:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --danger: #dc2626;
  --warn: #b45309;
  --good: #15803d;
  --good-soft: #dcfce7;
  --gold: #ca8a04;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.14);
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --panel-w: 420px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --panel: #151a21;
    --panel-2: #1b222b;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #29313b;
    --accent: #2dd4bf;
    --accent-ink: #042f2e;
    --accent-soft: #134e4a;
    --danger: #f87171;
    --warn: #fbbf24;
    --good: #4ade80;
    --good-soft: #14532d;
    --gold: #facc15;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h2, h3 { margin: 0; }
small { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.warn { color: var(--warn); }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text);
  text-decoration: none; white-space: nowrap; font-size: 14px;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.6; }
.icon-btn {
  flex: none; width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
  font-size: 20px;
}
.icon-btn.small { width: 40px; height: 40px; font-size: 17px; box-shadow: none; background: transparent; }
.map-ctrl .icon-btn.small { background: var(--panel); box-shadow: var(--shadow); }
.icon-btn.active, .map-ctrl .icon-btn.active { background: var(--accent); color: var(--accent-ink); }
.link { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; padding: 0; }

/* ---------- logowanie ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(360px, 100%); padding: 28px 22px; display: grid; gap: 12px; text-align: center;
  background: var(--panel); border-radius: 20px; box-shadow: var(--shadow);
}
.login-logo { font-size: 48px; }
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card input { height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); font-size: 16px; }
.login-card .btn { height: 48px; font-size: 16px; }
.error { color: var(--danger); margin: 0; min-height: 1.2em; }
.fatal { position: fixed; inset: auto 16px 16px; padding: 12px; background: var(--panel); color: var(--danger); border-radius: 12px; box-shadow: var(--shadow); }

/* ---------- mapa i górny pasek ---------- */
.map-wrap { position: fixed; inset: 0; background: var(--bg); }
#map { width: 100%; height: 100%; }

.topbar {
  position: fixed; z-index: 10;
  top: calc(var(--safe-top) + 10px); left: 10px; right: 10px;
  display: flex; gap: 8px;
}
.search {
  flex: 1; min-width: 0; min-height: 48px;
  display: flex; align-items: center;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
}
.search gmp-place-autocomplete { width: 100%; color-scheme: inherit; }
.plain-search { width: 100%; }
.plain-search input { width: 100%; height: 48px; padding: 0 14px; border: 0; background: transparent; font-size: 16px; outline: none; }

.map-ctrl {
  position: fixed; z-index: 4; right: 10px; top: calc(var(--safe-top) + 68px);
  display: grid; gap: 8px;
}

.bar {
  position: fixed; z-index: 9; left: 10px; right: 60px; top: calc(var(--safe-top) + 68px);
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
}
.bar-text { flex: 1; font-weight: 500; }

.toast {
  position: fixed; z-index: 30; left: 50%; top: calc(var(--safe-top) + 68px);
  max-width: min(92vw, 440px); padding: 10px 14px;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: #111827; color: #fff; border-radius: 12px; box-shadow: var(--shadow);
  transition: opacity 0.2s, transform 0.2s; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #991b1b; }

/* ---------- panel (bottom sheet) ---------- */
.sheet {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  height: calc(100dvh - var(--safe-top) - 66px);
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.16);
  will-change: transform;
}
.sheet.animating { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet-head { flex: none; touch-action: none; user-select: none; border-bottom: 1px solid var(--line); }
.sheet-handle { display: block; width: 100%; height: 22px; border: 0; background: none; padding: 0; }
.sheet-handle span { display: block; width: 40px; height: 5px; margin: 8px auto; border-radius: 3px; background: var(--line); }
.tabs { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  flex: 1 0 auto; height: 42px; padding: 0 10px;
  border: 0; border-bottom: 2.5px solid transparent; background: none;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 18px; }
.badge:empty { display: none; }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(24px + var(--safe-bottom) + var(--sheet-hidden, 0px));
}

