:root {
    --color-bg: #ffffff;
    --color-fg: #1a1a1a;
    --color-muted: #6b6b6b;
    --color-line: #e5e5e5;
    --color-accent: #e1005b;
    --color-accent-hover: #b8004a;
    --color-header-bg: #ffffff;
    --color-header-fg: #1a1a1a;
    --header-height: 72px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-fg);
    font: 16px/1.5 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a {
    color: inherit;
}

/* ---------- Header ---------- */

.site-header {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--header-height);
    padding: 0 24px;
    background: var(--color-header-bg);
    color: var(--color-header-fg);
    border-bottom: 1px solid var(--color-line);
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img {
    height: 32px;
    display: block;
}

.site-nav {
    display: flex;
    gap: 24px;
    margin-left: 16px;
}

.site-nav a {
    color: var(--color-header-fg);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}

.site-nav a:hover {
    border-bottom-color: var(--color-accent);
}

.site-nav a.is-active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.site-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-email {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9em;
}

.user-email:hover {
    color: var(--color-fg);
}

.logout-form {
    margin: 0;
}

/* ---------- Buttons ---------- */

/* ============================================================
   Buttons — single source of truth.
   One base class `.btn` + variants (primary / secondary / danger) + size
   modifiers (sm / lg) + `btn-block` for full-width form submits.
   Nothing else should restyle button appearance; layout containers may
   only position buttons (flex rows). Variants set their own color on both
   rest and :hover so context link-color rules can never bleed through.
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* `display: inline-flex` above out-specifies the UA [hidden] rule, so a .btn
   with the hidden attribute would stay visible — make hiding actually work. */
.btn[hidden] {
    display: none;
}

/* Variants */
.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    border-color: var(--color-line);
    color: var(--color-fg);
}

.btn-secondary:hover {
    background: var(--color-line);
    border-color: var(--color-line);
    color: var(--color-fg);
}

.btn-danger {
    background: transparent;
    border-color: var(--color-line);
    color: #c0143c;
}

.btn-danger:hover {
    background: #c0143c;
    border-color: #c0143c;
    color: #fff;
}

/* Sizes */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.05em;
}

/* Full-width — stacked single-action forms (login, register, password reset) */
.btn-block {
    display: flex;
    width: 100%;
}

/* ---------- Flash messages ---------- */

[class^="flash-"] {
    padding: 12px 24px;
    border-bottom: 1px solid var(--color-line);
}

