/* Granița care nu mai există — survey-plate theme, both modes. */
:root{
  --bg:#f4efe6; --surface:#fbf8f0; --surface2:#efe8d8;
  --ink:#1d2521; --muted:#4c564c; --faint:#6d7568;
  --line:#d5cdb6; --line-soft:#e2dbc6;
  --accent:#b23a1d; --accent-soft:#c9502f;
  --stage-bg:#ece5d2; --relief-o:.55;
  --shadow:0 1px 2px rgba(29,37,33,.08),0 8px 28px rgba(29,37,33,.08);
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --sans:"Source Sans 3",-apple-system,"Segoe UI",sans-serif;
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --topbar-h:52px;
}
[data-theme="dark"]{
  --bg:#131a20; --surface:#1a232d; --surface2:#202b36;
  --ink:#e9e3d2; --muted:#aab3a4; --faint:#8b9589;
  --line:#2e3a45; --line-soft:#26313c;
  --accent:#e0684a; --accent-soft:#e8836b;
  --stage-bg:#182029; --relief-o:.4;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 28px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--sans);
  font-size:17px;line-height:1.55;-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
svg[hidden]{display:none}
a{color:inherit;text-decoration-color:var(--accent);text-underline-offset:2px}
a:hover{color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}
.skip{position:absolute;left:-9999px;top:0;background:var(--ink);color:var(--bg);padding:.5rem 1rem;z-index:60}
.skip:focus{left:.5rem;top:.5rem}
.wrap{max-width:1180px;margin:0 auto;padding:0 clamp(16px,4vw,40px)}
.reading{max-width:680px}

/* topbar */
.topbar{position:fixed;inset:0 0 auto 0;height:var(--topbar-h);z-index:50;
  background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line-soft)}
.topbar-in{max-width:1180px;margin:0 auto;height:100%;padding:0 clamp(16px,4vw,40px);
  display:flex;align-items:center;gap:1.1rem}
.brand{display:flex;align-items:center;gap:.55rem;text-decoration:none;font-weight:700;letter-spacing:.01em;white-space:nowrap}
.brand .motif{width:26px;height:26px;flex:none}
.topnav{display:flex;gap:1rem;margin-left:auto;font-size:.92rem}
.topnav a{text-decoration:none;color:var(--muted);padding:.3rem 0}
.topnav a:hover{color:var(--ink)}
.langs{display:flex;gap:.15rem;font-size:.92rem;border:1px solid var(--line);border-radius:999px;padding:2px}
.langs a{padding:.12rem .55rem;border-radius:999px;text-decoration:none;color:var(--muted)}
.langs a[aria-current]{background:var(--ink);color:var(--bg)}
.theme-btn{width:40px;height:40px;border:1px solid var(--line);background:transparent;color:var(--ink);
  border-radius:999px;display:grid;place-items:center;cursor:pointer;flex:none}
.theme-btn svg{width:19px;height:19px}
.progress{position:absolute;left:0;bottom:-1px;height:2px;background:var(--accent);width:0%}
@media (max-width:760px){.topnav{display:none}.brand span{display:none}}

/* hero */
.hero{padding:calc(var(--topbar-h) + clamp(28px,6vh,64px)) 0 clamp(20px,4vh,40px)}
.hero h1{font-family:var(--serif);font-weight:640;font-size:clamp(2rem,5.2vw,3.6rem);
  line-height:1.04;letter-spacing:-.015em;margin:0 0 1rem;max-width:20ch;text-wrap:balance}
.deck{font-size:clamp(1.05rem,1.6vw,1.28rem);line-height:1.5;color:var(--ink);max-width:62ch;margin:0 0 1.4rem}
.deck strong{font-weight:700}
.findings{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);
  border:1px solid var(--line);margin:1.6rem 0 1.2rem}
.finding{background:var(--surface);padding:1rem 1.1rem}
.finding .num{font-family:var(--mono);font-size:clamp(1.5rem,3vw,2.1rem);font-weight:600;line-height:1}
.finding .lab{color:var(--muted);font-size:.95rem;margin-top:.45rem;line-height:1.4}
.howto{color:var(--muted);max-width:62ch}
.howto b{color:var(--ink)}
@media (max-width:680px){.findings{grid-template-columns:1fr}}

/* story + stage */
.story{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);gap:clamp(20px,3vw,44px);
  align-items:start;padding:2rem 0 1rem}
