﻿
/* --- STREAK WIDGET --- */
.streak-widget {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: default;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .streak-widget {
        padding: 5px 10px;
        font-size: 0.85em;
    }
}

/* --- SE BODY --- */
.pts-toast {
    position: fixed; top: 76px; left: 50%; z-index: 9998;
    transform: translate(-50%, -12px); opacity: 0;
    transition: opacity .3s, transform .3s;
    display: flex; align-items: center; gap: 10px;
    background: var(--card); color: var(--text);
    border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow); padding: 8px 18px 8px 10px;
    pointer-events: none; white-space: nowrap;
}
.pts-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pts-toast-tx { display: flex; flex-direction: column; line-height: 1.2; }
.pts-toast-tx b { color: var(--brand); font-size: 1.15em; }
.pts-toast-lvl { font-weight: 700; color: var(--success); }
.pts-toast-note { font-size: 0.85em; color: var(--text-2); white-space: normal; max-width: 240px; }

/* --- SE BODY VE STATISTIKÁCH --- */
.ps-top { display: flex; align-items: center; gap: 14px; }
.ps-level {
    width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%;
    border: 5px solid var(--brand); display: grid; place-items: center;
    font-weight: 800; font-size: 1.3em; color: var(--brand);
}
.ps-total { font-size: 1.6em; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.ps-sub { font-size: 0.82em; color: var(--muted); }
.ps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; text-align: center; }
.ps-grid div { background: var(--surface-2); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; }
.ps-grid b { font-size: 1.15em; font-variant-numeric: tabular-nums; }
.ps-grid span { font-size: 0.78em; color: var(--muted); }
@media (max-width: 480px) { .ps-grid { grid-template-columns: repeat(2, 1fr); } }
.ps-chart-title { font-size: 0.78em; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.ps-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.ps-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.ps-bar i { display: block; width: 100%; max-width: 36px; background: var(--brand-light); border-radius: 6px 6px 2px 2px; }
.ps-bar.now i { background: var(--brand); }
.ps-bar-val { font-size: 0.78em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-bar-lbl { font-size: 0.78em; color: var(--muted-2); margin-top: 4px; white-space: nowrap; }
.ps-board { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.ps-board li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.ps-board li.me { background: var(--brand-bg); outline: 2px solid var(--brand); font-weight: 700; }
.ps-board .n { width: 28px; text-align: center; font-weight: 700; color: var(--muted); }
.ps-board .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-board .v { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.ps-hint { margin: 10px 0 0; font-size: 0.88em; }
.ps-repair-tag { font-size: 0.78em; font-weight: 600; color: var(--danger); white-space: nowrap; }
.ps-repair-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--danger-bg); color: var(--text-2); font-size: 0.82em; }
.ps-hint b { color: var(--brand); }
.ps-goal { margin-top: 12px; }
.ps-goal-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85em; }

/* --- LIGA --- */
.lg-head { display: flex; align-items: center; gap: 12px; }
.lg-status { display: flex; flex-direction: column; gap: 4px; }
.pp-intro[data-pp-intro="league"] { max-width: none; margin: 0 0 14px; }
.link-btn { background: none; border: none; box-shadow: none; padding: 0 2px; color: var(--brand); cursor: pointer; text-decoration: underline; font-size: inherit; }

/* --- DENNÍ ÚKOLY --- */
.dt-card {
    background: var(--card); color: var(--text);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 14px 16px; margin: 0 0 14px;
}
.dt-card.dt-all { border-color: var(--success); background: var(--success-bg); }
.dt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dt-title { font-weight: 800; font-size: 1.05em; }
.dt-count { font-weight: 700; font-size: 0.85em; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.dt-mult { font-size: 0.82em; color: var(--muted); margin-top: 2px; }
.dt-mult b { color: var(--accent-orange); }
.dt-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.dt-task { display: flex; align-items: center; gap: 10px; font-size: 0.92em; }
.dt-chk {
    width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
    border: 2px solid var(--border-strong); display: grid; place-items: center;
    font-size: 12px; font-weight: 800; color: #fff;
}
.dt-task.done .dt-chk { background: var(--success); border-color: var(--success); }
.dt-task.done .dt-tx { color: var(--muted); text-decoration: line-through; }
.dt-tx { flex: 1; }
.dt-pts { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .pts-toast { transition: none; transform: translate(-50%, 0); } }
.pts-level { margin-top: 6px; }
.pts-level-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92em; }
.pts-level-bar { height: 8px; border-radius: 4px; background: var(--surface-3); margin: 6px 0 2px; overflow: hidden; }
.pts-level-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

:root {
    --bg: #f4f6fb;
    --card: #fff;
    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --surface-2: #f9fafb;
    --surface-3: #f3f4f6;
    --shadow: 0 10px 30px rgba(0,0,0,.08);
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-bg: #eff6ff;
    --brand-light: #bfdbfe;
    /* Barva značky – odvozené tokeny (přejmenování/redesign = změna jen tady):
       --on-brand  text a ikony NA barvě značky (na žluté musí být tmavý!)
       --brand-hover tlačítko značky po najetí myší, --brand-soft jemný podklad,
       --brand-deep / --brand-ink tmavší text v odstínu značky, --brand-rgb pro průhlednost. */
    --on-brand: #fff;
    --on-brand-rgb: 255, 255, 255;
    --brand-hover: #1d4ed8;
    --brand-soft: #dbeafe;
    --brand-deep: #1e40af;
    --brand-ink: #1e3a8a;
    --brand-rgb: 37, 99, 235;
    --success: #16a34a;
    --success-dark: #166534;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --warning: #f59e0b;
    --warning-dark: #92400e;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --accent-orange: #ea580c;
    --accent-purple: #7c3aed;
    --accent-cyan: #0ea5e9;
    --accent-pink: #db2777;
    --bonus-bg: #f5f3ff;
    --y1-bg: #ecfeff;
    --y2-bg: #fdf2f8;
    --g0-bg: #fff7ed;

    /* Heatmapa aktivity (streak/kalendáře) – 6 stupňů objemu, málo -> hodně */
    --vol-0-bg: #f3f4f6; --vol-0-fg: #9ca3af;
    --vol-1-bg: #dcfce7; --vol-1-fg: #166534;
    --vol-2-bg: #bbf7d0; --vol-2-fg: #166534;
    --vol-3-bg: #4ade80; --vol-3-fg: #052e16;
    --vol-4-bg: #22c55e; --vol-4-fg: #fff;
    --vol-5-bg: #15803d; --vol-5-fg: #fff;
    /* Zachráněný den série: zmražení (modrá) / oprava za SE (oranžová) */
    --saved-freeze-bg: #dbeafe; --saved-freeze-fg: #1e40af;
    --saved-repair-bg: #ffedd5; --saved-repair-fg: #9a3412;
}

:root[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-2: #cbd5e1;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --border: #334155;
    --border-strong: #475569;
    --surface-2: #1e293b;
    --surface-3: #273449;
    --shadow: 0 10px 30px rgba(0,0,0,.4);
    --brand: #3b82f6;
    --brand-dark: #60a5fa;
    --brand-bg: rgba(59,130,246,.16);
    --brand-light: #1e3a5f;
    --on-brand: #fff;
    --on-brand-rgb: 255, 255, 255;
    --brand-hover: #1d4ed8;
    --brand-soft: #dbeafe;
    --brand-deep: #1e40af;
    --brand-ink: #1e3a8a;
    --brand-rgb: 37, 99, 235;
    --success: #22c55e;
    --success-dark: #4ade80;
    --success-bg: rgba(34,197,94,.16);
    --danger: #f87171;
    --danger-bg: rgba(248,113,113,.14);
    --danger-border: rgba(248,113,113,.35);
    --warning: #fbbf24;
    --warning-dark: #fcd34d;
    --warning-bg: rgba(251,191,36,.14);
    --warning-border: rgba(251,191,36,.35);
    --accent-orange: #fb923c;
    --accent-purple: #a78bfa;
    --accent-cyan: #38bdf8;
    --accent-pink: #f472b6;
    --bonus-bg: rgba(167,139,250,.16);
    --y1-bg: rgba(56,189,248,.16);
    --y2-bg: rgba(244,114,182,.16);
    --g0-bg: rgba(251,146,60,.16);

    --vol-0-bg: #1e293b; --vol-0-fg: #64748b;
    --vol-1-bg: #14532d; --vol-1-fg: #86efac;
    --vol-2-bg: #166534; --vol-2-fg: #bbf7d0;
    --vol-3-bg: #15803d; --vol-3-fg: #dcfce7;
    --vol-4-bg: #16a34a; --vol-4-fg: #f0fdf4;
    --vol-5-bg: #22c55e; --vol-5-fg: #052e16;
    --saved-freeze-bg: #1e3a8a; --saved-freeze-fg: #bfdbfe;
    --saved-repair-bg: #7c2d12; --saved-repair-fg: #fed7aa;
}

* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    /* Systémové písmo telefonu/počítače — čitelnější než Arial a nic se nestahuje. */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
}

