:root {
  --bg: #f7f3ec;
  --card: #fffdf9;
  --ink: #1f1b16;
  --muted: #6b6258;
  --line: #e6ddd0;
  --accent: #b4532a;
  --accent-soft: #f6e3d8;
  --green: #2f7d4f;
  --green-soft: #e1f1e6;
  --amber: #9a6a00;
  --amber-soft: #fbf0d3;
  --grey-soft: #efebe5;
  --market: #b4532a;
  --city: #b9ad9e;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 6px 20px rgb(60 40 20 / 5%);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171411; --card: #211d19; --ink: #f2ece4; --muted: #a99e91; --line: #3a332c;
    --accent: #e48a5f; --accent-soft: #3d2a20; --green: #7fcf9c; --green-soft: #1f3327;
    --amber: #e5b95a; --amber-soft: #3a3020; --grey-soft: #2b2622; --market: #e48a5f; --city: #6e6458;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171411; --card: #211d19; --ink: #f2ece4; --muted: #a99e91; --line: #3a332c;
  --accent: #e48a5f; --accent-soft: #3d2a20; --green: #7fcf9c; --green-soft: #1f3327;
  --amber: #e5b95a; --amber-soft: #3a3020; --grey-soft: #2b2622; --market: #e48a5f; --city: #6e6458;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin: 28px 0 12px; max-width: 18ch; }
h2 { font-size: 26px; margin: 0 0 10px; }
h3 { font-size: 20px; margin: 0 0 10px; }
h4 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
code { font-size: .92em; background: var(--grey-soft); padding: 1px 5px; border-radius: 5px; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-family: Fraunces, Georgia, serif; font-size: 20px; font-weight: 650; }
.mark { color: var(--accent); }
.top-links { display: flex; gap: 18px; font-size: 14px; }
.top-links a { color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--ink); }