.stage-col{position:sticky;top:calc(var(--topbar-h) + 14px)}
.stage{background:var(--stage-bg);border:1px solid var(--line);box-shadow:var(--shadow);padding:10px 10px 6px}
.stage-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;padding:2px 4px 6px;min-height:1.6em}
.stage-title{font-family:var(--serif);font-weight:600;font-size:1.06rem;line-height:1.25}
.stage-count{font-family:var(--mono);font-size:.8rem;color:var(--muted);white-space:nowrap}
.map-wrap{position:relative}
canvas.map{display:block;width:100%;height:auto;aspect-ratio:2020/1030;cursor:pointer}
.legend{display:flex;align-items:center;gap:.5rem;font-size:.8rem;color:var(--muted);padding:4px 4px 2px;flex-wrap:wrap}
.legend .ramp{flex:1;min-width:90px;height:8px;border:1px solid var(--line)}
canvas.profile{display:block;width:100%;height:118px}
.profile-lab{display:flex;justify-content:space-between;font-size:.74rem;color:var(--faint);padding:0 4px 4px;font-family:var(--mono)}
.stage-note{font-size:.86rem;color:var(--muted);padding:2px 4px 6px;min-height:1.3em}
.beats{display:flex;flex-direction:column;gap:38vh;padding:4vh 0 26vh}
.beat{background:transparent;max-width:56ch}
.beat:first-child{margin-top:6vh}
.beat h2{font-family:var(--serif);font-weight:640;font-size:clamp(1.45rem,2.4vw,1.9rem);line-height:1.12;margin:0 0 .7rem}
.beat p{margin:0 0 .85rem;color:var(--ink)}
.beat .fact{border-left:3px solid var(--accent);padding:.15rem 0 .15rem .8rem;margin:.9rem 0;color:var(--muted);font-size:.96rem}
.beat .fact b{color:var(--ink)}
.glyphs{display:flex;gap:1.2rem;margin:.9rem 0}
.glyphs figure{margin:0;text-align:center}
.glyphs figcaption{font-size:.8rem;color:var(--muted);margin-top:.25rem}
@media (max-width:900px){
  .story{display:block;padding-top:.5rem}
  .stage-col{top:calc(var(--topbar-h) + 6px);z-index:30}
  .stage{padding:6px 6px 2px}
  canvas.profile{height:86px}
  .beats{gap:30vh;padding:2vh 2px 20vh;position:relative;z-index:1}
  .beat{background:color-mix(in srgb,var(--surface) 94%,transparent);border:1px solid var(--line-soft);
    box-shadow:var(--shadow);padding:1rem 1.05rem}
}
/* sections below the story */
section.block{padding:clamp(28px,5vh,56px) 0;border-top:1px solid var(--line-soft)}
section.block h2{font-family:var(--serif);font-weight:640;font-size:clamp(1.6rem,3vw,2.3rem);line-height:1.1;margin:0 0 .8rem;max-width:26ch}
section.block h3{font-family:var(--serif);font-weight:600;font-size:1.25rem;margin:2rem 0 .5rem}
section.block p{max-width:68ch}
.lede{font-size:1.08rem;color:var(--ink);max-width:64ch}
.muted{color:var(--muted)}
.small{font-size:.9rem}

/* explorer */
.explorer{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr);gap:clamp(20px,3vw,40px);align-items:start}
.controls{display:flex;flex-wrap:wrap;gap:.6rem;align-items:end;margin:1rem 0}
.field{display:flex;flex-direction:column;gap:.3rem;flex:1;min-width:210px}
.field label{font-size:.85rem;font-weight:600;color:var(--muted)}
select,input[type="search"]{font:inherit;font-size:1rem;color:var(--ink);background:var(--surface);
  border:1px solid var(--line);border-radius:6px;padding:.55rem .7rem;width:100%}
.search-wrap{position:relative}
.suggest{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--line);
  border-radius:8px;box-shadow:var(--shadow);z-index:20;max-height:300px;overflow:auto}
.suggest button{display:flex;justify-content:space-between;gap:1rem;width:100%;text-align:left;background:none;
  border:0;border-bottom:1px solid var(--line-soft);padding:.6rem .8rem;font:inherit;color:var(--ink);cursor:pointer}
.suggest button:last-child{border-bottom:0}
.suggest button:hover,.suggest button:focus-visible{background:var(--surface2)}
.suggest .cj{color:var(--muted);font-size:.88rem;white-space:nowrap}
.btn{font:inherit;font-size:.95rem;font-weight:600;border:1px solid var(--line);background:var(--surface);
  color:var(--ink);border-radius:999px;padding:.55rem 1rem;cursor:pointer}
.btn:hover{border-color:var(--accent);color:var(--accent)}
.btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.btn.primary:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.panel{background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);padding:1.1rem 1.2rem}
.panel h3{font-family:var(--serif);font-size:1.35rem;margin:0 0 .2rem;line-height:1.15}
.panel .where{color:var(--muted);margin:0 0 .8rem}
.kv{display:grid;grid-template-columns:auto 1fr;gap:.25rem .9rem;font-size:.96rem;margin:.7rem 0}
.kv dt{color:var(--muted)}
.kv dd{margin:0;font-weight:600;text-align:right;font-family:var(--mono);font-size:.92rem}
.vs{border-top:1px solid var(--line-soft);margin-top:.9rem;padding-top:.8rem}
.vs h4{font-size:.92rem;margin:0 0 .5rem;color:var(--muted);font-weight:600}
.vs-row{display:grid;grid-template-columns:1fr auto auto;gap:.6rem;font-size:.95rem;padding:.28rem 0;border-bottom:1px dashed var(--line-soft)}
.vs-row:last-child{border-bottom:0}
.vs-row .v{font-family:var(--mono);font-size:.9rem}
.vs-row .km{color:var(--faint);font-size:.82rem;font-family:var(--mono)}
.panel .actions{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:1rem;align-items:center}
.share-row{display:flex;align-items:center;gap:.45rem;margin-top:1rem;flex-wrap:wrap}
.share-row .slab{color:var(--muted);font-size:.88rem;margin-right:.2rem}
.share-row a,.share-row button{width:40px;height:40px;border-radius:999px;border:1px solid var(--line-soft);
  background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}
