:root {
  --ink: #12202f;
  --muted: #5a6878;
  --bg: #ffffff;
  --band: #f3f6f9;
  --navy: #0f2a44;
  --accent: #f08a24;
  --flood: #2f7fd1;
  --hurricane: #8b5cf6;
  --quake: #d6455d;
  --ref: #c2187a;
  --land: #dfe6ee;
  --line: #d5dde6;
  --r: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--navy); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.small { font-size: .875rem; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; color: var(--navy); text-decoration: none; }
.logo-dot { width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--accent); }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); font-size: .95rem; }
.nav a:hover { color: var(--accent); }
.lang select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.hero { background: linear-gradient(160deg, var(--navy), #1c4670); color: #fff; padding: 56px 0 48px; }
.hero .lead { max-width: 760px; font-size: 1.15rem; color: #dce7f2; }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(240,138,36,.16); color: #8a4200; border: 1px solid rgba(240,138,36,.45); }
.hero .badge { color: #ffd2a6; }

.map-sec { padding: 36px 0 48px; }
.world { aspect-ratio: 1000 / 437.4; }
.doc main { padding-top: 40px; padding-bottom: 60px; }
.doc .langs a[aria-current=page] { font-weight: 700; text-decoration: none; }
.doc main p { max-width: 760px; }
.doc .langs a { margin-right: 10px; }
.world svg { width: 100%; height: auto; display: block; }
.world svg path { fill: var(--land); stroke: #fff; stroke-width: .4; }
.world .ev { cursor: pointer; }
.world .ev circle.dot { stroke: #fff; stroke-width: 2; }
.world .ev circle.halo { fill: none; stroke-width: 1.5; opacity: .5; }
.world .ev:hover circle.dot, .world .ev:focus circle.dot { stroke: var(--ink); }
.world .ev:focus { outline: none; }
.world .ev:focus-visible circle.halo { stroke: var(--ink); stroke-width: 3; opacity: 1; }
.powodz { fill: var(--flood); background: var(--flood); stroke: var(--flood); }
.huragan { fill: var(--hurricane); background: var(--hurricane); stroke: var(--hurricane); }
.trzesienie { fill: var(--quake); background: var(--quake); stroke: var(--quake); }
.hint { color: var(--muted); }
.legend-types { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 14px; font-size: .9rem; }
.legend-types li { display: flex; align-items: center; gap: 6px; }
.mk { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.map-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; margin-bottom: 8px; }
.map-top .hint { margin: 0; }
.map-top .legend-types { margin: 0; }
.world { max-width: 1000px; margin: 0 auto; }
.events { position: relative; margin-top: 18px; }
.ev-list { list-style: none; padding: 4px 2px 12px; margin: 0; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: thin; min-height: 112px; }
.ev-list > li { flex: 0 0 auto; width: 236px; scroll-snap-align: start; }
.ev-list .ev-top { display: flex; align-items: center; gap: 8px; }
.ev-list img.flag { width: 28px; height: 21px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.ev-list .mk { margin: 0; }
.ev-list li > span { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; height: 100%; }
.strip-btn { position: absolute; top: 40%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.strip-btn.prev { left: -12px; }
.strip-btn.next { right: -12px; }
.strip-btn[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .strip-btn { display: none; } }
.sat-sec { background: #0b1c2e; color: #e3edf6; }
.sat-sec h2 { color: #fff; }
.sat-sec .small { color: #a9bccd; }
.sat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "intro glob" "panel glob"; grid-template-rows: auto 1fr; column-gap: 48px; align-items: start; }
.sat-intro { grid-area: intro; max-width: 560px; }
.sat-intro p { margin-bottom: 0; }
.sat-panel { grid-area: panel; max-width: 560px; }
.sat-grid .globe { grid-area: glob; align-self: center; }
.globe { aspect-ratio: 1 / 1; max-width: 540px; width: 100%; margin: 0 auto; }
.globe canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.globe canvas:active { cursor: grabbing; }
.sat-legend { list-style: none; padding: 14px 0 0; margin: 18px 0 0; border-top: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 28px; row-gap: 8px; font-size: .88rem; color: #c9d7e4; }
.sat-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0 8px; }
.sat-ctrl .sat-speed { margin: 0; }
.sat-zegar { font-size: .85rem; color: #a9bccd; }
.sat-uwaga { font-size: .8rem; line-height: 1.5; margin: 0; }
.sat-legend li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; line-height: 1.45; }
.sat-legend .dot { margin-top: 4px; }
.sat-legend .orbit-sw { margin-top: 9px; }
.sat-legend .band-sw { margin-top: 4px; }
.sat-legend li > span:first-child { flex: none; }
.sat-legend .dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.85); }
.sat-legend .dot.s1 { background: #3fb4d6; }
.sat-legend .dot.s2 { background: #f2a541; }
.sat-legend .orbit-sw { width: 18px; height: 0; border-top: 1.5px solid rgba(227,237,246,.6); }
.sat-legend .band-sw { width: 18px; height: 10px; border-radius: 2px; background: rgba(242,165,65,.35); }
.sat-sec .sat-speed button { background: transparent; color: #e3edf6; border-color: rgba(255,255,255,.35); }
.sat-sec .sat-speed button[aria-pressed=true] { background: #e3edf6; color: #0b1c2e; border-color: #e3edf6; }
.mono { font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 860px) { .sat-grid { grid-template-columns: 1fr; grid-template-areas: "intro" "glob" "panel"; grid-template-rows: auto; row-gap: 20px; } .sat-intro, .sat-panel { max-width: none; } .sat-grid .globe { max-width: 420px; } .sat-legend { margin-top: 0; } }
@media (max-width: 520px) { .sat-legend { grid-template-columns: 1fr; } }
.ev-list button { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.ev-list button:hover, .ev-list button:focus-visible { background: var(--band); outline: 2px solid transparent; }
.ev-list button:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ev-list .mk { margin-top: 6px; flex: none; }
.ev-list small { display: block; color: var(--muted); }

.band { background: var(--band); }
section { padding: 52px 0; }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { counter-increment: s; background: #fff; border-radius: var(--r); padding: 22px; border: 1px solid var(--line); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 700; margin-bottom: 10px; }
.note { color: var(--muted); max-width: 760px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cards3 > div { border-top: 3px solid var(--accent); padding-top: 14px; }

form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
form input, form textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
form input:focus, form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
button[type=submit] { font: inherit; font-weight: 600; background: var(--navy); color: #fff; border: 0; border-radius: 8px; padding: 11px 26px; cursor: pointer; }
button[type=submit][disabled] { opacity: .6; cursor: default; }
.ts { min-height: 66px; margin-bottom: 8px; }
.status { margin-top: 12px; font-weight: 600; }
.status.err { color: #b3261e; }

.foot { padding: 32px 0; border-top: 1px solid var(--line); }

dialog { border: 0; padding: 0; border-radius: 14px; width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,20,30,.55); }
.card { padding: 24px 26px 20px; }
.card-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.card-kind { margin: 0 0 4px; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.card-kind.powodz { color: #1f5f9e; background: none; }
.card-kind.huragan { color: #6a3fd1; background: none; }
.card-kind.trzesienie { color: #a8283d; background: none; }
.card-meta { color: var(--muted); margin: 0; }
.x { font: inherit; font-size: 1.6rem; line-height: 1; background: none; border: 0; cursor: pointer; padding: 4px 8px; color: var(--muted); }
.views { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.views button { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.views button[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.pair figure { margin: 0; }
.pair img { width: 100%; height: auto; max-height: 320px; object-fit: contain; display: block; border-radius: 6px; background: var(--band); }
.pair figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.views.bg { align-items: center; margin: 0 0 8px; }
.views.bg .small { margin-right: 4px; }
.summary { font-size: .92rem; font-weight: 600; margin: 8px 0 2px; }
.nopair { margin: 4px 0 14px; }
.cellmap { position: relative; }
.cellmap canvas { width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 6px; background: #eef2f6; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .85rem; margin: 10px 0 4px; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.sw.b { background: rgba(70,85,100,.35); }
.sw.q { background: var(--accent); }
.sw.r { background: transparent; border: 2px solid var(--ref); }
.legend label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sources { padding-left: 18px; }
.privacy p { font-size: .95rem; }
.pr-link { color: inherit; }

@media (max-width: 860px) {
  .steps, .cards3 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .lang { margin-left: auto; }
  .pair { grid-template-columns: 1fr 1fr; }
  .card { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* pasek zdarzeń: karta w kolumnie (po regule bazowej przycisku listy) */
.events .ev-list button { flex-direction: column; align-items: stretch; gap: 6px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.events .ev-list button:hover, .events .ev-list button:focus-visible { background: var(--band); }
.events .ev-list small { display: block; color: var(--muted); }
.events .ev-list strong { line-height: 1.25; }

/* modele 3D satelitów */
.m3d-h { margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); color: #fff; font-size: .95rem; }
.m3d-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m3d-list button { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 6px 10px 6px 6px; background: rgba(255,255,255,.04); display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
.m3d-list button:hover, .m3d-list button:focus-visible { background: rgba(255,255,255,.1); box-shadow: 0 0 0 2px #f2a541; }
.m3d-list img { flex: none; width: 72px; height: 54px; object-fit: contain; border-radius: 6px; background: #0f2438; }
.m3d-list .m3d-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m3d-list strong { color: #fff; font-size: .86rem; line-height: 1.25; }
.m3d-list span.m3d-cta { font-size: .76rem; color: #a9bccd; }
.m3d-list button:hover span.m3d-cta { color: #f2a541; }
@media (max-width: 400px) { .m3d-list { grid-template-columns: 1fr; } }
.m3d-scena { height: min(60vh, 460px); border-radius: 10px; background: radial-gradient(circle at 50% 40%, #1d3a57, #0b1c2e); margin: 8px 0 12px; }
.m3d-scena canvas { display: block; width: 100% !important; height: 100% !important; }
