/* ──────────────────────────────────────────────────────────────────────
   Trening — ciemny motyw, mobile-first. Tokeny w duchu shadcn/ui (dark).
   ────────────────────────────────────────────────────────────────────── */
:root {
    --bg: #0b0f17;
    --bg-elev: #0f1520;
    --card: #121a26;
    --card-hover: #162031;
    --border: #1f2a3a;
    --border-strong: #2b3a50;
    --fg: #e6eaf0;
    --fg-strong: #f8fafc;
    --muted: #8a96a8;
    --muted-2: #5f6b7d;

    --primary: #22c55e;
    --primary-fg: #04140a;
    --danger: #ef4444;
    --warn: #f59e0b;

    /* shadcn chart tokens (dark) */
    --chart-1: hsl(220 70% 58%);
    --chart-2: hsl(160 60% 45%);
    --chart-3: hsl(30 80% 55%);
    --chart-4: hsl(280 65% 62%);
    --chart-5: hsl(340 75% 58%);

    /* kolory bloków */
    --block-moc: hsl(30 85% 58%);
    --block-sila: hsl(220 75% 62%);
    --block-kondycja: hsl(150 60% 48%);

    --radius: 14px;
    --radius-sm: 10px;
    --tabbar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; } /* aplikacja jest ciemna: paski przewijania, listy wyboru i kalendarz przeglądarki też */
body {
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.app { min-height: 100dvh; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
/* rozmyte tło na osobnej warstwie POD treścią — iOS rozmywał też napisy, gdy filtr był na samym pasku */
.topbar::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: rgba(11, 15, 23, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }

#main, #main-panel { max-width: 680px; margin: 0 auto; }
.view {
    padding: 16px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(15, 21, 32, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}
.tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--fg-strong); }
.tab.is-active svg { color: var(--primary); }

/* ── Typografia / nagłówki ─────────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--fg-strong); letter-spacing: -0.01em; }
.page-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.section-label { margin: 22px 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Przyciski ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 16px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: var(--card); color: var(--fg); font-weight: 600; font-size: 15px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--card-hover); }
.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn-primary:hover { background: #2fd36b; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--card); color: var(--fg); }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,0.35); background: transparent; }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.confirm-modal .confirm-text { margin: 2px 0 16px; font-size: 16px; line-height: 1.45; color: var(--fg-strong); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 4px; }
.link-btn:hover { color: var(--fg); }

/* ── Karty ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
}
.card + .card { margin-top: 12px; }

/* ── Start sesji ───────────────────────────────────────────────────────── */
.start-card { display: grid; gap: 12px; }
.start-row { display: flex; gap: 10px; }
.start-row .input { flex: 1; }

/* ── Bloki ─────────────────────────────────────────────────────────────── */
.block-head { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; }
.block-chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.block-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.block-chip { color: var(--bc, var(--muted)); }
.block-count { color: var(--muted-2); font-size: 12px; }

/* ── Ćwiczenie ─────────────────────────────────────────────────────────── */
.ex-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 14px 12px; margin-bottom: 10px;
    border-left: 3px solid var(--border-strong);
}
.ex-card.has-block { border-left-color: var(--bc); }
.ex-card.is-done { background: linear-gradient(0deg, rgba(34,197,94,0.04), rgba(34,197,94,0.04)), var(--card); }

.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ex-title { margin: 0; font-size: 16px; font-weight: 650; color: var(--fg-strong); line-height: 1.3; }
.ex-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.ex-meta b { color: var(--fg); font-weight: 600; }
.badge {
    display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
    background: rgba(138,150,168,0.12); color: var(--muted); border: 1px solid var(--border);
    vertical-align: 2px; margin-left: 6px;
}
.badge-ok { background: rgba(34,197,94,0.12); color: var(--primary); border-color: rgba(34,197,94,0.3); }

.video-link {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
    color: #fca5a5; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
    text-decoration: none; cursor: pointer;
}
.video-link svg { width: 14px; height: 14px; }

.ex-last {
    margin-top: 10px; padding: 8px 10px; border-radius: 8px;
    background: var(--bg-elev); border: 1px dashed var(--border);
    color: var(--muted); font-size: 13px;
}
.ex-last b { color: var(--fg); font-weight: 600; }

/* ── Wideo (embed) ─────────────────────────────────────────────────────── */
.video-box {
    position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden;
    background: #000; border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
}
/* pionowy Short: ~44% wysokości ekranu, żeby pola serii zostały w zasięgu kciuka */
.video-box.is-short { aspect-ratio: 9 / 16; width: min(100%, calc(44vh * 9 / 16)); margin-left: auto; margin-right: auto; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-thumb {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer;
    background: #000 center / cover no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.video-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.45)); }
.video-play {
    position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
    background: rgba(239,68,68,0.92); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.video-play svg { width: 26px; height: 26px; margin-left: 1px; color: #fff; }

/* ── Serie ─────────────────────────────────────────────────────────────── */
.sets { margin-top: 12px; display: grid; gap: 8px; }
.set-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.set-idx {
    width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-elev); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 700;
}
.set-row.is-saved .set-idx { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.35); color: var(--primary); }
.set-fields { display: flex; align-items: center; gap: 8px; min-width: 0; }
.set-fields .x { color: var(--muted-2); font-weight: 600; }
.unit { color: var(--muted); font-size: 13px; min-width: 34px; }
.set-remove {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent;
    color: var(--muted-2); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.set-remove:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.set-remove svg { width: 16px; height: 16px; }
.add-set { margin-top: 10px; }

/* ── Pola formularza ───────────────────────────────────────────────────── */
.input, .select, .textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--fg); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--chart-1); box-shadow: 0 0 0 3px rgba(80,130,240,0.18); }
.input-num { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; }
.set-fields .input-num { flex: 1; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a96a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px;
}
.textarea { min-height: 72px; resize: vertical; }
input[type="date"].input { color-scheme: dark; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ── Segmented control ─────────────────────────────────────────────────── */
.seg {
    display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
}
.seg button {
    min-height: 34px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent;
    color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.seg button.is-active { background: var(--card-hover); color: var(--fg-strong); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* ── Sesja: krok po kroku ──────────────────────────────────────────────── */
.session-head { display: grid; gap: 10px; margin-bottom: 14px; }
.session-meta { display: flex; gap: 10px; }
.session-meta .input { flex: 1; }
.progress-track { height: 6px; border-radius: 999px; background: var(--bg-elev); overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--chart-2), var(--primary)); border-radius: 999px; transition: width .3s; }
.progress-text { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

.step-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.step-strip::-webkit-scrollbar { display: none; }
.step-pill {
    flex-shrink: 0; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card); color: var(--muted);
    font-size: 13px; font-weight: 700; cursor: pointer;
}
.step-pill.is-done { color: var(--primary); border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.08); }
.step-pill.is-current { color: var(--fg-strong); border-color: var(--chart-1); box-shadow: 0 0 0 2px rgba(80,130,240,0.25); }