.share-row a:hover,.share-row button:hover{color:var(--accent);border-color:var(--accent)}
.share-row svg{width:17px;height:17px}
@media (pointer:coarse){.share-row a,.share-row button{width:44px;height:44px}}
.share-status{font-size:.86rem;color:var(--muted);min-height:1.2em;margin-top:.4rem}
.reset-map{position:absolute;top:10px;right:10px;z-index:5}
@media (max-width:900px){.explorer{display:block}.panel{margin-top:1rem}}

/* tables */
.tbl-wrap{overflow-x:auto;border:1px solid var(--line);background:var(--surface)}
table.results{border-collapse:collapse;width:100%;font-size:.92rem;min-width:760px}
table.results th,table.results td{padding:.55rem .7rem;border-bottom:1px solid var(--line-soft);text-align:right;vertical-align:top}
table.results th:first-child,table.results td:first-child{text-align:left}
table.results thead th{font-size:.8rem;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface)}
table.results td.num,table.results th.num{font-family:var(--mono);font-size:.86rem}
tr.lit td{background:color-mix(in srgb,var(--accent) 7%,var(--surface))}
html.js tr.extra{display:none}
html.js tr.extra.open{display:table-row}
.verdict{font-weight:700;white-space:nowrap}
.verdict.step{color:var(--accent)}
.more-row{margin-top:.7rem}

/* method, faq, sources */
.method-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 clamp(24px,4vw,56px)}
@media (max-width:820px){.method-grid{grid-template-columns:1fr}}
details.faq{border-bottom:1px solid var(--line-soft);padding:.2rem 0}
details.faq summary{cursor:pointer;font-weight:600;font-size:1.05rem;padding:.7rem 0;font-family:var(--serif)}
details.faq p{margin:.2rem 0 1rem}
.sources{font-size:.95rem}
.sources li{margin-bottom:.5rem}
footer.site{border-top:1px solid var(--line);margin-top:2rem;padding:1.4rem 0 2.2rem;color:var(--muted);font-size:.93rem}
footer.site .wrap{display:flex;flex-wrap:wrap;gap:.6rem 1.6rem;align-items:center}
footer.site a{text-decoration:none}
footer.site a:hover{text-decoration:underline}

/* rail + to-top */
.rail{position:fixed;right:14px;top:50%;transform:translateY(-50%);z-index:40;display:flex;flex-direction:column;gap:9px;
  background:color-mix(in srgb,var(--surface) 82%,transparent);border:1px solid var(--line-soft);border-radius:999px;padding:8px 5px}
.rail a{width:26px;height:26px;display:grid;place-items:center;border-radius:999px;text-decoration:none}
.rail a::before{content:"";width:7px;height:7px;border-radius:99px;background:var(--faint)}
.rail a[aria-current]::before{background:var(--accent);width:9px;height:9px}
.rail .rlab{position:absolute;right:38px;background:var(--ink);color:var(--bg);font-size:.78rem;padding:.2rem .55rem;
  border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none}
.rail a:hover .rlab,.rail a:focus-visible .rlab{opacity:1}
@media (max-width:1240px){.rail{display:none}}
.totop{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:40;width:48px;height:48px;
  border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink);box-shadow:var(--shadow);
  font-size:.72rem;font-weight:700;cursor:pointer;display:grid;place-items:center}
.noscript-box{border:1px solid var(--line);background:var(--surface);padding:1rem 1.2rem;margin:1rem 0}
@media print{.topbar,.rail,.totop,.share-row{display:none!important}.stage-col{position:static}.beats{gap:2rem;padding:0}}

/* cadastre time figure (round 4) */
.timefig{margin:18px 0 8px;padding:16px 16px 6px;border:1px solid var(--line,#d8d2c4);border-radius:10px;background:var(--card,#fffdf7)}
.timefig-head{display:flex;flex-direction:column;gap:3px;margin-bottom:6px}
.timefig-head strong{font-size:15px}
.timefig-head span{font-size:12.5px;color:var(--muted,#6b6557);line-height:1.45}
#timechart{width:100%;height:auto;display:block}
.tc-grid{stroke:var(--line,#ddd6c6);stroke-width:1}
.tc-axis{stroke:var(--ink,#222);stroke-width:1.2}
.tc-lab{fill:var(--muted,#6b6557);font-size:11px}
.tc-line{fill:none;stroke-width:2}
.tc-pool{stroke:#8a6d3b;fill:#8a6d3b}
.tc-buk{stroke:#b33a3a;fill:#b33a3a}
.tc-dot{stroke:none}
.tc-ci{stroke-width:2.4;opacity:.35}
.tc-ann{font-size:12px;stroke:none}
.timefig .tc-line{fill:none}
