/* Ominuvo – style strony. Style samych map: assets/world-map/src/maps.css (kolory mapy przestawiamy niżej
   zmiennymi --wm-*). Jasny „papier” i ciemny motyw według ustawień systemu – jak w mapach z serii. */

:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --surface-3: #e9e8e3;
  --ink: #0b0b0b;
  --ink-2: #4a4946;
  --muted: #6b6964;            /* tekst drugorzędny (≥ 4,5:1 na tle) */
  --line: #e1e0d9;
  --line-2: #c9c8be;
  --accent: #4c5fd5;           /* przyciski, linki aktywne, znak */
  --accent-ink: #ffffff;
  --accent-soft: #e8ebfb;
  --accent-2: #eb6834;         /* kropka w znaku */
  --link: #3a4bbf;
  --danger: #c0392b;
  --ok: #1b8a5a;
  --warn: #9a6400;
  /* Mapa */
  --ocean: #f1f0ec;
  --land: #dcdbd4;
  --land-hover: #c4c3ba;
  --land-border: #f9f9f7;
  /* Kolory w ikonach (te same co na mapach) */
  --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #184f95;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-5: #8a5cd6;
  --marker: #e63946;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(11, 11, 11, .05), 0 10px 30px -14px rgba(11, 11, 11, .22);
  --header-h: 60px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --wide: 1200px;
}

/* Ciemny motyw: według systemu (bez wyboru) albo wybrany przełącznikiem (<html data-theme>, moduł theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0e0e10;
    --surface: #18181b;
    --surface-2: #202024;
    --surface-3: #2a2a2f;
    --ink: #f0efec;
    --ink-2: #cfcec6;
    --muted: #a3a197;
    --line: #2c2c31;
    --line-2: #3d3d44;
    --accent: #7d8cf0;
    --accent-ink: #0e0e10;
    --accent-soft: #23264a;
    --link: #a3aef7;
    --danger: #ef6a5a;
    --ok: #4cc28d;
    --warn: #e0a83a;
    --ocean: #141417;
    --land: #2f2f35;
    --land-hover: #45454d;
    --land-border: #141417;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -14px rgba(0, 0, 0, .8);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #202024;
  --surface-3: #2a2a2f;
  --ink: #f0efec;
  --ink-2: #cfcec6;
  --muted: #a3a197;
  --line: #2c2c31;
  --line-2: #3d3d44;
  --accent: #7d8cf0;
  --accent-ink: #0e0e10;
  --accent-soft: #23264a;
  --link: #a3aef7;
  --danger: #ef6a5a;
  --ok: #4cc28d;
  --warn: #e0a83a;
  --ocean: #141417;
  --land: #2f2f35;
  --land-hover: #45454d;
  --land-border: #141417;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -14px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* --- Przyciski i formularze --------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .62em 1.1em; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--link); border-color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .btn-primary:hover { background: #9aa6f5; border-color: #9aa6f5; } }
:root[data-theme='dark'] .btn-primary:hover { background: #9aa6f5; border-color: #9aa6f5; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .42em .85em; font-size: .86rem; }
.btn-lg { padding: .8em 1.4em; font-size: 1.02rem; }
.btn-block { width: 100%; }
.danger-text { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; min-width: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: 0; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 140px; }
.field-row > .grow { flex: 3 1 260px; }
.field-hint { font-size: .82rem; color: var(--muted); margin: -6px 0 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; padding: .55em .7em; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type="color"] { width: 38px; height: 30px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); cursor: pointer; }
.is-invalid { border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 8%, var(--surface)) !important; }
.check, .radio { display: flex; gap: .5em; align-items: baseline; margin: 0 0 10px; font-size: .93rem; cursor: pointer; }
.radio { display: block; }
.radio input { margin: 0 .45em 0 0; }
.radio.is-locked, .check.is-locked { color: var(--muted); cursor: default; }
.has-error input { border-color: var(--danger); }
small.error { color: var(--danger); font-size: .83rem; }

.notice { padding: .8em 1em; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.notice-soft { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.notice-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice p:last-child { margin: 0; }

.badge { display: inline-block; padding: .1em .55em; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: .75rem; font-weight: 600; text-decoration: none; vertical-align: middle; }
.badge-brand { background: var(--accent-soft); color: var(--link); }
.badge-warn { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--warn); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; vertical-align: -1px; margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

/* --- Nagłówek i stopka --------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.site-nav a { display: block; padding: .45em .8em; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .95rem; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current] { color: var(--ink); background: var(--surface-3); }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); padding: 8px; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 5px; cursor: pointer; padding: .4em .6em; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: var(--surface-2); }
.lang-menu svg { width: 18px; height: 18px; }
.lang-switch, .dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px;
  list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.lang-switch a { display: block; padding: .45em .7em; border-radius: 6px; color: var(--ink); text-decoration: none; }
.lang-switch a:hover, .lang-switch a[aria-current] { background: var(--surface-2); }
/* Przełącznik motywu (moduł theme: assets/theme/theme.css) – odstęp daje gap nagłówka */
.site-header { --theme-switch-gap-left: 0; --theme-switch-gap-left-compact: 0; --theme-switch-bg: transparent; --theme-switch-border: var(--line); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { order: 3; margin-left: 0; }
  .site-nav ul { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.is-open ul { display: flex; }
  .site-header { gap: 10px; }
  .site-header > .brand { margin-right: auto; }
  .header-cta { display: none; }
}

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface-2); padding: 40px 20px 24px; font-size: .92rem; }
/* Ikonki kanałów marki w stopce (Series::socialLinks, moduł series): kolor tekstu stopki, przy najechaniu i fokusie jaśniej */
.series-social-link { transition: opacity .15s; }
.series-social-link:hover, .series-social-link:focus-visible { opacity: .7; }
.footer-grid { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.series-lang { font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 .3em; vertical-align: 1px; }
.footer-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .8em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-grid p { color: var(--muted); margin-top: 10px; max-width: 30ch; }
.footer-note { max-width: var(--wide); margin: 28px auto 0; color: var(--muted); font-size: .82rem; }
.footer-note a { color: inherit; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* --- Strona główna --------------------------------------------------------- */

.hero {
  max-width: var(--wide); margin: 0 auto; padding: 48px 20px 32px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center;
}
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.025em; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 18px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .9rem; }
.hero-points li::before { content: '✓ '; color: var(--ok); font-weight: 700; }
.hero-map { margin: 0; }
.hero-map figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 28px; } }