.flash-success { background: #e8f5e9; }
.flash-error { background: #fdecea; }
.flash-warning { background: #fff8e1; }

/* ---------- Page grid (panels on index) ---------- */

.page-grid {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ---------- Shared panel ---------- */

.panel {
    border: 1px solid var(--color-line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-line);
    background: #fafafa;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.panel-dot-tv {
    background: var(--color-accent);
    box-shadow: 0 0 0 0 var(--color-accent);
    animation: tv-pulse 2s infinite;
}

.panel-dot-map {
    background: #2e7d32;
}

.panel-dot-crossings {
    background: #f5a300;
}

/* ---------- Recent crossings panel (index) ---------- */

.crossings-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crossings-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "date    style"
        "user    rating"
        "line    line"
        "comment comment";
    gap: 2px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-line);
    font-size: 0.85rem;
}

.crossings-list-panel .crossings-item:last-child {
    border-bottom: none;
}

.crossings-date {
    grid-area: date;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.crossings-user {
    grid-area: user;
    font-weight: 600;
    color: var(--color-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

a.crossings-user:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.crossings-line {
    grid-area: line;
    color: var(--color-fg);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

a.crossings-line:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.crossings-rating {
    grid-area: rating;
    font-size: 0.7rem;
    letter-spacing: -0.05em;
    color: var(--color-line);
    white-space: nowrap;
}

.crossings-star.on {
    color: var(--color-accent);
}

.crossings-rating-none {
    color: var(--color-line);
}

.crossings-style {
    grid-area: style;
    align-self: center;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    background: rgba(225, 0, 91, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    justify-self: end;
}

.crossings-comment {
    grid-area: comment;
    margin: 6px 0 0;
    padding: 6px 10px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--color-fg);
    font-style: italic;
    background: #fafafa;
    border-left: 2px solid var(--color-accent);
    border-radius: 0 3px 3px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

@keyframes tv-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(225, 0, 91, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(225, 0, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(225, 0, 91, 0); }
}

.panel-link {
    font-size: 0.85rem;
    color: var(--color-muted);
    text-decoration: none;
    font-weight: 500;
}

.panel-link:hover {
    color: var(--color-accent);
}

/* ---------- Homepage map panel (merged map + crossings) ---------- */

.hp-map-body {
    display: flex;
    height: 520px;
}

.hp-crossings {
    flex: 0 0 290px;
    overflow-y: auto;
    border-right: 1px solid var(--color-line);
}

.hp-crossings-empty {
    margin: 0;
    padding: 16px;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.crossings-item.hp-crossing {
    cursor: pointer;
    transition: background 0.15s;
}

.crossings-item.hp-crossing:hover {
    background: #fafafa;
}

.crossings-item.hp-crossing.is-active {
    background: rgba(225, 0, 91, 0.06);
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.hp-map-canvas-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.hp-map-canvas {
    position: absolute;
    inset: 0;
}

@media (max-width: 760px) {
    .hp-map-body {
        flex-direction: column;
        height: auto;
    }

    .hp-crossings {
        flex-basis: auto;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid var(--color-line);
    }

    .hp-map-canvas-wrap {
        height: 320px;
    }
}

/* User emoji circle marker — one per recent active user. */
.user-circle-icon {
    background: transparent;
    border: none;
}

.user-circle-icon .user-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-size: 17px;
    line-height: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.user-circle-icon:hover .user-emoji {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(225, 0, 91, 0.4);
    z-index: 1000;
}

/* Crossing-complete celebration — homepage walker (hp_map_controller). One picked
   at random when the athlete reaches the far anchor. Animates the emoji's own
   transform; the marker position lives on the parent .leaflet-marker-icon, so the
   two never fight. */
.user-emoji.hp-cel-bounce { animation: hp-cel-bounce 0.8s ease; }
.user-emoji.hp-cel-flip   { animation: hp-cel-flip 0.8s ease; }
.user-emoji.hp-cel-spin   { animation: hp-cel-spin 0.8s ease-in-out; }
.user-emoji.hp-cel-pop    { animation: hp-cel-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1); }
.user-emoji.hp-cel-wobble { animation: hp-cel-wobble 0.8s ease-in-out; }

@keyframes hp-cel-bounce {
    0%, 100% { transform: translateY(0); }
    25%      { transform: translateY(-12px); }
    45%      { transform: translateY(0); }
    65%      { transform: translateY(-6px); }
    85%      { transform: translateY(0); }
}

@keyframes hp-cel-flip {
    0%   { transform: rotateY(0) scale(1); }
    50%  { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(360deg) scale(1); }
}

@keyframes hp-cel-spin {
    0%   { transform: rotate(0) scale(1); }
    60%  { transform: rotate(360deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes hp-cel-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

@keyframes hp-cel-wobble {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(-15deg); }
    40%      { transform: rotate(12deg); }
    60%      { transform: rotate(-8deg); }
    80%      { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .user-emoji[class*="hp-cel-"] { animation: none; }
}

/* Thought bubble above the walker when the crossing has a comment. Decent: small,
   light, fades in. Sibling of .user-emoji so the celebration transform skips it. */
.hp-thought {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 9px;
    width: max-content;
    max-width: 168px;
    padding: 5px 9px;
    background: #fff;
    color: var(--color-fg);
    border: 1px solid var(--color-line);
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
    font-size: 11px;
    line-height: 1.35;
    font-style: italic;
    text-align: center;
    pointer-events: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0;
    animation: hp-thought-in 0.45s ease 0.3s forwards;
}

/* Trailing thought dot connecting bubble → head. */
.hp-thought::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-line);
}

@keyframes hp-thought-in {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .hp-thought { animation: none; opacity: 1; }
}

.user-popup strong {
    font-size: 1.05em;
}

.user-popup-line {
    font-style: italic;
}

.user-popup .muted {
    color: var(--color-muted);
    font-size: 0.9em;
}

.user-popup-stars {
    color: var(--color-accent);
    letter-spacing: -0.05em;
}

/* slackTV teaser on the homepage — full-width horizontal scroll strip. */
.tv-strip {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.tv-strip-item {
    flex: 0 0 240px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tv-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-line);
}

.tv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.tv-thumb:hover img {
    transform: scale(1.05);
}

.tv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.2s;
}

.tv-thumb:hover .tv-play {
    opacity: 1;
}

.tv-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tv-title {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tv-title a {
    color: var(--color-fg);
    text-decoration: none;
}

.tv-title a:hover {
    color: var(--color-accent);
}

.tv-sub {
    font-size: 0.75rem;
    color: var(--color-muted);
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.tv-sub a {
    color: inherit;
    text-decoration: none;
}

.tv-sub a:hover {
    color: var(--color-accent);
}

.tv-sep {
    opacity: 0.5;
}

/* ---------- slackTV page (/tv) ---------- */

.tv-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.tv-page-header {
    margin-bottom: 24px;
}

.tv-page-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tv-page-sub {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* Sections (Kanály / Playlisty / Hashtagy) → each holds one or more horizontal
   sliders. Slider = native horizontal scroll of fixed-width cards; the trailing
   card is a load-more button (AJAX) or a "Vše na YouTube" link. */
.tv-section {
    margin-top: 44px;
}

.tv-section:first-of-type {
    margin-top: 8px;
}

.tv-section-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tv-slider-group {
    margin-top: 22px;
}

.tv-slider-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

.tv-slider-title a {
    color: var(--color-fg);
    text-decoration: none;
}

.tv-slider-title a:hover {
    color: var(--color-accent);
}

.tv-slider {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
}

.tv-slider-track {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: max-content;
}

.tv-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tv-slider-track .tv-card {
    flex: 0 0 260px;
    width: 260px;
    scroll-snap-align: start;
}

/* Trailing tile — load-more button or "view all on YouTube" link. Narrower
   than a video card; the scoped rule below out-specifies `.tv-slider-track
   .tv-card` (same 0,2,0 specificity, later in source). */
.tv-slider-track .tv-more-card {
    flex: 0 0 170px;
    width: 170px;
}

.tv-more-card {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--color-line);
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.tv-more-card:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.tv-more-card.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.tv-more-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tv-more-icon {
    font-size: 1.7rem;
    line-height: 1;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────
   Generic, reusable tab component (controller: tabs). One panel visible at a
   time. Default look is an underline tab bar; add `.tabs-pills` for chips. */
.tabs-list {
    display: flex;
    gap: 4px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--color-line);
}

.tab {
    padding: 9px 16px;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--color-muted);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
    color: var(--color-fg);
}

.tab[aria-selected="true"] {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-panel[hidden] {
    display: none;
}

/* Pill variant — chips that wrap, no underline bar (e.g. /tv hashtags). */
.tabs-pills .tabs-list {
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    border-bottom: 0;
}

.tabs-pills .tab {
    padding: 5px 13px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tabs-pills .tab:hover {
    color: var(--color-fg);
    border-color: var(--color-fg);
}

.tabs-pills .tab[aria-selected="true"] {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.tab-panel .tv-slider-group {
    margin-top: 14px;
}

/* ── Table ─────────────────────────────────────────────────────────────────
   Generic, reusable data table. Page-agnostic — wrap in .table-wrap for
   horizontal scroll on narrow screens; style cells with the helper classes
   (.table-num for numeric/nowrap, .table-actions for a trailing action cell,
   .table-subtext for a muted second line). */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th,
.table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-line);
}

.table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table-num {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--color-muted);
}

.table-muted {
    color: var(--color-muted);
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions form {
    display: inline;
}

.table-subtext {
    display: block;
    margin-top: 3px;
    color: var(--color-muted);
}

/* Sortable header affordance for tables driven by the `data-table` controller.
   Page-agnostic — any `.table` with `data-sort-type` headers gets it. */
.table th[data-sort-type] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.table th[data-sort-type]:hover {
    color: var(--color-fg);
}

.table th[data-sort-type]::after {
    content: '↕';
    margin-left: 4px;
    opacity: 0.35;
    font-size: 0.85em;
}

.table th[aria-sort="ascending"]::after {
    content: '↑';
    opacity: 1;
    color: var(--color-accent);
}

.table th[aria-sort="descending"]::after {
    content: '↓';
    opacity: 1;
    color: var(--color-accent);
}

/* ── Deníčky (public diary directory) ──────────────────────────────────────── */
.denicky-toolbar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-line);
}

.denicky-search {
    width: 100%;
    max-width: 360px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-size: 0.9rem;
    background: var(--color-bg);
    color: var(--color-fg);
}

.denicky-search::placeholder {
    color: var(--color-muted);
}

.denicky-search:focus {
    outline: none;
    border-color: var(--color-accent);
}

.denicky-table a {
    color: var(--color-fg);
    text-decoration: none;
    font-weight: 600;
}

.denicky-table a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.denicky-empty {
    padding: 16px 14px;
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .tv-slider-track .tv-card {
        flex-basis: 220px;
        width: 220px;
    }
}

.tv-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: none;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-line);
    cursor: pointer;
}

.tv-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.tv-card-media:hover img {
    transform: scale(1.04);
}

.tv-card-media .tv-play {
    font-size: 2rem;
    opacity: 0.85;
}

.tv-card-media:hover .tv-play {
    opacity: 1;
}

.tv-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 6px;
    display: block;
}

.tv-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tv-empty {
    color: var(--color-muted);
}

/* ---------- Admin: Data report (kontrola/retuš legacy dat) ---------- */

.dr-header {
    margin-bottom: 4px;
}

.dr-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.dr-sub {
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.dr-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-accent);
    border-radius: 10px;
    padding: 1px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.dr-intro {
    margin: 0;
    padding: 14px 16px;
    color: var(--color-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    border-bottom: 1px solid var(--color-line);
}

.dr-table-wrap {
    overflow-x: auto;
}

.dr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dr-table th,
.dr-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

.dr-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    font-weight: 600;
    background: #fafafa;
}

.dr-table tbody tr:hover {
    background: rgba(225, 0, 91, 0.04);
}

.dr-num { text-align: right; font-variant-numeric: tabular-nums; }
.dr-id { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.dr-muted { color: var(--color-muted); }
.dr-bool { text-align: center; color: var(--color-muted); }
.dr-warn { color: #f5a300; font-weight: 700; }

.dr-line {
    color: var(--color-fg);
    text-decoration: none;
    font-weight: 600;
}

.dr-line:hover { color: var(--color-accent); text-decoration: underline; }

.dr-go a {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 1.05rem;
}

.dr-go a:hover { color: var(--color-accent); }

/* ---------- Site footer (magic banner) ---------- */

.site-footer {
    --footer-logo-width: clamp(220px, 32vw, 360px);
    --footer-logo-height: calc(var(--footer-logo-width) * 507 / 4000);

    position: relative;
    height: 260px;
    overflow: hidden;
    margin-top: 64px;
    color: #fff;
    border-top: 2px solid var(--color-accent);
}

.site-footer-bg,
.site-footer-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.site-footer-bg {
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 0;
}

.site-footer-vignette {
    background:
        radial-gradient(ellipse at 50% 55%, transparent 25%, rgba(0, 0, 0, 0.55) 95%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
}

.site-footer-content {
    position: relative;
    z-index: 2;
    height: 100%;
}

.site-footer-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--footer-logo-width);
    color: #fff;
    filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.55));
}

.site-footer-logo svg {
    display: block;
    width: 100%;
    height: auto;
}

.site-footer-copy {
    position: absolute;
    left: 50%;
    top: calc(50% + var(--footer-logo-height) / 2 + 16px);
    transform: translateX(-50%);
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

/* ---------- Intro splash overlay ---------- */

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at center, #1a0010 0%, #050005 75%);
    color: #fff;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro-dismissing {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
    visibility: hidden;
    transition: opacity 0.7s ease, transform 0.7s ease, visibility 0s linear 0.7s;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    text-align: center;
}

.intro-logo {
    width: clamp(240px, 42vw, 440px);
    height: auto;
    display: block;
    filter:
        drop-shadow(0 0 18px rgba(225, 0, 91, 0.85))
        drop-shadow(0 0 48px rgba(225, 0, 91, 0.55))
        drop-shadow(0 0 96px rgba(225, 0, 91, 0.35));
}

.intro-button {
    background: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    padding: 14px 44px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
    text-shadow: 0 0 18px rgba(225, 0, 91, 0.7);
    box-shadow:
        0 0 24px rgba(225, 0, 91, 0.4),
        inset 0 0 16px rgba(225, 0, 91, 0.1);
}

.intro-button--small {
    padding: 8px 20px;
    font-size: 0.7rem;
}

.intro-button:hover,
.intro-button:focus-visible {
    background: var(--color-accent);
    color: #0a0005;
    text-shadow: none;
    box-shadow:
        0 0 60px rgba(225, 0, 91, 0.8),
        inset 0 0 12px rgba(255, 255, 255, 0.3);
    outline: none;
}

.intro-button:active {
    transform: scale(0.97);
}

.intro-button-slackvibes {
    position: absolute;
    bottom: 0;
    left: 50%;
    translate: -50% -150%;
}

@media (prefers-reduced-motion: reduce) {
    .intro-overlay {
        transition: opacity 0.2s ease;
    }
}

/* ---------- Music player panel (visible after splash dismissed) ---------- */

/* The wrapper is in the header — display: contents makes its children
 * (overlay, music-panel) participate in the .site-user flex layout directly. */
.intro-wrapper {
    display: contents;
}

.music-panel {
    /* Default = expanded (floating). The compact state docks in the header. */
    position: fixed;
    bottom: 80px;
    left: 24px;
    width: 320px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s ease,
        opacity 0.5s ease 0.4s,
        transform 0.5s ease 0.4s;
}

.music-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-radio-icon {
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.music-radio-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    overflow: hidden;
    white-space: nowrap;
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
    max-width: 200px;
    opacity: 1;
}

.music-panel-dot {
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
    max-width: 8px;
    opacity: 1;
    overflow: hidden;
}

.music-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    margin-left: 4px;
}

.music-eq > span {
    display: block;
    width: 3px;
    background: var(--color-accent);
    border-radius: 1px;
    height: 28%;
    animation: music-eq-bar 0.9s ease-in-out infinite;
    animation-play-state: paused;
    opacity: 0.45;
    transition: opacity 0.25s ease;
}

.music-panel.is-playing .music-eq > span {
    animation-play-state: running;
    opacity: 1;
}

.music-eq > span:nth-child(1) { animation-delay: 0s;    animation-duration: 0.95s; }
.music-eq > span:nth-child(2) { animation-delay: 0.15s; animation-duration: 0.75s; }
.music-eq > span:nth-child(3) { animation-delay: 0.30s; animation-duration: 1.05s; }
.music-eq > span:nth-child(4) { animation-delay: 0.45s; animation-duration: 0.85s; }

@keyframes music-eq-bar {
    0%, 100% { height: 28%; }
    50%      { height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .music-eq > span { animation: none; height: 60%; }
}

.intro-wrapper.intro-started .music-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.music-panel-header {
    padding: 10px 14px;
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.music-panel:not(.is-compact) .music-panel-header {
    cursor: grab;
}

.music-panel.is-dragging,
.music-panel.is-dragging .music-panel-header {
    cursor: grabbing;
}

.music-panel.is-dragging {
    transition: none;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.music-panel-trail {
    display: flex;
    align-items: center;
    gap: 6px;
}


.music-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
    max-width: 100px;
    opacity: 1;
}

.music-mini {
    background: transparent;
    border: 1px solid var(--color-line);
    color: var(--color-fg);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.music-mini:hover,
.music-mini:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    outline: none;
}

.music-close {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(0, 0, 0, 0.45);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.music-close:hover,
.music-close:focus-visible {
    color: var(--color-accent);
    border-color: var(--color-accent);
    outline: none;
}

.intro-wrapper.music-hidden .music-panel {
    display: none;
}

.music-mini-icon {
    display: inline-flex;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.music-panel:not(.is-compact) .music-mini-icon-expand,
.music-panel.is-compact .music-mini-icon-collapse {
    display: none;
}

.music-panel-dot {
    background: var(--color-accent);
}

.music-mute {
    background: transparent;
    border: 1px solid var(--color-line);
    color: var(--color-fg);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit;
}

.music-mute:hover,
.music-mute:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    outline: none;
}

/* Mute button doubles as play/pause in compact state.
 * Icon visibility:
 *   full:    ♪ (sound on) / ⊘ (muted)
 *   compact: ▶ (paused)   / ⏸ (playing) — driven by .music-panel.is-playing
 */
.music-mute .music-icon { display: none; }
.music-mute .music-icon-on { display: inline-flex; }
.music-mute.is-muted .music-icon-on { display: none; }
.music-mute.is-muted .music-icon-off { display: inline-flex; }
.music-mute.is-muted { color: rgba(0, 0, 0, 0.4); }

.music-panel.is-compact .music-mute .music-icon-on,
.music-panel.is-compact .music-mute .music-icon-off { display: none; }
.music-panel.is-compact .music-mute .music-icon-play { display: inline-flex; }
.music-panel.is-compact.is-playing .music-mute .music-icon-play { display: none; }
.music-panel.is-compact.is-playing .music-mute .music-icon-pause { display: inline-flex; }
.music-panel.is-compact .music-mute { color: var(--color-fg); }

.music-now {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--color-line);
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.35s ease;
}

.music-now-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 28px;
    opacity: 1;
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
}

.music-now-artist {
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.55);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 24px;
    opacity: 1;
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
}

.music-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    overflow: hidden;
    max-height: 32px;
    opacity: 1;
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        margin 0.35s ease;
}

.music-progress {
    flex: 1;
    accent-color: var(--color-accent);
    height: 4px;
    cursor: pointer;
}

.music-time {
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.55);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.music-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    transition: margin 0.35s ease, gap 0.35s ease;
}

.music-ctrl-prev,
.music-ctrl-next {
    overflow: hidden;
    max-width: 60px;
    opacity: 1;
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        padding 0.35s ease,
        margin 0.35s ease;
}

.music-ctrl {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-fg);
    font-size: 1rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.music-ctrl:hover,
.music-ctrl:focus-visible {
    background: rgba(225, 0, 91, 0.08);
    color: var(--color-accent);
    outline: none;
}

.music-ctrl-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.9rem;
}

.music-ctrl-play:hover,
.music-ctrl-play:focus-visible {
    background: var(--color-accent-hover);
    color: #fff;
}

.music-queue {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.82rem;
    opacity: 1;
    transition:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.35s ease;
}

.music-queue-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.music-queue-item:hover {
    background: #fafafa;
}

.music-queue-item.is-current {
    background: rgba(225, 0, 91, 0.08);
}

.music-queue-num {
    flex: 0 0 auto;
    color: rgba(0, 0, 0, 0.4);
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    min-width: 16px;
    text-align: right;
}

.music-queue-item.is-current .music-queue-num {
    color: var(--color-accent);
}

.music-queue-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.music-queue-title {
    color: var(--color-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-queue-item.is-current .music-queue-title {
    color: var(--color-accent);
    font-weight: 600;
}

.music-queue-artist {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Compact (minimized) state ---------- */
/* The 📻 icon stays visible. Other parts collapse via max-width / max-height
 * + opacity so the toggle animates smoothly in both directions. */

/* Compact = docked into the header as a flex item. Body fully collapses. */
.music-panel.is-compact {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    z-index: auto;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background: #fafafa;
    box-shadow: none;
}

.music-panel.is-compact .music-panel-header {
    border-bottom: none;
    padding: 4px 6px 4px 12px;
    background: transparent;
    gap: 10px;
}

.music-panel.is-compact .music-panel-title {
    gap: 6px;
}

.music-panel.is-compact .music-panel-title h2 {
    font-size: 0.85rem;
}

.music-panel.is-compact .music-now,
.music-panel.is-compact .music-queue {
    max-height: 0;
    padding: 0;
    margin: 0;
    border-bottom: none;
    overflow: hidden;
    pointer-events: none;
}

@media (max-width: 600px) {
    .music-panel:not(.is-compact) {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

/* ---------- Article (about) ---------- */

.article {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    color: var(--color-fg);
}

.article-head {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-line);
}

.article h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.article-lead {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-muted);
}

.article section {
    margin-bottom: 32px;
}

.article h2 {
    font-size: 1.3rem;
    margin: 0 0 12px;
    color: var(--color-fg);
}

.article p {
    margin: 0 0 14px;
    line-height: 1.7;
}

/* Mini medailonky — Kolouch & Vejvis */
.people-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.person {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    padding: 22px 18px;
    background: #fff;
}

.person-photo {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 25%;
    border: 3px solid var(--color-accent);
}

.person-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.person-name {
    font-size: 1rem;
    line-height: 1.2;
}

.person-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--color-accent);
}

.person-bio {
    margin: 6px 0 0 !important;
    font-size: 0.85rem;
    line-height: 1.5 !important;
    color: var(--color-muted);
}

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

.article-figure {
    margin: 0 0 18px;
}

.article-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.article-figure-retro {
    border: 1px solid var(--color-line);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.article-figure-retro img {
    border-radius: 0;
}

.article-figure-banner {
    margin: 8px 0 24px;
}

.article-figure-banner img {
    border-radius: 6px;
    aspect-ratio: 5 / 1;
    object-fit: cover;
    object-position: center;
}

.article-figure figcaption {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--color-muted);
    background: #fafafa;
    border-top: 1px solid var(--color-line);
    text-align: center;
    font-style: italic;
}

.article blockquote {
    margin: 0 0 14px;
    padding: 12px 18px;
    border-left: 3px solid var(--color-accent);
    background: #fafafa;
    color: var(--color-fg);
    font-style: italic;
}

.article em {
    font-style: italic;
    color: var(--color-fg);
}

.preface {
    position: relative;
    margin: 32px 0;
    padding: 0;
    background: #fbfafa;
    border: 1px solid var(--color-line);
    border-radius: 6px;
    overflow: hidden;
}

.preface-content {
    padding: 24px 32px 28px;
    border-left: 3px solid var(--color-accent);
}

.preface-figure {
    margin: 0;
    border-bottom: 1px solid var(--color-line);
}

.preface-figure img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 280px;
}

.preface h2 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.preface-note {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0 0 20px;
}

.preface-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-fg);
}

