/* aifront.pl — skin `klasyczny`: extracted from the design files in aifront/design-ref/.
   Built by block-level union, not by hand: the blocks below are the design's own text.
   Core blocks are those present on every page of the skin; the rest are marked per page. */

/* ===== core (present on every page of the skin) ===== */

/* The dark palette. `html` in the selector is load-bearing, not decoration: the light `:root` blocks
   further down have the SAME specificity (0,1,0) as a bare `[data-theme="dark"]` and come later in the
   file, so they won the cascade and the palette never switched. Pinned by test_theme_css.py. */
html[data-theme="dark"] {
      --bg:      oklch(16% 0.012 70);
      --surface: oklch(20% 0.014 70);
      --fg:      oklch(93% 0.006 95);
      --muted:   oklch(71% 0.012 70);
      --border:  oklch(28% 0.014 70);
      --accent:  oklch(68% 0.12 28);
      --on-accent: oklch(15% 0.02 28);
      color-scheme: dark;
    }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
      margin: 0;
      background: var(--bg);
      color: var(--fg);
      font-family: var(--font-body);
      font-size: var(--fs-body);
      line-height: 1.55;
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
    }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

p { text-wrap: pretty; }

h1, h2, h3, h4 { text-wrap: balance; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container {
      max-width: var(--container);
      margin-inline: auto;
      padding-inline: var(--gutter);
    }

.section { padding-block: clamp(48px, 8vw, var(--gap-2xl)); }

.section + .section { border-top: 1px solid var(--border); }

.row { display: flex; align-items: center; gap: var(--gap-md); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }

.h2, h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.015em; margin: 0; }

.lead   { font-size: var(--fs-lead); line-height: 1.55; color: var(--muted); max-width: 60ch; margin: 0; }

.eyebrow {
      font-family: var(--font-mono);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
      margin: 0 0 var(--gap-md);
    }

.meta { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }

.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.topnav {
      position: sticky; top: 0; z-index: 10;
      background: color-mix(in oklch, var(--bg) 92%, transparent);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
    }

.topnav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }

.topnav .logo { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }

.topnav .logo-tld { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-weight: 500; }

.topnav nav { display: flex; gap: var(--gap-lg); }

.topnav nav a { font-size: 14px; color: var(--muted); }

.topnav nav a:hover { color: var(--fg); }

.nav-toggle {
      display: none; align-items: center; justify-content: center;
      width: 44px; height: 44px;
      background: transparent; border: 1px solid var(--border);
      color: var(--fg);
    }

.theme-toggle {
      display: inline-flex; align-items: center; justify-content: center;
      width: 44px; height: 44px; flex: none;
      background: transparent; border: 1px solid var(--border);
      color: var(--fg);
    }

.theme-toggle:hover { border-color: var(--fg); }

.theme-toggle .icon-sun  { display: none; }

.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.mobile-nav { display: none; }

.pagefoot { padding-block: var(--gap-xl); color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }

.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); }

.btn {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 11px 20px;
      border-radius: var(--radius);
      border: 1px solid transparent;
      font-size: 15px;
      font-weight: 500;
      letter-spacing: -0.005em;
      transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.btn-primary:hover { background: color-mix(in oklch, var(--accent) 85%, black); border-color: color-mix(in oklch, var(--accent) 85%, black); }

.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }

.btn-secondary:hover { border-color: var(--fg); }

.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 8px; }

.btn-ghost:hover { color: var(--accent); }

.btn-arrow::after { content: '→'; transition: transform 0.15s ease; }

.btn-arrow:hover::after { transform: translateX(2px); }

/* ===== page: index (from index.html) ===== */

:root {
      --bg:      oklch(98% 0.004 95);
      --surface: oklch(100% 0.002 95);
      --fg:      oklch(20% 0.018 70);
      --muted:   oklch(48% 0.012 70);
      --border:  oklch(90% 0.006 95);
      --accent:  oklch(52% 0.10 28);

      --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
      --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
      --on-accent:   oklch(100% 0.002 95);

      --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
      --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

      --fs-h1: clamp(44px, 6vw, 76px);
      --fs-h2: clamp(32px, 4vw, 48px);
      --fs-h3: 22px;
      --fs-lead: 19px;
      --fs-body: 16px;
      --fs-meta: 13px;

      --gap-xs: 8px;
      --gap-sm: 12px;
      --gap-md: 20px;
      --gap-lg: 32px;
      --gap-xl: 56px;
      --gap-2xl: 96px;
      --container: 1120px;
      --gutter: 32px;

      --radius: 0px;
      --radius-lg: 0px;
    }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }

.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }

@media (max-width: 920px) {
      .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
    }

.card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 28px;
    }

.card-flat { background: transparent; border: 0; padding: 0; }

.card-rule { background: transparent; border: 0; border-top: 1px solid var(--fg); padding: 24px 0 0; border-radius: 0; }

.hero { padding-block: clamp(64px, 9vw, 120px); }

.hero h1 { margin-bottom: var(--gap-lg); }

.hero .lead { margin-bottom: var(--gap-lg); }

.hero-cta { display: inline-flex; gap: var(--gap-sm); flex-wrap: wrap; }

.hero-figure { margin-top: var(--gap-xl); max-width: 720px; }

.hero-figure .content-img { width: 100%; border: 1px solid var(--border); }

.hero-figure figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.hero-figure .meta { margin-top: 10px; }

.log-row {
      display: grid; grid-template-columns: 120px 1fr 120px; gap: var(--gap-lg);
      padding: 22px 0; border-top: 1px solid var(--border); align-items: baseline;
    }

.log-row h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: 13px; color: var(--muted); }

.input, .textarea {
      width: 100%;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      color: var(--fg);
      font: inherit;
      font-size: 15px;
    }

.input:focus, .textarea:focus {
      outline: 2px solid var(--accent-soft);
      border-color: var(--accent);
    }

.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

@media (max-width: 920px) {
      .topnav nav, .topnav .topnav-cta { display: none; }
      .nav-toggle { display: inline-flex; }
      .mobile-nav.open {
        display: flex; flex-direction: column;
        padding: 8px 0 16px;
        border-top: 1px solid var(--border);
      }
      .mobile-nav a { padding: 12px var(--gutter); font-size: 16px; color: var(--fg); }
      .mobile-nav a:hover { color: var(--accent); }
      .log-row { grid-template-columns: 1fr; gap: 8px; }
      .log-row .pull { text-align: left; }
      .newsletter-form { flex-direction: column; }
    }

/* ===== page: aktualnosci (from aktualnosci.html) ===== */

:root {
      --bg:      oklch(98% 0.004 95);
      --surface: oklch(100% 0.002 95);
      --fg:      oklch(20% 0.018 70);
      --muted:   oklch(48% 0.012 70);
      --border:  oklch(90% 0.006 95);
      --accent:  oklch(52% 0.10 28);

      --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
      --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
      --on-accent:   oklch(100% 0.002 95);

      --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
      --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

      --fs-h1: clamp(40px, 5vw, 64px);
      --fs-h2: clamp(30px, 3.6vw, 44px);
      --fs-h3: 22px;
      --fs-lead: 19px;
      --fs-body: 16px;
      --fs-meta: 13px;

      --gap-xs: 8px;
      --gap-sm: 12px;
      --gap-md: 20px;
      --gap-lg: 32px;
      --gap-xl: 56px;
      --gap-2xl: 96px;
      --container: 1120px;
      --gutter: 32px;

      --radius: 0px;
      --radius-lg: 0px;
    }

@media (max-width: 920px) {
      .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
    }

.log-row {
      display: grid; grid-template-columns: 130px 1fr 150px; gap: var(--gap-lg);
      padding: 24px 0; border-top: 1px solid var(--border); align-items: baseline;
    }

.log-row h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

.cat-label {
      font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--muted);
    }

.filter-bar { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap-lg); }

.filter-pill {
      display: inline-flex; align-items: center; justify-content: center;
      min-height: 44px; padding: 10px 16px;
      font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
      color: var(--muted); background: transparent; border: 1px solid var(--border);
    }

.filter-pill:hover { color: var(--fg); border-color: var(--fg); }

.filter-pill[aria-pressed="true"] { color: var(--surface); background: var(--fg); border-color: var(--fg); }

.lead-card {
      display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--gap-xl); align-items: center;
    }

.lead-card .lead-media .content-img { width: 100%; border: 1px solid var(--border); }

.lead-card h2 { font-size: var(--fs-h2); }

.lead-card h2 a:hover { text-decoration: underline; }

.lead-card .dek { color: var(--muted); max-width: 52ch; }

.lead-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); margin-top: var(--gap-lg); }

.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: var(--gap-lg); }

.pagination .page-num { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted); }

