/* SP4KE: tokeny. Generowane z tokens.json. */
:root, [data-theme="dark"] {
  --surface-100: #060e1c;
  --surface-200: #0d1b33;
  --surface-300: #14284a;
  --hairline: #1f355c;
  --border: #5c79ae;
  --ink: #eaf0fa;
  --ink-muted: #9fb2cc;
  --cobalt: #2f62ff;
  --on-cobalt: #ffffff;
  --cobalt-text: #82a6ff;
  --amber: #f2a93b;
  --on-amber: #1a1204;
  --amber-text: #f2a93b;
  --focus: #9db8ff;
  --ok: #4ade9e;
  --danger: #ff8a7a;
  --shadow-raised: 0 8px 24px rgba(0,0,0,0.45);
}
[data-theme="light"] {
  --surface-100: #f4f7fc;
  --surface-200: #ffffff;
  --surface-300: #e6ecf5;
  --hairline: #cbd6e6;
  --border: #7b8fb0;
  --ink: #0b1b3a;
  --ink-muted: #46597a;
  --cobalt: #2f62ff;
  --on-cobalt: #ffffff;
  --cobalt-text: #1e4bd8;
  --amber: #f2a93b;
  --on-amber: #1a1204;
  --amber-text: #8a5200;
  --focus: #1e4bd8;
  --ok: #0b6b47;
  --danger: #b3261e;
  --shadow-raised: 0 8px 24px rgba(11,27,58,0.12);
}
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 26px;
  --radius-pill: 999px;
  --morse-dot: 8px;
  --morse-dash: 24px;
  --morse-gap: 8px;
  --morse-letter-gap: 24px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
.display { font-family: var(--font-display); font-size: 64px; line-height: 60px; font-weight: 800; letter-spacing: -0.03em; }
.h1 { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 800; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-display); font-size: 28px; line-height: 32px; font-weight: 800; letter-spacing: -0.01em; }
.h3 { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 800; }
.lead { font-family: var(--font-body); font-size: 20px; line-height: 30px; font-weight: 400; }
.body { font-family: var(--font-body); font-size: 17px; line-height: 27px; font-weight: 400; }
.body-sm { font-family: var(--font-body); font-size: 15px; line-height: 22px; font-weight: 400; }
.caption { font-family: var(--font-body); font-size: 13px; line-height: 18px; font-weight: 500; }
.data { font-family: var(--font-data); font-size: 15px; line-height: 22px; font-weight: 500; }
.data-lg { font-family: var(--font-data); font-size: 24px; line-height: 30px; font-weight: 500; }
.label { font-family: var(--font-data); font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: 0.02em; }

/* SP4KE: style komponentów. Wszystkie wartości pochodzą z tokens.json. */
.sp-root { background: var(--surface-100); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 27px; padding: var(--space-6); }
.sp-root *, .sp-root *::before, .sp-root *::after { box-sizing: border-box; }
.sp-stack { display: flex; flex-direction: column; gap: var(--space-6); }
.sp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.sp-note { margin: 0; color: var(--ink-muted); font-size: 13px; line-height: 18px; font-weight: 500; }

/* Przyciski */
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: var(--space-3) var(--space-6); border: 2px solid transparent; border-radius: var(--radius-md); font-family: var(--font-body); font-size: 17px; line-height: 22px; font-weight: 500; text-decoration: none; cursor: pointer; }
.sp-btn--primary { background: var(--cobalt); color: var(--on-cobalt); }
.sp-btn--primary:hover { filter: brightness(1.12); }
.sp-btn--secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.sp-btn--secondary:hover { background: var(--surface-300); }
.sp-btn--signal { background: var(--amber); color: var(--on-amber); }
.sp-btn--signal:hover { filter: brightness(1.08); }
.sp-btn:focus-visible, .sp-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sp-btn[disabled] { background: var(--surface-300); color: var(--ink-muted); border-color: transparent; cursor: not-allowed; filter: none; }

/* Linia Morse'a: kropka = 1 jednostka, kreska = 3 */
.sp-morse { display: flex; flex-wrap: wrap; align-items: center; gap: var(--morse-letter-gap); }
.sp-morse__l { display: flex; align-items: center; gap: var(--morse-gap); }
.sp-morse i { display: block; height: var(--morse-dot); background: var(--cobalt-text); border-radius: var(--radius-pill); }
.sp-morse i.d { width: var(--morse-dot); }
.sp-morse i.l { width: var(--morse-dash); }
.sp-morse--amber i { background: var(--amber); }
.sp-morse--ink i { background: var(--ink); }
.sp-morse--muted i { background: var(--border); }