.preface-body p {
    margin: 0 0 14px;
}

.preface-body p:last-of-type {
    margin-bottom: 0;
}

.preface-greeting {
    margin-top: 20px !important;
    margin-bottom: 4px !important;
    font-weight: 600;
    color: var(--color-accent);
}

.preface-sign {
    text-align: left;
    font-style: italic;
    color: var(--color-muted);
    margin-top: 0 !important;
}

.article a {
    color: var(--color-accent);
    text-decoration: none;
}

.article a:hover {
    text-decoration: underline;
}

/* ---------- Map page ---------- */

.highline-map-wrapper {
    position: relative;
    height: calc(100vh - var(--header-height));
    width: 100%;
}

.highline-map {
    height: 100%;
    width: 100%;
}

/* ---------- Map control pills: basemap + fullscreen (shared across all maps) ---------- */

.map-ctrl-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-line);
    color: var(--color-fg);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.map-ctrl-btn:hover,
.map-ctrl-btn:focus-visible {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    outline: none;
}

/* Active (ortho shown / in fullscreen) → dark pill, matching the highline form. */
.map-ctrl-btn.is-active {
    background: #1b1b1b;
    color: #fff;
    border-color: #1b1b1b;
}

/* Basemap picker: pill toggle that expands a small radio-like list below it. */
.map-layers {
    position: relative;
}