.page-btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 6px;
      min-height: 44px; padding: 10px 16px; font-size: 14px; font-weight: 500;
      background: transparent; color: var(--fg); border: 1px solid var(--border);
    }

.page-btn:hover:not(:disabled) { border-color: var(--fg); }

.page-btn:disabled { color: var(--muted); opacity: 0.5; cursor: default; }

@media (max-width: 920px) {
      .topnav nav, .topnav .topnav-cta { display: none; }
      .nav-toggle { display: inline-flex; }
      .mobile-nav.open {
        display: flex; flex-direction: column;
        padding: 8px 0 16px;
        border-top: 1px solid var(--border);
      }
      .mobile-nav a { padding: 12px var(--gutter); font-size: 16px; color: var(--fg); }
      .mobile-nav a:hover { color: var(--accent); }
      .log-row { grid-template-columns: 1fr; gap: 8px; }
      .log-row .pull { text-align: left; }
      .lead-card { grid-template-columns: 1fr; gap: var(--gap-md); }
      .lead-meta { flex-direction: column; align-items: flex-start; gap: var(--gap-sm); }
      .pagination { gap: var(--gap-sm); }
      .newsletter-form { flex-direction: column; }
    }

/* ===== page: artykul (from artykul.html) ===== */

/* /OD-LAYOUT-PRIMITIVES v1 */

    :root {
      --bg:      oklch(98% 0.004 95);
      --surface: oklch(100% 0.002 95);
      --fg:      oklch(20% 0.018 70);
      --muted:   oklch(48% 0.012 70);
      --border:  oklch(90% 0.006 95);
      --accent:  oklch(52% 0.10 28);

      --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
      --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
      --on-accent:   oklch(100% 0.002 95);

      --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
      --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

      --fs-h1: clamp(34px, 4.6vw, 56px);
      --fs-h2: clamp(28px, 3.4vw, 42px);
      --fs-h3: 22px;
      --fs-lead: 19px;
      --fs-body: 16px;
      --fs-meta: 13px;

      --gap-xs: 8px;
      --gap-sm: 12px;
      --gap-md: 20px;
      --gap-lg: 32px;
      --gap-xl: 56px;
      --gap-2xl: 96px;
      --container: 1120px;
      --gutter: 32px;

      --radius: 0px;
      --radius-lg: 0px;
    }

@media (max-width: 920px) {
      .grid-3 { grid-template-columns: 1fr; }
    }

.reading-progress {
      position: fixed; top: 0; left: 0; z-index: 30;
      width: 100%; height: 3px;
      background: transparent;
      pointer-events: none;
    }

.reading-progress .bar {
      height: 100%; width: 0;
      background: var(--accent);
      transition: width 0.08s linear;
    }

.article-head { max-width: 780px; }

.article-head h1 { margin-top: var(--gap-sm); }

.article-head .lead { font-size: 21px; margin-top: var(--gap-md); max-width: 56ch; }

.byline {
      display: flex; flex-wrap: wrap; gap: var(--gap-sm) var(--gap-xl); align-items: center;
      margin-top: var(--gap-lg); padding-top: var(--gap-md);
      border-top: 1px solid var(--border);
      font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--muted);
    }

.byline .author { color: var(--fg); }

.article-figure { margin-top: var(--gap-xl); }

.article-figure .content-img { width: 100%; border: 1px solid var(--border); }

.article-figure figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.article-body { max-width: 680px; margin-inline: auto; padding-inline: 0; }

.prose { font-size: 18px; line-height: 1.75; }

.prose p { margin: 0 0 1.4em; }

.prose h2 { font-family: var(--font-display); font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; margin: 2em 0 0.6em; scroll-margin-top: 84px; }

.prose ul { padding-left: 1.3em; margin: 0 0 1.4em; }

.prose li { margin-bottom: 0.6em; }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.toc {
      border: 1px solid var(--border);
      border-top: 2px solid var(--fg);
      padding: var(--gap-lg);
      margin: 0 0 var(--gap-xl);
    }