.step-counter { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.step-nav {
    position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 5;
    display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 14px;
}
.step-nav .btn { box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.step-nav .btn[disabled] { opacity: 1; background: var(--card); color: var(--muted-2); border-color: var(--border); }

/* ── Historia ──────────────────────────────────────────────────────────── */
.list { display: grid; gap: 10px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; text-align: left; cursor: pointer;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
}
.list-item:hover { background: var(--card-hover); border-color: var(--border-strong); }
.list-date { font-weight: 650; color: var(--fg-strong); }
.list-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.list-stats { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }
.list-stats b { color: var(--fg); font-size: 15px; }

/* ── Wykres (styl shadcn) ──────────────────────────────────────────────── */
.chart-card { padding: 16px 12px 12px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 4px 10px; }
.chart-title { margin: 0; font-size: 15px; font-weight: 650; color: var(--fg-strong); }
.chart-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.chart-head-wrap { flex-wrap: wrap; align-items: center; row-gap: 0; }   /* tytuł + trend w wierszu, podpis pod nimi na całą szerokość */
.chart-head-wrap > .chart-desc { flex-basis: 100%; }
.chart-trend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.chart-trend.up { color: var(--primary); }
.chart-trend.down { color: var(--danger); }
.chart-trend.flat { color: var(--muted); }
.chart-trend svg { width: 16px; height: 16px; }
.chart-wrap { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart-svg .axis-label { fill: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .line { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { fill: var(--bg); stroke: var(--chart-1); stroke-width: 2.5; }
.chart-svg .dot.is-active { fill: var(--chart-1); r: 6; }
.chart-svg .trend { stroke: var(--chart-3); stroke-width: 2; stroke-dasharray: 6 5; fill: none; opacity: .9; }
.chart-svg .hit { fill: transparent; cursor: pointer; }
.chart-tip {
    position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
    background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 8px 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); font-size: 12px; white-space: nowrap;
}
.chart-tip .tip-date { color: var(--muted); }
.chart-tip .tip-val { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--fg-strong); font-weight: 700; font-size: 13px; }
.chart-tip .tip-val::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--chart-1); }
.chart-legend { display: flex; gap: 16px; padding: 10px 4px 0; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--chart-1); display: inline-block; }
.chart-legend i.trend { background: repeating-linear-gradient(90deg, var(--chart-3) 0 5px, transparent 5px 9px); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--fg-strong); font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.table td:last-child, .table th:last-child { text-align: right; }

/* ── Edytor planu ──────────────────────────────────────────────────────── */
.edit-item {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 10px 10px 12px; margin-bottom: 8px;
}
.edit-order { display: grid; gap: 2px; }
.edit-order button {
    width: 28px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elev);
    color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.edit-order button svg { width: 14px; height: 14px; }
.edit-order button:disabled { opacity: .3; pointer-events: none; }
.edit-name { font-weight: 600; font-size: 15px; color: var(--fg-strong); line-height: 1.3; }
.edit-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.edit-actions { display: flex; gap: 6px; }

/* ── Nakładki ──────────────────────────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: radial-gradient(ellipse at top, #13213a 0%, var(--bg) 60%);
}
.overlay-card {
    width: 100%; max-width: 380px; display: grid; gap: 14px;
    background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.overlay-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--fg-strong); text-align: center; }
.user-pick-list { display: grid; gap: 10px; }
.user-pick-list a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-radius: 12px; text-decoration: none;
    background: var(--bg-elev); border: 1px solid var(--border-strong); font-weight: 650; font-size: 17px; color: var(--fg-strong);
}
.user-pick-list a:hover { border-color: var(--primary); }
.user-pick-list a span { color: var(--muted); font-size: 13px; font-weight: 500; }
.user-pick-form { display: flex; gap: 10px; }
.user-pick-form .input { flex: 1; }
.lock-error { margin: 0; color: var(--danger); text-align: center; font-size: 14px; }

/* modal (formularz ćwiczenia) */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-end; justify-content: center;
}
.modal {
    width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
    background: var(--card); border: 1px solid var(--border); border-radius: 18px 18px 0 0;
    padding: 20px 16px calc(20px + var(--safe-b));
}
.modal-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--fg-strong); }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }
@media (min-width: 640px) {
    .modal-backdrop { align-items: center; }
    .modal { border-radius: 18px; }
}

/* ── Toast / puste stany ───────────────────────────────────────────────── */
.toast {
    /* pod górnym paskiem (góra ekranu na iPhonie jest rozmyta przez system), szerokość ekranu z marginesami */
    position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 57px); z-index: 120;
    width: min(calc(100vw - 32px), 648px); box-sizing: border-box;
    transform: translateX(-50%);
    animation: toast-in .22s ease-out;
    background: var(--fg-strong); color: var(--bg); padding: 12px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.toast.is-multi { border-radius: 20px; }
.toast-msg { min-width: 0; }
.toast.is-error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.empty {
    text-align: center; padding: 36px 20px; color: var(--muted);
    border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty b { display: block; color: var(--fg); font-size: 16px; margin-bottom: 4px; }
.saving-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); margin-left: 6px; vertical-align: middle; }
.saving-dot.is-saving { background: var(--warn); animation: pulse 0.9s infinite; }
.saving-dot.is-ok { background: var(--primary); }
@keyframes pulse { 50% { opacity: .3; } }

/* ── Propozycja progresji, historia ćwiczenia, chipy ───────────────────── */
.ex-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ex-foot .btn { flex: 1 1 0; } /* „Wpisz jak ostatnio” i „Więcej” — dwa równe przyciski drugorzędne */
.sets-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.sets-head .btn { flex: none; }
.sets-head .btn svg { width: 14px; height: 14px; }
.sugg {
    margin-top: 10px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
    padding: 8px 10px; border-radius: 8px;
    background: rgba(45, 180, 130, 0.08); border: 1px solid rgba(45, 180, 130, 0.25);
    font-size: 13px;
}
.sugg span { color: var(--chart-2); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sugg b { color: var(--fg-strong); font-size: 15px; font-variant-numeric: tabular-nums; }
.sugg em { color: var(--muted); font-style: normal; }
.history-list { margin-top: 10px; display: grid; gap: 4px; }
.history-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; background: var(--bg-elev); font-size: 13px; }
.history-row span { color: var(--muted); white-space: nowrap; }
.history-row b { color: var(--fg); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 4px 10px; border-radius: 8px; background: var(--bg-elev); border: 1px solid var(--border); font-size: 13px; font-variant-numeric: tabular-nums; }
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg-full button { white-space: normal; line-height: 1.2; padding: 6px 8px; }

/* ── Plany, oznaczenia 1A/1B, notatki, biblioteka ─────────────────────── */
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.plan-chip, .day-chip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
    min-height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--card); color: var(--muted);
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.plan-chip.is-view { background: var(--card-hover); border-color: var(--chart-1); color: var(--fg-strong); box-shadow: 0 0 0 2px rgba(80,130,240,0.18); }
.active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.day-chip { border-radius: 10px; }
.day-chip.is-view { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.45); color: var(--fg-strong); }
.day-chip em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--primary); }
.day-chip small { font-size: 11px; color: var(--muted-2); font-weight: 700; }
.day-chip.day-add { border-style: dashed; color: var(--muted); }
.day-chip svg, .btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.label-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px;
    padding: 0 6px; margin-right: 8px; border-radius: 6px; vertical-align: 2px;
    background: rgba(80,130,240,0.14); border: 1px solid rgba(80,130,240,0.35); color: var(--chart-1);
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.note-box { margin-top: 10px; }
.note-text {
    display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px;
    background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.25);
    color: var(--fg); font-size: 13px; line-height: 1.45; white-space: pre-wrap;
}
.note-icon { color: var(--warn); flex-shrink: 0; }
.note-icon svg { width: 15px; height: 15px; margin-top: 1px; }
.note-add { font-size: 13px; padding: 4px 0; }
.note-actions { display: flex; gap: 8px; margin-top: 8px; }
.plan-card { margin-bottom: 10px; }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card-name { font-size: 17px; font-weight: 700; color: var(--fg-strong); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lib-search { margin-bottom: 8px; }
.lib-list {
    max-height: 240px; overflow-y: auto; margin-bottom: 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.lib-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 15px; }
.lib-item:last-child { border-bottom: 0; }
.lib-item input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.lib-item span { flex: 1; }
.lib-item small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.lib-item.has-history small::after { content: " · historia"; color: var(--chart-2); }
.form-hint { margin: -6px 0 14px; color: var(--muted); font-size: 12px; }
.form-section-title { margin: 6px 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-row em { display: block; font-style: normal; color: var(--muted-2); font-size: 11px; }
.seg button[disabled] { opacity: .4; pointer-events: none; }

@media (min-width: 640px) {
    .view { padding-left: 24px; padding-right: 24px; }
    .stats { grid-template-columns: repeat(4, 1fr); }
}

/* ── v3: aktywny plan, dni, wznowienie, data PL, pomijanie, przerwa, profil ── */
.min0 { min-width: 0; }
.badge-inline { margin-left: 0; margin-right: 8px; }
.badge-lg { padding: 6px 12px; font-size: 13px; align-self: center; }
.badge-live { background: rgba(245,158,11,0.14); color: var(--warn); border-color: rgba(245,158,11,0.35); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.link-accent { color: var(--chart-1); font-weight: 600; padding-left: 0; display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 10px; }
.link-accent svg { width: 15px; height: 15px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 0 6px; font-weight: 600; }
.back-btn svg { width: 16px; height: 16px; }

.notice {
    display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
    background: rgba(80,130,240,0.08); border: 1px solid rgba(80,130,240,0.3); font-size: 14px;
}
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.day-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 15px; color: var(--fg-strong); }
.day-title b { font-weight: 650; }
.day-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 4px 0 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-elev); border: 1px solid var(--border);
}