.section { max-width: var(--wide); margin: 0 auto; padding: 44px 20px; }
.section-alt { max-width: none; background: var(--surface-2); border-block: 1px solid var(--line); }
.section-alt > * { max-width: calc(var(--wide) - 40px); margin-inline: auto; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head p { color: var(--muted); margin: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature svg { width: 40px; height: 40px; margin-bottom: 10px; }
.feature p { color: var(--ink-2); margin: 0; font-size: .95rem; }
.feature.soon { border-style: dashed; }
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 0 auto 24px; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 4px; padding-left: 52px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.steps span { color: var(--ink-2); font-size: .95rem; }

/* --- Karty map (katalog) ---------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s; position: relative; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 1200 / 630; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.card-kicker .badge { white-space: nowrap; }
.card h3 { font-size: 1.04rem; margin-bottom: .35em; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }   /* cała karta klikalna */
.card h3 a:hover { text-decoration: underline; }
.card .ext { color: var(--muted); font-size: .85em; }
.card-text { font-size: .9rem; color: var(--ink-2); margin-bottom: 10px; }
.card-langs { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 4px; position: relative; z-index: 1; }
.card-langs a { font-size: .72rem; font-weight: 700; padding: .15em .45em; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); text-decoration: none; }
.card-langs a:hover { background: var(--surface-3); }
.card-langs a[aria-current] { background: var(--accent-soft); color: var(--link); }
.card-author { margin: auto 0 0; font-size: .82rem; color: var(--muted); }

.page-head { padding: 36px 0 12px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .filter-q { flex: 2 1 220px; }
.results-count { color: var(--muted); font-size: .92rem; }
.empty-state { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.pager { display: flex; gap: 6px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.pager a { min-width: 38px; padding: .4em .7em; text-align: center; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pager a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* --- Mapa (wspólne: strona mapy, osadzenie, strona główna, edytor) ---------- */

.mapview { position: relative; }
.mapview .wm[data-wm-theme] {
  --wm-ocean: var(--ocean);
  --wm-sphere-stroke: var(--line);
  --wm-land: var(--land);
  --wm-land-hover: var(--land-hover);
  --wm-land-inactive: var(--land);
  --wm-border: var(--land-border);
  --wm-dot: var(--land);
  --wm-hover-outline: var(--ink);
  --wm-control-bg: var(--surface);
  --wm-control-fg: var(--ink);
  --wm-control-border: var(--line-2);
  --wm-font: var(--font);
}
/* Podkład (rzeźba, atlas, satelita – mapview.js applyBackground): ocean i państwa bez danych przezroczyste,
   państwa z danymi półprzezroczyste; na szarej rzeźbie kolory mnożone przez cieniowanie. */
.mapview.has-bg .wm[data-wm-theme] {
  --wm-ocean: transparent;
  --wm-land: transparent;
  --wm-land-inactive: transparent;
  --wm-land-hover: rgba(255, 255, 255, .3);
  --wm-border: rgba(255, 255, 255, .55);
  --wm-dot: rgba(255, 255, 255, .45);
}
.mapview.has-bg .wm-country[data-fill], .mapview.has-bg .wm-dot[data-fill] { fill-opacity: .72; }
.mapview.has-bg .wm-dot:not([data-fill]) { display: none; }
.mapview.bg-relief .wm-layer-items { mix-blend-mode: multiply; }
.mapview.bg-relief .wm-country[data-fill] { fill-opacity: .9; }
.mapview.bg-relief .wm[data-wm-theme] { --wm-border: rgba(60, 60, 60, .35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .mapview.bg-relief image.map-bg { filter: brightness(.6); }
  :root:not([data-theme='light']) .mapview.bg-relief .wm-layer-items { mix-blend-mode: normal; }
  :root:not([data-theme='light']) .mapview.bg-relief .wm-country[data-fill] { fill-opacity: .85; }
  :root:not([data-theme='light']) .mapview.bg-relief .wm[data-wm-theme] { --wm-border: rgba(255, 255, 255, .25); }
}
:root[data-theme='dark'] .mapview.bg-relief image.map-bg { filter: brightness(.6); }
:root[data-theme='dark'] .mapview.bg-relief .wm-layer-items { mix-blend-mode: normal; }
:root[data-theme='dark'] .mapview.bg-relief .wm-country[data-fill] { fill-opacity: .85; }
:root[data-theme='dark'] .mapview.bg-relief .wm[data-wm-theme] { --wm-border: rgba(255, 255, 255, .25); }
.map-credit {
  position: absolute; right: 8px; bottom: 6px; z-index: 3; padding: 1px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-size: .7rem; text-decoration: none;
}
.map-credit:hover { color: var(--ink); }
.map-source {
  position: absolute; right: 8px; bottom: 6px; z-index: 3; max-width: min(70%, 520px); margin: 0; padding: 1px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-size: .7rem; text-align: right;
}
.mapview.has-bg .map-source { bottom: 28px; }
.map-source a, .map-legend-source a { color: inherit; }
/* Obszar mapy (settings.area): państwa spoza obszaru wyblakłe i nieaktywne */
.mapview .wm-country.is-out { opacity: .32; pointer-events: none; }
/* Styl mapy (moduł map-styles: settings.style – .ms-style na kontenerze): zmienne strony z papieru stylu – legenda,
   karta, podpisy, kafelki i linie w kolorach i fontach stylu, niezależnie od motywu strony (papier jest zawsze jasny) */
.mapview.ms-style {
  --surface: var(--ms-surface); --ink: var(--ms-ink); --ink-2: var(--ms-ink2); --muted: var(--ms-muted); --line: var(--ms-line);
  --line-2: var(--ms-line); --ocean: var(--ms-ocean); --land: var(--ms-land); --land-hover: var(--ms-hover); --land-border: var(--ms-border);
  --font: var(--ms-font); --link: var(--ms-ink);
  background: var(--ms-bg); color: var(--ms-ink); font-family: var(--ms-font); border-color: var(--ms-line);
}
.mapview.ms-style .mapview-map { background: var(--ms-bg); position: relative; }
.mapview.ms-style :is(.map-legend, .map-card) { background: var(--ms-surface) var(--ms-texture); background-blend-mode: multiply; font-style: var(--ms-body-style); color: var(--ms-ink); }
.mapview.ms-style :is(.map-legend-title, .map-card h3) { font-family: var(--ms-title-font); font-weight: var(--ms-title-weight); font-style: normal; }
.mapview.ms-style .map-legend-title { font-size: 1.05em; }
.mapview.ms-fairy .map-legend, .mapview.ms-fairy .map-card { border-radius: 16px; border-width: 2px; }
.mapview.ms-atlas .map-legend, .mapview.ms-atlas .map-card { border-radius: 2px; box-shadow: 0 0 0 3px var(--ms-surface), 0 0 0 4px var(--ms-ink); }
.mapview.ms-historic .map-legend, .mapview.ms-historic .map-card { border-radius: 3px; border-color: var(--ms-ink2); }
.mapview.ms-style .captions text { font-weight: 400; }
/* Stary atlas: podwójna ramka wokół mapy */
.mapview.ms-atlas .mapview-map { outline: 3px double var(--ms-ink); outline-offset: -6px; }
.mapview.ms-style .wm-btn { background: var(--ms-surface); color: var(--ms-ink); border-color: var(--ms-line); }

/* Mapa zdrapka: złota kopia konturu zdrapywana animacją (mapview.js) – nie przechwytuje kliknięć */
.mapview .scratch-anim { pointer-events: none; }
.map-legend-source { margin: 6px 0 0; max-width: 260px; font-size: .7rem; color: var(--muted); }
.map-sources { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.map-sources a { color: inherit; }
.map-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wm-marker.mk circle { stroke-width: 1.5px; }
.wm-marker .mk-glyph { pointer-events: none; }
.wm-marker.is-selected circle { stroke: var(--ink); stroke-width: 3px; }
.wm-marker.is-hot circle { stroke: var(--ink); stroke-width: 2.5px; }

.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 4; max-width: min(300px, 60%); max-height: 55%; overflow: auto;
  padding: 10px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 10px;
  font-size: .8rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.map-legend-title { font-weight: 700; margin: 0 0 6px; }
.map-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.map-legend li { display: flex; align-items: center; }
.map-card {
  position: absolute; right: 12px; bottom: 12px; z-index: 5; width: min(320px, calc(100% - 24px)); max-height: 70%; overflow: auto;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: .92rem;
}
.map-card h3 { margin: 0 24px 6px 0; font-size: 1.05rem; }
.map-card p { margin: 0 0 6px; color: var(--ink-2); }
.map-card-value { font-size: 1.15rem; font-weight: 700; color: var(--ink) !important; display: flex; align-items: center; }
.map-card-meta { font-size: .82rem; color: var(--muted) !important; }
.map-card-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px; }
@media (max-width: 600px) {
  .map-legend { position: static; max-width: none; max-height: none; margin: 8px; }
  .map-card { left: 8px; right: 8px; width: auto; }
}

.map-page .map-head { padding-top: 24px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.map-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--muted); }
div.map-meta { margin: 0 0 1em; }   /* <div>, bo w środku może być <details> – odstęp jak dawny <p> */
/* Inne wersje językowe mapy (templates/map.php): menu pod wierszem metadanych na całą jego szerokość, dwie kolumny */
.map-meta:has(.map-langs) { position: relative; }
.map-meta .map-langs { position: static; }
.map-langs summary { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.map-langs summary::after { content: ' ▾'; text-decoration: none; display: inline-block; margin-left: .2em; }
.map-langs[open] summary::after { content: ' ▴'; }
.map-langs summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.map-meta .map-langs-list { left: 0; right: 0; width: auto; max-width: 420px; max-height: min(60vh, 420px); overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px; }
.map-langs-list a { display: block; padding: .4em .6em; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.map-langs-list a:hover, .map-langs-list a:focus-visible { background: var(--surface-2); }
.map-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; align-items: center; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-panel { left: 0; right: auto; width: min(420px, 90vw); padding: 12px; }
.map-stage { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Strona mapy (templates/map.php): jedna szerokość i jedna lewa krawędź – ekran mapy, podpis źródeł, dane, sekcje
   niżej w .container-wide (cała szerokość okna, margines boczny jak w nagłówku – jak w serwisach serii, także na
   bardzo szerokich ekranach). Komputer: ekran mapy na wysokość okna minus nagłówek (wysokości tylko w CSS – bez
   skoku układu), mapa wypełnia pole (moduł world-map: kontener z wysokością), panel po prawej – tytuł, opis
   (przycięty, przycisk „Pokaż cały opis”), metadane, przyciski, lista punktów albo tier lista. Telefon: tytuł, mapa
   w proporcjach mapy, reszta panelu pod nią. Długi tekst niżej ma własną szerokość wiersza (.map-data). */
.container-wide { width: 100%; margin: 0; padding: 0 20px; }
.map-screen { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.map-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.map-main > .ex-years { margin-top: 0; }
/* Pasek lat widoczny od wczytania (templates/map.php), wypełnia go explore.js – ta sama wysokość, bez skoku */
.map-main > .ex-years:empty { height: 122px; }
.map-screen .map-head .crumbs { margin-bottom: 6px; }
.lead-box { position: relative; }
.map-screen .lead { margin: 0; }
.lead-more { display: none; }
.map-more { display: none; }
.map-screen .map-meta { margin: 0; }
.map-screen .map-actions { margin: 0; }
.map-screen .notice { margin: 0; }
@media (max-width: 900px) {
  /* Kolejność: okruszki i tytuł, mapa, opis, metadane, przyciski, lista */
  .map-side, .map-screen .map-head { display: contents; }
  .map-side > *, .map-screen .map-head > * { order: 4; }
  .map-screen .map-head > .crumbs { order: 1; margin: 0; }
  .map-screen .map-head > h1 { order: 2; margin: 0; font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
  .map-screen > .map-main { order: 3; }
  .map-screen .lead { font-size: 1.02rem; }
  .map-screen .tier-board { margin-top: 0; }
  /* Mapa wczytana na szerokim ekranie i zwężona (np. okno na pół ekranu): znów w proporcjach mapy */
  #map:not(.mapview-regions):not(.map-box-area) .wm.wm-fixed-height > .wm-root { aspect-ratio: var(--wm-aspect, 2 / 1); }
  /* Mapa z obszarem (Europa, Afryka…): pole na ok. pół ekranu, obszar je wypełnia (mapview.js: fill) */
  .map-main > #map.map-box-area > .mapview-map { height: clamp(280px, 50svh, 440px); }
  .map-main > #map.map-box-area .wm > .wm-root { aspect-ratio: auto; }
  /* Miejsce na mapę już przed jej narysowaniem (templates/map.php: --map-k – wysokość do szerokości, --map-bar – pasek
     odtwarzacza): treść pod mapą nie przeskakuje; legenda pod mapą (≤ 600 px) dochodzi po narysowaniu */
  .map-main > #map { min-height: calc((100vw - 42px) * var(--map-k, .4483) + var(--map-bar, 0px) + 2px); }
  .map-main > #map.map-box-area { min-height: calc(clamp(280px, 50svh, 440px) + var(--map-bar, 0px) + 2px); }
  .map-main > #map[data-type="regions"] { min-height: calc(min(78vh, 720px) + 2px); }
  .map-main > #map[data-type="tiles"] { min-height: calc((100vw - 66px) * .4321 + 26px); }
  /* Panel punktów: wysokość z góry (templates/map.php: --ex-h), dłuższa lista przewija się w środku */
  .map-screen .explore-panel { height: min(70vh, var(--ex-h, 70vh)); max-height: none; }
}
@media (max-width: 600px) {
  /* Legenda pod mapą w dwóch kolumnach – krótsza, mniejszy skok treści po narysowaniu mapy */
  .map-main .map-legend ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; }
}
@media (min-width: 901px) {
  /* Ekran mapy „na styk” jak w serwisach serii (castlesmap, ufo, ghostmap, volcanomap): mapa bez ramki, zaokrągleń
     i odstępów – od nagłówka do dołu okna, od lewej krawędzi okna do panelu; panel po prawej (jak w większości
     serwisów: ufo, ghostmap, worldnumbersmap, vpnmap, plantsmap) przylega do mapy – tylko linia podziału, tło
     powierzchni; pasek lat, oś czasu i quiz przyklejone do mapy (pełna szerokość pola mapy, linia podziału). */
  .map-screen {
    display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 400px); grid-template-areas: 'main side';
    gap: 0; padding: 0; border-bottom: 1px solid var(--line);
    height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h)); min-height: 560px;
  }
  .map-main { grid-area: main; min-height: 0; gap: 0; }
  .map-main > .quiz-bar { flex: none; margin: 0; border-width: 0 0 1px; border-radius: 0; padding: 12px 20px; }
  .map-main > .ex-years { flex: none; border-width: 1px 0 0; border-radius: 0; padding: 8px 20px 6px; }
  .map-main > .ex-years:empty { height: 119px; }
  .map-main > #map { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; border: 0; border-radius: 0; }
  .map-main > #map > .mapview-map { flex: 1 1 0; min-height: 0; height: auto; }
  .map-main > #map > .timebar { flex: none; padding: 8px 20px; }
  /* Mapa wczytana na wąskim ekranie i poszerzona: wypełnia pole jak mapa z ustaloną wysokością */
  .map-main #map .wm > .wm-root, .map-main #map .rm > .rm-root { aspect-ratio: auto; }
  .map-side {
    grid-area: side; min-width: 0; min-height: 0; display: flex; flex-direction: column;
    background: var(--surface); border-left: 1px solid var(--line);
  }
  .map-side .map-head { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 16px; }
  .map-side .crumbs { margin: 0 0 -2px; font-size: .78rem; }
  .map-side h1 { margin: 0; font-size: clamp(1.4rem, 1rem + .6vw, 1.7rem); line-height: 1.15; letter-spacing: -.015em; overflow-wrap: anywhere; }
  .map-side .lead {
    max-width: none; font-size: .93rem; line-height: 1.55;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
  }
  /* „Pokaż cały opis” na końcu ostatniego wiersza (map.js pokazuje go tylko przy przyciętym opisie) */
  .lead-more {
    display: block; position: absolute; right: 0; bottom: 0; padding: 0 0 0 2.2em; border: 0; cursor: pointer;
    background: linear-gradient(90deg, transparent, var(--surface) 1.8em); color: var(--link);
    font: inherit; font-size: .84rem; font-weight: 600; line-height: calc(.93rem * 1.55);
  }
  .lead-more:hover { text-decoration: underline; }
  .lead-more[hidden] { display: none; }
  .lead-box.is-open .lead { display: block; max-height: 42vh; overflow: auto; }
  .map-side .map-meta { font-size: .78rem; gap: 2px 12px; }
  .map-side .map-actions { position: relative; gap: 6px; }
  .map-side .map-actions .btn-sm { font-size: .84rem; }
  /* Menu „Osadź” i PNG pod rzędem przycisków na szerokość panelu – nie wychodzą poza ekran */
  .map-side .map-actions .dropdown, .map-side .map-actions .export-wrap { position: static; }
  .map-side .map-actions .dropdown-panel { left: 0; right: 0; width: auto; }
  .map-side .notice { font-size: .85rem; }
  .map-side .explore-panel {
    contain: none; flex: 1 1 0; min-height: 0; padding: 14px 22px 14px;
    background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0;
    scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; overscroll-behavior: contain;
  }
  /* grid-auto-rows: max-content – wiersze (overflow: hidden) nie kurczą się do wysokości panelu, lista się przewija */
  .map-side .tier-board {
    flex: 1 1 0; min-height: 0; overflow: auto; grid-auto-rows: max-content; align-content: start; margin: 0; padding: 14px 22px;
    border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; overscroll-behavior: contain;
  }
  .map-side .tier-row { min-height: 44px; }
  .map-side .tier-label:not(.is-long) { font-size: 1.15rem; }
  /* „Dane z mapy ↓” – dyskretna wskazówka przewijania u dołu panelu (jak „Więcej ↓” w serwisach) */
  .map-more {
    display: block; flex: none; margin-top: auto; padding: 8px 22px 9px; border-top: 1px solid var(--line);
    font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  }
  .map-more:hover { color: var(--ink); }
  /* Pod ekranem mapy: podpis źródeł tuż pod linią mapy */
  .map-page .container-wide.map-sources { padding-top: 10px; }
}
.map-page .container-wide.map-sources { margin-top: 0; }
/* Mapa świata w polu o innych proporcjach niż świat (ekran mapy): tło pola w kolorze oceanu, bez obrysu globu – świat
   leży na morzu, bez pustych pasów nad i pod nim (style map i mapy kosmosu mają własne tło) */
.map-main > #map:not(.ms-style):not(.mapview-space):not(.mapview-tiles):not(.mapview-regions) > .mapview-map { background: var(--ocean); }
.map-main > #map:not(.ms-style) .wm[data-wm-theme] { --wm-sphere-stroke: transparent; }
/* Przed i po: legenda nad suwakiem porównania (nie zasłania go) */
.map-main .mapview-compare .map-legend { bottom: 40px; }
.map-page .container-wide.map-data { padding-top: 28px; }
.map-data .table-wrap, .map-data > p, .map-data .notes, .map-data .marker-list, .map-data .cat-groups { max-width: 1200px; }
.map-data .marker-list p, .map-data .cat-groups p, .map-data .notes li { max-width: 80ch; }
.map-data { padding-top: 36px; }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th, .data-table td { padding: .55em .9em; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { font-size: .8rem; color: var(--muted); font-weight: 650; background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { white-space: nowrap; display: flex; gap: 12px; }
.cat-groups { display: grid; gap: 18px; }
.cat-groups h3 { display: flex; align-items: center; gap: 4px; }
.cat-groups p { color: var(--ink-2); }
/* Tier lista (mapa kategorii z settings.tiers – mapview.js, templates/map.php): wiersze poziomów pod mapą – kolorowe
   pole z nazwą poziomu (napis ciemny – kontrast ≥ 5:1 z domyślnymi kolorami) i państwa w tle koloru poziomu. */
.tier-board { display: grid; gap: 4px; margin-top: 12px; }
.tier-row { display: grid; grid-template-columns: var(--tier-w, 64px) minmax(0, 1fr); min-height: 52px; border-radius: 8px; overflow: hidden; background: color-mix(in srgb, var(--tier) 18%, var(--surface)); }
.tier-label { display: grid; place-items: center; min-width: 0; padding: 6px 8px; background: var(--tier); font-weight: 800; font-size: 1.4rem; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.tier-label.is-long { font-size: 1rem; }
.tier-items { list-style: none; margin: 0; padding: 7px 8px; display: flex; flex-wrap: wrap; gap: 5px 6px; align-items: center; }
.tier-items li { margin: 0; }
.tier-items button { font: inherit; font-size: .88rem; line-height: 1.2; padding: .3em .65em; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tier) 55%, var(--line)); background: var(--surface); color: var(--ink); cursor: pointer; }
.tier-items button:hover, .tier-items button:focus-visible { border-color: var(--ink); }
.tier-empty { color: var(--muted); }
.mapview .wm-country.is-tier-hl, .mapview .wm-country.is-picked { stroke: var(--ink); stroke-width: 2.5px; }
/* Mapa z podpisami (settings.captions – mapview.js layoutCaptions): podpisy z obwódką w kolorze tła, bez kliknięć,
   ukryte w czasie quizu (zdradzałyby odpowiedź) */
.mapview .captions { pointer-events: none; }
.mapview .captions text { fill: var(--ink); stroke: var(--surface); paint-order: stroke; stroke-linejoin: round; font-weight: 600; font-family: var(--font); }
.mapview .caption-line { stroke: var(--ink-2); }
.mapview .caption-dot { fill: var(--ink); }
.quiz-playing .captions { display: none; }
.embed .tier-board { flex: none; max-height: 42%; overflow: auto; margin: 0; padding: 6px; border-top: 1px solid var(--line); }
.embed .tier-row { min-height: 40px; }
.embed .tier-label:not(.is-long) { font-size: 1.1rem; }
/* Mapy kosmosu (moduł space-map, style silników: assets/space-map/src/space-map.css): ciemne niebo niezależnie od motywu strony */
.mapview-space .mapview-map { background: #070b1c; }
.map-box.mapview-space { border-color: #1b2347; background: #070b1c; }
.mapview-space .map-legend { background: rgba(9, 13, 32, .86); border-color: #26305e; color: #e3e8ff; }
.mapview-space .map-legend-title { color: #fff; }
.mapview-space .map-credit { background: rgba(9, 13, 32, .7); color: #9aa5d1; }
.mapview-space .wm-hl { stroke: #fff; }
.mapview-system .wm-hl { display: none; }
.orbitbar .tp-counter { min-width: 9.5em; font-size: 1rem; }
@media (max-width: 600px) { .orbitbar { flex-wrap: wrap; } .orbitbar .tp-range { order: 5; flex-basis: 100%; } }
.mapview-space .wm-marker.mk circle { stroke: rgba(255, 255, 255, .92); stroke-width: 2px; }
.mapview-space .wm-marker.is-selected circle { stroke: #ffd166; stroke-width: 3px; }

/* Mapa punktów z panelem (assets/js/explore.js): mapa i pasek lat po lewej, panel z listą i kartą po prawej */
.explore { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.explore-main { min-width: 0; }
/* contain: size – panel nie wydłuża wiersza: ma wysokość mapy z paskiem lat (najmniej 380px), dłuższa lista się przewija */
.explore-panel { contain: size; display: flex; flex-direction: column; gap: 10px; min-height: 380px; overflow: auto; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ex-title { margin: 0; font-weight: 700; }
.ex-search { width: 100%; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: .8rem; cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.ex-head { margin: 4px 0 6px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ex-head b { color: var(--ink); }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ex-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ex-list button:hover, .ex-list button:focus-visible { background: var(--surface-2); }
.ex-list img { width: 40px; height: 40px; flex: none; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.ex-list strong { display: block; font-size: .9rem; font-weight: 600; }
.ex-list em { display: block; font-size: .78rem; font-style: normal; color: var(--muted); }
.ex-dot { width: 12px; height: 12px; flex: none; margin: 0 14px; border-radius: 50%; }
.ex-near .ex-dot { margin: 0 4px; }
.ex-more { font-size: .82rem; margin: 6px 4px 0; }
.ex-back { align-self: flex-start; margin-bottom: 6px; }
.ex-card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.ex-card .map-card-meta { display: flex; align-items: center; margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.ex-card .map-card-link { display: inline-block; margin-top: 8px; }
.pt-img { margin: 0 0 10px; }
.pt-img img { display: block; width: 100%; height: auto; max-height: 240px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.pt-img figcaption { margin-top: 4px; font-size: .72rem; color: var(--muted); }
.map-card .pt-img img { max-height: 160px; }
.pt-fields { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 8px; font-size: .88rem; }
.pt-fields dt { color: var(--muted); }
.pt-fields dd { margin: 0; font-weight: 600; }
.pt-desc { white-space: pre-line; }
.pt-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .88rem; color: var(--muted); }
/* Pasek lat pod mapą: słupki z liczbą punktów, kliknięcie – przedział, przeciągnięcie – zakres */
.ex-years { margin-top: 10px; padding: 10px 12px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ex-years-head { display: flex; align-items: center; gap: 12px; min-height: 30px; font-size: .85rem; color: var(--muted); }
.ex-years-head b { color: var(--ink); }
.ex-years-all { margin-left: auto; }
.ex-years-play { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); cursor: pointer; }
.ex-years-play svg { width: 15px; height: 15px; fill: currentColor; }
.ex-years-play .i-pause, .ex-years.is-playing .ex-years-play .i-play { display: none; }
.ex-years.is-playing .ex-years-play .i-pause { display: inline; }
.ex-years-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; touch-action: none; user-select: none; }
.ex-bar { flex: 1; display: flex; align-items: flex-end; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.ex-bar span { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--line-2); }
.ex-bar:hover span { background: var(--ink-2); }
.ex-bar.is-on span { background: var(--accent); }
.ex-years-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
/* Pył: wszystkie punkty dużej mapy jako kropki stałej wielkości (klikalne są tylko znaczniki) */
.dust { fill: none; stroke-linecap: round; stroke-width: 3px; vector-effect: non-scaling-stroke; opacity: .55; pointer-events: none; }
.markers-hidden .dust { display: none; }
@media (max-width: 900px) {
  .explore { grid-template-columns: 1fr; }
  .explore-panel { contain: none; min-height: 0; max-height: 70vh; }
}
.marker-list { padding-left: 1.4em; display: grid; gap: 14px; }
.marker-list h3 { margin-bottom: .2em; }
.marker-list p { margin: 0 0 .2em; }
.notes { padding-left: 1.2em; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 44px; padding: 26px 28px; background: var(--accent-soft); border-radius: var(--radius); }
.cta-band h2 { margin-bottom: .2em; }
.cta-band p { margin: 0; color: var(--ink-2); }
.map-page .cta-band { max-width: calc(var(--wide) - 40px); }
/* Pasek w szerokim kontenerze: tło na szerokość treści (lewa krawędź jak reszta strony) */
.map-page .container-wide.cta-band { width: auto; max-width: none; margin-left: 20px; margin-right: 20px; }

/* --- Osadzenie (<iframe>) -------------------------------------------------- */

.page-embed { background: transparent; min-height: 0; }
.embed { display: flex; flex-direction: column; height: 100vh; }
.embed-map { flex: 1; min-height: 0; border-radius: 0; border: 0; }
.embed-map .mapview-map { height: 100%; }
.embed-foot { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 10px; font-size: .8rem; border-top: 1px solid var(--line); background: var(--surface); }
.embed-foot a { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-brand { font-weight: 700; flex: none; }
.embed-foot .export-wrap { flex: none; }
.embed-foot .export-btn { padding: .2em .55em; box-shadow: none; }

/* Eksport PNG (templates/partials/export-button.php, menu: assets/export/export.css) */
.export-wrap { position: relative; display: inline-flex; }
.export-trigger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.export-trigger .caret { width: 12px; height: 12px; margin-left: -.15rem; transition: transform .15s; }
.export-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }
.export-trigger:disabled { opacity: .6; cursor: progress; }

/* --- Tworzenie mapy, konto, logowanie, cennik ------------------------------ */

.create-step { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.create-step > legend { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 750; margin-bottom: 14px; padding: 0; }
.step-no { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .95rem; }
.type-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.type-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.type-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.type-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.type-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Podgląd: WebP z php cli.php previews (jasny i ciemny wariant – type_preview(), reguły na końcu pliku). */
.type-preview { display: block; aspect-ratio: 2 / 1; background: var(--ocean); border-bottom: 1px solid var(--line); }
.type-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.type-text { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; }
.type-text b { font-size: 1.12rem; }
.type-text span { color: var(--ink-2); font-size: .93rem; }
.type-text .type-uses { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.type-check {
  position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-2); color: transparent; font-weight: 800; font-size: .9rem;
}
.type-card:has(input:checked) .type-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.form-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.auth { max-width: 460px; padding-top: 40px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-form h1 { font-size: 1.6rem; }
.card-form h2 { font-size: 1.15rem; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 32px; align-items: start; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.status { font-size: .8rem; font-weight: 650; padding: .1em .55em; border-radius: 999px; }
.status-draft { background: var(--surface-3); color: var(--ink-2); }
.status-public { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.status-unlisted { background: var(--accent-soft); color: var(--link); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 860px; margin: 10px auto 0; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.plan-pro { border: 2px solid var(--accent); }
.price { font-size: 1.6rem; font-weight: 800; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; }
.plan li { display: flex; justify-content: space-between; gap: 12px; padding: .5em 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.plan li span { color: var(--ink-2); }
.plan-current { font-weight: 700; color: var(--ok); text-align: center; margin: 0; }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan .price { margin-bottom: 0; }
.price-alt { margin: 2px 0 16px; color: var(--ink-2); font-size: .9rem; }
.plan-buy { display: grid; gap: 8px; }
.pricing-notes { max-width: 860px; margin: 18px auto 0; font-size: .85rem; text-align: center; line-height: 1.6; }
/* Panel konta: plan i subskrypcja */
.billing-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 12px; }
.billing-box dt { color: var(--muted); }
.billing-box dd { margin: 0; font-weight: 600; }
.billing-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.verify-banner span { flex: 1 1 320px; }
.auth-forgot { margin: -4px 0 12px; text-align: right; }

.prose { padding-top: 36px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }
.prose h3 { margin-top: 1.3em; }
.legal ol { padding-left: 1.4em; }
.contact-form { margin: 24px 0; }
.contact-form .check { margin-top: 4px; }
.form-clause, .form-required { font-size: .85rem; }
.error-page { padding: 60px 20px; text-align: center; }

/* --- Edytor ------------------------------------------------------------------ */

.page-editor main { display: flex; }
.editor { flex: 1; display: flex; flex-direction: column; height: calc(100vh - var(--header-h)); min-height: 520px; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.editor-title { flex: 1 1 240px; font-size: 1.1rem !important; font-weight: 700; border-color: transparent !important; background: transparent !important; }
.editor-title:hover { border-color: var(--line-2) !important; }
.editor-type { font-size: .8rem; color: var(--muted); }
.editor-state { font-size: .82rem; color: var(--muted); min-width: 9ch; }
.editor-state.is-dirty { color: var(--warn); }
.editor-state.is-saved { color: var(--ok); }
/* Tworzenie bez konta: okno „Zapisz na koncie”, ramka szkicu w zakładce Publikacja, szkice z przeglądarki na koncie */
.guest-dialog { max-width: min(460px, calc(100vw - 32px)); padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.guest-dialog::backdrop { background: rgba(11, 11, 11, .45); }
.guest-dialog h2 { margin: 0 0 .5em; font-size: 1.2rem; }
.guest-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0; }
.guest-dialog-close { margin-top: 4px; }
.guest-box { margin-bottom: 16px; font-size: .9rem; }
.guest-box p { margin: 0 0 .6em; }
.local-drafts { list-style: none; margin: .6em 0 0; padding: 0; display: grid; gap: 8px; }
.local-drafts li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.local-drafts-actions { display: flex; gap: 6px; }
/* Wstaw dane z serii: przycisk w zakładce Dane, okno z galerią wzorów, podpis źródła w zakładce Wygląd */
.series-insert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.series-insert .field-hint { margin: 0; }
.series-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.series-dialog::backdrop { background: rgba(11, 11, 11, .45); }
.series-dialog h2 { margin: 0 0 .3em; font-size: 1.2rem; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 14px 0; }
.series-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; text-align: left; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.series-card:hover, .series-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.series-card .muted { font-size: .82rem; }
.series-credit { font-size: .72rem; color: var(--muted); }
.series-source select { margin-top: 4px; }
.series-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.series-gallery a { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: inherit; text-decoration: none; }
.series-gallery a:hover { border-color: var(--accent); }
.series-gallery span { font-size: .8rem; color: var(--muted); }
.editor-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.editor-map { position: relative; padding: 14px; display: flex; flex-direction: column; min-height: 0; }
.editor-map #ed-map { flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.editor-map .mapview-map { height: 100%; }
.editor-under { display: flex; align-items: flex-start; gap: 12px; }
/* Tier lista w edytorze: wybrane państwo i przyciski poziomów pod mapą, wiersze poziomów (przewijane) */
.tier-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.tier-pick-name { font-weight: 700; min-width: 8em; }
.tier-pick-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-btn { min-width: 44px; min-height: 40px; padding: 0 10px; border: 2px solid transparent; border-radius: 8px; background: var(--tier); font: inherit; font-weight: 800; cursor: pointer; }
.tier-btn.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.tier-btn[disabled] { opacity: .45; cursor: default; }
.tier-btn-off { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.tier-board-ed { flex: none; max-height: 30%; overflow: auto; margin-top: 8px; }
.tier-board-ed .tier-row { min-height: 40px; }
.tier-board-ed .tier-label:not(.is-long) { font-size: 1.1rem; }
.tier-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tier-tools select { width: auto; }
/* Własny widok startowy (edytor, zakładka Wygląd): stan, przyciski „Zapisz ten widok…” / „Wróć do obszaru” */
.view-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.view-state { margin: 0; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: .85rem; }
.view-field .field-hint { margin: 2px 0 0; }
.editor-under .export-wrap { margin: 6px 0 0 auto; flex: none; }
.editor-hint { font-size: .85rem; color: var(--muted); margin: 8px 2px 0; }
.editor-hint.is-pulse { color: var(--accent); font-weight: 600; }
.editor-side { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; padding: 12px 6px; border: 0; background: none; font: 600 .88rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { padding: 16px; overflow-y: auto; flex: 1; }
.tab-panel h3 { font-size: .95rem; margin-top: 18px; }
.add-row { display: flex; gap: 6px; margin-bottom: 12px; }
.add-row input { flex: 1 1 0; min-width: 0; }
.add-row input[name="country"], .add-row input[name="title"] { flex: 2 1 0; }
.add-row select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 45%; }
/* Wyszukiwarka miejscowości (assets/js/place-search.js): lista podpowiedzi pod polem */
.place-search { position: relative; display: flex; flex: 2 1 0; min-width: 0; }
.place-search > input { flex: 1; min-width: 0; width: 100%; }
.add-route .place-search { flex: 1 1 0; }
.place-suggest {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: max(100%, 300px); max-width: 90vw; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow);
}
.place-suggest li[data-i] { padding: 6px 8px; border-radius: 7px; cursor: pointer; line-height: 1.3; }
.place-suggest li[data-i]:hover, .place-suggest li.is-active { background: var(--accent-soft); }
.place-suggest strong { display: block; font-size: .9rem; }
.place-suggest span { display: block; font-size: .76rem; color: var(--muted); }
.place-suggest-credit { padding: 4px 8px 2px; font-size: .68rem; color: var(--muted); }
.import-geo { font-size: .88rem; color: var(--ink-2); }
.list-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.list-tools input { flex: 1; }
.list-tools span { font-size: .82rem; white-space: nowrap; }
.data-list { display: grid; gap: 2px; margin-bottom: 14px; }
.data-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 26px; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 6px; }
.data-row:hover { background: var(--surface-2); }
.data-row.is-flash { background: var(--accent-soft); }
.data-row input { padding: .35em .5em; font-size: .88rem; }
.row-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-del { border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; border-radius: 6px; line-height: 1; padding: 4px; }
.row-del:hover { color: var(--danger); background: var(--surface-3); }
.empty { color: var(--muted); font-size: .9rem; padding: 12px 4px; }
.marker-item { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.marker-item.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.marker-item summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; list-style: none; font-size: .9rem; }
.marker-item summary::-webkit-details-marker { display: none; }
.marker-item summary .row-name { flex: 1; min-width: 0; }
.marker-item, .marker-item summary { min-width: 0; }
.marker-item summary .muted { font-size: .78rem; }
.marker-fields { padding: 4px 10px 10px; }
.marker-fields .field { margin-bottom: 8px; }
.pt-field-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 12px; align-items: end; }
.pt-field-inputs .check { margin-bottom: 8px; }
/* Pola punktów (edytor mapy punktów): nazwa, rodzaj, usuwanie */
.fields-box { margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.fields-box summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.fields-box[open] summary { margin-bottom: 6px; }
.pt-fields-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.pt-fields-list li { display: flex; gap: 6px; align-items: center; }
.pt-fields-list input { flex: 1; min-width: 0; padding: .35em .5em; font-size: .9rem; }
.pt-fields-list select { width: auto; padding: .35em .5em; font-size: .9rem; }
.imp-newfields { display: block; margin: 8px 0; line-height: 1.9; }
.import-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 16px; font-size: .82rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#imp-text { font: .85rem/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.import-map { padding: 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.import-map .field { margin-bottom: 6px; }
.import-map select { width: auto; min-width: 150px; }
.import-summary { font-size: .9rem; }
.warn { color: var(--warn); }
.import-skipped { font-size: .85rem; margin-bottom: 10px; color: var(--ink-2); }
.import-preview { width: 100%; font-size: .85rem; border-collapse: collapse; margin-bottom: 12px; }
.import-preview td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.import-mode { margin-top: 6px; }
/* Styl mapy (edytor, zakładka Wygląd): galeria miniatur */
.style-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.style-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.style-card .style-name { font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.style-card.is-on { border-color: var(--ink); }
.style-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-card.is-locked { cursor: default; }
.style-card.is-locked img { opacity: .55; }
.style-field small.field-hint { display: block; margin-top: 6px; }
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.palette { display: flex; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; height: 26px; }
.palette.is-on { border-color: var(--ink); }
.palette input { position: absolute; opacity: 0; pointer-events: none; }
.palette span { flex: 1; }
.cat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cat-list li { display: flex; gap: 8px; align-items: center; }
.cat-list input[type="text"] { padding: .35em .5em; font-size: .9rem; }
.slug-field { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.slug-prefix { font-size: .78rem; color: var(--muted); padding: 0 0 0 .6em; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.slug-field input { border: 0 !important; outline: 0 !important; padding-left: 2px; }
.copy-row { display: flex; gap: 6px; margin-bottom: 10px; }
.copy-row input { font-size: .82rem; }
.share, .versions { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.versions ul { padding-left: 1.1em; font-size: .9rem; }
.editor-side .danger-zone { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
@media (max-width: 900px) {
  .editor { height: auto; }
  /* minmax(0, 1fr) i min-width: 0 – długie nazwy i tabele nie rozpychają kolumny poza ekran telefonu (390 px) */
  .editor-main { grid-template-columns: minmax(0, 1fr); }
  .editor-map { height: 62vh; min-width: 0; }
  .editor-side { border-left: 0; border-top: 1px solid var(--line); min-width: 0; }
  .tab-panel { overflow: visible; }
}

/* --- Komunikaty ------------------------------------------------------------ */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: .9rem; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast-ok { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast.is-out { opacity: 0; transform: translateY(6px); }

/* --- Rodzaje map: tworzenie, legenda, warstwy ---------------------------------------- */

[hidden] { display: none !important; }
.type-group { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 12px; }
.create-step .type-choice { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.create-step-sticky { position: sticky; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); padding: 14px 0 6px; border-top: 1px solid var(--line); }
.section-more { margin-top: 22px; }

/* Mapa kafelkowa (assets/js/tilemap.js) */
.tm { position: relative; }
.tm-svg { display: block; width: 100%; height: auto; max-height: 100%; }
.tm-tile { cursor: pointer; outline: none; }
.tm-tile rect { fill: var(--tm-fill, var(--land)); transition: opacity .12s; }
.tm-tile:hover rect, .tm-tile:focus-visible rect { stroke: var(--ink); stroke-width: .6; }
.tm-tile text { font: 700 3.1px var(--font); text-anchor: middle; fill: var(--ink-2); pointer-events: none; }
.tm-tile.is-filled text { fill: #1c1c1c; }
.tm-tile.is-filled.is-dark text { fill: #fff; }
.tm-tooltip { position: absolute; z-index: 3; padding: 5px 9px; border-radius: 6px; font-size: 13px; background: var(--ink); color: var(--bg); pointer-events: none; white-space: nowrap; }
.mapview-tiles .mapview-map { padding: 12px; }

/* Bąbelki, trasy, sześciokąty gęstości (warstwa overlay WorldMap) */
.mapview .bubble { fill: var(--bubble); fill-opacity: .5; stroke: var(--bubble); stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: pointer; }
.mapview .bubble:hover { fill-opacity: .75; }
.mapview .route { fill: none; stroke: var(--route); stroke-width: 2.2px; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .85; pointer-events: stroke; cursor: pointer; }
.mapview .route:hover { stroke-width: 4px; opacity: 1; }
.mapview .hexbin { stroke: var(--land-border); stroke-width: .4px; vector-effect: non-scaling-stroke; opacity: .92; }
.wm-marker.mk-end circle { stroke-width: 1px; }
/* Edytor: punkty i końce tras da się przeciągać (assets/js/map-drag.js); punkty mapy gęstości – małe, nad sześciokątami */
.editor-map .wm-marker { cursor: grab; }
.is-dragging-item, .is-dragging-item * { cursor: grabbing !important; }
/* Chwycony obiekt (map-drag.js): wyraźna obwódka od chwili naciśnięcia, bez czekania na ruch */
.wm-marker.is-grabbed circle { stroke: var(--ink); stroke-width: 3px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45)); }
.wm-marker.is-grabbed, .wm-marker.is-grabbed * { cursor: grabbing; }
.wm-marker.mk-point circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1px; }
.wm-marker.mk-point.is-selected circle { fill: var(--accent-2); }
.markers-hidden .wm-layer-markers { display: none; }

/* Quiz: wygląd paska i podświetleń – moduł quiz z assets (public/assets/quiz/quiz.css); tu tylko kolory serwisu */
.quiz { --quiz-target: var(--accent-2); --quiz-radius: var(--radius); }
.quiz-covered { visibility: hidden; }
/* Wyzwanie dnia */
.daily-date { display: block; font-weight: 400; color: var(--ink-2); font-size: .45em; margin-top: .3em; }
.daily-shared { font-weight: 600; }
.daily-status:empty { display: none; }
.daily-status { margin-top: 12px; }
.daily-done { margin: 0; font-weight: 700; font-size: 1.1rem; }
.daily-link { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.daily-archive { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 4px 18px; }
.daily-mark { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.daily-sources { font-size: .85rem; }
.quiz-levels { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; }
.quiz-levels .radio { margin: 0; }

/* Oś czasu */
/* Pasek odtwarzacza (moduł timeline – player.css, klasa .tp): oś czasu, dzień układu planetarnego, trasy po kolei */
.timebar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); --tp-surface: var(--surface); }
.timebar[hidden] { display: none; }
/* Legenda i karta nad paskiem odtwarzacza (pasek jest w tym samym pudełku mapy, pod nią) */
@media (min-width: 601px) {
  .mapview:has(> .timebar:not([hidden])) :is(.map-legend, .map-card) { bottom: 62px; }
}
/* Podpisy źródeł i podkładu w rogu samej mapy, nie na pasku */
.mapview:has(> .timebar:not([hidden])) > .mapview-map { position: relative; }
.mapview-space .timebar { background: #070b1c; border-top-color: #26305e; --tp-ink: #e3e8ff; --tp-muted: #9aa5d1; --tp-line: #34407a; --tp-surface: #0d1330; }
.mapview-space .orbit-today { color: #e3e8ff; border-color: #34407a; }

/* Przed i po: druga mapa odsłaniana suwakiem */
.mapview-compare .mapview-map { position: relative; }
/* Obie mapy w jednej komórce siatki – zawsze ten sam rozmiar i położenie, także gdy pole mapy jest wyższe niż mapa (edytor). */
.mapview-compare .mapview-map { display: grid; }
.mapview-compare .cmp-a, .mapview-compare .cmp-b { grid-area: 1 / 1; min-width: 0; min-height: 0; }
.mapview-compare .cmp-b { clip-path: inset(0 0 0 var(--cmp, 50%)); }
.mapview-compare .mapview-map::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--cmp, 50%); width: 2px; background: var(--ink); pointer-events: none; z-index: 2; }
.cmp-range { position: absolute; left: 8%; right: 8%; width: 84%; bottom: 10px; z-index: 4; accent-color: var(--ink); }
.cmp-label { position: absolute; top: 10px; z-index: 3; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; }
.cmp-label:empty { display: none; }
.cmp-label-a { left: 12px; }
.cmp-label-b { right: 56px; }

/* Legenda: dwie zmienne, licznik odwiedzonych */
.bv-legend { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 4px 6px; align-items: end; }
.bv-grid { grid-column: 2; display: grid; grid-template-columns: repeat(3, 16px); grid-auto-rows: 16px; gap: 1px; }
.bv-x { grid-column: 2; font-size: .75rem; }
.bv-y { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .75rem; }
.map-legend-stat { margin: 6px 0 0; }
.visited-stat { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-bottom: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: .9rem; }
.visited-stat > b:first-child { font-size: 1.2rem; }
.visited-total { font-size: 1.1rem; font-weight: 600; }

/* Edytor: lata, dwie wartości, trasy */
.year-bar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.year-bar .field { margin: 0; flex: 1 1 90px; }
.data-list.two-values .data-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 26px; }
.data-row select { padding: .35em .4em; font-size: .88rem; }
.add-route { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.add-route button { grid-column: 1 / -1; }

/* --- Iceberg ----------------------------------------------------------------------
   Niebo z granią nad linią wody i coraz ciemniejsze poziomy, przez które schodzi jeden masyw lodu
   (plastry SVG z app/Iceberg.php / assets/js/iceberg.js). Elementy leżą na pasie poziomu z poświatą pod tekstem. */

.iceberg-stage { position: relative; }
.iceberg { position: relative; border-radius: var(--radius); overflow: hidden; background: linear-gradient(var(--sky0), var(--sky1)); border: 1px solid var(--line); }
.ib-head { position: relative; z-index: 1; text-align: center; padding: 26px 16px 0; }
.ib-kicker { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #3b4d63; }
.ib-title { margin: 4px 0 0; font-size: clamp(1.4rem, 3vw, 2.2rem); color: #0b1f33; }
.ib-night .ib-kicker, .ib-night .ib-title { color: #e6eefc; }
.ib-level { position: relative; display: grid; align-items: center; background: var(--bg); padding: 14px 0; min-height: 98px; }
.ib-tip { background: transparent; padding-top: 24px; min-height: 185px; }
.ib-tip + .ib-level { border-top: 2px solid rgba(255, 255, 255, .85); }
.ib-level:last-child { padding-bottom: 30px; background: linear-gradient(var(--bg), var(--deep)); }
/* Poświata od powierzchni – słabnie z głębokością (--rays). */
.ib-level:not(.ib-tip)::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 130% at 50% -35%, rgba(255, 255, 255, var(--rays, 0)), transparent 55%); }
.ib-shape { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ib-name { position: absolute; left: 12px; top: 8px; margin: 0; max-width: 18%; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .92); z-index: 1; line-height: 1.25; text-shadow: 0 1px 2px rgba(4, 16, 31, .5); }
.ib-tip .ib-name { color: #3b4d63; top: auto; bottom: 10px; text-shadow: none; }
.ib-night .ib-tip .ib-name { color: #c9d6ee; }
.ib-items { position: relative; z-index: 1; width: min(76%, 860px); margin: 0 auto; }
.ib-tip .ib-items { width: min(54%, 560px); padding-top: 54px; }
.ib-items ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.ib-item { font: inherit; font-size: .95rem; color: var(--ink); background: none; border: 0; padding: 0; text-align: center; text-shadow: 0 1px 2px var(--halo), 0 0 7px var(--halo); }
button.ib-item { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
button.ib-item:hover { text-decoration-style: solid; }
.ib-card { position: absolute; left: 50%; right: auto; bottom: auto; transform: translateX(-50%); width: min(380px, calc(100% - 24px)); }
.ib-list { margin-bottom: 18px; }
.ib-list h3 { display: flex; align-items: center; gap: 8px; }
.ib-list ul { margin: 0; padding-left: 1.2em; }
.ib-list li { margin-bottom: .3em; }
.ib-depth { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 800; flex: none; }
.embed-iceberg .embed-map { overflow: auto; position: relative; }
.embed-iceberg .iceberg { border-radius: 0; border: 0; min-height: 100%; }
@media (max-width: 600px) {
  .ib-name { position: static; max-width: none; padding: 0 12px 6px; text-shadow: none; }
  .ib-items { width: 92%; }
  .ib-tip .ib-items { width: 88%; padding-top: 36px; }
}

/* Edytor icebergu */
.editor-iceberg .editor-map { overflow: auto; }
.ib-preview { position: relative; }
.ib-ed-level { border: 1px solid var(--line); border-left: 6px solid var(--bg); border-radius: 10px; padding: 10px; margin-bottom: 12px; background: var(--surface); }
.ib-ed-level header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ib-level-name { font-weight: 700; flex: 1; min-width: 0; }
.ib-add-level { margin: 4px 0 0; }
.ib-ed-items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.ib-ed-item.is-selected { outline: 2px solid var(--accent); border-radius: 8px; }
.ib-ed-row { display: flex; gap: 4px; align-items: center; }
.ib-ed-row input { flex: 1; padding: .35em .5em; font-size: .9rem; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; flex: none; }
.icon-btn:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn.is-on { border-color: var(--accent); color: var(--accent); }
.ib-ed-more { display: grid; gap: 4px; padding: 6px 0 4px 6px; }
.ib-ed-more textarea, .ib-ed-more input { font-size: .85rem; }
.ib-ed-add { display: flex; gap: 6px; }
.ib-ed-bulk { margin-top: 6px; font-size: .85rem; }
.ib-ed-bulk textarea { margin: 6px 0; }
.ib-themes { display: grid; gap: 8px; }
.ib-theme { display: flex; align-items: center; gap: 10px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.ib-theme.is-on { border-color: var(--accent); }
.ib-theme input { position: absolute; opacity: 0; }
.ib-theme-sw { display: flex; width: 120px; height: 22px; border-radius: 5px; overflow: hidden; }
.ib-theme-sw span { flex: 1; }

/* Mapa regionów: państwa bywają wysokie (Chile, Norwegia) – na stronie ograniczona wysokość, mapa się w niej mieści. */
.map-box.mapview-regions .mapview-map { height: min(78vh, 720px); }

/* Edytor: mapa i pasek osi czasu dzielą wysokość ramki (pasek pod mapą, nie poza nią). */
.editor-map .mapview { display: flex; flex-direction: column; }
.editor-map .mapview .mapview-map { flex: 1; min-height: 0; height: auto; }
.editor-map .timebar { flex: none; }

/* Kafle rodzajów na stronie „Stwórz”: przycisk (zalogowany – od razu tworzy pracę) albo link (gość – rejestracja). */
button.type-card { font: inherit; color: inherit; text-align: left; padding: 0; width: 100%; }
.type-card[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.type-card.is-suggested { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.type-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.type-go { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); font-weight: 800; color: var(--ink-2); transition: background .15s, color .15s; }
.type-card:hover .type-go, .type-card:focus-visible .type-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Strona główna: mozaika obrazków map z serii w nagłówku. */
.hero-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-mosaic a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s; }
.hero-mosaic a:hover { transform: translateY(-3px); }
.hero-mosaic img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }

/* Narzędzia „wkrótce” (TOOLS_OPEN=false): kafle bez akcji, z plakietką. */
.type-card.is-soon { cursor: default; }
a.type-card.is-soon { cursor: pointer; }
.type-card.is-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
a.type-card.is-soon:hover { border-color: var(--line-2); }
.type-soon { position: absolute; right: 12px; top: 12px; padding: .2em .7em; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.soon-page { padding: 60px 20px 20px; }

/* Podgląd rodzaju mapy (type_preview): jasny i ciemny obrazek według motywu strony */
.type-preview img.type-preview-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .type-preview img.type-preview-light { display: none; }
  :root:not([data-theme='light']) .type-preview img.type-preview-dark { display: block; }
}
:root[data-theme='dark'] .type-preview img.type-preview-light { display: none; }
:root[data-theme='dark'] .type-preview img.type-preview-dark { display: block; }

/* --- Panel administratora (/admin, templates/admin/) ----------------------- */

.admin { padding-bottom: 48px; }
.admin-head { padding-bottom: 0; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.admin-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 650; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.admin h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 22px; }
.admin-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.admin-flash { margin-top: 16px; }
.admin-section { margin: 28px 0; }
.admin-section > h2 { font-size: 1.2rem; }
.admin-section > h2 .muted { font-size: .9rem; font-weight: 500; }
.admin-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; margin: 18px 0; }
.admin-grid { margin-top: 0; }
.admin-grid h3 { font-size: 1rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.admin-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.admin-stat:hover { border-color: var(--accent); }
.admin-stat b { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.admin-stat span { font-size: .82rem; color: var(--muted); }
.admin-stat.is-warn b { color: var(--warn); }
.admin-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.admin-types .chip { text-decoration: none; }
.admin-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-list li { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; overflow-wrap: anywhere; }
.admin-list li:last-child { border-bottom: 0; }
.admin-list .muted { font-size: .85rem; }
.admin-config { list-style: none; padding: 0; margin: 0; }
.admin-config li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 7px 0 7px 18px; border-bottom: 1px solid var(--line); position: relative; font-size: .92rem; }
.admin-config li::before { content: ''; position: absolute; left: 2px; top: .95em; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.admin-config li.is-ok::before { background: var(--ok); }
.admin-config li.is-warn::before { background: var(--warn); }
.admin-config b { min-width: 120px; }
.admin-config span { color: var(--ink-2); }
.admin-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .93rem; }
.admin-dl dt { color: var(--muted); }
.admin-dl dd { margin: 0; overflow-wrap: anywhere; }
.admin-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.admin-inline .field { margin: 0; flex: 1 1 180px; }
.admin-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.admin-actions form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { text-decoration-thickness: 2px; }
.admin-table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.admin-table th a:hover { color: var(--ink); }
.admin-table td { vertical-align: top; }
.admin-message { max-width: 360px; }
.admin-message summary { cursor: pointer; }
.admin-message p { white-space: normal; margin: 6px 0 0; overflow-wrap: anywhere; }
.report-status { font-size: .8rem; font-weight: 650; padding: .1em .55em; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.report-new { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--warn); }
.report-resolved { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
/* Telefon: wiersze tabel jako karty (etykieta kolumny z data-label) */
@media (max-width: 700px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-table tbody tr:last-child { border-bottom: 0; }
  .admin-table td { border: 0; padding: 2px 14px; overflow-wrap: anywhere; }
  .admin-table td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: .8rem; }
  .admin-table .num { text-align: left; }
  .admin-table .admin-actions { padding-top: 6px; }
  .admin-message { max-width: none; }
  .admin-config b { min-width: 0; }
}

/* Strony krajów (templates/country.php, countries.php) – powiązania serii z modułu series-index */
.country-page, .countries-page { padding-bottom: 48px; }
.country-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 8px 0 8px; }
.country-map, .countries-map { margin: 0; }
.country-map-box { height: 340px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.countries-map .country-map-box { height: 460px; }
.country-map figcaption, .countries-map figcaption { margin-top: 6px; }
.country-cta { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; }
.country-cta h2 { font-size: 1.15rem; }
.country-cta .btn { margin: 4px 6px 0 0; }
.country-page .ol-links { --ol-radius: var(--radius-sm); }
.country-places { margin: 2rem 0; }
.places-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.places-col { border: 1px solid var(--line); border-top: 4px solid var(--ol-c); border-radius: var(--radius-sm); background: var(--surface); padding: 12px 16px; }
.places-col h3 { font-size: 1rem; margin-bottom: .4em; }
.places-col ol { margin: 0 0 .5em; padding-left: 1.3em; }
.places-col li { margin: .2em 0; }
.country-sources { margin-top: 1.5rem; max-width: 90ch; }
.country-sources a { color: inherit; }
.countries-list { list-style: none; padding: 0; margin: 24px 0 0; columns: 4 220px; column-gap: 24px; }
.countries-list li { break-inside: avoid; padding: 3px 0; }
@media (max-width: 760px) {
  .country-top { grid-template-columns: 1fr; }
  .country-map-box { height: 240px; }
  .countries-map .country-map-box { height: 280px; }
}

/* Porównanie dwóch krajów (templates/compare.php, compare-index.php) – kolory stron z Compare::COLORS (JS ustawia
   --vs-a / --vs-b według motywu; bez JS – wartości niżej) */
:root { --vs-a: #2f7fe0; --vs-b: #e8772e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --vs-a: #5b9df0; --vs-b: #f0904a; } }
:root[data-theme='dark'] { --vs-a: #5b9df0; --vs-b: #f0904a; }
.compare-page { padding-bottom: 48px; }
.vs-title .vs-vs, .vs-score .vs-vs { color: var(--muted); font-weight: 400; font-size: .7em; }
.vs-name-a { color: var(--vs-a); }
.vs-name-b { color: var(--vs-b); }
.vs-title .vs-name-a, .vs-title .vs-name-b { color: inherit; text-decoration: underline; text-decoration-thickness: .12em; text-underline-offset: .14em; }
.vs-title .vs-name-a { text-decoration-color: var(--vs-a); }
.vs-title .vs-name-b { text-decoration-color: var(--vs-b); }
.vs-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 10px; align-items: end; margin: 6px 0 18px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.vs-pick .field { margin: 0; }
.vs-pick .vs-field-a input { border-left: 4px solid var(--vs-a); }
.vs-pick .vs-field-b input { border-left: 4px solid var(--vs-b); }
.vs-swap { align-self: end; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.vs-swap svg { width: 20px; height: 20px; }
span.vs-swap { padding: 0 6px; font-weight: 700; }
.vs-go { min-height: 40px; }
.vs-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.vs-map { margin: 0; }
.vs-map-box { height: 380px; }
.vs-quiz { margin-bottom: 10px; scroll-margin-top: calc(var(--header-h, 64px) + 10px); }
.vs-key { display: inline-block; width: .9em; height: .9em; border-radius: 3px; vertical-align: -1px; background: var(--vs-a); }
.vs-key-b { background: var(--vs-b); }
.vs-side { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; }
.vs-side h2 { font-size: 1.05rem; margin-top: .4em; }
.vs-score { font-size: 1.35rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: .2em 0 .3em; }
.vs-score strong { font-size: 1.6em; }
.vs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.vs-facts { margin: 2rem 0 1rem; }
.vs-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.vs-table th, .vs-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.vs-table thead th { border-top: 0; background: var(--surface-2); font-size: .95rem; }
.vs-table thead .vs-name-a { text-align: left; }
.vs-table thead .vs-name-b { text-align: right; }
.vs-mid { text-align: center; font-weight: 400; color: var(--ink-2); width: 34%; }
.vs-label { display: block; font-weight: 600; color: var(--ink); }
.vs-note { display: block; font-size: .85rem; color: var(--ink-2); }
.vs-src { display: block; font-size: .75rem; color: var(--muted); }
.vs-src a { color: inherit; }
.vs-v { font-size: 1.05rem; font-variant-numeric: tabular-nums; width: 33%; }
.vs-va { text-align: left; }
.vs-vb { text-align: right; }
.vs-v a { color: inherit; text-decoration-color: var(--line-2); }
.vs-v a:hover { text-decoration-color: currentColor; }
.vs-v.is-win { font-weight: 700; }
.vs-va.is-win { color: var(--vs-a); box-shadow: inset 4px 0 0 var(--vs-a); background: color-mix(in srgb, var(--vs-a) 8%, var(--surface)); }
.vs-vb.is-win { color: var(--vs-b); box-shadow: inset -4px 0 0 var(--vs-b); background: color-mix(in srgb, var(--vs-b) 8%, var(--surface)); }
.vs-badge { display: inline-block; margin: 0 .3em; padding: 0 .45em; border: 1px solid currentColor; border-radius: 999px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; vertical-align: 2px; }
.vs-legend { margin-top: 8px; max-width: 90ch; }
.vs-more { margin: 2rem 0 1rem; }
.vs-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 6px 18px; }
.vs-about { margin: 2rem 0; max-width: 75ch; }
.country-compare { margin-top: 1rem; }
.country-compare form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.country-compare .field { margin: 0; flex: 1 1 10rem; }
.country-compare ul { list-style: none; padding: 0; margin: .6em 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .92rem; }
@media (max-width: 760px) {
  .vs-top { grid-template-columns: 1fr; }
  .vs-map-box { height: 260px; }
  .vs-pick { grid-template-columns: minmax(0, 1fr) auto; }
  .vs-pick .vs-field-a { grid-column: 1; }
  .vs-pick .vs-swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .vs-pick .vs-field-b { grid-column: 1; }
  .vs-pick .vs-go { grid-column: 1 / -1; }
  /* Tabela jako karty: kategoria nad wartościami obu krajów */
  .vs-table thead { display: none; }
  .vs-table tr { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
  .vs-table tr:first-child { border-top: 0; }
  .vs-table th, .vs-table td { border-top: 0; padding: 8px 12px; width: auto; }
  .vs-table .vs-mid { grid-column: 1 / -1; grid-row: 1; padding-bottom: 0; text-align: left; }
  .vs-table .vs-va { grid-row: 2; }
  .vs-table .vs-vb { grid-row: 2; }
}

/* „Prawdziwy rozmiar” (templates/truesize.php, assets/js/true-size.js) */
.ts-page { padding-bottom: 48px; }
.ts-tools { display: grid; grid-template-columns: minmax(0, 1.3fr) auto auto; gap: 12px 20px; align-items: end; margin: 6px 0 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ts-add { display: flex; gap: 8px; align-items: end; }
.ts-add .field { margin: 0; flex: 1; }
.ts-proj { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ts-proj legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 4px; }
.ts-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ts-map { margin: 0; }
.ts-svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  --ts-ocean: #e8eef3; --ts-land: #d9d8d1; --ts-grid: rgba(0, 0, 0, .1); user-select: none; -webkit-user-select: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .ts-svg { --ts-ocean: #1b2229; --ts-land: #3a3a41; --ts-grid: rgba(255, 255, 255, .1); } }
:root[data-theme='dark'] .ts-svg { --ts-ocean: #1b2229; --ts-land: #3a3a41; --ts-grid: rgba(255, 255, 255, .1); }
.ts-ocean { fill: var(--ts-ocean); }
.ts-land { fill: var(--ts-land); stroke: var(--surface); stroke-width: .35; stroke-linejoin: round; }
.ts-grid { fill: none; stroke: var(--ts-grid); stroke-width: .5; }
.ts-equator { fill: none; stroke: var(--ts-grid); stroke-width: 1.2; stroke-dasharray: 4 3; }
.ts-shape { cursor: grab; touch-action: none; outline: none; }
.ts-shape.is-dragging { cursor: grabbing; }
.ts-fill { fill: var(--ts-c); fill-opacity: .42; stroke: var(--ts-c); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ts-shape:hover .ts-fill, .ts-shape.is-dragging .ts-fill { fill-opacity: .58; }
.ts-shape:focus-visible .ts-fill { stroke-width: 3; stroke-dasharray: 5 3; }
.ts-label { font-size: var(--ts-fs, 13px); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: calc(var(--ts-fs, 13px) * .25); stroke-linejoin: round; pointer-events: none; }
.ts-panel { margin: 1.4rem 0; }
.ts-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 10px; }
.ts-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line);
  border-left: 4px solid var(--ts-c); border-radius: var(--radius-sm); background: var(--surface); }
.ts-swatch { width: 14px; height: 14px; margin-top: 4px; border-radius: 3px; background: var(--ts-c); opacity: .75; }
.ts-name { display: flex; flex-direction: column; gap: 1px; }
.ts-row-actions { display: flex; gap: 6px; }
.ts-about { max-width: 75ch; margin: 2rem 0; }
/* Telefon: mapa szersza niż ekran w pasie przewijanym w bok (jak tryb telefonu world-map) – palec poza konturem
   przewija pas albo stronę, na konturze – przeciąga */
.ts-scroll { border-radius: var(--radius); }
@media (max-width: 760px) {
  .ts-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .ts-svg { width: 920px; max-width: none; }
  .ts-tools { grid-template-columns: 1fr; }
  .ts-actions { justify-content: flex-start; }
}