.toc-label {
      font-family: var(--font-mono);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

.toc-list {
      list-style: none;
      margin: var(--gap-md) 0 0;
      padding: 0;
    }

.toc-list a {
      display: flex;
      gap: var(--gap-md);
      align-items: baseline;
      padding: 9px 0;
      border-top: 1px solid var(--border);
      font-size: 16px;
      line-height: 1.4;
    }

.toc-list li:first-child a { border-top: none; }

.toc-list .toc-num {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums;
      font-size: 12px;
      color: var(--muted);
      min-width: 24px;
      flex: none;
    }

.toc-list a:hover .toc-num { color: var(--accent); }

.toc-list a.active .toc-num { color: var(--accent); }

.pullquote {
      font-family: var(--font-display);
      font-size: clamp(24px, 3vw, 32px);
      line-height: 1.25;
      letter-spacing: -0.01em;
      margin: var(--gap-xl) 0;
      padding: var(--gap-lg) 0;
      border-top: 1px solid var(--fg);
      border-bottom: 1px solid var(--border);
    }

.share-row {
      display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-sm);
      margin-top: var(--gap-xl); padding-top: var(--gap-md); border-top: 1px solid var(--border);
    }

.share-row .share-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }

/* Słowniczek w tekście — układ kolumnowy i panel definicji */
    .article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-xl); }

@media (min-width: 1080px) {
      .article-layout { grid-template-columns: minmax(0, 680px) minmax(300px, 360px); justify-content: center; align-items: start; }
    }

.term-ref {
      font: inherit;
      color: inherit;
      background: transparent;
      border: 0;
      border-bottom: 1px dotted var(--accent);
      padding: 0;
      margin: 0;
      cursor: help;
      transition: background 0.15s ease, border-color 0.15s ease;
    }

.term-ref:hover, .term-ref[aria-expanded="true"] {
      background: var(--accent-soft);
      border-bottom-style: solid;
    }

.defpanel { border-top: 2px solid var(--fg); padding-top: var(--gap-md); }

.defpanel-label {
      font-family: var(--font-mono);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
    }

.defpanel-hint { margin: var(--gap-sm) 0 var(--gap-md); font-size: 15px; line-height: 1.6; color: var(--muted); }

.defpanel-top { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); }

.defpanel-close {
      display: inline-flex; align-items: center; justify-content: center;
      width: 44px; height: 44px; flex: none;
      background: transparent; border: 1px solid var(--border); color: var(--fg);
      transition: border-color 0.15s ease, color 0.15s ease;
    }

.defpanel-close:hover { border-color: var(--fg); }

.defpanel-term {
      margin: var(--gap-sm) 0 0;
      font-family: var(--font-display);
      font-size: 24px;
      line-height: 1.15;
      letter-spacing: -0.01em;
      text-wrap: balance;
    }

