/* Heliograf — styl. Tło to „niebo” zależne od wysokości słońca (zmienne ustawiane z app.js). */
:root {
    --sky-top: #0b1030;
    --sky-bottom: #1e2a5c;
    --glow: rgba(255, 170, 90, 0);
    --stars: 1;

    --text: #f4f1ff;
    --muted: rgba(232, 228, 255, 0.62);
    --faint: rgba(232, 228, 255, 0.14);
    --card: rgba(14, 14, 40, 0.52);
    --card-strong: rgba(14, 14, 40, 0.74);
    --border: rgba(255, 255, 255, 0.10);
    --sun: #ffc65a;
    --sun-hot: #ff9442;
    --sky-line: #8fd0ff;
    --accent: #ffb547;
    --danger: #ff7a7a;
    --ok: #7ee2a8;

    --radius: 20px;
    --gap: 14px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font: 15px/1.45 var(--font);
    color: var(--text);
    background: var(--sky-bottom);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--sun); }
h2 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------- niebo ---------- */
.sky {
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
    transition: background 1.2s ease;
}
.sky-glow {
    position: absolute; inset: 0;
    background: radial-gradient(120% 60% at 50% 105%, var(--glow), transparent 70%);
    transition: background 1.2s ease;
}
.stars {
    position: absolute; inset: 0; opacity: var(--stars); transition: opacity 1.5s ease;
    background-image:
        radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 27% 42%, #fff 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 41% 12%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 33%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 73% 8%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 86% 27%, #fff 50%, transparent 51%),
        radial-gradient(1.3px 1.3px at 92% 55%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 6% 62%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 35% 70%, #fff 50%, transparent 51%),
        radial-gradient(1.1px 1.1px at 66% 60%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 19% 85%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 80% 80%, #fff 50%, transparent 51%);
    background-size: 380px 380px;
}

/* ---------- górny pasek ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l));
    border-bottom: 1px solid var(--border);
}
/* rozmycie na pseudo-elemencie: backdrop-filter na samym pasku zamknąłby w nim
   pozycjonowanie fixed dolnego paska zakładek na telefonie */
.topbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(8, 8, 28, 0.72), rgba(8, 8, 28, 0.38));
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
}
.brand { display: flex; align-items: center; gap: 9px; font: 700 19px/1 var(--font-round); letter-spacing: -0.01em; }
.brand img { border-radius: 9px; box-shadow: 0 2px 12px rgba(255, 150, 60, 0.35); }
.ver {
    font: 650 11px/1 var(--font); letter-spacing: 0.02em; color: var(--sun); cursor: pointer;
    padding: 4px 7px; border-radius: 999px; border: 1px solid rgba(255, 198, 90, 0.4); background: rgba(255, 198, 90, 0.1);
    font-variant-numeric: tabular-nums;
}
.ver:hover { background: rgba(255, 198, 90, 0.2); }

.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tabs button {
    display: flex; align-items: center; gap: 7px;
    border: 0; background: transparent; padding: 8px 13px; border-radius: 999px;
    color: var(--muted); cursor: pointer; font-weight: 550;
    transition: background 0.2s, color 0.2s;
}
.tabs button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #1b1240; background: var(--sun); }

.place-pill {
    margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.07);
    border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer; text-align: left;
}
.place-pill svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--sun); stroke-width: 2; }
.pp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pp-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.pp-text small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }

/* ---------- pasek daty ---------- */
.datebar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    max-width: 1240px; margin: 14px auto 0;
    padding: 0 calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l));
}
.date-field {
    position: relative; display: inline-flex; align-items: center;
    padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
    font-weight: 600; cursor: pointer; min-width: 190px; justify-content: center;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.date-field input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.date-field input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.icon-btn {
    width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--border);
    background: var(--card); cursor: pointer; font-size: 20px; line-height: 1; display: grid; place-items: center;
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.icon-btn:hover { background: var(--card-strong); }
.live {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 8px 14px;
    cursor: pointer; font-weight: 600; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live[aria-pressed="true"] { border-color: rgba(126, 226, 168, 0.5); }
.live[aria-pressed="true"] i { background: var(--ok); box-shadow: 0 0 0 0 rgba(126, 226, 168, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(126, 226, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0); } }

/* ---------- układ ---------- */
main {
    max-width: 1240px; margin: 0 auto;
    padding: 14px calc(16px + var(--safe-r)) calc(40px + var(--safe-b)) calc(16px + var(--safe-l));
}
.view { display: none; }
.view.active { display: block; animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; margin-bottom: var(--gap);
    -webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2, .grid-2 + .card { margin-top: var(--gap); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }

/* ---------- hero ---------- */
.hero { padding-bottom: 10px; overflow: hidden; }
.hero-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.big {
    font: 700 clamp(54px, 11vw, 88px)/0.95 var(--font-round); letter-spacing: -0.04em;
    background: linear-gradient(180deg, #fff6d8 10%, var(--sun) 60%, var(--sun-hot));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-variant-numeric: tabular-nums;
}
.big.below { background: linear-gradient(180deg, #e6e9ff, #8e9bdc); -webkit-background-clip: text; background-clip: text; }
.sub { color: var(--muted); margin-top: 6px; }
.hero-side { display: grid; grid-template-columns: auto auto; gap: 4px 18px; align-items: baseline; }
.phase-pill {
    grid-column: 1 / -1; justify-self: end; padding: 5px 12px; border-radius: 999px; font-weight: 650; font-size: 13px;
    background: rgba(255, 255, 255, 0.1); border: 1px solid var(--border); margin-bottom: 6px;
}
.hero-kv { display: contents; }
.hero-kv span { color: var(--muted); font-size: 13px; text-align: right; }
.hero-kv b { font-size: 17px; font-variant-numeric: tabular-nums; }
.hero-kv b small { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.sky-chart { margin-top: 12px; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.chart text { fill: var(--muted); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .lbl-strong { fill: var(--text); font-weight: 650; }
.chart .grid line, .chart line.grid { stroke: var(--faint); stroke-width: 1; }

.scrub { padding: 6px 2px 0; }
input[type="range"] { width: 100%; accent-color: var(--sun); height: 28px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff8dc, var(--sun) 55%, var(--sun-hot));
    box-shadow: 0 0 0 4px rgba(255, 198, 90, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4);
}
input[type="range"] { -webkit-appearance: none; appearance: none; }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--sun); }

/* ---------- kafelki ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.stat {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); position: relative; overflow: hidden;
}
.stat .k { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 550; }
.stat .k svg { width: 18px; height: 18px; fill: none; stroke: var(--sun); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat .v { font: 650 28px/1.15 var(--font-round); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.accent { background: linear-gradient(140deg, rgba(255, 180, 70, 0.28), rgba(255, 120, 60, 0.12)); border-color: rgba(255, 198, 90, 0.35); }
.up { color: var(--ok); }
.down { color: #ffa38a; }

/* ---------- moc ---------- */
.power-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pw { background: rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 10px 12px; }
.pw .k { color: var(--muted); font-size: 12px; }
.pw .v { font: 650 22px/1.2 var(--font-round); font-variant-numeric: tabular-nums; }
.pw .v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.pw.hl { background: linear-gradient(140deg, rgba(255, 180, 70, 0.25), rgba(255, 120, 60, 0.08)); }
.energy { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.energy .pw .v { font-size: 19px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 16px; height: 4px; border-radius: 2px; background: var(--c); display: inline-block; }
.sw.dash { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 7px); }
.sw.dot { width: 9px; height: 9px; border-radius: 50%; }
.sw.area { height: 10px; background: linear-gradient(180deg, var(--c), transparent); opacity: 0.8; }

.panel-cfg { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.panel-cfg summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
.panel-cfg summary::-webkit-details-marker { display: none; }
.panel-cfg summary::before { content: "⚙︎ "; }
.panel-cfg[open] summary { margin-bottom: 10px; color: var(--text); }
.panel-cfg p { margin: 10px 0 0; }
.link-btn { border: 0; background: none; color: var(--sun); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; }

/* ---------- formularze ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 550; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid output { color: var(--text); font-weight: 650; }
.form-grid label:has(output) { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
.form-grid label:has(output) input { flex-basis: 100%; }
input:not([type="range"]):not([type="checkbox"]):not([type="file"]), select {
    width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 16px; outline: none;
}
input:focus, select:focus { border-color: rgba(255, 198, 90, 0.7); box-shadow: 0 0 0 3px rgba(255, 198, 90, 0.18); }
select option { background: #1b1640; }
input.invalid { border-color: var(--danger) !important; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; font-weight: 650;
    background: linear-gradient(180deg, #ffd27a, var(--sun-hot)); color: #2a1406;
    box-shadow: 0 4px 16px rgba(255, 140, 60, 0.25);
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.btn.ghost { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13.5px; }
.btn.wide { width: 100%; margin: 10px 0 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.switch input { display: none; }
.switch span { width: 42px; height: 25px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); position: relative; transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------- fazy i szczegóły ---------- */
.phases-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin: 4px 0 6px; }
.phases-bar i { display: block; height: 100%; }
.phases-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable td { padding: 6px 0; border-bottom: 1px solid var(--faint); font-variant-numeric: tabular-nums; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable td:first-child { display: flex; align-items: center; gap: 9px; }
.ptable td:last-child { text-align: right; font-weight: 600; }
.ptable tr.key td { color: var(--sun); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.details div { background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 9px 12px; }
.details span { display: block; color: var(--muted); font-size: 12px; }
.details b { font-variant-numeric: tabular-nums; font-size: 15.5px; }

/* ---------- miejsca ---------- */
.gps-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.gps-box .msg { grid-column: 1 / -1; color: var(--muted); }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.place {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
    -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); display: flex; flex-direction: column; gap: 10px;
}
.place.active { border-color: rgba(255, 198, 90, 0.65); box-shadow: 0 0 0 1px rgba(255, 198, 90, 0.35), 0 10px 40px rgba(255, 150, 60, 0.12); }
.place-top { display: flex; gap: 10px; align-items: flex-start; }
.place-top .dot { margin-top: 6px; }
.place-top h3 { margin: 0; font-size: 16.5px; }
.place-top .coords { color: var(--muted); font-size: 12.5px; }
.place-now { margin-left: auto; text-align: right; }
.place-now b { font: 650 22px/1 var(--font-round); }
.place-now span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.place-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
.place-row div { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 6px 9px; }
.place-row span { display: block; color: var(--muted); font-size: 11.5px; }
.place-row b { font-variant-numeric: tabular-nums; }
.place-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.place-actions .spacer { flex: 1; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.icon-btn.danger { color: var(--danger); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--sun); }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }

/* ---------- porównanie ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.05); font-weight: 600; font-size: 14px;
}
.chip .dot { width: 9px; height: 9px; }
.chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.chip[aria-pressed="false"] { opacity: 0.6; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: -4px; padding: 4px; }
table.cmp { width: 100%; border-collapse: collapse; min-width: 640px; font-variant-numeric: tabular-nums; }
.cmp th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cmp td { padding: 10px; border-bottom: 1px solid var(--faint); vertical-align: top; white-space: nowrap; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp td b { font-size: 15.5px; }
.cmp td small { display: block; color: var(--muted); font-size: 11.5px; }
.cmp .name { display: flex; gap: 8px; align-items: center; font-weight: 650; }
.badge { display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; background: var(--sun); color: #2a1406; vertical-align: 2px; }
.seg { display: inline-flex; background: rgba(0, 0, 0, 0.25); border-radius: 10px; padding: 3px; border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.active { background: rgba(255, 255, 255, 0.16); color: var(--text); }

/* ---------- prose ---------- */
.prose p, .prose li { color: rgba(240, 238, 255, 0.86); }
.prose ul { padding-left: 18px; }
.prose li { margin-bottom: 8px; }
.prose h2 { margin-bottom: 8px; }

/* ---------- instalacja / toast ---------- */
.install-hint {
    display: flex; align-items: center; gap: 12px; max-width: 1240px;
    margin: 12px auto 0; padding: 12px 14px; border-radius: 16px;
    width: calc(100% - 32px - var(--safe-l) - var(--safe-r));
    background: linear-gradient(120deg, rgba(255, 180, 70, 0.28), rgba(140, 90, 255, 0.22)); border: 1px solid rgba(255, 198, 90, 0.4);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.install-hint > div { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.install-hint em { font-style: normal; font-weight: 650; }
.ios-share { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: #8fc7ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-hint .icon-btn { width: 32px; height: 32px; font-size: 14px; }

.toast {
    position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 30px);
    background: rgba(20, 18, 50, 0.92); border: 1px solid var(--border); padding: 11px 18px; border-radius: 14px;
    opacity: 0; pointer-events: none; transition: all 0.3s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- dialog ---------- */
dialog {
    width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border);
    border-radius: 24px; background: rgba(22, 18, 54, 0.96); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
dialog::backdrop { background: rgba(5, 5, 20, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { padding: 18px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.search { position: relative; }
.results { display: flex; flex-direction: column; margin-top: 6px; border-radius: 12px; overflow: hidden; }
.results button {
    text-align: left; border: 0; background: rgba(255, 255, 255, 0.06); padding: 9px 12px; cursor: pointer;
    border-bottom: 1px solid var(--faint);
}
.results button:hover, .results button:focus { background: rgba(255, 198, 90, 0.16); outline: none; }
.results small { display: block; color: var(--muted); font-size: 12px; }
#fNote { margin: 10px 0 0; }

/* ---------- responsywność ---------- */
@media (max-width: 1020px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .grid-2 { grid-template-columns: 1fr; }
    .tabs {
        position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 30;
        justify-content: space-around; gap: 0;
        padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l));
        background: rgba(10, 8, 30, 0.82); border-top: 1px solid var(--border);
        -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
    }
    .tabs button { flex-direction: column; gap: 2px; font-size: 11px; padding: 5px 4px; flex: 1; border-radius: 12px; }
    .tabs button svg { width: 24px; height: 24px; }
    .tabs button.active { background: transparent; color: var(--sun); }
    main { padding-bottom: calc(96px + var(--safe-b)); }
    .toast { bottom: calc(86px + var(--safe-b)); }
    .pp-text b, .pp-text small { max-width: 46vw; }
}
@media (max-width: 560px) {
    body { font-size: 14.5px; }
    .card { padding: 15px; }
    .brand .name { display: none; }
    .stat .v { font-size: 24px; }
    .power-now { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
    .pw { padding: 8px 9px; }
    .pw .v { font-size: 17px; }
    .hero-side { width: 100%; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .phase-pill { justify-self: start; }
    .hero-kv { display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 7px 10px; }
    .hero-kv span { text-align: left; font-size: 11.5px; }
    .hero-kv b { font-size: 15px; white-space: nowrap; }
    .date-field { min-width: 0; flex: 1; padding: 8px 10px; }
    .live { margin-left: 0; }
    .datebar .btn.small { padding: 7px 10px; }
    .form-grid { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr 1fr; }
    .places { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
    .live span { display: none; }
    .stats { gap: 10px; }
    .stat { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* tabela porównania: pierwsza kolumna zostaje przy przewijaniu w bok */
.cmp th:first-child, .cmp td:first-child { position: sticky; left: 0; z-index: 1; background: #17153c; box-shadow: 6px 0 10px -8px rgba(0, 0, 0, 0.6); }
