:root {
  --bg: #f6f1e5; --bg-surface: #fffdf7; --text-primary: #1e1c15; --text-secondary: #5c5747;
  --text-muted: #8a8474; --border: #e2d9c4; --border-strong: #c9bfa4; --accent: #1d5fae;
  --focus: #1d5fae; --map-bg: #ece5d2; --map-pin: #7d5a16; --map-town: #a9a28f;
  --ok: #2e6b34; --warn: #8a5a17; --bad: #9c2f2f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191713; --bg-surface: #22201a; --text-primary: #ece7d8; --text-secondary: #b7b09c;
    --text-muted: #8a8474; --border: #3a362c; --border-strong: #57503d; --accent: #7aa8e0;
    --focus: #7aa8e0; --map-bg: #22262b; --map-pin: #d9b263; --map-town: #a9a28f;
  }
}
[data-theme="dark"] {
  --bg: #191713; --bg-surface: #22201a; --text-primary: #ece7d8; --text-secondary: #b7b09c;
  --text-muted: #8a8474; --border: #3a362c; --border-strong: #57503d; --accent: #7aa8e0;
  --focus: #7aa8e0; --map-bg: #22262b; --map-pin: #d9b263; --map-town: #a9a28f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif; line-height: 1.6; }
main { max-width: 46rem; margin: 0 auto; padding: 0 1rem 3rem; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.45rem; margin: 2.6rem 0 0.8rem; line-height: 1.25; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0.7rem 0; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; border-radius: 8px; }
.kicker { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); margin: 1.2rem 0 0; }
.deck { font-size: 1.1rem; color: var(--text-secondary); }
.byline { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.82rem; color: var(--text-muted); }
.caption { font-size: 0.88rem; color: var(--text-secondary); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 10; }
.topbar .brand { font-weight: bold; color: var(--text-primary); text-decoration: none;
  font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.9rem; white-space: nowrap; }
nav.rail { display: flex; gap: 0.9rem; overflow-x: auto; font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem; }
nav.rail a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
nav.rail a[aria-current="true"] { color: var(--text-primary); font-weight: bold; }
button.theme { margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: 50%; width: 2rem; height: 2rem; cursor: pointer; color: var(--text-primary); font-size: 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.keystats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; list-style: none;
  padding: 0; margin: 1.2rem 0; }
@media (min-width: 720px) { .keystats { grid-template-columns: repeat(4, 1fr); } }
.keystats li { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem; }
.keystats strong { display: block; font-size: 1.25rem; }
.keystats span { font-size: 0.85rem; color: var(--text-secondary); }
.hero figure { margin: 1.2rem 0 0; }
figure { margin: 0.8rem 0; }
figcaption { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.35rem; }
.credit { font-size: 0.82rem; color: var(--text-muted); margin: 0.2rem 0; }
.nophoto { font-size: 0.85rem; color: var(--text-muted); border-left: 3px solid var(--border-strong);
  padding-left: 0.6rem; }
.map-wrap { position: relative; }
.map-svg { width: 100%; height: auto; background: var(--map-bg); border-radius: 10px; }
.map-svg .ro-outline { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.map-svg .pin-hit { fill: transparent; }
.map-svg .pin { stroke: var(--bg-surface); stroke-width: 2; cursor: pointer; }
.map-svg .pin-link:hover .pin, .map-svg .pin-link:focus-visible .pin { r: 10; }
.map-svg .pin-link.active .pin { r: 11; stroke: var(--focus); stroke-width: 3; }
.map-svg .pin-link.dimmed { opacity: 0.25; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0 0.2rem; }
.filter-bar button { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.85rem;
  padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text-primary); cursor: pointer; }
.filter-bar button[aria-pressed="true"] { background: var(--text-primary); color: var(--bg);
  border-color: var(--text-primary); }
.filter-count { font-size: 0.85rem; color: var(--text-secondary); margin: 0.2rem 0 0.8rem; }
.card[hidden] { display: none; }
.map-svg .pin-link:focus-visible .pin { stroke: var(--focus); stroke-width: 3; }
.map-svg .pin-leader { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 2; }
.map-tip { position: absolute; z-index: 5; max-width: 240px; padding: 0.45rem 0.65rem;
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); pointer-events: none; font-size: 0.85rem; line-height: 1.35; }
.map-tip[hidden] { display: none; }
.map-tip strong { display: block; font-size: 0.9rem; }
.map-tip span { color: var(--text-secondary); }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem;
  margin: 0.8rem 0; font-size: 0.9rem; }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.35rem; }
.ranking { list-style: none; padding: 0; margin: 1rem 0; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 0.6rem;
  align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.rank-name { font-size: 0.92rem; }
.rank-name small { display: block; color: var(--text-secondary); font-size: 0.78rem; }
.rank-val { font-size: 0.92rem; white-space: nowrap; text-align: right; }
.rank-val small { display: block; color: var(--text-secondary); font-size: 0.75rem; font-weight: normal; }
.bar { display: block; height: 14px; border-radius: 3px; background: var(--accent); min-width: 3px; }
.bar.ghost { background: transparent; border: 1px dashed var(--border-strong); }
.bar.hatched { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 4px,
  transparent 4px, transparent 8px); border: 1px solid var(--accent); }
