/* Prosto w prawo: jasny, spokojny interfejs. Dużo światła, jeden kolor marki,
   wyraźna hierarchia: tekst przepisu najwyżej, wyjaśnienie pod nim, treść
   od modelu oznaczona i wyciszona. Zasady: docs/brand.md. */

:root {
  --bg: #fcfcfa;
  --surface: #ffffff;
  --tint: #f4f5f1;
  --law-bg: #f6f7f3;
  --fg: #15181c;
  --text: #262b32;
  --muted: #5e6670;
  /* wyciszony tekst: kontrast co najmniej 4,5:1 na tle strony i tła przepisu
     (WCAG 2.1 AA; dawne #8a919a miało 3,1:1 — axe-core, tests/e2e) */
  --faint: #666e77;
  --line: #e5e7e2;
  --line-strong: #d4d7d1;
  --brand: #0f6e5f;
  --brand-hover: #0a5648;
  --brand-ink: #0b4f44;
  --brand-soft: #e6f4f0;
  --brand-line: #bfe0d7;
  --on-brand: #ffffff; /* text on a brand background (buttons, chips) */
  --green: #1c7a4a;
  --green-soft: #e4f4ea;
  --amber: #8a5a00;
  --amber-soft: #fbf1dc;
  --rose: #a8324f;
  --rose-soft: #fbe9ee;
  --orange: #a44f12;
  --orange-soft: #fcefe4;
  --slate: #55606d;
  --slate-soft: #eef0f3;
  --shadow-sm: 0 1px 2px rgba(21, 24, 28, 0.05);
  --shadow: 0 2px 8px rgba(21, 24, 28, 0.05), 0 14px 36px rgba(21, 24, 28, 0.07);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 760px;
  --radius: 14px;
  color-scheme: light;
}

/* ciemny motyw według ustawień systemu (docs/ux.md, etap 3): te same tokeny,
   ciemne tło, jaśniejszy kolor marki dla linków; przyciski marki z ciemnym
   napisem (--on-brand) */
