/* PlugsMap – „tabliczka znamionowa”: kość słoniowa jak płytka gniazdka, grafit, bursztyn przewodu pod napięciem.
   Manrope do tekstu, Fira Code do liczb, liter typów i etykiet. Jasny i ciemny motyw wg systemu. */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Fira Code';
  src: url('../fonts/fira-code.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --surface-2: #ece7dc;
  --ink: #1d1f23;
  --ink-2: #45474c;
  --muted: #6e6a61;
  --line: #ddd6c7;
  --accent: #e8a317;
  --accent-ink: #8a5a00;
  --ok: #3f8f3a;
  --warn: #d9822b;
  --bad: #c8324b;
  --map-land: #d9d3c5;
  --map-dim: #e7e2d6;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(29, 31, 35, 0.04), 0 8px 24px -12px rgba(29, 31, 35, 0.18);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Fira Code', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  /* rysunki wtyczek */
  --pg-body: #fdfcf8;
  --pg-body-stroke: #b9b19f;
  --pg-pin: #a07f2c;
  --pg-hole: #23252a;
  --pg-plate: #fdfcf8;
  --pg-recess: #e9e3d6;
  color-scheme: light dark;
}

/* Ciemny motyw: według systemu (gdy nie wybrano jasnego przełącznikiem) albo wybrany przełącznikiem w nagłówku. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #131416;
    --surface: #1b1d20;
    --surface-2: #24272b;
    --ink: #ece8de;
    --ink-2: #c9c4b8;
    --muted: #9c978b;
    --line: #2f3236;
    --accent: #f2b632;
    --accent-ink: #f2b632;
    --ok: #5fb257;
    --warn: #e59a4c;
    --bad: #e0566b;
    --map-land: #3a3d42;
    --map-dim: #26292d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
    --pg-body: #e9e5da;
    --pg-body-stroke: #8d8778;
    --pg-pin: #d3ad4e;
    --pg-hole: #0f1012;
    --pg-plate: #2b2e33;
    --pg-recess: #1f2125;
  }
}
:root[data-theme='dark'] {
  --bg: #131416;
  --surface: #1b1d20;
  --surface-2: #24272b;
  --ink: #ece8de;
  --ink-2: #c9c4b8;
  --muted: #9c978b;
  --line: #2f3236;
  --accent: #f2b632;
  --accent-ink: #f2b632;
  --ok: #5fb257;
  --warn: #e59a4c;
  --bad: #e0566b;
  --map-land: #3a3d42;
  --map-dim: #26292d;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  --pg-body: #e9e5da;
  --pg-body-stroke: #8d8778;
  --pg-pin: #d3ad4e;
  --pg-hole: #0f1012;
  --pg-plate: #2b2e33;
  --pg-recess: #1f2125;
  color-scheme: dark;
}
:root[data-theme='light'] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  font-feature-settings: 'ss01';
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* width i min-width – długie treści (lista krajów w <select>) nie poszerzają strony na telefonie (main z margin: auto) */
main { flex: 1; min-width: 0; width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.mono, code { font-family: var(--mono); font-feature-settings: 'zero'; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small, small { font-size: 0.85rem; color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 46rem; }
.kicker {
  font: 500 0.75rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.hint { color: var(--muted); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- nagłówek ------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}
/* „przewód” pod nagłówkiem */
.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0 18%, transparent 18% 20%, var(--accent) 20% 21%, transparent 21%);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.bm-plate { fill: var(--ink); }
.bm-recess { fill: var(--surface-2); }
.bm-hole { fill: var(--ink); }
.bm-live { fill: var(--accent); }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-tag { font: 0.78rem var(--mono); color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.2rem; align-items: center; }
.site-nav a, .drop summary {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.site-nav a:hover, .drop summary:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.drop { position: relative; }
.drop summary { list-style: none; }
.drop summary::-webkit-details-marker { display: none; }
.drop summary::after { content: ' ▾'; font-size: 0.75em; color: var(--muted); }
.drop-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 14rem;
  max-height: 70vh;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: block !important;
}
.drop-list a { display: block; padding: 0.4rem 0.6rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.drop-list a:hover, .drop-list a[aria-current] { background: var(--surface-2); }
.lang-menu summary { font-family: var(--mono); font-weight: 600; border: 1px solid var(--line); }
.more-lang { font: 0.7rem var(--mono); color: var(--muted); }
.drop-home { border-top: 1px solid var(--line); margin-top: 0.3rem; padding-top: 0.3rem; }
.drop-home a { color: var(--accent-ink); }
/* Przełącznik motywu: słońce / auto / księżyc – moduł theme (assets/theme/theme.css), wygląd zmiennymi --theme-switch-* */
.site-header {
  --theme-switch-size: 33px; --theme-switch-icon: 17px; --theme-switch-gap-left: 0; --theme-switch-gap-left-compact: 0;
  --theme-switch-bg: transparent; --theme-switch-border: var(--line); --theme-switch-active: var(--surface-2);
  --theme-switch-bg-compact: transparent; --theme-switch-compact-icon: 18px;
}
/* Zaokrąglenia jak pozostałe elementy nagłówka (menu, wybór języka, przycisk menu: 8 px) – nie pigułka z modułu */
.site-header .theme-switch { border-radius: 10px; }
.site-header .theme-switch button { border-radius: 8px; }
/* Nagłówek w jednej linii (wysokość --header-h – od niej liczy się wysokość mapy na stronie głównej): pozycje menu się
   nie łamią, poniżej 1200 px bez dopisku obok nazwy, poniżej 1100 px ciaśniejsze menu (tak mieści się w obu językach) */
#nav-list > li > a, .drop summary { white-space: nowrap; }
@media (max-width: 1199px) { .brand-tag { display: none; } }
@media (max-width: 1100px) {
  .site-header { gap: 0.6rem; }
  #nav-list { gap: 0.1rem; }
  #nav-list > li > a, .drop summary { padding-inline: 0.5rem; }
}
@media (max-width: 480px) {
  .site-header .theme-switch { border-radius: 8px; }
  .site-header .theme-switch button[aria-pressed='true'] { width: 36px; height: 36px; }
}

/* --- stopka --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 3rem;
}
.site-footer p { margin: 0.2rem 0; }
.site-footer a { color: var(--ink-2); }
.site-footer .copyright { margin-top: 0.5rem; }
/* 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; }

/* --- wspólne elementy ------------------------------------------------------ */

.page { max-width: 1120px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--accent); color: #1d1f23; }
button.link { background: none; border: 0; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.more { font-weight: 700; }
.notice {
  border-left: 3px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  padding: 0.6rem 0.9rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
}
.badge {
  display: inline-grid; place-items: center;
  width: 1.2em; height: 1.2em;
  border-radius: 50%;
  background: var(--warn); color: #fff;
  font: 700 0.75rem/1 var(--mono);
  vertical-align: 0.15em;
}
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.chips a:hover { border-color: var(--accent); }
.chips .is-primary a { border-color: var(--c, var(--accent)); font-weight: 700; }
.swatch { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; background: var(--c); vertical-align: -0.1em; margin-right: 0.35em; }
.swatch.light { background: color-mix(in srgb, var(--c) 45%, var(--map-land)); }

/* tabliczka znamionowa: napięcie, częstotliwość, typ */
.spec-plate {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.spec-plate > div { padding: 0.65rem 0.9rem; border-left: 1px solid var(--line); }
.spec-plate > div:first-child { border-left: 0; }
.spec-plate dt { font: 500 0.68rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.spec-plate dd { margin: 0.2rem 0 0; font-weight: 700; font-size: 1.05rem; }
.spec-plate dd.mono { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.spec-plate.mini dd.mono { font-size: 1.15rem; }

/* rysunki wtyczek (symbole ze sprite'a w layout.php) */
.pg { display: block; width: 72px; height: 72px; }
.pg-body { fill: var(--pg-body); stroke: var(--pg-body-stroke); stroke-width: 0.8; }
.pg-pin { fill: var(--pg-pin); }
.pg-hole { fill: var(--pg-hole); }
.pg-metal { fill: var(--pg-pin); opacity: 0.85; }
.pg-plate { fill: var(--pg-plate); stroke: var(--pg-body-stroke); stroke-width: 0.8; }
.pg-recess { fill: var(--pg-recess); }

/* --- mapy ----------------------------------------------------------------- */

.map.wm, .map.rm { --wm-ocean: transparent; --wm-sphere-stroke: transparent; --wm-land: var(--map-land); --wm-land-hover: color-mix(in srgb, var(--ink) 25%, var(--map-land));
  --wm-land-inactive: var(--map-land); --wm-border: var(--bg); --wm-selected: var(--accent); --wm-selected-outline: var(--ink); --wm-hover-outline: var(--ink);
  --wm-control-bg: var(--surface); --wm-control-fg: var(--ink); --wm-control-border: var(--line); --wm-font: var(--font);
  --rm-land: var(--map-land); --rm-border: var(--bg); --rm-outline: var(--ink-2); }
.map.world { width: 100%; }
.map.region { width: 100%; max-width: 640px; }
/* Mapa z przyciskiem „PNG” w lewym dolnym rogu – menu formatów otwiera się w górę (moduł export, assets/export/) */
.map-frame { position: relative; }
.map-frame.small { max-width: 900px; }
.map-frame.region { width: 100%; max-width: 640px; }
.map-frame > .map-export-wrap { position: absolute; z-index: 5; left: 10px; bottom: 10px; }
.export-btn, .export-menu { --export-line: var(--line); --export-radius: 10px; }

/* --- strona główna ---------------------------------------------------------- */

/* Pierwszy ekran: mapa na wysokość okna minus nagłówek (wysokości tylko w CSS – bez skoku układu), legenda pod mapą,
   panel po prawej przewijany w środku; dalsza część strony (.below, #more) pod mapą. */
:root { --header-h: 62px; }
.site-header { min-height: var(--header-h); }
.home { max-width: 1320px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); }
.page-home .home { max-width: none; padding: 0; }
.page-home .site-footer { margin-top: 2rem; }
.map-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 27vw, 390px);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: 'map side' 'key side';
  gap: 0.6rem 1.1rem;
  padding: 0.9rem clamp(1rem, 1.6vw, 1.6rem) 0.8rem;
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  min-height: 600px;
}
.map-area { grid-area: map; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.map-area .map-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.map-area .map.world { flex: 1; min-height: 0; }
/* Przełącznik warstw na mapie, w lewym górnym rogu (przybliżanie – w prawym) */
.map-area > .modes { position: absolute; z-index: 5; top: 10px; left: 10px; box-shadow: var(--shadow); }
/* Dyskretna wskazówka, że pod mapą jest dalsza część strony */
.more-hint {
  position: absolute; z-index: 4; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink-2);
  font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.04em; text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12); backdrop-filter: blur(4px);
}
.more-hint:hover { color: var(--accent-ink); border-color: var(--accent); }
.map-key { grid-area: key; min-width: 0; }
.map-key .legend { margin: 0 0 0.3rem; gap: 0.3rem; }
.map-key .legend button { font-size: 0.78rem; padding: 0.2rem 0.6rem 0.2rem 0.45rem; }
.key-notes { margin: 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.key-notes .legend-note[hidden] { display: none; }
.key-notes .legend-note:not([hidden])::after { content: ' · '; }
.below { max-width: 1320px; margin: 0 auto; padding: 1.6rem clamp(1rem, 3vw, 2rem) 0; scroll-margin-top: 0.5rem; }

/* Panel: tytuł, wyszukiwarka, „Jadę z… do…” i karta kraju – przewija się w środku */
.side {
  grid-area: side; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.side-intro { padding: 1.15rem 1.2rem 1rem; }
.side-intro h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.side-intro .lead { font-size: 0.95rem; line-height: 1.55; margin-bottom: 0.9rem; }
.side .search { max-width: none; }
.side .search input { font-size: 1rem; }
.side .trip { margin: 0 1.2rem; padding: 1.1rem; border-radius: 14px; }
.side .trip-title { font-size: 1.02rem; margin-bottom: 0.7rem; }
.side .kicker { font-size: 0.7rem; letter-spacing: 0.06em; }
.side .trip select { padding: 0.5rem 0.45rem; font-size: 0.95rem; }
.side .trip-swap { width: 38px; height: 38px; }
/* W wąskim panelu: „z kraju” i „do kraju” jedno pod drugim, przycisk zamiany obok (strzałki pionowo) */
@media (min-width: 901px) {
  .side .trip-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.55rem; }
  .side .trip-row > label:first-child { grid-area: 1 / 1; }
  .side .trip-row > label:last-child { grid-area: 2 / 1; }
  .side .trip-swap { grid-area: 1 / 2 / 3 / 3; align-self: center; margin-top: 1rem; transform: rotate(90deg); }
}
.side .trip-result { margin-top: 0.8rem; font-size: 0.93rem; }
.side .country-card { padding: 1.1rem 1.2rem 1.2rem; scroll-margin-top: 0.5rem; }
.side .country-card h2 { font-size: 1.5rem; }

.search {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 32rem;
  padding: 0.2rem 0.8rem;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: none; font: inherit; font-size: 1.05rem; padding: 0.55rem 0; color: var(--ink); min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }

.trip {
  background: var(--ink);
  color: var(--bg);
  border-radius: 18px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.trip::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.trip-title { font-size: 1.1rem; margin-bottom: 0.9rem; color: var(--bg); }
.trip-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: end; }
.trip label span { display: block; font: 500 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 0.25rem; }
.trip select, .inline-select select {
  width: 100%;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
}
.trip-swap { background: var(--accent); color: #1d1f23; border: 0; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; display: grid; place-items: center; }
.trip-swap svg { width: 20px; height: 20px; }
.trip-result { margin-top: 1rem; }
.trip .hint { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.trip .more { color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme='light'])) .trip { background: var(--surface-2); color: var(--ink); }
  :where(:root:not([data-theme='light'])) .trip-title { color: var(--ink); }
  :where(:root:not([data-theme='light'])) .trip select { background: var(--bg); }
  :where(:root:not([data-theme='light'])) .trip .hint { color: var(--muted); }
}
:where(:root[data-theme='dark']) .trip { background: var(--surface-2); color: var(--ink); }
:where(:root[data-theme='dark']) .trip-title { color: var(--ink); }
:where(:root[data-theme='dark']) .trip select { background: var(--bg); }
:where(:root[data-theme='dark']) .trip .hint { color: var(--muted); }
.mini-verdict { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.5rem; }
.mini-verdict li { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; }
.mini-verdict p { margin: 0.1rem 0 0; font-size: 0.9rem; opacity: 0.85; }
.verdict-icon {
  display: grid; place-items: center;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  font: 700 0.95rem/1 var(--mono);
  color: #fff;
  background: var(--ok);
}
.is-warn .verdict-icon { background: var(--warn); }
.is-bad .verdict-icon { background: var(--bad); }

.modes { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.modes button {
  border: 0; background: none; color: var(--ink-2);
  font: 600 0.92rem var(--font);
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  cursor: pointer;
}
.modes button[aria-checked='true'] { background: var(--ink); color: var(--bg); }
.country-card h2 { font-size: 1.6rem; }
.country-card .spec-plate { margin: 0.6rem 0 0.9rem; }
.mini-plugs { display: grid; gap: 0.4rem; margin-bottom: 0.8rem; }
.mini-plug { display: grid; grid-template-columns: 44px auto 1fr; gap: 0.5rem; align-items: center; color: var(--ink); text-decoration: none; padding: 0.25rem; border-radius: 10px; }
.mini-plug:hover { background: var(--surface-2); }
.mini-plug .pg { width: 44px; height: 44px; }
.mini-plug b { font: 700 1.1rem var(--mono); color: var(--c); }
.mini-plug span { font-size: 0.86rem; color: var(--ink-2); line-height: 1.3; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin: 0; }

.legend { list-style: none; padding: 0; margin: 0.9rem 0 0.3rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.legend button {
  display: inline-flex; align-items: center; gap: 0.2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 0.3rem 0.7rem 0.3rem 0.5rem;
  font: 500 0.85rem var(--font);
  cursor: pointer;
}
.legend button b { font-family: var(--mono); color: var(--ink); }
.legend button small { font-family: var(--mono); margin-left: 0.3rem; }
.legend button.is-focus, .legend button[aria-pressed='true'] { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); color: var(--ink); }
.legend.static { margin-top: 0.6rem; }
.legend.static li { font-size: 0.88rem; color: var(--ink-2); margin-right: 0.8rem; }
.legend-note { font-size: 0.82rem; color: var(--muted); }

.plug-strip h2 { margin-bottom: 1rem; }
.plug-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.plug-grid a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0.4rem 0.6rem; align-items: center;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  border-top: 3px solid var(--c);
}
.plug-grid a:hover { box-shadow: var(--shadow); }
.plug-grid .pg { width: 48px; height: 48px; }
.plug-grid .letter { font: 700 1.3rem/1 var(--mono); }
/* Nazwa pod rysunkiem i literą, na całą szerokość kafelka – długie polskie nazwy („południowoafrykańska”) mieszczą się
   bez ucinania; w najwęższych kafelkach (8 w rzędzie przy ok. 1280 px) pismo odrobinę mniejsze (cqi – szerokość kafelka),
   a wyraz dłuższy niż kafelek przenosi się z dywizem albo łamie, zamiast wychodzić poza ramkę */
.plug-grid a { container-type: inline-size; }
.plug-grid .nick { grid-column: 1 / -1; align-self: start; font-size: 0.78rem; font-size: min(0.78rem, 9.4cqi); color: var(--muted); line-height: 1.25; }
.plug-grid .nick, .plug-card .nick, .mini-plug span { overflow-wrap: break-word; hyphens: auto; }

/* --- strona kraju ----------------------------------------------------------- */

.spec-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: end; margin-bottom: 1.5rem; }
.spec-head .spec-plate { min-width: 22rem; }
.plug-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.plug-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  position: relative;
}
.plug-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); background: var(--c); }
.plug-card.is-primary { border-color: var(--c); }
.plug-card h2 { font-size: 1.15rem; margin: 0.6rem 0 0.1rem; }
.plug-card h2 a { color: var(--ink); text-decoration: none; }
.plug-card h2 a:hover { text-decoration: underline; }
.plug-card .nick { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.5rem; }
.plug-card .meta { font-size: 0.8rem; color: var(--muted); margin: 0; }
.pair-icons { display: flex; gap: 0.5rem; }
.pair-icons .pg { width: 78px; height: 78px; }
.note-block { background: var(--surface-2); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 2rem; }
.note-block h2 { font-size: 1.05rem; }
.note-block p { margin: 0; }
.travel-map, .regions, .checker, .routes, .faq, .same, .users, .compat, .fit-table, .prose, .verdict { margin-bottom: 2.4rem; }
.regions-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; }
.regions .legend.static { flex-direction: column; }
.checker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.inline-select { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.inline-select span { font-weight: 600; }
.inline-select select { width: auto; min-width: 14rem; max-width: 100%; border-color: var(--line); }
.checker .trip-result { margin-bottom: 1.2rem; }
.checker h3 { margin-top: 1rem; }
.map.small { max-width: 900px; }
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.routes h2 { font-size: 1.05rem; }
.faq details { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 0.5rem 0 0; color: var(--ink-2); max-width: 52rem; }

/* --- strona wtyczki ----------------------------------------------------------- */

.plug-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; margin-bottom: 2rem; }
.plug-figure { display: flex; gap: 0.8rem; }
.plug-figure figure { margin: 0; text-align: center; }
.plug-figure figcaption { font: 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pg.big { width: 170px; height: 170px; }
.letter-badge {
  display: inline-grid; place-items: center;
  width: 1.25em; height: 1.25em;
  border-radius: 0.25em;
  background: var(--c);
  color: #fff;
  font: 700 1em/1 var(--mono);
  vertical-align: -0.12em;
}
.plug-head .spec-plate { margin-top: 1rem; }
.prose { max-width: 50rem; }
.prose-page { max-width: 820px; }
.prose-page h2 { margin-top: 2rem; }
.prose-page li { margin-bottom: 0.4rem; }
.compat { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.type-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.type-list a { display: grid; justify-items: center; gap: 0.2rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.85rem; border-bottom: 3px solid var(--c); text-align: center; }
.type-list .pg { width: 56px; height: 56px; }
.users .chips { margin-top: 1rem; }
.type-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.type-nav a { font: 700 1rem/1 var(--mono); padding: 0.5rem 0.6rem; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: var(--surface); }
.type-nav a[aria-current], .type-nav a:hover { background: var(--c); border-color: var(--c); color: #fff; }

/* --- strona pary „z → do” --------------------------------------------------- */

.travel-head h1 a { color: var(--ink); text-decoration: none; }
.travel-head h1 a:hover { text-decoration: underline; }
.travel-head .arrow { color: var(--accent); font-family: var(--mono); }
.swap-link { font-weight: 600; }
.verdict { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.verdict-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 1.1rem; }
.verdict-card.is-warn { border-top-color: var(--warn); }
.verdict-card.is-bad { border-top-color: var(--bad); }
.verdict-card h2 { font-size: 1.1rem; margin: 0.6rem 0 0.4rem; }
.verdict-card p { margin: 0; color: var(--ink-2); }
.fit-table table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.fit-table th, .fit-table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.fit-table th { font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.type-cell { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.type-cell .pg, .sockets .pg { width: 48px; height: 48px; }
.sockets { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sockets a { display: grid; justify-items: center; color: var(--muted); text-decoration: none; font-size: 0.75rem; }
.fit-yes strong { color: var(--ok); }
.fit-partial strong { color: var(--warn); }
.fit-no strong { color: var(--bad); }
.spec-plate.compare { max-width: 36rem; margin-bottom: 1rem; }

/* --- lista krajów ------------------------------------------------------------ */

.filters { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 1rem; }
.filters .search { flex: 1 1 16rem; }
.type-filter { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.type-filter button {
  font: 600 0.85rem var(--mono);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.type-filter button[aria-pressed='true'] { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: #fff; }
.country-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.country-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0.6rem 0.8rem; }
.country-table td { padding: 0.45rem 0.8rem; border-top: 1px solid var(--line); }
.country-table td a { color: var(--ink); font-weight: 600; text-decoration: none; }
.country-table td a:hover { text-decoration: underline; }
.tchip { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; margin-right: 0.2rem; border-radius: 6px; font: 600 0.85rem/1 var(--mono); color: var(--ink) !important; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.tchip.is-primary { background: var(--c); color: #fff !important; }
.empty { color: var(--muted); padding: 1rem 0; }

/* --- kontakt ------------------------------------------------------------------ */

.contact-form { max-width: 640px; margin: 1.4rem 0 1.2rem; }
.contact-form .field { margin-bottom: 1rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.contact-form input[type='text'], .contact-form input[type='email'], .contact-form textarea {
  width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.contact-form [aria-invalid='true'] { border-color: var(--bad); }
.contact-form .field-check label { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; font-weight: 400; font-size: 0.93rem; color: var(--ink-2); }
.contact-form .field-check input { width: 18px; height: 18px; margin: 0.15rem 0 0; accent-color: var(--accent); }
button.button { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.req { color: var(--bad); }
.field-error { color: var(--bad); font-size: 0.88rem; margin: 0.3rem 0 0; }
.form-alert, .form-success { border-left: 3px solid var(--bad); background: var(--surface); padding: 0.75rem 1rem; border-radius: 0 10px 10px 0; max-width: 640px; box-shadow: var(--shadow); }
.form-success { border-left-color: var(--ok); font-size: 1.08rem; }
.form-clause { max-width: 640px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- afiliacja, błąd --------------------------------------------------------- */

.affiliate { border: 1px dashed var(--accent); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 2.4rem; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.affiliate h2 { font-size: 1.05rem; }
.affiliate ul { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.6rem; }
.affiliate .offer a { font-weight: 700; }
.affiliate .offer p { margin: 0.1rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.affiliate .price { font-size: 0.85rem; }
.disclosure { font-size: 0.78rem; color: var(--muted); margin: 0; }
.error-page { text-align: center; padding-top: 4rem; }
.error-mark { width: 120px; height: 120px; margin: 0 auto 1rem; display: block; opacity: 0.8; }
.error-page .lead { margin-inline: auto; }

/* --- telefon ---------------------------------------------------------------- */

/* Legenda w wierszach, gdy mapa i tak się mieści: zawinięta legenda (po polsku do 7–8 wierszy przy 900–1280 px) zostawia
   mapie tyle wysokości, że przełącznik warstw u góry i PNG / „Więcej” u dołu nie zasłaniają lądów – od ok. 780 px wysokości
   okna w obu językach (przy każdej szerokości powyżej 900 px). W niższym oknie i na telefonie legenda to jeden pasek
   przewijany w bok (jak filtry nad mapą w castlesmap) – na telefonie wiersze odsunęłyby tytuł i panel od mapy. */
@media (max-width: 900px), (max-height: 789px) {
  .map-key .legend {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .map-key .legend li { flex: none; }
  .map-key .legend button { white-space: nowrap; }
}
/* Strona główna na telefonie i wąskim oknie: przełącznik warstw, mapa, legenda, panel – jedno pod drugim, bez przewijania w panelu */
@media (max-width: 900px) {
  .map-stage {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'map' 'key' 'side';
    height: auto; min-height: 0; padding: 0.7rem clamp(0.75rem, 3vw, 1rem) 0.4rem; gap: 0.7rem;
  }
  .map-area > .modes { position: static; align-self: flex-start; max-width: 100%; margin-bottom: 0.6rem; box-shadow: none; }
  .map-area .map-frame { flex: none; }
  .map-area .map.world { flex: none; height: max(260px, 62vw); max-height: 70vh; }
  .side { overflow: visible; }
  .side-intro h1 { font-size: 1.75rem; }
  .side .trip { margin: 0 1rem; }
  .side-intro, .side .country-card { padding-inline: 1rem; }
  .more-hint { display: none; }
}
@media (max-width: 420px) {
  .modes button { padding: 0.4rem 0.65rem; font-size: 0.86rem; }
}
@media print { .more-hint { display: none; } }
@media (max-width: 960px) {
  .spec-head, .plug-head, .regions-body { grid-template-columns: minmax(0, 1fr); }
  .spec-head .spec-plate { min-width: 0; }
}
/* Menu pod przyciskiem: pełne menu w jednej linii potrzebuje ok. 800 px (po polsku) */
@media (max-width: 840px) {
  .nav-toggle { display: block; order: 3; }
  .site-nav { order: 3; }
  .site-nav ul { display: none; }
  .site-nav.is-open ul {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.5rem;
  }
  .site-nav.is-open .drop-list { position: static; box-shadow: none; }
}
@media (max-width: 760px) {
  .trip-row { grid-template-columns: minmax(0, 1fr); }
  .trip-swap { justify-self: center; transform: rotate(90deg); }
  .spec-plate { grid-auto-flow: row; }
  .spec-plate > div { border-left: 0; border-top: 1px solid var(--line); }
  .spec-plate > div:first-child { border-top: 0; }
  .pg.big { width: 120px; height: 120px; }
  .country-table th:nth-child(4), .country-table td:nth-child(4) { display: none; }
  .fit-table .pg { width: 38px; height: 38px; }
}
/* Na wąskim ekranie przełącznik motywu to jeden przycisk z bieżącym trybem (moduł theme) */
@media (max-width: 480px) {
  .site-header { gap: 0.6rem; }
  .country-table th, .country-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
}

.plug-head .spec-plate dd.mono { font-size: 1.2rem; }
.plug-head .spec-plate { grid-auto-columns: auto; }

/* Przycisk „Osadź” (moduł embed-php) obok PNG na mapie */
.map-export-wrap .oe-embed { margin-left: 6px; vertical-align: bottom; }
.oe-embed-box { color: var(--ink); background: var(--bg); }
.export-up .oe-embed-box { top: auto; bottom: calc(100% + 6px); }

/* ---------- Quiz (/quiz – moduł quiz z assets) ---------- */
.quiz-stage { margin: 1.2rem 0 2rem; }
.quiz-stage .quiz { --quiz-accent: var(--accent); --quiz-accent-ink: var(--accent-ink); --quiz-ok: var(--ok); --quiz-bad: var(--bad); --quiz-radius: var(--radius); }
.quiz-map {
  --wm-ocean: transparent; --wm-sphere-stroke: transparent; --wm-land: var(--map-land); --wm-land-hover: color-mix(in srgb, var(--ink) 25%, var(--map-land));
  --wm-dot: var(--map-land); --wm-border: var(--bg); --wm-border-width: .6px; --wm-font: var(--font);
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.quiz-about { max-width: 46rem; color: var(--ink-2); }
