/* Additions for the shared (logged-in) version of the hub. Same palette as styles.css. */

/* Pages without the quick-nav dock */
body.plain { padding-top: 0 }
a.brand { color: var(--ink); text-decoration: none }
header .account { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 14px }
header .account a { color: var(--ink) }
.link-button { background: none; color: inherit; border: 0; padding: 6px 4px; min-height: 40px; text-decoration: underline; text-underline-offset: 4px; font-size: 14px }
.narrow { max-width: 460px }
.select { width: 100%; padding: 12px; font: inherit; margin: 6px 0 16px; border: 1px solid var(--line); background: #fffdf8; min-height: 48px }
.library-card .tools a.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line) }
.library-card.inactive { opacity: .65 }
section[hidden] { display: none }

/* Expo banner tools (Edit brief / History / Library) */
.banner-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end }
.expo-banner .link-button { min-height: 40px }

/* Upload state on supplier cards */
.badge { display: inline-block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 30px; margin: 0 0 10px }
.badge-ok { background: #e3eadb; color: #3d5a2a }
.badge-wait { background: #f3e6c9; color: #6b4e14 }
.badge-error { background: #f2dcd7; color: #8a2f22; text-transform: none; letter-spacing: 0 }
.supplier-card.pending { border-style: dashed }

/* Brief editor */
main.editing { outline: 2px dashed var(--gold); outline-offset: 10px; padding-bottom: 220px }
main.editing:focus { outline-style: solid }
main.editing details > summary { cursor: text }
main.editing label.check { cursor: text }
body.is-editing .dock { display: none }
.editor-toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: #fbf8f1; border-top: 2px solid var(--gold);
  padding: 10px 12px max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -6px 20px #0001 }
.editor-tools, .editor-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 1000px; margin: 0 auto; width: 100% }
.editor-tools button { background: #eee6d7; color: var(--ink); border: 1px solid var(--line); min-height: 40px; padding: 6px 12px; font-size: 14px }
.editor-actions button { min-height: 44px; padding: 8px 16px; font-size: 15px; background: transparent; color: var(--ink); border: 1px solid var(--line) }
.editor-actions button.primary { background: var(--ink); color: var(--paper); border: 0 }
.editor-note { flex: 1 1 200px; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 15px; border: 1px solid var(--line); background: #fffdf8 }
.editor-status { font-size: 14px; color: #8a2f22; flex-basis: 100% }
.editor-toolbar.preview { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; font-size: 14px }

dialog.history { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 24px }
dialog.history::backdrop { background: #0005 }
dialog.history ol { padding-left: 20px; max-height: 55vh; overflow: auto }
dialog.history li { margin: 0 0 14px }

@media (max-width: 480px) {
  header .account .edition { display: none }
  .expo-banner { padding: 6px 16px; gap: 8px }
  .expo-banner #expo-name { flex: 1; min-width: 0 }
  .banner-tools { flex-wrap: nowrap; gap: 8px }
  .banner-tools a, .banner-tools .link-button { font-size: 12px; min-height: 36px; padding: 4px 0 }
  .editor-tools button { padding: 6px 9px; font-size: 13px }
}

/* Team page: role explanation cards side by side on wider screens */
.roles { display: grid; gap: 0 18px }
.roles ul { padding-left: 20px; margin: 10px 0 0 }
.roles li { margin: 6px 0 }
@media (min-width: 700px) { .roles { grid-template-columns: 1fr 1fr } }

/* Logo in the header (VEAUDRY International, from brand/) */
.brand { display: block; line-height: 0; letter-spacing: 0 }
.brand img { display: block; height: 34px; width: auto }
@media (max-width: 480px) { .brand img { height: 26px } }

/* ---------- Gallery ---------- */
.gallery-controls { position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 20px; max-width: 1000px; margin: 0 auto }
.segmented { display: inline-flex; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden }
.segmented button { background: transparent; color: var(--ink); border-radius: 0; min-height: 40px; padding: 6px 14px; font-size: 14px }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chips button { background: #fbf8f1; color: var(--ink); border: 1px solid var(--line); border-radius: 30px; min-height: 36px; padding: 4px 12px; font-size: 13px }
.chips button[aria-pressed="true"] { background: #e9e1d2; border-color: var(--gold) }
.chips button span { color: var(--muted); margin-left: 2px }
#gallery-search, #supplier-search { flex: 1 1 180px; min-height: 40px; padding: 6px 12px; font: inherit; font-size: 15px; border: 1px solid var(--line); background: #fffdf8; border-radius: 3px }

main.gallery { max-width: 1000px; padding-top: 10px }
.gallery-group { margin-top: 30px }
.gallery-head h2 { margin: 0 0 4px }
.gallery-head .note { margin: 0 0 12px }
.gallery-note { white-space: pre-wrap; margin: 0 0 12px; font-size: 15px; color: var(--muted) }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 0; background: transparent; color: var(--ink); border: 0; text-align: left; min-height: 0 }
.tile > img, .tile-video, .tile-voice { width: 100%; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #e9e1d2; position: relative }
.tile > img { object-fit: cover; display: block }
.tile-video video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #282923 }
.tile-badge { position: absolute; inset: auto 8px 8px auto; background: #282923cc; color: #fff; border-radius: 30px; padding: 2px 10px; font-size: 13px }
.tile-voice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(135deg, #e9e1d2, #d6cdbb); font-size: 14px }
.tile-voice-icon { font-size: 34px; line-height: 1 }
.tile-label { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tile:focus-visible > img, .tile:focus-visible > div { outline: 3px solid #876733; outline-offset: 2px }
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) } }

/* Full-screen viewer */
dialog.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #141410; color: #f5f0e6 }
dialog.viewer::backdrop { background: #000 }
dialog.viewer[open] { display: grid; grid-template-rows: auto 1fr auto }
.viewer-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 14px }
.viewer-top button { background: transparent; color: inherit; font-size: 22px; min-height: 44px; padding: 4px 12px }
.viewer-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 8px }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain }
.viewer-voice { display: flex; flex-direction: column; align-items: center; gap: 20px; width: min(420px, 100%) }
.viewer-voice .tile-voice-icon { font-size: 64px }
.viewer-voice audio { width: 100% }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); background: #0006; color: #fff; font-size: 34px; min-height: 64px; width: 48px; padding: 0; border-radius: 4px }
.viewer-nav.prev { left: 8px } .viewer-nav.next { right: 8px }
.viewer-nav:disabled { opacity: .15 }
.viewer-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); font-size: 14px; color: #d6cdbb }
.viewer-caption strong { color: #f5f0e6 }
.viewer-links { display: flex; gap: 16px }
.viewer-links a { color: #e9e1d2 }

/* Supplier card jumped to from the gallery */
.supplier-card.jumped-to { outline: 3px solid var(--gold); outline-offset: 4px }

/* Quick-nav dock: one row that scrolls sideways on narrow phones instead of wrapping */
.dock { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start }
.dock::-webkit-scrollbar { display: none }
.dock a { flex: 1 0 auto } /* spread out when there's room, never squash below the label */

/* Pages with the shared top bar: keep the gallery/supplier controls below it when scrolling */
.gallery-controls { top: 58px }
.dock a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 6px }
a.button-link { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 20px; background: var(--ink); color: var(--paper); text-decoration: none; border-radius: 3px }
a.card-title-link { color: inherit; text-decoration: none }
a.card-title-link:hover { text-decoration: underline; text-underline-offset: 5px }

/* ---------- Suppliers list ---------- */
main.supplier-index { padding-top: 6px }
.letter-group { margin-top: 26px }
h2.letter { font-size: 28px; margin: 0 0 8px; color: var(--gold) }
.supplier-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line) }
.supplier-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 88px }
.supplier-row:hover { background: #fbf8f1 }
.supplier-row img, .supplier-row-blank { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; background: #e9e1d2 }
.supplier-row-blank { display: flex; align-items: center; justify-content: center; font: 28px Georgia, serif; color: var(--gold) }
.supplier-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.supplier-row-text strong { font: normal 22px/1.25 Georgia, serif }
.supplier-row-text span { overflow-wrap: anywhere }
.supplier-row-text .note { font-size: 13px; margin: 0 }
.supplier-row-go { font-size: 28px; color: var(--muted); padding: 0 6px }

/* ---------- Supplier page ---------- */
.supplier-head { padding: 34px 0 10px }
.supplier-head h1 { font-size: clamp(36px, 7vw, 56px); margin: 10px 0 12px }
.supplier-contact { font-size: 18px; margin: 0 0 8px }
details.add-panel { border: 1px solid var(--line); background: #fbf8f1; margin: 22px 0 }
details.add-panel > summary { font-size: 18px }
details.add-panel .supplier-form { border: 0; border-top: 1px solid var(--line) }
.timeline { margin-top: 30px }
.timeline .day { margin-top: 24px }
.timeline .day > h3 { font: normal 24px Georgia, serif; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line) }
.visit { padding: 10px 0 18px }
.visit.pending { border: 1px dashed var(--line); padding: 14px; background: #fbf8f1 }
.visit-head { font-size: 14px; color: var(--muted); margin: 0 0 6px }
.visit-note { white-space: pre-wrap; margin: 0 0 10px }
.visit video, .visit audio { width: 100%; max-height: 300px; margin: 8px 0 }

/* ---------- Top bar: Brief / Gallery / Suppliers | brief sections ---------- */
.dock-divider { flex: 0 0 1px; align-self: stretch; margin: 8px 4px; background: var(--line) }
.dock a.dock-section { color: var(--muted) }

/* ---------- Suppliers page: Add supplier button + pop-up ---------- */
button.add-supplier { flex: 0 0 auto; min-height: 44px; padding: 8px 18px; font-weight: 600 }
.flash { background: #e3eadb; color: #3d5a2a; padding: 12px 16px; border-radius: 4px; margin: 14px 0 0 }
.supplier-row.pending { border-style: dashed; background: #fbf8f1; grid-template-columns: 64px 1fr }
.supplier-row.pending .badge { margin: 4px 0 0; align-self: flex-start }
.supplier-row.pending .tools { display: flex; gap: 8px; margin: 6px 0 0 }
.supplier-row.jumped-to { outline: 3px solid var(--gold); outline-offset: 2px }

dialog.sheet { width: min(640px, 100vw); max-width: 100vw; max-height: 92dvh; height: auto; margin: auto; padding: 0;
  border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); overflow: hidden }
dialog.sheet::backdrop { background: #0007 }
dialog.sheet[open] { display: flex; flex-direction: column }
.sheet-form { display: flex; flex-direction: column; min-height: 0; max-height: 92dvh }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fbf8f1 }
.sheet-head h2 { margin: 0; font-size: 26px }
.sheet-close { background: transparent; color: var(--ink); font-size: 22px; min-height: 44px; padding: 4px 10px }
.sheet-body { overflow-y: auto; flex: 1 1 auto; border: 0; margin: 0 }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: flex-end; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fbf8f1 }
.sheet-foot p { flex: 1 1 200px; margin: 0; font-size: 14px }
@media (max-width: 640px) {
  /* Full screen on phones, like a native "new item" sheet */
  dialog.sheet { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0 }
  .sheet-form { max-height: 100dvh; height: 100% }
}
button.danger { background: transparent; color: #8a2f22; border: 1px solid #d9b3ab }