.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

/* brand (logo + title) */
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--brand);
    color: var(--on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Logo s hlavou opice (img/logo-opice.svg) — dlaždici i rámeček má v sobě */
.logo.logo-opice {
    width: 40px;
    height: 40px;
    background: none;
    border-radius: 0;
    display: block;
    flex-shrink: 0;
}

.user-icon { display: inline-flex; line-height: 0; }

.title {
    font-weight: 700;
}

.subtitle {
    color: var(--muted);
    font-size: 13px;
}

/* brand clickable, but NOT looking like link */
.brand-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

    .brand-link:visited {
        color: inherit;
    }

    .brand-link:hover .logo {
        filter: brightness(1.03);
    }

    .brand-link:focus-visible {
        outline: 3px solid rgba(var(--brand-rgb), .25);
        outline-offset: 6px;
        border-radius: 14px;
    }

/* nav base */
.nav {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

    .nav a {
        text-decoration: none;
        color: var(--brand);
        font-weight: 700;
    }

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
}

@media (max-width:720px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow);
}

    .card h2 {
        margin: 0 0 8px;
        font-size: 18px;
    }

    .card p {
        margin: 0;
        color: var(--muted);
    }

.list {
    display: grid;
    gap: 10px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.badge {
    background: var(--brand-bg);
    color: var(--brand-dark);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

/* Placeholder za skrytou CZ/EN větu (★★★★★) — užší svislý padding než běžný
   .badge, jinak jeho výška přesahuje do řádku nad ním (ten má margin:0,
   viz .card p) a překrývá dolní přesahy písmen jako "j"/"y". */
.badge-hidden {
    background: var(--brand-bg);
    color: var(--brand-dark);
    padding: 1px 10px;
    border-radius: 999px;
    font-size: 13px;
    display: inline-block;
    line-height: 1.4;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,0,0,.08);
    -webkit-tap-highlight-color: transparent;
}

    button.primary {
        background: var(--brand);
        color: var(--on-brand);
    }

    button.secondary {
        background: var(--surface-3);
        color: var(--text);
    }

input, select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
}

small {
    color: var(--muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* ===== SETTINGS LAYOUT ===== */
.settings-card {
    max-width: 800px;
    margin: 20px auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .field label {
        font-weight: 600;
        font-size: 14px;
    }

.checkbox-field {
    justify-content: center;
}

.buttons-row {
    margin-top: 24px;
    gap: 12px;
}

/* Mobil */
@media (max-width: 720px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* --- NAV: dropdown groups --- */
.nav-dd {
    position: relative;
    display: inline-block;
}

    .nav-dd > summary {
        list-style: none;
        cursor: pointer;
        user-select: none;
        padding: 8px 10px;
        border-radius: 10px;
    }

        .nav-dd > summary::-webkit-details-marker {
            display: none;
        }

/* dropdown menu */
.nav-dd-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 50;
}

    .nav-dd-menu a {
        display: block;
        padding: 10px 10px;
        border-radius: 10px;
        text-decoration: none;
        color: inherit;
    }

        .nav-dd-menu a:hover {
            background: var(--surface-3);
        }

/* --- NAV: hamburger on small screens --- */
.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--border-strong);
    background: var(--card);
    color: var(--text);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav {
        display: none;
        width: 100%;
        margin-top: 10px;
        flex-direction: column;
        gap: 6px;
    }

        .nav.nav-open {
            display: flex;
        }

    .nav-dd {
        width: 100%;
    }

    .nav-dd-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-top: 6px;
    }

        .nav-dd-menu a {
            padding-left: 14px;
        }
}

/* --- NAV: primary action button (Studijní plán) --- */
.nav .nav-link.primary-nav {
    background: var(--brand);
    color: var(--on-brand);
    padding: 8px 16px;
    border-radius: 10px;
}

/* --- NAV unified blue links --- */
.nav .nav-link,
.nav-dd > summary.nav-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Bez tohohle prohlížeč po ťuknutí na mobilu navíc vykreslí vlastní
       poloprůhledný "tap highlight" přes tlačítko — složí se s modrou
       a vypadá to jako jiný odstín, i když background je stejná var(--brand). */
    -webkit-tap-highlight-color: transparent;
}

/* :hover jen na zařízeních se skutečnou myší — na dotykových displejích si
   prohlížeč po ťuknutí :hover "podrží" (chybí událost, co by ho zrušila),
   takže tlačítko vypadá pořád "stmavlé" i po puštění prstu. */
@media (hover: hover) {
    .nav .nav-link.primary-nav:hover {
        background: var(--brand-hover);
        color: var(--on-brand);
    }

    .nav .nav-link:hover,
    .nav-dd > summary.nav-link:hover {
        background: rgba(var(--brand-rgb), 0.10);
    }
}

/* caret (dropdown indicator) */
.nav-caret {
    font-size: 0.9em;
    transform: translateY(1px);
    opacity: 0.9;
}
/* when dropdown open: highlight + caret flips */
.nav-dd[open] > summary.nav-link {
    background: rgba(var(--brand-rgb), 0.12);
}

.nav-dd[open] .nav-caret {
    transform: translateY(1px) rotate(180deg);
}

/* Jednotný ukazatel aktivní stránky napříč všemi nav položkami — samotné
   podbarvení nestačilo, protože "Studijní plán" (.primary-nav) má trvale
   plné modré pozadí i mimo aktivní stav, takže vypadal aktivní pořád.
   Kontrastní spodní pruh je vidět stejně jasně na obou stylech tlačítek. */
.nav .nav-link.active,
.nav-dd > summary.nav-link.active {
    box-shadow: inset 0 -3px 0 0 var(--warning);
}

/* header layout */
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
}

.header-inner > * {
    min-width: 0;
}

/* user dropdown */
.user-dd {
    position: relative;
    display: inline-block;
}

.user-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text);
}

    .user-summary::-webkit-details-marker {
        display: none;
    }

/* Jméno nikdy nezalamovat na druhý řádek — když se nevejde, zkrátí se na "…".
   Šířka se přizpůsobuje obrazovce, aby se vešlo vedle loga a streaku. */
.user-summary {
    min-width: 0;
}

#userName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: clamp(80px, 34vw, 220px);
}

