/* Miernik Netu — arkusz stylów.
   Jasna strona „wydawnicza” (reklamy i treść czytają się jak w serwisie
   informacyjnym) z ciemnym panelem testu, w którym gra główną rolę
   prędkościomierz. Panel administratora korzysta z tych samych tokenów. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --good: #059669;
  --ok: #d97706;
  --bad: #dc2626;

  /* panel testu */
  --hero-bg: #0b1324;
  --hero-bg-2: #13213d;
  --hero-card: rgba(255, 255, 255, .05);
  --hero-border: rgba(148, 163, 184, .18);
  --hero-text: #f1f5f9;
  --hero-muted: #94a3b8;
  --cyan: #22d3ee;
  --indigo: #818cf8;
  --green: #34d399;
  --track: #1e2947;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --container: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-hover); }

:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.3px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { color: var(--text); }
.logo-mark { width: 30px; height: 30px; color: var(--text); flex-shrink: 0; }
.logo-text span { color: var(--brand); }
.logo-light, .logo-light:hover { color: #fff; }
.logo-light .logo-mark { color: #fff; }
.logo-light .logo-text span { color: var(--cyan); }

.main-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a.current { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-short { display: none; }
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .main-nav a { padding: 6px 11px; font-size: 14px; }
  .nav-full { display: none; }
  .nav-short { display: inline; }
}

/* ------------------------------------------------------------- układ -- */

.layout {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Reklamy pionowe po bokach tylko tam, gdzie jest na nie miejsce obok
   1200 px treści — nigdy kosztem samego testu. Węższe ekrany dostają je
   pod treścią, w zwykłym przepływie strony. */
.layout.has-rails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}
.layout.has-rails .layout-main { grid-column: 1 / -1; grid-row: 1; }
.rail { display: flex; justify-content: center; margin: 0 0 24px; grid-row: 2; }
.rail-left { justify-content: flex-end; }
.rail-right { justify-content: flex-start; }
@media (min-width: 1600px) {
  .layout.has-rails {
    display: grid;
    grid-template-columns: 160px minmax(0, var(--container)) 160px;
    gap: 28px;
    max-width: calc(var(--container) + 2 * 160px + 2 * 28px + 40px);
  }
  .layout.has-rails .layout-main { grid-column: 2; grid-row: 1; }
  .rail { margin: 0; padding-top: 24px; display: block; grid-row: 1; }
  .rail-left { grid-column: 1; grid-row: 1; }
  .rail-right { grid-column: 3; grid-row: 1; }
  .rail .ad-slot { position: sticky; top: 88px; }
}

.content-grid {
  display: grid;
  gap: 24px;
  margin: 24px 0 48px;
}
@media (min-width: 1024px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}

.main-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.sidebar { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: 88px; }
}

/* ------------------------------------------------------------ reklamy -- */

.ad-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.rail .ad-slot { width: 160px; max-width: 100%; }
.ad-marker {
  align-self: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-slot > ins, .ad-slot > .ad-banner, .ad-slot > .ad-html { width: 100%; }
.ad-banner { display: block; text-align: center; }
.ad-banner img { max-width: 100%; height: auto; display: inline-block; border-radius: 4px; }
.ad-html { max-width: 100%; overflow: hidden; text-align: center; }

/* Zarezerwowane wysokości standardowych formatów — brak skoków układu. */
.top-ad, .bottom-ad { padding-top: 20px; padding-bottom: 4px; }
.ad-top > ins, .ad-bottom > ins { min-height: 90px; }
.ad-sidebar > ins { min-height: 250px; }
.ad-inline > ins { min-height: 250px; }
.ad-left > ins, .ad-right > ins { min-height: 600px; }
@media (max-width: 727px) {
  .ad-top > ins, .ad-bottom > ins { min-height: 100px; }
}

.ad-inline, .ad-sidebar {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* -------------------------------------------------------------- karty -- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-flush { padding: 0; overflow: hidden; }
.card h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.3px; line-height: 1.3; }
.card-lead { margin: -4px 0 18px; color: var(--muted); }
@media (max-width: 600px) { .card { padding: 20px; } }

.prose h2 { margin: 28px 0 10px; font-size: 20px; }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code {
  font-size: 13.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

.metric-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-top: 8px;
}
@media (min-width: 600px) { .metric-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.guide-item h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 16px;
}
.guide-item p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-download { background: var(--cyan); }
.dot-upload { background: var(--indigo); }
.dot-ping { background: var(--green); }
.dot-jitter { background: #f59e0b; }

.faq details {
  border-top: 1px solid var(--border);
  padding: 2px 0;
}
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 32px 14px 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 16px; color: var(--text-2); }

.footnote { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------------------------------------------------------- widżety -- */

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.widget h2 { margin: 0 0 10px; font-size: 16px; }
.widget p { margin: 0 0 14px; font-size: 14.5px; color: var(--text-2); }
.tips { margin: 0; padding-left: 20px; font-size: 14.5px; color: var(--text-2); }
.tips li { margin-bottom: 6px; }
.widget-cta {
  background: linear-gradient(135deg, var(--hero-bg), var(--hero-bg-2));
  border-color: transparent;
  color: var(--hero-text);
}
.widget-cta p { color: var(--hero-muted); }

/* ------------------------------------------------------------ przyciski -- */

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

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

.page-head {
  margin-top: 24px;
  padding: 32px;
  border-radius: var(--radius);
  background:
    radial-gradient(600px 240px at 90% -40%, rgba(34, 211, 238, .22), transparent 70%),
    linear-gradient(135deg, var(--hero-bg), var(--hero-bg-2));
  color: var(--hero-text);
}
.page-head h1 { margin: 0 0 6px; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.6px; line-height: 1.2; }
.page-head p { margin: 0; max-width: 720px; color: var(--hero-muted); }

/* --------------------------------------------------------- panel testu -- */

.hero {
  margin-top: 24px;
  padding: 32px 32px 0;
  border-radius: 20px;
  color: var(--hero-text);
  background:
    radial-gradient(700px 360px at 50% -10%, rgba(34, 211, 238, .16), transparent 70%),
    radial-gradient(600px 320px at 100% 0%, rgba(129, 140, 248, .14), transparent 70%),
    linear-gradient(160deg, var(--hero-bg), var(--hero-bg-2));
  overflow: hidden;
  scroll-margin-top: 80px;
}
@media (max-width: 600px) { .hero { padding: 24px 16px 0; border-radius: 16px; } }

.hero-head { text-align: center; margin-bottom: 8px; }
.hero-head h1 { margin: 0; font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -.7px; line-height: 1.2; }
.hero-head p { margin: 6px 0 0; color: var(--hero-muted); }

.test-area {
  display: grid;
  align-items: center;
  gap: 24px 40px;
  padding: 16px 0 28px;
  scroll-margin-top: 80px;
}
@media (min-width: 860px) {
  .test-area { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); padding: 20px 8px 32px; }
}

.test-gauge { display: flex; flex-direction: column; align-items: center; }

.gauge-wrap { position: relative; width: 300px; max-width: 82vw; }
.gauge { width: 100%; height: auto; display: block; }
.gauge-track { fill: none; stroke: var(--track); stroke-width: 12; stroke-linecap: round; }
.gauge-value {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 424.12;
  stroke-dashoffset: 424.12;
  filter: url(#gaugeGlow);
  transition: stroke-dashoffset .25s ease;
}
.needle {
  stroke: var(--hero-text);
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 100px 100px;
  transform: rotate(-135deg);
  transition: transform .25s ease;
}
.needle-hub { fill: var(--hero-text); }

.gauge-readout { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; }
.gauge-value-text { font-size: 38px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.gauge-value-text .unit { margin-left: 6px; font-size: 14px; font-weight: 500; color: var(--hero-muted); }
.gauge-phase {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--hero-muted);
}

.start-btn {
  margin-top: 18px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: rgba(34, 211, 238, .08);
  color: var(--cyan);
  font: inherit;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, .35);
  transition: background .18s, color .18s, transform .1s, box-shadow .3s;
}
.start-btn:hover {
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  color: #06121c;
  box-shadow: 0 0 36px -4px rgba(34, 211, 238, .6);
}
.start-btn:active { transform: scale(.96); }
.start-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: rgba(34, 211, 238, .05);
  color: var(--cyan);
  box-shadow: none;
}
.start-btn.is-again { border-color: var(--green); color: var(--green); background: rgba(52, 211, 153, .08); }
.start-btn.is-again:hover {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #06121c;
  box-shadow: 0 0 36px -4px rgba(52, 211, 153, .55);
}

.test-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.progress { opacity: .5; transition: opacity .25s ease; }
.progress.is-running, .progress.is-done { opacity: 1; }
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.step { transition: color .2s ease; }
.step.active { color: var(--cyan); }
.step.done { color: var(--green); }
.progress-track { height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
  transition: width .2s linear;
}
.is-done .progress-fill { background: linear-gradient(90deg, var(--indigo), var(--green)); }

.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-box {
  padding: 16px 18px;
  border: 1px solid var(--hero-border);
  border-radius: 12px;
  background: var(--hero-card);
}
.result-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.result-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.result-download .result-label::before { background: var(--cyan); }
.result-upload .result-label::before { background: var(--indigo); }
.results .result-box:nth-child(4) .result-label::before { background: #f59e0b; }
.result-value { margin-top: 4px; font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.result-value small { font-size: 13px; font-weight: 500; color: var(--hero-muted); letter-spacing: 0; }
.result-download .result-value, .result-upload .result-value { font-size: 32px; }

.client-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0 -32px;
  padding: 0;
  border-top: 1px solid var(--hero-border);
  background: rgba(2, 6, 23, .28);
}
@media (max-width: 600px) { .client-info { margin: 0 -16px; } }
.info-item { padding: 16px 32px; min-width: 0; }
.info-item + .info-item { border-left: 1px solid var(--hero-border); }
@media (max-width: 860px) { .info-item + .info-item { border-left: 0; border-top: 1px solid var(--hero-border); } }
.info-label { font-size: 11.5px; font-weight: 600; letter-spacing: .9px; text-transform: uppercase; color: var(--hero-muted); }
.info-value {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hero-text);
  overflow-wrap: anywhere;
}
.link-btn-inline {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  cursor: pointer;
}
.link-btn-inline:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .progress-fill, .step, .progress, .gauge-value, .needle { transition: none; }
}

