:root {
  --paper: #f6f1e7;
  --paper-2: #eee7d8;
  --card: #fbf8f1;
  --ink: #131210;
  --ink-2: #4b463d;
  --rule: #d9d0be;
  --accent: #ff6a13;
  --accent-ink: #a53900;
  --ok: #1d6a3a;
  --bad: #a3271b;
  --wait: #655f52;
  --radius: 6px;
  --gutter: clamp(16px, 3.2vw, 44px);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 8px var(--gutter) 56px; outline: none; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h3 { font-size: 1.05rem; }
h1:focus, h1:focus-visible { outline: none; box-shadow: none; }
p { margin: 0 0 0.75em; }
code, pre, .mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 20; border-radius: var(--radius); }
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--accent); border-radius: 3px; }

/* ---------- header ---------- */
.site-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 28px; padding: 18px var(--gutter) 14px; border-bottom: 2px solid var(--ink); max-width: 1560px; width: 100%; margin: 0 auto; }
.brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.brand em { color: var(--accent-ink); font-style: italic; font-weight: 600; }
#nav { display: flex; flex-wrap: wrap; gap: 2px 6px; }
#nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: 0.92rem; font-weight: 500; border: 1px solid transparent; }
#nav a:hover { background: var(--paper-2); color: var(--ink); }
#nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- common bits ---------- */
.page-head { display: grid; gap: 10px; padding: 26px 0 18px; }
.page-head .lede { color: var(--ink-2); max-width: 62ch; margin: 0; }
.eyebrow { font: 600 0.74rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.hash { font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }

.btn { font: 600 0.88rem/1 var(--sans); padding: 10px 14px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 7px 10px; min-height: 34px; font-size: 0.82rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: var(--bad); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 0.72rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 8px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); }
.chip.bad { color: var(--bad); }
.chip.wait { color: var(--wait); }
.chip.neutral { color: var(--ink-2); }
.chip.kind { color: var(--ink); border-color: var(--rule); background: var(--paper-2); }
.chip.kind::before { display: none; }

