/* SANMMH Digital Guide — "SANMMH Look and Feel v1".
   DITSONG-family sub-brand: warm heritage colour, EB Garamond + Alegreya Sans,
   rules not boxes (2px ink rules, square corners), 56px taps, exhibit-first.
   Light (warm) by default; gallery mode (dark) via [data-theme] / prefers-color-scheme. */

:root {
  /* light / warm — default */
  --ink: #231C18;          /* text + 2px rules */
  --paper: #FBF8F4;        /* app surface */
  --parchment: #F3ECE4;    /* alt rows / fills */
  --board: #E9E2DA;        /* deepest page bg */
  --muted: #5F5F5F;
  --rule: #231C18;         /* strong 2px rule */
  --rule-soft: #DDD3C9;    /* hairline 1px rule */
  --accent: #C73D0E;       /* rust — primary action + labels */
  --accent-press: #9E2F0A;
  --ember: #7A2415;
  --flame: #E8700F;
  --amber: #F2A341;
  --on-accent: #FFFFFF;
  --player: #0E0B09;       /* always-dark video + scanner surface */
  --player-ink: #F4EDE6;
  --player-muted: #8A7F76;
  --player-rule: #4A3F38;
  --player-accent: #EE8434;
  --ok: #2F7D4A; --warn: #8A5300; --err: #A8231B; --info: #2F5E8C;

  --tap: 56px;
  --maxw: 560px;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Segoe UI", Roboto, system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --ink: #F4EDE6;
  --paper: #17120F;
  --parchment: #231C18;
  --board: #0E0B09;
  --muted: #B5A99F;
  --rule: #4A3F38;
  --rule-soft: #3A312B;
  --accent: #EE8434;        /* flame accent on dark */
  --accent-press: #E8700F;
  --on-accent: #17120F;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F4EDE6; --paper: #17120F; --parchment: #231C18; --board: #0E0B09;
    --muted: #B5A99F; --rule: #4A3F38; --rule-soft: #3A312B;
    --accent: #EE8434; --accent-press: #E8700F; --on-accent: #17120F;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Base font size drives all rem sizes — the text-size control scales this. */
:root { font-size: 16px; }
:root[data-text="large"] { font-size: 18px; }
:root[data-text="xl"] { font-size: 20px; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--board);
  font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
button { font-family: inherit; cursor: pointer; color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; margin: 0; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75;
      stroke-linecap: square; stroke-linejoin: miter; display: block; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* serif caps label used throughout */
.kicker {
  font-family: var(--serif); font-size: .9rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .5rem;
  height: 64px; padding: 0 1rem; padding-top: env(safe-area-inset-top);
  background: var(--paper); border-bottom: 2px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .55rem; margin-right: auto; text-decoration: none; color: inherit; }
.brand__mark { width: 30px; height: 30px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .14em; }
.brand__sub { font-size: .62rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin-top: 2px; }
.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: none; color: var(--ink);
}
.iconbtn:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.langchip {
  height: 44px; padding: 0 .7rem; display: flex; align-items: center; gap: .35rem;
  border: 2px solid var(--rule); background: transparent; color: var(--ink);
  font-weight: 700; font-size: .95rem;
}
.langchip .ic { width: 20px; height: 20px; }

/* ---------- Layout ---------- */
.app { max-width: var(--maxw); margin: 0 auto; background: var(--paper); min-height: calc(100% - 64px); }
.view { animation: fade .22s ease; padding-bottom: 104px; }  /* room for fixed action bar */
.view--flush { padding-bottom: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- Fixed primary action bar ---------- */
.actionbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--maxw); z-index: 15;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 2px solid var(--rule);
}
.action {
  height: 60px; width: 100%; display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem; font-size: 1.15rem; font-weight: 700;
  background: var(--accent); color: var(--on-accent); border: none;
}
.action:active { background: var(--accent-press); }
.action .ic { width: 26px; height: 26px; color: currentColor; }
.action .ic--end { margin-left: auto; }