.defpanel-en { margin: 6px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.defpanel-text { margin: var(--gap-sm) 0 0; font-size: 16px; line-height: 1.65; }

.defpanel-link {
      display: inline-block;
      margin-top: var(--gap-md);
      font-size: 14px;
      color: var(--accent);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

.defpanel-link:hover { text-decoration-thickness: 2px; }

@media (max-width: 1079px) {
      .defpanel {
        position: fixed;
        left: 0; right: 0; bottom: 0; z-index: 20;
        max-height: 46vh;
        overflow-y: auto;
        background: var(--bg);
        border-top: 2px solid var(--fg);
        padding: var(--gap-md) var(--gutter) calc(var(--gap-md) + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -14px 28px -20px oklch(0% 0 0 / 0.4);
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 0.2s ease-in, visibility 0s linear 0.2s;
      }
      .defpanel[data-state="term"] {
        transform: none;
        visibility: visible;
        transition: transform 0.2s ease-out, visibility 0s;
      }
    }

@media (min-width: 1080px) {
      .defpanel { position: sticky; top: 92px; }
    }

@media (prefers-reduced-motion: reduce) {
      .term-ref, .defpanel, .defpanel-close { transition: none; }
    }

@media (max-width: 920px) {
      .topnav nav, .topnav .topnav-cta { display: none; }
      .nav-toggle { display: inline-flex; }
      .mobile-nav.open {
        display: flex; flex-direction: column;
        padding: 8px 0 16px;
        border-top: 1px solid var(--border);
      }
      .mobile-nav a { padding: 12px var(--gutter); font-size: 16px; color: var(--fg); }
      .mobile-nav a:hover { color: var(--accent); }
      .newsletter-form { flex-direction: column; }
      .prose { font-size: 17px; }
    }

/* ===== page: slowniczek (from slowniczek.html) ===== */

/* /OD-LAYOUT-PRIMITIVES v1 */

    :root {
      --bg:      oklch(98% 0.004 95);
      --surface: oklch(100% 0.002 95);
      --fg:      oklch(20% 0.018 70);
      --muted:   oklch(48% 0.012 70);
      --border:  oklch(90% 0.006 95);
      --accent:  oklch(52% 0.10 28);

      --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
      --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
      --on-accent:   oklch(100% 0.002 95);

      --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', serif;
      --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

      --fs-h1: clamp(32px, 4vw, 48px);
      --fs-h2: clamp(28px, 3.4vw, 42px);
      --fs-h3: 22px;
      --fs-lead: 19px;
      --fs-body: 16px;
      --fs-meta: 13px;

      --gap-xs: 8px;
      --gap-sm: 12px;
      --gap-md: 20px;
      --gap-lg: 32px;
      --gap-xl: 56px;
      --gap-2xl: 96px;
      --container: 1120px;
      --gutter: 32px;

      --radius: 0px;
      --radius-lg: 0px;
    }

.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.06; letter-spacing: -0.02em; margin: 0; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn:disabled:hover { background: transparent; color: var(--fg); }

/* Słowniczek */
    .glossary-head { max-width: 780px; }

.glossary-head .lead { margin-top: var(--gap-sm); }

.glossary-head .btn-ghost { margin-top: var(--gap-sm); margin-left: -8px; }

.defs-toolbar {
      display: grid;
      gap: var(--gap-md);
      margin-top: var(--gap-xl);
      padding-bottom: var(--gap-md);
      border-bottom: 1px solid var(--fg);
    }

.defs-search-row { align-items: flex-end; }

.defs-search { --od-gap: 6px; }

.defs-search label {
      font-family: var(--font-mono);
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

.defs-chips { --od-rail-pad: 0px; --od-gap: 8px; min-width: 0; }

.chip {
      display: inline-flex; align-items: center; justify-content: center;
      padding: 0 16px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--fg);
      font-family: var(--font-mono);
      font-size: 12px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

.chip:hover { border-color: var(--fg); }

.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.defs-status {
      margin: 0;
      font-family: var(--font-mono);
      font-size: var(--fs-meta);
      color: var(--muted);
    }

.defs-group { margin-top: var(--gap-xl); }

.defs-group-title {
      display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap-md);
      font-family: var(--font-display);
      font-size: var(--fs-h3);
      font-weight: 600;
      letter-spacing: -0.005em;
    }

.defs-group-num { font-size: 13px; color: var(--muted); white-space: nowrap; }

.defs-list {
      list-style: none;
      margin: var(--gap-md) 0 0;
      padding: 0;
      border-bottom: 1px solid var(--border);
    }

.def-entry {
      display: grid;
      grid-template-columns: minmax(150px, 250px) minmax(0, 1fr);
      gap: var(--gap-xs) var(--gap-lg);
      padding-block: var(--gap-md);
      border-top: 1px solid var(--border);
      scroll-margin-top: 110px;
    }

.def-entry.is-target { background: var(--accent-soft); }

.def-entry[hidden], .defs-group[hidden], .defs-empty[hidden] { display: none; }

.def-term { --od-gap: 4px; }

.def-term .pl {
      font-family: var(--font-display);
      font-size: 21px;
      line-height: 1.2;
      letter-spacing: -0.01em;
      font-weight: 600;
    }

.def-term .en { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.def-text { margin: 0; font-size: 17px; line-height: 1.65; max-width: 64ch; }

.def-tag {
      display: inline-block;
      margin-top: 12px;
      padding: 3px 8px;
      border: 1px solid var(--border);
      font-family: var(--font-mono);
      font-size: 11px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
    }

.defs-empty {
      display: grid;
      justify-items: start;
      gap: var(--gap-sm);
      margin-top: var(--gap-xl);
      padding: var(--gap-lg);
      border: 1px solid var(--border);
      border-top: 2px solid var(--fg);
    }

.defs-empty p { margin: 0; }

.defs-empty-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

.defs-empty-text { font-size: 16px; line-height: 1.6; color: var(--muted); }

.noscript-note {
      margin-top: var(--gap-lg);
      padding: var(--gap-md);
      border: 1px solid var(--border);
      font-size: 15px;
      color: var(--muted);
    }

@media (max-width: 720px) {
      .def-entry { grid-template-columns: minmax(0, 1fr); }
      .def-text { font-size: 16px; }
    }

@media (max-width: 920px) {
      .topnav nav { display: none; }
      .nav-toggle { display: inline-flex; }
      .mobile-nav.open {
        display: flex; flex-direction: column;
        padding: 8px 0 16px;
        border-top: 1px solid var(--border);
      }
      .mobile-nav a { padding: 12px var(--gutter); font-size: 16px; color: var(--fg); }
      .mobile-nav a:hover { color: var(--accent); }
    }

@media (max-width: 480px) {
      .defs-search-row { flex-direction: column; align-items: stretch; }
      .defs-clear { align-self: flex-start; }
    }

@media (prefers-reduced-motion: reduce) {
      .chip, .btn, .defs-clear { transition: none; }
    }

/* ===== used by more than one page, kept once (from index.html) ===== */

.stack { display: flex; flex-direction: column; }

.stack > * + * { margin-top: var(--gap-md); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }

.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }

.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }

.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; margin: 0; }

.pagefoot .credits { font-size: 12px; line-height: 1.5; max-width: 60ch; }

.content-img {
      display: block;
      max-width: 100%;
      max-height: min(70vh, 720px);
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: var(--radius-lg);
    }

.rule  { border: 0; border-top: 1px solid var(--border); margin: 0; }

.rule-strong { border: 0; border-top: 1px solid var(--fg); margin: 0; }

.log-row .meta { color: var(--muted); }

.log-row h3 a:hover { text-decoration: underline; }

.log-row .pull { text-align: right; }

.log-row:hover h3 a { text-decoration: underline; }

.cat-card { display: flex; flex-direction: column; gap: 12px; }

.cat-card .content-img { width: 100%; border: 1px solid var(--border); }

.cat-card .cat-label {
      font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--muted);
    }