/* trening w trakcie */
.resume-card { margin-bottom: 12px; border-color: rgba(245,158,11,0.4); background: linear-gradient(0deg, rgba(245,158,11,0.05), rgba(245,158,11,0.05)), var(--card); display: grid; gap: 8px; }
.resume-head { display: flex; align-items: center; gap: 10px; color: var(--fg-strong); }
.resume-head .elapsed { margin-left: auto; }
.resume-actions { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-top: 4px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s infinite; flex-shrink: 0; }
.elapsed { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.elapsed svg { width: 14px; height: 14px; }
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -6px 0 12px; }
.session-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.session-tools .icon-btn { width: 44px; height: 44px; font-size: 22px; font-weight: 700; color: var(--fg); letter-spacing: 1px; }
.swap-item.is-warn b { color: var(--warn); }
.swap-item.is-danger b { color: var(--danger); }
.menu-note { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--warn);
    background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.35); }
.menu-note-deload { color: var(--chart-1); background: color-mix(in srgb, var(--chart-1) 10%, transparent); border-color: color-mix(in srgb, var(--chart-1) 40%, transparent); }
.session-tools .icon-btn.has-flag { position: relative; }
.session-tools .icon-btn.has-flag::after { content: ''; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.topbar-clock { margin-left: auto; font-size: 15px; color: var(--fg); }
.topbar-clock + #btn-switch-user:not([hidden]) { margin-left: 14px; }

/* data po polsku: nasz tekst + przezroczyste natywne pole na wierzchu */
.date-field {
    position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 12px; cursor: pointer;
    background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.date-field svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.date-field:focus-within { border-color: var(--chart-1); box-shadow: 0 0 0 3px rgba(80,130,240,0.18); }
.date-text { overflow: hidden; text-overflow: ellipsis; }
.date-native {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
    opacity: 0; cursor: pointer; color-scheme: dark; font-size: 16px; -webkit-appearance: none; appearance: none;
}
.date-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.session-meta .date-field { flex: 0 0 auto; }
.session-meta .input { min-width: 0; }

/* serie: przyciski ✓ / ⏭ / ✕, pominięcia, rekord */
.set-actions { display: flex; gap: 4px; }
.set-btn {
    width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-elev);
    color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.set-btn svg { width: 17px; height: 17px; }
.set-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.set-btn.set-ok { color: var(--primary); border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.1); }
.set-row.is-skipped .set-idx { opacity: .5; text-decoration: line-through; }
.set-skip-text { color: var(--muted-2); font-size: 13px; font-style: italic; padding-left: 4px; }
.set-row.is-record .set-idx { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.5); color: var(--warn); }
.ex-card.is-skipped { opacity: .72; border-left-style: dashed; }
.skip-note { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.skip-note svg { width: 16px; height: 16px; flex-shrink: 0; }
.skip-note span { flex: 1; }
.step-pill.is-skipped { color: var(--muted-2); text-decoration: line-through; border-style: dashed; }
.step-counter .next-up { margin-left: auto; color: var(--muted-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.step-nav.one { grid-template-columns: 1fr; }
.ex-foot .btn svg { width: 14px; height: 14px; }

.toast.is-record { background: var(--warn); color: #1a1002; text-align: center; }
.net-badge { font-size: 11px; font-weight: 700; color: var(--warn); background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.35); border-radius: 999px; padding: 2px 8px; }
.saving-dot.is-offline { background: var(--warn); }
.list-time { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.list-date .badge { vertical-align: 1px; }
.chip.chip-muted { color: var(--muted-2); border-style: dashed; }

/* katalog */
.cat-item { grid-template-columns: 1fr auto; }
.cat-use { color: var(--muted-2); font-size: 12px; margin-top: 3px; }
.cat-video { display: inline-flex; margin-left: 6px; color: #fca5a5; vertical-align: -1px; }
.cat-video svg { width: 12px; height: 12px; }

/* profil */
.stats-3 { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
.sum-row { display: flex; gap: 8px; overflow-x: auto; padding: 0 4px 12px; scrollbar-width: none; }
.sum-row::-webkit-scrollbar { display: none; }
.sum-chip {
    flex-shrink: 0; display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px;
    background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--c);
}
.sum-chip span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sum-chip b { font-size: 18px; color: var(--fg-strong); font-variant-numeric: tabular-nums; }
.sum-chip b small { font-size: 12px; color: var(--muted); }
.sum-chip em { font-style: normal; font-size: 12px; color: var(--muted); }
.series-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 4px 0; }
.series-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: transparent; color: var(--fg); font-size: 12px; font-weight: 600; cursor: pointer;
}
.series-chip i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); }
.series-chip.is-off { color: var(--muted-2); border-style: dashed; }
.series-chip.is-off i { background: var(--muted-2); }
.chart-svg .mline { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .mdot { fill: var(--bg); stroke-width: 2; }
.chart-svg .zero-line { stroke: var(--border-strong); stroke-dasharray: none; }
.chart-svg .guide { stroke: var(--muted-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); }
.chart-tip .tip-row i { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip .tip-row b { margin-left: auto; padding-left: 10px; color: var(--fg-strong); }
.chart-empty { padding: 40px 0; text-align: center; }
.measure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.measure-field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.measure-input { position: relative; display: block; }
.measure-input .input { padding-right: 36px; }
.measure-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted-2); font-size: 13px; pointer-events: none; }
.measure-list { margin-top: 14px; display: grid; gap: 8px; }
.measure-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); }
.link-list { display: grid; gap: 10px; margin-top: 12px; }
.link-list .list-date { display: inline-flex; align-items: center; gap: 8px; }
.link-list .list-date svg { width: 16px; height: 16px; color: var(--muted); }

