:root {
  --paper: #f4efe6;
  --card: #fbf8f2;
  --ink: #1f1b16;
  --muted: #5a5348;
  --rule: #d8cfbf;
  --accent: #7a2c26;
  --accent-ink: #fbf8f2;
  --selected: var(--accent); /* the one selected-state colour: primary buttons, pressed buttons, chips, the current tab */
  --selected-ink: var(--accent-ink);
  --good: #2f5d3a;
  --bad: #8a2a1f;
  --focus: #0b57d0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tab-h: 58px;
  --bar-h: 52px;
  /* the artwork box has a fixed height (never a layout shift when the image arrives): phones leave room for the question and four answers */
  --art-h: clamp(150px, calc(100vh - 350px), 56vh);
}
@supports (height: 100svh) { :root { --art-h: clamp(150px, calc(100svh - 350px), 56svh); } }
@media (min-width: 768px) {
  :root { --art-h: min(calc(100vh - 150px), 720px); }
  @supports (height: 100svh) { :root { --art-h: min(calc(100svh - 150px), 720px); } }
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f; --card: #1f1c16; --ink: #efe9dc; --muted: #b3aa99; --rule: #3a352b;
    --accent: #e0a396; --accent-ink: #16140f; --good: #8fcf9b; --bad: #f0a79b; --focus: #8ab4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; scroll-padding-bottom: 104px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1.125rem; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 40; }
.skip:focus { top: 8px; }

/* ---------- header, tabs, menu ---------- */
.site-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.25rem; padding: .6rem 16px; max-width: 72rem; width: 100%; margin: 0 auto; border-bottom: 1px solid var(--rule); }
.brand { font-size: 1.25rem; letter-spacing: .01em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; }
.brand-mark { width: 1rem; height: 1.25rem; border: 2px solid var(--ink); outline: 2px solid var(--rule); outline-offset: 2px; display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; width: .32rem; height: .32rem; border-radius: 50%; background: var(--accent); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.top-nav { display: none; gap: .25rem 1.5rem; font-family: var(--sans); font-size: .98rem; margin-left: auto; }
.top-nav a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 3px solid transparent; }
.top-nav a:hover { color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--selected); }
.menu-btn { min-height: 44px; min-width: 44px; background: transparent; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink); font: .95rem var(--sans); cursor: pointer; padding: 0 .8rem; }
.menu-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.menu-btn-text { display: none; }
.menu-panel { position: absolute; right: 16px; top: calc(100% + 4px); z-index: 30; width: min(21rem, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--ink); border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .4rem; font-family: var(--sans); }
.menu-panel[hidden] { display: none; }
.menu-item { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 .8rem; color: var(--ink); text-decoration: none; background: none; border: 0; font: 1rem var(--sans); text-align: left; cursor: pointer; border-radius: 3px; }
.menu-item:hover { background: var(--paper); }
.menu-policy { border-top: 1px solid var(--rule); margin-top: .3rem; padding: .5rem .8rem .3rem; font-size: .88rem; }
.menu-policy p { margin: .25rem 0; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; background: var(--paper); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); font-family: var(--sans); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab-h); color: var(--muted); text-decoration: none; font-size: .78rem; border-top: 3px solid transparent; margin-top: -1px; }
.tab[aria-current="page"] { color: var(--selected); border-top-color: var(--selected); font-weight: 600; }
.tab svg { display: block; }
@media (min-width: 768px) {
  .tabbar { display: none; }
  .top-nav { display: flex; }
  .menu-btn-text { display: inline; }
}

