/* Picture Plane
   Concept: the screen is a gallery wall. Each work is hung at its true proportions with a museum
   wall label beneath it, and the wall takes a quiet tint of the work's own dominant hue, the way
   curators paint walls for a hang. Everything else stays out of the way.
   Type: Newsreader for titles (italic for artwork titles, as on real labels); Schibsted Grotesk for interface. */

:root {
  --wh: 220; --ws: 8%;                       /* wall hue and saturation, set per artwork */
  --wall: hsl(var(--wh) var(--ws) 90%);
  --wall-deep: hsl(var(--wh) calc(var(--ws) + 2%) 84%);
  --paper: #fbfbf9;
  --ink: #16181b;
  --ink-2: #555a61;
  --line: rgba(22, 24, 27, 0.14);
  --chip: rgba(255, 255, 255, 0.72);
  --keep: #23744f;
  --pass: #b0402f;
  --gilt: #9a7428;
  --focus: #2f5fd0;
  --land: #e6e0d2; --fog: #dad6cd; --fogline: rgba(22,24,27,.09);
  --emb-fill: #efece5; --emb-hi: rgba(255,255,255,.95); --emb-lo: rgba(22,24,27,.24);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --shadow-art: 0 1px 1px rgba(0,0,0,.18), 0 6px 14px -6px rgba(0,0,0,.35), 0 28px 50px -24px rgba(0,0,0,.55);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: hsl(var(--wh) var(--ws) 15%);
    --wall-deep: hsl(var(--wh) calc(var(--ws) + 2%) 11%);
    --paper: #1d2024;
    --ink: #eceae4;
    --ink-2: #a7abb1;
    --line: rgba(236, 234, 228, 0.16);
    --chip: rgba(255, 255, 255, 0.08);
    --keep: #5fbf8e;
    --pass: #e2806f;
    --gilt: #d3ad62;
    --focus: #8fb0ff;
    --land: #3b3c38; --fog: #2a2d31; --fogline: rgba(236,234,228,.07);
    --emb-fill: #2a2d31; --emb-hi: rgba(255,255,255,.10); --emb-lo: rgba(0,0,0,.55);
    --shadow-art: 0 1px 1px rgba(0,0,0,.5), 0 10px 22px -8px rgba(0,0,0,.65), 0 34px 60px -26px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: hsl(var(--wh) var(--ws) 15%); --wall-deep: hsl(var(--wh) calc(var(--ws) + 2%) 11%);
  --paper: #1d2024; --ink: #eceae4; --ink-2: #a7abb1; --line: rgba(236,234,228,.16); --chip: rgba(255,255,255,.08);
  --keep: #5fbf8e; --pass: #e2806f; --gilt: #d3ad62; --focus: #8fb0ff; color-scheme: dark;
  --emb-fill: #2a2d31; --emb-hi: rgba(255,255,255,.10); --emb-lo: rgba(0,0,0,.55);
  --land: #3b3c38; --fog: #2a2d31; --fogline: rgba(236,234,228,.07);
}

* { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior-x: none; }   /* sideways swipes stay in the app instead of becoming Back/Forward */
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color .7s ease;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
cite { font-style: italic; }
a { color: inherit; text-underline-offset: 3px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: var(--paper); padding: 8px 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 6px; }
.wordmark { margin: 0; display: flex; align-items: center; gap: 9px; font: 500 21px/1 var(--serif); letter-spacing: -0.01em; }
.mark { width: 17px; height: 20px; position: relative; display: inline-block; }
.mark::before { content: ""; position: absolute; left: 0; top: 0; width: 17px; height: 14px; background: var(--gilt); box-shadow: inset 0 0 0 1.5px currentColor; }
.mark::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 7px; height: 2.5px; background: currentColor; }
.topright { display: flex; align-items: center; gap: 8px; min-width: 0; }
.savechip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: none; color: var(--ink-2); padding: 7px 11px; border-radius: 999px; font: 500 12.5px/1 var(--sans); white-space: nowrap; }
.savechip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn, #c4572e); }
.savechip[hidden] { display: none; }
.savechip.pulse { animation: savePulse 1.4s ease 1.2s 1; }
@keyframes savePulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 40% { box-shadow: 0 0 0 6px var(--chip); } }
@media (max-width: 380px) { .topbar:has(.savechip:not([hidden])) .wtext { display: none; } }   /* room for the chip on small phones; the mark stays */
.consent { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.consent .toggle { padding: 4px 0; }
.levelchip { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--chip); padding: 4px 12px 4px 5px; border-radius: 999px; font: 500 13.5px/1 var(--sans); }
.levelchip svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.levelchip circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--line); }
.ring { stroke: var(--gilt); stroke-linecap: round; transition: stroke-dasharray .6s ease; }