@media (min-width: 640px) {
    .stats-3 { grid-template-columns: repeat(3, 1fr); }
    .measure-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Karty-siatki na wąskich telefonach (320 px): kolumna może się zwęzić, pole daty skraca tekst zamiast wypychać przycisk */
.start-card, .session-head, .resume-card, .notice { grid-template-columns: minmax(0, 1fr); }
.start-row .btn { flex-shrink: 0; }
@media (max-width: 360px) { .session-meta .date-dow { display: none; } }
/* Telefon: data na całą szerokość, pod nią duży przycisk startu (pod kciuk) */
@media (max-width: 420px) {
    .start-row { flex-direction: column; align-items: stretch; }
    .start-row .btn { min-height: 50px; font-size: 16px; }
}

/* panel aplikacji */
.panel-view { padding-bottom: 40px; }
.dot-panel { background: var(--chart-1); box-shadow: 0 0 0 3px rgba(80,130,240,0.18); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-head .section-label { margin: 0; }
.list-arrow { color: var(--muted-2); display: inline-flex; }
.list-arrow svg { width: 18px; height: 18px; }
.list > a.list-item { text-decoration: none; }
.cat-use b { color: var(--muted); font-weight: 600; }
.panel-link { display: block; text-align: center; color: var(--muted); font-size: 14px; text-decoration: none; padding: 6px 0 0; }
.panel-link:hover { color: var(--fg); }
.select option:disabled { color: var(--muted-2); }
#panel-count { text-transform: none; letter-spacing: 0; }
/* odstęp między kartą startu a listą ćwiczeń (z nagłówkiem bloku marginesy się nie sumują — zostaje 24 px) */
.start-card { margin-bottom: 16px; }

/* nazwa po polsku, podgląd ćwiczenia w panelu */
.name-pl { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.lib-item .lib-pl { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.cat-open { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.cat-open:hover .edit-name { text-decoration: underline; text-underline-offset: 3px; }
.cat-pl { color: var(--muted); font-size: 13px; margin-top: 1px; }
.modal.preview { padding-top: 22px; }
.pv-pl { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.pv-list { display: grid; gap: 1px; margin: 14px 0 6px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.pv-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; background: var(--bg-elev); font-size: 14px; }
.pv-row span { color: var(--muted); white-space: nowrap; }
.pv-row b { font-weight: 600; text-align: right; color: var(--fg); }
.pv-row b b { color: var(--muted); }
.pv-merge { display: block; margin: 4px 0 2px; font-size: 13px; }

/* ── Telefon: panel wpisywania serii (własna klawiatura) ───────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,0.25); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
    width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--border-strong); border-bottom: 0;
    border-radius: 18px 18px 0 0; padding: 14px 14px calc(12px + var(--safe-b)); box-shadow: 0 -12px 40px rgba(0,0,0,0.45);
    touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-title { font-weight: 700; color: var(--fg-strong); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-sub { color: var(--muted); font-size: 13px; }
.sheet-hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.sheet-hint b { color: var(--chart-2); }
.sheet-fields { display: grid; gap: 8px; margin-top: 12px; }
.sheet-field { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: stretch; }
.sheet-step {
    min-height: 54px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg-elev);
    color: var(--fg-strong); font-size: 26px; font-weight: 600; cursor: pointer;
}
.sheet-value {
    display: flex; align-items: baseline; justify-content: center; gap: 6px; min-height: 54px; border-radius: 12px;
    border: 2px solid var(--border-strong); background: var(--bg-elev); color: var(--fg-strong); cursor: pointer;
}
.sheet-value b { font-size: 26px; font-variant-numeric: tabular-nums; }
.sheet-value span { color: var(--muted); font-size: 14px; }
.sheet-field.is-active .sheet-value { border-color: var(--chart-1); box-shadow: 0 0 0 3px rgba(80,130,240,0.2); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.keypad button {
    min-height: 48px; border-radius: 10px; border: 0; background: var(--card-hover); color: var(--fg-strong);
    font-size: 22px; font-weight: 600; cursor: pointer;
}
.keypad button:active, .sheet-step:active { background: var(--border-strong); }
.keypad button:disabled { opacity: .3; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; margin-top: 10px; }
.sheet-actions .btn { min-height: 50px; }
.sheet-actions .btn svg { width: 15px; height: 15px; }
body.sheet-open .step-nav, body.sheet-open .tabbar { visibility: hidden; }
body.sheet-open .view { padding-bottom: 75vh; }
.set-row.is-editing .set-idx { border-color: var(--chart-1); color: var(--fg-strong); box-shadow: 0 0 0 2px rgba(80,130,240,0.3); }
.set-row input[readonly] { cursor: pointer; }

/* nowa wersja aplikacji */
.update-bar {
    position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 58px); transform: translateX(-50%); z-index: 110;
    display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px;
    background: var(--bg-elev); border: 1px solid var(--chart-1); box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    font-size: 14px; font-weight: 600; white-space: nowrap;
}
.update-bar .btn { border-radius: 999px; padding-left: 16px; padding-right: 16px; } /* pigułka w pigułce, jak „Cofnij” */

/* ── UX mobilny (dobre praktyki: cele dotyku ≥ 44 px, kciuk, bez skoków) ── */
html, body { overscroll-behavior-y: none; } /* przeciągnięcie w dół nie przeładuje strony w trakcie treningu */
/* bez przesuwania strony w bok i bez przybliżania (szczypanie, podwójne dotknięcie) — telefon nie zostaje „lekko przyzoomowany” */
html { overflow-x: hidden; touch-action: pan-x pan-y; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }
/* otwarte okno: strona pod spodem stoi (przewija się tylko zawartość okna) */
html.scroll-locked, html.scroll-locked body { overflow: hidden; }
.modal, .sheet { overscroll-behavior: contain; }
/* pasek przewijania na komputerze: systemowy schowany (nie zabiera miejsca po prawej), w zamian cienki wskaźnik nad treścią
   tylko w trakcie przewijania (.scroll-thumb, app.js); telefon ma taki pasek systemowo */
@media (pointer: fine) {
    * { scrollbar-width: none; }
    ::-webkit-scrollbar { display: none; width: 0; height: 0; }
}
.scroll-thumb { position: fixed; z-index: 200; width: 6px; border-radius: 3px; background: rgba(168, 182, 204, 0.55); opacity: 0;
    transition: opacity .35s ease; pointer-events: none; }
.scroll-thumb.is-on { opacity: 1; transition-duration: .1s; }
/* uchwyt okna na telefonie: przeciągnięcie w dół zamyka */
@media (max-width: 639px) {
    .modal, .sheet { position: relative; }
    .modal::before, .sheet::before { content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border-strong); }
}
button, .btn, a, input, select, label { touch-action: manipulation; } /* bez opóźnienia i przybliżania przy szybkim dotknięciu */
.btn:active, .icon-btn:active, .set-btn:active, .tab:active, .plan-chip:active, .day-chip:active, .list-item:active { filter: brightness(1.25); }
.topbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }   /* wycięcie ekranu w aplikacji z ekranu głównego */
.update-bar { top: calc(env(safe-area-inset-top, 0px) + 62px); }
.link-btn { min-height: 44px; padding: 10px 6px; }
.note-add { min-height: 40px; }
.icon-btn { width: 44px; height: 44px; }
.set-btn, .set-btn-slot { width: 44px; height: 44px; flex-shrink: 0; }
.set-btn-slot { display: block; }
.set-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
.set-fields .input-num { min-height: 48px; font-size: 17px; }
.edit-order { gap: 4px; }
.edit-order button { width: 36px; height: 30px; }
.video-link { min-height: 36px; padding: 6px 12px; }
.step-pill { min-width: 40px; height: 40px; }
.seg button { min-height: 38px; }
.modal { overscroll-behavior: contain; }
.lib-item { min-height: 48px; }

/* Tryb skupienia na treningu: bez paska zakładek, „Wstecz / Dalej" na stałe przy dolnej krawędzi */
body.in-session .tabbar { display: none; }
body.in-session .view { padding-bottom: calc(var(--safe-b) + 100px); }
body.in-session .step-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    padding: 10px max(16px, calc((100% - 680px) / 2 + 16px)) calc(10px + var(--safe-b));
    background: rgba(11, 15, 23, 0.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}
body.in-session .step-nav .btn { min-height: 52px; box-shadow: none; }
/* film w treningu mniejszy — serie bliżej kciuka */
#view-session .video-box.is-short { width: min(100%, calc(34vh * 9 / 16)); }
#view-session .video-box:not(.is-short) { max-width: 520px; margin-left: auto; margin-right: auto; }
.install-ios { cursor: default; }
.list-date svg, .list-note svg { width: 15px; height: 15px; vertical-align: -2px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* przy otwartym panelu serii strona musi mieć miejsce, by przewinąć wiersz nad panel (ważniejsze niż tryb skupienia) */
body.sheet-open .view, body.sheet-open.in-session .view { padding-bottom: 80vh; }
/* wartość w panelu serii: grupa „10 powt.” na środku pola (w pionie i poziomie), liczba i jednostka na wspólnej linii */
.sheet-value { align-items: center; justify-content: center; padding: 0 8px; }
.sheet-value .sv { display: inline-flex; align-items: baseline; gap: 6px; line-height: 1; }
.sheet-value .sv b { line-height: 1; }

/* ── Partia 1: karta „Dziś”, Cofnij, kafelek filmu, odczucie, panel serii ── */
.today-card { display: grid; gap: 6px; margin-bottom: 14px; border-color: rgba(34,197,94,0.35); background: linear-gradient(160deg, rgba(34,197,94,0.10), rgba(34,197,94,0.02) 60%), var(--card); }
.today-card.is-secondary { border-color: var(--border); background: var(--card); }
.today-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.today-card.is-secondary .today-label { color: var(--muted); }
.today-title { font-size: 20px; font-weight: 750; color: var(--fg-strong); line-height: 1.25; }
.today-sub { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.today-card .btn-lg svg { width: 18px; height: 18px; }
.today-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.today-foot .date-field { flex: 0 0 auto; min-height: 38px; font-size: 14px; }
.today-foot .muted { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.has-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 20px; }
.toast-undo { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--primary); color: var(--primary-fg); font-weight: 700; cursor: pointer; }
.video-tile {
    position: relative; flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border-strong);
    background: var(--bg-elev) center / cover no-repeat; cursor: pointer; overflow: hidden;
}
.video-tile::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.video-tile span { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; color: #fff; }
.video-tile svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.swap-note { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--warn); }
.effort-badge { border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--fg); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.effort-badge.e1 { border-color: rgba(34,197,94,0.45); }
.effort-badge.e3 { border-color: rgba(245,158,11,0.5); }
.session-meta { align-items: center; }
.session-note-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-note-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.session-note-panel .textarea { min-height: 80px; }
.sheet-hint-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.sheet-hint-row .sheet-hint { margin: 0; line-height: 1.4; }
.sheet-spark { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sheet-spark svg { display: block; }
.sheet-spark polyline { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sheet-spark circle { fill: var(--chart-1); }
.sheet-spark b { font-size: 12px; color: var(--fg); font-variant-numeric: tabular-nums; }
.sheet-note-add { min-height: 32px; padding: 6px 2px 0; font-size: 13px; color: var(--chart-1); }
.sheet-note { margin-top: 8px; min-height: 40px; font-size: 16px; }
.effort-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.effort-btn {
    display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--border-strong);
    background: var(--bg-elev); color: var(--fg-strong); font-weight: 700; font-size: 14px; cursor: pointer;
}
.effort-btn span { font-size: 28px; line-height: 1; }
.effort-btn.e1:active { border-color: var(--primary); }
.effort-btn.e3:active { border-color: var(--warn); }
.set-note-line { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--fg); } .set-note-line svg { width: 14px; height: 14px; color: var(--warn); flex-shrink: 0; margin-top: 2px; }
.today-card { grid-template-columns: minmax(0, 1fr); } .today-foot { min-width: 0; } .today-foot .muted { min-width: 0; flex: 1; }
.set-idx { position: relative; } .set-idx.has-note::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); border: 2px solid var(--card); }

/* ── Cel tygodnia ─────────────────────────────────────────────── */
.week-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.week-line b { color: var(--fg-strong); }
.week-line i { flex: 1; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; max-width: 160px; }
.week-line em { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .3s; }

/* ── Kalendarz ────────────────────────────────────────────────── */
.cal-card { padding: 12px; margin-bottom: 12px; }
.cal-card.foldable { padding: 16px; margin: 12px 0 0; } /* w Profilu jak pozostałe karty (zwinięte stoją równo) */
.cal-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; margin-bottom: 8px; }
.cal-title { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.cal-title b { color: var(--fg-strong); font-size: 15px; }
.cal-title span { color: var(--muted); font-size: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted-2); padding: 2px 0 4px; }
.cal-cell { aspect-ratio: 1; min-height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted);
    font: inherit; font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0; }
