/* OMR post components: the crate, the blind quiz, the cost chart. Site palette,
   with literal fallbacks so a draft previewed outside the site still renders. */
[data-omr] {
  --o-ink: var(--ink, #1e2e38); --o-ink-2: var(--ink-light, #3a5060); --o-muted: #5f7380;
  --o-line: var(--border, #c8d8e4); --o-accent: var(--accent, #1a5f8a); --o-accent-soft: var(--accent-muted, #d4ecf8);
  --o-card: var(--card-bg, #fff); --o-bg: var(--cream, #f5f8fa); --o-err: #c62a20; --o-ok: #2f8a69;
  --booth: #141c22; --booth-2: #1d2830; --booth-ink: #eef2f4; --booth-muted: #93a4ae; --paper: #efe6d2;
  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --omono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 28px 0; font: 400 1rem/1.6 var(--sans); color: var(--o-ink);
}
[data-omr] * { box-sizing: border-box; }
[data-omr] p { margin: 0; }
[data-omr] button { font: inherit; color: inherit; cursor: pointer; }
[data-omr] button:focus-visible, [data-omr] [tabindex]:focus-visible, [data-omr] input:focus-visible { outline: 2px solid var(--o-accent); outline-offset: 3px; }
[data-omr] .num { font-family: var(--omono); font-variant-numeric: tabular-nums; }

/* ---------- Crate: the one dark panel, a listening booth ---------- */
.booth { background: var(--booth); color: var(--booth-ink); border-radius: 16px; padding: 18px 0 20px; display: grid; gap: 14px; overflow: hidden; }
.booth > .row { padding: 0 16px; }
.booth button:focus-visible, .booth [tabindex]:focus-visible { outline-color: var(--paper); }
.booth .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.booth .tab { background: transparent; border: 1px solid #33424d; color: var(--booth-muted); border-radius: 99px; padding: 6px 12px; font-size: .85rem; }
.booth .tab[aria-pressed="true"] { background: var(--paper); color: #1a1a1a; border-color: var(--paper); }
.stage { --s: 240px; position: relative; height: calc(var(--s) + 40px); perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sleeve { position: absolute; left: 50%; top: 18px; width: var(--s); height: var(--s); margin-left: calc(var(--s) / -2);
  transition: transform .55s cubic-bezier(.2,.75,.25,1), opacity .4s; cursor: pointer; }
.disc { position: absolute; inset: 2%; border-radius: 50%; transition: transform .6s cubic-bezier(.2,.75,.25,1); }
.disc canvas { width: 100%; height: 100%; border-radius: 50%; display: block; }
.disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 30deg, transparent 0 8%, rgba(255,255,255,.12) 12%, transparent 18% 58%, rgba(255,255,255,.08) 62%, transparent 68%); }
.sleeve.active .disc { transform: translateX(34%); }
.sleeve.active.playing .disc { transform: translateX(46%); }
.sleeve.playing canvas { animation: omr-spin 1.8s linear infinite; } /* 33 1/3 rpm */
@keyframes omr-spin { to { transform: rotate(360deg); } }
.cover { position: absolute; inset: 0; border-radius: 3px; overflow: hidden; background: #fbfaf6;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.08); }
.cover .art { position: absolute; inset: 0; background-repeat: no-repeat; }
.cover .band { position: absolute; left: 0; right: 0; top: 0; padding: 10px 12px 9px; background: rgba(20,28,34,.92); color: #f4efe3; display: grid; gap: 2px; }
.cover .work { font: italic 500 .78rem/1.2 var(--display); color: #cfc6b3; }
.cover .by { font: 500 1.15rem/1.15 var(--display); }
.cover .score { position: absolute; right: 10px; bottom: 10px; background: #fff; color: #1a1a1a; border-radius: 4px; padding: 4px 7px; font: 500 .78rem/1 var(--omono); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.cover .score b { color: var(--o-err); font-weight: 500; }
.cover.crashed { background: repeating-linear-gradient(135deg, #2a3239 0 10px, #252c33 10px 20px); }
.cover.crashed .msg { position: absolute; inset: auto 12px 14px; color: #f4efe3; font-size: .85rem; line-height: 1.4; }
.cover.crashed .msg b { display: block; font: 500 1.4rem/1.1 var(--display); margin-bottom: 4px; }
.deck { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center; }
.booth .play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--paper); color: #141c22; display: grid; place-items: center; grid-row: span 2; }
.booth .play:disabled { opacity: .35; cursor: not-allowed; }
.booth .play svg { width: 22px; height: 22px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; min-width: 0; }
.seg { display: inline-flex; border: 1px solid #33424d; border-radius: 99px; padding: 2px; }
.seg button { border: 0; background: none; color: var(--booth-muted); padding: 5px 11px; border-radius: 99px; font-size: .82rem; }
.seg button[aria-pressed="true"] { background: var(--booth-2); color: var(--booth-ink); box-shadow: inset 0 0 0 1px #46566282; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.fader { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--booth-muted); }
.fader input { width: 130px; accent-color: var(--paper); }
.fader.off { opacity: .35; }
.meter { height: 3px; background: #2b3740; border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--paper); }
.booth .caption { font-size: .88rem; color: var(--booth-muted); line-height: 1.5; min-height: 2.6em; }
.booth .caption strong { color: var(--booth-ink); font-weight: 500; }
.booth .nav { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--booth-muted); }
.booth .nav button { background: var(--booth-2); border: 1px solid #33424d; color: var(--booth-ink); width: 36px; height: 36px; border-radius: 50%; }
@media (max-width: 480px) {
  .fader input { width: 100px; }
  .seg { border-radius: 12px; } .seg button { border-radius: 10px; line-height: 1.3; }  /* labels wrap at phone width */
}

/* ---------- Blind listening quiz ---------- */
.quiz { background: var(--o-card); border: 1px solid var(--o-line); border-radius: 14px; padding: 22px; display: grid; gap: 18px; }
.quiz .q { font: 500 1.3rem/1.25 var(--display); color: var(--o-ink); }
.quiz .meta { display: flex; justify-content: space-between; gap: 12px; color: var(--o-muted); font-size: .82rem; }
.quiz .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz .take { border: 1px solid var(--o-line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; justify-items: start; }
.quiz .lbl { font: 700 2rem/1 var(--display); }
.quiz .lbl small { display: block; font: 400 .75rem/1.4 var(--sans); color: var(--o-muted); letter-spacing: .04em; }
.quiz .listen, .quiz .pick, .quiz .next { border-radius: 99px; padding: 8px 14px; font-size: .88rem; }
.quiz .listen { border: 1px solid var(--o-line); background: var(--o-bg); display: inline-flex; align-items: center; gap: 8px; }
.quiz .listen[aria-pressed="true"] { border-color: var(--o-accent); color: var(--o-accent); }
.quiz .pick { border: 0; background: var(--o-accent); color: #fff; font-weight: 500; }
.quiz .pick:disabled { opacity: .4; cursor: default; }
.quiz .take.won { border-color: var(--o-ok); box-shadow: inset 0 0 0 1px var(--o-ok); }
.quiz .take.lost { border-color: var(--o-err); box-shadow: inset 0 0 0 1px var(--o-err); }
.quiz .reveal { display: grid; gap: 10px; border-top: 1px solid var(--o-line); padding-top: 16px; }
.quiz .reveal[hidden] { display: none; }
.quiz .verdict { font-weight: 600; }
.quiz .qerr { color: var(--o-err); font-size: .88rem; }
.quiz .qerr:empty { display: none; }
.quiz .verdict.y { color: var(--o-ok); } .quiz .verdict.n { color: var(--o-err); }
.quiz .reveal img { width: 100%; height: 130px; object-fit: cover; object-position: 0 18%; border-radius: 8px; border: 1px solid var(--o-line); background: #fff; margin: 0; }
.quiz .next { justify-self: start; border: 1px solid var(--o-ink); background: var(--o-ink); color: #fff; font-weight: 500; }
@media (max-width: 480px) { .quiz { padding: 16px; } .quiz .pair { grid-template-columns: 1fr; } }

/* ---------- Effort and cost chart ---------- */
.chart { background: var(--o-card); border: 1px solid var(--o-line); border-radius: 14px; padding: 22px; display: grid; gap: 14px; position: relative; }
.chart .title { font-weight: 600; }
.chart .legend { display: flex; gap: 6px 16px; font-size: .82rem; color: var(--o-ink-2); flex-wrap: wrap; }
.chart .legend span { display: inline-flex; gap: 6px; align-items: center; }
.chart .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.chart .dot.m { border: 2px solid var(--o-accent); background: var(--o-card); }
.chart .dot.h { background: var(--o-accent); }
.chart .dash { width: 0; height: 14px; border-left: 2px dashed var(--o-muted); display: inline-block; }
.chart .plot { display: grid; gap: 4px; }
.chart .prow, .chart .axis { display: grid; grid-template-columns: 128px 1fr 118px; align-items: center; gap: 12px; padding: 0 6px; }
.chart .prow { min-height: 44px; border-radius: 8px; }
.chart .prow:hover, .chart .prow:focus-visible { background: var(--o-accent-soft); }
.chart .nm { font-size: .9rem; font-weight: 500; }
.chart .track { position: relative; height: 44px; }
.chart .axis .track { height: 20px; }
.chart .gl { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--o-line); }
.chart .aud { position: absolute; top: -2px; bottom: -2px; border-left: 2px dashed var(--o-muted); }
.chart .tick, .chart .audiveris { position: absolute; top: 2px; transform: translateX(-50%); font: .7rem/1 var(--omono); color: var(--o-muted); white-space: nowrap; }
.chart .audiveris { top: auto; bottom: 2px; transform: translateX(-100%); padding-right: 6px; font: .72rem/1 var(--sans); color: var(--o-ink-2); }
.chart .seg-line { position: absolute; top: 50%; height: 2px; background: var(--o-accent); transform: translateY(-50%); }
.chart .pt { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; }
.chart .pt.m { border: 2px solid var(--o-accent); background: var(--o-card); }
.chart .pt.h { background: var(--o-accent); box-shadow: 0 0 0 2px var(--o-card); }
.chart .val { position: absolute; top: 50%; transform: translate(-50%, -150%); font: 500 .72rem/1 var(--omono); color: var(--o-ink); white-space: nowrap; background: var(--o-card); padding: 0 2px; }
.chart .tok { font: 400 .78rem/1.3 var(--omono); color: var(--o-ink-2); text-align: right; }
.chart .tok b { color: var(--o-ink); font-weight: 500; }
.chart .tip { position: absolute; pointer-events: none; background: var(--o-ink); color: #fff; font-size: .8rem; line-height: 1.45; padding: 8px 10px; border-radius: 8px; max-width: min(260px, calc(100% - 16px)); z-index: 5; }
.chart.spread .pt { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.chart .all { position: absolute; top: 50%; width: 3px; height: 26px; margin: -13px 0 0 -1.5px; border-radius: 2px; background: var(--o-ink); box-shadow: 0 0 0 2px var(--o-card); }
.chart .legend .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--o-ink); display: inline-block; }
.chart .note { font-size: .8rem; color: var(--o-muted); line-height: 1.5; }
@media (max-width: 560px) {
  .chart { padding: 16px; }
  /* phone: each row gets the full width for its track; the scale sits under the last row on the same edges */
  .chart .prow, .chart .axis { grid-template-columns: 1fr; gap: 0; }
  .chart .prow { padding-block: 6px; }
  .chart .axis > span { display: none; }
  .chart .tok { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .sleeve, .disc { transition: none; }
  .sleeve.playing canvas { animation: none; }
}

/* ---------- Post prose: round bullets instead of the site's arrows, and quiet footnotes ---------- */
main ul > li::before { content: ''; top: .72em; left: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent, #1a5f8a); }
sup { line-height: 0; }
.footnote-ref { text-decoration: none; padding: 0 1px; font-weight: 600; }
.footnote { font-size: .9rem; line-height: 1.6; }
.footnote hr { display: none; }
.footnote ol { margin-bottom: 0; }
.footnote p { margin-bottom: .3em; }
.footnote-backref { text-decoration: none; margin-left: 4px; }
:target { scroll-margin-top: 24px; }
.footnote li:target, sup:target { background: var(--accent-muted, #d4ecf8); border-radius: 4px; }
main details { margin: 0 0 1em; }
main summary { cursor: pointer; color: var(--accent, #1a5f8a); }
main details[open] > summary { margin-bottom: .8em; }

/* model name pills in prose, tinted with the chart hue (set by omr.js) */
.who { white-space: nowrap; padding: 0 .45em 0 .4em; border-radius: 99px;
  background: color-mix(in srgb, var(--hue) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 45%, transparent); }
.who::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .3em;
  border-radius: 50%; background: var(--hue); vertical-align: .06em; }

/* scan thumbnails open enlarged in a dialog */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--accent, #1a5f8a); outline-offset: 3px; }
/* shared.css zeroes every margin, so center explicitly */
.omr-zoom { position: fixed; inset: 0; margin: auto; width: min(94vw, 960px); height: fit-content; max-height: 92vh; overflow: auto;
  padding: 48px 20px 16px; border: 0; border-radius: 12px;
  background: var(--card-bg, #fff); color: var(--ink, #1e2e38); cursor: zoom-out; }
.omr-zoom::backdrop { background: rgba(10, 16, 20, .78); }
.omr-zoom img { width: 100%; height: auto; }
.omr-zoom figcaption { font-size: .95rem; }
.omr-zoom .close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink, #1e2e38); font: 400 26px/1 sans-serif; cursor: pointer; }
.omr-zoom .close:hover { background: var(--accent-muted, #d4ecf8); }
.omr-zoom .close:focus-visible { outline: 2px solid var(--accent, #1a5f8a); outline-offset: 2px; }