main { min-height: 0; min-width: 0; position: relative; }
.view { height: 100%; min-width: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }   /* never wider than the screen; wide pieces scroll inside themselves */
.view.look { display: flex; flex-direction: column; overflow: hidden; padding: 0 16px; }

/* ---------- the wall ---------- */
.stage-wrap { position: relative; flex: 1; min-height: 0; }
.stage { position: absolute; inset: 0; }
.card {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px;
  touch-action: none; user-select: none; -webkit-user-select: none; will-change: transform;
  transition: transform .36s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
.card.dragging { transition: none; cursor: grabbing; }
.card.next { opacity: 0; pointer-events: none; }
.card.next .plate { visibility: hidden; }
.hang { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.work { display: block; max-width: 100%; max-height: 100%; box-shadow: var(--shadow-art); opacity: 0; transition: opacity .45s ease; background: var(--wall-deep); -webkit-user-drag: none; }
.card.loaded .work { opacity: 1; }
.plate { display: grid; gap: 10px; max-width: 34rem; padding-bottom: 4px; }
.label p { margin: 0; }
.label .who { font: 600 15px/1.3 var(--sans); }
.label .bio { font-size: 13px; color: var(--ink-2); }
.label .what { font: 400 19px/1.3 var(--serif); margin-top: 3px; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.label .med { font-size: 13px; color: var(--ink-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.label .src { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.cue { border-top: 1px solid var(--line); padding-top: 9px; font-size: 13.5px; line-height: 1.45; }
.cue p { margin: 0; }
.cue .sub { color: var(--ink-2); margin-top: 2px; }
.cue-seed p:first-child { color: var(--gilt); font-weight: 500; }
.cue-match p:first-child { color: var(--keep); font-weight: 500; }
.cue-unsure p:first-child, .cue-explore p:first-child, .cue-look p:first-child { color: var(--ink-2); font-weight: 500; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; color: var(--ink-2); padding: 24px; }
.empty p { max-width: 30ch; margin: 0 auto; }

/* Feedback at the edges of the wall while dragging */
.edge { position: absolute; z-index: 3; pointer-events: none; opacity: 0; display: grid; place-items: center; transition: opacity .12s; }
.edge span { font: 600 13px/1 var(--sans); letter-spacing: .02em; padding: 7px 12px; border-radius: 999px; background: var(--paper); box-shadow: 0 6px 18px -8px rgba(0,0,0,.4); }
#edge-keep { right: -16px; top: 0; bottom: 0; width: 34%; background: linear-gradient(to left, color-mix(in srgb, var(--keep) 30%, transparent), transparent); }
#edge-keep span { color: var(--keep); justify-self: end; margin-right: 22px; }
#edge-pass { left: -16px; top: 0; bottom: 0; width: 34%; background: linear-gradient(to right, color-mix(in srgb, var(--pass) 30%, transparent), transparent); }
#edge-pass span { color: var(--pass); justify-self: start; margin-left: 22px; }
#edge-love { left: -16px; right: -16px; top: 0; height: 30%; background: linear-gradient(to bottom, color-mix(in srgb, var(--gilt) 34%, transparent), transparent); align-items: start; }
#edge-love span { color: var(--gilt); margin-top: 14px; }
#edge-later { left: -16px; right: -16px; bottom: 0; height: 30%; background: linear-gradient(to top, color-mix(in srgb, var(--ink-2) 26%, transparent), transparent); align-items: end; }
#edge-later span { color: var(--ink-2); margin-bottom: 14px; }

/* ---------- controls ---------- */
.controls { display: flex; justify-content: center; align-items: center; gap: clamp(8px, 3.4vw, 18px); padding-top: 12px; }
.ctl { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip); display: grid; place-items: center; transition: transform .12s, background-color .2s; backdrop-filter: blur(6px); }
.ctl svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl:active { transform: scale(.92); }
.ctl.ghost { width: 42px; height: 42px; color: var(--ink-2); }
.ctl.ghost svg { width: 19px; height: 19px; }
.ctl.pass { color: var(--pass); } .ctl.keep { color: var(--keep); } .ctl.later { color: var(--ink-2); }
.ctl.love { color: var(--gilt); } .ctl.love svg { fill: currentColor; stroke-width: 1.2; }
.ctl:disabled { opacity: .35; cursor: default; }
.aux { display: flex; justify-content: center; padding: 6px 0 8px; }
.textbtn { border: 0; background: none; color: var(--ink-2); font: 500 13.5px/1 var(--sans); padding: 8px 12px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }

.why { position: absolute; left: 16px; right: 16px; bottom: 132px; z-index: 6; margin: 0 auto; max-width: 30rem; background: var(--paper); border-radius: 14px; padding: 12px 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); animation: rise .25s ease; }
.why p { margin: 0 0 8px; font-weight: 500; font-size: 14px; }
.why-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.card.held .work { box-shadow: 0 0 0 3px var(--gilt), var(--shadow-art); transition: box-shadow .25s ease, opacity .45s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

.nudge { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--chip); }

/* ---------- tab bar ---------- */
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); background: color-mix(in srgb, var(--wall) 86%, var(--ink) 4%); }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; font: 500 11.5px/1 var(--sans); color: var(--ink-2); }
.tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--ink); }