/* Šipka ukazuje, že jméno je rozbalovací nabídka (ikona opičky už tu není). */
.user-summary::after {
    content: "▾";
    flex-shrink: 0;
    font-size: 0.9em;
    color: var(--muted);
}

    .user-summary:hover {
        background: var(--surface-3);
    }

.user-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 160px;
    padding: 8px;
    z-index: 100;
}

/* Odznáček s počtem nepřečtených vedle "🔔 Notifikace" v nav menu */
.notif-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

    .user-dd-menu a {
        display: block;
        padding: 8px 10px;
        border-radius: 8px;
        text-decoration: none;
        color: var(--text);
    }

        .user-dd-menu a:hover {
            background: var(--surface-3);
        }

/* --- Training dropdown (only for Present/Past Simple) --- */
.train-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 200;
}

    .train-dd-menu a {
        display: block;
        padding: 10px 10px;
        border-radius: 10px;
        text-decoration: none;
        color: var(--text);
        font-weight: 600;
    }

        .train-dd-menu a:hover {
            background: var(--surface-3);
        }

/* --- Header spacing: tighter gap between brand row and nav --- */
.header .container {
    padding-top: 10px;
    padding-bottom: 10px;
}

.header .nav {
    margin-top: 4px;
}

/* --- Vocab pack layout --- */
.vocab-grid {
    display: grid;
    gap: 10px;
}

.vocab-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--border);
}

.vocab-cz {
    font-size: 16px;
}

.vocab-en {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
}

/* mobil: EN pod CZ */
@media (max-width: 640px) {
    .vocab-row {
        grid-template-columns: 1fr;
    }

    .vocab-en {
        text-align: left;
    }
    .brand .title,
    .brand .subtitle {
        display: none;
    }
}

.linklike {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
    text-align: left;
}

#brandToggle {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
    text-align: left;
}

/* Maskot (opice) — js/modular/ui/opice.js nastaví --opice-mobil/--opice-desktop
   inline přes style, ať každé použití může mít jinou velikost beze změny téhle
   sdílené třídy. Desktop je výchozí (stejná konvence jako zbytek souboru),
   pod 720px se přepne na mobilní rozměr. */
.opice-img {
    width: var(--opice-desktop, 180px);
    height: var(--opice-desktop, 180px);
    display: block;
    flex-shrink: 0;
}

/* Vycentruje opici uvnitř text-align:center kontejneru (display:block jinak
   zůstane přilepený vlevo). */
.opice-centrovana {
    margin: 0 auto;
}

@media (max-width: 720px) {
    .opice-img {
        width: var(--opice-mobil, 120px);
        height: var(--opice-mobil, 120px);
    }
}

/* Plovoucí tlačítko "nahlásit chybu ve větě" — js/modular/views/
   vocabSentenceTraining.js. Velikost jde přes --opice-mobil/desktop
   (opice.js), tlačítko samo jen obaluje kruhem + stínem. */
.se-report-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 300;
    border: none;
    border-radius: 50%;
    background: var(--card);
    box-shadow: var(--shadow);
    padding: 4px;
    cursor: pointer;
    display: flex;
}

.se-report-fab .opice-img {
    border-radius: 50%;
}

/* Režim výběru věty (klik na plovoucí tlačítko) — karty dostanou
   zvýraznění a kurzor lupy, aby bylo jasné, že klik teď znamená
   "tahle věta je špatně", ne normální akci. */
.se-pick-mode .card[data-sent-idx] {
    cursor: zoom-in;
}

.se-pick-mode .card[data-sent-idx]:hover {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ── Studijní plán: přepínač Cesta / Seznam + cesta (js/modular/ui/planPath.js) ── */
.plan-level-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.plan-view-toggle {
    display: inline-flex;
    background: var(--surface-3);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.plan-view-toggle button {
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}

.plan-view-toggle button.on {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.plan-path-head { margin-bottom: 4px; }

/* Cesta i mapa: zastávky jsou absolutně umístěné nad SVG silnicí */
.plan-path,
.pp-map {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.plan-path { margin-top: 8px; }

.pp-road {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.pp-road path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pp-road-base { stroke: var(--border); stroke-width: 22px; }
.pp-road-walked { stroke: var(--pp-color); stroke-width: 22px; opacity: .85; }
.pp-road-line { stroke: var(--card); stroke-width: 2.5px; stroke-dasharray: 7 10; opacity: .9; }
.pp-road-side-line { stroke: var(--border); stroke-width: 6px; stroke-dasharray: 2 12; }

.pp-map-road { position: absolute; inset: 0; pointer-events: none; }

.pp-block {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-2);
    background: var(--card);
    border: 2px solid var(--pp-color);
    border-radius: 999px;
    padding: 5px 14px;
    box-shadow: var(--shadow);
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pp-block:hover { background: var(--surface-2); }
.pp-block:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.pp-block-name { overflow: hidden; text-overflow: ellipsis; }
.pp-block-arrow { font-size: 1.1em; line-height: 1; }
.pp-block-count { color: var(--muted); font-weight: 700; letter-spacing: 0; }
.pp-block-here { color: var(--pp-color); letter-spacing: 0; text-transform: none; font-size: 1.1em; }

/* Zabalený blok: větší cedule přímo na silnici */
.pp-block.pp-block-closed {
    width: min(92%, 440px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 1px;
    padding: 9px 16px;
    border-radius: 16px;
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
    line-height: 1.3;
    text-align: left;
    color: var(--text);
}

.pp-block-closed .pp-block-name { overflow: visible; }
.pp-block-closed .pp-block-count { font-size: 0.9em; }
.pp-block-closed .pp-block-here { grid-column: 2 / 4; font-size: 0.86em; }
.pp-block.pp-block-done { border-color: var(--success); }
.pp-block.pp-block-done .pp-block-count { color: var(--success-dark); }

.pp-tools {
    max-width: 560px;
    margin: 10px auto 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pp-all:disabled { opacity: .45; cursor: default; }

.pp-all {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.84em;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    box-shadow: none;
}

.pp-node {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: var(--border);
    box-shadow: 0 4px 0 rgba(15, 23, 42, .14);
}

.pp-node:active { transform: translate(-50%, calc(-50% + 2px)); }
.pp-node:focus-visible,
.pp-station:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.pp-node-inner {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card);
    font-size: 25px;
    line-height: 1;
}

.pp-node.pp-new .pp-node-inner { filter: grayscale(.35); }
.pp-node.pp-done { background: var(--success); box-shadow: 0 4px 0 rgba(22, 101, 52, .45); }

/* Rozpracovaná lekce: kroužek vyplněný podle podílu hotových sekcí */
.pp-node.pp-partial { background: conic-gradient(var(--pp-color) calc(var(--pp-pct) * 1%), var(--border) 0); }

.pp-node.pp-big { width: 78px; height: 78px; background: var(--pp-color); }
.pp-node.pp-big.pp-partial { background: conic-gradient(var(--pp-color) calc(var(--pp-pct) * 1%), var(--border) 0); }
.pp-node.pp-big .pp-node-inner { inset: 6px; font-size: 32px; filter: none; }
.pp-node.pp-big { box-shadow: 0 0 0 7px color-mix(in srgb, var(--pp-color) 22%, transparent), 0 5px 0 rgba(15, 23, 42, .18); }

.pp-check {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--success);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    border: 2px solid var(--card);
}

.pp-flag {
    position: absolute;
    left: -6px;
    bottom: -4px;
    font-size: 17px;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3));
}

.pp-label {
    position: absolute;
    z-index: 1;
    transform: translateY(-50%);
    font-size: 0.86em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pp-label-new { color: var(--muted); font-weight: 500; }

.pp-walker {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -100%);
    pointer-events: none;
    scroll-margin: 160px;
}

.pp-walker .opice-img { display: block; filter: drop-shadow(0 3px 2px rgba(15, 23, 42, .25)); }

@media (prefers-reduced-motion: no-preference) {
    .pp-walker .opice-img { animation: pp-hop 1.8s ease-in-out infinite; }
}

@keyframes pp-hop {
    0%, 60%, 100% { translate: 0 0; }
    75% { translate: 0 -8px; }
}

.pp-bubble {
    position: absolute;
    z-index: 2;
    transform: translateY(-50%);
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--card);
    border: 2px solid var(--pp-color);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
    font-size: 0.88em;
    line-height: 1.3;
}

.pp-bubble-l { margin-left: auto; align-items: flex-end; text-align: right; }
.pp-bubble small { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 0.78em; }
.pp-bubble b { color: var(--text); }
.pp-go { margin-top: 6px; padding: 7px 14px; font-size: 0.95em; }

.pp-finished {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--success-bg);
    border-radius: 16px;
    padding: 12px 16px;
    margin-top: 10px;
}

.pp-finished div { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); font-size: 0.9em; }
.pp-finished b { color: var(--success-dark); font-size: 1.05em; }