@media (min-width: 900px) {
  .map-wrap { left: var(--panel-w); }
  .sheet {
    top: 0; right: auto; width: var(--panel-w); height: auto;
    border-radius: 0; transform: none !important; padding-top: 70px;
    box-shadow: 1px 0 0 var(--line);
  }
  .sheet-handle { display: none; }
  .topbar { left: 12px; right: auto; width: calc(var(--panel-w) - 24px); top: 12px; }
  .topbar .icon-btn, .search { box-shadow: none; border: 1px solid var(--line); }
  .map-ctrl { top: 12px; right: 12px; }
  .bar { left: calc(var(--panel-w) + 12px); right: 64px; top: 12px; }
  .toast { left: calc(50% + var(--panel-w) / 2); top: 12px; }
}

/* ---------- sekcje ---------- */
section { margin-top: 20px; }
section > h3 {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
section > h3 .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
section > h3 .link { margin-left: auto; text-transform: none; letter-spacing: 0; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 8px; }
.foot { margin: 20px 0 0; font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 18px 8px 8px; }
.empty-icon { font-size: 44px; }
.empty h2 { font-size: 18px; margin: 6px 0; }
.empty p { color: var(--muted); margin: 0 auto; max-width: 340px; }

.loading { display: grid; place-items: center; gap: 12px; padding: 36px 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- nagłówek wpisu ---------- */
.entry-title { font-size: 19px; line-height: 1.25; }
.entry-addr { color: var(--muted); margin-top: 2px; }
.star { color: var(--gold); }
.stars { color: var(--gold); letter-spacing: 1px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; }
.sep { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.btn.icon-only { width: 38px; padding: 0; font-size: 18px; }
.notes { white-space: pre-wrap; margin: 12px 0 0; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; font-size: 14px; }

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill.st-faworyt { background: #fef3c7; color: #92400e; }
.pill.st-odrzucony { background: var(--panel-2); color: var(--muted); }
.pill.st-obejrzany { background: #e0e7ff; color: #3730a3; }
@media (prefers-color-scheme: dark) {
  .pill.st-faworyt { background: #422006; color: #fde68a; }
  .pill.st-obejrzany { background: #1e1b4b; color: #c7d2fe; }
}

/* ---------- trasy ---------- */
.route {
  padding: 12px; margin-bottom: 10px;
  border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.route.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.route header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.route-dest small { color: var(--muted); font-size: 12px; }
.route-time { font-size: 22px; font-weight: 700; white-space: nowrap; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 6px; }
.arrow { color: var(--muted); }
.seg { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg.walk { background: var(--panel-2); color: var(--muted); font-weight: 500; }
.seg.line { background: var(--seg-bg, var(--accent)); color: var(--seg-fg, var(--accent-ink)); }
.route-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.route-meta b { color: var(--text); }
.route-meta.variants { margin-top: 4px; }
.offpeak-head { margin-top: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.offpeak-head small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.offpeak { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.offpeak .offpeak-head { margin-top: 0; }
.offpeak.muted { font-size: 12px; }
.chain.small { margin: 4px 0; }
.chain.small .seg { height: 20px; font-size: 12px; padding: 0 5px; }
.route-meta.variants b { font-size: 14px; }
.route details { margin-top: 8px; }
.route summary { font-size: 13px; color: var(--accent); cursor: pointer; }
.steps { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.step { padding-left: 10px; border-left: 3px solid var(--line); }
.step.walk { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }

/* ---------- kategorie ---------- */
.cats { display: grid; gap: 2px; }
.cat { border-radius: 12px; }
.cat.open { background: var(--panel-2); }
.cat-row { display: flex; align-items: center; gap: 4px; }
.cat-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border: 0; background: none; text-align: left;
}
.cat.off .cat-main { opacity: 0.5; }
.dot {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c); color: var(--t, #fff); font-size: 17px; font-weight: 800;
}
.cat-label { flex: 1; min-width: 0; font-weight: 600; }
.cat-label small { display: block; font-weight: 400; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-label .tts { flex-wrap: nowrap; }
.cat-near { text-align: right; font-weight: 600; white-space: nowrap; }
.cat-near small { display: block; font-weight: 400; font-size: 12px; }

.switch { position: relative; flex: none; width: 44px; height: 26px; margin-right: 4px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.places { list-style: none; margin: 0; padding: 0 6px 8px 50px; }
.places button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 8px;
  padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left;
}
.pl-name { font-weight: 500; }
.pl-addr { grid-column: 1; color: var(--muted); font-size: 12px; }
.pl-dist { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 13px; white-space: nowrap; }
.pl-times { grid-column: 1 / 3; margin-top: 3px; }
.tts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text); font-size: 12px; }
.tt { white-space: nowrap; }
.tt-row { margin-top: 2px; }
.tt-row small { color: #6b7280; }
.iw-times { margin-top: 6px; padding-top: 6px; border-top: 1px solid #e5e7eb; }
.iw-loading { color: #6b7280; font-style: italic; }

/* ---------- listy ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.list-head select { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }

.card {
  padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  border-left: 4px solid var(--accent);
}
.card:hover { background: var(--panel-2); }
.card.st-faworyt { border-left-color: var(--gold); }
.card.st-odrzucony { border-left-color: var(--line); opacity: 0.65; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-facts { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 14px; }
.card-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; color: var(--muted); }

.row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; font-size: 12px; }

/* ---------- porównanie ---------- */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.cmp { border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; }
.cmp th, .cmp td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.cmp thead th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; cursor: pointer; }
.cmp thead th.sorted { color: var(--accent); }
.cmp .sticky { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; max-width: 150px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line); }
.cmp thead .sticky { z-index: 2; }
.cmp tbody tr { cursor: pointer; }
.cmp tbody tr:hover td, .cmp tbody tr:hover th { background: var(--panel-2); }
.cmp td.best { color: var(--good); font-weight: 700; background: var(--good-soft); }

/* ---------- pinezki na mapie ---------- */
.home-pin {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg) translate(6px, -6px);
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: grab;
}
.home-pin span { transform: rotate(45deg); font-size: 20px; }
.poi {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c); color: var(--t, #fff);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
  font-size: 14px; font-weight: 800; line-height: 1;
}
.poi.nearest { width: 34px; height: 34px; font-size: 17px; border-width: 2.5px; }
.dest-pin {
  padding: 4px 10px; border-radius: 999px; background: #111827; color: #fff;
  font-size: 13px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: nowrap;
}
.ov-pin {
  padding: 4px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 13px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: nowrap;
}
.ov-pin.st-faworyt { background: var(--gold); color: #1c1917; }
.ov-pin.st-odrzucony { background: #6b7280; color: #fff; }

/* ---------- InfoWindow ---------- */
.iw { color: #111827; font-size: 13px; max-width: 260px; }
.iw-cat { font-size: 12px; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .03em; }
.iw-name { font-size: 15px; font-weight: 700; margin: 2px 0; }
.iw-addr { color: #6b7280; }
.iw-dist { margin-top: 4px; }
.iw-warn { color: #b45309; margin-top: 4px; }
.iw-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.iw-links a { color: #0f766e; font-weight: 600; text-decoration: none; white-space: nowrap; }
.iw-links .iw-dir { color: #6b7280; font-size: 12px; white-space: nowrap; }

/* ---------- formularz ogłoszenia ---------- */
dialog {
  width: min(520px, 100vw); max-height: 100dvh; padding: 0; border: 0;
  border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
}
#listingForm { display: grid; gap: 12px; padding: 16px 16px calc(16px + var(--safe-bottom)); }
#listingForm header { display: flex; align-items: center; justify-content: space-between; }
#listingForm h2 { font-size: 18px; }
#listingForm label, #listingForm .field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
#listingForm input, #listingForm select, #listingForm textarea {
  width: 100%; min-height: 42px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); font-size: 16px;
}
#listingForm textarea { resize: vertical; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rating { display: flex; gap: 2px; min-height: 42px; align-items: center; }
.rating button { border: 0; background: none; font-size: 26px; line-height: 1; padding: 0 2px; color: var(--line); }
.rating button.on { color: var(--gold); }
#listingForm footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- import z Otodom ---------- */
.import { display: flex; gap: 6px; margin: 4px 0 14px; }
.import input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); font-size: 16px; }
.entry-img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; background: var(--panel-2); }
.approx { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 13px; }
@media (prefers-color-scheme: dark) { .approx { background: #431407; color: #fed7aa; } }

/* ---------- nasłonecznienie ---------- */
.home-pin.small { width: 32px; height: 32px; }
.home-pin.small span { font-size: 15px; }
.sun-pin { font-size: 28px; filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.9)); }
.sun-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sun-head h2 { font-size: 18px; flex: 1; }
.sun-status { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13px; }
.sun-status .warn { color: var(--warn); }
.seg-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btns .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sun-now { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-size: 14px; }
.sun-now .big { font-size: 22px; font-weight: 800; }
.slider { display: grid; gap: 2px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.slider input[type=range] { width: 100%; accent-color: var(--accent); }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.quick button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 3px 8px; font-size: 12px; }
.heat-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 10px; }
.heat th { color: var(--muted); font-weight: 600; padding: 0 2px; }
.heat td.c { width: 15px; height: 15px; border-radius: 3px; cursor: pointer; padding: 0; }
.heat td.c.night { background: var(--line); opacity: 0.35; }
.heat td.h { padding-left: 6px; font-weight: 700; white-space: nowrap; font-size: 11px; }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.heat-legend .heat-bar { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #334155, #facc15); }
.sun-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.sun-summary div { padding: 8px 4px; border-radius: 10px; background: var(--panel-2); font-size: 12px; color: var(--muted); }
.sun-summary b { display: block; font-size: 17px; color: var(--text); }
.heat td.c.sel { outline: 2px solid var(--text); outline-offset: 0; }

/* ---------- ocena i ranking ---------- */
.score { display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding: 0 6px; border-radius: 10px; font-weight: 800; font-size: 17px; color: #fff; background: #6b7280; }
.score.small { min-width: 30px; height: 22px; font-size: 12px; border-radius: 7px; }
.score.good { background: #16a34a; }
.score.mid { background: #d97706; }
.score.low { background: #dc2626; }
.card-badges { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ranking { display: grid; gap: 8px; }
.rank { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.rank.open { background: var(--panel-2); }
.rank-main { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; }
.rank-pos { flex: none; width: 22px; font-weight: 800; color: var(--muted); }
.rank-title { flex: 1; min-width: 0; font-weight: 600; }
.rank-title small { display: block; font-weight: 400; font-size: 12px; }
.rank-bar { display: flex; height: 8px; margin-top: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.rank-bar i { display: block; height: 100%; }
.veto { margin-top: 6px; font-size: 12px; color: var(--danger); font-weight: 600; }
.rank-missing { margin-top: 4px; font-size: 11px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.breakdown { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 12px; }
.breakdown th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 4px 4px 0; }
.breakdown td { padding: 4px 4px 4px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.breakdown td:first-child { white-space: normal; }
.breakdown tr.na td { color: var(--muted); }
.pts { display: inline-block; width: 40px; height: 6px; border-radius: 3px; background: var(--line); vertical-align: middle; overflow: hidden; }
.pts i { display: block; height: 100%; background: var(--accent); }
.scatter { width: 100%; height: auto; display: block; }
.scatter .zone-ideal { fill: #22c55e; opacity: 0.22; }
.scatter .zone-ok { fill: #22c55e; opacity: 0.08; }
.scatter .grid { stroke: var(--line); stroke-width: 1; }
.scatter .tick, .scatter .axis { fill: var(--muted); font-size: 10px; }
.scatter .pt { cursor: pointer; }
.scatter .pt circle { stroke: var(--panel); stroke-width: 2; }
.scatter .pt-label { fill: var(--text); font-size: 10px; font-weight: 600; }
.weights { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.weights summary { cursor: pointer; font-weight: 600; }
.wtable { border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.wtable th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px 4px 0; white-space: nowrap; }
.wtable td { padding: 3px 6px 3px 0; border-top: 1px solid var(--line); }
.wtable td:first-child { min-width: 150px; }
.wtable select, .wtable input { width: 64px; height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--text); font-size: 14px; }
.wtable select { width: 52px; }
.ov-pin.sc-good { background: #16a34a; color: #fff; }
.ov-pin.sc-mid { background: #d97706; color: #fff; }
.ov-pin.sc-low { background: #dc2626; color: #fff; }
.ov-score { display: inline-block; margin-left: 2px; padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.25); font-weight: 800; }

/* jeden układ dla „rano” i „po południu” */
.time-block { margin-top: 8px; }
.time-block + .time-block { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.tb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tb-head .offpeak-head { margin-top: 0; }
.tb-time { font-size: 20px; font-weight: 800; white-space: nowrap; }
.time-block .chain { margin: 6px 0 4px; }
.card-badges .icon-btn.small { width: 30px; height: 30px; font-size: 14px; margin: -4px -4px -4px 0; }
