:root {
  --navy: #092d4a;
  --navy-2: #061f34;
  --turquoise: #17b7bd;
  --turquoise-dark: #07888d;
  --sky: #eaf8fa;
  --paper: #ffffff;
  --ink: #183142;
  --muted: #667a87;
  --line: #d5e5e9;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 12px 32px rgba(4, 38, 61, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  background: linear-gradient(180deg, #dff5f7 0, #f7fbfc 320px, #edf4f6 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--turquoise-dark); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: .6rem .9rem; transform: translateY(-150%);
  background: #fff; border-radius: .5rem;
}
.skip-link:focus { transform: none; }

.site-header {
  color: #fff;
  background-color: #06243b;
  background-image:
    linear-gradient(90deg, #031a2dde 0%, #04243a8f 42%, #031a2d7a 68%, #031a2dbd 100%),
    url("/assets/img/header-background-v2.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-bottom: 5px solid var(--turquoise);
}
.header-inner, .shell, .footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}
.header-inner {
  min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; min-width: 280px; min-height: 74px; flex: 1 1 auto; align-items: center; color: #fff; text-decoration: none; }
.brand-title { color: #fff; font-size: clamp(1.55rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; text-shadow: 0 2px 10px #00101c, 0 1px 2px #00101c; white-space: nowrap; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { padding: .65rem .85rem; color: #fff; background: #062d46e6; border: 1px solid #75d9d5; border-radius: .6rem; box-shadow: 0 3px 10px #00192766; text-decoration: none; text-shadow: 0 1px 2px #001927; font-weight: 700; }
.nav a:hover, .nav a:focus-visible { background: #0b4960; outline: 2px solid #a1fffa; outline-offset: 2px; }

.shell { padding-block: 34px 52px; }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 .45rem; color: var(--turquoise-dark); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { color: var(--navy); line-height: 1.15; }
h1 { margin: 0 0 .8rem; font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -.045em; }
.hero h1 span { display: block; }
h2 { margin-top: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.lead { max-width: 760px; margin: 0; color: #3d5869; font-size: clamp(1rem, 2vw, 1.22rem); }
.hero-mark { display: grid; min-height: 146px; place-items: center; padding: 22px; background: #ffffffbd; border: 1px solid #fff; border-radius: 18px; box-shadow: var(--shadow); }
.hero-mark p { margin: 0; color: var(--muted); }
.hero-mark strong { display: block; color: var(--navy); font-size: 2rem; }
.hero-sponsor { display: block; border-radius: 10px; }
.hero-sponsor:focus-visible { outline: 3px solid var(--turquoise-dark); outline-offset: 5px; }
.hero-sponsor img { width: min(260px, 100%); height: auto; }

.section-card { margin-top: 28px; padding: clamp(20px, 4vw, 36px); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.camera-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.camera-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 22px #06223812; transition: transform .18s, box-shadow .18s; }
.camera-card:hover { transform: translateY(-3px); box-shadow: 0 13px 28px #06223825; }
.camera-card a { color: inherit; text-decoration: none; }
.thumb-wrap { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #082940; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.live-badge { position: absolute; right: 12px; bottom: 12px; padding: .24rem .58rem; color: #fff; background: #d92d20; border-radius: 999px; font-size: .73rem; font-weight: 800; letter-spacing: .08em; }
.camera-copy { padding: 16px 17px 18px; }
.camera-copy h3 { margin: 0 0 .35rem; font-size: 1.12rem; }
.camera-copy p { margin: 0; color: var(--muted); font-size: .92rem; }

.ad-slot { min-height: 90px; display: grid; place-items: center; margin: 28px 0; overflow: hidden; background: #fff; border: 1px dashed #b7cbd0; border-radius: 12px; }
.ad-slot .adsbygoogle { max-width: 100%; }

.player-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 26px; align-items: start; }
.video-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #02131f; border-radius: 16px; box-shadow: var(--shadow); }
.video-frame video { width: 100%; height: 100%; background: transparent; object-fit: contain; }
.player-overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 28px; color: #fff; text-align: center; text-shadow: 0 2px 7px #000; background: linear-gradient(#031a2833, #031a287a); }
.player-overlay[hidden] { display: none; }
.primary-button { cursor: pointer; padding: .78rem 1.15rem; border: 0; border-radius: .7rem; color: #032b32; background: #5ce4df; font-weight: 800; }
.primary-button:hover { background: #91f1ed; }
.stream-state { min-height: 1.5em; color: var(--muted); font-size: .9rem; }
.details-panel { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.details-panel h1 { font-size: clamp(1.7rem, 4vw, 2.55rem); }
.details-panel dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 12px; margin: 20px 0; }
.details-panel dt { color: var(--muted); }
.details-panel dd { margin: 0; font-weight: 700; }
.map-image { width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.camera-partner { display: block; aspect-ratio: 234 / 60; margin-top: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.camera-partner[hidden] { display: none; }
.camera-partner img { width: 100%; height: 100%; object-fit: cover; }
.camera-description { margin-top: 26px; }

.partners { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 18px; align-items: center; }
.partner { min-height: 88px; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.partner img { max-width: 100%; max-height: 68px; width: auto; height: auto; object-fit: contain; }
.partner--resident-card { min-height: 0; aspect-ratio: 376 / 133; overflow: hidden; padding: 0; }
.partner--resident-card img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.partner--nowy-staw { height: 90px; overflow: hidden; padding: 4px 6px; background: transparent; }
.partner--nowy-staw img { display: block; width: 100%; max-width: 100%; height: 100%; max-height: none; object-fit: contain; }

.site-footer { color: #cfe5ed; background: var(--navy-2); border-top: 4px solid var(--turquoise); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding-block: 30px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.footer-nav a { color: #e3ffff; }
.footer-inner p { margin: .35rem 0 0; color: #a8c6d0; font-size: .85rem; }
.footer-logo, .footer-inner > a img { width: min(249px, 100%); height: auto; }

.stats-toolbar { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: .35rem .7rem; border-radius: 999px; background: #eef2f4; color: var(--muted); font-weight: 700; }
.status-pill::before { width: 9px; height: 9px; content: ""; border-radius: 50%; background: #98a2b3; }
.status-pill.ok { color: var(--ok); background: #ecfdf3; }
.status-pill.ok::before { background: #12b76a; }
.status-pill.error { color: var(--danger); background: #fef3f2; }
.status-pill.error::before { background: #f04438; }
.stats-grid { display: block; }
.stats-page .shell { width: min(1800px, calc(100% - 24px)); }
.stats-page .section-card { padding: clamp(16px, 1.7vw, 28px); }
.stat-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.stat-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.stat-card dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: .88rem; }
.stat-card dt { color: var(--muted); }
.stat-card dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.stats-table-wrap { width: 100%; overflow-x: visible; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px #0622380d; }
.stats-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: clamp(.68rem, .72vw, .82rem); }
.stats-table th, .stats-table td { padding: 9px clamp(5px, .55vw, 10px); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.stats-table thead th { color: #dffafa; background: var(--navy-2); font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.stats-table thead tr:first-child th { text-align: center; }
.stats-table .group-start { border-left: 2px solid #9bc9cf; }
.stats-table tbody th { color: var(--navy); background: #fff; font-weight: 800; }
.channel-description { color: var(--muted); font-weight: 600; }
.stream-row { cursor: pointer; }
.stream-row:focus-visible { outline: 3px solid var(--turquoise); outline-offset: -3px; }
.expand-indicator { display: inline-block; width: 1.15rem; color: var(--turquoise-dark); transition: transform .16s ease; }
.stream-row.is-expanded .expand-indicator { transform: rotate(90deg); }
.client-details-row > td { padding: 0; background: #effafa; }
.client-details { padding: 16px 18px 18px; }
.client-details h3 { display: flex; gap: 9px; align-items: center; margin: 0 0 10px; font-size: .94rem; }
.client-details h3 span { padding: .1rem .5rem; color: #fff; background: var(--turquoise-dark); border-radius: 999px; font-size: .72rem; }
.client-table-wrap { overflow-x: auto; }
.client-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.client-table th, .client-table td { padding: 8px 10px; border: 1px solid #c9dfe3; white-space: nowrap; }
.client-table thead th { color: var(--navy); background: #d9f0f2; text-transform: none; letter-spacing: 0; }
.stats-table tbody tr:last-child th, .stats-table tbody tr:last-child td { border-bottom: 0; }
.stats-table tbody tr:hover th, .stats-table tbody tr:hover td { background: #effafa; }
.stats-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.publisher-state { color: var(--ok); font-weight: 800; }
.raw-stats { max-height: 320px; overflow: auto; padding: 15px; color: #c6edf2; background: #061e2d; border-radius: 10px; font-size: .78rem; white-space: pre-wrap; }

@media (max-width: 900px) {
  .camera-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero, .player-layout { grid-template-columns: 1fr; }
  .partners { grid-template-columns: repeat(2, 1fr); }
  .stats-table-wrap { overflow-x: auto; }
  .stats-table { min-width: 1220px; }
}
@media (max-width: 720px) {
  .site-header { background-position: 66% center; }
  .ad-slot { display: none; }
  .header-inner { min-height: 0; align-items: stretch; flex-direction: column; gap: 10px; padding-block: 13px 12px; }
  .brand { min-width: 0; min-height: 0; flex: 0 0 auto; justify-content: center; }
  .brand-title { font-size: clamp(1.35rem, 6.5vw, 1.7rem); }
  .nav { display: flex; width: 100%; min-width: 0; flex-wrap: nowrap; gap: 6px; }
  .nav a { min-width: 0; flex: 1 1 0; overflow: hidden; padding: .62rem .25rem; text-align: center; white-space: nowrap; font-size: .74rem; }
}
@media (max-width: 640px) {
  .camera-grid { grid-template-columns: 1fr; }
  .stats-table > thead th:first-child, .stats-table > tbody > .stream-row > th:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  .stats-table > thead th:first-child { z-index: 2; }
  .section-card { border-radius: 13px; }
  .footer-inner { grid-template-columns: 1fr; }
  .section-heading, .stats-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .partners { grid-template-columns: 1fr; }
  .partner { min-height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