/* Lista danych */
.sp-facts { margin: 0; display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); border-top: 1px solid var(--hairline); }
.sp-facts dt, .sp-facts dd { margin: 0; padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.sp-facts dt { color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.sp-facts dd { font-family: var(--font-data); font-weight: 500; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
@media (max-width: 30rem) { .sp-facts { grid-template-columns: minmax(0, 1fr); } .sp-facts dt { border-bottom: 0; padding-bottom: 0; } }

/* Wiersz linku */
.sp-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.sp-links li { border-bottom: 1px solid var(--hairline); }
.sp-link { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: var(--space-2) var(--space-6); align-items: baseline; padding: var(--space-3) 0; color: var(--ink); text-decoration: none; }
.sp-link b { font-weight: 500; }
.sp-link span { font-family: var(--font-data); font-weight: 500; font-size: 15px; line-height: 22px; color: var(--cobalt-text); overflow-wrap: anywhere; }
.sp-link:hover span { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 30rem) { .sp-link { grid-template-columns: minmax(0, 1fr); } }
.sp-chip { display: inline-block; font-family: var(--font-data); font-weight: 500; font-size: 15px; line-height: 22px; background: var(--surface-300); color: var(--ink); padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); overflow-wrap: anywhere; }

/* Znacznik stanu: kolor zawsze ze słowem */
.sp-status { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 500; font-size: 15px; line-height: 22px; }
.sp-status::before { content: ""; width: var(--morse-dot); height: var(--morse-dot); border-radius: var(--radius-pill); background: currentColor; }
.sp-status--ok { color: var(--ok); }
.sp-status--warn { color: var(--amber-text); }
.sp-status--danger { color: var(--danger); }

/* Tył karty QSL, 140 x 90 mm */
.sp-qsl { width: 100%; max-width: 560px; aspect-ratio: 14 / 9; display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-3); padding: var(--space-6); background: var(--surface-200); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sp-qsl__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.sp-qsl__call { font-family: var(--font-data); font-weight: 500; font-size: 24px; line-height: 30px; }
.sp-qsl__loc { font-family: var(--font-data); font-weight: 500; font-size: 13px; line-height: 16px; color: var(--ink-muted); text-align: right; }
.sp-qsl__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); align-self: stretch; }
.sp-qsl__cell { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-1); padding: var(--space-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 0; }
.sp-qsl__cell small { font-family: var(--font-data); font-weight: 500; font-size: 11px; line-height: 14px; color: var(--ink-muted); }
.sp-qsl__cell span { font-family: var(--font-data); font-weight: 500; font-size: 15px; line-height: 20px; }
.sp-qsl__cell--w3 { grid-column: span 3; }
.sp-qsl__cell--w4 { grid-column: span 4; }
.sp-qsl__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
@media (max-width: 30rem) { .sp-qsl { aspect-ratio: auto; } .sp-qsl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-qsl__cell--w3, .sp-qsl__cell--w4 { grid-column: span 2; } }

/* Osadzony widget zewnętrzny (iframe) */
.sp-embed { width: 100%; max-width: 640px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-200); }
.sp-embed iframe { display: block; width: 100%; height: 500px; border: 0; }