.map-layers.is-open .map-layers-toggle {
    background: #1b1b1b;
    color: #fff;
    border-color: #1b1b1b;
}

.map-layers-panel {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Left-corner control → open the panel rightward; bottom corner → open upward. */
.map-layers--left .map-layers-panel {
    right: auto;
    left: 0;
}

.map-layers--up .map-layers-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

.map-layers-panel[hidden] {
    display: none;
}

.map-layers-option {
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-fg);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.map-layers-option:hover,
.map-layers-option:focus-visible {
    background: var(--color-accent);
    color: #fff;
    outline: none;
}

.map-layers-option.is-active {
    background: #1b1b1b;
    color: #fff;
}

/* Fullscreen toggle is icon-only → square button, slightly larger glyph. */
.map-fullscreen-toggle {
    padding: 0;
    width: 34px;
    height: 34px;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* On /mapa the top-right corner already holds the "Přehrát historii" toggle, so
   push the basemap + fullscreen controls below it. */
.highline-map-wrapper .leaflet-top.leaflet-right {
    top: 44px;
}

/* "Podrž Ctrl a otoč kolečkem" hint — shown by enableCtrlScrollZoom when the user
   wheels over an embedded map without the modifier (the wheel scrolled the page).
   Centered, non-interactive, fades in/out. */
.map-zoom-hint {
    position: absolute;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.32);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.map-zoom-hint.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Fullscreen: let the map target (and the Leaflet canvas inside it) fill the screen
   without leftover rounded corners. addFullscreenToggle tags its target .map-fs-target. */
.map-fs-target:fullscreen,
.map-fs-target:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: var(--color-bg);
}

.map-fs-target:fullscreen .leaflet-container,
.map-fs-target:-webkit-full-screen .leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* ---------- Crossing news-bar feed ---------- */

.crossing-feed {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 500;
    width: 320px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    pointer-events: auto;
    transition: width 0.25s ease;
}

.time-travel-active .crossing-feed {
    bottom: 110px; /* clear the time-travel panel */
}

.crossing-feed.is-collapsed {
    width: auto;
    bottom: auto; /* shrink to header height instead of stretching to full height */
}

.time-travel-active .crossing-feed.is-collapsed {
    bottom: auto;
}

.crossing-feed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-line);
    background: rgba(20, 0, 12, 0.92);
    color: #fff;
    flex-shrink: 0;
}

.crossing-feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--color-accent);
    box-shadow: 0 0 8px rgba(225, 0, 91, 0.8);
    animation: crossing-feed-dot-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes crossing-feed-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.crossing-feed-titles {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.crossing-feed-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.crossing-feed-caption {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    transition: color 0.15s;
}

.crossing-feed-caption::after {
    content: '▾';
    font-size: 0.6rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.crossing-feed.filter-open .crossing-feed-caption::after {
    transform: rotate(180deg);
}

.crossing-feed-caption:hover,
.crossing-feed-caption:focus-visible {
    color: #fff;
    outline: none;
}

.crossing-feed-filter {
    flex-shrink: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-line);
    background: rgba(20, 0, 12, 0.92);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.78rem;
}

.crossing-feed-filter[hidden] {
    display: none;
}

.crossing-feed-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.crossing-feed-filter-row input[type="radio"] {
    accent-color: var(--color-accent);
    margin: 0;
    flex-shrink: 0;
}

.crossing-feed-filter-num {
    width: 56px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: inherit;
    font-size: 0.78rem;
}

.crossing-feed-filter-range {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 22px; /* line up under the radio label text */
}

.crossing-feed-filter-range input[type="date"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    color-scheme: dark; /* light native calendar icon on the dark panel */
}

.crossing-feed-filter input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.crossing-feed-filter-num:focus-visible,
.crossing-feed-filter-range input[type="date"]:focus-visible {
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
}

.crossing-feed-toggle,
.crossing-feed-eye {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.crossing-feed-toggle:hover,
.crossing-feed-toggle:focus-visible,
.crossing-feed-eye:hover,
.crossing-feed-eye:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
    outline: none;
}

.crossing-feed-eye-off { display: none; }
.crossing-feed.users-hidden .crossing-feed-eye-on { display: none; }
.crossing-feed.users-hidden .crossing-feed-eye-off { display: block; }
.crossing-feed.users-hidden .crossing-feed-eye {
    color: rgba(255, 255, 255, 0.55);
}

.crossing-feed-toggle-icon {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.crossing-feed.is-collapsed .crossing-feed-toggle-icon {
    transform: rotate(180deg);
}

.crossing-feed.is-collapsed .crossing-feed-caption,
.crossing-feed.is-collapsed .crossing-feed-filter,
.crossing-feed.is-collapsed .crossing-feed-body-wrap {
    display: none;
}

.crossing-feed.is-collapsed .crossing-feed-header {
    border-bottom: none;
}

.crossing-feed-body-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crossing-feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crossing-feed-item {
    background: #fff;
    border: 1px solid var(--color-line);
    border-left: 3px solid var(--color-accent);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    animation: crossing-feed-item-in 0.35s ease both;
    animation-delay: var(--feed-stagger, 0ms);
}

@keyframes crossing-feed-item-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.crossing-feed-empty {
    margin: 8px 0 0;
    padding: 16px 8px;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-style: italic;
}

.crossing-feed-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--color-muted);
}