/* ---------- pages ---------- */
.page { max-width: 40rem; margin: 0 auto; padding: 8px 16px 40px; }
.display { font: 500 44px/1.05 var(--serif); letter-spacing: -0.02em; margin: 0 0 8px; text-wrap: balance; }
.display.small { font-size: 34px; margin: 6px 0 14px; }
.kicker { margin: 10px 0 2px; color: var(--ink-2); font-size: 14px; }
.lede { font: 400 18px/1.45 var(--serif); margin: 6px 0 10px; }
h2 { font: 600 17px/1.3 var(--sans); margin: 30px 0 10px; }
h3 { font: 600 14.5px/1.3 var(--sans); margin: 0 0 8px; }
.needs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.needs li { display: grid; gap: 4px; font-size: 14px; }
.needs li.done span:first-child { color: var(--keep); }
.meter { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gilt); border-radius: 2px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: 14px; margin: 14px 0 0; }
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tone { font-size: 13.5px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
select, textarea, input[type=file] { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
textarea { width: 100%; min-height: 84px; font-size: 12.5px; }
.note { background: var(--paper); border-radius: 4px; padding: 18px 20px; box-shadow: 0 1px 0 var(--line), 0 14px 30px -22px rgba(0,0,0,.45); margin: 4px 0 12px; }
.note h3 { font: 500 20px/1.25 var(--serif); margin-bottom: 6px; }
.note p { margin: 0; font: 400 17px/1.55 var(--serif); }
.note .note-meta { font: 400 12.5px/1.4 var(--sans); color: var(--ink-2); margin-top: 10px; }
.note.small h3 { font-size: 17px; } .note.small p { font-size: 15.5px; }
.past summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin: 8px 0; }
/* ---------- Taste: jump bar, portrait, badge cabinet ---------- */
.jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; justify-content: center; padding: 8px 10px; background: var(--wall); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: 0 1 7rem; min-width: 0; text-align: center; padding: 7px 8px; border-radius: 999px; font: 500 13px/1 var(--sans); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.jump a[aria-current] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.tsec { padding-top: 6px; scroll-margin-top: 52px; }
#view-taste .page { padding-bottom: 30vh; }   /* room for the last sections to reach the top */
.tsec + .tsec { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.sech { font: 500 28px/1.15 var(--serif); margin: 6px 0 6px; }
.small { font-size: 13px; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.trait { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 3px 12px 3px 3px; font: 500 13.5px/1 var(--sans); color: var(--ink); }
.trait svg { width: 28px; height: 28px; }
.level { margin-top: 14px; }
.level .kicker b { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.tiles div { background: var(--paper); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; box-shadow: 0 1px 0 var(--line); }
.tiles b { font: 600 22px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.tiles span { font-size: 12.5px; color: var(--ink-2); }
.pattern { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.pattern span { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); }
.appknows { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.appknows h2 { margin: 0 0 8px; }
.appknows .small { margin: 8px 0; }
.drift { border-left: 3px solid var(--gilt); padding-left: 10px; }
.rungs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.rungs span { font-size: 10.5px; text-align: center; padding: 6px 0 0; border-top: 4px solid var(--line); color: var(--ink-2); }
.rungs span.on { border-top-color: var(--keep); }
.rungs span.cur { color: var(--ink); font-weight: 600; }
.callit { display: flex; gap: 3px; margin: 2px 0 6px; }
.callit i { flex: 1; height: 8px; border-radius: 2px; background: var(--line); }
.callit i.hit { background: var(--keep); }
.nextup { display: grid; gap: 8px; margin: 4px 0 8px; }
.next { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 12px 8px 8px; color: var(--ink); font: inherit; }
.next svg { width: 48px; height: 48px; }
.next b { font-weight: 600; font-size: 14.5px; display: block; }
.next small { display: block; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 5px; }
.family { margin: 22px 0 8px; }
.family h3 { font: 500 20px/1.2 var(--serif); margin: 0; }
.family h3 small { font: 400 12.5px/1 var(--sans); color: var(--ink-2); margin-left: 6px; }
.family > p { margin: 2px 0 10px; }
.cabinet { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 12px 8px; }
.pin { position: relative; display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 2px; font: 500 11.5px/1.2 var(--sans); color: var(--ink); text-align: center; border-radius: 12px; }
.pin svg { width: 64px; height: 64px; }
.pin.locked span, .pin.secret span { color: var(--ink-2); }
.pin:focus-visible, .next:focus-visible, .trait:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sealdot { position: absolute; top: 44px; right: calc(50% - 32px); width: 14px; height: 14px; border-radius: 50%; background: #8e2a20; box-shadow: 0 0 0 2px var(--wall); }
.pinart.locked .pinbody { opacity: .3; filter: saturate(.55); }
.pinart.sealed .pinbody { opacity: .55; }
.emb-fill { fill: var(--emb-fill); } .emb-hi { stroke: var(--emb-hi); } .emb-lo { stroke: var(--emb-lo); }
.pinhead { display: grid; place-items: center; }
.pinhead svg { width: 132px; height: 132px; }
.pinrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px 6px; }
.pinrow figure { margin: 0; display: grid; justify-items: center; gap: 3px; font-size: 11.5px; text-align: center; }
.pinrow svg { width: 58px; height: 58px; }
.pinrow small { color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .ceremony figure { animation: pinDrop .45s cubic-bezier(.2,.8,.3,1.2) both; animation-delay: calc(var(--i) * 70ms); } }
@keyframes pinDrop { from { opacity: 0; transform: translateY(-14px) scale(.8); } to { opacity: 1; transform: none; } }
.home { font: 500 24px/1.2 var(--serif); margin: 0 0 2px; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 10px; margin: 4px 0 6px; color: var(--ink-2); }
.stamps figure { margin: 0; }
.stamps svg, .pinhead .stamp { width: 100%; height: auto; display: block; }
.pinhead .stamp { max-width: 240px; }
.mrows { margin-bottom: 8px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mrow .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .c { font-size: 12.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.mrow .c.wide { grid-column: 2 / 4; }
.mrow.few .n { color: var(--ink-2); }
.museumday { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.daybtns { display: flex; flex-wrap: wrap; gap: 6px; }
.mapbox { margin: 6px -8px 4px; background: var(--paper); border-radius: 14px; padding: 8px; min-height: 120px; }
.worldmap { width: 100%; height: auto; display: block; }
.worldmap path { stroke: var(--paper); stroke-width: .6; cursor: pointer; }
.worldmap path.fog { fill: url(#pp-fog); }
.worldmap path.sel { stroke: var(--ink); stroke-width: 1.8; }
.worldmap .fogbg { fill: var(--fog); } .worldmap .fogline { stroke: var(--fogline); }
.worldmap .route { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 5; stroke-linejoin: round; pointer-events: none; }
.worldmap .stop { fill: var(--ink); stroke: var(--paper); stroke-width: 1.2; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .worldmap .route { animation: march 1.6s linear infinite; } @keyframes march { to { stroke-dashoffset: -20; } } }
.ramp { height: 6px; border-radius: 3px; margin: 6px 0 2px; background: linear-gradient(90deg, #6f8296, var(--land), #c48a2a); }
.legend { display: flex; justify-content: space-between; }
.atlaspanel { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.atlaspanel h3 { font: 500 22px/1.2 var(--serif); margin: 0 0 4px; }
.atlaspanel .btn { margin-top: 6px; }
.chip small { color: var(--ink-2); margin-left: 3px; }
.tlbox { overflow-x: auto; }
.timeline { width: 100%; min-width: 520px; height: auto; display: block; }
.timeline .axis { stroke: var(--line); stroke-width: 1.5; } .timeline .tick { stroke: var(--ink-2); }
.timeline .tl { fill: var(--ink-2); font: 11px var(--sans); }
.timeline .pass { stroke: var(--ink-2); stroke-opacity: .4; stroke-width: 1.4; }
.timeline .love { fill: #c48a2a; stroke: var(--paper); stroke-width: 1; }
.questbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--chip); font: 500 13.5px/1.2 var(--sans); }
.questbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.aux .dot { color: var(--ink-2); margin: 0 6px; }
.qcards { display: grid; gap: 8px; }
.qcard { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 8px 12px 8px 8px; color: var(--ink); font: inherit; }
.qcard svg { width: 44px; height: 44px; }
.qcard b { display: block; font-weight: 600; font-size: 14.5px; }
.qcard small { display: block; font-size: 12.5px; color: var(--ink-2); }
.qicon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--ink-2); }
.qicon svg { width: 22px; height: 22px; }
.qcard:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.modal-card h3 { margin: 10px 0 2px; }
.qbuild { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.qbuild label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.qbuild input[type=text] { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.qactive { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--chip); }
.qactive p { margin: 0; }
.qloves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qloves img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.ladder { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 4px; font-size: 13.5px; }
.ladder li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.ladder li b { color: var(--ink); font-weight: 600; }
.ladder li.got { color: var(--keep); } .ladder li.sealed { color: var(--gilt); }
.walllabel { font: italic 400 16px/1.5 var(--serif); color: var(--ink-2); border-left: 2px solid var(--gilt); padding-left: 12px; margin: 6px 0; }
.dim { margin: 18px 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 30px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .c { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar i.pos { background: var(--keep); } .bar i.neg { background: var(--pass); }
.plain { padding-left: 18px; margin: 0; font-size: 14.5px; }
.btn { border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 9px 16px; font: 500 14.5px/1.1 var(--sans); }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.warn { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 50%, transparent); }
.btn:disabled { opacity: .45; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 18px 14px; }
.tile { border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 6px; width: 100%; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--wall-deep); }
.tile .t { font: 400 15px/1.25 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .a { font-size: 12.5px; color: var(--ink-2); }
.tile-wrap { position: relative; }
.lovebtn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: 0 2px 8px -3px rgba(0,0,0,.35); transition: transform .12s, color .2s; }
.lovebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.lovebtn[aria-pressed="true"] { color: var(--gilt); }
.lovebtn[aria-pressed="true"] svg { fill: currentColor; }
.lovebtn:active { transform: scale(.9); }
.tile-wrap .lovebtn { position: absolute; top: 6px; right: 6px; }
.sheet-love { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: 14px; color: var(--ink-2); }

.settings section { border-top: 1px solid var(--line); padding: 4px 0 10px; }
.settings h2 { margin-top: 16px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.toggle span { display: grid; } .toggle small { color: var(--ink-2); font-size: 12.5px; }
.toggle input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.range { display: block; font-size: 14.5px; margin-bottom: 6px; }
input[type=range] { width: 100%; accent-color: var(--gilt); }
.ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.diag { font-size: 11.5px; white-space: pre-wrap; word-break: break-word; background: var(--paper); padding: 10px; border-radius: 8px; }

/* ---------- wall text sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 9, 10, .45); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88dvh; max-height: 88vh; overflow-y: auto; background: var(--paper); color: var(--ink);
  border-radius: 16px 16px 0 0; padding: 0 20px calc(28px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin: 0 auto; box-shadow: 0 -18px 50px -20px rgba(0,0,0,.6);
  transform: translateY(24px); opacity: 0; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.sheet.open { transform: none; opacity: 1; }
.sheet { touch-action: pan-y; }   /* vertical scrolling stays native; horizontal drags decide */
.sheet.dragging { transition: none; user-select: none; -webkit-user-select: none; }
.sheet img { -webkit-user-drag: none; }
.sheet-actions { position: sticky; bottom: calc(-28px - env(safe-area-inset-bottom, 0px)); z-index: 2; margin: 8px -20px 0; padding: 14px 20px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--paper) 22%); }
.sheet-btns { display: flex; justify-content: center; gap: clamp(12px, 5vw, 22px); }
.sheet-hint { margin: 8px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-2); }
.sheet-top { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; justify-content: flex-end; padding: 12px 0 8px; }
.grab { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 2px; background: var(--line); }
.zoomBtn { display: block; width: 100%; border: 0; padding: 14px; background: var(--wall-deep); border-radius: 4px; margin-bottom: 14px; cursor: zoom-in; }
.zoomBtn img { display: block; margin: 0 auto; max-width: 100%; max-height: 40vh; box-shadow: var(--shadow-art); }
.sheet-title { font: 400 26px/1.2 var(--serif); margin: 4px 0 4px; text-wrap: balance; }
.sheet-who { margin: 0 0 14px; font-weight: 600; }
.sheet-who span { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.prose p { font: 400 17px/1.6 var(--serif); margin: 0 0 .8em; max-width: 64ch; }
.prose .muted { font-family: var(--sans); font-size: 14.5px; }
.onview { display: inline-block; font-size: 13.5px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); margin: 4px 0 12px; }
.onview.yes { color: var(--keep); border-color: color-mix(in srgb, var(--keep) 55%, transparent); }
.scale { margin: 8px 0 14px; }
.scale svg { width: 100%; max-width: 420px; height: auto; display: block; }
.scale .floor { stroke: var(--line); stroke-width: 1; }
.scale .person { fill: var(--ink-2); opacity: .55; }
.scale .art { fill: color-mix(in srgb, var(--gilt) 30%, transparent); stroke: var(--gilt); stroke-width: 1; }
.scale figcaption { font-size: 12.5px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 14px; margin: 8px 0 16px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.reasons ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 14px; }
.reasons .up { color: var(--keep); font-weight: 500; } .reasons .down { color: var(--pass); font-weight: 500; }
.out { font-weight: 500; }

.zoom { position: fixed; inset: 0; z-index: 30; background: #0c0d0e; overflow: hidden; overscroll-behavior: none; touch-action: none; }
.zoom img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; cursor: zoom-in; user-select: none; -webkit-user-select: none; will-change: transform; }
.zoom.big img { cursor: grab; }
.zoom.big img:active { cursor: grabbing; }
.zoom .btn { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: #f4f3ef; color: #16181b; }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(8, 9, 10, .55); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 24px 22px; max-width: 30rem; width: 100%; max-height: 88vh; overflow-y: auto; display: grid; gap: 12px; animation: rise .3s ease; }
.modal-card h2 { margin: 0; font: 500 30px/1.1 var(--serif); }
.modal-card .display { font-size: 40px; margin: 0; }
.modal-card .kicker { margin: 0; }
.modal-card .note { margin: 0; box-shadow: none; border: 1px solid var(--line); }
.gestures { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14.5px; }
.gestures b { font-weight: 600; }

.toast { position: fixed; left: 50%; top: calc(58px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); }

@media (min-width: 760px) {
  .view.look { padding: 0 32px; }
  .plate { margin: 0 auto; width: 100%; max-width: 40rem; grid-template-columns: 1fr 1fr; align-items: start; }
  .cue { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 16px; }
}
/* ---------- large landscape screens (a laptop, a TV): the art takes the left, the label and controls the right ---------- */
@media (min-width: 1100px) and (min-aspect-ratio: 5/4) and (min-height: 560px) {
  :root { --side: clamp(320px, 26vw, 560px); --gut: clamp(24px, 3vw, 64px); }
  body { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .topbar { grid-column: 1; grid-row: 1; padding-left: var(--gut); }
  .tabbar { grid-column: 2; grid-row: 1; display: flex; gap: 2px; border-top: 0; background: none; padding: 4px var(--gut) 0 0; }
  .tabbar button { display: flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: 14px; border-radius: 999px; }
  .tabbar button[aria-current="page"] { background: var(--chip); }
  main { grid-column: 1 / -1; grid-row: 2; }
  .view.look { display: grid; position: relative; grid-template-columns: minmax(0, 1fr) var(--side); grid-template-rows: auto minmax(0, 1fr) auto auto;
    column-gap: var(--gut); padding: 4px var(--gut) clamp(12px, 2.5vh, 32px); }
  .stage-wrap { grid-column: 1 / -1; grid-row: 1 / -1; }
  .nudge { grid-column: 1; grid-row: 1; position: relative; z-index: 5; justify-self: start; }
  .questbar { grid-column: 2; grid-row: 1; position: relative; z-index: 5; margin: 6px 0 0; }
  .controls { grid-column: 2; grid-row: 3; position: relative; z-index: 5; padding-top: 0; }
  .aux { grid-column: 2; grid-row: 4; position: relative; z-index: 5; }
  .card { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); column-gap: var(--gut); padding: 8px 0 clamp(12px, 2.5vh, 32px); }
  .hang { grid-column: 1; grid-row: 1; min-height: 0; }
  .plate { grid-column: 2; grid-row: 1; align-self: start; margin: 72px 0 0; width: auto; max-width: none; grid-template-columns: 1fr; gap: 16px; }
  .cue { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; font-size: clamp(14px, .95vw, 19px); }
  .label .who { font-size: clamp(16px, 1.15vw, 23px); }
  .label .bio, .label .med, .label .src { font-size: clamp(13px, .9vw, 18px); }
  .label .what { font-size: clamp(24px, 1.9vw, 40px); margin-top: 8px; -webkit-line-clamp: 4; }
  .label .med { -webkit-line-clamp: 3; margin-top: 8px; }
  .label .src { margin-top: 8px; }
  .ctl { width: clamp(54px, 3.6vw, 72px); height: clamp(54px, 3.6vw, 72px); }
  .ctl.ghost { width: clamp(42px, 2.8vw, 56px); height: clamp(42px, 2.8vw, 56px); }
  .why { left: auto; right: var(--gut); width: var(--side); max-width: none; margin: 0; bottom: calc(clamp(54px, 3.6vw, 72px) + 84px); }
  .sheet { left: auto; top: 0; width: min(640px, 40vw); max-height: none; border-radius: 16px 0 0 16px; transform: translateX(24px); }
  .sheet.open { transform: none; }
}
@media (max-height: 640px) {
  .label .bio, .label .src, .cue .sub { display: none; }
  .ctl { width: 48px; height: 48px; } .ctl.ghost { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Kept slideshow (full screen, for a TV) ---------- */
.kept-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.showform { display: grid; gap: 12px; margin: 12px 0; }
.showform label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.showform label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.showform select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.show { position: fixed; inset: 0; z-index: 60; background: #121314; color: #ece8df; display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 520px); }
.show.noinfo { grid-template-columns: minmax(0, 1fr); }
.show.noinfo .show-info { display: none; }
.show:not(.ui) { cursor: none; }
.show-stage { position: relative; margin: 4vh 3vw; min-width: 0; min-height: 0; }
.show-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.4s ease; }
.show-img.front { opacity: 1; }
.show.beside .show-img { object-position: right center; }
.show.beside .show-stage, .show.beside .show-info { transform: translateX(calc(-1 * var(--shift, 0px))); transition: transform 1.4s ease, padding-bottom 1.4s ease; }
.show.beside .show-info { padding-left: 1.5vw; }
.show-info { align-self: end; padding: 0 3.5vw 7vh 0; display: grid; gap: .5em; font-size: clamp(14px, 1vw, 20px); line-height: 1.4; }
.show-info p { margin: 0; }
.show-info .who { font-weight: 600; font-size: 1.15em; }
.show-info .bio, .show-info .med, .show-info .src { color: #a9a59c; }
.show-info .what { font: 400 clamp(22px, 1.9vw, 40px)/1.25 var(--serif); text-wrap: balance; }
.show-bar { position: absolute; top: 3vh; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(20, 21, 22, .78); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.show.ui .show-bar, .show.paused .show-bar { opacity: 1; pointer-events: auto; }
.show-bar button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: none; color: #ece8df; display: grid; place-items: center; }
.show-bar button:hover, .show-bar button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); }
.show-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.show-count { font-size: 13px; color: #a9a59c; padding: 0 10px; white-space: nowrap; }
@media (max-aspect-ratio: 1/1) {   /* a portrait screen or phone: the label sits under the art */
  .show { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .show-info { align-self: start; padding: 0 6vw 5vh; }
}
@media (prefers-reduced-motion: reduce) { .show-img { transition: none; } }

/* Account (0.10): sign-up sheet, recovery code, passkeys and devices */
.settings h3 { font-size: 14.5px; margin: 16px 0 4px; }
.field { display: grid; gap: 4px; font-size: 14px; }
.field small { color: var(--ink-2); }
.field input { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.check { min-height: 0; }
.check:not(:empty) { min-height: 65px; }
.err { color: var(--pass); margin: 0; }
.err:empty { display: none; }
.attn { border-left: 2px solid var(--gilt); padding-left: 10px; }
.code { font: 600 clamp(15px, 4.6vw, 21px)/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; white-space: nowrap; text-align: center; padding: 12px 8px;
  border: 1px dashed var(--line); border-radius: 10px; margin: 0; user-select: all; overflow-wrap: anywhere; }
.acctlist { list-style: none; padding: 0; margin: 0; }
.acctlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.acctlist li span { display: grid; min-width: 0; }
.acctlist small { color: var(--ink-2); font-size: 12.5px; }
.howto { margin: 12px 0 4px; font-size: 14px; }
.howto summary { cursor: pointer; color: var(--ink-2); }
@media print {
  body.print-code > *:not(#modal) { display: none !important; }
  body.print-code #modal { position: static; background: none; }
  body.print-code .modal-card > :not(.code):not(h2):not(.kicker) { display: none !important; }
}