/* ---------- Home ---------- */
/* Official DITSONG endorsement strip — the museum's real logo on a light chip so it
   reads on both the warm and gallery (dark) grounds; the flame stays as the app icon. */
.cobrand {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1.25rem; text-decoration: none;
  border-bottom: 1px solid var(--rule-soft); background: var(--parchment);
}
.cobrand__chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1px solid var(--rule-soft); border-radius: 6px;
  padding: 5px 8px; flex: none;
}
.cobrand__chip img { display: block; height: 22px; width: auto; }
.cobrand__t {
  font-family: var(--sans); font-size: .76rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.cobrand__t strong { color: var(--ink); font-weight: 800; }
.hero { padding: 1.75rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .85rem; }
.hero__title { font-size: 2.5rem; line-height: 1.06; text-wrap: pretty; }
.hero__lede { font-size: 1.2rem; line-height: 1.45; color: var(--muted); }

.howto { display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
         border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); }
.howto__cell { padding: 1rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.howto__cell + .howto__cell { border-left: 2px solid var(--rule); }
.howto__cell .ic { width: 28px; height: 28px; color: var(--accent); }
.howto__cell span { font-size: 1rem; font-weight: 700; line-height: 1.2; }

.section-label { padding: 1rem 1.25rem .5rem; font-size: .8rem; font-weight: 700;
                 letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.rowlist { display: flex; flex-direction: column; }
.row {
  height: var(--tap); flex: none; width: 100%;
  padding: 0 1.25rem; display: flex; align-items: center; gap: .9rem;
  border-top: 1px solid var(--rule-soft); background: transparent; text-align: left;
}
.row:first-child { border-top: none; }
.row:active { background: var(--parchment); }
.row__num { font-family: var(--serif); font-size: 1.3rem; width: 28px; flex: none; color: var(--accent); }
.row__title { font-size: 1.12rem; font-weight: 500; flex: 1; min-width: 0; }
.row__meta { font-size: .95rem; color: var(--muted); }
.row .ic { color: var(--ink); }

/* ---------- Scanner (always dark) ---------- */
.scanner { background: var(--player); color: var(--player-ink); min-height: calc(100vh - 64px);
           display: flex; flex-direction: column; }
.scanner__head { height: 56px; display: flex; align-items: center; gap: .25rem; padding: 0 .5rem; }
.scanner__head .iconbtn { color: var(--player-ink); }
.scanner__head h2 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; }
#qrreader { flex: 1; min-height: 320px; position: relative; background: #2A2420; overflow: hidden; }
#qrreader video { width: 100% !important; height: 100% !important; object-fit: cover; }
/* viewfinder overlay (amber brackets) drawn over the live camera */
.viewfinder { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.viewfinder__box { width: 240px; height: 240px; position: relative; }
.viewfinder__box i { position: absolute; width: 44px; height: 44px; border: 4px solid var(--amber); }
.viewfinder__box i:nth-child(1){ left:0; top:0; border-right:0; border-bottom:0; }
.viewfinder__box i:nth-child(2){ right:0; top:0; border-left:0; border-bottom:0; }
.viewfinder__box i:nth-child(3){ left:0; bottom:0; border-right:0; border-top:0; }
.viewfinder__box i:nth-child(4){ right:0; bottom:0; border-left:0; border-top:0; }
.viewfinder__line { position: absolute; left: 20px; right: 20px; top: 50%; height: 2px; background: var(--amber); opacity: .6; }
.scanner__foot { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
                 display: flex; flex-direction: column; gap: .9rem;
                 border-top: 2px solid var(--player-rule); background: #17120F; }
.scanner__foot .lead { font-family: var(--serif); font-size: 1.6rem; line-height: 1.15; }
.scanner__err { padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem;
                border-top: 2px solid var(--player-rule); background: #17120F; }
.scanner__err .lead { font-family: var(--serif); font-size: 1.6rem; line-height: 1.15; }
.scanner__err p { margin: 0; color: var(--player-muted); font-size: 1rem; }
.btn-onDark { height: var(--tap); border: 2px solid var(--player-ink); background: transparent;
              color: var(--player-ink); display: flex; align-items: center; gap: .75rem;
              padding: 0 1.1rem; font-size: 1.1rem; font-weight: 700; width: 100%; }
.btn-onDark .ic { color: currentColor; }

/* ---------- Exhibit / player ---------- */
.player { background: var(--player); color: var(--player-ink); }
.player__head { height: 56px; display: flex; align-items: center; gap: .25rem; padding: 0 .5rem 0 0; }
.player__head .iconbtn { color: var(--player-ink); }
.player__count { font-size: 1rem; font-weight: 700; letter-spacing: .08em; }
.player__count b { color: var(--player-muted); font-weight: 500; }
.player__video { width: 100%; max-height: 56vh; background: #000; display: block; }

.ex__head { padding: 1.35rem 1.25rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.ex__title { font-size: 2.1rem; line-height: 1.08; }
.ex__meta { font-size: 1rem; color: var(--muted); }

.controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 2px solid var(--rule); }
.ctrl {
  height: 72px; padding: 0 1rem; display: flex; align-items: center; gap: .65rem;
  background: transparent; border: none; border-bottom: 2px solid var(--rule); text-align: left; color: inherit;
}
.ctrl:nth-child(odd) { border-right: 2px solid var(--rule); }
.ctrl--fill { background: var(--parchment); }
.ctrl .ic { width: 26px; height: 26px; color: var(--ink); }
.ctrl__text { display: flex; flex-direction: column; line-height: 1.15; }
.ctrl__text b { font-size: 1.05rem; font-weight: 700; }
.ctrl__text small { font-size: .9rem; color: var(--muted); }
.ctrl--yt .ic { color: var(--accent); }

.ex__blurb { padding: 1.1rem 1.25rem; font-size: 1.12rem; line-height: 1.5; text-wrap: pretty; }
.ex__cap { padding: 0 1.25rem 1.1rem; font-size: .9rem; color: var(--muted); }

/* ---------- Language sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, #0E0B09 55%, transparent); }
.sheet__panel {
  position: relative; width: 100%; max-width: var(--maxw); margin: 0 auto;
  background: var(--paper); border-top: 2px solid var(--rule);
  max-height: 85vh; overflow: auto; animation: slideup .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grab { width: 48px; height: 4px; background: var(--ink); margin: .7rem 1.25rem 0; }
.sheet__header { padding: 1.1rem 1.25rem 1rem; border-bottom: 2px solid var(--rule); }
.sheet__header h2 { font-size: 1.85rem; }
.sheet__note { margin: .25rem 0 0; color: var(--muted); font-size: 1rem; }
.langgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.langopt {
  height: 60px; padding: 0 1rem; display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid var(--rule-soft); border-right: 1px solid var(--rule-soft);
  background: transparent; text-align: left; color: inherit;
}
.langopt__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.langopt__name { font-size: 1.1rem; font-weight: 700; }
.langopt__sub { font-size: .82rem; color: var(--muted); }
.langopt[aria-pressed="true"] { background: var(--parchment); box-shadow: inset 0 0 0 2px var(--accent); }
.langopt[aria-pressed="true"] .langopt__name { color: var(--accent); }
.langopt:disabled { opacity: .45; }
.langopt .ic { color: var(--accent); stroke-width: 2.25; }
.sheet__foot { padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); }

/* ---------- Buttons ---------- */
.btn { height: var(--tap); display: flex; align-items: center; gap: .7rem; padding: 0 1.1rem;
       font-size: 1.1rem; font-weight: 700; border: none; width: 100%; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:active { background: var(--accent-press); }
.btn--secondary { background: transparent; border: 2px solid var(--rule); color: var(--ink); }
.btn--secondary:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: .7rem; z-index: 60;
  background: var(--ink); color: var(--paper); padding: .85rem 1rem; min-width: 220px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast::before { content: ""; width: 10px; height: 10px; background: var(--amber); flex: none; }
.toast.show { opacity: 1; }

/* ---------- Offline / not-found ---------- */
.notice { padding: 3rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; border-bottom: 2px solid var(--rule); }
.notice .ic { width: 48px; height: 48px; color: var(--amber); }
.notice h1 { font-size: 2.2rem; line-height: 1.08; }
.notice p { margin: 0; font-size: 1.15rem; color: var(--muted); line-height: 1.45; }

.footer-note { padding: 1.5rem 1.25rem; font-size: .85rem; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--rule-soft); }
.footer-note .langchip { display: inline-flex; height: 28px; vertical-align: middle; }

/* ---------- Custom video player (large, consistent controls) ---------- */
.vplayer { position: relative; background: #000; }
.vplayer__video { width: 100%; max-height: 56vh; display: block; background: #000; }
.vplayer__big {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: color-mix(in srgb, #000 20%, transparent); border: none; color: #fff; width: 100%;
}
.vplayer__big span {
  width: 84px; height: 84px; display: grid; place-items: center;
  background: var(--player-accent); color: #0E0B09;
}
.vplayer__big .ic { width: 40px; height: 40px; color: currentColor; stroke-width: 2; }
.vplayer.is-playing .vplayer__big { display: none; }
.vplayer__bar {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem;
  background: var(--player); color: var(--player-ink);
}
.vplayer__btn { width: 48px; height: 48px; display: grid; place-items: center; background: transparent; border: none; color: var(--player-ink); }
.vplayer__btn .ic { color: currentColor; stroke-width: 2; }
.vplayer__time { font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--player-ink); min-width: 92px; text-align: right; }
.vplayer__seek { -webkit-appearance: none; appearance: none; flex: 1; height: 24px; background: transparent; cursor: pointer; }
.vplayer__seek::-webkit-slider-runnable-track { height: 6px; background: var(--player-rule); }
.vplayer__seek::-moz-range-track { height: 6px; background: var(--player-rule); }
.vplayer__seek::-moz-range-progress { height: 6px; background: var(--player-accent); }
.vplayer__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; background: #fff; border: 3px solid var(--player-accent); border-radius: 50%; }
.vplayer__seek::-moz-range-thumb { width: 20px; height: 20px; background: #fff; border: 3px solid var(--player-accent); border-radius: 50%; }
.vplayer__seek:focus-visible { outline: 3px solid var(--player-accent); outline-offset: 3px; }
/* captions sit above the control bar */
.vplayer__video::cue { background: rgba(14,11,9,.85); color: #fff; font-family: var(--sans); font-size: 1rem; }

/* ---------- Control on/off clarity ---------- */
.ctrl { transition: background .15s; }
.ctrl.is-on { }
.ctrl.is-off .ctrl__text b, .ctrl.is-off .ic { color: var(--muted); }
.ctrl.is-on .ic { color: var(--accent); }
.ctrl__state { display: inline-flex; align-items: center; gap: .3rem; }
.ctrl__dot { width: 8px; height: 8px; flex: none; background: var(--accent); }
.ctrl.is-off .ctrl__dot { background: var(--muted); }

/* ---------- Row chevron ---------- */
.row__go { color: var(--muted); }
.row__go .ic { width: 20px; height: 20px; }

/* ---------- Segmented control + settings ---------- */
.setblock { padding: 1.1rem 1.25rem; border-bottom: 2px solid var(--rule); }
.setblock__label { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.setblock__hint { margin: .6rem 0 0; font-size: .95rem; color: var(--muted); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--rule); }
.seg__opt {
  min-height: 52px; display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: transparent; border: none; color: var(--ink); font-size: 1rem; font-weight: 700; padding: 0 .4rem;
}
.seg__opt + .seg__opt { border-left: 2px solid var(--rule); }
.seg__opt .ic { width: 20px; height: 20px; }
.seg__opt[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg__opt:not([aria-pressed="true"]):active { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skiplink {
  position: fixed; top: -60px; left: 1rem; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .7rem 1rem; font-weight: 700;
  transition: top .15s;
}
.skiplink:focus { top: calc(.5rem + env(safe-area-inset-top)); }

/* ---------- First-run welcome ---------- */
.overlay { position: fixed; inset: 0; z-index: 70; background: var(--paper); display: flex; }
.overlay[hidden] { display: none; }
.overlay__card {
  margin: auto; width: 100%; max-width: var(--maxw); padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 1.1rem; min-height: 100%;
}
.overlay__mark { width: 60px; height: 60px; }
.overlay__card h1 { font-size: 2.3rem; line-height: 1.1; }
.overlay__list { display: flex; flex-direction: column; border-top: 2px solid var(--rule); margin-top: .25rem; }
.ostep { display: flex; gap: .9rem; align-items: center; padding: 1rem 0; border-bottom: 2px solid var(--rule); }
.ostep__n { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); width: 32px; flex: none; }
.ostep .ic { width: 30px; height: 30px; color: var(--accent); flex: none; }
.ostep span { font-size: 1.1rem; font-weight: 500; }
.overlay__card .btn--primary { margin-top: auto; }
.overlay__skip { background: none; border: none; color: var(--muted); font-size: 1rem; font-weight: 700; padding: .5rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: #0E0B09; display: grid; place-items: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; }
.lightbox__close { position: absolute; top: calc(.6rem + env(safe-area-inset-top)); right: .8rem; width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: none; color: #fff; }
.lightbox__close .ic { stroke: #fff; stroke-width: 2; }
.lightbox__cap { position: absolute; left: 0; right: 0; bottom: calc(1rem + env(safe-area-inset-bottom)); text-align: center; color: #B5A99F; font-size: .9rem; }

/* ---------- Skeleton / loading ---------- */
.vplayer__load { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--player-accent); border-radius: 50%; animation: spin 1s linear infinite; }
.vplayer.is-ready .vplayer__load, .vplayer.is-playing .vplayer__load { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--parchment) 25%, color-mix(in srgb, var(--ink) 6%, var(--parchment)) 37%, var(--parchment) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-row { height: var(--tap); border-top: 1px solid var(--rule-soft); }

/* ---------- Scan success ---------- */
.scan-ok { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, #2F7D4A 55%, transparent); z-index: 5; }
.scan-ok span { width: 96px; height: 96px; display: grid; place-items: center; background: #2F7D4A; color: #fff; animation: pop .3s ease; }
.scan-ok .ic { width: 52px; height: 52px; stroke: #fff; stroke-width: 2.5; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Exhibit sub-sections (specs / gallery / related) ---------- */
.ex-section { border-top: 2px solid var(--rule); }
.ex-section__h { padding: 1.1rem 1.25rem .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.specs { padding: 0 1.25rem 1rem; }
.specs__row { display: flex; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--rule-soft); }
.specs__row:first-child { border-top: none; }
.specs__k { flex: none; width: 38%; color: var(--muted); font-size: 1rem; }
.specs__v { font-weight: 500; font-size: 1.05rem; }
.gallery { display: flex; gap: .7rem; overflow-x: auto; padding: .3rem 1.25rem 1.25rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.gallery__item { flex: none; width: 240px; scroll-snap-align: start; border: 2px solid var(--rule); background: transparent; padding: 0; }
.gallery__item img { width: 240px; height: 172px; object-fit: cover; display: block; }
.gallery__cap { font-size: .8rem; color: var(--muted); padding: .4rem .5rem; text-align: left; }

/* ---------- Viewed state + progress ---------- */
.row__check { color: var(--ok); }
.row__check .ic { width: 22px; height: 22px; stroke: var(--ok); stroke-width: 2.5; }
.row.is-viewed .row__num { color: var(--muted); }
.progress { padding: .9rem 1.25rem; display: flex; align-items: center; gap: .8rem; border-top: 1px solid var(--rule-soft); }
.progress__bar { flex: 1; height: 8px; background: var(--parchment); border: 1px solid var(--rule-soft); }
.progress__fill { height: 100%; background: var(--accent); width: 0; transition: width .4s ease; }
.progress__txt { font-size: .9rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ---------- Camera priming ---------- */
.prime { padding: 2.5rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; min-height: calc(100vh - 64px); }
.prime__mark { width: 56px; height: 56px; }
.prime h1 { font-size: 2.2rem; line-height: 1.1; }
.prime p { margin: 0; font-size: 1.2rem; line-height: 1.5; color: var(--muted); }
.prime__spacer { flex: 1; }
.prime .btn { margin-top: .5rem; }
.prime .reassure { display: flex; align-items: center; gap: .6rem; font-size: 1rem; color: var(--muted); }
.prime .reassure .ic { width: 22px; height: 22px; color: var(--accent); }

/* ---------- Rate this exhibit ---------- */
.rate { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.rate__star {
  background: none; border: none; padding: .2rem; cursor: pointer; line-height: 0;
  color: var(--rule-soft); transition: transform .08s ease;
}
.rate__star:hover { transform: scale(1.12); }
.rate__ic { width: 38px; height: 38px; }
.rate__star.is-on { color: var(--amber); }
.rate__hint { margin-left: .5rem; font-size: .95rem; color: var(--muted); }

/* ---------- Manager insights dashboard ---------- */
.staff-link {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 1.25rem 1.5rem;
  font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none;
  letter-spacing: .02em;
}
.staff-link .ic { width: 18px; height: 18px; color: var(--accent); }
.staff-link:hover { color: var(--accent); }
body.is-dash .app { max-width: 1040px; }

.view--dash { padding: 1.25rem 1.25rem 3rem; }
.dash__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.dash__title { font-size: 2.1rem; line-height: 1.05; margin: .1rem 0 0; }
.dash__sub { font-size: .95rem; color: var(--muted); margin-top: .35rem; }
.dash__back { white-space: nowrap; width: auto; flex: 0 0 auto; align-self: flex-start; padding: .6rem 1.1rem; min-width: 0; }
.dash__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; margin-bottom: .95rem; }
.kpi { background: var(--parchment); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 1rem; }
.kpi__n { font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--ink); line-height: 1; }
.kpi__l { font-size: .85rem; color: var(--muted); margin-top: .35rem; letter-spacing: .02em; }
.dash__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .95rem; }
.dcard { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 1.1rem 1.2rem; }
.dcard__h {
  font-family: var(--serif); font-weight: 600; font-size: .78rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .9rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.dbar { display: grid; grid-template-columns: 1fr 42% auto; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.dbar__l { font-size: .95rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbar__track { height: 10px; background: var(--board); border-radius: 6px; overflow: hidden; }
.dbar__fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.dbar__v { font-size: .9rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }
.drate { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.drate__l { font-size: .95rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drate__stars { display: inline-flex; gap: 1px; }
.drate__ic { width: 17px; height: 17px; color: var(--rule-soft); }
.drate__ic.is-on { color: var(--amber); }
.drate__v { font-size: .9rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dstat { font-size: 1rem; color: var(--ink); padding: .3rem 0; border-bottom: 1px solid var(--rule-soft); }
.dstat:last-child { border-bottom: none; }
.dstat b { font-family: var(--serif); color: var(--accent); margin-right: .4rem; }
.dcard--optin { margin-top: .95rem; background: var(--parchment); }
.dcard__p { margin: 0; font-size: .95rem; color: var(--muted); line-height: 1.5; }
.dpill {
  font-family: var(--sans); font-weight: 700; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--board); border-radius: 999px; padding: .2rem .6rem;
}
.dash__note { font-size: .85rem; color: var(--muted); line-height: 1.5; margin: 1.1rem 0 0; }
@media (max-width: 640px) {
  .dash__kpis { grid-template-columns: repeat(2, 1fr); }
  .dash__grid { grid-template-columns: 1fr; }
  .dash__head { flex-direction: column; align-items: flex-start; }
}