.cal-cell.is-empty { visibility: hidden; }
.cal-cell:disabled { cursor: default; opacity: 1; }
.cal-cell.is-today { border-color: var(--border-strong); color: var(--fg-strong); }
.cal-cell.has-session { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--fg-strong); font-weight: 700; cursor: pointer; }
.cal-cell.has-session.is-live { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.cal-cell.has-session:active { transform: scale(.94); }

/* ── Podsumowanie treningu ────────────────────────────────────── */
.summary-hero { text-align: center; padding: 8px 0 14px; }
.summary-emoji { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.summary-compare { margin-top: 12px; font-size: 14px; color: var(--muted); }
.summary-compare .up { color: var(--primary); }
.summary-compare .down { color: var(--warn); }
.summary-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.summary-ex { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.summary-sets { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.summary-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }

/* ── Zamiana ćwiczenia ─────────────────────────────────────────── */
.sheet-swap { max-height: 82dvh; display: flex; flex-direction: column; }
.swap-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; min-height: 60px; }
.swap-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; color: var(--fg); font: inherit; min-height: 56px; cursor: pointer; }
.swap-item b { display: block; color: var(--fg-strong); font-size: 15px; }
.swap-item em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.swap-item small { display: block; color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.swap-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.swap-item:active:not(:disabled) { background: var(--card-hover); }
.swap-item.is-current { opacity: .6; cursor: default; }
.swap-item.swap-back { margin-top: 10px; border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.swap-tag { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; flex: none; }
.swap-empty { color: var(--muted); font-size: 14px; padding: 14px 4px; }

/* ── Trening we dwoje: przełącznik osoby w pasku u góry ─────────── */
.who-seg { display: inline-flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.who-seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700;
    padding: 7px 14px; border-radius: 999px; min-height: 36px; cursor: pointer; }
.who-seg button.is-active { background: var(--primary); color: var(--primary-fg); cursor: default; }
@media (max-width: 360px) { .who-seg button { padding: 7px 10px; font-size: 13px; } }

/* ── Przypomnienia ─────────────────────────────────────────────── */
.rem-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.rem-days button { min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted);
    font: inherit; font-size: 13px; font-weight: 700; padding: 0; cursor: pointer; }
.rem-days button.is-active { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); color: var(--fg-strong); }
.rem-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.rem-row label { color: var(--muted); font-size: 14px; }
.rem-row .select { width: auto; min-width: 110px; }
.rem-device { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rem-on { color: var(--primary); font-weight: 700; font-size: 14px; margin-right: auto; }
.rem-hint { color: var(--muted); font-size: 13px; margin: 0; }
.reminder-card .btn-block svg { width: 16px; height: 16px; }

/* ── Postęp ćwiczeń na kafelkach i blokada „Dalej" ─────────────── */
.step-pill.is-partial { color: var(--warn); border-color: rgba(245,158,11,0.45); background: rgba(245,158,11,0.10); }
.step-pill.is-skipped { background: transparent; }
.step-pill.is-done.is-current, .step-pill.is-partial.is-current, .step-pill.is-skipped.is-current { box-shadow: 0 0 0 2px rgba(80,130,240,0.35); border-color: var(--chart-1); }
.btn.is-blocked { opacity: .45; filter: saturate(.5); }
.set-row.needs-input { animation: needs-input 1.2s ease; border-radius: 10px; }
@keyframes needs-input { 0%, 60% { background: rgba(245,158,11,0.18); box-shadow: 0 0 0 2px rgba(245,158,11,0.55); } 100% { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .set-row.needs-input { animation: none; box-shadow: 0 0 0 2px rgba(245,158,11,0.55); } }

/* ── Stagnacja, lżejszy tydzień, czas ─────────────────────────── */
.plateau { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--warn); }
.plateau .link-btn { min-height: 32px; padding: 4px 0; color: var(--warn); font-weight: 700; }
.deload-card { margin-top: 12px; border-color: rgba(80,130,240,0.45); background: color-mix(in srgb, var(--chart-1) 8%, var(--card)); }
.deload-title { font-weight: 800; color: var(--fg-strong); }
.deload-why { margin: 4px 0 6px; font-size: 14px; color: var(--fg); }
.deload-active { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 2px; font-size: 13px;
    color: var(--chart-1); font-weight: 600; }
.deload-active .link-btn { min-height: 32px; padding: 4px 0; }
.time-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; }
.time-row > span { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.time-row svg { width: 14px; height: 14px; }
.seg.seg-sm { flex: 1; min-width: 0; }
.seg.seg-sm button { font-size: 13px; padding: 6px 4px; min-height: 36px; }
.session-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.flag { font-size: 12px; font-weight: 700; color: var(--warn); background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.35);
    border-radius: 999px; padding: 3px 10px; }
.flag-deload { color: var(--chart-1); background: color-mix(in srgb, var(--chart-1) 10%, transparent); border-color: color-mix(in srgb, var(--chart-1) 40%, transparent); }
.session-flags .link-btn { min-height: 32px; padding: 4px 2px; }
.swap-item.is-static { cursor: default; background: transparent; }

/* ── Ocena ćwiczeń w podsumowaniu ──────────────────────────────── */
.summary-hint { margin: 14px 2px 0; font-size: 13px; color: var(--muted); }
.sum-effort { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.sum-effort button { min-height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted);
    font: inherit; font-size: 12px; font-weight: 700; padding: 0 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-effort button.is-active.e1 { color: #7dd3fc; border-color: rgba(125,211,252,0.5); background: rgba(125,211,252,0.10); }
.sum-effort button.is-active.e2 { color: var(--primary); border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.10); }
.sum-effort button.is-active.e3 { color: var(--warn); border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.10); }

/* ── Postęp: zakładki, rekordy, bilans ─────────────────────────── */
.progress-tabs { margin-bottom: 12px; }
.records { display: flex; flex-direction: column; gap: 10px; }
.rec-card { padding: 12px 14px; }
.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rec-new { flex: none; font-size: 12px; font-weight: 800; color: var(--warn); background: rgba(245,158,11,0.12); border-radius: 999px; padding: 3px 9px; }
.rec-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 14px; }
.rec-line span { color: var(--muted); }
.rec-line b { color: var(--fg-strong); text-align: right; font-variant-numeric: tabular-nums; }
.rec-line em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--muted-2); }
.rec-more { margin-top: 6px; font-size: 13px; }
.rec-more summary { cursor: pointer; color: var(--chart-1); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rec-chips span { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.rec-foot { margin-top: 8px; font-size: 12px; color: var(--muted-2); }
.bal-card { padding: 12px; }
.bal-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bal-row summary { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 2rem; align-items: center; gap: 8px; min-height: 36px;
    cursor: pointer; list-style: none; font-size: 13px; }
.bal-row summary::-webkit-details-marker { display: none; }
.bal-label { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-row.is-zero .bal-label, .bal-row.is-zero b { color: var(--muted-2); }
.bal-bar { height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bal-bar i { display: block; height: 100%; background: var(--chart-1); border-radius: inherit; }
.bal-row b { text-align: right; color: var(--fg-strong); font-variant-numeric: tabular-nums; }
.bal-ex { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 8px; font-size: 12px; color: var(--muted); }
.bal-ex span { background: var(--bg-elev); border-radius: 8px; padding: 3px 8px; }
.bal-hints { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--warn); }
.bal-ok { margin-top: 10px; font-size: 13px; color: var(--primary); }
.bal-prev { margin-top: 10px; font-size: 12px; color: var(--muted-2); }
.bal-prev b { color: var(--muted); }
@media (max-width: 360px) { .bal-row summary { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 1.8rem; } }

/* ── Ból ───────────────────────────────────────────────────────── */
.pain-warn { margin-top: 8px; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--warn);
    background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.35); }
.pain-warn .link-btn { color: var(--warn); font-weight: 700; min-height: 32px; padding: 4px 0; }
.pain-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pain-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pain-chips button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev);
    color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pain-chips button.is-active { color: var(--warn); border-color: rgba(245,158,11,0.6); background: rgba(245,158,11,0.12); }