.cat-card h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.18; letter-spacing: -0.01em; font-weight: 600; }

.cat-card:hover h3 { text-decoration: underline; }

.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }

.newsletter-form .input { flex: 1; }

.newsletter-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.newsletter-done { font-size: 15px; color: var(--fg); }

/* ===== used by more than one page, kept once (from aktualnosci.html) ===== */

.stack { display: flex; flex-direction: column; }

.stack > * + * { margin-top: var(--gap-md); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }

.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }

.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }

.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; margin: 0; }

.topnav nav a.active { color: var(--fg); text-decoration: underline; text-underline-offset: 6px; }

.mobile-nav a.active { color: var(--accent); }

.pagefoot .credits { font-size: 12px; line-height: 1.5; max-width: 60ch; }

.content-img {
      display: block;
      max-width: 100%;
      max-height: min(70vh, 720px);
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: var(--radius-lg);
    }

.rule  { border: 0; border-top: 1px solid var(--border); margin: 0; }

.rule-strong { border: 0; border-top: 1px solid var(--fg); margin: 0; }

.log-row .meta { color: var(--muted); }

.log-row h3 a:hover { text-decoration: underline; }

.log-row .pull { text-align: right; }

.log-row:hover h3 a { text-decoration: underline; }

.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }

.newsletter-form .input { flex: 1; }

.newsletter-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.newsletter-done { font-size: 15px; color: var(--fg); }

.input {
      width: 100%;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      color: var(--fg);
      font: inherit;
      font-size: 15px;
    }

.input:focus {
      outline: 2px solid var(--accent-soft);
      border-color: var(--accent);
    }

/* ===== used by more than one page, kept once (from artykul.html) ===== */

/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
       Put this @layer first;

product CSS outside the layer always wins. */
    @layer od-layout {
      :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

      /* containers */
      .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
      .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
      .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
      .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
      .od-fill    { flex: 1 1 0; min-width: 0; }
      .od-fixed   { flex: none; }
      .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

      /* stacked information: each piece is its own line — never sibling inline spans */
      .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
      :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
      .od-tile { display: grid; grid-template-rows: auto 1fr; }
      :where(.od-tile) > :where(*) { display: block; }

      /* media keeps its intrinsic ratio by default; never a distorted or cropped
         cover by accident. height:auto lets the ratio win over an <img height="…">
         attribute. Cropping to a uniform box is an explicit opt-in: set --od-ratio
         AND add .od-media-cover together (per the core rule, only where a crop is
         deliberate — tile thumbs, decorative fills — never on full-frame content). */
      .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
      .od-media-cover { object-fit: cover; }

      /* data text only — authored copy is rewritten to its budget instead */
      .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
      .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
      .od-clamp-2 { -webkit-line-clamp: 2; }
      .od-clamp-3 { -webkit-line-clamp: 3; }
      .od-lines-2 { min-height: calc(2 * 1.4em); }   /* block-level reservation for a shared baseline */
      .od-nowrap  { white-space: nowrap; }           /* 数字+单位 · 价格+起 · 日期+星期 */
      .od-keep    { word-break: keep-all; overflow-wrap: anywhere; } /* CJK labels break at spaces / <wbr> first */

      /* screen skeleton (optional): bars take their own space, the middle scrolls — no padding guessed for chrome */
      .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
      .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

      /* horizontal rail: the next item peeks at the edge; trailing room survives overflow */
      .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
                 padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
      .od-rail::-webkit-scrollbar { display: none; }
      :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
      :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

      .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
      .od-touch  { min-width: 44px; min-height: 44px; }
    }