.crossing-feed-date {
    font-weight: 600;
    color: var(--color-fg);
    letter-spacing: 0.02em;
}

.crossing-feed-style {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(225, 0, 91, 0.1);
    color: var(--color-accent);
}

.crossing-feed-rating {
    display: inline-flex;
    gap: 1px;
    font-size: 0.72rem;
    line-height: 1;
}

.crossing-feed-star {
    color: rgba(0, 0, 0, 0.18);
}

.crossing-feed-star.on {
    color: var(--color-accent);
}

.crossing-feed-body {
    margin-top: 4px;
    font-size: 0.85rem;
    line-height: 1.35;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
}

.crossing-feed-user {
    color: var(--color-fg);
    font-weight: 600;
    text-decoration: none;
}

.crossing-feed-user:hover {
    color: var(--color-accent);
}

.crossing-feed-on {
    color: var(--color-muted);
}

.crossing-feed-line {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
}

.crossing-feed-line:hover {
    text-decoration: underline;
}

.crossing-feed-comment {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px dashed var(--color-line);
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--color-fg);
    font-style: italic;
}

/* Push Leaflet's bottom-right zoom controls above the time-travel panel when active. */
.time-travel-active .leaflet-bottom.leaflet-right {
    bottom: 110px;
}

@media (prefers-reduced-motion: reduce) {
    .crossing-feed-item {
        animation: none;
    }
    .crossing-feed-dot {
        animation: none;
    }
    .crossing-feed,
    .crossing-feed-toggle-icon {
        transition: none;
    }
}

@media (max-width: 720px) {
    .crossing-feed {
        width: calc(100% - 28px);
        max-width: 320px;
        bottom: auto;
        max-height: 45%;
    }
    .crossing-feed.is-collapsed {
        width: 44px;
    }
}

/* ---------- Time-travel controls ---------- */

.map-tt-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 500;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-line);
    color: var(--color-fg);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.map-tt-toggle:hover,
.map-tt-toggle:focus-visible {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    outline: none;
}

.time-travel-active .map-tt-toggle {
    background: rgba(20, 0, 12, 0.92);
    color: #fff;
    border-color: rgba(225, 0, 91, 0.4);
}

.map-tt-panel {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    z-index: 500;
    padding: 14px 18px 12px;
    background: rgba(20, 0, 12, 0.92);
    color: #fff;
    border: 1px solid rgba(225, 0, 91, 0.35);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.time-travel-active .map-tt-panel {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.map-tt-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.map-tt-play {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background-color 0.15s, transform 0.1s;
}

.map-tt-play:hover {
    background: var(--color-accent-hover);
}

.map-tt-play:active {
    transform: scale(0.95);
}

.map-tt-date {
    flex: 0 0 175px;
    font-size: 1.05rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fff;
    white-space: nowrap;
}

.map-tt-slider {
    flex: 1;
    accent-color: var(--color-accent);
    height: 4px;
    cursor: pointer;
}

.map-tt-speed {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.map-tt-speed option {
    background: #1a0011;
    color: #fff;
}

.map-tt-speed option:checked {
    background: var(--color-accent);
    color: #fff;
}

.map-tt-counter {
    margin-top: 6px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Highline first-ascent bloom */
.highline-bloom-icon {
    background: transparent;
    border: none;
    pointer-events: none;
}

.highline-bloom {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(225, 0, 91, 0.55) 0%,
        rgba(225, 0, 91, 0.25) 35%,
        rgba(225, 0, 91, 0)   70%);
    animation: highline-bloom-anim 2.0s ease-out forwards;
}

@keyframes highline-bloom-anim {
    0%   { transform: scale(0.15); opacity: 0; }
    20%  { transform: scale(1.0);  opacity: 1; }
    100% { transform: scale(2.6);  opacity: 0; }
}

/* Crossing pulse — emoji circle expanding ring at the highline location */
.crossing-pulse-icon {
    background: transparent;
    border: none;
    pointer-events: none;
    position: relative;
}

.crossing-pulse-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    background: #fff;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: crossing-pulse-emoji-anim 1.6s ease-out forwards;
}

.crossing-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    animation: crossing-pulse-ring-anim 1.6s ease-out forwards;
}

@keyframes crossing-pulse-emoji-anim {
    0%   { opacity: 0; transform: scale(0.4); }
    20%  { opacity: 1; transform: scale(1.15); }
    50%  { opacity: 1; transform: scale(1.0);  }
    100% { opacity: 0; transform: scale(0.95); }
}

@keyframes crossing-pulse-ring-anim {
    0%   { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0;   transform: scale(3); }
}

@media (prefers-reduced-motion: reduce) {
    .highline-bloom,
    .crossing-pulse-emoji,
    .crossing-pulse-ring,
    .map-tt-panel {
        animation-duration: 0.01ms;
        transition-duration: 0.01ms;
    }
}

.highline-popup strong {
    font-size: 1.05em;
}

.highline-popup .muted {
    color: var(--color-muted);
    font-size: 0.9em;
}

.highline-popup a {
    color: var(--color-accent);
    text-decoration: none;
}

.highline-popup a:hover {
    text-decoration: underline;
}

.user-popup-line a {
    color: var(--color-accent);
    text-decoration: none;
}

.user-popup-line a:hover {
    text-decoration: underline;
}

/* ---------- Highline detail page ---------- */

.hl-detail {
    /* Full-bleed: cover hero is edge-to-edge. Content body has its own max-width. */
    margin: 0;
    padding: 0;
}

/* ---------- Cover hero ---------- */

.hl-cover {
    position: relative;
    width: 100%;
    /* Fill viewport minus app header. dvh handles mobile URL bar gracefully. */
    height: calc(100dvh - var(--header-height));
    min-height: 360px;
    overflow: hidden;
    background: #1a0010;
    color: #fff;
}

.hl-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* When the page has no cover URL (legacyId missing) OR the cover image 404s
 * (onerror strips the class) collapse the hero — slim band with the title
 * still visible. The content must flow statically here, otherwise the
 * absolutely-positioned .hl-cover-content gets clipped by .hl-cover's
 * overflow:hidden because absolute children don't contribute to parent
 * height. */
.hl-detail:not(.hl-detail-has-cover) .hl-cover {
    height: auto;
    min-height: 0;
    background: linear-gradient(135deg, #1a0010 0%, #3a0020 100%);
}

.hl-detail:not(.hl-detail-has-cover) .hl-cover-content {
    position: static;
    padding: 28px 24px 32px;
}

/* Gradient shade for legibility of the title and a smooth bleed into content. */
.hl-cover-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(0, 0, 0, 0.55) 0%,
            rgba(0, 0, 0, 0.0) 25%,
            rgba(0, 0, 0, 0.0) 55%,
            rgba(0, 0, 0, 0.75) 100%);
}

.hl-cover-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 32px 24px 56px;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 1;
}

.hl-cover-content .hl-back {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hl-cover-content .hl-back:hover {
    color: #fff;
}

.hl-cover-content h1 {
    margin: 8px 0 14px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
    line-height: 1.05;
}

.hl-cover-content .hl-detail-meta {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.hl-cover-content .hl-loc,
.hl-cover-content .hl-fa {
    color: rgba(255, 255, 255, 0.85);
}

/* Override badge background on dark cover for legibility */
.hl-cover-content .hl-type-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Action buttons sit over a dark cover photo — default ghost/danger variants have dark or red
 * text on transparent bg → low contrast. Reskin them with a translucent scrim + light text
 * only inside the cover (the danger variant keeps a red-tinted hover). */
.hl-cover-content .btn-secondary,
.hl-cover-content .btn-danger {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hl-cover-content .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.55);
    border-color: #fff;
    color: #fff;
}

.hl-cover-content .btn-danger:hover {
    background: rgba(192, 20, 60, 0.6);
    border-color: #fff;
    color: #fff;
}

.hl-back {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-muted);
    text-decoration: none;
}

.hl-back:hover {
    color: var(--color-accent);
}

.hl-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-muted);
}

/* ---------- Content body below the cover ---------- */