/* Hlavička sekce/lekce ve stylu stanice z mapy */
.pp-hero {
    max-width: 560px;
    margin: 6px auto 0;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 4px 8px;
}

.pp-hero-station { position: relative; flex-shrink: 0; width: 84px; height: 84px; }
.pp-hero-station .pp-station-ico { font-size: 34px; }
.pp-hero-station .pp-check { top: 0; right: 0; width: 26px; height: 26px; font-size: 15px; }

.pp-hero-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-hero-text h2 { margin: 0; font-size: 1.3em; line-height: 1.2; text-wrap: balance; }
.pp-hero-eyebrow { font-size: 0.78em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pp-color); }
.pp-hero-sub { font-size: 0.84em; color: var(--muted); line-height: 1.35; }
.pp-hero-meta { font-size: 0.84em; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.pp-hero-text > div[style] { margin: 8px 0 0 !important; }

/* Úvodní box sekce (Cesta i Seznam) */
.pp-intro {
    max-width: 560px;
    margin: 12px auto 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--pp-color);
    border-radius: 12px;
    font-size: 0.86em;
    line-height: 1.45;
    color: var(--text-2);
}

.pp-intro summary {
    cursor: pointer;
    padding: 8px 14px;
    font-weight: 700;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pp-intro summary::-webkit-details-marker { display: none; }
.pp-intro summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.pp-intro:not([open]) summary::after { transform: rotate(-90deg); }
.pp-intro summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; }

/* 🔊 Předčítání rámečku (ui/readAloud.js) – vpravo v hlavičce, před šipkou */
.pp-intro-speak {
    margin-left: auto;
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 1.05em;
    line-height: 1;
    cursor: pointer;
}
.pp-intro-speak.is-playing { border-color: var(--pp-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-color) 25%, transparent); }
.pp-intro summary:has(.pp-intro-speak)::after { margin-left: 4px; }

.pp-intro ul {
    margin: 0;
    padding: 0 14px 10px 32px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pp-intro li::marker { color: var(--pp-color); }
.card .pp-intro { max-width: none; margin: 10px 0 0; }

/* Detail lekce: Teorie jako cedule na začátku cesty, zastávky s podtitulkem */
.pp-start { position: absolute; left: 50%; transform: translate(-50%, -50%); z-index: 2; }

.pp-theory {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    background: var(--card);
    border: 2px solid var(--pp-color);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.92em;
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.pp-theory span { font-weight: 600; font-size: 0.86em; color: var(--muted); }
.pp-theory.pp-theory-done { border-color: var(--success); }
.pp-theory.pp-theory-done span { color: var(--success-dark); }

.pp-label.pp-label-stop { display: flex; flex-direction: column; gap: 1px; -webkit-line-clamp: unset; }
.pp-label-stop small { font-size: 0.86em; font-weight: 500; color: var(--muted); }
.pp-bubble .pp-sub { color: var(--muted); font-size: 0.9em; }

/* ── Mapa sekcí (plan.js) ── */
.pp-map-card { padding: 12px 8px; overflow: hidden; }

.pp-station {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: 92px;
    height: 92px;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    cursor: pointer;
}

.pp-station-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--pp-color) calc(var(--pp-pct) * 1%), var(--border) 0);
    box-shadow: 0 0 0 6px var(--card), 0 6px 0 6px rgba(15, 23, 42, .08);
}

.pp-station-ico {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card);
    font-size: 36px;
    line-height: 1;
}

.pp-station .pp-check { top: 0; right: 0; width: 26px; height: 26px; font-size: 15px; }

.pp-station-label {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.25;
    font-size: 0.86em;
    color: var(--text);
    padding: 2px 4px;
}

/* G1: popisek vedle stanice, ať nezakrývá silnice vedoucí dolů do S1 a G2 */
.pp-station-label.pp-station-label-side {
    top: 50%;
    left: calc(100% + 16px);
    transform: translateY(-50%);
    width: 120px;
    align-items: flex-start;
    text-align: left;
}

.pp-station-label b { font-size: 1.15em; }
.pp-station-label small { color: var(--muted); margin-top: 2px; }

.pp-station-sm { width: 66px; height: 66px; }
.pp-station-sm .pp-station-ico { inset: 6px; font-size: 26px; }
/* G0 se S0 vpravo: popisek G0 vlevo, ať nepřekryje silnici do S0 */
.pp-station-label.pp-station-label-side.pp-station-label-left {
    left: auto;
    right: calc(100% + 16px);
    align-items: flex-end;
    text-align: right;
}
.pp-station-sm .pp-station-label { width: 100px; font-size: 0.8em; }

.pp-station:hover .pp-station-ring { filter: brightness(1.05); }
.pp-station:active { transform: translate(-50%, calc(-50% + 2px)); }

.pp-map-opice { position: absolute; z-index: 3; pointer-events: none; }

.pp-map-caption {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--card);
    padding: 2px 10px;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .pp-station-label { width: 130px; }
    .pp-station-sm .pp-station-label { width: 92px; }
    /* Popisek G0 vlevo od stanice se na úzkém displeji nesmí dostat za okraj mapy (karta má overflow:hidden).
       G0 leží na 42 % šířky mapy (plan.js), mapa je zhruba 100vw − 54 px široká; od středu stanice ubývá
       poloměr 46 px + mezera 16 px, přidat jde 8 px odsazení karty. Delší text se zalomí. */
    .pp-station-label.pp-station-label-side.pp-station-label-left {
        width: max(64px, calc(42vw - 77px));
        overflow-wrap: anywhere;
    }
}

/* ── Odznaky (Statistiky + oslava po tréninku) ── */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}