.stack { display: flex; flex-direction: column; }

.stack > * + * { margin-top: var(--gap-md); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }

.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }

.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; margin: 0; }

.topnav nav a.active { color: var(--fg); text-decoration: underline; text-underline-offset: 6px; }

.mobile-nav a.active { color: var(--accent); }

.pagefoot .credits { font-size: 12px; line-height: 1.5; max-width: 60ch; }

.content-img {
      display: block;
      max-width: 100%;
      max-height: min(70vh, 720px);
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: var(--radius-lg);
    }

.cat-card { display: flex; flex-direction: column; gap: 12px; }

.cat-card .content-img { width: 100%; border: 1px solid var(--border); }

.cat-card .cat-label {
      font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--muted);
    }

.cat-card h3 { font-family: var(--font-display); font-size: 24px; line-height: 1.18; letter-spacing: -0.01em; font-weight: 600; }

.cat-card:hover h3 { text-decoration: underline; }

.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }

.newsletter-form .input { flex: 1; }

.newsletter-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.newsletter-done { font-size: 15px; color: var(--fg); }

.input {
      width: 100%;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      color: var(--fg);
      font: inherit;
      font-size: 15px;
    }

.input:focus {
      outline: 2px solid var(--accent-soft);
      border-color: var(--accent);
    }

/* ===== used by more than one page, kept once (from slowniczek.html) ===== */

/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
       Put this @layer first;

product CSS outside the layer always wins. */
    @layer od-layout {
      :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

      /* containers */
      .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
      .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
      .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
      .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
      .od-fill    { flex: 1 1 0; min-width: 0; }
      .od-fixed   { flex: none; }
      .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

      /* stacked information: each piece is its own line — never sibling inline spans */
      .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
      :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
      .od-tile { display: grid; grid-template-rows: auto 1fr; }
      :where(.od-tile) > :where(*) { display: block; }

      /* media keeps its intrinsic ratio by default; never a distorted or cropped
         cover by accident. height:auto lets the ratio win over an <img height="…">
         attribute. Cropping to a uniform box is an explicit opt-in: set --od-ratio
         AND add .od-media-cover together (per the core rule, only where a crop is
         deliberate — tile thumbs, decorative fills — never on full-frame content). */
      .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
      .od-media-cover { object-fit: cover; }

      /* data text only — authored copy is rewritten to its budget instead */
      .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
      .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
      .od-clamp-2 { -webkit-line-clamp: 2; }
      .od-clamp-3 { -webkit-line-clamp: 3; }
      .od-lines-2 { min-height: calc(2 * 1.4em); }   /* block-level reservation for a shared baseline */
      .od-nowrap  { white-space: nowrap; }           /* 数字+单位 · 价格+起 · 日期+星期 */
      .od-keep    { word-break: keep-all; overflow-wrap: anywhere; } /* CJK labels break at spaces / <wbr> first */

      /* screen skeleton (optional): bars take their own space, the middle scrolls — no padding guessed for chrome */
      .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
      .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

      /* horizontal rail: the next item peeks at the edge; trailing room survives overflow */
      .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
                 padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
      .od-rail::-webkit-scrollbar { display: none; }
      :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
      :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

      .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
      .od-touch  { min-width: 44px; min-height: 44px; }
    }

.topnav nav a.active { color: var(--fg); text-decoration: underline; text-underline-offset: 6px; }

.input {
      width: 100%;
      padding: 11px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface);
      color: var(--fg);
      font: inherit;
      font-size: 15px;
    }

.input:focus {
      outline: 2px solid var(--accent-soft);
      border-color: var(--accent);
    }

/* The panel's term list — every term this text references, as chips that are real links. Clicking one
   fills the panel instead of navigating (app.js); with JS off they are ordinary links to the entry page. */