/* ---------- page frame ---------- */
main { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: 1.25rem 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); outline: none; }
@media (min-width: 768px) { main { padding-bottom: 2.5rem; padding-top: 2rem; } }
h1 { font-weight: 400; font-size: 2rem; line-height: 1.15; margin: .25rem 0 .75rem; letter-spacing: -.005em; }
h1:focus { outline: none; }
h2 { font-weight: 400; font-size: 1.45rem; margin: 1.75rem 0 .5rem; }
h3 { font-weight: 600; font-size: 1.05rem; margin: 1.25rem 0 .4rem; font-family: var(--sans); }
.lede { font-size: 1.2rem; color: var(--ink); max-width: 36rem; }
.kicker { font-family: var(--sans); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.muted { color: var(--muted); font-size: .95rem; }
.life { color: var(--muted); font-size: .8em; font-weight: 400; }
.site-foot { max-width: 46rem; width: 100%; margin: 0 auto; padding: 0 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); font: .85rem/1.5 var(--sans); }
.site-foot a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
@media (min-width: 768px) { .site-foot { padding-bottom: 2rem; } }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.15rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 1rem var(--sans); border-radius: 4px; text-decoration: none; cursor: pointer; }
.btn.big { min-height: 56px; font-size: 1.15rem; padding: .6rem 2.2rem; }
@media (hover: hover) { .btn:hover:not(:disabled):not(.primary):not([aria-pressed="true"]) { background: var(--ink); color: var(--paper); } }
.btn.primary, .btn[aria-pressed="true"] { background: var(--selected); color: var(--selected-ink); border-color: var(--selected); }
@media (hover: hover) { .btn.primary:hover:not(:disabled) { filter: brightness(1.12); } }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.linklike { background: none; border: 0; color: var(--accent); text-decoration: underline; font: .95rem var(--sans); cursor: pointer; min-height: 44px; padding: 0 .5rem; }
.sel-row { display: grid; gap: .25rem; margin: .7rem 0; font-family: var(--sans); min-width: 0; }
.sel-row select { width: 100%; max-width: 100%; min-width: 0; min-height: 48px; font: 1rem var(--sans); padding: .4rem .6rem; background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-radius: 4px; text-overflow: ellipsis; }
.readout { background: var(--card); border: 1px solid var(--rule); padding: .7rem .9rem; border-radius: 4px; font-family: var(--sans); font-size: .98rem; }
#artist-filter { width: 100%; min-height: 48px; font: 1rem var(--sans); padding: .4rem .6rem; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; margin-top: .5rem; }

