/* Společný vzhled aplikace (Bootstrap 5) */
:root {
    --app-bg: #f4f6fa;
    --app-accent: #1f4e79;
    --app-border: #e3e7ee;
    --app-text: #1e293b;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.app-navbar {
    background: var(--app-accent);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .15);
}
.app-navbar .nav-link.active {
    color: #fff;
    font-weight: 600;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}
.page-header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

.card {
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.card > .card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid var(--app-border);
    border-top-left-radius: .75rem;
    border-top-right-radius: .75rem;
}
.card > .table-responsive:last-child,
.card > .table-responsive:last-child .table {
    border-bottom-left-radius: .75rem;
    border-bottom-right-radius: .75rem;
}

/* Tabulky */
.table-app {
    margin-bottom: 0;
    font-size: .9rem;
    --bs-table-hover-bg: #eef3fb;
}
.table-app > thead > tr > th {
    --bs-table-bg: #f1f4f9;
    background: #f1f4f9;
    color: #475569;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
    border-bottom: 2px solid var(--app-border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table-app > :not(caption) > * > * {
    padding: .45rem .6rem;
    vertical-align: middle;
    border-color: var(--app-border);
}
.table-app > tfoot > tr > * {
    --bs-table-bg: #f1f4f9;
    background: #f1f4f9;
    font-weight: 600;
}
.table-app .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table-app .nowrap { white-space: nowrap; }
.table-app th[scope="row"] { font-weight: 500; }

.trend-up { color: #198754; }
.trend-down { color: #dc3545; }
.trend-same { color: #0d6efd; }
.trend-neutral { color: #94a3b8; }

/* DataTables v kartách */
.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child {
    padding: .5rem .75rem;
    margin: 0;
}
.dataTables_wrapper .dataTables_filter input { margin-left: .4rem; }
.dataTables_wrapper .dataTables_info { padding-top: .5rem; font-size: .85rem; color: #64748b; }

/* Mapy a grafy */
.map-wrapper { position: relative; }
.map-box { height: 460px; }
@media (max-width: 767.98px) {
    .map-box { height: 340px; }
}
.map-preloader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: rgba(244, 246, 250, .92);
    z-index: 500;
    transition: opacity .3s ease, visibility .3s ease;
}
.map-preloader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.chart-panel {
    position: relative;
    width: 100%;
    height: 420px;
}
@media (max-width: 767.98px) {
    .chart-panel { height: 300px; }
}
.chart-panel canvas { width: 100% !important; height: 100% !important; }

#history-map {
    height: 360px;
    width: 100%;
    border-radius: .5rem;
    background: #f8f9fa;
    border: 1px solid var(--app-border);
}
.history-placeholder { display: flex; align-items: center; justify-content: center; color: #6c757d; }
.history-visits li + li { margin-top: .35rem; border-top: 1px solid #eee; padding-top: .35rem; }

.save-status { font-size: .85em; margin-left: .4rem; }
.save-success { color: #198754; }
.save-error { color: #dc3545; }

/* Timeline – zvýraznění problémových záznamů */
.issue-legend .badge { font-weight: 500; }
/* pozdější pravidla mají přednost – nejzávažnější je poslední */
tr.issue-zero > * { --bs-table-bg: #e3f2fd; }
tr.issue-unknown > * { --bs-table-bg: #efe7ff; }
tr.issue-gap > * { --bs-table-bg: #fff8e1; }
tr.issue-overlap > * { --bs-table-bg: #ffe9cc; }
tr.issue-error > * { --bs-table-bg: #ffe1e1; }
tr.issue-gap > td:first-child { border-left: 4px solid #f59e0b; }
tr.issue-overlap > td:first-child { border-left: 4px solid #ea580c; }
@media (max-width: 767.98px) {
    .col-optional { display: none; }
}
.badge-issue-error { background: #f8b4b4; color: #7f1d1d; }
.badge-issue-overlap { background: #fbd38d; color: #7c2d12; }
.badge-issue-gap { background: #fde68a; color: #78350f; }
.badge-issue-unknown { background: #d6c8ff; color: #3b2a7a; }
.badge-issue-zero { background: #bfdbfe; color: #1e3a8a; }
.badge-issue-noloc { background: #fecaca; color: #991b1b; }
.issue-icons i { margin-right: .15rem; }
/* Oddělovač dnů (DataTables rowGroup vykresluje buňku jako th s vlastním poloprůhledným pozadím – přebít) */
table.dataTable tr.dtrg-group > th,
table.dataTable tr.dtrg-group > td {
    background-color: #e2e8f0;
    font-weight: 600;
    color: #334155;
}
.check-cell, .action-cell { text-align: center; width: 40px; white-space: nowrap; }
.delete-row-btn { color: #dc3545; padding: 0 .3rem; border: 0; background: transparent; }
.delete-row-btn:hover { color: #a51d2d; }
.overlay-spinner {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .4);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Výstup importu */
.command-output {
    max-height: 60vh;
    overflow: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: .5rem;
    padding: 1rem;
    font-size: .85rem;
    white-space: pre-wrap;
}

/* Přihlášení */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-card { width: 100%; max-width: 380px; }

/* Přehled (úvodní stránka) */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: .5rem 0 .75rem;
}
.stat-tile .card-body { padding: .85rem 1rem; }
.stat-label { font-size: .8rem; color: #64748b; white-space: nowrap; }
.stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.2; color: var(--app-accent); }
.stat-note { font-size: .78rem; color: #94a3b8; }
.flag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.flag-list img {
    height: 30px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
}
.home-map { display: block; border-top: 1px solid var(--app-border); border-bottom-left-radius: .75rem; border-bottom-right-radius: .75rem; }
.place-popup { min-width: 10rem; }

.app-footer { color: #94a3b8; font-size: .75rem; text-align: center; padding: 1rem 0 1.5rem; }

/* Interaktivní heatmapa na Přehledu */
.home-heatmap { height: 440px; background: #111; }
@media (max-width: 767.98px) { .home-heatmap { height: 340px; } }
.home-heatmap-wrapper { border-top: 1px solid var(--app-border); overflow: hidden; border-bottom-left-radius: .75rem; border-bottom-right-radius: .75rem; }
.home-heatmap-wrapper .map-preloader { background: rgba(17, 17, 17, .85); }
.home-heatmap-wrapper.leaflet-map-fullscreen .home-heatmap { height: 100%; }

/* Místa: štítek zdroje názvu */
.name-source .badge { margin-left: .35rem; font-weight: 500; }

/* Záznamy: tlačítko úprav */
.edit-row-btn { color: #2563eb; padding: 0 .3rem; border: 0; background: transparent; }
.edit-row-btn:hover { color: #1e40af; }
.action-cell { width: 64px; }

/* Upravený řádek po uložení krátce blikne */
tr.row-flash > * {
    animation: row-flash-bg 4.5s ease-in-out;
}
@keyframes row-flash-bg {
    0%, 12%, 36%, 60% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .6); }
    24%, 48% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .15); }
    80% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .3); }
    100% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, 0); }
}

/* Souhrn přesunů v řádku dne */
.day-travel { white-space: nowrap; font-weight: 500; color: #475569; }
.day-travel i { color: #64748b; }

/* Ikona ostatních typů míst (restaurace, hotel…): tmavě modrá bez rámečku, jako ikony přesunů */
.place-icon { color: #2563eb; }

/* Ikona typu místa (stanice, zastávka, parkoviště…) jako značka: bílá v modrém čtverečku,
   aby se odlišila od šedé ikony přesunu (vlak × železniční stanice) */
.place-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35em !important;
    height: 1.35em;
    font-size: .8em;
    color: #fff;
    background: #2563eb;
    border-radius: .3em;
    vertical-align: .05em;
}

/* Vlastní ikony mimo Font Awesome Free (metro v tunelu z Material Symbols, licence Apache 2.0) –
   kreslí se maskou v barvě textu, takže fungují jako ostatní ikony i ve značce typu místa */
.fa-train-subway-tunnel::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -.125em;
    background-color: currentColor;
    -webkit-mask: url("icons/subway.svg") center / contain no-repeat;
    mask: url("icons/subway.svg") center / contain no-repeat;
}

/* Rozklikávací přehled míst (státy → města → místa, kategorie → místa) */
.places-tree .tree-group { cursor: pointer; user-select: none; }
.places-tree .tree-depth-0 > td:first-child { font-weight: 600; }
.places-tree .tree-depth-1 > td:first-child { font-weight: 500; }
.places-tree .tree-toggle { display: inline-block; width: 1.25rem; font-size: .8em; color: #64748b; transition: transform .15s; }
.places-tree .tree-group[aria-expanded="true"] .tree-toggle { transform: rotate(90deg); }
.places-tree .tree-spacer { display: inline-block; width: 1.25rem; }
.group-map { height: 70vh; min-height: 320px; }
@media (max-width: 991.98px) { .group-map { height: calc(100vh - 7rem); } }
/* Přepínače vedle sebe: mezera za popiskem, ať je jasné, ke kterému přepínači patří */
.d-flex > .form-switch + .form-switch { margin-left: 1rem; }
.tree-flag { height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .12); vertical-align: -2px; }

/* Okno místa: detail a návštěvy */
.place-detail-table th { width: 8.5rem; vertical-align: top; }
.place-detail-table tr:last-child > * { border-bottom: 0; }
/* ID místa: zkrácené (dlouhá ID adres by okno roztáhla do stran), celé po kliknutí */
.place-detail-table .place-id { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
                                white-space: nowrap; vertical-align: bottom; cursor: pointer; }
.place-detail-table td:has(> .place-id) { max-width: 0; }   /* šířku sloupce určí ostatní řádky, ne ID */
.place-detail-table .place-id.expanded { white-space: normal; word-break: break-all; cursor: text; }
.visit-tree td { padding-top: .3rem; padding-bottom: .3rem; }
/* Tabulka DataTables se ukáže až hotová (jinak při načítání skáče) */
.table-pending { visibility: hidden; }
/* Nový záznam: výsledky hledání místa */
.add-place-results { max-height: 16rem; overflow-y: auto; }
.add-place-results:empty { display: none; }
/* Tlačítka v řádku zarovnaná vpravo (detail je jen u míst), úzké sloupce zaškrtávátek */
#timeline-table .action-cell { width: 1%; text-align: right; }
#timeline-table .check-cell { width: 28px; padding-left: .25rem; padding-right: .25rem; }
@media (min-width: 768px) {
    .admin-places > [class*="col-"] + [class*="col-"] { border-left: 1px solid var(--app-border); }
}
.admin-places .card-header { border-radius: 0; }
/* Výběr ikony kategorie */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .35rem; }
.icon-choice {
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    padding: .5rem .25rem; border: 1px solid var(--app-border); border-radius: .4rem; background: transparent;
    font-size: .68rem; color: #475569; overflow: hidden;
}
.icon-choice i { font-size: 1.25rem; color: #2563eb; }
.icon-choice span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-choice:hover { background: #eff6ff; }
.icon-choice.active { border-color: #2563eb; background: #dbeafe; }
/* Oprava podle Excelu: tlačítko stále vidět dole */
.excel-apply-bar { position: sticky; bottom: 0; padding: .75rem 0; background: var(--app-bg); border-top: 1px solid var(--app-border); }

/* Úspěchy: odznak podle úrovně (bronz → diamant), zamčený šedý */
.ach-badge {
    --ach-color: #94a3b8; --ach-bg: #f1f5f9;
    flex: 0 0 auto; width: 3.25rem; height: 3.25rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
    color: var(--ach-color); background: var(--ach-bg); border: 3px solid var(--ach-color);
}
.ach-badge-sm { width: 2.25rem; height: 2.25rem; font-size: .95rem; border-width: 2px; }
.ach-bronze { --ach-color: #b06a2c; --ach-bg: #f7e8da; }
.ach-silver { --ach-color: #7d8894; --ach-bg: #eef1f4; }
.ach-gold { --ach-color: #c79a0e; --ach-bg: #fbf2d0; }
.ach-platinum { --ach-color: #1c9488; --ach-bg: #dcf3f0; }
.ach-diamond { --ach-color: #6741d9; --ach-bg: #ece5ff; }
.ach-crown { --ach-color: #c2255c; --ach-bg: #ffe3ec; }
.ach-locked { --ach-color: #cbd5e1; --ach-bg: #f8fafc; }
.ach-emoji { font-size: 1.15rem; line-height: 1; cursor: default; }
.ach-emoji-off { filter: grayscale(1); opacity: .3; }
.ach-emoji-new { border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #22c55e; }
.ach-card-locked .fw-semibold { color: #64748b; }
.ach-new { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, .35); }
.ach-progress { background: var(--app-accent); }
.ach-card { cursor: pointer; }
.extremes-map { height: 320px; border-radius: .75rem; }
.extremes-home { color: #1f4e79; font-size: 1.2rem; text-shadow: 0 0 3px #fff, 0 0 3px #fff; display: flex; align-items: center; justify-content: center; }
.ach-toggle { color: #94a3b8; font-size: .85rem; transition: transform .15s; }
.ach-card-open .ach-toggle { transform: rotate(180deg); }
.ach-levels-table td { padding-top: .15rem; padding-bottom: .15rem; }
/* Rozbalené úrovně na vlastním řádku pod odznakem a textem (text vedle odznaku se nesmí zalomit pod něj) */
.ach-card > .card-body { row-gap: .5rem !important; }
.ach-card > .card-body > .flex-grow-1 { flex-basis: 0; }
.ach-flag { height: 1em; width: auto; vertical-align: -.1em; border-radius: 2px; }
.min-w-0 { min-width: 0; }

/* Výběr typu přesunu v okně úprav: vybraný typ zvýrazněný, ikona si nechá barvu */
.vehicle-picker .type-option.active, .type-picker .type-option.active { background: #e7f0fb; border-color: var(--app-accent); color: var(--app-accent); font-weight: 600; }

/* Průběh importu: ikona stavu u každého kroku */
.import-step-icon { flex: 0 0 1.5rem; display: inline-flex; justify-content: center; padding-top: .15rem; font-size: 1.15rem; }
.import-step-wait .fw-semibold, .import-step-skip .fw-semibold { color: #64748b; }
.import-map { height: 460px; }

/* QR kód pro dvoufázové ověření */
.two-factor-qr svg { max-width: 220px; height: auto; background: #fff; border-radius: .5rem; }

/* Malé tabulky mimo table-app (Statistika dat – server a databáze): čísla vpravo */
.table-sm .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Kalendář roku (heatmapa) */
.calendar-heatmap { overflow-x: auto; }
/* Přepínač Kalendáře roku: na užší obrazovce do více řádků (jedna řada tlačítek rozšiřovala stránku na telefonu
   na dvojnásobek – okno dne přes celou obrazovku pak bylo dvakrát širší a posunuté) */
@media (max-width: 991.98px) {
    #calendar-metric { flex-wrap: wrap; gap: .25rem; }
    #calendar-metric > .btn { border-radius: var(--bs-btn-border-radius) !important; margin-left: 0 !important; }
}
/* Pojistka: stránka na mobilu nikdy širší než obrazovka (prohlížeč by ji oddálil a okna přes celou obrazovku
   by se roztáhla na její šířku); široké tabulky a grafy se posouvají ve svém rámečku */
@media (max-width: 991.98px) {
    html { overflow-x: hidden; }
    body { overflow-x: clip; }   /* clip: body nebude posuvný rámeček – připnutá lišta (sticky) funguje dál */
}
.calendar-svg { min-width: 720px; width: 100%; height: auto; display: block; }
.calendar-svg .cal-label { font-size: 9px; fill: #64748b; }
.calendar-svg rect:hover { stroke: #0f172a; stroke-width: 1; }
.calendar-svg a { text-decoration: none; }  /* bez podtržení ikon počasí (text v odkazu) */
.calendar-svg .cal-icon { font-size: 10px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.calendar-svg .cal-month-border { fill: none; stroke: #94a3b8; stroke-width: 1.2; pointer-events: none; }
.cal-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }

/* Rok v kostce */
.year-hero { background: linear-gradient(135deg, #1f4e79, #2f80c0); color: #fff; border-radius: .75rem; padding: 1.25rem 1.5rem; }
.year-hero-year { font-size: 3rem; font-weight: 700; line-height: 1; }
.year-hero-text { font-size: 1.1rem; opacity: .9; margin-top: .35rem; }
/* Rok v kostce: pořadí roku, pás roku s výlety, rozdělení času, noci v mapě */
.stat-rank { font-size: .75rem; color: var(--bs-secondary-color); margin-top: .1rem; }
.year-strip { position: relative; height: 46px; background: var(--bs-tertiary-bg); border-radius: .4rem; overflow: hidden;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.year-strip-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--bs-border-color); font-size: .68rem;
    color: var(--bs-secondary-color); padding: 1px 3px; overflow: hidden; white-space: nowrap; }
.year-strip-month:first-child { border-left: 0; }
.year-strip-trip { position: absolute; top: 18px; height: 22px; min-width: 4px; border-radius: 3px; background: #2f80c0; opacity: .9; }
.year-strip-trip:hover, .year-strip-trip:focus { background: #1f4e79; opacity: 1; }
.year-strip-trip.partner { background: #e64980; }
.year-strip-trip.business { background: #6c757d; }
.year-strip-legend { display: flex; flex-wrap: wrap; gap: .75rem; }
.year-strip-key { display: inline-block; width: .8rem; height: .6rem; border-radius: 2px; background: #2f80c0; margin-right: .3rem; }
.year-strip-key.partner { background: #e64980; }
.year-strip-key.business { background: #6c757d; }
.year-split-chart { position: relative; width: 170px; height: 170px; }
.year-split-dot, .year-night-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .35rem; }
.year-night-dot { background: #1971c2; }
@media print { .app-navbar, footer { display: none !important; } .card { break-inside: avoid; } #review-map { width: 100% !important; } .leaflet-control-container .leaflet-top { display: none; } }

/* Přehrání trasy v okně mapy */
.route-replay { display: flex; align-items: center; gap: .5rem; background: #fff; padding: .35rem .5rem; max-width: calc(100vw - 4rem); }
.route-replay .replay-time { width: 12rem; min-width: 6rem; }
.route-replay .replay-speed { width: auto; }
.route-replay .replay-clock { min-width: 4rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) {
    .route-replay { flex-wrap: wrap; gap: .35rem; }
    .route-replay .replay-time { width: 8rem; flex: 1 1 6rem; }
    .route-replay .replay-clock { order: 4; flex-basis: 100%; max-width: none; }
    .route-replay .replay-speed { max-width: 6.5rem; }
}
#route-map-steps tr.replay-current > * { background: rgba(13, 110, 253, .14); }
#route-map-steps tr.replay-current > :first-child { box-shadow: inset 3px 0 0 #0d6efd; }

/* Správa: navigace sekcí vlevo (na mobilu vodorovně posuvná) */
.admin-nav .nav-link { text-align: left; white-space: nowrap; }
.admin-nav .nav-link i { width: 1.25rem; }
@media (min-width: 992px) { .admin-nav { position: sticky; top: 4.5rem; } }
@media (max-width: 991.98px) {
    .admin-nav { flex-wrap: nowrap; overflow-x: auto; gap: .25rem; padding-bottom: .25rem; }
}

/* Výlety: oddělení roků */
.trips-year { border-bottom: 2px solid var(--bs-border-color); padding-bottom: .35rem; }
.trips-hidden > summary { cursor: pointer; list-style: revert; }
/* Hlavní menu: na užších obrazovkách s rozbaleným menu menší mezery, ať se vejde na jeden řádek */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .app-navbar .navbar-nav .nav-link { padding-left: .3rem; padding-right: .3rem; font-size: .92rem; }
    .app-navbar .navbar-nav .nav-link i { margin-right: .2rem !important; }
}

/* Okno mapy trasy: na počítači mapa vlevo a průběh vpravo; na mobilu (celá obrazovka) mapa i s hlavičkou zhruba
   na 60 % obrazovky a pod ní průběh, okno se neposouvá – posouvá se jen seznam průběhu (při přehrávání sám); přehled
   dne je na mobilu až pod průběhem, aby byla místa vidět hned. Výška okna podle viditelné části obrazovky (dvh) –
   100 % je na telefonu i pod lištou prohlížeče, okno pak přetékalo a otevíralo se posunuté dolů. */
#route-map { height: 60vh; min-height: 320px; border-radius: .5rem; border: 1px solid var(--app-border); }
#route-map-steps { height: 60vh; min-height: 320px; }
@media (max-width: 991.98px) {
    /* Okno pevně přes viditelnou plochu a jeho části nejdou posunout (overflow: clip) – posouvá se jen průběh */
    #routeMapModal { overflow: hidden; }
    #routeMapModal .modal-dialog { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: auto; height: auto; margin: 0; transform: none; }
    #routeMapModal .modal-content { height: 100%; max-height: none; overflow: hidden; overflow: clip; }
    #routeMapModal .modal-body { display: flex; flex-direction: column; overflow: hidden; overflow: clip; padding: .75rem; }
    #routeMapModal .route-modal-row { flex: 1 1 auto; min-height: 0; flex-direction: column; flex-wrap: nowrap; margin: 0; gap: .5rem; overflow: clip; }
    #routeMapModal .route-modal-row > * { margin-top: 0; padding: 0; }
    #routeMapModal .route-map-col { flex: 0 0 auto; display: flex; flex-direction: column; }
    #routeMapModal #route-map { flex: 0 0 auto; height: 42.5vh; height: 42.5dvh; min-height: 225px; }
    #routeMapModal #route-map-legend { flex: 0 0 auto; }
    #routeMapModal .route-steps-col { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
    #routeMapModal #route-map-steps { flex: 1 1 0; height: auto; min-height: 0; display: flex; flex-direction: column; }
    #routeMapModal #route-map-steps > * { flex-shrink: 0; }
    #routeMapModal #route-map-steps > .route-day-info { order: 1; }
}

/* Statistika dat: průzkumník složky s daty */
.files-explorer .files-folder > * { background: var(--bs-tertiary-bg); border-top: 2px solid var(--bs-border-color); }
.files-explorer .files-kind { padding-left: 2rem; }
.files-explorer .files-kind summary { cursor: pointer; }
.files-explorer .files-list { max-width: 900px; }
.files-explorer .files-list td { padding-top: .1rem; padding-bottom: .1rem; }

/* Okno mapy trasy: graf nadmořské výšky (na mobilu skrytý – mapa a seznam vyplní obrazovku) */
.route-profile { position: relative; height: 70px; margin-top: .25rem; border: 1px solid var(--app-border); border-radius: .4rem; overflow: hidden; }
.route-profile canvas { display: block; }
.route-profile-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #dc2626; display: none; pointer-events: none; }
.route-profile { cursor: crosshair; touch-action: pan-y; }
.route-profile-label { position: absolute; bottom: 2px; display: none; pointer-events: none; padding: 0 .3rem; border-radius: .25rem;
    font-size: 11px; white-space: nowrap; background: var(--bs-body-bg); color: var(--bs-body-color); box-shadow: 0 0 2px rgba(0, 0, 0, .35); }
/* Místa: filtr typu (rozbalovací seznam se zaškrtávátky) */
.place-type-filter { min-width: 240px; }
.place-type-options { max-height: 300px; overflow-y: auto; }
.place-type-filter-btn { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* Výběr mezi trasami přes sebe (route-map.js) */
.route-choice { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.route-choice-item { text-align: left; border: 1px solid var(--app-border); }
.route-choice-item:hover, .route-choice-item:focus { background: var(--bs-tertiary-bg); }
.route-choice-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
@media (max-width: 991.98px) { #route-map-profile { display: none !important; } }

.legend-line { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }
.source-badge { font-weight: 600; vertical-align: 1px; }
.source-gpx { background: #e7f0ff; color: #0b4fb3; border: 1px solid #b6cff7; }
.source-strava { background: #fff1ea; color: #c2410c; border: 1px solid #fdc9ad; }

.source-icon { font-size: 1.05rem; vertical-align: -2px; }
.source-gpx-icon { color: #0b63ce; }
.source-strava-icon { color: #fc4c02; }
/* Untappd: ikona v jantarové barvě, odznak piva u návštěvy (seznam piv v bublině) */
.untappd-icon { color: #e8a200; }
.beer-badge { cursor: default; white-space: nowrap; }
.history-flags { white-space: nowrap; cursor: default; }
.preview-row { cursor: pointer; }
.preview-table-scroll { max-height: 48vh; overflow-y: auto; }
/* Značka místa v mapě (okno dne, kontrola importu): ikona typu místa v bílém kolečku */
/* Výběr roku historického podkladu (Esri Wayback, archivní ortofoto ČÚZK, OpenHistoricalMap) */
.map-utils-year select, .map-utils-year input { border: 0; padding: 2px 4px; font-size: 13px; background: #fff; color: #222; }
.map-utils-year select { cursor: pointer; }
.map-utils-year input { width: 5.5em; }

.map-place-divicon { background: none; border: 0; }
.map-place-marker {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    background: #fff; border: 2px solid #2563eb; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    font-size: 13px; line-height: 1;
}
.map-place-marker i { color: #2563eb; }
/* i.… – přebije i modrý čtvereček značky tmavého vzhledu (jinak modrá ikona na modrém = jen čtverec) */
.map-place-marker i.place-type-icon { width: auto !important; height: auto; font-size: inherit; background: none; color: #2563eb; }
.map-place-marker.selected { border-color: #b91c1c; border-width: 3px; font-size: 16px; }
.map-place-marker.selected i { color: #b91c1c; }
/* Řádek náhledu označený „neimportovat“ */
.preview-skipped > td:not(:first-child) { opacity: .45; text-decoration: line-through; }

/* Potvrzovací okno aplikace */
.app-dialog { border: 0; border-radius: 1rem; box-shadow: 0 1rem 3rem rgba(15, 23, 42, .25); }
.app-dialog-icon { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.4rem; }
.app-dialog-icon.is-question { background: #e7f0ff; color: #0b63ce; }
.app-dialog-icon.is-danger, .app-dialog-icon.is-error { background: #fde8e8; color: #c81e1e; }
.app-dialog-icon.is-warning { background: #fff4db; color: #b45309; }
.app-dialog-icon.is-info { background: #e7f0ff; color: #0b63ce; }
#app-dialog-text { white-space: normal; word-break: break-word; }
#appDialog { z-index: 1070; }
.modal-backdrop.app-dialog-backdrop { z-index: 1065; }
/* Hranice mezi záznamy (boundary-editor.js) – i nad oknem porovnání importu */
#boundaryModal { z-index: 1062; }
.modal-backdrop.boundary-backdrop { z-index: 1060; }
.boundary-map { height: 45vh; min-height: 260px; border-radius: .5rem; border: 1px solid var(--app-border); }
/* Úprava trasy – režim Posunout bod: body trasy a oranžové opěrné body přichycené části */
.route-editor-vertex { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 2px rgba(0, 0, 0, .6); cursor: move; }
.route-editor-vertex-point { background: #0d6efd; }
.route-editor-vertex-waypoint { background: #f59f00; }
.route-editor-transfer { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #7048e8;
    color: #fff; font-size: 12px; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0, 0, 0, .6); cursor: move; }
.route-editor-vertex-selected { outline: 3px solid rgba(13, 110, 253, .5); outline-offset: 1px; }
.place-company { max-width: 26rem; }
.place-company-icons { flex: 0 0 2.4rem; }
.vehicle-facts dt { font-weight: 500; color: var(--bs-secondary-color); }
.boundary-btn { max-width: 100%; display: inline-flex; align-items: center; }
.boundary-btn .boundary-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.bulk-table { max-height: 50vh; overflow-y: auto; }
.add-split-map { height: 240px; border-radius: .5rem; border: 1px solid var(--app-border); }
.boundary-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Log v průzkumníku souborů */
.log-view { font-size: .78rem; line-height: 1.35; padding: .75rem 1rem; white-space: pre-wrap; word-break: break-word;
    background: #0f172a; color: #e2e8f0; min-height: 100%; }
.log-view.log-nowrap { white-space: pre; word-break: normal; }
#log-body { background: #0f172a; }
.log-filter { max-width: 22rem; }

/* Záznamy: Prohlížení / Editace a zaškrtávátka „s kým“ */
.flag-icon { display: none; }
.records-view .update-checkbox, .records-view .edit-only { display: none !important; }
.records-view .update-checkbox:checked + .flag-icon { display: inline; }
.records-view .insert-after-btn, .records-view .edit-record-btn, .records-view .delete-row-btn { display: none; }
.companion-checks { display: inline-flex; flex-wrap: wrap; gap: .1rem .35rem; justify-content: center; }
.companion-check { display: inline-flex; align-items: center; gap: .15rem; margin: 0; cursor: pointer; white-space: nowrap; }
.companion-name { font-size: .75rem; }
.records-view .companion-check { cursor: default; }

/* Sbalovací hlavička karty */
.collapse-chevron { transition: transform .2s; }
[data-bs-toggle="collapse"]:not(.collapsed) .collapse-chevron { transform: rotate(180deg); }

/* Karta se sbalitelnou hlavičkou: výplň hlavičky nepřeteče přes zaoblené rohy */
.card-collapsible { overflow: hidden; }

/* Závod ze Stravy v Záznamech */
.race-badge { color: #b45309; }

/* Aktivita na místě u návštěvy v Záznamech */
.race-name { font-size: .85rem; font-weight: 600; }

/* Okno mapy dne: řádek průběhu jde vybrat (zvýrazní trasu / místo v mapě) */
.route-steps tr[data-kind] { cursor: pointer; }
/* Mapa dne – úpravy: zaškrtávátka s kým / práce pod záznamem a posun hranice mezi záznamy */
.day-edit-row { display: flex; flex-wrap: wrap; gap: .15rem .6rem; margin-top: .15rem; }
.day-edit-check { display: inline-flex; align-items: center; gap: .2rem; cursor: pointer; white-space: nowrap; }
.day-edit-check .form-check-input { margin-top: 0; }
.route-steps tr.day-edit-boundary > td { padding-top: 0; padding-bottom: 0; line-height: 1; }
.route-steps .day-boundary-btn { font-size: .75rem; text-decoration: none; }
.route-steps tr.route-step-selected > td { background: #dbeafe; }
/* Výlet a období přes víc dní: oddělovač dne v průběhu, při posouvání zůstane nahoře */
.route-steps tr.route-steps-day > td { position: sticky; top: 0; z-index: 1; background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color); font-size: .78rem; font-weight: 600; padding: .25rem .5rem;
    border-bottom: 1px solid var(--bs-border-color); }
.route-steps-day-weather { float: right; font-weight: normal; white-space: nowrap; cursor: default; }
/* Opatření proti covidu u dne (covid.py): nouzový stav červeně, jinak opatření oranžově */
.day-covid { white-space: nowrap; cursor: default; }
.day-covid small { font-size: .65rem; margin-left: .1rem; color: var(--bs-secondary-color); }
.covid-emergency { color: #dc3545; }
.covid-measure { color: #f08c00; }
[data-bs-theme="dark"] .covid-emergency { color: #ff6b6b; }
[data-bs-theme="dark"] .covid-measure { color: #ffa94d; }
.route-day-period { font-size: .78rem; font-weight: 600; color: var(--bs-secondary-color); margin-bottom: .1rem; }
/* Datum ve statistikách: šedý štítek s odkazem (_stat_dates.html) */
a.stat-date { text-decoration: none; }
a.stat-date:hover, a.stat-date:focus-visible { filter: brightness(1.18); text-decoration: none; }

/* Počasí v řádku dne (Záznamy) a u výletu */
.day-weather { font-weight: normal; font-size: .85rem; color: #475569; white-space: nowrap; }
/* Druhý řádek hlavičky dne: zdraví z Garmin Connect (kroky, spánek, stres…) – podrobnosti v bublině */
.day-health { display: flex; flex-wrap: wrap; gap: .15rem .9rem; margin-top: .15rem; font-weight: normal; font-size: .8rem; color: #64748b; }
.day-health-item { white-space: nowrap; cursor: default; }
.day-health-item i { margin-right: .1rem; opacity: .85; }
[data-bs-theme="dark"] .day-health { color: #aeb9c6; }
/* Přehrávání trasy: noční animace nad mapou v době spánku (Garmin Connect) – nad podkladem a trasami, pod ovládáním */
/* Přehrávání trasy: značka s ikonou dopravy a bubliny událostí (pivo, nejvyšší bod, hranice, poprvé tady, doma, km) */
.replay-marker-icon { background: none; border: 0; }
.replay-marker { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.replay-marker-stay { width: 22px; height: 22px; background: #1f4e79; }
/* Další doprava zadaná u výletu (vlak, let…): značka se štítkem, kdo jede */
.replay-extra { position: relative; width: 32px; height: 32px; }
.replay-extra .replay-marker { animation: replay-extra-pulse 1.6s ease-in-out infinite; }
.replay-extra-who { position: absolute; left: 34px; top: 4px; white-space: nowrap; background: var(--bs-body-bg); color: var(--bs-body-color);
    border: 2px solid; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 600; line-height: 20px; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
@keyframes replay-extra-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .9), 0 1px 5px rgba(0, 0, 0, .45); }
    50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0), 0 1px 5px rgba(0, 0, 0, .45); } }
.replay-marker.hop { animation: replay-hop .55s ease-out; }
@keyframes replay-hop { 0% { transform: scale(1); } 35% { transform: translateY(-12px) scale(1.3); } 65% { transform: translateY(0) scale(.92); } 100% { transform: scale(1); } }
.replay-bubbles { position: absolute; z-index: 640; pointer-events: none; transform: translate(-50%, calc(-100% - 24px));
    display: flex; flex-direction: column; align-items: center; gap: 4px; }
.replay-bubble { background: var(--bs-body-bg); color: var(--bs-body-color); border-radius: 999px; padding: 4px 12px; font-size: .85rem;
    font-weight: 600; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); white-space: nowrap; display: flex; align-items: center; gap: 6px;
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; animation: replay-pop 2.6s ease forwards; }
.replay-bubble img { height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.replay-bubble .replay-emoji { font-size: 1.05rem; line-height: 1; }
.replay-bubble-beer .replay-emoji { display: inline-block; animation: replay-cheers .5s ease-in-out 3; transform-origin: 50% 90%; }
.replay-bubble-peak, .replay-bubble-border { border: 2px solid #f08c00; }
.replay-bubble-home { border: 2px solid #2f9e44; }
@keyframes replay-pop { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 12% { opacity: 1; transform: translateY(0) scale(1.08); }
    20% { transform: scale(1); } 80% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes replay-cheers { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-20deg); } }
@media (prefers-reduced-motion: reduce) { .replay-marker.hop, .replay-bubble, .replay-bubble-beer .replay-emoji { animation-duration: .01s; } .replay-bubble { animation: none; } }
.replay-sleep { position: absolute; inset: 0; z-index: 650; pointer-events: none; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .4rem; color: #fff; opacity: 0; transition: opacity .6s;
    background: radial-gradient(ellipse at 50% 42%, rgba(30, 45, 100, .55), rgba(6, 10, 32, .82)); }
.replay-sleep.show { opacity: 1; }
.replay-sleep-moon { position: relative; font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 0 14px rgba(255, 230, 150, .7));
    animation: replay-sleep-bob 3.2s ease-in-out infinite; }
.replay-sleep-z { position: absolute; left: 78%; top: 0; font-size: 1.1rem; font-weight: 700; color: #cfe0ff; opacity: 0;
    animation: replay-sleep-z 2.7s ease-in infinite; }
.replay-sleep-z:nth-child(2) { animation-delay: .9s; font-size: 1.35rem; }
.replay-sleep-z:nth-child(3) { animation-delay: 1.8s; font-size: 1.6rem; }
.replay-sleep-text { font-size: .9rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.replay-sleep-star { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff;
    animation: replay-sleep-twinkle 2.8s ease-in-out infinite; }
@keyframes replay-sleep-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes replay-sleep-z { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; }
    100% { transform: translate(1.6rem, -2.6rem) scale(1.15); opacity: 0; } }
@keyframes replay-sleep-twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) {
    .replay-sleep-moon, .replay-sleep-star { animation: none; }
    .replay-sleep-z { animation: none; opacity: .8; }
    .replay-sleep-z:nth-child(2) { transform: translate(.8rem, -1.2rem); }
    .replay-sleep-z:nth-child(3) { transform: translate(1.6rem, -2.4rem); }
}
/* Přehled dne v okně mapy dne (route-map.js): počasí, pohyb a zdraví nad průběhem */
.route-day-info { padding: .5rem .25rem 0; margin-top: .5rem; border-top: 1px solid var(--app-border); }
.route-day-info summary { font-size: .8rem; cursor: pointer; }
/* Na počítači pod průběhem vedle grafu výšky: rozbalené podrobnosti s vlastním posuvníkem, okno nepřetečou */
#route-map-day-info .route-day-details { max-height: 4.2rem; overflow-y: auto; }
.route-day-detail { padding-left: 1.4rem; text-indent: -1.4rem; margin-top: .15rem; }
.route-day-detail i { display: inline-block; width: 1.4rem; text-indent: 0; text-align: center; opacity: .75; }
.trip-health { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
/* Karta výletu: hlavní čísla, pruh dopravy a řádky s popisky */
.trip-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: .75rem 0; padding: .5rem 0; text-align: center;
    border-top: 1px solid var(--app-border); border-bottom: 1px solid var(--app-border); }
.trip-stats > div + div { border-left: 1px solid var(--app-border); }
.trip-stats b { display: block; font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.trip-stats span { font-size: .75rem; color: var(--bs-secondary-color); }
.trip-transport-bar { display: flex; height: .4rem; border-radius: .2rem; overflow: hidden; background: var(--bs-secondary-bg); }
.trip-transport-legend { display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin-top: .3rem; font-size: .8rem; }
.trip-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem .75rem; margin: .75rem 0 0; font-size: .875rem; }
.trip-facts dt { font-weight: normal; color: var(--bs-secondary-color); }
.trip-facts dd { margin: 0; min-width: 0; }
.trip-time { opacity: .75; }
/* Poznámka dne (Záznamy): přidání jen v režimu úprav, tlumeně */
.day-note-add { color: var(--bs-secondary-color); opacity: .7; }
.day-note-add:hover { opacity: 1; }
.day-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Výlety: ikona počasí za každý den výletu (zalomí se u dlouhých výletů) */
.trip-weather-days { letter-spacing: -0.05em; word-break: break-all; }
.trip-weather-days > span { cursor: default; }

/* Přehled: počasí posledních dní */
.home-weather-day { display: flex; flex-direction: column; align-items: center; min-width: 3.6rem; padding: 0.15rem 0.35rem;
    border-radius: 0.5rem; color: inherit; line-height: 1.25; }
.home-weather-day:hover { background: rgba(37, 99, 235, 0.08); }

/* Bublina s textem title po klepnutí (dotykové displeje) */
.tap-tip { position: absolute; z-index: 2000; max-width: min(320px, calc(100vw - 16px)); padding: 0.4rem 0.6rem;
    background: #1e293b; color: #fff; font-size: 0.82rem; line-height: 1.35; border-radius: 0.45rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25); white-space: pre-line; pointer-events: none; }
.tap-tip::after { content: ""; position: absolute; left: var(--arrow, 50%); top: 100%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: #1e293b; }
.tap-tip.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #1e293b; }

/* Úprava trasy přesunu */
/* Lišta nástrojů nahoře, mapa s panelem vpravo, časová osa výběru dole (route-editor.js) */
.modal-body.route-editor-body { display: flex; flex-direction: column; overflow: hidden; height: 78vh; min-height: 480px; }
.route-editor-toolbar { flex: 0 0 auto; }
.route-editor-main { flex: 1 1 auto; min-height: 0; display: flex; }
.route-editor-map-col { flex: 1 1 auto; min-width: 0; }
.route-editor-map { height: 100%; min-height: 260px; }
.route-editor-side { flex: 0 0 270px; overflow-y: auto; border-left: 1px solid var(--app-border); }
.route-editor-timeline { flex: 0 0 auto; }
.route-editor-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }
/* Výběr úseku: dva posuvníky přes sebe na jedné ose (táhnou se jen jejich úchyty) */
.route-editor-range { position: relative; height: 26px; }
.route-editor-range-track, .route-editor-range-selected { position: absolute; top: 11px; height: 4px; border-radius: 2px; }
.route-editor-range-track { left: 0; right: 0; background: var(--bs-secondary-bg); }
.route-editor-range-selected { background: #f59f00; }
.route-editor-range input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 26px; margin: 0; background: none;
    pointer-events: none; -webkit-appearance: none; appearance: none; }
.route-editor-range input[type=range]::-webkit-slider-runnable-track { background: none; }
.route-editor-range input[type=range]::-moz-range-track { background: none; }
.route-editor-range input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; border: 3px solid #f59f00; cursor: grab; }
.route-editor-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 3px solid #f59f00; cursor: grab; }
.route-editor-menu .btn { text-align: left; }
/* Mobil: mapa nahoře pevně, panel a osa pod ní (posouvá se jen panel) */
@media (max-width: 991.98px) {
    .modal-body.route-editor-body { height: auto; min-height: 0; }
    .route-editor-main { flex-direction: column; }
    .route-editor-map-col { flex: 0 0 auto; }
    .route-editor-map { height: 42vh; height: 42dvh; min-height: 220px; }
    .route-editor-side { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--app-border); }
}
.route-editor-handle span { display: block; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45); cursor: grab; }

/* Záznamy: výběr jiného místa návštěvy */
.edit-place-results { max-height: 220px; overflow-y: auto; }

/* Detail místa: výběr polohy kliknutím do mapy */
.place-locate-map { height: 260px; border-radius: .375rem; cursor: crosshair; }

/* ==========================================================================
   Tmavý vzhled (Správa → Osobní údaje → Vzhled; static/theme.js nastaví data-bs-theme="dark")
   Stránka tmavší než karty, akcentní modrá světlejší (text na tmavém pozadí), světlé plochy jako tmavé odstíny.
   Mapové podklady zůstávají, jak jsou – tmavé jsou jen ovládací prvky a bubliny map.
   ========================================================================== */
[data-bs-theme="dark"] {
    --app-bg: #15181c;
    --app-border: #343a40;
    --app-text: #dee2e6;
    --bs-link-color: #7cb4ff;
    --bs-link-color-rgb: 124, 180, 255;
    --bs-link-hover-color: #a8ccff;
    --bs-link-hover-color-rgb: 168, 204, 255;
}
[data-bs-theme="dark"] .app-navbar { background: #14304d; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
[data-bs-theme="dark"] .card { box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
[data-bs-theme="dark"] .card > .card-header { background: #2a2f35; }
[data-bs-theme="dark"] .table-app { --bs-table-hover-bg: #2c3542; }
[data-bs-theme="dark"] .table-app > thead > tr > th,
[data-bs-theme="dark"] .table-app > tfoot > tr > * { --bs-table-bg: #2a2f35; background: #2a2f35; color: #adb5bd; }
[data-bs-theme="dark"] .trend-up { color: #51cf66; }
[data-bs-theme="dark"] .trend-down { color: #ff6b6b; }
[data-bs-theme="dark"] .trend-same { color: #74c0fc; }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .stat-label,
[data-bs-theme="dark"] .section-title,
[data-bs-theme="dark"] .day-travel,
[data-bs-theme="dark"] .day-travel i,
[data-bs-theme="dark"] .day-weather,
[data-bs-theme="dark"] .icon-choice,
[data-bs-theme="dark"] .import-step-wait .fw-semibold,
[data-bs-theme="dark"] .import-step-skip .fw-semibold,
[data-bs-theme="dark"] .ach-card-locked .fw-semibold { color: #adb5bd; }
[data-bs-theme="dark"] .stat-note { color: #868e96; }
[data-bs-theme="dark"] .stat-value { color: #8ec5ff; }
[data-bs-theme="dark"] .map-preloader { background: rgba(21, 24, 28, .9); }
[data-bs-theme="dark"] #history-map { background: #2a2f35; }
[data-bs-theme="dark"] .history-visits li + li { border-top-color: var(--app-border); }
[data-bs-theme="dark"] .overlay-spinner { background: rgba(0, 0, 0, .4); }

/* Záznamy: barevné řádky problémů jako tmavé odstíny, souhrn dne */
[data-bs-theme="dark"] tr.issue-zero > * { --bs-table-bg: #1b3047; }
[data-bs-theme="dark"] tr.issue-unknown > * { --bs-table-bg: #2c2547; }
[data-bs-theme="dark"] tr.issue-gap > * { --bs-table-bg: #3a3420; }
[data-bs-theme="dark"] tr.issue-overlap > * { --bs-table-bg: #43301c; }
[data-bs-theme="dark"] tr.issue-error > * { --bs-table-bg: #4a2427; }
[data-bs-theme="dark"] table.dataTable tr.dtrg-group > th,
[data-bs-theme="dark"] table.dataTable tr.dtrg-group > td { background-color: #33404f; color: #f1f3f5; border-top: 1px solid #4a5a6c; }
@keyframes row-flash-bg-dark {
    0%, 12%, 36%, 60% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .45); }
    24%, 48% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .12); }
    80% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .25); }
    100% { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, 0); }
}
[data-bs-theme="dark"] tr.row-flash > * { animation-name: row-flash-bg-dark; }

/* Barevné ikony s pevnou barvou v CSS – světlejší odstíny (ikony s barvou ve style zesvětlí theme.js) */
[data-bs-theme="dark"] .place-icon,
[data-bs-theme="dark"] .icon-choice i,
[data-bs-theme="dark"] .edit-row-btn { color: #74a7ff; }
[data-bs-theme="dark"] .edit-row-btn:hover { color: #a5c8ff; }
[data-bs-theme="dark"] .delete-row-btn { color: #ff6b6b; }
[data-bs-theme="dark"] .delete-row-btn:hover { color: #ffa8a8; }
[data-bs-theme="dark"] .place-type-icon { background: #3b74e0; }
[data-bs-theme="dark"] .source-gpx-icon { color: #4dabf7; }
[data-bs-theme="dark"] .untappd-icon { color: #ffc61a; }
/* Tmavá emoji (obal přidá theme.js): černé tlapky 🐾 obrácené na světlé, hnědá aktovka 💼 zesvětlená */
[data-bs-theme="dark"] .emoji-dark[data-emoji="paw"] { filter: invert(1); }
[data-bs-theme="dark"] .emoji-dark[data-emoji="case"] { filter: brightness(1.7) saturate(0.6); }
[data-bs-theme="dark"] .race-badge { color: #ffa94d; }
[data-bs-theme="dark"] .save-success { color: #51cf66; }
[data-bs-theme="dark"] .save-error { color: #ff6b6b; }
[data-bs-theme="dark"] .source-gpx { background: #1b3352; color: #a5c8ff; border-color: #2f5585; }
[data-bs-theme="dark"] .source-strava { background: #45261a; color: #ffb38a; border-color: #7a3d22; }
[data-bs-theme="dark"] .icon-choice:hover { background: #26303c; }
[data-bs-theme="dark"] .icon-choice.active { border-color: #74a7ff; background: #1f3350; }
[data-bs-theme="dark"] .vehicle-picker .type-option.active, [data-bs-theme="dark"] .type-picker .type-option.active { background: #1f3350; border-color: #74a7ff; color: #a5c8ff; }
[data-bs-theme="dark"] .route-steps tr.route-step-selected > td { background: #1f3350; }
[data-bs-theme="dark"] #route-map-steps tr.replay-current > * { background: rgba(77, 171, 247, .2); }

/* Úspěchy: odznaky s tmavým podkladem v barvě úrovně */
[data-bs-theme="dark"] .ach-badge { --ach-bg: #2a2f35; }
[data-bs-theme="dark"] .ach-bronze { --ach-color: #d08b4f; --ach-bg: #3a2a1d; }
[data-bs-theme="dark"] .ach-silver { --ach-color: #b4bec8; --ach-bg: #2c3136; }
[data-bs-theme="dark"] .ach-gold { --ach-color: #f2c230; --ach-bg: #3a3218; }
[data-bs-theme="dark"] .ach-platinum { --ach-color: #38c9b8; --ach-bg: #163632; }
[data-bs-theme="dark"] .ach-diamond { --ach-color: #9775fa; --ach-bg: #2b2348; }
[data-bs-theme="dark"] .ach-crown { --ach-color: #f06595; --ach-bg: #45202f; }
[data-bs-theme="dark"] .ach-locked { --ach-color: #495057; --ach-bg: #25292e; }
[data-bs-theme="dark"] .ach-emoji-new { box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px #22c55e; }
[data-bs-theme="dark"] .ach-progress { background: #4d8fd6; }

/* Kalendář roku: popisky a hrana dne */
[data-bs-theme="dark"] .calendar-svg .cal-label { fill: #adb5bd; }
[data-bs-theme="dark"] .calendar-svg rect:hover { stroke: #f8f9fa; }
[data-bs-theme="dark"] .calendar-svg .cal-month-border { stroke: #6c757d; }

/* Potvrzovací okno */
[data-bs-theme="dark"] .app-dialog { box-shadow: 0 1rem 3rem rgba(0, 0, 0, .6); }
[data-bs-theme="dark"] .app-dialog-icon.is-question,
[data-bs-theme="dark"] .app-dialog-icon.is-info { background: #1b3352; color: #74a7ff; }
[data-bs-theme="dark"] .app-dialog-icon.is-danger,
[data-bs-theme="dark"] .app-dialog-icon.is-error { background: #4a2427; color: #ff8787; }
[data-bs-theme="dark"] .app-dialog-icon.is-warning { background: #43301c; color: #ffc078; }

/* Bootstrap: světlé utility a tlačítka, které Bootstrap v tmavém vzhledu nechává světlé */
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #343a40; --bs-btn-border-color: #343a40; --bs-btn-color: #dee2e6;
    --bs-btn-hover-bg: #3d444b; --bs-btn-hover-border-color: #3d444b; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #495057; --bs-btn-active-border-color: #495057; --bs-btn-active-color: #fff; }
[data-bs-theme="dark"] .bg-light { background-color: var(--bs-tertiary-bg) !important; }
[data-bs-theme="dark"] .bg-white { background-color: var(--bs-body-bg) !important; }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--bs-tertiary-bg) !important; color: var(--bs-body-color) !important; }
[data-bs-theme="dark"] .table-light { --bs-table-bg: #2a2f35; --bs-table-color: #dee2e6; --bs-table-border-color: var(--app-border); }
/* Barevné řádky tabulek (chyba v Logu aktivit, náhled importu…): Bootstrap je má jen světlé – tmavý podklad, světlé písmo */
[data-bs-theme="dark"] .table-danger,
[data-bs-theme="dark"] .table-warning,
[data-bs-theme="dark"] .table-success,
[data-bs-theme="dark"] .table-primary {
    --bs-table-color: #dee2e6; --bs-table-striped-color: #dee2e6; --bs-table-active-color: #dee2e6; --bs-table-hover-color: #fff;
}
[data-bs-theme="dark"] .table-danger { --bs-table-bg: #3a1a1e; --bs-table-border-color: #5c2a30; --bs-table-hover-bg: #4a2228; --bs-table-striped-bg: #422025; --bs-table-active-bg: #4a2228; }
[data-bs-theme="dark"] .table-warning { --bs-table-bg: #3a3214; --bs-table-border-color: #5c4f20; --bs-table-hover-bg: #4a3f1a; --bs-table-striped-bg: #423917; --bs-table-active-bg: #4a3f1a; }
[data-bs-theme="dark"] .table-success { --bs-table-bg: #18321f; --bs-table-border-color: #275032; --bs-table-hover-bg: #1f4028; --bs-table-striped-bg: #1c3924; --bs-table-active-bg: #1f4028; }
[data-bs-theme="dark"] .table-primary { --bs-table-bg: #1a2c42; --bs-table-border-color: #29466a; --bs-table-hover-bg: #213855; --bs-table-striped-bg: #1e324b; --bs-table-active-bg: #213855; }

/* Mapy: ovládací prvky, bubliny a přehrávač tmavé (podklad mapy beze změny) */
[data-bs-theme="dark"] .leaflet-container { background: #2a2f35; }
[data-bs-theme="dark"] .leaflet-popup-content-wrapper,
[data-bs-theme="dark"] .leaflet-popup-tip { background: #2a2f35; color: #dee2e6; box-shadow: 0 3px 14px rgba(0, 0, 0, .6); }
[data-bs-theme="dark"] .leaflet-container a.leaflet-popup-close-button { color: #adb5bd; }
[data-bs-theme="dark"] .leaflet-tooltip { background: #2a2f35; color: #dee2e6; border-color: #495057; }
[data-bs-theme="dark"] .leaflet-tooltip-top::before { border-top-color: #2a2f35; }
[data-bs-theme="dark"] .leaflet-tooltip-bottom::before { border-bottom-color: #2a2f35; }
[data-bs-theme="dark"] .leaflet-tooltip-left::before { border-left-color: #2a2f35; }
[data-bs-theme="dark"] .leaflet-tooltip-right::before { border-right-color: #2a2f35; }
[data-bs-theme="dark"] .leaflet-bar a { background-color: #2a2f35; color: #dee2e6; border-bottom-color: #495057; }
[data-bs-theme="dark"] .leaflet-bar a:hover { background-color: #343a40; }
[data-bs-theme="dark"] .leaflet-bar a.leaflet-disabled { background-color: #24282c; color: #6c757d; }
[data-bs-theme="dark"] .leaflet-control-layers { background: #2a2f35; color: #dee2e6; }
[data-bs-theme="dark"] .leaflet-control-layers-toggle { background-color: #dee2e6; border-radius: 4px; }
[data-bs-theme="dark"] .leaflet-control-attribution { background: rgba(33, 37, 41, .8) !important; color: #adb5bd; }
[data-bs-theme="dark"] .leaflet-control-attribution a { color: #8ec5ff; }
[data-bs-theme="dark"] .route-replay { background: #2a2f35; color: #dee2e6; }
[data-bs-theme="dark"] .map-utils-year select,
[data-bs-theme="dark"] .map-utils-year input { background: #2a2f35; color: #dee2e6; }

/* Detail místa: kdy tam bývám (dny v týdnu × hodiny) */
.place-rhythm { display: grid; grid-template-columns: 1.4rem repeat(24, minmax(6px, 1fr)); gap: 2px; max-width: 26rem; font-size: .65rem; }
.place-rhythm-day, .place-rhythm-hour { color: var(--bs-secondary-color); line-height: 1; }
.place-rhythm-year { grid-template-columns: 1.6rem repeat(31, minmax(5px, 1fr)); max-width: 30rem; }
.place-rhythm-switch .btn { padding: 0 .5rem; font-size: .75rem; }
.place-rhythm-cell { aspect-ratio: 1; border-radius: 2px; background: rgba(13, 110, 253, var(--level)); outline: 1px solid var(--bs-border-color-translucent); }

/* Celková statistika: vzdálenost od domova, objevování, mapa piv */
.distance-year { width: 2.6rem; flex: none; }
.distance-bar { display: flex; height: 1.15rem; border-radius: .25rem; overflow: hidden; background: var(--bs-secondary-bg); }
.distance-bar span { display: block; height: 100%; color: #fff; font-size: .7rem; line-height: 1.15rem; text-align: center; overflow: hidden; white-space: nowrap; }
.distance-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }
.discovery-share { min-width: 7rem; }
.discovery-share .progress { height: 1rem; }
.discovery-months { display: inline-flex; align-items: flex-end; gap: 1px; height: 1.4rem; }
.discovery-months span { display: block; width: 5px; min-height: 1px; background: var(--bs-primary); opacity: .75; }
.beer-map { height: 340px; }
.on-this-day-weather { width: 1.4rem; text-align: center; flex: none; }

/* Úprava záznamu z mapy dne: stránka Záznamů v rámu přes okno mapy (jen její okno úprav) */
.record-window-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1100;
    background: transparent; color-scheme: normal; opacity: 0; pointer-events: none; }
.record-window-frame.ready { opacity: 1; pointer-events: auto; }
.record-window-spinner { position: fixed; inset: 0; z-index: 1099; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .25); }

/* Výlety: tabulka po letech a okno výletu se záložkami */
.trips-table .trip-row { cursor: pointer; }
.trips-table .trip-row:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
.trip-row-flags { display: inline-flex; gap: .2rem; margin-right: .35rem; vertical-align: -1px; }
.trip-row-flags:empty { display: none; }
/* Záložky okna výletu: na úzké obrazovce posun prstem, bez posuvníku */
.trip-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.trip-tabs::-webkit-scrollbar { display: none; }
.trip-tabs .nav-link { white-space: nowrap; padding: .45rem .75rem; }
.trip-row-link { color: var(--bs-secondary-color); }
.trip-row-link:hover { color: var(--bs-link-color); }
.trip-row-with { white-space: nowrap; }
.trips-filter .form-control, .trips-filter .form-select { width: auto; }
.trips-filter #trip-search { min-width: 14rem; flex: 1 1 14rem; max-width: 24rem; }
/* Seznam států: každý stát na jednom řádku (šířka podle nejdelšího názvu), dlouhý seznam se posouvá */
.trip-country-menu { width: max-content; min-width: 17rem; max-width: calc(100vw - 2rem); max-height: 65vh; overflow-y: auto; }
.trip-country-menu .form-check-label { white-space: nowrap; }
/* Záložka Zdraví: dlaždice s ikonami a pruhy po dnech */
.trip-health-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem; }
.trip-health-tile { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--app-border); border-radius: .5rem; padding: .5rem .7rem; }
.trip-health-tile > i { font-size: 1.3rem; color: var(--bs-secondary-color); width: 1.6rem; text-align: center; }
.trip-health-tile b { display: block; font-size: 1.1rem; font-weight: 600; line-height: 1.2; }
.trip-health-tile span { font-size: .75rem; color: var(--bs-secondary-color); }
.trip-health-days th { white-space: nowrap; font-weight: 600; }
.trip-health-days th i { color: var(--bs-secondary-color); }
.trip-health-bar-cell { min-width: 8.5rem; }
.trip-health-bar { height: .35rem; border-radius: .2rem; background: var(--bs-secondary-bg); overflow: hidden; margin-bottom: .1rem; }
.trip-health-bar span { display: block; height: 100%; border-radius: .2rem; }
.trip-health-bar .bar-steps { background: #2f9e44; }
.trip-health-bar .bar-sleep { background: #5f3dc4; }
.trip-health-bar .bar-battery { background: #1c7ed6; }
.trip-health-pill { display: inline-block; min-width: 2rem; padding: 0 .35rem; border-radius: 1rem; text-align: center; color: #fff; }
.trip-health-pill.low { background: #2f9e44; } .trip-health-pill.mid { background: #f08c00; } .trip-health-pill.high { background: #e03131; }
.trip-table td, .trip-table th { white-space: normal; }
.trip-itinerary-day td { background: var(--bs-tertiary-bg); font-weight: 600; }
/* Upravit / přidat výlet: čas vedle data (nepovinný) */
.trip-time-input { flex: 0 0 8rem; width: 8rem; }
/* Doprava: řádek druhu (souhrn) a pod ním vozidla / spoje */
.trip-transport-type td { background: var(--bs-tertiary-bg); }
.trip-transport-table .trip-connection td:nth-child(2), .trip-transport-table .trip-transport-vehicle td:nth-child(2) { padding-left: 1rem; }
.trip-itinerary-border td, .trip-itinerary-mode td { color: var(--bs-secondary-color); }
.trip-itinerary-border td:nth-child(3), .trip-itinerary-mode td:nth-child(3) { color: var(--bs-body-color); }
/* Itinerář: další místa zastávky / výletu po kliknutí, řádek státu a celý den na cestě */
.trip-itinerary-more { display: inline; }
.trip-itinerary-more summary { display: inline; cursor: pointer; list-style: none; }
.trip-itinerary-more summary::-webkit-details-marker { display: none; }
.trip-itinerary-more[open] summary { margin-right: .3rem; }
.trip-itinerary-country td { background: rgba(var(--bs-primary-rgb), .06); }
.trip-itinerary-transit td { color: var(--bs-secondary-color); font-style: italic; }
.trip-country-bar { display: flex; height: .55rem; border-radius: .3rem; overflow: hidden; background: var(--bs-secondary-bg); }
.trip-country-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; }
.trip-country-0 { background: #1971c2; } .trip-country-1 { background: #e8590c; } .trip-country-2 { background: #2f9e44; }
.trip-country-3 { background: #ae3ec9; } .trip-country-4 { background: #f08c00; } .trip-country-5 { background: #868e96; }
.beer-stars { color: #f59f00; font-size: .8rem; letter-spacing: -.05em; }
.trip-country-bar-thin { height: .4rem; }
.trip-vehicle-compact { font-size: .85rem; }

/* ==========================================================================
   Kalendář (templates/calendar_view.html): měsíc, rok, pásy dne, na den přesně a panel dne
   ========================================================================== */
.cal-page {
    --cal-surface: var(--bs-body-bg);
    --cal-surface-2: var(--bs-tertiary-bg);
    --cal-border: var(--app-border);
    --cal-muted: var(--bs-secondary-color);
    --cal-link: var(--bs-link-color);
    --cal-off: #c2410c;
    --cal-doma: #94a3b8; --cal-prace: #3b6ea8; --cal-cesta: #d98e2b; --cal-vylet: #2f9e6e; --cal-zahranici: #8a5cc7;
    --cal-nodata: #cbd5e1; --cal-bar-fg: #fff; --cal-strava: #fc4c02;
    --cal-heat-km: #1f5fa8; --cal-heat-places: #0e8a7c; --cal-heat-steps: #2f9e6e; --cal-cold: #2b6cb0; --cal-warm: #d0442c;
}
[data-bs-theme="dark"] .cal-page {
    --cal-off: #fb923c;
    --cal-doma: #64748b; --cal-prace: #5b8fd0; --cal-cesta: #e0a24a; --cal-vylet: #45b884; --cal-zahranici: #a27ddb;
    --cal-nodata: #3b4451; --cal-bar-fg: #0b1220; --cal-strava: #ff7a3d;
    --cal-heat-km: #6aa6ea; --cal-heat-places: #3cc2b0; --cal-heat-steps: #57c98f; --cal-cold: #5b9be6; --cal-warm: #f0715a;
}
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-bottom: .75rem; }
.cal-nav { display: flex; align-items: center; gap: .4rem; }
.cal-period { font-weight: 600; font-size: 1.1rem; min-width: 9.5em; text-align: center; }
.cal-ctl { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--cal-muted); margin: 0; }
.cal-ctl select { width: auto; }
.cal-hlcount { font-size: .88rem; color: var(--cal-link); font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; font-size: .82rem; color: var(--cal-muted); margin-bottom: .75rem; }
.cal-legend i:not([class*="fa-"]) { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.cal-grad { width: 140px; height: 10px; border-radius: 5px; display: inline-block; vertical-align: middle; margin: 0 6px; }
.cal-tip { margin-left: auto; }
.cal-strava-text { color: var(--cal-strava); }
.cal-flag { height: .8em; width: auto; vertical-align: 0; margin-right: .25em; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.cal-muted { color: var(--cal-muted); font-weight: 400 !important; }

.cal-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 1rem; }
.cal-sum { padding: .6rem .9rem; border-right: 1px solid var(--cal-border); min-width: 0; }
.cal-sum:last-child { border-right: 0; }
.cal-sum-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cal-muted); font-weight: 600; }
.cal-sum-v { font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-sum-v .cal-flag { height: .75em; }
.cal-d { font-size: .78rem; color: var(--cal-muted); font-variant-numeric: tabular-nums; display: block; }

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.cal-view { min-width: 0; transition: opacity .15s; }
.cal-busy { opacity: .5; pointer-events: none; }
.cal-loading { padding: 2rem; color: var(--cal-muted); display: flex; align-items: center; }
.cal-dim { opacity: .28; }

/* Měsíc */
.cal-grid { overflow: hidden; }
.cal-row { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
.cal-hd { padding: .4rem .5rem; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--cal-muted);
    background: var(--cal-surface-2); border-bottom: 1px solid var(--cal-border); }
.cal-hd.cal-off { color: var(--cal-off); }
.cal-wk { display: grid; place-items: start center; padding-top: .6rem; font-size: .7rem; color: var(--cal-muted); background: var(--cal-surface-2);
    border-right: 1px solid var(--cal-border); border-bottom: 1px solid var(--cal-border); font-variant-numeric: tabular-nums; }
.cal-head .cal-wk { padding-top: .45rem; }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-height: 124px; padding: 6px 7px 7px; border: 0; border-radius: 0;
    border-right: 1px solid var(--cal-border); border-bottom: 1px solid var(--cal-border); background: var(--cal-surface);
    color: inherit; text-align: left; cursor: pointer; min-width: 0; position: relative; font-size: inherit; }
.cal-row > .cal-cell:last-child { border-right: 0; }
.cal-row:last-child > * { border-bottom: 0; }
.cal-cell > span { display: block; min-width: 0; }
.cal-cell .cal-top { display: flex; align-items: center; gap: 5px; }
.cal-num { font-weight: 600; font-variant-numeric: tabular-nums; width: 1.75em; height: 1.75em; display: inline-grid; place-items: center;
    border-radius: 50%; margin-left: -3px; flex: none; }
.cal-off .cal-num, .cal-off.cal-st-lab, td.cal-off { color: var(--cal-off); }
.cal-today .cal-num { background: var(--cal-link); color: var(--cal-surface); }
.cal-hol { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cal-off); font-weight: 600; white-space: nowrap; }
.cal-wx { margin-left: auto; font-size: .78rem; display: flex; gap: 2px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-cell .cal-trip { height: 18px; }
.cal-bar { display: block; height: 18px; line-height: 18px; font-size: .7rem; font-weight: 600; color: var(--cal-bar-fg); padding: 0 7px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar b { font-weight: 600; position: relative; z-index: 1; }
.cal-bar-vylet { background: var(--cal-vylet); }
.cal-bar-zahranici { background: var(--cal-zahranici); }
.cal-bar.st { border-radius: 9px 0 0 9px; } .cal-bar.en { border-radius: 0 9px 9px 0; } .cal-bar.st.en { border-radius: 9px; }
.cal-bar.cl { margin-left: -7px; } .cal-bar.cr { margin-right: -8px; overflow: visible; }
.cal-main { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell .cal-stats { display: flex; gap: 4px; align-items: center; font-size: .76rem; color: var(--cal-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-tr { margin-left: auto; display: flex; gap: 3px; }
.cal-cell .cal-badges { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: .74rem; margin-top: auto; font-variant-numeric: tabular-nums; }
.cal-badges .fa-solid { margin-right: 2px; }
.cal-cell:hover { box-shadow: inset 0 0 0 1px var(--cal-link); }
.cal-cell.cal-sel { box-shadow: inset 0 0 0 2px var(--cal-link); }
.cal-cell.cal-out { background: var(--cal-surface-2); cursor: default; box-shadow: none; }
.cal-cell.cal-out .cal-num { color: var(--cal-muted); opacity: .55; }
.cal-nodata { background: repeating-linear-gradient(135deg, var(--cal-surface) 0 5px, var(--cal-surface-2) 5px 10px) !important; }

/* Panel dne */
.cal-panel { padding: 1rem; position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.cal-panel h2 { font-size: 1.25rem; margin: 0; font-weight: 600; }
.cal-p-dow { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cal-muted); font-weight: 600; }
.cal-p-hol { color: var(--cal-off); font-size: .85rem; font-weight: 600; }
.cal-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px;
    background: var(--cal-surface-2); white-space: nowrap; }
.cal-pill i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-p-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cal-p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--cal-border); border-radius: .6rem; }
.cal-p-stats div { padding: .4rem .6rem; border-right: 1px solid var(--cal-border); }
.cal-p-stats div:last-child { border-right: 0; }
.cal-p-stats b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cal-p-stats span { font-size: .72rem; color: var(--cal-muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-p-trip { font-size: .88rem; padding: .45rem .6rem; border-radius: .5rem; color: inherit; text-decoration: none; }
.cal-p-trip:hover { text-decoration: underline; color: inherit; }
.cal-p-trip-vylet { background: color-mix(in oklab, var(--cal-vylet) 16%, var(--cal-surface)); }
.cal-p-trip-zahranici { background: color-mix(in oklab, var(--cal-zahranici) 16%, var(--cal-surface)); }
.cal-p-h { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cal-muted); font-weight: 600; margin-bottom: .25rem; }
.cal-p-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .86rem; overflow-wrap: anywhere; }
.cal-tl { list-style: none; margin: 0; padding: 0; font-size: .86rem; max-height: 22rem; overflow-y: auto; }
.cal-tl li { display: grid; grid-template-columns: 88px 20px minmax(0, 1fr); gap: 4px; padding: 3px 0; border-bottom: 1px dashed var(--cal-border); align-items: baseline; }
.cal-tl li:last-child { border-bottom: 0; }
.cal-tl-tm { color: var(--cal-muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.cal-tl-travel { color: var(--cal-muted); }
.cal-p-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Rok */
.cal-year { padding: .9rem 1rem; overflow-x: auto; }
.cal-yr-grid { display: flex; flex-direction: column; gap: 4px; min-width: 520px; max-width: 940px; }
.cal-yr-row { display: grid; grid-template-columns: 46px repeat(31, minmax(0, 1fr)) 64px; gap: 3px; align-items: center; }
.cal-yr-head span { font-size: .68rem; color: var(--cal-muted); text-align: center; font-variant-numeric: tabular-nums; }
.cal-yr-m { font-size: .8rem; color: var(--cal-link); background: none; border: 0; text-align: left; cursor: pointer; padding: 0; font-weight: 600; }
.cal-yr-km { font-size: .74rem; color: var(--cal-muted); text-align: right; font-variant-numeric: tabular-nums; }
.cal-sq { aspect-ratio: 1; border-radius: 3px; border: 0; padding: 0; cursor: pointer; background: var(--cal-surface-2); max-width: 100%; }
.cal-sq-empty { background: transparent; cursor: default; }
.cal-sq-future { background: transparent; box-shadow: inset 0 0 0 1px var(--cal-border); cursor: default; }
.cal-sq.cal-sel { outline: 2px solid var(--bs-body-color); outline-offset: 1px; }
.cal-sq-today { box-shadow: inset 0 0 0 2px var(--bs-body-color); }

/* Pásy */
.cal-strips { padding: .75rem 1rem; overflow-x: auto; }
.cal-st-in { min-width: 520px; }
.cal-st-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 120px; gap: .6rem; align-items: center; padding: 2px 4px; width: 100%;
    border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 5px; }
.cal-st-row:hover { background: var(--cal-surface-2); }
.cal-st-row.cal-sel { background: color-mix(in oklab, var(--cal-link) 14%, var(--cal-surface)); }
.cal-st-row:disabled { cursor: default; background: none; }
.cal-st-headrow { cursor: default; }
.cal-st-headrow:hover { background: none; }
.cal-st-week { margin-top: .55rem; }
.cal-st-lab { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-st-track { position: relative; height: 16px; border-radius: 4px; background: var(--cal-surface-2); overflow: hidden; }
.cal-sg { position: absolute; top: 0; bottom: 0; }
.cal-k-home { background: color-mix(in oklab, var(--cal-doma) 45%, var(--cal-surface)); }
.cal-k-work { background: var(--cal-prace); }
.cal-k-other { background: var(--cal-vylet); }
.cal-k-travel { background: var(--cal-cesta); }
.cal-k-strava { background: var(--cal-strava); z-index: 1; box-shadow: inset 0 0 0 1.5px var(--cal-surface); border-radius: 3px; }
.cal-legend .cal-k-strava { box-shadow: none; }
.cal-st-km { font-size: .76rem; color: var(--cal-muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-st-hours { position: relative; height: 16px; font-size: .68rem; color: var(--cal-muted); }
.cal-st-hours span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }

/* Na den přesně */
.cal-otd tr[data-date] { cursor: pointer; }
.cal-otd tr.cal-sel > td { background: color-mix(in oklab, var(--cal-link) 12%, var(--cal-surface)); }
.cal-otd-y { font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 1199.98px) {
    .cal-layout { grid-template-columns: minmax(0, 1fr); }
    .cal-panel { position: static; }
}
@media (max-width: 991.98px) {
    .cal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cal-sum:nth-child(3) { border-right: 0; }
    .cal-sum:nth-child(-n+3) { border-bottom: 1px solid var(--cal-border); }
    .cal-tip { margin-left: 0; width: 100%; }
}
@media (max-width: 767.98px) {
    .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .cal-wk { display: none; }
    .cal-cell { min-height: 62px; padding: 4px 3px; gap: 2px; }
    .cal-cell .cal-main, .cal-cell .cal-stats, .cal-cell .cal-badges, .cal-cell .cal-hol, .cal-wx .t { display: none; }
    .cal-cell .cal-top { flex-direction: column; align-items: center; gap: 0; }
    .cal-num { margin-left: 0; }
    .cal-wx { margin-left: 0; }
    .cal-cell .cal-trip { height: 5px; margin-top: auto; }
    .cal-bar { height: 5px; font-size: 0; padding: 0; }
    .cal-bar.cl { margin-left: -3px; } .cal-bar.cr { margin-right: -4px; }
    .cal-hd { padding: .35rem .2rem; text-align: center; }
    .cal-period { min-width: 8em; font-size: 1rem; }
}
@media (max-width: 575.98px) {
    .cal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-sum { border-right: 1px solid var(--cal-border); border-bottom: 1px solid var(--cal-border); }
    .cal-sum:nth-child(2n) { border-right: 0; }
    .cal-sum:nth-child(3) { border-right: 1px solid var(--cal-border); }
    .cal-sum:nth-last-child(-n+2) { border-bottom: 0; }
}