.badge-tile {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.badge-ico {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: var(--warning-bg);
}

.badge-name { font-size: 0.8em; font-weight: 700; line-height: 1.25; color: var(--text); }
.badge-tile.off .badge-ico { background: var(--surface-3); filter: grayscale(1); opacity: .55; }
.badge-tile.off .badge-name { color: var(--muted); }

.badge-bar { width: 100%; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.badge-bar i { display: block; height: 100%; background: var(--brand); }
.badge-prog { font-size: 0.78em; color: var(--muted); font-variant-numeric: tabular-nums; }

.badge-award {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--warning-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.badge-award-title { font-weight: 700; color: var(--warning-dark); }
.badge-award-row { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.badge-award-ico { font-size: 1.2em; }

/* ── Trénink vět ve stylu Cesty (js/modular/ui/trainingStage.js) ── */
.ts-stage {
    max-width: 560px;
    margin: 14px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ts-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 2px solid var(--pp-color);
    border-radius: 20px;
    padding: 18px 18px 18px 12px;
    box-shadow: var(--shadow);
    min-height: 150px;
}

.ts-opice { width: 92px; height: 92px; flex-shrink: 0; align-self: flex-end; }
.ts-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ts-lang { font-size: 0.78em; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ts-lang + .ts-cz, .ts-lang + .ts-en { margin-bottom: 8px; }
.ts-cz { font-size: 1.35em; font-weight: 700; line-height: 1.3; color: var(--text); text-wrap: balance; }
.ts-en { font-size: 1.25em; font-weight: 700; line-height: 1.3; color: var(--pp-color); text-wrap: balance; }
.ts-en.ts-en-hidden { color: var(--muted); font-weight: 500; font-size: 1em; font-style: italic; }

.ts-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 0 6px; }
.ts-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); transition: background .2s, transform .2s; }
.ts-dots span.done { background: var(--pp-color); }
.ts-dots span.now { background: var(--card); box-shadow: 0 0 0 3px var(--pp-color); transform: scale(1.15); }
.ts-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ts-bar span { display: block; height: 100%; width: 0; background: var(--pp-color); transition: width .3s; }

.ts-statusline { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 0.86em; color: var(--muted); font-variant-numeric: tabular-nums; }

.ts-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; }
.ts-controls button:disabled { display: none; }
.ts-controls .ts-main {
    order: 3;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    display: grid;
    place-items: center;
    background: var(--pp-color);
    border-color: var(--pp-color);
    box-shadow: 0 5px 0 rgba(15, 23, 42, .18);
}
.ts-controls .ts-main:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(15, 23, 42, .18); }
.ts-controls .ts-side { order: 1; width: 46px; height: 46px; border-radius: 50%; padding: 0; font-size: 18px; display: grid; place-items: center; }
.ts-controls [data-nav].ts-side { order: 5; }
.ts-lbl-restart { display: none; }
/* Pozastaveno: hlavní je Pokračovat, "Od začátku" jde jako malé tlačítko pod něj */
.ts-controls #btnResume:not(:disabled) ~ #btnPlay {
    order: 6;
    flex-basis: 100%;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--muted);
    font-size: 0.86em;
    font-weight: 600;
}
.ts-controls #btnResume:not(:disabled) ~ #btnPlay .ts-lbl-start { display: none; }
.ts-controls #btnResume:not(:disabled) ~ #btnPlay .ts-lbl-restart { display: inline; }

.ts-done {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--success-bg);
    border-radius: 16px;
    padding: 12px 16px;
}
.ts-done[hidden] { display: none; }
.ts-done > div { display: flex; flex-direction: column; gap: 3px; color: var(--text-2); font-size: 0.92em; }
.ts-done b#tsDoneTitle { color: var(--success-dark); font-size: 1.1em; }
.ts-done-btns { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }

.ts-all { max-width: 560px; margin: 18px auto 0; padding-bottom: 90px; }
.ts-all summary { cursor: pointer; font-weight: 700; color: var(--text-2); padding: 8px 4px; }
.ts-list { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.ts-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0; }
.ts-item.now { outline: 2px solid var(--pp-color, var(--brand)); }
.ts-num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 0.78em; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.ts-item-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ts-item-text small { color: var(--muted); }
.ts-type { font-size: 0.78em; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.ts-all .ts-item.now { outline-color: var(--brand); }

@media (max-width: 720px) {
    .ts-opice { width: 70px; height: 70px; }
    .ts-dots { gap: 4px; padding: 0; }
    .ts-dots span { width: 10px; height: 10px; }
    .ts-cz { font-size: 1.2em; }
    .ts-en { font-size: 1.1em; }
}
.ts-ipa { display: block; font-style: normal; font-weight: 500; font-size: 0.78em; color: var(--muted); margin-top: 2px; }
.ts-item-text .ts-ipa { display: inline; font-size: 1em; margin: 0; }
.ts-dots.ts-dots-many { gap: 3px; }
.ts-dots.ts-dots-many span { width: 8px; height: 8px; }

/* ── Checkpoint ve stylu Cesty (js/modular/ui/checkpointStage.js) ── */
.cp-steps { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.cp-steps div { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cp-steps span { font-size: 1.7em; line-height: 1.2; }
.cp-steps b { font-size: 0.92em; }
.cp-steps small { color: var(--muted); font-size: 0.78em; }

.cp-start { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-top: 6px; }
.cp-start small { color: var(--muted); font-size: 0.8em; max-width: 34ch; }
.cp-mic-btn {
    width: 84px; height: 84px; border-radius: 50%; padding: 0; font-size: 34px; line-height: 1;
    display: grid; place-items: center; margin-bottom: 4px;
    background: var(--pp-color); border-color: var(--pp-color);
    box-shadow: 0 6px 0 rgba(15, 23, 42, .18), 0 0 0 8px color-mix(in srgb, var(--pp-color) 18%, transparent);
}
.cp-mic-btn:active { transform: translateY(2px); }

.cp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.86em; color: var(--muted); }
.cp-count { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cp-lesson { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.cp-dots span.ok { background: var(--success); }
.cp-dots span.miss { background: var(--warning); }
.cp-dots span.now { background: var(--card); box-shadow: 0 0 0 3px var(--pp-color); }

.cp-card { transition: border-color .25s, background .25s; }
.cp-card.cp-ok { border-color: var(--success); background: var(--success-bg); }
.cp-card.cp-miss { border-color: var(--warning); background: var(--warning-bg); }
.cp-phase { margin-top: 8px; font-size: 0.9em; font-weight: 600; color: var(--muted); }
.cp-ok .cp-phase { color: var(--success-dark); }

/* Mikrofon s odpočtem: kroužek se vyprázdní za --cp-secs */
.cp-mic { position: relative; width: 92px; height: 92px; margin: 2px auto 0; display: grid; place-items: center; }
.cp-mic svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cp-ring-bg { fill: var(--card); stroke: var(--border); stroke-width: 6; }
.cp-ring { fill: none; stroke: var(--success); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 283; }
.cp-mic.on .cp-ring { stroke-dashoffset: 0; animation: cp-countdown var(--cp-secs, 5s) linear forwards; }
@keyframes cp-countdown { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 283; } }
.cp-mic-ico { position: relative; font-size: 30px; line-height: 1; opacity: .35; filter: grayscale(1); transition: opacity .2s; }
.cp-mic.on .cp-mic-ico { opacity: 1; filter: none; }
.cp-timer { position: absolute; bottom: 12px; font-size: 0.78em; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-mic.on { animation: cp-pulse 1.2s ease-in-out infinite; border-radius: 50%; }
@keyframes cp-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 35%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--success) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .cp-mic.on { animation: none; } }

.cp-heard { min-height: 52px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; text-align: center; }
.cp-heard small { display: block; font-size: 0.78em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cp-heard div { font-weight: 600; color: var(--text); min-height: 1.3em; }
.cp-stop { align-self: center; background: none; border: none; box-shadow: none; color: var(--muted); font-size: 0.84em; text-decoration: underline; cursor: pointer; padding: 4px 8px; }

.cp-score { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 4px; }
.cp-score-ring {
    width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--pp-color) calc(var(--pp-pct) * 1%), var(--border) 0);
    display: grid; place-items: center;
}
.cp-score-ring span { width: 104px; height: 104px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cp-score-ring b { font-size: 1.7em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cp-score-ring small { color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-verdict { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.cp-verdict b { font-size: 1.3em; }
.cp-verdict span { color: var(--text-2); font-size: 0.92em; }
.cp-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cp-list { display: flex; flex-direction: column; gap: 6px; }
.cp-list summary { cursor: pointer; font-weight: 700; color: var(--text-2); padding: 6px 2px; }
.label-sm { font-size: 0.78em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cp-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--warning); }
.cp-row.ok { border-left-color: var(--success); }
.cp-row + .cp-row { margin-top: 6px; }
.cp-row-n { font-size: 0.78em; font-weight: 700; color: var(--muted); min-width: 18px; }
.cp-row-cz { font-size: 0.86em; color: var(--muted); }
.cp-row-en { font-weight: 700; }
.cp-row-heard { font-size: 0.82em; color: var(--muted); }

@media (max-width: 720px) {
    .cp-score-ring { width: 112px; height: 112px; }
    .cp-score-ring span { width: 90px; height: 90px; }
}

/* Admin Přehledy: klikací řádek vede na kartu (ui/dataTable.js, rowHref) */
/* Tabulka má vlastní rolovací okno vysoké jako obrazovka — vodorovný posuvník je
   tak vždy vidět dole (ne až na konci dlouhých dat), záhlaví s filtry zůstává nahoře. */
.dt-scroll { overflow: auto; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
.dt-sticky-head { position: sticky; top: 0; z-index: 1; background: var(--card); }
.dt-link-row:hover { background: var(--surface-2); }
.dt-link-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Správa (admin.js): "Co potřebuje pozornost" a dlaždice nástrojů */
.adm-attn-grid, .adm-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.adm-attn { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; border-left: 4px solid var(--border-strong); background: var(--surface-2); color: var(--text); text-decoration: none; }
.adm-attn-bad { border-left-color: var(--danger); background: var(--danger-bg); }
.adm-attn-warn { border-left-color: var(--warning); background: var(--warning-bg); }
.adm-attn-info { border-left-color: var(--brand); background: var(--brand-bg); }
.adm-attn-n { font-size: 1.6em; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adm-attn-t { font-weight: 700; font-size: 0.9em; }
.adm-attn-d { font-size: 0.8em; color: var(--muted); }
a.adm-attn:hover, .adm-tool:hover { filter: brightness(0.97); }
.adm-attn-ok { color: var(--success-dark); font-weight: 600; }
.adm-tool { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9em; cursor: pointer; text-align: left; }
.adm-tool .notif-badge { margin-left: auto; }
.adm-tool-danger { color: var(--danger); }
.adm-settings > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }

/* Záložky detailu třídy (učitel) */
.cd-tabs { display: flex; gap: 4px; margin: 14px 0; border-bottom: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab { flex: 0 0 auto; background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; margin-bottom: -2px; box-shadow: none; padding: 10px 16px; font-size: 15px; font-weight: 600; }
.cd-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.cd-tab:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
@media (hover: hover) { .cd-tab:hover { color: var(--text); } }
.cd-panel { display: grid; gap: 14px; }
.cd-panel[hidden] { display: none; }

/* Karta "Potřebují pozornost" v detailu třídy */
.ca-card { border-left: 4px solid var(--warning); }
.ca-card.ca-ok { border-left-color: var(--success); color: var(--text-2); font-weight: 600; }
.ca-group { padding: 10px 0; border-top: 1px solid var(--surface-3); }
.ca-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ca-title { font-weight: 700; }
.ca-count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: var(--warning-bg); color: var(--warning-dark); font-size: 0.85em; text-align: center; }
.ca-remind { font-size: 0.85em; padding: 6px 12px; }
.ca-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ca-name { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.85em; }
.ca-name small { margin-left: 4px; }
.ca-more { color: var(--muted); }

/* Pozvánka do třídy (učitel) a připojení kódem (žák) */
.ci-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ci-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.4em; font-weight: 800; letter-spacing: .12em; padding: 6px 14px; border-radius: 10px; background: var(--brand-bg); color: var(--brand-dark); }
.ci-code-big { display: inline-block; font-size: 2.2em; margin-top: 4px; }
.ci-link { flex: 1; min-width: 200px; font-size: 0.88em; color: var(--muted); }
.ci-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.jc-card { max-width: 520px; margin: 40px auto; text-align: center; padding: 32px; }
.jc-card p { margin: 0 0 16px; }
.jc-form { margin-top: 8px; text-align: left; }
.jc-label { display: block; font-weight: 600; margin-bottom: 6px; }
.jc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.jc-row input { flex: 1; min-width: 140px; font-size: 1.1em; letter-spacing: .1em; text-transform: uppercase; }
.jc-err { color: var(--danger); font-size: 0.88em; margin: 8px 0 0; }
.jc-login-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--brand-bg); color: var(--brand-dark); font-size: 0.92em; font-weight: 600; }

/* Učitelská tabulka žáků (detail třídy) */
.st-tools { padding: 12px 20px 4px; }
.st-search { width: 100%; max-width: 320px; box-sizing: border-box; }
.st-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.st-table th { padding: 8px 10px; text-align: center; background: var(--surface-2); border-bottom: 2px solid var(--border); white-space: nowrap; }
.st-table th.st-name-col { text-align: left; padding-left: 20px; }
.st-table td { padding: 10px; text-align: center; border-bottom: 1px solid var(--surface-3); font-variant-numeric: tabular-nums; }
.st-table td.st-name-col { text-align: left; padding-left: 20px; }
.st-table tr[hidden] { display: none; }
.st-sort { background: none; box-shadow: none; padding: 4px 2px; border-radius: 6px; font-size: 0.95em; font-weight: 600; color: var(--muted); white-space: nowrap; }
th[aria-sort="ascending"] .st-sort, th[aria-sort="descending"] .st-sort { color: var(--brand); }
.st-sort:focus-visible, .st-menu-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.st-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-name-tx { display: flex; flex-direction: column; min-width: 0; }
.st-name-main { font-weight: 600; color: var(--text); }
.st-nick { font-size: 0.8em; color: var(--muted); }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.st-dot.st-ok { background: var(--success); }
.st-dot.st-fading { background: var(--warning); }
.st-dot.st-off { background: var(--danger); }
.st-last.st-ok { color: var(--success); }
.st-last.st-fading { color: var(--warning-dark); }
.st-last.st-off { color: var(--danger); }
.st-link { cursor: pointer; font-weight: 600; text-decoration: underline dotted var(--muted-2); }
.st-cp-weak { color: var(--warning-dark); }
.st-dash { color: var(--muted-2); }
.st-lvl { display: block; font-size: 0.78em; }
.st-menu-col { width: 1%; padding-right: 14px; }
.st-menu-btn { background: var(--surface-3); color: var(--text); box-shadow: none; padding: 4px 12px; font-size: 1.1em; line-height: 1; border-radius: 8px; }
@media (hover: hover) { .st-menu-btn:hover { background: var(--border); } .st-table tbody tr:hover { background: var(--surface-2); } }
.st-nomatch { margin: 0; padding: 20px; text-align: center; color: var(--muted); }

/* Na úzkém displeji místo tabulky karty žáků */
@media (max-width: 720px) {
    .st-table thead { display: none; }
    .st-table, .st-table tbody { display: block; }
    .st-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: relative; }
    .st-table td { display: flex; justify-content: space-between; gap: 8px; padding: 0; border: 0; text-align: right; }
    .st-table td::before { content: attr(data-label); color: var(--muted); font-size: 0.85em; text-align: left; }
    .st-table td.st-name-col { grid-column: 1 / -1; padding: 0 44px 4px 0; }
    .st-table td.st-name-col::before, .st-table td.st-menu-col::before { content: none; }
    .st-table td.st-menu-col { position: absolute; top: 10px; right: 12px; width: auto; padding: 0; }
    .st-lvl { display: inline; margin-left: 4px; }
}

/* Stav třídy na kartě v seznamu tříd */
.cc-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 0.8em; }
.cc-pill { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.cc-pill.cc-ok { background: var(--success-bg, var(--surface-2)); }
.cc-pill.cc-off { color: var(--danger); }
.cc-pill.cc-warn { background: var(--warning-bg); color: var(--warning-dark); font-weight: 600; }
.cc-muted { color: var(--muted-2); }

/* Vystavení platby jednomu žákovi (záložka Výběr od žáků) */
.cc-issue > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

/* Předplatné žáků (učitel, třída kde platí každý žák sám) */
.sub-st { white-space: nowrap; font-size: 0.88em; }
.sub-st .sub-tx { white-space: normal; }
.sub-ok { color: var(--success-dark, var(--success)); }
.sub-warn { color: var(--warning-dark); }
.sub-bad { color: var(--danger); font-weight: 600; }
.sub-none { color: var(--muted); }
.st-sub-cell { text-align: left; min-width: 140px; }
.sub-list { margin-top: 12px; border-top: 1px solid var(--surface-3); }
.sub-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--surface-3); }
.sub-who small { color: var(--muted); margin-left: 4px; }
.st-sub-cell .sub-payer { display: block; font-size: 0.85em; white-space: nowrap; }
.st-sub-cell .sub-st { display: block; margin-top: 2px; }
@media (max-width: 720px) { .st-sub-cell .sub-payer, .st-sub-cell .sub-st { display: inline; margin-left: 6px; } }