/* ---------- play screen ---------- */
body[data-mode="play"] .site-head, body[data-mode="play"] .tabbar, body[data-mode="play"] .site-foot { display: none; }
body[data-mode="play"] main { max-width: 72rem; padding: 0 16px 16px; }
.play { }
.play.has-next { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.play-bar { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: .6rem; min-height: var(--bar-h); background: var(--paper); border-bottom: 1px solid var(--rule); margin: 0 -16px 8px; padding: 0 16px; font-family: var(--sans); font-size: .9rem; }
.pb-title { font-weight: 600; white-space: nowrap; }
.pb-score { color: var(--muted); white-space: nowrap; margin-left: auto; }
.pb-exit { margin-left: auto; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; background: none; border: 0; font: .9rem var(--sans); cursor: pointer; gap: .15rem; }
.pb-score + .pb-exit { margin-left: 0; }
.pb-exit-text { display: none; }
@media (min-width: 420px) { .pb-exit-text { display: inline; } }
.marks { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pm { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font: 700 .72rem var(--sans); line-height: 1; }
.pm-todo { width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 50%; }
.pm-now { border: 3px solid var(--ink); border-radius: 50%; }
.pm-right { background: var(--good); color: var(--paper); border-radius: 50%; }
.pm-wrong { background: var(--bad); color: var(--paper); border-radius: 3px; }
.play-grid { display: grid; gap: 8px; }
.play-art { min-width: 0; }
.art-btn { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.art { height: var(--art-h); margin: 0; padding: 10px; background: var(--card); border: 1px solid var(--rule); box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(0,0,0,.45); display: flex; justify-content: center; align-items: center; overflow: hidden; }
.art img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.art-cmp { height: min(46vh, 440px); }
.art-fail { color: var(--muted); font-family: var(--sans); font-size: .95rem; margin: 1rem; }
.question { font-size: 1.25rem; line-height: 1.25; margin: 4px 0 6px; outline: none; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice { width: 100%; min-height: 48px; text-align: left; display: flex; align-items: center; gap: .8rem; background: var(--card); color: var(--ink); border: 1px solid var(--ink); border-radius: 4px; padding: .5rem .9rem; font: inherit; font-size: 1.05rem; cursor: pointer; flex-wrap: wrap; }
.choice[aria-disabled="true"] { cursor: default; opacity: .62; }
.choice.is-correct { opacity: 1; border: 2px solid var(--good); }
.choice.is-wrong { opacity: 1; border: 2px dashed var(--bad); }
.choice-name { flex: 1; min-width: 0; }
.choice-mark { font: 600 .88rem var(--sans); }
.choice.is-correct .choice-mark { color: var(--good); }
.choice.is-wrong .choice-mark { color: var(--bad); }
.choice-num { display: none; font: .85rem var(--sans); border: 1px solid currentColor; border-radius: 50%; width: 1.7rem; height: 1.7rem; align-items: center; justify-content: center; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .choice-num { display: inline-flex; }
  .choice:not([aria-disabled="true"]):hover { background: var(--ink); color: var(--paper); }
}
@media (min-width: 768px) {
  .play-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
  .play-qa { align-self: center; }
  .question { font-size: 1.6rem; margin-bottom: 12px; }
  .choice { min-height: 56px; }
}
.lightbox, .sheet { border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 12px; max-width: min(96vw, 60rem); border-radius: 4px; }
.lightbox::backdrop, .sheet::backdrop { background: rgba(0,0,0,.72); }
.lightbox img { display: block; max-width: calc(96vw - 24px); max-height: calc(100vh - 110px); margin: 8px auto 0; }
.lb-close { display: flex; margin-left: auto; }
.sheet { max-width: min(92vw, 28rem); }
.steps { padding-left: 1.2rem; }

/* ---------- reveal ---------- */
.reveal { border-top: 2px solid var(--ink); margin-top: 16px; padding-top: 8px; }
.verdict { font-family: var(--sans); font-weight: 600; margin: 0 0 .25rem; outline: none; }
.verdict.right { color: var(--good); }
.verdict.wrong { color: var(--bad); }
.artist-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.reveal-artist { font-size: 1.6rem; margin: .25rem 0; flex: 1 1 auto; }
.reveal-title, .reveal-museum { margin: .2rem 0; }
.reveal-gallery { color: var(--muted); margin: .4rem 0; }
.save-btn { min-height: 44px; }
.sources { margin: 12px 0; border: 1px solid var(--rule); border-radius: 4px; background: var(--card); }
.sources summary { min-height: 48px; display: flex; align-items: center; padding: 0 .9rem; cursor: pointer; font-family: var(--sans); }
.sources > :not(summary) { margin-left: .9rem; margin-right: .9rem; }
.compare { margin-top: 14px; }
.compare h3 { margin-top: 0; }
.cmp-grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .cmp-grid { grid-template-columns: 1fr 1fr; } }
.cmp-item .art { margin: 0 0 .4rem; }
.cmp-cap { font-size: .98rem; margin: 0; }
.next-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 14; background: var(--paper); border-top: 1px solid var(--rule); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.next-bar .btn { width: 100%; max-width: 40rem; min-height: 52px; font-size: 1.1rem; }

/* ---------- today: start and finish ---------- */
.streak-line { font-family: var(--sans); color: var(--muted); margin: .25rem 0 1rem; }
.score { font-size: 3.5rem; margin: 0; line-height: 1.1; }
.thumbs { list-style: none; margin: 1rem 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.thumb { display: block; text-decoration: none; color: var(--ink); }
.thumb-img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: var(--card); border: 2px solid var(--rule); overflow: hidden; }
.thumb-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb.right .thumb-img { border-color: var(--good); }
.thumb.wrong .thumb-img { border: 2px dashed var(--bad); }
.thumb-mark { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font: 700 .75rem var(--sans); color: var(--paper); }
.thumb.right .thumb-mark { background: var(--good); border-radius: 50%; }
.thumb.wrong .thumb-mark { background: var(--bad); border-radius: 3px; }
.thumb-cap { display: block; font: .75rem/1.25 var(--sans); margin-top: 4px; overflow-wrap: anywhere; }
.share-preview { background: var(--card); border: 1px solid var(--rule); padding: .9rem 1rem; font: 1rem/1.5 var(--sans); white-space: pre-wrap; word-break: break-word; border-radius: 4px; user-select: all; }
.countdown { font-family: var(--sans); color: var(--muted); }
.install-card { border: 1px solid var(--ink); background: var(--card); border-radius: 4px; padding: .8rem 1rem; margin: 1rem 0; }
.install-card p { margin: 0 0 .3rem; }
.stats { margin: 1.5rem 0; }
.stats h2 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; margin: 0 0 .5rem; }
.stats dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; margin: 0; }
@media (min-width: 560px) { .stats dl { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stat dt { font: .78rem var(--sans); color: var(--muted); }
.stat dd { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.mark { font-family: var(--sans); font-size: .8rem; font-weight: 700; padding: .1rem .45rem; border: 1px solid currentColor; border-radius: 3px; }
.mark.right { color: var(--good); } .mark.wrong { color: var(--bad); }
.badges ul { list-style: none; padding: 0; margin: .5rem 0 0; }
.badges summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-family: var(--sans); }
.badge { display: flex; gap: .6rem; margin: .4rem 0; font-size: 1rem; }
.badge-mark { color: var(--muted); } .badge.earned .badge-mark { color: var(--accent); }

/* ---------- practice ---------- */
.artist-pick, .pack-list, .list-items { list-style: none; padding: 0; margin: 1rem 0; }
.artist-pick { max-height: 26rem; overflow: auto; border: 1px solid var(--rule); padding: 0 .75rem; border-radius: 4px; }
.artist-pick li { display: flex; gap: .75rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.artist-pick input { width: 1.4rem; height: 1.4rem; margin-top: .3rem; flex: none; accent-color: var(--accent); }
.artist-pick label { min-height: 44px; display: block; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: .5rem 0; padding: 0; }
.chip { min-height: 44px; display: inline-flex; align-items: center; border-radius: 22px; border: 1px solid var(--selected); background: var(--selected); color: var(--selected-ink); padding: 0 1rem; font: .95rem var(--sans); cursor: pointer; }
.change-artists { margin: .5rem 0 1rem; }
.change-artists summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-family: var(--sans); text-decoration: underline; }
.visit-banner { border: 1px solid var(--rule); background: var(--card); border-radius: 4px; padding: .6rem 1rem; margin-bottom: 1rem; }
.visit-banner .kicker { margin: 0; }
.progress-big { font-size: 1.4rem; margin: .5rem 0; }
.pack-list li { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.dots { display: inline-flex; gap: .3rem; vertical-align: middle; }
.dot { width: .8rem; height: .8rem; border-radius: 50%; border: 1.5px solid var(--ink); }
.dot.on { background: var(--ink); }
.pair-list { list-style: none; padding: 0; margin: .4rem 0; }
.pair-list li { margin: .5rem 0; }
.pair-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-family: var(--sans); }
.pairs h2 { margin-top: 1rem; }

/* ---------- visit and offer ---------- */
.museum-cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 10px; }
.museum-card { display: grid; gap: 2px; padding: .85rem 1rem; border: 1px solid var(--rule); background: var(--card); text-decoration: none; color: var(--ink); border-radius: 4px; min-height: 64px; }
.museum-card:hover { border-color: var(--ink); }
.museum-card .kicker { margin: 0; }
.mc-name { font-size: 1.25rem; }
.mc-unlocked { font: 600 .85rem var(--sans); color: var(--good); }
.free-start h2 { margin-top: 1.25rem; }
.unlock-line { margin: 1.5rem 0; font-family: var(--sans); }
.unlocked-box { border: 1px solid var(--good); border-radius: 4px; padding: .5rem 1rem; margin: 1.25rem 0; }
.paid-pack { border: 1px solid var(--ink); border-radius: 4px; padding: 1rem 1.1rem; margin: 1.25rem 0; background: var(--card); }
.paid-pack h3 { margin-top: 0; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.free-vs-paid { display: grid; gap: .5rem 1.5rem; }
.free-vs-paid h4 { margin: .5rem 0 .2rem; font-family: var(--sans); font-size: .95rem; }
.free-vs-paid ul { margin: 0; padding-left: 1.2rem; }
@media (min-width: 640px) { .free-vs-paid { grid-template-columns: 1fr 1fr; } }
.price { font-size: 1.15rem; margin: .8rem 0 .2rem; }
.unlocked { font-family: var(--sans); font-weight: 600; color: var(--good); }
.coming-soon { font-family: var(--sans); font-weight: 600; margin: .4rem 0 0; }
.policy { margin-top: .9rem; font-size: .95rem; }
.policy p { margin: .25rem 0; }
.restore-box { display: grid; gap: .4rem; }
.restore-box input, #restore-input { width: 100%; min-height: 48px; font: .95rem var(--sans); padding: .4rem .6rem; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; }
.restore-paste { margin-top: .75rem; }
.restore-paste summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }

/* ---------- list, about ---------- */
.gallery-block { margin-bottom: 1rem; }
.list-items li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.row-actions { display: flex; gap: 1rem; align-items: center; font-family: var(--sans); font-size: .95rem; }
.row-actions a { min-height: 44px; display: inline-flex; align-items: center; }
.prose { max-width: 38rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .4rem 0; }
.print-only { display: none; }

/* ---------- app update bar ---------- */
.update-bar { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); max-width: 44rem; margin: 0 auto; display: flex; gap: 1rem; align-items: center; justify-content: space-between; background: var(--ink); color: var(--paper); padding: .5rem .9rem; border-radius: 4px; font-family: var(--sans); z-index: 25; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.update-bar .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); min-height: 44px; }
body[data-mode="play"] .update-bar { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .update-bar { bottom: 16px; } body[data-mode="play"] .update-bar { bottom: 96px; } }