.pain-label { font-size: 12px; color: var(--muted); margin-bottom: -4px; }
.week-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pain-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.pain-item b { display: block; color: var(--warn); }
.pain-item span { font-size: 13px; color: var(--muted); }
.pain-hist { margin-top: 8px; font-size: 13px; }
.pain-hist summary { cursor: pointer; color: var(--muted); min-height: 36px; display: flex; align-items: center; }
.pain-row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 2px 0; color: var(--muted); }
.pain-row em { font-style: normal; color: var(--primary); }
.pain-row .icon-btn { width: 36px; height: 36px; }

/* ── Zdjęcia ───────────────────────────────────────────────────── */
.photo-actions { display: flex; gap: 6px; }
.photo-day { margin-top: 10px; }
.photo-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.photo-row { display: flex; gap: 8px; overflow-x: auto; }
.photo-thumb { position: relative; flex: none; width: 84px; height: 112px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
    background: var(--bg-elev); padding: 0; cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); padding: 10px 6px 4px; text-align: left; }
.photo-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; padding: 12px; }
.photo-overlay-inner { width: 100%; max-width: 680px; max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.photo-big { width: 100%; max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 10px; }
.photo-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #e6eaf0; font-size: 14px; }
.btn-danger-ghost { color: var(--danger); background: transparent; border-color: rgba(239,68,68,0.4); }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-grid > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cmp-grid img { width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 8px; background: #111; }
.seg-radio { flex: 1; position: relative; display: flex; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; }
.seg-radio span { flex: 1; text-align: center; padding: 8px 6px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg-radio input:checked + span { background: var(--card-hover); color: var(--fg-strong); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--chart-1); }

/* ── Superserie: wspólna ramka i kolor pary ────────────────────── */
:root { --ss-1: hsl(275 70% 68%); --ss-2: hsl(190 75% 55%); --ss-3: hsl(330 75% 66%); --ss-4: hsl(45 85% 60%); }
.ss-group { flex-shrink: 0; display: inline-flex; gap: 4px; padding: 3px; border-radius: 13px; border: 1.5px solid var(--ss); background: color-mix(in srgb, var(--ss) 10%, transparent); }
.ss-group .step-pill { height: 30px; min-width: 34px; }
.ss-1 { --ss: var(--ss-1); } .ss-2 { --ss: var(--ss-2); } .ss-3 { --ss: var(--ss-3); } .ss-4 { --ss: var(--ss-4); }
.ss-tag { margin: 4px 0 2px; font-size: 12px; font-weight: 700; color: var(--ss); }
.step-strip { align-items: center; }

/* ── Edytor planu: przeciąganie ────────────────────────────────── */
.drag-handle { flex: none; width: 36px; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent;
    color: var(--muted-2); cursor: grab; touch-action: none; border-radius: 8px; padding: 0; }
.drag-handle svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.drag-handle:focus-visible { outline: 2px solid var(--chart-1); }
.edit-item.is-dragging { position: relative; z-index: 5; background: var(--card-hover); box-shadow: 0 10px 28px rgba(0,0,0,0.45); border-radius: 12px; transition: none; }
.edit-item { transition: background .15s; }
.edit-list { display: flex; flex-direction: column; }

/* ── Historia: filtr i porównanie ──────────────────────────────── */
.hist-filter { margin: 0 0 12px; }
.cmp-head .page-title { margin-bottom: 8px; }
.cmp-cols { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.cmp-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmp-col b { color: var(--fg-strong); }
.cmp-col span { font-size: 12px; color: var(--muted); }
.cmp-arrow { color: var(--muted-2); }
.cmp-total { margin-top: 8px; font-weight: 700; font-size: 14px; }
.cmp-total.up, .cmp-badge.up { color: var(--primary); }
.cmp-total.down, .cmp-badge.down { color: var(--warn); }
.cmp-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cmp-ex { padding: 10px 12px; }
.cmp-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cmp-badge { flex: none; font-size: 12px; font-weight: 800; color: var(--muted); }
.cmp-line { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 8px; font-size: 13px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.cmp-line > span { color: var(--muted-2); }
.cmp-line em { color: var(--muted-2); font-style: normal; }

/* ── „Dlaczego?", karta ćwiczenia, „⋯", podgląd czasu ─────────── */
.sugg-why-btn { min-height: 32px; padding: 2px 0; font-size: 12px; font-weight: 700; color: var(--chart-1); margin-left: auto; }
.sugg-why { flex-basis: 100%; font-size: 13px; color: var(--fg); line-height: 1.45; padding-top: 4px; }
.ex-name-btn { all: unset; cursor: pointer; display: inline; }
.ex-name-btn:focus-visible { outline: 2px solid var(--chart-1); border-radius: 4px; }
.ex-title .ex-name-btn { color: inherit; }
.sheet-card { max-height: 88dvh; }
.card-body { gap: 6px; }
.card-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; background: var(--bg-elev); border-radius: 10px; padding: 10px; }
.card-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.card-sec { margin-top: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }
.card-spark { width: 100%; height: 46px; }
.card-spark polyline { fill: none; stroke: var(--chart-1); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ex-more { margin-left: auto; }
.time-preview { margin: -4px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.time-preview b { color: var(--fg-strong); }

/* ── Kosz ─────────────────────────────────────────────────────── */
.trash-link { margin: 14px auto 0; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.trash-link svg { width: 15px; height: 15px; }
.trash-item { align-items: center; }
.trash-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* ── Profil: zwijane sekcje ───────────────────────────────────── */
.foldable .chart-title { cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; }
.foldable .chart-title::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -3px 0 0 auto; transition: transform .15s; }
.foldable.is-folded .chart-title::after { transform: rotate(-45deg); margin-top: 0; }
.foldable.is-folded > :not(.fold-keep) { display: none !important; }
.foldable.is-folded { padding-bottom: 14px; }
.foldable.is-folded .fold-keep { margin-bottom: 0; }

/* ── Panel: filtr, zaznaczanie, pasek zbiorczy ────────────────── */
.panel-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.panel-tools .select { flex: 1; min-width: 0; }
.panel-tools .btn { flex: none; min-height: 44px; }
.cat-item.is-selecting { grid-template-columns: auto 1fr; }
.cat-item.is-picked { border-color: color-mix(in srgb, var(--chart-1) 60%, var(--border)); background: color-mix(in srgb, var(--chart-1) 8%, var(--card)); }
.cat-check { display: flex; align-items: center; justify-content: center; width: 32px; min-height: 44px; }
.cat-check input { width: 20px; height: 20px; accent-color: var(--chart-1); }
.bulk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg-elev); border-top: 1px solid var(--border-strong);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px rgba(0,0,0,0.4); }
.bulk-inner { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.bulk-top { display: flex; align-items: center; gap: 12px; }
.bulk-top b { margin-right: auto; color: var(--fg-strong); }
.bulk-top .link-btn { min-height: 36px; padding: 4px 2px; }
body.has-bulk #main-panel { padding-bottom: 210px; }

/* ── Dodawanie ćwiczenia: filtry ──────────────────────────────── */
.lib-filters { margin: 8px 0; }
.lib-filters .select { min-width: 0; }
.edit-open { all: unset; cursor: pointer; display: block; min-width: 0; }
.edit-open:focus-visible { outline: 2px solid var(--chart-1); border-radius: 6px; }
.link-danger { color: var(--danger); display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 44px; }
.link-danger svg { width: 15px; height: 15px; }

/* ── Telefon: pasek treningu i licznik bez łamania ────────────── */
.session-bar { flex-wrap: wrap; row-gap: 6px; }
.session-bar .btn, .session-bar .elapsed { flex: none; white-space: nowrap; }
.session-bar .elapsed { margin-left: auto; }
.step-counter > span:not(.next-up) { white-space: nowrap; }
.step-counter .next-up { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 360px) { .session-bar .btn { padding-left: 10px; padding-right: 10px; } }
.bulk-top { flex-wrap: nowrap; white-space: nowrap; }
.bulk-inner .field-row { gap: 8px; }
.bulk-row { flex-direction: row; align-items: center; gap: 10px; }
.bulk-row .btn { min-height: 44px; flex: none; }
.bulk-count { flex: 1; text-align: center; color: var(--fg-strong); white-space: nowrap; }
body.has-bulk #main-panel { padding-bottom: 96px; }
.section-head .section-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ── Panel: zaznaczanie w kolorach aplikacji ──────────────────── */
.cat-item.is-selecting { grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.cat-item.is-selecting .cat-use { display: none; }
.cat-item.is-picked { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }
.pick-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
    color: var(--primary-fg); transition: background .12s, border-color .12s; cursor: pointer; }
.cat-item.is-picked .pick-dot { background: var(--primary); border-color: var(--primary); }
.pick-dot svg { width: 14px; height: 14px; stroke-width: 3; }
.time-row { flex-direction: column; align-items: stretch; gap: 6px; }
.time-row .seg { width: 100%; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-actions .detail-main { flex: 1 1 100%; }
.detail-actions > .btn:not(.detail-main) { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
/* zwinięta sekcja Profilu: same tytuły — przyciski („+ Dodaj”, „Porównaj”…) dopiero po rozwinięciu */
.foldable.is-folded .fold-keep .btn, .foldable.is-folded .fold-keep .photo-actions { display: none !important; }

/* ── Pasek tygodnia nad „Dziś" ─────────────────────────────────── */
.week-strip { margin-top: 12px; }
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin: 0 2px 6px; }
.wk-head b { color: var(--fg-strong); font-size: 13px; }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 4px 0;
    border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font: inherit; cursor: default; }
.wk-day span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.wk-day b { font-size: 16px; font-weight: 700; color: var(--fg); font-variant-numeric: tabular-nums; }
.wk-day:not(:disabled) { cursor: pointer; }
.wk-day.is-today { border-color: var(--chart-1); box-shadow: 0 0 0 1px var(--chart-1) inset; }
.wk-day.is-today span { color: var(--chart-1); }
.wk-day.is-done { background: color-mix(in srgb, var(--primary) 22%, var(--card)); border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.wk-day.is-done b, .wk-day.is-done span { color: var(--fg-strong); }
.wk-day.is-live { background: color-mix(in srgb, var(--warn) 20%, var(--card)); border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.wk-day.is-planned::after, .cal-cell.is-planned::after { content: ''; position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--primary); }
.wk-day.is-missed { opacity: .55; }
.wk-day.is-missed::after { content: ''; position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; border: 1px solid var(--muted); }
.cal-cell { position: relative; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.cal-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.cal-legend .lg:first-child { margin-left: 0; }
.cal-legend .lg-done { background: color-mix(in srgb, var(--primary) 35%, transparent); }
.cal-legend .lg-plan { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.cal-card .chart-title { margin-bottom: 6px; }
@media (max-width: 360px) { .wk-days { gap: 4px; } .wk-day { min-height: 48px; } .wk-day b { font-size: 15px; } }
.wk-day { padding-bottom: 9px; }
.wk-day.is-planned::after, .wk-day.is-missed::after { bottom: 4px; width: 4px; height: 4px; margin-left: -2px; }
@media (max-width: 360px) { .wk-day { min-height: 52px; } }

/* ── Pasek tygodnia: lżejszy (kółka zamiast kafelków) ──────────── */
.week-strip { margin: 16px 0 14px; padding: 12px 10px 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.wk-head { margin: 0 4px 10px; font-size: 13px; }
.wk-head span { color: var(--fg-strong); font-weight: 700; }
.wk-head em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 6px; }
.wk-head b { font-size: 12px; font-weight: 700; color: var(--primary); }
.wk-days { gap: 0; }
.wk-day, .wk-day.is-done, .wk-day.is-live, .wk-day.is-today { background: transparent; border: 0; box-shadow: none; min-height: 0; padding: 0 0 10px; gap: 6px; border-radius: 0; opacity: 1; }
.wk-day span { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted-2); }
.wk-day b { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--fg); transition: transform .1s; }
.wk-day.is-done b { background: var(--primary); color: var(--primary-fg); font-weight: 800; }
.wk-day.is-live b { background: var(--warn); color: #1a1002; font-weight: 800; }
.wk-day.is-today span { color: var(--chart-1); font-weight: 800; }
.wk-day.is-today b { box-shadow: 0 0 0 2px var(--chart-1); }
.wk-day.is-today.is-done b, .wk-day.is-today.is-live b { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--chart-1); }
.wk-day.is-done span { color: var(--fg); }
.wk-day:not(:disabled):active b { transform: scale(.92); }
.wk-day.is-planned::after, .wk-day.is-missed::after { bottom: 1px; width: 5px; height: 5px; margin-left: -2.5px; border: 0; }
.wk-day.is-planned::after { background: var(--primary); }
.wk-day.is-missed::after { background: var(--muted-2); }
.wk-day.is-missed b { color: var(--muted); }
.wk-day.is-madeup b { color: var(--muted); }
.wk-day.is-picked b { background: color-mix(in srgb, var(--chart-1) 24%, transparent); color: var(--fg-strong); }
.today-card.is-rest { border-color: var(--border); background: var(--card); }
.today-card.is-rest .today-label { color: var(--chart-1); }
.today-card.is-rest .today-sub { color: var(--fg); }
.today-meta { font-size: 13px; color: var(--muted); margin: -2px 0 6px; }
.rest-art { display: block; width: 100%; height: auto; max-height: 150px; margin: 4px 0 10px; color: var(--chart-1); }
.rest-art .fill { fill: currentColor; fill-opacity: .14; }
.rest-art .bg { fill: var(--card); }
.today-card.is-makeup { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--warn) 10%, transparent), transparent 60%), var(--card); }
.today-card.is-makeup .today-label { color: var(--warn); }
.cal-cell.is-loggable { cursor: pointer; }
@media (max-width: 360px) { .week-strip { padding: 10px 4px 6px; } .wk-day b { width: 32px; height: 32px; font-size: 14px; } .wk-day { min-height: 0; } }
.wk-set { display: block; margin: 0 auto; min-height: 36px; padding: 4px 8px; font-size: 13px; font-weight: 700; color: var(--primary); }
.reminder-card { transition: box-shadow .3s; }
.reminder-card.is-flash { box-shadow: 0 0 0 2px var(--primary); }

/* ── „?" przy propozycji ──────────────────────────────────────── */
.sugg-q { align-self: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--chart-1) 55%, var(--border));
    background: color-mix(in srgb, var(--chart-1) 12%, transparent); color: var(--chart-1); font: 800 12px/1 inherit; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer; position: relative; }