.bar.seg { background: linear-gradient(var(--accent), var(--accent)) no-repeat,
  repeating-linear-gradient(90deg, transparent 0 10px, var(--bg) 10px 13px); }
.bar.excluded { background: var(--text-muted); opacity: 0.55; }
.bar.seg.ghost, .bar.hatched.ghost { background: transparent; border: 1px dashed var(--border-strong); }
.toggle { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.toggle button { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.88rem;
  padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text-primary); cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }
.cards { display: grid; gap: 1.6rem; margin: 1rem 0; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } .card { margin: 0; } }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; background: var(--bg-surface); }
.card h3 { margin-top: 0.4rem; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.8rem; font-size: 0.88rem;
  margin: 0.6rem 0; }
dl.facts dt { color: var(--text-secondary); }
dl.facts dd { margin: 0; }
.badge { display: inline-block; font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.75rem;
  font-weight: bold; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-strong);
  margin-right: 0.3rem; }
.badge.a { background: #dcefe0; border-color: #2e6b34; color: #1e4a24; }
.badge.b { background: #e3ecf7; border-color: #1d5fae; color: #173f73; }
.badge.c { background: #f7ecd4; border-color: #8a5a17; color: #5f430e; }
.badge.d { background: #f3dede; border-color: #9c2f2f; color: #6b1f1f; }
.taxgrid { display: grid; gap: 0.7rem; margin: 1rem 0; }
@media (min-width: 720px) { .taxgrid { grid-template-columns: 1fr 1fr; } }
.taxgrid article { border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem;
  background: var(--bg-surface); }
.taxgrid h4 { margin: 0 0 0.3rem; font-size: 1rem; }
.taxgrid p { margin: 0.3rem 0; font-size: 0.9rem; }
.glyph { display: inline-block; width: 34px; height: 44px; margin-right: 0.6rem; vertical-align: middle;
  border: 1px solid var(--border-strong); border-radius: 4px; background: var(--bg); }
details.faq { border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem;
  margin: 0.6rem 0; background: var(--bg-surface); }
details.faq summary { cursor: pointer; font-weight: bold; }
details.faq p { font-size: 0.95rem; }
.warning { border: 1px solid #9c2f2f; border-radius: 10px; padding: 0.7rem 0.9rem;
  background: var(--bg-surface); font-size: 0.92rem; }
footer { border-top: 1px solid var(--border); padding: 1.2rem 1rem 2rem; text-align: center;
  font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.85rem; color: var(--text-secondary); }
footer a { color: var(--text-secondary); }
.keystats.trio { grid-template-columns: 1fr; }
@media (min-width: 720px) { .keystats.trio { grid-template-columns: repeat(3, 1fr); } }
section.interlude { border-left: 4px solid var(--accent); background: var(--bg-surface);
  border-radius: 0 10px 10px 0; padding: 0.4rem 1rem 1rem; margin-top: 2.4rem; }
section.interlude h2 { margin-top: 1.2rem; }
.scroll-x { overflow-x: auto; }
.scroll-x svg { min-width: 560px; }
#vertical .scroll-x { padding-left: 24px; }
#vertical .scroll-x svg { min-width: 1200px; overflow: visible; }
#vertical .scroll-x svg > text {
  font-size: 16px;
  font-weight: 650;
  paint-order: stroke fill;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}
#vertical .scroll-x svg > text[fill="#ffffff"] {
  font-weight: 750;
  stroke: none;
}
svg .grid { stroke: var(--border); stroke-width: 1; }
svg .baseline { stroke: var(--text-primary); stroke-width: 2; }
svg text { font-family: -apple-system, "Segoe UI", sans-serif; }
details.dovezi { border-top: 1px solid var(--border); margin-top: 0.6rem; padding-top: 0.5rem; }
details.dovezi summary { cursor: pointer; font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 0.88rem; font-weight: bold; color: var(--accent); }
details.dovezi .hook { font-size: 0.9rem; }
dl.legend-defs { grid-template-columns: auto 1fr; }
dl.legend-defs dt { font-weight: bold; color: var(--text-primary); }
#raspuns { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface);
  padding: 0.4rem 1.1rem 1.1rem; margin-top: 1.4rem; }
#raspuns h2 { margin-top: 1rem; }
.keystats.trio a { color: inherit; text-decoration: none; }
.keystats.trio a:hover strong, .keystats.trio a:focus-visible strong { text-decoration: underline; }
.meta { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.82rem; color: var(--text-muted); }
.detalii { font-size: 0.92rem; }
.takeaway { font-size: 0.95rem; border-left: 3px solid var(--accent); padding-left: 0.7rem; }
.scroll-hint { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.8rem;
  color: var(--text-muted); margin-bottom: 0.2rem; }
@media (min-width: 720px) { .scroll-hint { display: none; } }
.scroll-x svg rect.winner { stroke: var(--text-primary); stroke-width: 2.5; }
.scroll-x svg a:focus-visible rect { stroke: var(--focus); stroke-width: 3; }
.chart-status { font-size: 0.85rem; color: var(--text-secondary); margin: 0.2rem 0 0.6rem; }
.expand-all { font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.85rem;
  padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text-primary); cursor: pointer; margin: 0.4rem 0 0.2rem; }
section.card-group[hidden] { display: none; }