/* Układ strony */
.sp-page { max-width: 62rem; margin: 0 auto; }
.sp-meta { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding-block: var(--space-6) 0; color: var(--ink-muted); font-family: var(--font-data); font-weight: 500; font-size: 15px; line-height: 22px; }
.sp-meta span { white-space: nowrap; }
.sp-flag { display: inline-block; vertical-align: -2px; margin-right: var(--space-2); border-radius: 2px; }
.sp-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4) var(--space-8); padding-block: var(--space-4) var(--space-4); }
.sp-home { display: inline-flex; line-height: 0; border-radius: var(--radius-xl); }
.sp-home svg { width: 44px; height: 44px; display: block; }
.sp-nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); }
.sp-nav a { color: var(--ink-muted); text-decoration: none; font-weight: 500; padding: var(--space-2) 0; border-bottom: 2px solid transparent; }
.sp-nav a:hover { color: var(--ink); }
.sp-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cobalt-text); }
.sp-nav a:focus-visible, .sp-home:focus-visible, .sp-tile:focus-visible, .sp-card a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sp-hero { padding-block: var(--space-8) var(--space-12); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); }
.sp-hero h1 { margin: 0; line-height: 0; color: var(--ink); }
.sp-hero .sp-logo { display: block; width: 34rem; max-width: 100%; height: auto; }
.sp-hero p { max-width: 36rem; margin: 0; text-wrap: pretty; font-size: 20px; line-height: 30px; }
.sp-pagehead { padding-block: var(--space-8) var(--space-12); display: flex; flex-direction: column; gap: var(--space-3); }
.sp-pagehead h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 44px; letter-spacing: -0.02em; text-wrap: balance; }
.sp-pagehead p { max-width: 36rem; margin: 0; font-size: 20px; line-height: 30px; text-wrap: pretty; }
.sp-section { padding-block: var(--space-12); border-top: 1px solid var(--hairline); display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: var(--space-6) var(--space-12); }
.sp-section h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 32px; letter-spacing: -0.01em; text-wrap: balance; }
.sp-section__body { min-width: 0; max-width: 40rem; }
.sp-section__body > p { margin: 0 0 var(--space-4); }
.sp-section--wide { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.sp-section--wide .sp-section__body { max-width: none; }
@media (max-width: 40rem) { .sp-section { grid-template-columns: minmax(0, 1fr); } }
.sp-footer { padding-block: var(--space-8) var(--space-12); border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); color: var(--ink-muted); }
.sp-footer strong { font-family: var(--font-data); color: var(--ink); font-weight: 500; }
.sp-qsl-photo { margin: 0 0 var(--space-12); }
.sp-qsl-photo img { display: block; width: 100%; max-width: 48.6rem; height: auto; aspect-ratio: 14 / 9; border-radius: var(--radius-lg); border: 1px solid var(--hairline); }
.sp-qsl-photo figcaption { margin-top: var(--space-3); color: var(--ink-muted); font-size: 13px; line-height: 18px; font-weight: 500; }

/* Kafelki linków: sam symbol i nazwa, adres ukryty pod kafelkiem */
.sp-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--space-4); }
.sp-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); min-height: 9rem; height: 100%; padding: var(--space-6) var(--space-4); background: var(--surface-200); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--ink); text-decoration: none; text-align: center; }
.sp-tile:hover { background: var(--surface-300); border-color: var(--cobalt-text); }
.sp-tile__icon { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.sp-tile__icon svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; color: var(--cobalt-text); }
.sp-tile__icon img { width: 32px; height: 32px; display: block; }
.sp-tile__icon .sp-fallback { display: none; }
.sp-tile__icon.is-fallback img { display: none; }
.sp-tile__icon.is-fallback .sp-fallback { display: block; }
.sp-tile__name { font-weight: 500; font-size: 17px; line-height: 24px; text-wrap: balance; }

/* Karty sprzętu i zdjęcia */
.sp-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--space-6); }
.sp-card { display: flex; flex-direction: column; min-width: 0; background: var(--surface-200); border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.sp-photo { margin: 0; aspect-ratio: 4 / 3; background: var(--surface-300); display: grid; place-items: center; }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-photo .sp-photo__empty { display: none; width: 96px; height: 96px; }
.sp-photo.is-empty img { display: none; }
.sp-photo.is-empty .sp-photo__empty { display: block; }
.sp-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.sp-card__name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 26px; }
.sp-card__meta { margin: 0; font-family: var(--font-data); font-weight: 500; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sp-card__text { margin: 0; font-size: 15px; line-height: 22px; }

/* Treści dodawane później: tekst, zdjęcie, galeria */
.sp-prose { max-width: 40rem; }
.sp-prose > * { margin: 0; }
.sp-prose > * + * { margin-top: var(--space-4); }
.sp-prose h3 { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 26px; margin-top: var(--space-8); }
.sp-prose a { color: var(--cobalt-text); }
.sp-prose ul, .sp-prose ol { padding-left: var(--space-6); }
.sp-figure { margin: 0; }
.sp-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.sp-figure figcaption, .sp-gallery figcaption { margin-top: var(--space-2); color: var(--ink-muted); font-size: 13px; line-height: 18px; font-weight: 500; }
.sp-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--space-4); }
.sp-gallery figure { margin: 0; }
.sp-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }


:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-100); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 27px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0; }
a { color: var(--cobalt-text); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
