/* Atlas prawa — wspólna skórka.
   Kierunek: „atrament” — prawie czarne tło, kremowy tekst i złoty akcent marki Lexedit (granat #0A1F3D,
   krem #FAF8F3, złoto #B8935A rozjaśnione pod ciemne tło). Kroje marki: Fraunces + Inter Tight. */
@import url("../vendor/fonts.css?v=20261020d");

:root {
  --ground: #0b0f17;        /* atrament */
  --ground-deep: #080b11;   /* panele, cień planszy */
  --ground-lift: #141a26;   /* pola, podświetlenia */
  --rule: #242d3d;          /* linie siatki */
  --paper: #f4f1ea;         /* krem marki — tekst główny */
  --ink-muted: #a0a9b8;     /* opisy, osie */
  --ink-faint: #667085;     /* drugorzędne podpisy */
  --brass: #e8b866;         /* złoto marki: zaznaczenie, wybór, „pieczęć” */
  --brass-soft: rgba(232, 184, 102, 0.18);

  /* obszary prawa — paleta kategorii na ciemnym tle */
  --a-administracyjne: #60a5fa;
  --a-podatkowe: #a78bfa;
  --a-cywilne: #f87171;
  --a-karne: #e879f9;
  --a-budowlane: #4ade80;
  --a-ubezpieczenia: #fb923c;
  --a-nieruchomosci: #2dd4bf;
  --a-pracy: #a3e635;
  --a-rodzinne: #fbcfe8;
  --a-inne: #94a3b8;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter Tight", Inter, system-ui, "Helvetica Neue", Arial, sans-serif;

  /* skala typograficzna (≈ kwarta 1.25 od 16px) */
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 2.441rem;
  --t-3xl: 3.815rem;
  --t-4xl: 5.96rem;

  --header-h: 56px;
  --panel-w: 360px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--paper);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* zamiast siatki planu: miękka złota poświata w rogu */