:root { color-scheme: light dark; }
:root.light-only { color-scheme: light; } /* przepis osadzony na cudzej stronie */
@media screen and (prefers-color-scheme: dark) {
  :root:not(.light-only) {
    --bg: #111413;
    --surface: #191d1b;
    --tint: #222725;
    --law-bg: #1b201e;
    --fg: #eef1ee;
    --text: #d6dbd7;
    --muted: #a5ada8;
    --faint: #939c97;
    --line: #2b322f;
    --line-strong: #3a433f;
    --brand: #5cc8ad;
    --brand-hover: #82d8c3;
    --brand-ink: #a7ead8;
    --brand-soft: #16362f;
    --brand-line: #2a5a4f;
    --on-brand: #08201a;
    --green: #6fd69a;
    --green-soft: #173225;
    --amber: #f2c063;
    --amber-soft: #352a12;
    --rose: #f2849c;
    --rose-soft: #3a1a23;
    --orange: #f5a36a;
    --orange-soft: #382215;
    --slate: #aeb8c3;
    --slate-soft: #232930;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 14px 36px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand-soft); }
h1, h2, h3 { color: var(--fg); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

/* ——— icons ——— */
/* Lucide (lucide.dev, ISC licence), lucide-static 1.52.0: the shape as a mask,
   colour from the surrounding text. In HTML <span class="i i-name"
   aria-hidden="true"> (web/page.py, icon; static/app.js, icon); keep a text
   label next to it, an icon alone is rarely unambiguous. New icon: the <svg>
   content from lucide.dev as a data URI like below (stroke='%23000', "<" and
   ">" as %3C, %3E). */
.i { display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.i-circle-user-round { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.925 20.056a6 6 0 0 0-11.851.001'/%3E%3Ccircle cx='12' cy='11' r='4'/%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E"); }
.i-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.i-settings { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.i-folder { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.i-bell { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.268 21a2 2 0 0 0 3.464 0'/%3E%3Cpath d='M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326'/%3E%3C/svg%3E"); }
.i-history { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l4 2'/%3E%3C/svg%3E"); }
.i-log-out { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3C/svg%3E"); }

.i-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
.i-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.i-share-2 { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' x2='15.42' y1='13.51' y2='17.49'/%3E%3Cline x1='15.41' x2='8.59' y1='6.51' y2='10.49'/%3E%3C/svg%3E"); }
.i-chevron-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.i-link { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }
.i-calendar { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v3'/%3E%3Cpath d='M16 2v3'/%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M3 9h18'/%3E%3C/svg%3E"); }
.i-code-xml { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 16 4-4-4-4'/%3E%3Cpath d='m6 8-4 4 4 4'/%3E%3Cpath d='m14.5 4-5 16'/%3E%3C/svg%3E"); }
.i-send { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z'/%3E%3Cpath d='m21.854 2.147-10.94 10.939'/%3E%3C/svg%3E"); }
.i-quote { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z'/%3E%3Cpath d='M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z'/%3E%3C/svg%3E"); }
.i-file-text { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z'/%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5'/%3E%3Cpath d='M10 9H8'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3C/svg%3E"); }
.i-folder-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 10v6'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.i-maximize-2 { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='m21 3-7 7'/%3E%3Cpath d='m3 21 7-7'/%3E%3Cpath d='M9 21H3v-6'/%3E%3C/svg%3E"); }
.i-external-link { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E"); }
.i-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.i-book-open { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v16'/%3E%3Cpath d='M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z'/%3E%3C/svg%3E"); }
.i-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.i-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E"); }
.i-rss { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9'/%3E%3Cpath d='M4 4a16 16 0 0 1 16 16'/%3E%3Ccircle cx='5' cy='19' r='1'/%3E%3C/svg%3E"); }
.i-ellipsis { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E"); }
.i-file-diff { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M9 10h6'/%3E%3Cpath d='M12 13V7'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E"); }
/* ——— nagłówek ——— */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.brand:hover { color: var(--fg); text-decoration: none; }
/* znak: strzałka „prosto i w prawo” jak znak poziomy na jezdni (P-8c) */
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 26V6.5M8 9.5l3-3 3 3M11 18.5h13M21 15.5l3 3-3 3' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  flex: none;
}
.wordmark { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; white-space: nowrap; }
.wordmark mark { background: linear-gradient(transparent 55%, var(--brand-soft) 55%); color: inherit; padding: 0 1px; }
.top nav { display: flex; gap: 4px; }
.top nav a {
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 15.5px;
  white-space: nowrap;
}
.top nav a:hover { color: var(--fg); background: var(--tint); text-decoration: none; }
.top nav a.active { color: var(--fg); font-weight: 600; }
/* "Więcej" with the rest of the navigation: only on a phone (web/page.py, nav) */
.nav-more { display: none; position: relative; }
.nav-more summary { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; white-space: nowrap; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary .i { width: 1em; height: 1em; transition: transform .15s; }
.nav-more[open] summary .i { transform: rotate(180deg); }
.nav-more summary:hover, .nav-more[open] summary { color: var(--fg); background: var(--tint); }
.nav-more:has(a.active) summary { color: var(--fg); font-weight: 600; }
.nav-more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.top nav .nav-more-menu a { display: block; padding: 9px 10px; border-radius: 8px; font-size: 15px; }
.pro-link {
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--brand-ink);
  padding: 7px 14px;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  white-space: nowrap;
}
.pro-link:hover { background: var(--brand-soft); text-decoration: none; }
.pro-link.active { background: var(--brand-soft); }

.banner {
  max-width: var(--measure);
  width: calc(100% - 48px);
  margin: 10px auto 0;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 14.5px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.banner.error { background: var(--orange-soft); color: var(--orange); }

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 64px);
  margin: 0 auto;
  padding: 24px 32px 96px;
}

/* ——— strona główna ——— */

.hero { padding: 8vh 0 0; text-align: center; }
.hero h1 {
  font-size: 50px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.hero .lead {
  margin: 0 auto 36px;
  max-width: 560px;
  text-wrap: balance;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}
.hero .search { text-align: left; }
.hero-note { margin: 18px 0 0; color: var(--faint); font-size: 14px; }
.hero-note b { color: var(--muted); font-weight: 500; }
.examples {
  margin: 26px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.examples-title { color: var(--faint); font-size: 13.5px; margin-top: 34px; }
.examples button,
.examples a {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.examples a { display: inline-flex; align-items: center; text-decoration: none; line-height: normal; }
.examples button:hover,
.examples a:hover { border-color: var(--brand-line); color: var(--brand-ink); background: var(--brand-soft); }

.home-section { margin-top: 112px; }
.home-section > h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
.home-section > .section-lead { color: var(--muted); font-size: 17px; margin: 0 0 32px; max-width: 600px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
}
.steps h3 { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.steps p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }

.demo { border-top: 1px solid var(--line); padding-top: 28px; }
.demo-q { font-size: 23px; font-weight: 650; color: var(--fg); margin: 24px 0 22px; letter-spacing: -0.015em; }
.demo-q::before { content: "Pytanie"; display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.demo .provision { margin-bottom: 0; }
.demo-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 15.5px; }
.demo-note { color: var(--faint); font-size: 13.5px; margin: 14px 0 0; }

.trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 36px; }
.trust div { padding-left: 16px; border-left: 2px solid var(--brand-line); }
.trust h3 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.trust p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.trust-claim { margin: 36px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.015em; color: var(--fg); }

.browse-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
.browse-groups h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; color: var(--muted); }
.browse-groups ul { list-style: none; margin: 0; padding: 0; font-size: 15.5px; line-height: 1.8; }
.browse-all { margin-top: 28px; font-size: 16px; font-weight: 600; }

/* ——— wyszukiwarka ——— */

.search {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#app > .search { margin-bottom: 36px; }
.search:focus-within { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 4px var(--brand-soft); }
.search-row { display: flex; gap: 10px; align-items: flex-end; }
.search textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--fg);
  font: 19px/1.45 var(--sans);
  padding: 11px 12px;
  min-height: 50px;
  max-height: 240px;
}
.search textarea::placeholder { color: var(--faint); }
/* recent questions under the field (static/app.js, recentList): over the
   content, without shifting the page */
.search { position: relative; }
.recent-menu { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 15; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: 15.5px; }
.recent-item { display: flex; align-items: center; border-radius: 9px; }
.recent-item:hover, .recent-item:focus-within { background: var(--tint); }
.recent-q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 9px; }
.recent-q span:not(.i) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-q .i { color: var(--faint); }
.recent-q:focus-visible, .recent-remove:focus-visible { outline-offset: -2px; }
.recent-remove { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; opacity: 0; }
.recent-item:hover .recent-remove, .recent-remove:focus-visible { opacity: 1; }
.recent-remove:hover { color: var(--fg); }
@media (hover: none) { .recent-remove { opacity: 1; } }
.recent-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.recent-foot .link-button { color: var(--muted); }
.btn {
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 22px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: var(--brand-soft); color: var(--brand-ink); }
.btn.secondary:hover { background: var(--brand-line); }
.options {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 2px;
  font-size: 14px;
  color: var(--muted);
}
.options:empty { display: none; }
/* przełącznik wyjaśnienia: jedno ustawienie zamiast list wyboru */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #d3d6d0; transition: background 0.15s; }
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(21, 24, 28, 0.25);
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.switch-label { font-weight: 600; color: var(--fg); font-size: 14.5px; }

/* ——— wyniki: warstwy ——— */

.layer { margin-top: 76px; }
.layer.first { margin-top: 0; }
.layer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 6px; }
.layer-head h2, .section-head h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
.layer-note, .section-note { color: var(--muted); font-size: 15px; margin: 4px 0 22px; line-height: 1.55; }
.section { margin-top: 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.section-head .meta { color: var(--faint); font-size: 14px; white-space: nowrap; }
.refining { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; margin: 0 0 20px; }
/* results skeleton (static/app.js, resultsSkeleton): after a moment, so a
   fast answer never shows it; a calm pulse, no motion with reduced motion */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skeleton { animation: fade 0.25s ease 0.35s both; }
.skel-provision { margin-bottom: 30px; }
.skel-line { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.skel-meta { width: 38%; margin: 14px 0 12px; }
.skel-text { display: grid; gap: 15px; padding: 22px 22px 22px 24px; border-left: 3px solid var(--line-strong); border-radius: 0 12px 12px 0; background: var(--law-bg); }
.skel-text .skel-line { height: 13px; background: #e6e8e2; }
@media (prefers-reduced-motion: no-preference) {
  .skel-line { animation: skel-pulse 1.6s ease-in-out 0.35s infinite; }
}
@keyframes skel-pulse { 50% { opacity: 0.5; } }
.provisional { opacity: 0.6; transition: opacity 0.2s; }
.notice { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-size: 14.5px; line-height: 1.55; }

/* przepis dosłownie (karta „Co mówią przepisy”) */
.verbatim { font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.verbatim::before { content: "✓ "; }
/* one style of headings in the results (docs/ux.md, stage 2): capitals only
   for the label above cards ("Do pełnego obrazu"); a collapsed section is
   plain text with a count, as "Więcej przepisów" (.more-all) */
.lawcard-group > h3 { margin: 40px 0 16px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.lawcard > .layer.explain { margin-top: 48px; } /* right after the main provision */
.lawcard-group.others { margin-top: 32px; border-top: 1px solid var(--line); }
.lawcard-group > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 20px 0; font-size: 16.5px; font-weight: 600; color: var(--muted); }
.lawcard-group > summary::-webkit-details-marker { display: none; }
.lawcard-group > summary::before { content: "›"; color: var(--faint); font-size: 20px; line-height: 1; transition: transform 0.15s; width: 12px; }
.lawcard-group[open] > summary::before { transform: rotate(90deg); }
.lawcard-group > summary:hover { color: var(--fg); }
.lawcard-group > summary .g-count, .more-all > summary .g-count { color: var(--faint); font-size: 14px; font-weight: 500; }

.provision { margin-bottom: 30px; }
.provision.primary { margin-bottom: 36px; }
.prov-why { margin-bottom: 6px; font-size: 13.5px; color: var(--muted); }
.prov-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; }
.src-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 15px; color: var(--muted); }
.src-line a, .src-line .prov-act { color: var(--muted); }
.src-line a:hover { color: var(--brand); }
.src-line .dot { color: var(--faint); }
.prov-label { font-size: 17px; font-weight: 650; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: -0.01em; }
.prov-label:hover { color: var(--brand); }
.provision.primary .prov-label { font-size: 19px; }
.prov-actions { margin-left: auto; display: flex; gap: 2px; }
.prov-actions .ghost { font-size: 13.5px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; }
.prov-actions .ghost .i { width: 1.05em; height: 1.05em; }
/* numerki przypisów, pod którymi wyjaśnienie powołuje się na przepis */
.prov-refs { display: inline-flex; gap: 4px; }
.prov-refs .cite { margin: 0; vertical-align: 0; }
/* tekst ustawy: wyraźnie inny niż objaśnienia, przez tło i pionową linię */
.law-quote, .prov-text {
  margin: 0;
  padding: 20px 24px 20px 26px;
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--law-bg);
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--fg);
}
.provision.small .prov-text { font-size: 16px; line-height: 1.65; color: var(--text); padding: 12px 18px 12px 20px; }
.prov-text .ln { padding-left: calc(var(--d, 0) * 22px); margin: 7px 0; }
.prov-text .hd { font-weight: 650; margin-right: 6px; }
.prov-text .gapline, .prov-text .gap { color: var(--faint); font-size: 14px; }
.prov-text .repealed { color: var(--faint); font-style: italic; }
.prov-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 13.5px; color: var(--faint); }
.law-table { border-collapse: collapse; margin: 8px 0; font: 14.5px/1.5 var(--sans); }
.law-table td { border: 1px solid var(--line-strong); padding: 4px 10px; vertical-align: top; }

mark { background: none; color: inherit; }
.m-value { font-weight: 700; background: linear-gradient(transparent 56%, #ffe9a8 56%); padding: 0 1px; }
.m-value-cond { font-weight: 600; }
.m-cond { font-weight: 600; color: var(--amber); }
.m-time { text-decoration: underline 2px var(--brand-line); text-underline-offset: 3px; }
.m-modal { font-weight: 700; text-decoration: underline 2px var(--brand); text-underline-offset: 3px; }
.m-term { font-weight: 700; background: linear-gradient(transparent 56%, #d3f0df 56%); }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { background: #fff0b3; } 100% { background: transparent; } }

/* ——— „Co to oznacza”: wyjaśnienie z modelu, oznaczone i wyciszone ——— */

.answer { margin-top: 0; }
.answer + .answer, .followup-answer { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.answer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-bottom: 6px; }
.answer-head h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.answer-head h2.sub { font-size: 18px; }
.answer-date { margin: 4px 0 0; color: var(--faint); font-size: 13.5px; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.rating-q { margin: 0 6px 0 0; color: var(--muted); }
.rating textarea { flex: 1 1 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; }
.rating-keep { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-right: auto; }
.verdict { font-size: 13.5px; font-weight: 600; border-radius: 999px; padding: 5px 13px; white-space: nowrap; }
.verdict.wprost { background: var(--green-soft); color: var(--green); }
.verdict.zalezy { background: var(--amber-soft); color: var(--amber); }
.verdict.brak { background: var(--slate-soft); color: var(--slate); }
.auto-note { margin: 0 0 28px; font-size: 13.5px; line-height: 1.6; color: var(--faint); }
.ai-badge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--slate); background: var(--slate-soft); border-radius: 999px; padding: 2px 9px; margin-right: 4px; vertical-align: 1px; }
.answer-label, .cond-map h3 { margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.answer-text { font-size: 18px; line-height: 1.75; color: var(--text); }
.answer-text p { margin: 0 0 12px; }
.answer-text ul { margin: 0 0 12px; padding-left: 1.3em; }
.answer-text li { margin: 0 0 4px; padding-left: 2px; }
.answer-text li::marker { color: var(--faint); }
.answer-text.streaming > :last-child::after, .answer-text.streaming > ul:last-child > li:last-child::after { content: "▍"; color: var(--brand); animation: blink 1s steps(2) infinite; margin-left: 2px; }
.answer-text.streaming > ul:last-child::after { content: none; }
@keyframes blink { 50% { opacity: 0; } }
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  margin: 0 1px 0 2px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font: 600 12.5px/1 var(--sans);
  vertical-align: 2px;
  cursor: pointer;
}
.cite:hover { background: var(--brand); color: var(--on-brand); }
.cite.flash { animation: cite-flash 1.8s ease-out; }
@keyframes cite-flash { 0%, 40% { background: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 4px var(--brand-line); } }
.cites { white-space: nowrap; margin-left: 3px; }
.amount-check { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--rose-soft); color: var(--rose); font-size: 14.5px; line-height: 1.55; }
.answer-foot { margin-top: 20px; color: var(--faint); font-size: 13.5px; line-height: 1.55; }
.answer .pending { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 16px; padding: 6px 0; }
.warn { color: var(--orange); }
.tech-details { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.tech-details summary { cursor: pointer; color: var(--faint); }
.tech { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 10px 0 0; padding: 12px 16px; background: var(--tint); border-radius: 12px; font-size: 13.5px; }
.tech dt { color: var(--faint); font-size: 12px; margin-bottom: 2px; }
.tech dd { margin: 0; color: var(--text); }
.tech b { color: var(--fg); }
.eta { display: flex; flex-direction: column; gap: 10px; width: 100%; color: var(--muted); font-size: 15px; }
.eta-bar { height: 6px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.eta-fill { width: 0; height: 100%; background: var(--brand); border-radius: 999px; }
/* dopytanie: wyraźne pole jak główna wyszukiwarka; z pytaniami modelu na
   osobnym tle, żeby nie zlewało się z wyjaśnieniem nad nim */
.ask-more { margin-top: 44px; }
.ask-more.asking { margin-top: 48px; padding: 26px 28px 28px; border-radius: 18px; background: color-mix(in srgb, var(--brand-soft) 60%, var(--bg)); }
.ask-more-label { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.ask-more-title { margin: 0 0 14px; font-size: 19px; font-weight: 650; line-height: 1.35; }
.ask-more-questions { list-style: none; margin: 0 0 22px; padding: 0; font-size: 17px; line-height: 1.55; color: var(--fg); }
.ask-more-questions li { display: flex; gap: 12px; padding: 7px 0; }
.ask-more-questions .cond-icon { background: var(--amber-soft); color: var(--amber); }
.followup { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); padding: 8px 8px 8px 16px; }
.followup:focus-within { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 4px var(--brand-soft); }
.followup input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 17px/1.4 var(--sans); color: var(--fg); padding: 8px 0; }
.followup input::placeholder { color: var(--faint); }
.followup textarea.prepared { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 17px/1.4 var(--sans); color: var(--fg); padding: 8px 0; resize: none; overflow: hidden; cursor: pointer; }
.asked { margin: -2px 0 12px; color: var(--muted); font-size: 15.5px; font-style: italic; }
.understood { margin-top: 14px; color: var(--muted); font-size: 14px; }
.understood summary { cursor: pointer; color: var(--muted); }
.understood ul { margin: 8px 0 0; padding-left: 20px; }
.pro-hint { margin-top: 44px; }
p.pro-hint { color: var(--faint); font-size: 15px; }
/* reszta przepisów zwinięta pod jednym nagłówkiem */
.more-all { margin-top: 20px; border-top: 1px solid var(--line); }
.more-all > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 20px 0; font-size: 16.5px; font-weight: 600; color: var(--muted); }
.more-all > summary::-webkit-details-marker { display: none; }
.more-all > summary::before { content: "›"; color: var(--faint); font-size: 20px; line-height: 1; transition: transform 0.15s; width: 12px; }
.more-all[open] > summary::before { transform: rotate(90deg); }
.more-all > summary:hover { color: var(--fg); }
.more-all > .section:first-of-type { margin-top: 8px; }
/* podobne sprawy pod wynikami (etap G3a) */
.similar > .section-note { margin: 0 0 4px; font-size: 14.5px; }
.similar .refs.results li:last-child { border-bottom: 0; }
.similar .chip { margin-left: 8px; vertical-align: 1px; }

/* mapa warunków: przepis i jego skutek, pod nim warunki i wyjątki, każdy
   z oceną słowami w osobnym wierszu (✓ spełniony, ✗ niespełniony,
   ? do ustalenia); pismo jak w tekście, nie drobny dopisek */
.cond-map { margin: 4px 0 18px; }
.cond-map h3 { margin-top: 40px; margin-bottom: 14px; }
.cond-note { text-transform: none; letter-spacing: 0; color: var(--amber); font-weight: 600; }
.cond-provision { border-top: 1px solid var(--line); padding: 24px 0 10px; }
.cond-provision:first-of-type { border-top: 0; padding-top: 0; }
.cond-head { font-weight: 600; font-size: 17px; }
.cond-effect { margin: 8px 0 12px; font-size: 17px; line-height: 1.65; color: var(--fg); }
.cond-list { list-style: none; margin: 0; padding: 0; font-size: 17px; line-height: 1.55; color: var(--text); }
.cond-list li { display: flex; gap: 12px; padding: 9px 0; }
.cond-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 700 13px/1 var(--sans); margin-top: 1px; }
.cond-list li.ok .cond-icon { background: var(--green-soft); color: var(--green); }
.cond-list li.no .cond-icon { background: var(--slate-soft); color: var(--slate); }
.cond-list li.warn .cond-icon { background: var(--amber-soft); color: var(--amber); }
.cond-list li.unknown .cond-icon { background: var(--amber-soft); color: var(--amber); }
.cond-status { margin-top: 2px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.cond-status b { font-weight: 600; }
.cond-list li.ok .cond-status b { color: var(--green); }
.cond-list li.no .cond-status b { color: var(--slate); }
.cond-list li.warn .cond-status b { color: var(--amber); }
.cond-ask { font-size: inherit; }
.cond-list li.unknown .cond-status b { color: var(--amber); }
.cond-kind { font-weight: 650; color: var(--fg); }
mark.from-law { cursor: help; }

/* ——— powiązane przepisy: lista kart ——— */

.card { padding: 20px 0 18px; border-top: 1px solid var(--line); }
.card:last-child { border-bottom: 1px solid var(--line); }
.card.cited { border-top: 0; padding-top: 0; }
.card-head { display: flex; align-items: flex-start; gap: 16px; }
.card-title { flex: 1; min-width: 0; }
.eyebrow { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.card-title .label { font-size: 18px; font-weight: 650; color: var(--fg); cursor: pointer; background: none; border: 0; padding: 0; text-align: left; letter-spacing: -0.01em; }
.card-title .label:hover { color: var(--brand); }
.card-title .ttl { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.card-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; margin-top: 2px; }
.ghost {
  font-size: 14px;
  color: var(--muted);
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.ghost:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }

.law { font-size: 17px; line-height: 1.7; color: var(--text); margin: 12px 0 4px; }
.law .ln { padding-left: calc(var(--d, 0) * 24px); margin: 4px 0; }
.law .hd { font-weight: 650; margin-right: 6px; color: var(--fg); }
.law a.hd { color: var(--brand); }
.law .heading { font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--muted); margin: 26px 0 10px; letter-spacing: 0.01em; }
.law .heading-title { margin-left: 10px; font-weight: 500; color: var(--text); }
.judgment a.ref-link, .law a.ref-link { color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.judgment a.ref-link:hover, .law a.ref-link:hover { text-decoration-color: var(--brand); background: var(--brand-soft); border-radius: 3px; }
.law a.ref-link.ext::after { content: "↗"; font-size: 0.72em; margin-left: 2px; vertical-align: 0.3em; }
.law .repealed { color: var(--faint); font-style: italic; }
.law .annex { white-space: pre-line; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.law.clip { max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.card .law { padding-left: 14px; border-left: 2px solid var(--line-strong); font-size: 16.5px; }
.more { margin-top: 2px; }
.more button { border: 0; background: none; padding: 0; color: var(--brand); font-size: 14px; cursor: pointer; }
.more button:hover { text-decoration: underline; text-underline-offset: 3px; }

.why { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--faint); }
.why .by { color: var(--faint); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--tint);
  color: var(--muted);
}
.chip.src { background: var(--tint); color: var(--muted); }
.chip.src.llm { background: var(--slate-soft); color: var(--slate); }
.chip.general { background: var(--slate-soft); color: var(--slate); }
.chip.cocite { background: var(--amber-soft); color: var(--amber); }
.chip.ref { background: var(--slate-soft); color: var(--slate); }
.chip.def { background: var(--green-soft); color: var(--green); }
.chip.pending { background: var(--orange-soft); color: var(--orange); }
.chip.recent { background: var(--brand-soft); color: var(--brand-ink); }
.why .from a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.why .from a:hover { color: var(--brand); text-decoration-color: currentColor; }

/* dołożone: zwinięte grupy */
.group { border-top: 1px solid var(--line); padding: 2px 0; }
.group:last-child { border-bottom: 1px solid var(--line); }
.group > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; padding: 16px 4px; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: "›"; color: var(--faint); font-size: 20px; line-height: 1; transition: transform 0.15s; transform: translateY(1px); width: 12px; }
.group[open] > summary::before { transform: rotate(90deg) translateX(1px); }
.group .g-title { font-size: 16.5px; font-weight: 650; color: var(--fg); }
.group .g-hint { color: var(--muted); font-size: 14px; flex: 1; }
.group .g-count { color: var(--faint); font-size: 14px; }
.group .cards { padding: 0 0 12px; }
.card.compact { padding: 14px 0 12px; }
.card.compact:last-child { border-bottom: 0; }
.card.compact .label { font-size: 16.5px; }
.card.compact .law { font-size: 15.5px; margin: 6px 0 0; }
.card.compact .law .ln { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.compact .why { margin-top: 8px; }

.empty, .loading, .error-box { text-align: center; color: var(--muted); padding: 56px 0; font-size: 16px; }
.error-box { color: var(--orange); }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ——— panel przepisu ——— */

.scrim { position: fixed; inset: 0; background: rgba(21, 24, 28, 0.22); z-index: 30; animation: fade 0.18s; }
@keyframes fade { from { opacity: 0; } }
.panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(720px, calc(100vw - 24px));
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(21, 24, 28, 0.2);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide 0.2s ease-out;
}
.panel:focus { outline: none; } /* fokus z kodu dla czytnika; obramówki mają elementy w środku */
@keyframes slide { from { transform: translateX(28px); opacity: 0.5; } }
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.panel-bar > .icon:first-child { margin-left: -8px; }
/* ślad przejść po linkach w panelu: okruszki poprzednich przepisów */
.panel-trail { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.panel-trail:empty { display: none; }
.panel-trail a { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.panel-trail a::after { content: "›"; margin-left: 6px; color: var(--faint); }
.panel-title { flex: 1; font-size: 14.5px; color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 17px; }
.icon:hover { background: var(--tint); color: var(--fg); }
.panel-body { overflow-y: auto; padding: 30px 40px 56px; }

.unit .crumbs { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.unit .crumbs > * + *::before { content: "›"; display: inline-block; margin: 0 6px 0 2px; color: var(--faint); }
.unit .crumbs a { color: var(--muted); }
.unit .crumbs a:hover { color: var(--brand); text-decoration: none; }
.unit h1 { font-size: 30px; line-height: 1.2; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; }
.unit .sub { color: var(--muted); font-size: 15.5px; }
.unit .toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
/* strona przepisu: kopiuj link, kopiuj cytat, udostępnij (static/share.js) */
.toolbar.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.pill {
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover { border-color: var(--brand-line); color: var(--brand); text-decoration: none; }
.pill.primary { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.pill.primary:hover { background: var(--brand-line); color: var(--brand-ink); }
/* button with an icon (web/page.py, icon): icon before the label, menu chevron after */
.pill:has(.i) { display: inline-flex; align-items: center; gap: 7px; }
.pill .i { color: var(--muted); }
.pill:hover .i, .pill.primary .i { color: inherit; }
.pill .i-chevron-down { width: 0.95em; height: 0.95em; margin: 0 -3px 0 -1px; }
/* menu under a button (web/page.py, dropdown; static/share.js) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.dropdown[open] > summary .i { color: inherit; }
.dropdown-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 25; min-width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.dropdown-menu.to-left { left: auto; right: 0; }
.dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; white-space: nowrap; cursor: pointer; }
.dropdown-menu button:hover, .dropdown-menu button:focus-visible { background: var(--tint); color: var(--fg); outline-offset: -2px; }
.dropdown-menu .i { color: var(--muted); }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 15px; white-space: nowrap; }
.dropdown-menu a:hover, .dropdown-menu a:focus-visible { background: var(--tint); color: var(--fg); text-decoration: none; outline-offset: -2px; }
/* bar under the act title (web/page.py, act_page): Obserwuj, Na dzień, Więcej */
.act-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 18px; }
.act-bar .toolbar.keep { margin: 0; }
.dropdown-menu .on-date { display: grid; gap: 8px; margin: 0; padding: 6px 8px 8px; }
.dropdown-menu .on-date label { display: grid; gap: 6px; }
.dropdown-menu .on-date input[type="date"] { padding: 7px 10px; font-size: 15px; }
.dropdown-menu .on-date button.pill { display: inline-flex; justify-content: center; width: auto; padding: 7px 14px; border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); font-size: 14.5px; }
/* buttons under a provision or document in one row: share, cite, watch,
   add to folder (docs/ux.md) */
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 14px 0 4px; }
.actions > .toolbar.share, .actions > .toolbar.keep { margin: 0; }
.actions > .folder-pick { flex-basis: 100%; }
/* toast after copying (static/share.js): bottom of the screen, hides itself */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--fg); color: var(--bg); font-size: 15px; box-shadow: var(--shadow); animation: fade 0.15s ease; max-width: calc(100vw - 32px); }
.toast .i { color: #9fe3cf; }
.unit .law { font-size: 18px; line-height: 1.75; margin-top: 20px; }
.unit .law-quote { margin-top: 20px; }
.unit .law-quote .law { margin: 0; padding: 0; }
.unit h2, .doc h2 { font-size: 13px; line-height: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); margin: 40px 0 14px; }
.change { padding: 12px 16px; margin-bottom: 10px; border-radius: 12px; background: var(--orange-soft); font-size: 15px; }
.change.in-force { background: var(--brand-soft); }
.change .when { font-weight: 600; color: var(--fg); }
.change .units { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.refs { list-style: none; padding: 0; margin: 0; font-size: 15.5px; columns: 2; column-gap: 28px; }
.refs li { break-inside: avoid; padding: 4px 0; }
.refs .kind { color: var(--faint); font-size: 12.5px; margin-left: 6px; }
.terms { font-size: 16.5px; line-height: 1.7; color: var(--text); }
.source-note { margin-top: 40px; padding: 14px 18px; background: var(--tint); border-radius: 12px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.source-note b { color: var(--text); font-weight: 600; }

/* wyszukiwarka w tekście (panel, strona przepisu, cała ustawa) */
.find {
  position: sticky;
  top: 72px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 22px -12px 6px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border-radius: 14px;
}
.find input {
  flex: 1;
  min-width: 0;
  font: 15px/1.4 var(--sans);
  color: var(--fg);
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a919a' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") no-repeat 12px center;
}
.find input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.find input::-webkit-search-cancel-button { cursor: pointer; }
.find-count { min-width: 64px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon.small { width: 32px; height: 32px; font-size: 15px; }
.panel-body .find { top: -30px; }
mark.found { background: #fff0a0; color: inherit; border-radius: 3px; }
mark.found.current { background: #ffc94d; box-shadow: 0 0 0 2px #ffc94d; }

/* ——— zmiany jak w GitHubie ——— */

ins, del { text-decoration: none; border-radius: 4px; padding: 1px 2px; }
ins { background: #abf2bc; color: #0f3d1d; text-decoration: underline; text-decoration-color: rgba(15, 61, 29, 0.45); text-underline-offset: 2px; }
/* zmiana nie tylko kolorem: dla czytników ekranu słowo przed i po (WCAG 1.4.1) */
ins::before, ins::after, del::before, del::after { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
ins::before { content: " [dodano: "; }
del::before { content: " [usunięto: "; }
ins::after, del::after { content: "] "; }
del { background: #ffcecb; color: #6e0b17; text-decoration: line-through; text-decoration-color: rgba(110, 11, 23, 0.45); }
.law .diffline { margin-left: calc(var(--d, 0) * 24px - 12px); padding: 4px 10px 4px 12px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; }
.law .diffline.add { background: #e6ffec; border-left-color: #1a7f37; }
.law .diffline.del { background: #ffebe9; border-left-color: #cf222e; }
.law .diffline.mod { background: #fff8e6; border-left-color: #d4a72c; }
.law .diffline.add::before, .law .diffline.del::before { font: 600 13px/1 var(--sans); margin-right: 8px; }
.law .diffline.add::before { content: "+"; color: #1a7f37; }
.law .diffline.del::before { content: "−"; color: #cf222e; }
.law .diffline .chip { vertical-align: 2px; }
.diffblock { margin: 6px 0 10px calc(var(--d, 0) * 24px); padding: 10px 14px; background: #fff8e6; border-left: 3px solid #d4a72c; border-radius: 0 8px 8px 0; font-size: 15.5px; }
.diffblock .cap { font-size: 13px; line-height: 1.5; color: var(--muted); margin-bottom: 6px; }
.pill.diff-toggle.on { background: #fff8e6; border-color: #eed9a0; color: #7a5a06; }
.diffprev { margin: 8px 0 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; line-height: 1.65; color: var(--text); }
.diffprev .who { display: block; font-size: 12.5px; line-height: 1.4; font-weight: 600; color: var(--brand); margin-bottom: 4px; }

/* ——— strony aplikacji: zmiany, historia, koszty, sprawdzian ——— */

.page-title { font-size: 38px; line-height: 1.12; font-weight: 700; margin: 4vh 0 12px; letter-spacing: -0.025em; }
.page-lead { color: var(--muted); margin: 0 0 28px; font-size: 17px; max-width: 640px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--tint); border-radius: 12px; margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; border-radius: 9px; padding: 8px 16px; cursor: pointer; font-size: 14.5px; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); font-weight: 600; }
.day { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.day .date { font-size: 18px; line-height: 1.3; font-weight: 650; color: var(--fg); }
.day .date small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.5; font-weight: 400; margin-top: 2px; }
.day .item { margin-bottom: 16px; font-size: 15.5px; }
.day .item:last-child { margin-bottom: 0; }
.day .item .act { font-size: 12.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 2px; }
.day .item .units { color: var(--muted); font-size: 14px; margin-top: 4px; }
.more-changes { margin: 8px 0 24px; }
.undated { margin: 24px 0; }
.undated summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.act-groups { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.act-groups .acts b { font-weight: 600; color: var(--fg); margin-right: 4px; }
.act-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); margin: 4px 0 8px; max-width: 100%; }
.act-pick select { font: inherit; color: var(--fg); padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); max-width: min(100%, 480px); }

.hint { color: var(--muted); font-size: 14.5px; margin: -4px 0 12px; line-height: 1.55; }
.hist-list { display: flex; flex-direction: column; gap: 12px; }
.hist { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hist-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.hist-head .when { font-weight: 600; }
.op { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.op.dodanie { background: var(--green-soft); color: var(--green); }
.op.uchylenie { background: var(--rose-soft); color: var(--rose); }
.op.wyrazy, .op.brzmienie { background: var(--brand-soft); color: var(--brand-ink); }
.hist-diff { line-height: 1.6; font-size: 15px; }
.hist > .hist-diff { margin-top: 8px; }
.hist-note { color: var(--muted); font-size: 14.5px; }
.hist-text summary { cursor: pointer; color: var(--brand); font-size: 14px; }
.hist-text div { margin-top: 8px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.hist-src { margin-top: 8px; font-size: 13px; color: var(--muted); }
.hist-stats { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }
.ver-text { white-space: pre-wrap; }
.hist.ver-now { border-color: var(--brand-line); }
.ver-pick { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.ver-pick input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; }
.ver-at { margin: 0 0 18px; }
.ver-box { background: var(--tint); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip-filter { border: 1px solid var(--line-strong); background: transparent; color: var(--fg); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 14px; cursor: pointer; }
.chip-filter.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.year { margin-bottom: 28px; }
.year-head { font-size: 22px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.event:last-child { border-bottom: 0; }
.event-date { font-weight: 600; font-size: 15px; }
.event-date small { display: block; font-weight: 400; color: var(--muted); }
.event-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 14px; }
.badge { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }
.event.tekst-jednolity .badge { background: var(--tint); color: var(--muted); }
.event.wyrok-TK .badge { background: var(--amber-soft); color: var(--amber); }
.event.future .badge { background: var(--brand); color: var(--on-brand); }
.event-title { font-size: 15px; line-height: 1.5; margin-bottom: 8px; }
.event-note { font-size: 13px; color: var(--muted); }
.event-points { margin-top: 10px; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.points-date { font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
.points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.points li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.points .words { font-size: 14px; }
.muted { color: var(--muted); }
.digest { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--slate-soft); font-size: 15px; line-height: 1.6; }
.digest ul { margin: 8px 0; padding-left: 20px; }
.digest li + li { margin-top: 4px; }
.digest-lead { font-weight: 600; margin: 0 0 6px; }
.digest-note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.cost-card { border-top: 1px solid var(--line); padding: 24px 0; }
.cost-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cost-head h2 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 650; }
.cost-head .meta { color: var(--muted); font-size: 14px; }
.meter { height: 8px; background: var(--tint); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.meter-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-label { color: var(--muted); font-size: 13.5px; }
.stat-value { font-size: 26px; line-height: 1.3; font-weight: 650; color: var(--fg); margin-top: 2px; letter-spacing: -0.01em; }
.stat-note { color: var(--faint); font-size: 13px; }
.cost-note { color: var(--muted); font-size: 14px; margin: 16px 0 0; line-height: 1.55; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cost-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.cost-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); }
.cost-table td:not(:first-child), .cost-table th:not(:first-child) { text-align: right; }
.sources-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 8px 0 4px; }
.sources-table th { text-align: left; font-weight: 600; padding: 10px 12px 10px 0; vertical-align: top; width: 34%; }
.sources-table td { padding: 10px 12px 10px 0; color: var(--text); vertical-align: top; }
.sources-table td:last-child { color: var(--muted); white-space: nowrap; }
.sources-table tr { border-bottom: 1px solid var(--line); }

.back { margin: 0 0 8px; font-size: 14px; }
.filters .chip { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13.5px; padding: 5px 12px; }
.filters .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.case { border-top: 1px solid var(--line); padding: 20px 0; }
.case-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; }
.case-sig { font-weight: 600; color: var(--fg); }
.case-head .grade { margin-left: auto; }
.grade { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.grade.good { background: var(--green-soft); color: var(--green); }
.grade.mid { background: var(--amber-soft); color: var(--amber); }
.grade.bad { background: var(--rose-soft); color: var(--rose); }
.grade.none { background: var(--slate-soft); color: var(--slate); }
.case-q { font-size: 17.5px; line-height: 1.5; font-weight: 650; color: var(--fg); margin: 10px 0 6px; }
.case-more { margin: 6px 0; font-size: 14.5px; color: var(--text); }
.case-more summary { cursor: pointer; color: var(--muted); }
.case-more p { white-space: pre-line; margin: 6px 0 0; }
.case-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.case-col { background: var(--tint); border-radius: 12px; padding: 12px 16px; font-size: 14.5px; line-height: 1.6; }
.case-col h3 { margin: 0 0 8px; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.case-col p { margin: 0 0 8px; }
.answer-text.small { font-size: 14.5px; line-height: 1.6; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 20px; }
.tile { border-top: 2px solid var(--brand-line); padding: 16px 0 4px; }
.tile-value { font-size: 44px; line-height: 1.1; font-weight: 700; color: var(--fg); letter-spacing: -0.02em; }
.tile-unit { font-size: 16px; line-height: 1; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile-label { margin-top: 8px; font-size: 15.5px; color: var(--text); }
.tile-note { margin-top: 6px; font-size: 13.5px; color: var(--faint); }
.checkup-note { max-width: 680px; font-size: 16px; color: var(--text); }
.checkup-note.small { font-size: 14px; color: var(--muted); line-height: 1.55; }
.checkup-link { font-size: 15.5px; }
.models { margin: 40px 0 8px; }
.models h2 { font-size: 22px; line-height: 1.3; font-weight: 650; margin: 0 0 14px; }
.table-scroll { overflow-x: auto; margin: 0 0 14px; }
.models-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.models-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; line-height: 1.35; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.models-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.models-table small.ci { display: block; color: var(--faint); font-size: 12px; white-space: nowrap; }
.models-table .model-name { font-weight: 600; color: var(--fg); margin-right: 6px; }
.models-table .badge { margin-right: 4px; }
.cases-table tr.clickable { cursor: pointer; }
.cases-table tr.clickable:hover td { background: var(--tint); }
.cases-table .grade { display: inline-block; margin-bottom: 4px; }
.case-q-small { font-size: 14px; color: var(--text); margin-top: 4px; min-width: 220px; max-width: 360px; }
.answers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
/* na szerokim ekranie wyjaśnienia modeli obok siebie szerzej niż kolumna treści */
@media (min-width: 1100px) {
  .answers-grid { position: relative; left: 50%; transform: translateX(-50%); width: min(1180px, calc(100vw - 64px)); }
}
.answer-col h3 .grade { margin-left: auto; }
.answer-col .cond-map { margin-top: 12px; }
.judge-conds { list-style: none; padding: 0; margin: 12px 0 8px; font-size: 13.5px; line-height: 1.5; }
.judge-conds li + li { margin-top: 4px; }
.judge-conds li.ok { color: var(--green); }
.judge-conds li.no { color: var(--rose); }
.urzad-conds { margin: 4px 0 8px; padding-left: 20px; }
.given-sources { list-style: none; padding: 0; margin: 8px 0; font-size: 14.5px; }
.given-sources summary { cursor: pointer; }
.given-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; background: var(--law-bg); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ——— strony renderowane na serwerze (web/page.py, web/changes.py) ——— */

.doc .crumbs { font-size: 14px; color: var(--muted); margin: 8px 0 14px; }
.doc .crumbs a { color: var(--muted); }
.doc .crumbs a:hover { color: var(--brand); }
.doc h1 { font-size: 34px; line-height: 1.15; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.025em; }
.doc h1 .act { display: block; font-size: 16px; line-height: 1.45; font-weight: 400; color: var(--muted); margin-top: 8px; letter-spacing: 0; }
.doc .act-eyebrow { font-size: 14.5px; font-weight: 600; color: var(--brand-ink); margin: 0 0 8px; }
.doc .act-eyebrow a { color: inherit; }
.doc h3 { font-size: 16.5px; line-height: 1.4; font-weight: 650; margin: 28px 0 8px; }
.doc .ttl { color: var(--muted); font-size: 16px; margin: 0 0 8px; }
.doc .badges, .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 6px; font-size: 14.5px; color: var(--muted); }
.doc .badges:empty { display: none; }
.meta-row .dot { color: var(--faint); }
.doc > .law, .doc .reader-grid > .law { font-size: 18px; line-height: 1.75; margin-top: 20px; }
.doc > .law { padding: 18px 22px 18px 24px; border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; background: var(--law-bg); }
.doc .hint { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.doc .source-note { margin-top: 24px; }
.doc .ctx li { margin-bottom: 8px; }
.doc .ctx-text { color: var(--muted); font-size: 14.5px; }
details.more-section { margin-top: 36px; border-top: 1px solid var(--line); }
details.more-section > summary { cursor: pointer; list-style: none; padding: 16px 0; display: flex; align-items: baseline; gap: 12px; }
details.more-section > summary::-webkit-details-marker { display: none; }
details.more-section > summary::before { content: "›"; color: var(--faint); font-size: 20px; line-height: 1; transition: transform 0.15s; width: 12px; }
details.more-section[open] > summary::before { transform: rotate(90deg); }
details.more-section > summary h2 { margin: 0; }
details.more-section > summary .g-hint { color: var(--muted); font-size: 14px; }
details.more-section > div { padding: 0 0 12px; }
.doc .acts-filter { width: 100%; font: 16.5px var(--sans); padding: 12px 16px; margin: 20px 0 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.doc .acts-filter:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.doc .acts-group .kind { font-weight: 400; }
.doc .law .ln[id] { scroll-margin-top: 80px; }

/* strony informacyjne: jak to działa, dla profesjonalistów */
.doc.prose h1 { font-size: 40px; margin: 3vh 0 14px; }
.doc.prose .lead { color: var(--muted); font-size: 19px; line-height: 1.55; margin: 0 0 40px; max-width: 620px; text-wrap: balance; }
.doc.prose h2 { font-size: 24px; line-height: 1.25; font-weight: 700; text-transform: none; letter-spacing: -0.02em; color: var(--fg); margin: 56px 0 14px; }
.doc.prose p, .doc.prose li { font-size: 17px; line-height: 1.65; }
.doc.prose ul { padding-left: 22px; }
.doc.prose li { margin: 6px 0; }
.doc.prose .steps { margin: 24px 0 0; }
.doc.prose .trust { margin: 24px 0 0; }
.doc.prose .cta { margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.doc.prose .cta .btn { display: inline-block; text-decoration: none; }
.doc.prose .soon { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: 2px; }
.doc.prose .plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 24px; }
.doc.prose .plans h3 { margin: 0 0 6px; }
.doc.prose .plans ul { margin: 0; }
.doc.prose h2[id] { scroll-margin-top: 120px; }
.human-check { margin: 12px 0; }
.doc.prose .byok { margin: 18px 0 10px; }
.doc.prose .byok-note { font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; }
.doc.prose .byok details { margin-top: 12px; }
.doc.prose .byok summary { cursor: pointer; color: var(--brand-ink); }
.doc.prose .byok-key { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.doc.prose .byok-key input { flex: 1 1 260px; font: inherit; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); }
.doc.prose .byok [hidden] { display: none; }
.doc.prose .faq dt { font-weight: 650; margin-top: 18px; }
.doc.prose .faq dd { margin: 4px 0 0; color: var(--text); }

/* account and login (web/auth.py): header account entry (web/page.py,
   ACCOUNT; static/account.js), login buttons on the page and in the offer
   under results, account page. "Zaloguj się" without a session, an avatar
   with an initial and a menu with one; the signed-in class on <html>, set
   before first paint (page.SIGNED_IN_JS), decides, so the header never jumps */
.account { position: relative; display: flex; align-items: center; flex: none; }
.account-login { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; padding: 7px 4px; }
.account-login:hover { color: var(--fg); text-decoration: none; }
.account-login .i { width: 22px; height: 22px; }
.account-button { display: none; padding: 2px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.signed-in .account-login { display: none; }
.signed-in .account-button { display: inline-flex; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 15px; font-weight: 650; line-height: 1; transition: box-shadow 0.15s; }
.avatar .i { width: 18px; height: 18px; }
.account-button:hover .avatar, .account-button[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--brand-line); }
.account-button:focus-visible { outline-offset: 2px; border-radius: 50%; }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 272px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: 15px; }
.account-menu .account-head { display: grid; gap: 2px; margin: 0 0 6px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.35; }
.account-email { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-quota { color: var(--muted); font-size: 13.5px; }
.account-quota:empty { display: none; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover, .account-menu a:focus-visible, .account-menu button:focus-visible { background: var(--tint); color: var(--fg); text-decoration: none; outline-offset: -2px; }
.account-menu .i { color: var(--muted); }
.account-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
/* first-login prompt about question history (static/account.js) */
dialog.prompt { width: calc(100% - 32px); max-width: 440px; padding: 26px 26px 22px; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.prompt::backdrop { background: rgba(21, 24, 28, 0.35); }
.prompt-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.prompt-mark .i { width: 22px; height: 22px; }
.prompt h2 { margin: 14px 0 8px; font-size: 21px; line-height: 1.3; }
.prompt p { margin: 0 0 22px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.doc.prose.narrow { max-width: 560px; }
.doc.prose .small, .small { font-size: 14.5px; }
.login { display: grid; gap: 12px; max-width: 420px; margin: 8px 0 24px; }
.login form { margin: 0; display: grid; gap: 10px; }
.login .btn { width: 100%; text-align: center; }
.btn.google { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); }
.btn.google:hover { background: var(--tint); }
/* znak Google na przycisku (wytyczne marki Google: „G” w kolorach) */
.g-mark {
  width: 20px;
  height: 20px;
  flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.login-or { margin: 0; text-align: center; color: var(--faint); font-size: 14.5px; }
.login-email label { font-size: 15px; font-weight: 600; color: var(--fg); }
.login-email input { font: 17px/1.4 var(--sans); padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--fg); }
.login-email input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.login-offer { margin-top: 16px; }
.form-error { color: var(--rose); background: var(--rose-soft); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.explain-note { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.explain-left { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; }
.account-left { font-size: 20px; font-weight: 650; color: var(--fg); margin: 0 0 6px; }
.account-facts { margin-top: 0; }
.account-delete { display: grid; gap: 12px; justify-items: start; }
.account-delete input[type="email"] { width: 100%; max-width: 420px; font: 17px/1.4 var(--sans); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--fg); }
.account-delete input[type="email"]:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.btn.danger-solid { background: var(--rose); color: #fff; }
.btn.danger-solid:hover { background: #8e2742; }
.btn .i { margin-right: 8px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.field-row { display: flex; gap: 8px; width: 100%; }
.field-row input { flex: 1; min-width: 0; }

/* account page (web/page.py, account_page): settings in cards like large
   services, section index at the side on desktop and on top on phones;
   account deletion as a plain link in the last card, confirmed on its own page */
.doc.settings-page { max-width: 1040px; }
.settings-head { display: flex; align-items: center; gap: 16px; margin: 3vh 0 28px; }
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 24px; }
.settings-who { flex: 1; min-width: 0; }
.doc.prose .settings-who h1 { margin: 0; font-size: 30px; }
.doc.prose .settings-who p { margin: 2px 0 0; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.settings-head .account-out { margin: 0; }
.settings { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 36px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: grid; gap: 2px; }
.settings-nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 15px; }
.settings-nav a:hover { background: var(--tint); color: var(--fg); text-decoration: none; }
.settings-body { display: grid; gap: 20px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; scroll-margin-top: 84px; }
.card > :last-child { margin-bottom: 0; }
.doc.prose .card h2 { font-size: 19px; margin: 0 0 14px; }
.doc.prose .card h3 { font-size: 16px; margin: 22px 0 8px; }
.doc.prose .card .account-facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 20px; }
.doc.prose .card .account-facts li { margin: 0; font-size: 15px; color: var(--muted); }
.card .folder-new { margin-top: 14px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc.prose .card-foot h3 { margin: 0 0 2px; font-size: 15.5px; }
.card-foot p { margin: 0; }
.quiet-link { color: var(--rose); font-size: 15px; font-weight: 600; white-space: nowrap; }
.quiet-link:hover { color: #8e2742; }
@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
}
@media (max-width: 600px) {
  .settings-head { flex-wrap: wrap; margin-top: 8px; }
  .avatar.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
  .settings-head .account-out { flex-basis: 100%; }
  .card { padding: 18px 16px; }
  .card-foot { flex-direction: column; align-items: flex-start; }
}
.btn.danger { background: var(--rose-soft); color: var(--rose); }
.btn.danger:hover { background: #f6d3dc; }
/* zapowiedź wyjaśnienia pod przepisami i „Zapytaj o swoją sytuację” (etap C) */
.teaser .teaser-text { font-size: 17px; line-height: 1.6; color: var(--text); margin: 6px 0 0; max-width: 640px; }
.teaser .pro-hint { margin-top: 18px; }
.ask-own { margin: 36px 0 8px; padding: 22px 22px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ask-own h2 { margin: 0 0 12px; }
.ask-form { display: flex; gap: 10px; align-items: flex-end; }
.ask-form textarea { flex: 1; min-width: 0; font: 17px/1.45 var(--sans); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); color: var(--fg); resize: vertical; }
.ask-form textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.ask-own .small { margin: 10px 0 0; }
@media (max-width: 720px) { .ask-form { flex-direction: column; align-items: stretch; } }
/* doładowanie (web/payments.py): pakiety, zgoda, BLIK jako pierwszy przycisk */
.topup { display: grid; gap: 14px; max-width: 560px; margin: 8px 0 0; }
.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.package { position: relative; display: grid; gap: 2px; padding: 14px 14px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.package:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.package input { position: absolute; opacity: 0; pointer-events: none; }
.package-amount { font-size: 20px; font-weight: 700; color: var(--fg); }
.package-bonus { font-size: 13.5px; font-weight: 600; color: var(--green); }
.package-answers { font-size: 13.5px; color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.consent input { margin-top: 4px; flex: none; }
.invoice summary { cursor: pointer; color: var(--brand-ink); font-size: 15px; }
.invoice input { display: block; margin-top: 6px; font: 16px/1.4 var(--sans); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.invoice label { font-size: 14px; color: var(--muted); }
.topup-pay { display: flex; flex-wrap: wrap; gap: 10px; }
.topup-pay .btn { flex: 1 1 200px; white-space: normal; }
@media (max-width: 720px) { .packages { grid-template-columns: 1fr; } }
table.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
table.ledger th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px 6px 0; }
table.ledger td { border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; }
table.ledger .num { text-align: right; white-space: nowrap; padding-right: 0; }
/* obserwowanie (web/watches.py, static/keep.js): przycisk przy przepisie,
   ustawie, dokumencie i wynikach; lista i skrót na stronie konta */
.toolbar.keep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.keep-note { color: var(--muted); font-size: 14.5px; }
.keep-note a { text-decoration: underline; text-underline-offset: 3px; }
.refs.watch-list, .refs.folder-list, .doc.prose .refs.watch-list, .doc.prose .refs.folder-list { columns: 1; padding-left: 0; }
.watch-list li, .folder-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
form.inline { display: inline; margin-left: auto; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: 14.5px; color: var(--brand-ink); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--brand); }
.digest-form { display: grid; gap: 12px; justify-items: start; margin-top: 18px; }
.digest-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.digest-form legend { font-weight: 600; color: var(--fg); margin-bottom: 6px; }
.digest-form label { font-size: 16px; }
/* teczki i notatka z researchu (web/folders.py, static/keep.js, folder.js) */
.folder-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 15px; }
.folder-pick select, .folder-pick input, .folder-form input, .folder-form textarea, .folder-new input { font: 16px/1.4 var(--sans); padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--fg); }
.folder-pick input { flex: 1 1 220px; min-width: 0; }
.folder-new, .folder-form { display: grid; gap: 8px; justify-items: start; max-width: 560px; margin: 18px 0 0; }
.folder-form textarea { width: 100%; resize: vertical; }
.folder-new label, .folder-form label { font-size: 15px; font-weight: 600; color: var(--fg); }
.folder-settings { margin: 8px 0 24px; }
.folder-settings summary { cursor: pointer; color: var(--brand-ink); font-size: 15px; }
.folder-delete { display: grid; gap: 10px; justify-items: start; margin-top: 18px; }
.folder-item { padding: 6px 0 16px; border-bottom: 1px solid var(--line); }
.doc .folder-item h2 { margin: 26px 0 10px; font-size: 20px; line-height: 1.3; font-weight: 650; text-transform: none; letter-spacing: -0.01em; color: var(--fg); }
.folder-item h2 a { color: inherit; text-decoration-color: var(--brand-line); }
.folder-item .law { padding: 14px 18px 14px 20px; border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; background: var(--law-bg); }
.folder-item .hint { margin: 8px 0 0; }
.folder-thesis { font-size: 16.5px; line-height: 1.6; color: var(--text); }
.folder-text p { margin: 0 0 10px; }
.folder-controls { display: flex; gap: 14px; margin-top: 8px; }
.folder-controls form.inline { margin-left: 0; }
.refs.folder-cited { columns: 1; margin: 6px 0; }
.fn-ref { font-size: 0.75em; margin-left: 2px; }
ol.footnotes, ul.folder-sources { font-size: 15px; line-height: 1.6; padding-left: 22px; overflow-wrap: anywhere; }
ol.footnotes li, ul.folder-sources li { margin: 4px 0; }
/* historia pytań na koncie (web/history.py) */
.history-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 8px 0; }
.history-toggle .switch-label { font-size: 16px; font-weight: 500; }
.history-search { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.history-search input { flex: 1 1 240px; min-width: 0; font: 16px/1.4 var(--sans); padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--fg); }
.history-clear { display: grid; gap: 10px; justify-items: start; margin-top: 28px; }

/* odesłanie rozwinięte w tekście */
.judgment a.ref-link[data-ref]::after, .law a.ref-link[data-ref]::after, .law a.ref-link.expandable::after { content: "▸"; font-size: 0.55em; margin-left: 2px; color: var(--brand); opacity: 0.8; vertical-align: 0.15em; }
.judgment a.ref-link.open, .law a.ref-link.open { background: var(--brand-soft); border-radius: 3px; text-decoration-color: var(--brand); }
.judgment a.ref-link.open::after, .law a.ref-link.open::after { content: "▾"; }
/* pojęcie ze słowniczka ustawy (corpus/terms.py): tekst jak przepis,
   kropkowane podkreślenie; dotknięcie rozwija definicję jak odesłanie */
.law a.ref-link.def { color: inherit; text-decoration-style: dotted; text-decoration-color: var(--muted); }
.law a.ref-link.def::after, .law a.ref-link.def.open::after { content: none; }
.ref-box {
  margin: 6px 0 14px calc(var(--d, 0) * 24px + 24px);
  padding: 10px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--brand-line);
  border-left: 3px solid var(--brand);
  border-radius: 4px 12px 12px 4px;
  box-shadow: var(--shadow-sm);
}
.ref-box-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.4; color: var(--muted); padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--brand-line); }
.ref-box-kind { font-size: 11.5px; line-height: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--brand); }
.ref-box-head a { flex: 1; color: var(--fg); font-weight: 600; }
.ref-box-close { flex: none; border: 1px solid var(--brand-line); background: var(--surface); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 13px; line-height: 1.3; cursor: pointer; }
.ref-box-close:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ref-box .law { font-size: 16px; line-height: 1.65; margin: 0; padding: 0; border: 0; background: none; }
.ref-box .law .ln { margin: 3px 0; }
.ref-box-more { margin-top: 6px; font-size: 13.5px; }
.ref-box-loading { color: var(--muted); font-size: 14px; }

/* strona ustawy: cały tekst ze spisem treści jako nawigacją i wyszukiwarką
   w obrębie ustawy */
.reader-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
.reader-grid > .law { min-width: 0; }
.toc-nav { margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; }
.toc-nav > summary { cursor: pointer; font-weight: 600; color: var(--fg); padding: 8px 0; list-style: none; }
.toc-nav > summary::-webkit-details-marker { display: none; }
.toc-nav > summary::before { content: "▸ "; color: var(--brand); }
.toc-nav[open] > summary::before { content: "▾ "; }
.toc-nav nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 12px; }
.toc-nav nav a { color: var(--muted); text-decoration: none; padding: 3px 8px 3px calc(var(--d, 0) * 14px + 8px); border-radius: 6px; }
.toc-nav nav a:hover { color: var(--brand); background: var(--brand-soft); }
.toc-nav .toc-title { color: var(--text); margin-left: 6px; }
.reader-find { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; }
.reader-find input { flex: 1; min-width: 0; font: 14.5px/1.4 var(--sans); color: var(--fg); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.reader-find input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.reader-find .find-count { min-width: 0; font-size: 12.5px; }
.law .heading, .law .ln { scroll-margin-top: 72px; }

/* skład tekstu ustawy na stronie ustawy: kolumna do czytania (ok. 70 znaków),
   artykuł jako blok z numerem nad tekstem, § i punkty z numerem w marginesie
   (wcięcie wiszące), nagłówki w trzech stopniach, wartości pogrubione,
   słowa warunku oznaczone kropkowanym podkreśleniem */
.doc.reader .reader-grid > .law { max-width: 46rem; font-size: 18px; line-height: 1.65; margin-top: 8px; }
.doc.reader .law .ln { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: .6rem; padding-left: calc(var(--d, 0) * 1.7rem); margin: .4rem 0; }
.doc.reader .law .ln > .hd { margin: 0; font-weight: 600; color: var(--muted); min-width: 2.2rem; font-variant-numeric: tabular-nums; }
.doc.reader .law .ln[data-kind="par"] > .hd, .doc.reader .law .ln[data-kind="ust"] > .hd { color: var(--fg); }
.doc.reader .law .ln[data-kind="art"] { display: block; padding-left: 0; margin: 2.1rem 0 .5rem; }
.doc.reader .law .ln[data-kind="art"] + .ln[data-kind="par"], .doc.reader .law .ln[data-kind="art"] + .ln[data-kind="ust"] { margin-top: .2rem; }
.doc.reader .law .ln[data-kind="art"] > .hd { display: block; font-size: 15px; line-height: 1.2; font-weight: 600; letter-spacing: .01em; color: var(--brand); margin: 0 0 .4rem; }
.doc.reader .law .ln[data-kind="art"] > .hd:hover { text-decoration: underline; }
.doc.reader .law .ln[data-kind="art"] > .tx { display: block; }
.doc.reader .law .ln.repealed-unit { color: var(--faint); font-size: .92em; margin: .9rem 0 .2rem; }
.doc.reader .law .ln.repealed-unit > .hd { color: var(--faint); }
/* uchylony artykuł w jednym wierszu: „Art. 4. (uchylony)” */
.doc.reader .law .ln.repealed-unit[data-kind="art"] { margin: .9rem 0 .2rem; }
.doc.reader .law .ln.repealed-unit[data-kind="art"] > .hd, .doc.reader .law .ln.repealed-unit[data-kind="art"] > .tx { display: inline; font-size: 14px; }
.doc.reader .law .ln.repealed-unit[data-kind="art"] > .hd { margin-right: .4rem; }
.doc.reader .law .ln.repealed-unit[data-kind="art"] + .ln.repealed-unit[data-kind="art"] { margin-top: .2rem; }
.doc.reader .law .heading { margin: 3.2rem 0 1rem; }
.doc.reader .law .heading .heading-title { display: block; margin: .3rem 0 0; letter-spacing: 0; text-transform: none; color: var(--fg); }
.doc.reader .law .heading[data-kind="czesc"], .doc.reader .law .heading[data-kind="ksiega"], .doc.reader .law .heading[data-kind="tytul"], .doc.reader .law .heading[data-kind="dzial"] { font-size: 13px; line-height: 1.4; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: 3.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.doc.reader .law .heading[data-kind="czesc"] .heading-title, .doc.reader .law .heading[data-kind="ksiega"] .heading-title, .doc.reader .law .heading[data-kind="tytul"] .heading-title, .doc.reader .law .heading[data-kind="dzial"] .heading-title { font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; }
.doc.reader .law .heading[data-kind="rozdzial"] { font-size: 12.5px; line-height: 1.4; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 2.8rem; }
.doc.reader .law .heading[data-kind="rozdzial"] .heading-title { font-size: 19px; line-height: 1.35; font-weight: 650; letter-spacing: -0.01em; }
.doc.reader .law .heading[data-kind="oddzial"] { font-size: 12px; line-height: 1.4; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 2.2rem; }
.doc.reader .law .heading[data-kind="oddzial"] .heading-title { font-size: 16.5px; line-height: 1.35; font-weight: 650; }
.doc.reader .law .heading[data-kind="zal"] { font-size: 13px; line-height: 1.4; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 3.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.doc.reader .law .annex { font-size: 14px; }
@media (max-width: 720px) {
  .doc.reader .reader-grid > .law { font-size: 17px; line-height: 1.6; }
  .doc.reader .law .ln { padding-left: calc(var(--d, 0) * 1rem); column-gap: .45rem; }
  .doc.reader .law .ln[data-kind="art"] { margin-top: 1.7rem; }
}

/* w warstwie pierwszej wyników sekcje nie mają górnego odstępu (jest nad nią
   pole pytania); między „Przepis z pytania” a „Co mówią przepisy” zostaje */
.layer.first > .section { margin-top: 0; }
.layer.first > .section ~ .section { margin-top: 48px; }

/* ——— stopka ——— */

.foot { border-top: 1px solid var(--line); margin-top: 24px; }
.foot-inner { max-width: calc(var(--measure) + 64px); margin: 0 auto; padding: 32px 32px 48px; color: var(--faint); font-size: 14px; line-height: 1.6; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 18px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--brand); }
.foot-note { margin: 0 0 8px; max-width: 640px; }
.foot-asof { margin: 0; }
.foot-asof b { color: var(--muted); font-weight: 500; }

/* previous and next article under the text (web/page.py, _neighbors) */
.unit-pager { display: flex; justify-content: space-between; gap: 16px; margin: 20px 0 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15.5px; }
.unit-pager a { padding: 6px 10px; margin: -6px -10px; border-radius: 8px; font-weight: 500; }
.unit-pager a:hover { background: var(--tint); text-decoration: none; }
/* signed in: the note under "Zapytaj o swoją sytuację" waits for /api/me
   (static/ask.js) instead of showing "sign in" for a moment */
.signed-in .ask-own .ask-note:not(.filled) { visibility: hidden; }
/* "Przejdź do…" (Ctrl+K, static/jump.js): palette at the top of the screen */
dialog.jump { width: min(640px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 120px)); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18); overflow: hidden; }
dialog.jump::backdrop { background: rgba(20, 24, 22, 0.32); }
.jump-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.jump-field .i { color: var(--muted); width: 20px; height: 20px; }
.jump-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 18px/1.4 var(--sans); color: var(--fg); }
.jump-field kbd { font: 12px var(--sans); color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
dialog.jump ul { list-style: none; margin: 0; padding: 6px; max-height: 420px; overflow-y: auto; }
dialog.jump li { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 15.5px; }
dialog.jump li[aria-selected="true"] { background: var(--tint); }
.jump-kind { flex: none; width: 88px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); }
.jump-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
@media (max-width: 720px) {
  dialog.jump { margin-top: 12px; }
  .jump-kind { width: 64px; font-size: 11.5px; }
  .jump-field kbd { display: none; }
}

/* changes in law (web/changes.py): a row opens the difference */
.refs.changes li { padding: 4px 0; }
details.chg > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; }
details.chg > summary::-webkit-details-marker { display: none; }
details.chg > summary::after { content: "›"; color: var(--faint); transition: transform .15s; }
details.chg[open] > summary::after { transform: rotate(90deg); }
details.chg > summary b { color: var(--brand); font-weight: 500; }
details.chg .hist-diff { margin: 8px 0 6px; }
details.chg .chg-open { font-size: 14.5px; }

/* API keys on the account page (web/apikeys.py) */
.table-wrap { overflow-x: auto; }
.inline-form { display: grid; gap: 8px; justify-items: start; max-width: 560px; margin: 18px 0 0; }
.inline-form label { font-size: 15px; font-weight: 600; color: var(--fg); }
.inline-form input { font: 16px/1.4 var(--sans); padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--fg); width: 100%; }
.inline-form .btn { display: inline-flex; align-items: center; gap: 8px; }
table.api-keys code { font-size: 13px; color: var(--muted); }
table.api-keys .quiet-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
table.api-keys td.act { padding-left: 20px; text-align: right; }
.api-key-done { margin-top: 20px; }
.api-key-done .btn { text-decoration: none; }
.api-key-value { width: 100%; font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px 12px; border: 1px solid var(--brand-line); border-radius: 10px; background: var(--brand-soft); color: var(--fg); }
pre.code { overflow-x: auto; padding: 12px 14px; border-radius: 10px; background: var(--tint); font-size: 13.5px; }
/* "Na dzień" in the results (static/app.js, dayPicker, wordingOn) */
.law-state { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.day-pick { position: relative; }
.day-pick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.day-pick > summary::-webkit-details-marker { display: none; }
.day-pick[open] > summary, .day-pick > summary:hover { color: var(--fg); border-color: var(--brand-line); }
.day-pick-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; font-size: 14px; }
.day-pick-box input { font: inherit; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--fg); }
.day-chip { font-size: 13px; font-weight: 600; padding: 4px 12px; border: 0; cursor: pointer; }
.wording-on { margin: 0 0 10px; min-height: 22px; }
.wording-on.differs { padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); }
.wording-note { margin: 0; font-size: 14.5px; color: var(--text); }
.wording-note.same { display: flex; align-items: center; gap: 6px; color: var(--green); }
.wording-note.unknown { color: var(--muted); }
.wording-on .hist-diff { margin-top: 8px; }

/* ——— wąski ekran ——— */

/* nagłówek w dwóch wierszach, zanim jeden przestanie się mieścić (tablet,
   wąskie okno): znak i „Dla profesjonalistów”, pod nimi nawigacja i konto */
@media (max-width: 1100px) {
  .top-inner { gap: 8px 14px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 8px; }
  .top-inner::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .top nav { order: 3; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; margin: 0 0 0 -12px; }
  .top nav::-webkit-scrollbar { display: none; }
  .account { order: 1; }
}
@media (max-width: 720px) {
  .meta-row .dot { display: none; } /* wrapped rows would start with "·" */
  .act-bar { gap: 6px; }
  .act-bar .pill { padding-left: 11px; padding-right: 11px; }
  .top-inner { padding: 12px 16px 8px; }
  .top nav { margin: 0 0 0 -8px; overflow: visible; }
  .top nav .nav-wide { display: none; }
  .nav-more { display: block; }
  .top nav a { padding: 6px 10px; font-size: 15px; }
  .pro-link { padding: 6px 11px; font-size: 13.5px; }
  .account-login span:not(.i) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .account-login { padding: 4px 0; }
  .account-login .i { width: 26px; height: 26px; }
  .top-inner { column-gap: 10px; }
  .account-button { padding: 0; }
  .avatar { width: 30px; height: 30px; font-size: 14px; }
  .wordmark { font-size: 17px; }
  .cost-table th:nth-child(3), .cost-table td:nth-child(3), .cost-table th:nth-child(4), .cost-table td:nth-child(4) { display: none; }
  main { padding: 16px 16px 64px; }
  .hero { padding-top: 5vh; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: 17px; margin-bottom: 26px; }
  .home-section { margin-top: 72px; }
  .home-section > h2 { font-size: 24px; }
  .steps, .trust, .browse-groups, .doc.prose .plans { grid-template-columns: 1fr; gap: 22px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search textarea { flex: none; font-size: 17px; }
  .card-head { flex-wrap: wrap; }
  .card-actions { width: 100%; margin-left: -9px; }
  .answer-sources ol, .refs { columns: 1; }
  .panel { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .panel-body { padding: 22px 18px 40px; }
  .panel-body .find { top: -22px; }
  .day { grid-template-columns: 1fr; gap: 8px; }
  .event { grid-template-columns: 1fr; gap: 4px; }
  .case-cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .law .ln { padding-left: calc(var(--d, 0) * 16px); }
  .law-quote, .prov-text, .doc > .law { padding: 12px 14px 12px 16px; font-size: 16.5px; }
  .prov-text .ln { padding-left: calc(var(--d, 0) * 14px); }
  .prov-actions { margin-left: 0; width: 100%; }
  .ask-more.asking { padding: 20px 16px 18px; margin-left: -4px; margin-right: -4px; }
  .followup { padding-left: 12px; }
  .ref-box { margin-left: calc(var(--d, 0) * 16px + 8px); padding: 10px 12px; }
  .ref-box-head { flex-wrap: wrap; }
  .page-title { font-size: 30px; }
  .doc h1 { font-size: 28px; }
  .doc.prose h1 { font-size: 32px; }
  .foot-inner { padding: 24px 16px 40px; }
}
@media (min-width: 1100px) {
  .doc.reader { max-width: 1240px; }
  .reader-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .toc-nav { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; padding-right: 8px; margin: 24px 0 0; }
  .toc-nav > summary { display: none; }
  .toc-nav nav { display: flex; }
}

/* ——— przegląd zmian w prawie (web/briefs.py): przepis przed i po, pod nim
   wyjaśnienie z przypisami, źródła, poprawki; panel właściciela ——— */

.brief { margin: 36px 0 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h2.brief-title { margin: 0 0 6px; font-size: 26px; line-height: 1.25; font-weight: 700; text-transform: none; letter-spacing: -0.015em; color: var(--fg); }
.brief-title .act { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.brief h3 { margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.brief h4 { margin: 18px 0 6px; font-size: 16px; color: var(--fg); }
.brief-text { font-size: 17px; line-height: 1.7; }
.brief-text > p { font-size: 18px; margin: 0 0 10px; }
.brief-list { margin: 0 0 8px; padding-left: 20px; }
.brief-list li { margin: 6px 0; }
.brief .auto-note { margin: 12px 0 0; }
.brief-sources { font-size: 14.5px; line-height: 1.55; color: var(--muted); padding-left: 22px; }
.brief-sources li { margin: 6px 0; }
.brief-sources li:target { background: #fff8e6; border-radius: 6px; }
.fn-quote { display: inline; margin-left: 6px; }
.fn-quote summary { display: inline; cursor: pointer; color: var(--brand); font-size: 13.5px; }
.fn-quote blockquote { margin: 8px 0; padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--law-bg); white-space: pre-line; color: var(--text); font-size: 14.5px; }
.brief-fixes { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--text); font-size: 14.5px; }
.brief-fixes h4 { margin: 0 0 6px; }
.brief-fixes ul { margin: 0; padding-left: 18px; }
.review { margin: 12px 0 20px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface); }
.review-meta { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.review-row { margin: 10px 0 14px; }
.review-row textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.5; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.review-row.rejected textarea { border-color: var(--rose); background: var(--rose-soft); }
.review-row label { font-size: 14px; }
.review-problems { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.review-row.rejected .review-problems { color: var(--rose); }
.review .toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.review-fix { display: flex; gap: 8px; margin-top: 10px; }
.review-fix input { flex: 1; min-width: 0; font: inherit; font-size: 14.5px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; }

/* ——— udostępnianie odpowiedzi (static/app.js, web/shared.py) ——— */

.share-box { margin: 18px 0 6px; }
.share-label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.share-box textarea { width: 100%; font: inherit; font-size: 15.5px; line-height: 1.5; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.share-url { flex: 1; min-width: 220px; font: inherit; font-size: 14.5px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--tint); }
.share-msg { margin: 8px 0 0; font-size: 14px; color: var(--rose); }
.shared-q { font-size: 28px; }
.shared-unit { margin: 0 0 18px; }
.shared-unit-head { font-weight: 600; margin-bottom: 4px; }
.shared-unit-head .cite { cursor: default; }
.shared-unit:target { background: #fff8e6; border-radius: 10px; }

/* ——— stały link do brzmienia, przepis osadzony w ramce (web/page.py) ——— */

.ver-link { font-size: 13px; margin-left: 4px; }
body.embed { min-height: 0; background: var(--surface); }
.embed-main { padding: 14px 18px 10px; }
.embed-head { font-weight: 650; font-size: 17px; margin-bottom: 4px; }
.embed-head .act { font-weight: 400; color: var(--muted); margin-left: 6px; }
.embed .law { font-size: 16px; margin: 6px 0; }
.embed-foot { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* orzeczenia i interpretacje u nas (etap G1): treść dosłownie, sekcje źródła,
   miejsce omawiania przepisu wyróżnione, zakrycia danych (G4) */
.judgment { margin: 8px 0 24px; }
/* the provision next to a judgment (web/documents.py, _beside_open) */
.beside-box { margin: 12px 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--law-bg); }
.beside-box > summary { cursor: pointer; font-weight: 600; color: var(--fg); }
.beside-box .law { margin: 10px 0 0; font-size: 15px; background: none; padding: 0; border: 0; }
.beside-link { margin: 10px 0 0; font-size: 14.5px; }
.beside-then { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--text); font-size: 14px; }
@media (min-width: 1180px) {
  .judgment-page:has(.beside-grid) { max-width: 1180px; }
  .beside-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
  .beside-grid > .beside { grid-column: 2; grid-row: 1; position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .beside-grid > .judgment { grid-column: 1; grid-row: 1; }
  .beside-box { margin-top: 8px; }
  .beside-box > summary { pointer-events: none; list-style: none; }
  .beside-box > summary::-webkit-details-marker { display: none; }
}
.judgment h2 { font-size: 18px; margin: 28px 0 10px; }
.judgment p { margin: 0 0 12px; line-height: 1.7; }
.judgment mark { background: var(--brand-soft); color: inherit; padding: 0 2px; border-radius: 3px; scroll-margin-top: 96px; }
.masked { color: var(--muted); font-size: 0.92em; background: var(--tint); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.facet { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 8px 0; font-size: 14.5px; }
.facet b { font-weight: 600; margin-right: 4px; }
.facet .chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13.5px; padding: 4px 11px; }
.facet .chip:hover { border-color: var(--brand-line); text-decoration: none; }
.facet .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pager { display: flex; gap: 18px; margin: 18px 0 8px; }
/* wyszukiwarka orzeczeń (etap G2): pole jak na stronie głównej, wyniki w jednej kolumnie */
.doc-search { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.doc-search input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 18px/1.45 var(--sans); padding: 10px 12px; }
.refs.results { columns: 1; margin-top: 8px; }
.refs.results li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.refs.results .ctx-text, .refs.results .snippet { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 4px; }
.snippet mark { background: var(--brand-soft); color: inherit; padding: 0 1px; border-radius: 3px; }
/* opis przepisu prostym językiem (answer/plain.py): pod tekstem przepisu */
.plain { margin: 18px 0 8px; padding: 14px 16px; background: var(--tint); border-radius: 12px; }
.plain h2 { margin-top: 0; }
.plain p { margin: 0 0 6px; line-height: 1.65; }
.plain .hint { margin: 6px 0 0; font-size: 13.5px; }

/* linki w tekście nie tylko kolorem (WCAG 1.4.1, axe link-in-text-block):
   delikatne podkreślenie w akapitach, notach i stopce dokumentu */
p a, .source-note a, .hint a, .foot-note a, .lead a, main li a:not([class]) {
  text-decoration: underline;
  text-decoration-color: var(--brand-line);
  text-underline-offset: 3px;
}
p a:hover, .source-note a:hover, .hint a:hover { text-decoration-color: currentColor; }
/* zanim aplikacja narysuje widok, stopka nie wskakuje na górę ekranu
   (przesunięcie układu, CLS 0,4 na stronie głównej — Lighthouse) */
#app:empty { min-height: 100vh; }

/* druk (master-plan.md, czytelnia P1): tekst przepisu, ustawy albo orzeczenia
   bez nawigacji, przycisków i stopki serwisu; adres i stan prawny zostają
   w nocie źródła, linki z adresem przy odesłaniach */
@media print {
  .top, .foot, .toolbar, .share, .toc-nav, .banner, .scrim, .panel,
  .search, .examples, .pager, .facet, details:not([open]),
  .feedback, .pro-link, .no-print, .folder-pick { display: none !important; }
  .folder-item { border-color: #999; }
  .folder-sources a, .footnotes a { color: #000; }
  .footnotes a[href^="#"] { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  main.doc, #app { max-width: none; padding: 0; margin: 0; }
  a { color: #000; text-decoration: none; }
  .source-note a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .law, .law-quote, .plain, .source-note { background: none; border-color: #999; }
  h1, h2 { break-after: avoid; }
  .law p, .judgment p { orphans: 3; widows: 3; }
}
/* cała ustawa na dzień (web/page.py, act_on_page) */
.on-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; font-size: 14.5px; color: var(--muted); }
.on-date input[type="date"] { font: inherit; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--fg); }
.on-day { margin: 0 0 14px; }
.on-day-now { font-size: 13.5px; }

/* narrowest phones: logo and "Dla profesjonalistów" in one row, the account
   at the end of the navigation row */
@media (max-width: 400px) {
  .brand { gap: 8px; }
  .wordmark { font-size: 16px; }
  .pro-link { font-size: 13px; padding: 5px 9px; }
}
@media (max-width: 380px) {
  .account { order: 4; }
}

/* poradniki (web/guides.py): przepis dosłownie nad wyjaśnieniem */
.guide-law { margin: 12px 0 14px; padding: 12px 16px; border-left: 3px solid var(--brand); background: var(--law-bg); border-radius: 0 10px 10px 0; }
.guide-law p { margin: 0; white-space: pre-line; }
.guide-law footer { margin-top: 8px; font-size: 14px; }

/* teczka: powiadomienia o zmianach w jej przepisach (web/folders.py) */
.folder-follow { margin: 20px 0 8px; }
.folder-follow p { margin: 0 0 8px; }

/* ciemny motyw: kolory wpisane na stałe (podświetlenia, różnice); na końcu,
   żeby wygrały z regułami wyżej; druk zostaje jasny (screen) */
@media screen and (prefers-color-scheme: dark) {
  :root:not(.light-only) .switch .track { background: #3a433f; }
  :root:not(.light-only) .skel-text .skel-line { background: #262c29; }
  :root:not(.light-only) .m-value { background: linear-gradient(transparent 56%, #5a4a14 56%); }
  :root:not(.light-only) .m-term { background: linear-gradient(transparent 56%, #1f4a35 56%); }
  @keyframes flash { 0%, 30% { background: #5a4a14; } 100% { background: transparent; } }
  :root:not(.light-only) mark.found { background: #5a4a14; }
  :root:not(.light-only) mark.found.current { background: #8a6d12; box-shadow: 0 0 0 2px #8a6d12; }
  :root:not(.light-only) ins { background: #1f4d2c; color: #b8f0c6; text-decoration-color: rgba(184, 240, 198, 0.45); }
  :root:not(.light-only) del { background: #5a1f25; color: #ffc9cd; text-decoration-color: rgba(255, 201, 205, 0.45); }
  :root:not(.light-only) .law .diffline.add { background: #16301f; border-left-color: #3fb26a; }
  :root:not(.light-only) .law .diffline.del { background: #351a1d; border-left-color: #e5534b; }
  :root:not(.light-only) .law .diffline.mod, :root:not(.light-only) .diffblock, :root:not(.light-only) .brief-sources li:target, :root:not(.light-only) .shared-unit:target { background: #2f2711; }
  :root:not(.light-only) .law .diffline.add::before { color: #3fb26a; }
  :root:not(.light-only) .law .diffline.del::before { color: #e5534b; }
  :root:not(.light-only) .pill.diff-toggle.on { background: #2f2711; border-color: #5a4a14; color: #f2c063; }
  :root:not(.light-only) .btn.danger-solid { color: #22080f; }
  :root:not(.light-only) .btn.danger-solid:hover { background: #f5a3b5; }
  :root:not(.light-only) .btn.danger:hover { background: #4a1f2b; }
  :root:not(.light-only) .quiet-link:hover { color: #f5a3b5; }
  :root:not(.light-only) .toast .i { color: #1c7a64; }
}