.hl-detail-body {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 64px;
    /* Soft fade from transparent into page bg at the top, so the cover→content
     * seam is smooth as the user scrolls past the hero. */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--color-bg) 80px);
}

/* Without a cover image, the hero collapses — content starts immediately
 * with normal spacing, no gradient needed. */
.hl-detail:not(.hl-detail-has-cover) .hl-detail-body {
    background: var(--color-bg);
    padding-top: 32px;
}

.hl-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(225, 0, 91, 0.10);
    color: var(--color-accent);
}

.hl-type-badge.hl-type-top_highline { background: rgba(225, 0, 91, 0.18); }
.hl-type-badge.hl-type-midline       { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.hl-type-badge.hl-type-urban_line    { background: rgba(33, 33, 33, 0.10); color: #333; }
.hl-type-badge.hl-type-unsorted      { background: rgba(0, 0, 0, 0.06); color: var(--color-muted); }

.hl-loc, .hl-fa { color: var(--color-muted); }

.hl-detail-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

.hl-stats {
    grid-column: 2;
    grid-row: 1 / span 4;
    padding: 24px 20px;
    text-align: center;
    position: sticky;
    top: 16px;
}

.hl-info        { grid-column: 1; grid-row: 1; }
.hl-gallery-panel { grid-column: 1; grid-row: 2; }
.hl-map-panel   { grid-column: 1; grid-row: 3; }
.hl-crossings-panel { grid-column: 1; grid-row: 4; }

@media (max-width: 900px) {
    .hl-detail-grid {
        grid-template-columns: 1fr;
    }
    .hl-stats,
    .hl-info,
    .hl-gallery-panel,
    .hl-map-panel,
    .hl-crossings-panel {
        grid-column: 1;
        grid-row: auto;
    }
    .hl-stats {
        position: static;
    }
}

/* ---------- Highline gallery ---------- */

.panel-dot-gallery {
    background: var(--color-accent);
}

.hl-gallery-grid {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.hl-gallery-item {
    position: relative;
    background: var(--color-panel-soft, #f4f4f6);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hl-gallery-link {
    display: block;
    aspect-ratio: 4 / 3;
    background: #000;
}

.hl-gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 220ms ease;
}

.hl-gallery-link:hover img {
    transform: scale(1.04);
}

.hl-gallery-meta {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--color-muted, #6b6b73);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hl-gallery-caption {
    color: var(--color-text, #1c1c1f);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hl-gallery-author a {
    color: inherit;
    text-decoration: none;
}

.hl-gallery-author a:hover {
    color: var(--color-accent);
}

.hl-gallery-link {
    position: relative;
}

.hl-gallery-stats {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
    pointer-events: none;
}

.hl-gallery-stat {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

.hl-gallery-stat.is-liked {
    background: var(--color-accent);
}

/* ---------- Highline photo detail page ---------- */

.hl-photo-detail {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hl-photo-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hl-photo-nav {
    display: flex;
    gap: 8px;
}

.hl-photo-frame {
    padding: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hl-photo-original-link {
    display: block;
    width: 100%;
}

.hl-photo-main {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
    object-fit: contain;
}

.hl-photo-meta-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hl-photo-caption {
    margin: 0;
    font-size: 16px;
    color: var(--color-text, #1c1c1f);
}

.hl-photo-byline {
    margin: 0;
    font-size: 13px;
    color: var(--color-muted, #6b6b73);
}

.hl-photo-byline a {
    color: inherit;
    text-decoration: none;
}

.hl-photo-byline a:hover {
    color: var(--color-accent);
}

.hl-photo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.hl-photo-like-btn {
    background: var(--color-panel-soft, #f4f4f6);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text, #1c1c1f);
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hl-photo-like-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.hl-photo-like-btn.is-liked {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.hl-photo-like-btn.is-disabled {
    cursor: default;
    opacity: 0.7;
}

.hl-photo-like-count {
    font-weight: 600;
}

/* ---------- Comments ---------- */

.hl-comments {
    list-style: none;
    margin: 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

.hl-comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-divider, #ececef);
}

.hl-comment:last-child {
    border-bottom: none;
}

.hl-comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-muted, #6b6b73);
}

.hl-comment-author a {
    color: var(--color-text, #1c1c1f);
    font-weight: 500;
    text-decoration: none;
}

.hl-comment-author a:hover {
    color: var(--color-accent);
}

.hl-comment-delete {
    margin: 0 0 0 auto;
}

.hl-comment-delete button {
    background: transparent;
    border: none;
    color: var(--color-muted, #6b6b73);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.hl-comment-delete button:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #d32f2f;
}

.hl-comment-text {
    margin: 6px 0 0;
    color: var(--color-text, #1c1c1f);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.hl-comment-form {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hl-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 8px 10px;
    border: 1px solid var(--color-divider, #ececef);
    border-radius: 6px;
    font: inherit;
}

/* ---------- Homepage „Z galerie" rotating panel ---------- */

.panel-photos {
    padding-bottom: 12px;
}

.hp-photos-grid {
    list-style: none;
    margin: 0;
    padding: 12px 16px 4px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.hp-photo {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #000;
}

.hp-photo-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.hp-photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 220ms ease;
}

.hp-photo-link:hover img {
    transform: scale(1.05);
}

.hp-photo-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 8px 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 1px;
    pointer-events: none;
}

.hp-photo-line {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-photo-author {
    opacity: 0.85;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hl-stats-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 16px;
}

.hl-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hl-stat-icon {
    font-size: 1.8rem;
    color: var(--color-accent);
    line-height: 1;
}

.hl-stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.hl-stat-unit {
    font-size: 0.55em;
    font-weight: 500;
    color: var(--color-muted);
}

.hl-stat-label {
    font-size: 0.68rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hl-rating-large {
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    color: var(--color-line);
}

.hl-rating-large .hl-star.on {
    color: var(--color-accent);
}

.hl-info {
    padding: 22px 24px;
}

.hl-info-block {
    margin-bottom: 22px;
}

.hl-info-block h2,
.hl-info > h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hl-info p {
    margin: 0 0 12px;
    line-height: 1.65;
    color: var(--color-fg);
}

.hl-info p:last-child {
    margin-bottom: 0;
}

.hl-richtext p {
    margin: 0 0 10px;
    line-height: 1.6;
}

.hl-richtext p:last-child {
    margin-bottom: 0;
}

.hl-richtext ul,
.hl-richtext ol {
    margin: 0 0 10px;
    padding-left: 20px;
    line-height: 1.55;
}

.hl-richtext a {
    color: var(--color-accent);
    text-decoration: underline;
}

.hl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.hl-table tr {
    border-bottom: 1px solid var(--color-line);
}

.hl-table tr:last-child {
    border-bottom: none;
}

.hl-table th,
.hl-table td {
    padding: 10px 0;
    vertical-align: top;
    text-align: left;
}

.hl-table th {
    width: 38%;
    font-weight: 600;
    color: var(--color-muted);
    padding-right: 16px;
}

.hl-table td {
    color: var(--color-fg);
}

.hl-table a {
    color: var(--color-accent);
    text-decoration: none;
}

.hl-table a:hover {
    text-decoration: underline;
}

.hl-map-wrapper {
    height: 380px;
    width: 100%;
}

.hl-map-canvas {
    height: 100%;
    width: 100%;
}

/* Compound `.leaflet-marker-icon.<x>` selectors are deliberate: Leaflet's own
   `.leaflet-marker-icon { display: block }` loads after app.css and would otherwise
   beat a bare `.hl-parking-marker { display: flex }` on equal specificity, killing the
   centering. The extra class wins the tie. */
.leaflet-marker-icon.hl-parking-marker {
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    background: #1b6cf3;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    text-align: center;
}

/* Numbered anchor-point pin (bod 1 / bod 2) — single marker with the number inside. */
.leaflet-marker-icon.hl-point-marker {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    background: #e1005b;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

/* Nudge the glyph down ~1px: flex centers the line-box, but digits/caps have no
   descender so they read as slightly high. */
.hl-parking-marker-glyph,
.hl-point-marker > span {
    display: block;
    transform: translateY(1px);
}

.hl-crossings-count {
    color: var(--color-muted);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.hl-empty {
    padding: 22px 24px;
    margin: 0;
    color: var(--color-muted);
    font-style: italic;
}

/* On detail page the line column is redundant — slim grid */
.crossings-item-noline {
    grid-template-areas:
        "date    style"
        "user    rating"
        "comment comment";
}

/* ---------- Deník (uživatelský profil) ---------- */

.denik {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.denik-head {
    padding: 24px 28px;
}

.denik-identity h1 {
    margin: 0 0 4px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.denik-realname {
    margin: 0 0 14px;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.denik-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 0.92rem;
    color: var(--color-fg);
}

.denik-meta-label {
    color: var(--color-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 6px;
}

.denik-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.denik-map-panel { grid-column: 1; }
.denik-crossings-panel { grid-column: 2; }

.denik-map-wrapper {
    height: 420px;
    width: 100%;
}

.denik-map-canvas {
    height: 100%;
    width: 100%;
}

.denik-map-popup {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

.denik-map-popup:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .denik-grid {
        grid-template-columns: 1fr;
    }
    .denik-map-panel,
    .denik-crossings-panel {
        grid-column: 1;
    }
    .denik-map-wrapper {
        height: 300px;
    }
}

/* ---------- Header search ---------- */

.site-search {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search-btn {
    background: #fafafa;
    border: 1px solid var(--color-line);
    color: var(--color-fg);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.site-search-btn:hover,
.site-search-btn:focus-visible,
.site-search.is-open .site-search-btn {
    border-color: var(--color-accent);
    color: var(--color-accent);
    outline: none;
}

.site-search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1500;
}

.site-search.is-open .site-search-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.site-search-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--color-line);
    padding: 12px 16px;
    font: inherit;
    font-size: 0.95rem;
    background: transparent;
    color: var(--color-fg);
}

.site-search-input::placeholder {
    color: var(--color-muted);
}

.site-search-input:focus {
    outline: none;
    border-bottom-color: var(--color-accent);
}

.site-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}

.site-search-results:not(.has-results) {
    display: none;
}

.site-search-results li {
    border-bottom: 1px solid var(--color-line);
}

.site-search-results li:last-child {
    border-bottom: none;
}

.site-search-results a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--color-fg);
    transition: background 0.12s, color 0.12s;
}

.site-search-results a:hover,
.site-search-results a:focus-visible {
    background: rgba(225, 0, 91, 0.08);
    color: var(--color-accent);
    outline: none;
}

.site-search-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.site-search-meta {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.site-search-results a:hover .site-search-meta,
.site-search-results a:focus-visible .site-search-meta {
    color: var(--color-accent);
}

.site-search-empty {
    padding: 16px;
    color: var(--color-muted);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 600px) {
    .site-search-panel {
        width: calc(100vw - 32px);
        right: -16px;
    }
}

/* ===== Markdown sections (/docs, /wiki) =====
   Single CSS namespace `.md-*` napříč všemi GitHub-backed MD sekcemi
   (`App\Markdown\Section\*`). Žádný per-sekci styl — vše per-class.
   Container width sjednocený s homepage `.page-grid` (1320 px). */

.article.md-section {
    max-width: 1320px;
}

.md-empty {
    margin-top: 24px;
    padding: 16px;
    border: 1px dashed var(--color-line);
    border-radius: 8px;
    color: var(--color-muted);
}

/* --- Section head (meta links napravo) --- */

.md-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
}

.md-section-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-left: auto;
}

.md-meta-link {
    color: var(--color-accent);
    text-decoration: none;
}

.md-meta-link:hover {
    text-decoration: underline;
}

.md-meta-sep {
    margin: 0 6px;
    color: var(--color-line);
}

/* --- Sidebar + main layout --- */

.md-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

@media (max-width: 800px) {
    .md-layout {
        grid-template-columns: 1fr;
    }
    .md-sidebar {
        position: static;
    }
}

.md-sidebar {
    position: sticky;
    top: 16px;
}

.md-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    border-left: 2px solid var(--color-line);
}

.md-sidebar-list li {
    margin: 0;
}

.md-sidebar-group {
    margin: 12px 0 4px;
    padding: 0 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--color-muted);
}

.md-sidebar-list li:first-child.md-sidebar-group {
    margin-top: 0;
}

.md-sidebar-link {
    display: block;
    padding: 6px 10px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--color-fg);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.4;
}

.md-sidebar-link:hover {
    color: var(--color-accent);
}

.md-sidebar-link.is-active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

/* --- Main column --- */

.md-main {
    min-width: 0;
}

/* --- Rendered markdown body --- */

.md-prose {
    line-height: 1.65;
    font-size: 1rem;
    max-width: 78ch;
    color: var(--color-fg);
}

.md-prose h1,
.md-prose h2,
.md-prose h3,
.md-prose h4 {
    margin: 1.6em 0 0.5em;
    font-weight: 700;
    line-height: 1.25;
}

.md-prose h1 {
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 0.3em;
}

.md-prose h2 {
    font-size: 1.45rem;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 0.25em;
}

.md-prose h3 {
    font-size: 1.18rem;
}

.md-prose h4 {
    font-size: 1.02rem;
    color: var(--color-muted);
}

.md-prose p {
    margin: 0 0 1em;
}

.md-prose a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.md-prose a:hover {
    color: var(--color-accent-hover);
}

.md-prose ul,
.md-prose ol {
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.md-prose li {
    margin: 0.2em 0;
}

.md-prose code {
    background: #f4f4f4;
    padding: 0.12em 0.4em;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.92em;
}

.md-prose pre {
    background: #1a1a1a;
    color: #f5f5f5;
    padding: 14px 18px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 1em 0;
}

.md-prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.md-prose blockquote {
    margin: 1em 0;
    padding: 0.4em 1em;
    border-left: 4px solid var(--color-accent);
    color: var(--color-muted);
    background: #fafafa;
}

/* Pull-quote: blockquote těsně po úvodním H1 — vizuálně odlišený od běžných
   citací v textu (větší písmo, italika, jemný accent background). */
.md-prose h1 + blockquote {
    margin: 0 0 24px;
    padding: 12px 16px;
    border-left: 3px solid var(--color-accent);
    background: rgba(233, 30, 99, 0.04);
    color: var(--color-fg);
    font-style: italic;
    font-size: 1.05em;
    line-height: 1.5;
}

.md-prose table {
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.92rem;
    overflow-x: auto;
    display: block;
}

.md-prose table th,
.md-prose table td {
    border: 1px solid var(--color-line);
    padding: 6px 12px;
    text-align: left;
    vertical-align: top;
}

.md-prose table th {
    background: #fafafa;
    font-weight: 600;
}

.md-prose hr {
    border: 0;
    border-top: 1px solid var(--color-line);
    margin: 2em 0;
}

.md-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.md-prose ul.contains-task-list {
    list-style: none;
    padding-left: 0.4em;
}

.md-prose .task-list-item input {
    margin-right: 0.4em;
}

/* ---------- Auth (login / register / reset password) ---------- */

.auth-page {
    max-width: 420px;
    margin: 48px auto 64px;
    padding: 0 24px;
}

.auth-card {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    padding: 32px 28px;
}

.auth-card h1 {
    margin: 0 0 24px;
    font-size: 1.5em;
    font-weight: 600;
}

.auth-card .form-group {
    margin-bottom: 16px;
}

.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--color-fg);
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    font: inherit;
    color: var(--color-fg);
    background: var(--color-bg);
    transition: border-color 0.15s;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.auth-card input[type="checkbox"] {
    margin-right: 6px;
}

.auth-card .checkbox-row label {
    display: inline;
    font-weight: 400;
    font-size: 0.95em;
    color: var(--color-muted);
}

.auth-alert {
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 4px;
    background: #fdecea;
    color: #842029;
    font-size: 0.9em;
}

.auth-card ul,
.auth-card .form-error-message {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    color: #c0143c;
    font-size: 0.85em;
}

.auth-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.auth-links a {
    color: var(--color-muted);
    text-decoration: none;
}

.auth-links a:hover {
    color: var(--color-accent);
}

.auth-current-user {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #f5f5f5;
    color: var(--color-muted);
    font-size: 0.9em;
}

.auth-card p {
    margin: 0 0 12px;
    color: var(--color-fg);
    line-height: 1.55;
}

.auth-card p:last-child {
    margin-bottom: 0;
}

.auth-help {
    display: block;
    margin: -8px 0 16px;
    color: var(--color-muted);
    font-size: 0.85em;
    line-height: 1.45;
}

.auth-card a:not(.btn) {
    color: var(--color-accent);
    text-decoration: none;
}

.auth-card a:not(.btn):hover {
    text-decoration: underline;
}

/* ---------- Profile page ---------- */

.profile-page {
    max-width: 520px;
}

.profile-denik-link {
    margin: 0 0 20px;
    font-size: 0.95em;
}

.profile-info {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 16px;
    margin: 0 0 24px;
    font-size: 0.95em;
}

.profile-info dt {
    color: var(--color-muted);
    font-weight: 500;
}

.profile-info dd {
    margin: 0;
    color: var(--color-fg);
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-actions .btn {
    flex: 1;
}

/* ---------- Crossing form (new / edit) ---------- */

.crossing-form-card {
    max-width: 520px;
}

.crossing-form-card .hl-back {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--color-muted);
    font-size: 0.9em;
    text-decoration: none;
}

.crossing-form-card .hl-back:hover {
    color: var(--color-accent);
}

.crossing-form-line {
    margin: -12px 0 20px;
    color: var(--color-muted);
    font-size: 0.95em;
}

.crossing-form-line strong {
    color: var(--color-fg);
}

.crossing-form-card input[type="date"],
.crossing-form-card select,
.crossing-form-card textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    font: inherit;
    color: var(--color-fg);
    background: var(--color-bg);
    transition: border-color 0.15s;
}

.crossing-form-card textarea {
    resize: vertical;
    min-height: 90px;
}

.crossing-form-card input[type="date"]:focus,
.crossing-form-card select:focus,
.crossing-form-card textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.crossing-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.crossing-form-actions .btn {
    flex: 1;
}

/* ---------- Crossing row actions (deník) ---------- */

.crossings-item {
    grid-template-areas:
        "date    style"
        "user    rating"
        "line    line"
        "comment comment"
        "actions actions";
}

/* On the user's own deník the author name is redundant — drop the user row and
   left-align the rating. Placed after the actions-row override above so it wins
   the cascade (same specificity, later source order). */
.crossings-item-nouser {
    grid-template-areas:
        "date    style"
        "rating  rating"
        "line    line"
        "comment comment"
        "actions actions";
}

.crossings-actions {
    grid-area: actions;
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.crossings-delete-form {
    display: inline;
    margin: 0;
}

/* ---------- Highline form (new / edit) ---------- */

.hl-form-page {
    max-width: 1320px;
}

.hl-form-card {
    padding: 28px 28px 32px;
}

.hl-form-card .hl-back {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--color-muted);
    font-size: 0.9em;
    text-decoration: none;
}

.hl-form-card .hl-back:hover {
    color: var(--color-accent);
}

.hl-form-help {
    margin: -16px 0 24px;
    color: var(--color-muted);
    font-size: 0.9em;
    line-height: 1.5;
}

.hl-form-notice {
    margin: -8px 0 24px;
    padding: 10px 14px;
    border-left: 3px solid var(--color-accent);
    background: rgba(225, 0, 91, 0.06);
    color: var(--color-fg);
    font-size: 0.9em;
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
}

.hl-form-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-line);
}

.hl-form-section:last-of-type {
    border-bottom: none;
}

.hl-form-section h2 {
    margin: 0 0 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
}

.form-grid-2,
.form-grid-3 {
    display: grid;
    gap: 12px;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 600px) {
    .form-grid-2,
    .form-grid-3 { grid-template-columns: 1fr; }
}

.hl-form-card input[type="text"],
.hl-form-card input[type="number"],
.hl-form-card input[type="date"],
.hl-form-card select,
.hl-form-card textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    font: inherit;
    color: var(--color-fg);
    background: var(--color-bg);
    transition: border-color 0.15s;
}

.hl-form-card textarea {
    resize: vertical;
    min-height: 80px;
}

.hl-form-card input:focus,
.hl-form-card select:focus,
.hl-form-card textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.hl-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.hl-form-actions .btn {
    min-width: 140px;
}

.hl-form-map {
    position: relative;
    margin-bottom: 14px;
}

.hl-form-map-canvas {
    height: 320px;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    overflow: hidden;
}

.hl-form-help-tight {
    margin: -6px 0 12px;
}

.hl-form-lock {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.85em;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.hl-form-lock:hover,
.hl-form-lock:focus {
    opacity: 1;
    outline: none;
}

.hl-form-url-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin: 0 0 18px;
    padding: 10px 14px;
    background: rgba(233, 30, 99, 0.06);
    border: 1px solid var(--color-line);
    border-radius: 4px;
    font-size: 0.9em;
}

.hl-form-url-label {
    color: var(--color-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hl-form-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--color-fg);
    font-weight: 600;
    background: transparent;
    padding: 0;
}

.hl-form-url-hint {
    flex-basis: 100%;
    color: var(--color-muted);
    font-size: 0.85em;
    line-height: 1.4;
}

.hl-form-distance {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 500;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--color-line);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    pointer-events: none;
}

.hl-form-distance-label {
    color: var(--color-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hl-form-distance-value {
    color: var(--color-fg);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hl-form-distance-value.is-empty {
    color: var(--color-muted);
    font-weight: 400;
    font-style: italic;
}

.hl-form-map-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.hl-form-map-toggle {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.hl-form-map-toggle.is-active {
    background: #e1005b;
    color: #fff;
    border-color: #e1005b;
}

.hl-form-map-toggle.hl-form-parking-toggle.is-active {
    background: #1b6cf3;
    border-color: #1b6cf3;
}

.hl-form-map-controls-bl {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.hl-form-map-btn {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.hl-form-fullscreen-toggle.is-active {
    background: #1b1b1b;
    color: #fff;
    border-color: #1b1b1b;
}

/* Fullscreen: let the map container and its canvas fill the screen. */
.hl-form-map:fullscreen,
.hl-form-map:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: var(--color-bg);
}

.hl-form-map:fullscreen .hl-form-map-canvas,
.hl-form-map:-webkit-full-screen .hl-form-map-canvas {
    height: 100%;
    border: none;
    border-radius: 0;
}

.hl-form-point-parking {
    grid-column: 1 / -1;
}

.hl-form-optional {
    color: var(--color-muted);
    font-weight: 400;
    font-size: 0.85em;
}

.hl-form-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 14px;
}

@media (max-width: 700px) {
    .hl-form-points { grid-template-columns: 1fr; }
}

.hl-form-point {
    padding: 14px;
    background: #fafafa;
    border: 1px solid var(--color-line);
    border-radius: 6px;
}

.hl-form-point h3 {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
}

/* ---------- Verified / proposal badge on detail ---------- */

.hl-proposal-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 9px;
    font-size: 0.55em;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c0143c;
    background: #fff;
    border: 1px solid currentColor;
    border-radius: 3px;
    vertical-align: middle;
}

.hl-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.hl-action-form {
    display: inline;
    margin: 0;
}

/* ---------- Admin proposals queue ---------- */

.proposals-page {
    max-width: 1100px;
    margin: 32px auto 64px;
    padding: 0 24px;
}

.proposals-header {
    margin-bottom: 24px;
}

.proposals-header h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 600;
}

.proposals-meta {
    color: var(--color-muted);
    font-size: 0.9em;
    margin: 0;
}

.proposals-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.proposals-item {
    padding: 0;
}

.proposals-diff {
    width: 100%;
    margin: 14px 0 0;
    border-collapse: collapse;
    font-size: 0.9em;
}

.proposals-diff th,
.proposals-diff td {
    padding: 8px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-line);
}

.proposals-diff th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.proposals-field {
    font-weight: 600;
    color: var(--color-muted);
    width: 160px;
}

.proposals-before {
    color: var(--color-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(192, 20, 60, 0.4);
}

.proposals-after {
    color: var(--color-fg);
    background: rgba(46, 125, 50, 0.06);
}

.proposals-actions {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--color-line);
    background: #fafafa;
}

.proposals-actions form {
    margin: 0;
}

.hl-history-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hl-history-applied {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

.hl-history-rejected {
    background: rgba(192, 20, 60, 0.1);
    color: #c0143c;
}

.hl-history-firstnote {
    font-style: normal;
    color: var(--color-muted);
}

/* ---------- Site nav admin tint ---------- */

.site-nav-admin {
    color: var(--color-accent);
}