.defpanel-terms-list { display: flex; flex-wrap: wrap; gap: var(--gap-xs) var(--gap-sm); list-style: none; margin: var(--gap-sm) 0 0; padding: 0; }
.term-chip { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; text-decoration: none; }
.term-chip:hover, .term-chip:focus-visible { border-color: var(--fg); }
.term-chip[data-active] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.term-ref[data-active] { background: var(--accent-soft); }
.defpanel-src { display: none; }

/* The reading bar: hidden on paper, and not animated for a reader who asked for less motion. */
@media print { .reading-progress { display: none; } }
@media (prefers-reduced-motion: reduce) { .reading-progress .bar { transition: none; } }

/* --- mobile guards: the LAST word on phone widths ------------------------------------------------
   This sheet is the UNION of the original designs' stylesheets, and `.grid-3` — with `.grid-2`,
   `.grid-4`, `.grid-2-1`, `.grid-1-2` — is declared `repeat(N, 1fr)` again FURTHER DOWN, below the
   per-design `@media (max-width: 920px)` blocks that collapsed them to one column (lines 200/309/424
   against 868/929/1049). Equal specificity plus later position wins, so the collapse never applied:
   measured at 390px, `/` rendered 462px wide (72px of horizontal overflow) and every `/n/` page 485px
   (95px) — the cards stayed three-up and hung off the right edge.
   That overflow is also what broke the dictionary on a phone: a `≤1079px` panel is `position: fixed`,
   so on an overflowing page the browser widens the layout viewport (976px on the article pages) and
   the panel lays itself out against the wide box — the term and its definition sat at x≈473, off a
   390px screen, and tapping a term opened nothing at all.
   The track is `minmax(0, 1fr)` and not `1fr`: a `1fr` track still refuses to shrink below its
   content's min-content width, so one unbreakable child could blow the column back up.
   These rules must stay at the END of the file — `test_mobile_css.py` pins the cascade and the order. */
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
}

/* A source is usually a bare URL, and a `Źródła`/`dowody` link has nothing to wrap at: the longest
   one sets the min-content width of the whole article column (measured: 925px for a single link).
   `overflow-wrap: anywhere` lets it break — and, unlike `break-word`, it also lowers the min-content
   contribution, which is the half that actually lets the column shrink. */
.prose a, .sources a { overflow-wrap: anywhere; }

/* The article column is a grid item, and an item's automatic minimum size is its min-content width:
   without this, one long link would still widen the column past its track. */
.article-body { min-width: 0; }

/* --- the dictionary sheet's action must never fall below its own fold -----------------------------
   At `≤1079px` `#defpanel` is a `position: fixed` scrollport capped at `max-height: 46vh`. A definition
   that carries an `analogia` is taller than that: measured on an iPhone 13 (390×664), the sheet showed
   303px of 355px of content and put „Więcej w słowniku” at y 674–695 — below the sheet's own bottom
   edge (664) and outside the visual viewport, so `elementFromPoint` at its centre returned *nothing* and
   a fingertip tap did not navigate, while Playwright's `locator.click()` passed because it scrolls the
   element into view first. A slightly taller phone (Pixel 7, 412×839) fitted the same content, which is
   why this only showed on a real reader's device.
   Sticky inside the scrollport pins the one action the panel exists to offer to the bottom of whatever
   is visible, for any content length; it rests in its natural place once the sheet is scrolled to the
   end, so nothing is hidden behind it. */
@media (max-width: 1079px) {
  .defpanel-link {
    position: sticky;
    bottom: 0;
    display: block;
    margin-top: var(--gap-sm);
    padding-block: 12px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
  }
}

/* --- the sheet's close control („X”) ------------------------------------------------------------
   `.defpanel-close` was styled from the start — a 44×44 bordered target, the size a finger wants — and
   `app.js` already bound it to `showRest()`; it only ever wanted to exist in the markup (Piotr, 2026-10-01).
   It appears only while a definition is displayed (at rest the sheet *is* the term list, nothing to close)
   and on a phone it is `sticky` at the top of the sheet's scrollport, so a long definition cannot scroll it
   out of reach — the same reason the action is sticky at the bottom. A tap outside the sheet closes it too
   (`app.js`), which is the gesture a phone reader reaches for first. */
.defpanel-close { display: none; }

.defpanel[data-state="term"] .defpanel-close { display: flex; margin-left: auto; }

@media (max-width: 1079px) {
  .defpanel[data-state="term"] .defpanel-close { position: sticky; top: 0; z-index: 1; background: var(--bg); }
}