.lede { font-size: 18px; color: var(--muted); max-width: 70ch; margin: 0 0 22px; }
.lede strong { color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin: 0 0 16px; }
.grid2.tight { gap: 20px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

form { display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
select, input, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.actions-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
button.primary {
  font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 22px; cursor: pointer;
}
button.primary:disabled { opacity: .55; cursor: progress; }
.hint, .note { color: var(--muted); font-size: 14px; }
.note { margin: -4px 0 12px; }
.samples { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 14px; display: grid; gap: 8px; }
.samples-label { font-size: 14px; color: var(--muted); }

.steps { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.steps li { display: grid; grid-template-columns: 64px 70px minmax(0, 1fr); gap: 8px; align-items: start; }
.steps li > span { min-width: 0; overflow-wrap: anywhere; }
.steps .ms { color: var(--muted); font-variant-numeric: tabular-nums; }
.steps .detail { grid-column: 3; color: var(--muted); font-size: 13px; }
.steps.small li { font-size: 13px; }
@media (max-width: 560px) { .steps li { grid-template-columns: 52px minmax(0, 1fr); } .steps .phase { display: none; } .steps .detail { grid-column: 2; } }
.phase { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-radius: 6px; padding: 2px 6px; text-align: center; }
.phase.qloo { background: var(--accent-soft); color: var(--accent); }
.phase.agent { background: var(--green-soft); color: var(--green); }
.phase.model { background: var(--amber-soft); color: var(--amber); }
.phase.done, .phase.cache { background: var(--grey-soft); color: var(--muted); }
.progress .live::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .progress .live::after { animation: none; } }

.error { border-color: var(--accent); color: var(--accent); }

.brief-head h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; margin: 4px 0 10px; }
.eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.summary { font-size: 17px; margin: 0 0 10px; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }

.actions { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.actions li::marker { font-family: Fraunces, Georgia, serif; font-weight: 650; color: var(--accent); }
.actions .t { font-weight: 600; }
.actions .d { margin: 2px 0 6px; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ref {
  font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 7px; padding: 2px 8px; cursor: pointer; max-width: 100%; text-align: left;
}
.ref b { color: var(--accent); font-weight: 600; margin-right: 4px; }
.ref:hover { border-color: var(--accent); }

.places { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.places li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.places li:last-child { border-bottom: 0; }
.rank { font-family: Fraunces, Georgia, serif; font-size: 20px; color: var(--accent); line-height: 1.2; }
.pname { font-weight: 600; }
.paddr { font-size: 13px; color: var(--muted); }
.ptags { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lift { font-size: 12.5px; white-space: nowrap; border-radius: 6px; padding: 2px 7px; background: var(--grey-soft); color: var(--muted); }
.lift.up { background: var(--green-soft); color: var(--green); }
.lift.new { background: var(--accent-soft); color: var(--accent); }

.profile { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.profile .lab { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.profile .lab span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 3px; margin-top: 4px; }
.bar { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }
.bar.m i { background: var(--market); }
.bar.c i { background: var(--city); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.idea-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.idea-list .itop { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.idea-list .iname { font-weight: 600; }
.verdict { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.verdict.over-represented { background: var(--green-soft); color: var(--green); }
.verdict.common { background: var(--grey-soft); color: var(--muted); }
.verdict.untested { background: var(--amber-soft); color: var(--amber); }
.verdict.absent-from-favourites { background: var(--accent-soft); color: var(--accent); }
.idea-list .why { font-size: 14px; color: var(--muted); }
.own { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; font-size: 14px; }

.culture { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.culture li { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.culture li small { color: var(--muted); display: block; font-size: 12px; }
.culture.subtle li { background: var(--bg); }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.checks .ok { color: var(--green); font-weight: 700; }
.checks .no { color: var(--muted); }
.checks small { display: block; color: var(--muted); }

.caveats { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ledger-row { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; display: grid; grid-template-columns: 46px 1fr; gap: 8px; }
.ledger-row code { word-break: break-all; }

.how ol { padding-left: 20px; display: grid; gap: 8px; }
.foot { color: var(--muted); font-size: 13px; padding: 10px 16px 40px; }

.pop {
  position: absolute; z-index: 10; max-width: min(360px, calc(100vw - 32px)); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 18%); font-size: 13.5px;
}
.pop h5 { margin: 0 0 4px; font-size: 14px; }
.pop .src { color: var(--muted); font-size: 12px; margin-top: 6px; word-break: break-all; }

/* --- round 2: hero, language, map, photos, partners, print --- */
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 26px; }
.ghost {
  font: inherit; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 18px; text-decoration: none; cursor: pointer;
}
.ghost:hover { border-color: var(--accent); }
.ghost.small { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.brand { color: var(--ink); text-decoration: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button { font: inherit; font-size: 12.5px; font-weight: 600; background: transparent; color: var(--muted); border: 0; padding: 4px 9px; cursor: pointer; min-height: 30px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.top-links { align-items: center; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.map { height: 360px; border-radius: 10px; border: 1px solid var(--line); z-index: 0; }
@media (max-width: 560px) { .map { height: 280px; } }
.places li { grid-template-columns: 30px 56px minmax(0, 1fr) auto; }
.places li.noimg { grid-template-columns: 30px minmax(0, 1fr) auto; }
.thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--grey-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.none img { display: none; }
.pbody { min-width: 0; }
.partner { font-size: 13px; color: var(--accent); margin-top: 4px; }
.places.compact li { padding-bottom: 8px; }
.ratio { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.audience { margin-top: 14px; font-size: 14px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.audience:empty { display: none; }
.inote { font-size: 14px; margin-top: 2px; }
.verdict.too-few { background: var(--grey-soft); color: var(--muted); }
.verdict.under-represented { background: var(--accent-soft); color: var(--accent); }
.culture li small.cwhy { color: var(--ink); opacity: .75; max-width: 28ch; }
.pop-img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.ref { min-height: 30px; }
.ledger-row code { font-size: 12px; }
@media print {
  .no-print, .top, .foot, .how, #map, .tools, details { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

.coverage-note { margin: -4px 0 0; font-size: 14px; color: var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 8px 12px; }