@media (prefers-reduced-motion: no-preference) { .choice, .btn, .tab { transition: background-color .15s, color .15s; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #333; --rule: #999; --accent: #000; }
  body { font-size: 12pt; }
  .site-head, .site-foot, .tabbar, .no-print, .skip, .update-bar, .next-bar { display: none !important; }
  .print-only { display: block; }
  a { color: #000; }
  .list-items li { break-inside: avoid; }
  .museum-block, .gallery-block h3 { break-after: avoid; }
}

/* practice: keep the chosen set above the fold on phones */
.selectors { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.selectors .sel-row:first-child, .selectors #form-status { grid-column: 1 / -1; }
.selectors .sel-row { margin: .35rem 0; }
.selectors #form-status { margin: 0; min-height: 0; }
.selectors #form-status:empty { display: none; }
.pairs .progress-big { font-size: 1.15rem; margin: .2rem 0; }
.picker h2 { margin-top: .8rem; font-size: 1.2rem; }
.picker .chips { margin-top: .2rem; }
.picker .actions { margin: .5rem 0; }
.artists-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; }
.artists-head h2 { margin: 0; }
.chip span { margin-left: .5rem; }

/* ---------- browse, work page, shared lists ---------- */
.browse-filters { margin-top: .5rem; }
.browse-filters .sel-row:last-child { grid-column: 1 / -1; }
.wgrid { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 14px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .wgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .wgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wcard { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wcard-link { display: block; color: var(--ink); text-decoration: none; }
.wcard-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--card); border: 1px solid var(--rule); overflow: hidden; }
.wcard-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.wcard-fail { font: .8rem var(--sans); color: var(--muted); padding: .5rem; text-align: center; }
.wcard-link:hover .wcard-img, .wcard-link:focus-visible .wcard-img { border-color: var(--ink); }
.wcard-cap { display: grid; gap: 1px; margin-top: 6px; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.wcard-cap em { font-style: italic; }
.wcard .save-btn { min-height: 44px; font-size: .9rem; padding: .3rem .6rem; }
.work-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .work-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; } }
.work-art .art { height: min(60vh, 560px); }
@media (min-width: 768px) { .work-art .art { height: min(calc(100vh - 170px), 700px); } }
.work-title { font-size: 1.8rem; margin-top: 0; }
.work-artist { font-size: 1.15rem; margin: .2rem 0; }
.share-url { width: 100%; min-height: 44px; font: .85rem var(--sans); padding: .4rem .6rem; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; margin: .4rem 0; }
.share-list { margin: .5rem 0 1rem; }
.liked h2 { margin-top: 2rem; }
.block { display: block; }

/* ---------- walking order ---------- */
.tour-note { color: var(--muted); font-size: 1rem; }
.tour-group { margin: 1.25rem 0; }
.tour-group-h { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; border-bottom: 2px solid var(--selected); display: inline-block; margin: 0 0 .25rem; }
.tour-stop { border-bottom: 1px solid var(--rule); padding: .4rem 0 .8rem; }
.tour-stop h3 { margin: .6rem 0 .1rem; }
.tour-works { list-style: none; padding: 0; margin: .3rem 0; }
.tour-works li { display: flex; align-items: flex-start; gap: .7rem; padding: .35rem 0; }
.tour-works input { width: 1.4rem; height: 1.4rem; margin-top: .25rem; flex: none; accent-color: var(--accent); }
.tour-works label { flex: 1; min-height: 44px; display: block; }
.tw-link { font: .9rem var(--sans); min-height: 44px; display: inline-flex; align-items: center; }
@media print { .tour-works input { appearance: auto; } .tour-stop { break-inside: avoid; } .tw-link { display: none; } }

/* Beat my five */
.challenge-card { border: 1px solid var(--rule); border-radius: 6px; padding: .9rem 1rem; margin: 1.25rem 0; background: var(--card); }
.challenge-card h2 { margin-top: 0; }
.challenge-card input[type="text"] { width: 100%; min-height: 44px; font: 1rem var(--sans); padding: .4rem .6rem; box-sizing: border-box; }
.challenge-card .sel-row label { display: block; margin-bottom: .25rem; }
.ch-out label { display: block; margin: .75rem 0 .25rem; font-family: var(--sans); }
.cmp-rows { padding-left: 1.2rem; font-family: var(--sans); }
.cmp-rows li { margin: .6rem 0; }
.challenge .score { font-size: 1.75rem; line-height: 1.2; }

/* Art Institute of Chicago dot map (our own schematic) */
.floor-figure { margin: .75rem 0 1rem; }
.floor-map { width: 100%; max-width: 420px; height: auto; display: block; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; }
.fm-base { fill: var(--muted); opacity: .45; }
.fm-base.fm-closed { fill: none; stroke: var(--muted); stroke-width: 1; }
.fm-stop circle { fill: var(--ink); stroke: var(--paper); stroke-width: 1.5; }
.fm-stop text { fill: var(--paper); font: 700 10px var(--sans); }
.fm-stop.fm-closed circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 2; }
.fm-stop.fm-closed text { fill: var(--ink); }
.fm-north path { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.fm-north text { fill: var(--ink); font: 700 9px var(--sans); }
.floor-figure figcaption { font-family: var(--sans); font-size: .9rem; margin-top: .4rem; }

/* Visit guide: offer screen, museum card, previews */
.guide-card { border: 1px solid var(--rule); border-radius: 6px; padding: .9rem 1rem; margin: 1.25rem 0; background: var(--card); }
.guide-card h2 { margin-top: 0; }
.guide-fact { font-family: var(--sans); font-weight: 600; margin: .25rem 0; }
.mc-offer { display: block; font-size: .9rem; }
.offer-view h1 { font-size: 1.7rem; line-height: 1.2; }
.paid-pack .lede { margin-top: .25rem; }
.guide-route, .guide-practice { border: 1px solid var(--rule); border-radius: 6px; padding: .75rem 1rem; margin: 1rem 0; background: var(--card); }
.guide-route h3, .guide-practice h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.gp-gallery h4 { margin: .6rem 0 .25rem; font: 600 .95rem var(--sans); }
.gp-works { list-style: none; margin: 0; padding: 0; }
.gp-works li { display: flex; gap: .6rem; align-items: center; margin: .35rem 0; font-size: .95rem; line-height: 1.3; }
.gp-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 3px; flex: none; opacity: 0; }
.gp-thumb.loaded { opacity: 1; }
.gp-more { font-family: var(--sans); font-weight: 600; margin: .5rem 0 0; }
.gp-thumbs { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; min-height: 56px; }
.guide-page-fig { margin: 1rem 0; }
.guide-page { background: #fff; color: #222; border: 1px solid var(--rule); box-shadow: 0 1px 6px rgba(0, 0, 0, .2); padding: .8rem .9rem; max-width: 330px; font: .78rem/1.35 Georgia, serif; }
.guide-page p { margin: .2rem 0; }
.gpg-title { font-weight: 700; font-size: .95rem; }
.gpg-lede { color: #555; }
.gpg-gallery { font-weight: 700; margin-top: .5rem !important; }
.guide-compare { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .95rem; margin: .5rem 0 1rem; }
.guide-compare th, .guide-compare td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.guide-compare thead th { font-size: .85rem; color: var(--muted); }
.guide-compare .gc-guide { font-weight: 600; }
.visit-nudge { font-family: var(--sans); margin: .75rem 0; }
.buy-block .price { font-size: 1.1rem; }