/* -------------------------------------------------------- podsumowanie -- */

.summary {
  margin-top: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}
.summary[hidden] { display: none; }
@media (max-width: 600px) { .summary { padding: 20px; } }

.summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.summary-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand);
}
.summary-head h2 { margin: 4px 0 6px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.5px; line-height: 1.2; }
.summary-meta { margin: 0; color: var(--muted); }

.summary-badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: var(--muted);
}
.badge-Aplus { background: linear-gradient(135deg, #059669, #10b981); }
.badge-A { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.badge-B { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.badge-C { background: linear-gradient(135deg, #d97706, #f59e0b); }
.badge-D { background: linear-gradient(135deg, #dc2626, #ef4444); }

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.metric-label { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.metric-value { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.metric-value small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.chip {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.chip-good { background: #d1fae5; color: #065f46; }
.chip-ok { background: #fef3c7; color: #92400e; }
.chip-bad { background: #fee2e2; color: #991b1b; }

.summary-cols { display: grid; gap: 24px; }
@media (min-width: 760px) { .summary-cols { grid-template-columns: 1fr 1fr; } }
.summary-col h3 { margin: 0 0 12px; font-size: 16px; }

.uses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.use { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.use-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.use-ok .use-icon { background: #d1fae5; color: #047857; }
.use-no .use-icon { background: #fee2e2; color: #b91c1c; }
.use-no { color: var(--muted); }

.compare { display: grid; gap: 12px; }
.compare-row p { margin: 6px 0 0; font-size: 15px; }
.compare-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.compare-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--brand)); }
.compare-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.compare-line > span:first-child { color: var(--text-2); }
.compare-ref { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.compare-ref em { display: block; font-style: normal; font-size: 13px; font-weight: 600; }
.diff-up { color: var(--good); }
.diff-down { color: var(--bad); }
.compare-empty { margin: 0; color: var(--muted); font-size: 15px; }
.compare-loading { opacity: .8; }
.compare-loading::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  vertical-align: -1px;
  animation: obrot .8s linear infinite;
}
@keyframes obrot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .compare-loading::after { animation: none; } }

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------- tabele -- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafbff; }
.card .data-table { margin-top: 4px; }
.card:not(.card-flush) .data-table th:first-child,
.card:not(.card-flush) .data-table td:first-child { padding-left: 0; }
.card:not(.card-flush) .data-table th { background: none; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-strong { font-weight: 700; color: var(--text); }
.nowrap { white-space: nowrap; }
.isp-name { font-weight: 600; }
.empty { padding: 36px 16px !important; text-align: center !important; color: var(--muted); }

.rank-pos { width: 56px; }
.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.rank-1 { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.rank-2 { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.rank-3 { background: #ffedd5; border-color: #fdba74; color: #9a3412; }

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

.site-footer { margin-top: 32px; background: var(--hero-bg); color: var(--hero-muted); font-size: 14.5px; }
.footer-inner {
  display: grid;
  gap: 28px;
  padding-top: 44px;
  padding-bottom: 32px;
}
@media (min-width: 760px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand p { margin: 12px 0 0; max-width: 380px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h2 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--hero-text);
}
.footer-col a { color: var(--hero-muted); text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 18px;
  padding-bottom: 24px;
  border-top: 1px solid rgba(148, 163, 184, .16);
  font-size: 13px;
}

/* =================================================== panel administratora */

body.admin { background: var(--bg); }

.admin-page { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }
.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.admin-header h1 { margin: 0; font-size: 26px; letter-spacing: -.4px; }
.admin-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-header-actions form { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #b91c1c; }

.flash {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14.5px;
}
.flash-ok { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }

.panel-lead { margin: 0 0 18px; color: var(--muted); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.stat-value { margin-top: 4px; font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); }

.ad-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14.5px;
}
.ad-table th, .ad-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ad-table th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.ad-table tbody tr:last-child td { border-bottom: 0; }
.ad-table form { margin: 0; }
.thumb { width: 96px; height: 40px; object-fit: contain; border-radius: 4px; background: var(--surface-2); }
.type-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}
.status-badge {
  padding: 3px 10px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.inactive { background: #f1f5f9; color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.row-actions a { font-weight: 600; text-decoration: none; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--bad);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.row-bad td { background: #fef2f2; color: #991b1b; }
.row-bad .num-strong { color: #991b1b; }
.dim-cell { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-form-wide { max-width: 820px; }
.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
}
.admin-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.type-fields { display: flex; flex-direction: column; gap: 16px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 10px !important; }
.form-hint { margin: -8px 0 0; font-size: 13.5px; color: var(--muted); }
.form-hint code, .notice-box code {
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.admin-form-actions { display: flex; gap: 10px; margin-top: 4px; }

.notice-box {
  max-width: 820px;
  margin-top: 24px;
  padding: 22px 26px;
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
}
.notice-box h2 { margin: 0 0 10px; font-size: 17px; }
.notice-box ol { margin: 0; padding-left: 20px; }
.notice-box li { margin-bottom: 6px; color: var(--text-2); font-size: 14.5px; }

.admin-auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(34, 211, 238, .16), transparent 70%),
    linear-gradient(160deg, var(--hero-bg), var(--hero-bg-2));
}
.admin-auth-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, .35);
}
.admin-auth-box h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.admin-auth-box .flash { margin: 0; }
.admin-auth-box button {
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: #fc6d26;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.admin-auth-box button:hover { background: #e24329; }
.admin-auth-box button:disabled { opacity: .5; cursor: not-allowed; }
.back-link { font-size: 14px; text-align: center; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--text); }