body.plate {
  background-image: radial-gradient(1200px 700px at 85% -10%, rgba(232, 184, 102, 0.07), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 450; line-height: 1.12; margin: 0; letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72, "SOFT" 50; }
p { margin: 0 0 0.8em; }
.serif { font-family: var(--serif); }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- nagłówek planszy ---------- */
.atlas-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 20;
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: linear-gradient(var(--ground) 70%, rgba(11, 15, 23, 0));
}
.atlas-header .brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  font-family: var(--serif); font-size: var(--t-lg); font-weight: 500; }
.atlas-header .brand svg { width: 26px; height: 26px; flex: none; }
.atlas-header .sep { color: var(--ink-faint); margin: 0 -12px; }
.atlas-header .home { font-family: var(--serif); font-size: var(--t-lg); text-decoration: none; white-space: nowrap; }
.atlas-header .plate-no { font-family: var(--serif); color: var(--brass); font-size: var(--t-lg); }
.atlas-header .plate-title { font-family: var(--serif); font-size: var(--t-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atlas-header nav { margin-left: auto; display: flex; gap: 4px; }
.atlas-header nav a {
  font-family: var(--serif); text-decoration: none; color: var(--ink-muted);
  padding: 4px 9px; border-radius: 3px; font-size: var(--t-md);
}
.atlas-header nav a:hover { color: var(--paper); background: var(--ground-lift); }
.atlas-header nav a[aria-current="page"] { color: var(--ground); background: var(--brass); }
.atlas-header .cta {
  font-size: var(--t-sm); white-space: nowrap; text-decoration: none; color: var(--ground); background: var(--paper);
  padding: 6px 12px; border-radius: 999px; font-weight: 600;
}
.atlas-header .cta:hover { background: var(--brass); }

/* znak „Atlas prawa · lexedit.ai” w rogu każdej grafiki — zostaje na zrzutach ekranu */
.atlas-mark {
  position: absolute; right: 16px; top: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 6px; border-radius: 999px;
  background: rgba(11, 15, 23, 0.72); border: 1px solid var(--rule); backdrop-filter: blur(4px);
  font-size: var(--t-xs); color: var(--ink-muted); text-decoration: none; letter-spacing: 0.01em;
}
.atlas-mark svg { width: 16px; height: 16px; }
.atlas-mark b { color: var(--paper); font-weight: 600; }
.atlas-mark:hover { color: var(--paper); border-color: var(--brass); }

/* ---------- układ planszy: płótno + panel ---------- */
.stage { position: fixed; inset: var(--header-h) 0 0 0; display: grid; grid-template-columns: 1fr var(--panel-w); }
.stage.no-panel { grid-template-columns: 1fr; }
.canvas { position: relative; overflow: hidden; }
.canvas > svg, .canvas > canvas { display: block; width: 100%; height: 100%; }

.panel {
  background: var(--ground-deep); border-left: 1px solid var(--rule);
  overflow-y: auto; padding: 24px 24px 40px;
}
.panel h2 { font-size: var(--t-xl); margin-bottom: 6px; }
.panel h3 { font-size: var(--t-lg); margin: 22px 0 8px; }
.panel .lede { color: var(--ink-muted); font-size: var(--t-sm); max-width: 60ch; }
.panel .empty { color: var(--ink-muted); font-family: var(--serif); font-style: italic; }

/* intro planszy — pierwsza rzecz w panelu przed wyborem */
.intro { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.45; color: var(--paper); }
.intro + p { color: var(--ink-muted); font-size: var(--t-sm); }

/* ---------- elementy sterujące ---------- */
.controls {
  position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  pointer-events: none;
}
.controls > * { pointer-events: auto; }
button, .btn, select, input[type="search"], input[type="text"] {
  font: inherit; font-size: var(--t-sm); color: var(--paper);
  background: var(--ground-lift); border: 1px solid var(--rule); border-radius: 3px;
  padding: 6px 12px;
}
button { cursor: pointer; }
button:hover, select:hover { border-color: var(--ink-muted); }
button[aria-pressed="true"] { background: var(--brass); color: var(--ground); border-color: var(--brass); }
input[type="search"]::placeholder, input[type="text"]::placeholder { color: var(--ink-faint); }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.seg button:last-child { border-radius: 0 3px 3px 0; }

/* suwak roku */
.year-scrub { display: flex; align-items: center; gap: 12px; }
.year-scrub .year { font-family: var(--serif); font-size: var(--t-2xl); color: var(--brass); min-width: 3.2ch; line-height: 1; }
input[type="range"] { accent-color: var(--brass); width: min(420px, 40vw); }

/* ---------- dymek ---------- */
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px;
  background: var(--paper); color: var(--ground); border-radius: 3px;
  padding: 8px 11px; font-size: var(--t-sm); line-height: 1.35;
  box-shadow: 0 6px 24px rgba(3, 5, 9, 0.45);
  opacity: 0; transition: opacity 0.12s;
}
.tip.on { opacity: 1; }
.tip b { font-family: var(--serif); font-size: var(--t-md); font-weight: 600; }
.tip .muted { color: #5b6474; }

/* ---------- legenda obszarów ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--t-xs); color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend span.off { opacity: 0.35; }

/* listy w panelu */
.rows { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(36, 45, 61, 0.6); }
.rows li .v { color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows li.click { cursor: pointer; }
.rows li.click:hover { color: var(--brass); }

/* osie d3 */
.axis text { fill: var(--ink-muted); font-family: var(--sans); font-size: 11px; }
.axis path, .axis line { stroke: var(--rule); }
.gridline line { stroke: rgba(36, 45, 61, 0.55); }

.source-note { font-size: var(--t-xs); color: var(--ink-faint); margin-top: 28px; line-height: 1.45; }

@media (max-width: 1280px) { .atlas-header .cta { display: none; } }
@media (max-width: 1200px) {
  .atlas-header { gap: 16px; }
  .atlas-header .brand .wm { display: none; }
  .atlas-header nav { gap: 0; }
  .atlas-header nav a { padding: 4px 6px; font-size: var(--t-sm); }
}
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 62vh auto; position: absolute; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); }
  .atlas-header nav, .atlas-header .cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