.notice { border-left: 4px solid var(--accent); background: var(--card); padding: 12px 16px; margin: 0 0 18px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice.error { border-color: var(--bad); }
.notice p:last-child { margin-bottom: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.tabs a { display: block; text-decoration: none; padding: 7px 12px; border: 1.5px solid var(--rule); border-radius: 999px; font-size: 0.86rem; font-weight: 500; background: var(--card); }
.tabs a:hover { border-color: var(--ink); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.stats { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats div { display: flex; gap: 8px; align-items: baseline; }
.stats dt { color: var(--ink-2); font-size: 0.85rem; }
.stats dd { margin: 0; font: 600 1.15rem var(--serif); }

/* ---------- frames / posters ---------- */
.frame { position: relative; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.frame > img, .frame > video, .frame > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #fff; }
.ph { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; text-align: center; padding: 10px; color: var(--ink-2); background: repeating-linear-gradient(135deg, var(--paper-2) 0 10px, var(--card) 10px 20px); }
.ph b { font: 600 0.95rem var(--serif); color: var(--ink); }
.ph span { font-size: 0.78rem; }
.frame.big { border-width: 1.5px; border-color: var(--ink); }
.frame > iframe.live-preview { inset: auto; transform-origin: top left; max-width: none; }
.media:fullscreen { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--paper, #f6f1e7); width: 100%; height: 100%; }
.media:fullscreen > .frame { flex: 1; min-height: 0; aspect-ratio: auto; }
.media:fullscreen > .row, .media:fullscreen > .media-note { flex: none; }

/* ---------- matrix ---------- */
.matrix { --cols: minmax(8.5rem, 11rem) repeat(5, minmax(0, 1fr)); display: grid; gap: 22px 0; margin-top: 18px; }
.mx-head, .mx-row { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: start; }
.mx-head { padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.mx-col { font: 600 0.95rem var(--serif); }
.mx-col small { display: block; font: 400 0.74rem var(--sans); color: var(--ink-2); }
.mx-rowhead { padding-top: 4px; }
.mx-rowhead h2 { font-size: 1.15rem; margin-bottom: 6px; }
.mx-rowhead h2 a { text-decoration: none; }
.mx-rowhead h2 a:hover { color: var(--accent-ink); text-decoration: underline; }
.cell { display: grid; gap: 8px; text-decoration: none; color: inherit; border-radius: var(--radius); }
.cell:hover .frame { border-color: var(--ink); box-shadow: 4px 4px 0 var(--accent); }
.cell:hover { color: inherit; }
.cell-cap { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: space-between; font-size: 0.82rem; }
.cell-cap .who { font-weight: 600; }
.mine { font-size: 0.8rem; color: var(--ink-2); }
.mine.rated { color: var(--ink); font-weight: 600; }
.mine.rated::before { content: "★ "; color: var(--accent-ink); }

@media (max-width: 1099px) {
  .mx-head { display: none; }
  .mx-row { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); border-top: 1px solid var(--rule); padding-top: 18px; }
  .mx-rowhead { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 0; }
  .mx-rowhead h2 { margin: 0; }
}

/* ---------- card grids (by brief / by agent) ---------- */
.cards { display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); margin-top: 20px; }
.card { display: grid; gap: 10px; align-content: start; }
.card header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; justify-content: space-between; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button { font: 600 0.78rem/1 var(--sans); padding: 8px 11px; background: transparent; color: var(--ink); border: 0; border-right: 1.5px solid var(--ink); cursor: pointer; min-height: 34px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.seg button:focus-visible { outline-offset: -3px; }
.media-note { font-size: 0.78rem; color: var(--ink-2); margin: 0; }
.media-note.warn { color: var(--bad); }

/* ---------- detail ---------- */
.detail { display: grid; gap: 28px 36px; grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 1fr); align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 0.92rem; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.1rem; margin-bottom: 10px; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
details.src { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 12px; }
details.src > summary { cursor: pointer; font: 600 1.02rem var(--serif); padding: 4px 0; }
pre.text { margin: 10px 0 0; padding: 14px 16px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); overflow: auto; max-height: 34rem; font-size: 0.8rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.verify.ok { color: var(--ok); }
.verify.bad { color: var(--bad); font-weight: 600; }

/* ---------- rating widget ---------- */
.rate { border: 0; margin: 0; padding: 0; min-width: 0; }
.rate legend { padding: 0; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.rate-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rate-opt { position: relative; }
.rate-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rate-opt span { display: grid; place-items: center; width: 38px; height: 38px; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 600; background: transparent; }
.rate-opt input:checked + span { background: var(--accent); }
.rate-opt input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--accent); }
.rate-opt input:disabled + span { opacity: 0.4; }
.rate-opt input:disabled { cursor: not-allowed; }
.rate-help { font-size: 0.78rem; color: var(--ink-2); margin: 6px 0 0; }
.note-in { width: 100%; margin-top: 8px; font: inherit; font-size: 0.88rem; padding: 8px 10px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--ink); }
.note-in:focus { border-color: var(--ink); }

/* ---------- review ---------- */
.review-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 800px) { .pair { grid-template-columns: 1fr; } }
.side { display: grid; gap: 10px; align-content: start; }
.side-label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.side-label .big { font: 700 2.2rem/1 var(--serif); color: var(--accent-ink); }
.side.won .frame { border-color: var(--ink); box-shadow: 5px 5px 0 var(--accent); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
kbd { font: 600 0.72rem var(--mono); border: 1px solid var(--ink-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--card); }
.reveal { margin-top: 16px; }

/* ---------- ratings page ---------- */
.two { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); background: var(--paper-2); }
tr:last-child td { border-bottom: 0; }
.filein { font: inherit; max-width: 100%; }
ul.plain { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.86rem; }

.loading, .noscript { padding: 40px 0; color: var(--ink-2); }
.empty { padding: 36px 0; max-width: 60ch; }

.site-foot { border-top: 2px solid var(--ink); max-width: 1560px; width: 100%; margin: 0 auto; padding: 18px var(--gutter) 34px; color: var(--ink-2); font-size: 0.84rem; display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 8px 40px; }
.site-foot p { margin: 0; max-width: 72ch; }
.site-foot strong { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .site-head nav, .skip { display: none; } }

.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