.sugg-q::before { content: ''; position: absolute; inset: -11px; } /* większe pole dotyku */
.sugg-q:active { transform: scale(.92); }
.why-text { margin: 4px 2px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 15px; line-height: 1.55; color: var(--fg); }

/* ── Dni treningowe: przełącznik przypomnień ──────────────────── */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); cursor: pointer; }
.switch-row b { display: block; color: var(--fg-strong); font-size: 15px; font-weight: 650; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--chart-1); outline-offset: 2px; }
.rem-opts { margin-top: 4px; }

/* ── Sekcje Profilu: strzałka zawsze przy prawej krawędzi, przyciski w środku ── */
.foldable .chart-title::after { content: none; }
.foldable > .fold-head { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    min-height: 44px; margin: -6px -6px 10px; padding: 6px; border-radius: 10px; }
.foldable.is-folded > .fold-head { margin-bottom: -6px; }
.foldable > .fold-head:active { background: var(--card-hover); }
.foldable > .fold-head::after { content: ''; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); margin: -5px 8px 0 auto; transition: transform .15s; }
.foldable.is-folded > .fold-head::after { transform: rotate(-45deg); margin-top: 0; }
.foldable > .chart-head.fold-head::after { align-self: flex-start; margin-top: 5px; }
.foldable.is-folded > .chart-head.fold-head::after { margin-top: 8px; }
.foldable > .fold-head:focus-visible { outline: 2px solid var(--chart-1); outline-offset: 4px; border-radius: 6px; }
.card-actions { display: flex; gap: 8px; margin: 10px 0 8px; }
.card-actions .btn { flex: 1; }