/* Spodní lišta pro žáka na mobilu (bod 6.1). Na širokém displeji zůstává
   horní navigace, lišta se nezobrazí. */
.tabbar { display: none !important; }
@media (max-width: 860px) {
    body.has-tabbar .tabbar {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
        background: var(--card);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(0,0,0,.08);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .tab-link {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 58px; padding: 6px 2px;
        color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }
    .tab-link .tab-ic { font-size: 22px; line-height: 1; filter: grayscale(0.6); opacity: .75; position: relative; }
    .tab-link .tab-badge { position: absolute; top: -4px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; box-sizing: border-box; filter: none; }
    .tab-link.active { color: var(--brand); }
    .tab-link.active .tab-ic { filter: none; opacity: 1; transform: translateY(-1px); }
    .tab-link:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
    /* Místo dole, ať lišta nepřekryje konec stránky ani plovoucí prvky. */
    body.has-tabbar main.container { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
    body.has-tabbar .se-report-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* Statistiky žáka — jedno hlavní číslo (bod 6.5) */
.stats-hero-num { font-size: 2.6em; font-weight: 800; line-height: 1.1; color: var(--brand); margin-top: 10px; font-variant-numeric: tabular-nums; }
.stats-hero-label { font-size: 0.9em; color: var(--muted); }

/* Checkpoint — slova, která aplikace od žáka neslyšela (bod 6.6) */
.cp-w-miss { background: var(--danger-bg); color: var(--danger); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.cp-row-alt { color: var(--muted); font-size: 0.9em; }
.cp-miss-hint { margin: 2px 0 8px; font-size: 0.85em; color: var(--muted); }

/* Interaktivní průvodce pro nového žáka (bod 2.3) */
.tour-root { position: fixed; inset: 0; z-index: 9500; pointer-events: none; }
.tour-block { position: fixed; pointer-events: auto; background: transparent; }
.tour-ring { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .62), 0 0 0 3px var(--brand); pointer-events: none; transition: all .2s; }
.tour-bubble { position: fixed; pointer-events: auto; background: var(--card); color: var(--text); border-radius: 16px; box-shadow: 0 12px 36px rgba(0,0,0,.3); padding: 14px; }
.tour-bubble-in { display: flex; gap: 10px; align-items: flex-start; }
.tour-tx { flex: 1; min-width: 0; font-size: 0.95em; line-height: 1.45; }
.tour-title { font-weight: 800; margin-bottom: 4px; }
.tour-count { font-weight: 600; color: var(--muted); font-size: 0.8em; margin-left: 4px; }
.tour-skip { display: inline-block; margin-top: 8px; font-size: 0.85em; color: var(--muted); }
.tour-done, .tour-paused { inset: auto 0 0 0; }
.tour-bubble-top { top: 12px; left: 12px; right: 12px; max-width: 420px; margin: 0 auto; }
.tour-ok { margin-top: 10px; }
.cp-tip-list { margin: 4px 0 0; padding-left: 18px; }
.cp-tip-list li { margin: 3px 0; }
.tour-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--card); box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; font-weight: 600; }
.tour-pill button { padding: 6px 12px; font-size: 0.85em; }

/* Výběr cíle a karta cíle na Plánu */
.goal-label { font-size: 0.85em; font-weight: 700; color: var(--text-2); margin: 10px 0 6px; }
.goal-label:first-child { margin-top: 0; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-chip { padding: 7px 12px; font-size: 0.9em; background: var(--surface-2); color: var(--text); border: 2px solid transparent; box-shadow: none; border-radius: 999px; }
.goal-chip.active { border-color: var(--brand); background: var(--brand-bg); font-weight: 700; }
.goal-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.9em; color: var(--text-2); }
.goal-custom[hidden] { display: none; }
.goal-custom input { width: 100px; }
.goal-summary { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 0.9em; color: var(--text-2); }
.goal-prev { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--brand-bg); border: 1px solid var(--border); font-size: 0.92em; }
.goal-prev-dates { color: var(--muted); font-size: 0.9em; }
.goal-prev-q { margin-top: 4px; color: var(--text-2); }
.goal-prev-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.goal-prev-act button { font-size: 0.85em; padding: 6px 12px; }
.goal-card { margin: 12px 0; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.goal-card.goal-reached { border-color: var(--success); background: var(--success-bg); }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-title { font-weight: 700; }
.goal-nums { font-size: 0.95em; color: var(--muted); }
.goal-nums b { font-size: 1.3em; color: var(--text); }
.goal-edit { font-size: 0.8em; padding: 5px 10px; box-shadow: none; }
.goal-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); margin: 10px 0 8px; overflow: visible; }
.goal-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.goal-reached .goal-bar > i { background: var(--success); }
.goal-mark { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; background: var(--text-2); transform: translateX(-50%); }
.goal-status { font-size: 0.88em; color: var(--text-2); }