/* ── „?" (propozycja, czas): białe kółko przy prawej krawędzi; szczegóły w oknie ── */
.sugg { align-items: center; }
.info-q { flex: none; margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--fg-strong); background: transparent;
    color: var(--fg-strong); font: 800 13px/1 inherit; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; position: relative; }
.info-q::before { content: ''; position: absolute; inset: -10px; } /* większe pole dotyku */
.info-q:active { transform: scale(.92); }
.time-head { display: flex; align-items: center; gap: 10px; }
.form-section-q { display: flex; align-items: center; gap: 10px; }
/* ── Profil → Plany treningowe ── */
.pp-list { display: flex; flex-direction: column; margin-top: 4px; }
.pp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; background: none; border: 0; border-top: 1px solid var(--border);
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pp-item:first-child { border-top: 0; }
.pp-item .list-arrow { margin-left: auto; }
.pp-name { color: var(--fg-strong); font-size: 15px; font-weight: 650; }
.pp-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pp-card { margin-top: 4px; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pp-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.pp-value { color: var(--fg-strong); font-size: 15px; font-weight: 650; margin-top: 2px; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pp-day { margin-top: 10px; }
.pp-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pp-ex { margin: 10px 0 0; padding-left: 22px; font-size: 14px; color: var(--fg); }
.pp-ex li { padding: 3px 0; }
.pp-ex li span { display: inline; }
.pp-ex li small { color: var(--muted); margin-left: 6px; white-space: nowrap; }
.today-note { margin-top: 4px; color: var(--muted); font-size: 13px; }
.today-note.is-warn { color: var(--warn); }
.plan-chip.is-hidden { opacity: .6; border-style: dashed; }
.ss-field { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 12px; }
.ss-field .min0 { flex: 1; }
.ss-field b { display: block; color: var(--fg-strong); font-size: 14px; font-weight: 650; }
.ss-field small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-field .btn { flex: none; }
.form-section-q .info-q { width: 22px; height: 22px; font-size: 12px; letter-spacing: 0; text-transform: none; }
.why-body { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.why-lead { margin: 4px 2px 6px; font-size: 15px; font-weight: 700; color: var(--fg-strong); }
.why-body .why-text { margin: 4px 2px 0; }
.why-list { margin: 0 2px; padding-left: 20px; font-size: 15px; line-height: 1.6; color: var(--fg); }
.time-head > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
/* okno informacyjne („?”): mocne przyciemnienie reszty ekranu */
.sheet-backdrop.is-dim { background: rgba(0, 0, 0, 0.72); animation: dim-in .18s ease-out; }
@keyframes dim-in { from { background: rgba(0, 0, 0, 0.25); } }