/* --- PRUH DNES (cíl + denní úkoly na Plánu) --- */
.today-bar { margin: 12px 0 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.today-bar.tb-reached, .today-bar.tb-alldone { border-color: var(--success); background: var(--success-bg); }
.tb-sum { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; font-size: 0.92em; user-select: none; }
.tb-sum::-webkit-details-marker { display: none; }
.tb-goal { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tb-goal b { font-size: 1.1em; }
.tb-behind .tb-goal b { color: var(--accent-orange); }
.tb-bar { flex: 1; min-width: 36px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tb-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.tb-reached .tb-bar > i { background: var(--success); }
.tb-tasks { white-space: nowrap; color: var(--text-2); }
.tb-tasks:empty { display: none; }
.tb-tasks b { color: var(--accent-orange); }
.tb-alldone .tb-tasks { color: var(--success-dark); font-weight: 700; }
.tb-chev { color: var(--muted); transition: transform .2s; }
.today-bar[open] .tb-chev { transform: rotate(180deg); }
.tb-body { padding: 0 10px 10px; }
.tb-body .goal-card, .tb-body .dt-card { margin: 0 0 10px; box-shadow: none; }
.tb-body > div:last-child .dt-card { margin-bottom: 0; }
@media (max-width: 420px) { .tb-sum { gap: 8px; padding: 10px 12px; font-size: 0.88em; } }

/* --- NÁKUP DNE DO SÉRIE (detail dne ve Statistikách) --- */
.repair-day { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--saved-repair-bg); border: 1px solid var(--border); font-size: 0.9em; }
.repair-day-title { font-weight: 700; margin-bottom: 4px; }
.repair-day-text { color: var(--text); }
.repair-day-note { color: var(--muted); font-size: 0.88em; margin-top: 6px; }
.repair-day button { width: 100%; margin-top: 10px; }

/* --- LIGA: MINULÉ TÝDNY --- */
.lg-weeks { display: grid; gap: 6px; }
.lg-week { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lg-week > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 0.92em; }
.lg-week > summary::-webkit-details-marker { display: none; }
.lg-week > summary::after { content: "⌄"; color: var(--muted); transition: transform .2s; }
.lg-week[open] > summary::after { transform: rotate(180deg); }
.lg-week-n { width: 26px; text-align: center; font-weight: 700; }
.lg-week-t { flex: 1; min-width: 0; font-weight: 600; }
.lg-week-t small { color: var(--muted); font-weight: 400; }
.lg-week-me { color: var(--text-2); font-size: 0.9em; white-space: nowrap; }
.lg-week-body { padding: 0 10px 10px; }
.lg-week-body .ps-board { margin-top: 0; }
.lg-week-load { color: var(--muted); font-size: 0.9em; margin: 4px 2px; }
@media (max-width: 420px) { .lg-week > summary { flex-wrap: wrap; } .lg-week-me { width: 100%; padding-left: 36px; } }

/* --- SOUHRN "HOTOVO!" PO CVIČENÍ (ui/sessionSummary.js) --- */
.ss-overlay { position: fixed; inset: 0; z-index: 9600; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ss-fade .2s ease-out; }
.ss-card { position: relative; width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; background: var(--card); color: var(--text); border-radius: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); padding: 22px 18px 18px; text-align: center; animation: ss-pop .3s cubic-bezier(.2,1.4,.4,1); }
.ss-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); border: none; box-shadow: none; font-size: 1.05em; line-height: 1; }
.ss-close:hover { color: var(--text); background: var(--surface-3); }
.ss-title { margin: 8px 0 2px; font-size: 1.6em; font-weight: 800; color: var(--accent-orange); }
.ss-sub { margin: 0 0 4px; color: var(--muted); font-size: .92em; }
.ss-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; }
.ss-tile { border: 2px solid var(--t); border-radius: 14px; overflow: hidden; background: var(--card); }
.ss-tile-l { background: var(--t); color: #fff; font-size: .68em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 2px; }
.ss-tile-v { font-size: 1.25em; font-weight: 800; color: var(--t); padding: 10px 2px 2px; white-space: nowrap; }
.ss-tile-s { font-size: .72em; color: var(--muted); padding: 0 4px 8px; }
.ss-tile-v:last-child { padding-bottom: 12px; }
.ss-se { --t: var(--warning); }
.ss-mid { --t: var(--success); }
.ss-time { --t: var(--accent-cyan); }
.ss-wait { opacity: .55; animation: ss-blink 1s ease-in-out infinite; }
.ss-lines { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; display: grid; gap: 6px; font-size: .9em; }
.ss-lines li { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.ss-gbar { display: inline-block; vertical-align: middle; width: 60px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 0 4px; }
.ss-gbar i { display: block; height: 100%; background: var(--brand); }
.ss-gnote { color: var(--muted); font-size: .9em; }
.ss-plus { color: var(--brand); font-weight: 800; }
.ss-btns { display: grid; gap: 8px; margin-top: 16px; }
.ss-btns button { width: 100%; padding: 12px; font-size: 1em; }
@keyframes ss-fade { from { opacity: 0; } }
@keyframes ss-pop { from { transform: scale(.9); opacity: 0; } }
@keyframes ss-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ss-overlay, .ss-card, .ss-wait { animation: none; } }
@media (max-width: 380px) { .ss-tile-v { font-size: 1.05em; } }

/* --- 📖 PŘÍBĚH (views/story.js) --- */
.sy-log { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; }
.sy-whole { max-height: 60vh; }
.sy-intro { margin: 0; color: var(--muted); font-size: 0.9em; text-align: center; padding: 8px 12px; }
.sy-line { animation: sy-in .25s ease-out; }
.sy-narr { color: var(--text-2); font-size: 0.98em; padding: 2px 6px; }
.sy-narr > span { font-style: italic; }
.sy-say { display: flex; align-items: flex-end; gap: 6px; }
.sy-say.sy-right { flex-direction: row-reverse; }
.sy-say.sy-center { justify-content: center; }
.sy-say.sy-center .sy-bubble { border-style: dashed; background: var(--surface-2); text-align: center; }
.sy-who { font-size: 1.5em; line-height: 1; flex-shrink: 0; }
.sy-bubble { max-width: 78%; background: var(--card); border: 2px solid var(--pp-color, var(--brand)); border-radius: 16px; padding: 7px 12px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--shadow); }
.sy-left .sy-bubble { border-bottom-left-radius: 4px; }
.sy-right .sy-bubble { border-bottom-right-radius: 4px; background: var(--brand-bg); }
.sy-name { font-size: 0.72em; color: var(--muted); font-weight: 800; letter-spacing: .03em; }
.sy-bubble > span { font-weight: 600; }
.sy-cz { display: block; color: var(--muted); font-size: 0.85em; margin-top: 2px; }
.sy-now { min-height: 130px; }
@keyframes sy-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .sy-line { animation: none; } }
/* Odbočka na mapě lekce (planPath.js renderStopsPath) */
.pp-node.pp-branch { width: 54px; height: 54px; font-size: 22px; }
.pp-label-branch { position: absolute; transform: none; max-width: 34%; font-size: 0.82em; line-height: 1.25; display: flex; flex-direction: column; }
.pp-road-side-line.pp-road-side-done { stroke: var(--pp-color); stroke-width: 7px; stroke-dasharray: 2 10; opacity: .9; }
.pp-label-branch small { color: var(--muted); font-size: 0.85em; }

/* ── Výzvy (souboje 2–8 hráčů) ─────────────────────────────────────────── */
.ch-h { margin: 14px 0 6px; }
.ch-card { cursor: pointer; }
.ch-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ch-main { flex: 1; min-width: 200px; }
.ch-title { font-weight: 700; }
.ch-sub { color: var(--muted); font-size: 0.88em; margin-top: 2px; }
.ch-sub b { color: var(--text); font-variant-numeric: tabular-nums; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.72em; font-weight: 700; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.ch-tag.ch-running { background: var(--success-bg); color: var(--success); }
.ch-tag.ch-scheduled { background: var(--brand-bg); color: var(--brand); }
.ch-tag.ch-finalizing, .ch-tag.ch-due { background: var(--danger-bg); color: var(--text-2); }
.ch-pos { color: var(--success); }
.ch-neg { color: var(--danger); font-weight: 700; }
.ch-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--brand-bg); color: var(--text-2); font-size: 0.9em; }
.ch-result.good { border: 2px solid var(--success); background: var(--success-bg); }
.ch-result.bad { border: 2px solid var(--danger); background: var(--danger-bg); }
.ps-board li.ch-off { opacity: 0.65; }
.ch-lbl { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 0.9em; }
.ch-found { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; min-height: 8px; }
.ch-hit { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--brand); background: var(--surface-2); color: var(--text); cursor: pointer; }
.ch-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ch-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--brand-bg); color: var(--brand); font-weight: 700; }
.ch-chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 1em; padding: 0 4px; }
.ch-radio { display: flex; gap: 16px; }
.ch-warn { margin: 14px 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--danger-bg); color: var(--text-2); font-size: 0.85em; }
.ch-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.ch-link small { color: var(--muted); }
.ch-link-ic { font-size: 1.6em; }
