:root {
    color-scheme: dark;
    --bg: #08111f;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-solid: #0f172a;
    --panel-soft: rgba(30, 41, 59, 0.8);
    --text: #e5edf9;
    --muted: #98a6ba;
    --line: rgba(148, 163, 184, 0.22);
    --accent: #38bdf8;
    --accent-2: #f97316;
    --danger: #ef4444;
    --success: #22c55e;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.22), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.18), transparent 30%),
        linear-gradient(135deg, #07101f 0%, #0f172a 45%, #111827 100%);
    color: var(--text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

body.lightbox-open {
    overflow: hidden;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hero {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -30% -10%;
    height: 55%;
    background: linear-gradient(180deg, transparent, rgba(8, 17, 31, 0.9) 55%, var(--bg));
    pointer-events: none;
}

.topbar,
.admin-header {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.topbar-home {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.topbar-compact {
    justify-content: flex-end;
}

.topbar-spacer {
    min-width: 110px;
}

.brand {
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.1rem;
}

.brand-home {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
    gap: 2px;
    text-align: center;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.48);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.brand-line-1 {
    font-size: 1.12rem;
    line-height: 1;
}

.brand-line-2 {
    font-size: 0.83rem;
    letter-spacing: 0.02em;
    color: #c4d4ea;
    text-transform: uppercase;
}

.admin-link,
.back-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 650;
}

.admin-link:hover,
.back-link:hover {
    color: var(--text);
}

.topbar-home .admin-link {
    justify-self: end;
}

.hero-inner {
    width: min(1160px, calc(100% - 32px));
    margin: auto auto 12vh;
    position: relative;
    z-index: 2;
}

.hero-inner-centered {
    display: flex;
    justify-content: center;
    text-align: center;
}

.hero-card {
    width: min(920px, 100%);
    padding: clamp(24px, 5vw, 48px);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.38));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
}

.hero-graphic-wrap {
    flex-direction: column;
    align-items: center;
}

.hero-graphic-shell {
    width: min(1080px, 100%);
    padding: clamp(12px, 2vw, 20px);
    border-radius: 36px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.38), rgba(15, 23, 42, 0.18));
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.hero-graphic {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.18));
}

.hero-graphic-intro {
    max-width: 760px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
    margin: 26px auto 0;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    margin-bottom: 22px;
}

.hero-kicker {
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: #d9e7f8;
    margin-bottom: 12px;
}

.hero h1 {
    max-width: 880px;
    margin: 0 auto;
    font-size: clamp(2.8rem, 8vw, 6.2rem);
    line-height: 0.92;
    letter-spacing: -0.08em;
}

.hero-route {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px auto 0;
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.route-year {
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.route-flag,
.route-arrow,
.route-car {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.route-flag {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1;
}

.route-arrow {
    color: #c7d7ea;
    font-weight: 900;
    font-size: 1.25rem;
}

.route-car {
    width: 52px;
    height: 30px;
    color: #ffffff;
}

.route-car svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
    margin: 24px auto 0;
}

.hero-actions {
    margin-top: 32px;
}

.hero-actions-centered {
    display: flex;
    justify-content: center;
}

.button,
.danger-button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: #04111f;
    box-shadow: 0 12px 34px rgba(56, 189, 248, 0.22);
}

.button.ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--line);
}

.danger-button {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    box-shadow: none;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.page-shell,
.admin-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}


.map-shell {
    margin-top: clamp(-28px, -2vw, -10px);
    margin-bottom: 38px;
}

.map-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.14), transparent 38%),
        radial-gradient(circle at 88% 10%, rgba(249, 115, 22, 0.11), transparent 35%),
        rgba(15, 23, 42, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: clamp(20px, 3vw, 34px);
}

.map-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.map-card-header,
.route-map-visual,
.map-note {
    position: relative;
    z-index: 1;
}

.map-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
}

.section-eyebrow {
    display: inline-flex;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.88rem;
    font-weight: 850;
    margin-bottom: 12px;
}

.map-card h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.map-card p {
    max-width: 700px;
    color: var(--muted);
    line-height: 1.65;
    margin: 14px 0 0;
}

.map-current-location {
    min-width: min(330px, 100%);
    border-radius: 22px;
    background: rgba(8, 17, 31, 0.54);
    border: 1px solid rgba(125, 211, 252, 0.18);
    padding: 14px 16px;
    text-align: right;
}

.map-current-label {
    display: block;
    color: #93a4ba;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.map-current-location strong {
    display: block;
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.25;
    letter-spacing: -0.035em;
}

.route-map-visual {
    display: grid;
    grid-template-columns: auto minmax(34px, 1fr) auto minmax(34px, 1fr) auto minmax(34px, 1fr) auto minmax(34px, 1fr) auto;
    align-items: center;
    gap: clamp(8px, 1.5vw, 16px);
    padding: clamp(16px, 3vw, 26px);
    border-radius: 28px;
    background: rgba(8, 17, 31, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.route-country {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: #eaf4ff;
    font-weight: 850;
    min-width: 74px;
}

.route-country img {
    width: clamp(54px, 7vw, 78px);
    aspect-ratio: 1.55 / 1;
    object-fit: cover;
    border-radius: 13px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.28), 0 10px 24px rgba(0,0,0,0.28);
}

.route-line {
    height: 4px;
    min-width: 30px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56,189,248,0.20), rgba(249,115,22,0.96), rgba(239,68,68,0.72));
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.24);
}

.map-note {
    font-size: 0.94rem;
    color: #93a4ba;
    margin-top: 16px;
}

.timeline-list {
    display: grid;
    gap: 28px;
    padding-bottom: 60px;
}

.post-card,
.admin-panel,
.auth-card,
.empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.post-card {
    padding: clamp(18px, 3vw, 30px);
}

.post-meta-row,
.post-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.post-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 10px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.045em;
}

.post-emoji {
    font-size: 1.25em;
}

.post-body {
    color: #d9e4f5;
    line-height: 1.7;
    font-size: 1.06rem;
    margin: 12px 0 20px;
}

.media-grid {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.media-grid.single {
    grid-template-columns: 1fr;
}

.media-grid.double {
    grid-template-columns: repeat(2, 1fr);
}

.media-grid.multi {
    grid-template-columns: repeat(3, 1fr);
}

.media-tile {
    position: relative;
    border: 0;
    padding: 0;
    min-height: 190px;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: zoom-in;
    background: #111827;
    outline: 1px solid rgba(255,255,255,0.08);
}

.media-grid.single .media-tile {
    aspect-ratio: 16 / 10;
    min-height: 260px;
}

.media-tile img,
.media-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 260ms ease, filter 260ms ease;
}

.media-tile:hover img,
.media-tile:hover video {
    transform: scale(1.025);
    filter: brightness(1.07);
}

.play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.35rem;
    box-shadow: 0 12px 34px rgba(0,0,0,0.3);
}

.post-footer {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 18px;
}

.empty-state {
    text-align: center;
    padding: 56px 22px;
    margin-bottom: 70px;
}

.empty-icon {
    font-size: 3rem;
}

.site-footer {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 50px;
    color: var(--muted);
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 56px 18px 76px;
    overflow: auto;
    overscroll-behavior: contain;
}

.lightbox.show {
    display: flex;
}

.lightbox-content {
    width: 100%;
    min-height: calc(100dvh - 140px);
    display: grid;
    place-items: center;
}

.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, calc(100vw - 36px));
    max-height: calc(100dvh - 150px);
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 100px rgba(0,0,0,0.6);
}

.lightbox-content video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, calc(100vw - 36px));
    max-height: calc(100dvh - 150px);
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 100px rgba(0,0,0,0.6);
}

.lightbox-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-caption {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    color: #cbd5e1;
    text-align: center;
    font-size: 0.95rem;
}

.admin-body {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 30%),
        linear-gradient(135deg, #08111f, #0f172a);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(460px, 100%);
    padding: 30px;
}

.auth-card h1,
.admin-header h1,
.admin-panel h2 {
    margin: 8px 0 8px;
    letter-spacing: -0.045em;
}

.admin-header {
    padding: 28px 0 14px;
}

.admin-shell {
    display: grid;
    gap: 22px;
    padding-bottom: 60px;
}

.admin-panel {
    padding: clamp(18px, 3vw, 28px);
}

.stack-form,
.post-form {
    display: grid;
    gap: 16px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 8px;
    color: #dbeafe;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

textarea {
    resize: vertical;
}

.file-drop {
    border: 1px dashed rgba(125, 211, 252, 0.38);
    border-radius: var(--radius-lg);
    padding: 18px;
    background: rgba(14, 165, 233, 0.08);
}

.file-drop small,
.muted {
    color: var(--muted);
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--panel-soft);
    margin-bottom: 14px;
}

.alert.success {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
}

.alert.error {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
}

.health-grid {
    display: grid;
    grid-template-columns: minmax(150px, 240px) 1fr;
    gap: 8px 16px;
    margin-top: 16px;
    font-size: 0.95rem;
}

.health-key {
    color: var(--muted);
}

.health-value {
    overflow-wrap: anywhere;
}

.admin-post-list {
    display: grid;
    gap: 12px;
}

.admin-post-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.54);
}


.small-button {
    padding: 9px 14px;
    font-size: 0.92rem;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
}

.highlight-panel {
    outline: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.92);
}

.split-actions {
    justify-content: space-between;
}

.post-admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.post-admin-actions form {
    margin: 0;
}

.emoji-picker {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.48);
    overflow: hidden;
}

.emoji-picker > summary,
.admin-create-user > summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
    color: #dbeafe;
}

.emoji-picker-inner {
    border-top: 1px solid var(--line);
    padding: 16px;
    display: grid;
    gap: 14px;
}

.emoji-picker-top {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 16px;
    align-items: end;
}

.emoji-select-label {
    margin: 0;
}

.emoji-help {
    margin: 0;
    align-self: center;
}

.emoji-button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-button {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 1.35rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.emoji-button:hover,
.emoji-button:focus-visible {
    border-color: rgba(56, 189, 248, 0.78);
    background: rgba(56, 189, 248, 0.16);
}

.current-media-block {
    display: grid;
    gap: 12px;
}

.current-media-block h3 {
    margin: 0;
    letter-spacing: -0.02em;
}

.current-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.current-media-item {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.52);
}

.current-media-order-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.current-media-move-button {
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.86rem;
}

.current-media-move-button[hidden] {
    display: none;
}


.current-media-preview {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #111827;
}

.current-media-preview img,
.current-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-badge.small {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.current-media-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.current-media-meta span,
.current-media-meta small {
    overflow-wrap: anywhere;
}

.delete-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fecaca;
    font-weight: 800;
}

.delete-check input {
    width: auto;
}

.admin-user-list {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.48);
}

.admin-create-user {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.42);
}

.compact-form {
    padding: 0 16px 16px;
}

@media (max-width: 760px) {
    .topbar,
    .admin-header,
    .page-shell,
    .admin-shell,
    .site-footer {
        width: min(100% - 24px, 1040px);
    }

    .hero {
        min-height: 70vh;
    }

    .hero-inner {
        width: min(100% - 24px, 1040px);
        margin-bottom: 8vh;
    }

    .topbar-compact {
        width: min(100% - 24px, 1040px);
    }

    .hero-graphic-shell {
        padding: 10px;
        border-radius: 24px;
    }

    .topbar-home {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
    }

    .topbar-spacer {
        display: none;
    }

    .topbar-home .admin-link {
        justify-self: center;
    }

    .brand-home {
        padding: 10px 18px;
    }

    .hero-card {
        border-radius: 28px;
        padding: 24px 18px;
    }

    .hero-route {
        gap: 10px;
        padding: 12px 14px;
    }

    .route-car {
        width: 46px;
        height: 26px;
    }


    .map-card-header {
        flex-direction: column;
    }

    .map-header-side {
        width: 100%;
        justify-items: stretch;
    }

    .map-current-location {
        width: 100%;
        text-align: left;
    }

    
.map-style-picker {
    width: 100%;
    display: grid;
    gap: 6px;
    color: #93a4ba;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.map-style-select {
    width: 100%;
    min-width: 220px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.94));
    color: #eaf4ff;
    border-radius: 16px;
    padding: 11px 14px;
    font-weight: 850;
    cursor: pointer;
    outline: none;
    box-shadow:
        0 10px 24px rgba(0,0,0,0.22),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.map-style-select:hover,
.map-style-select:focus {
    border-color: rgba(125, 211, 252, 0.45);
}

.map-theme-toggle {
        justify-self: start;
    }

    .route-map-visual {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
    }

    .route-line {
        width: 4px;
        height: 28px;
        min-width: 0;
        background: linear-gradient(180deg, rgba(56,189,248,0.25), rgba(250,204,21,0.92), rgba(56,189,248,0.25));
    }

    .media-grid.double,
    .media-grid.multi {
        grid-template-columns: 1fr;
    }

    .media-tile,
    .media-grid.single .media-tile {
        min-height: 220px;
        aspect-ratio: 4 / 3;
    }

    .form-grid.two,
    .form-grid.three,
    .emoji-picker-top {
        grid-template-columns: 1fr;
    }

    .admin-post-item,
    .admin-user-item,
    .panel-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-post-item form {
        align-self: flex-start;
    }

    .post-admin-actions {
        align-items: stretch;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .lightbox {
        padding: 66px 8px 72px;
    }
}

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

.flag-img {
    width: 1.45em;
    height: 1.0em;
    object-fit: cover;
    border-radius: 0.16em;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.32);
    vertical-align: -0.12em;
    margin-right: 0.18em;
    display: inline-block;
}

.flag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}

.emoji-button.flag-button {
    width: auto;
    min-height: 46px;
    height: auto;
    padding: 8px 10px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.94rem;
    text-align: left;
}

.emoji-button.flag-button img {
    width: 34px;
    height: 23px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.28);
    flex: 0 0 auto;
}

.emoji-button.flag-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    background:
        radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.2), transparent 28%),
        linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.9));
    color: #cbd5e1;
    text-align: center;
}

.video-placeholder span {
    font-size: 2.2rem;
}

.video-placeholder small {
    max-width: 85%;
    line-height: 1.35;
    color: var(--muted);
    font-weight: 800;
}

.lightbox-error {
    max-width: 680px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.38);
    background: rgba(127, 29, 29, 0.36);
    color: #fecaca;
    text-align: center;
    line-height: 1.5;
}

.selected-file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.selected-file-item {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.48);
}

.selected-file-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #111827;
}

.selected-file-visual img,
.selected-file-visual video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.selected-file-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.selected-file-meta strong,
.selected-file-meta small {
    overflow-wrap: anywhere;
}

.selected-file-meta small {
    color: var(--muted);
    font-weight: 650;
}

.repair-video-form {
    display: grid;
    justify-items: start;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.repair-video-form p {
    margin: 0;
}

@media (max-width: 760px) {
    .flag-grid,
    .selected-file-preview {
        grid-template-columns: 1fr;
    }
}

.media-item {
    margin: 0;
    display: grid;
    gap: 10px;
    align-content: start;
}

.media-caption {
    color: #d9e4f5;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    line-height: 1.5;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.media-caption-editor {
    display: grid;
    gap: 7px;
    color: #dbeafe;
    font-weight: 750;
}

.media-caption-editor textarea {
    min-height: 78px;
    padding: 10px 11px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.selected-caption-editor {
    margin-top: 2px;
}

/* v1.7.0 code-driven frontpage hero */
.hero-front {
    min-height: 82vh;
}

.hero-front .hero-inner-centered {
    display: flex;
    justify-content: center;
    text-align: center;
    margin: auto auto 8vh;
}

.hero-code-card {
    position: relative;
    width: min(1160px, 100%);
    isolation: isolate;
    overflow: hidden;
    padding: clamp(28px, 5vw, 62px) clamp(18px, 4vw, 52px) clamp(30px, 5vw, 58px);
    border-radius: 34px;
    background:
        radial-gradient(circle at 22% 12%, rgba(56, 189, 248, 0.18), transparent 32%),
        radial-gradient(circle at 82% 5%, rgba(249, 115, 22, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.34));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(14px);
}

.hero-code-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255,255,255,0.034) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.5;
    mask-image: linear-gradient(to bottom, black, transparent 94%);
}

.hero-code-card::after {
    content: "";
    position: absolute;
    inset: auto 9% 18% 9%;
    height: 120px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.18), transparent 68%);
    filter: blur(16px);
}

.hero-logo-stack {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.hero-logo-main {
    color: #eef6ff;
    font-size: clamp(2rem, 5.1vw, 4.8rem);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.06em;
    text-shadow: 0 3px 0 rgba(15, 23, 42, 0.35), 0 14px 24px rgba(0, 0, 0, 0.32);
}

.hero-logo-sub {
    display: grid;
    grid-template-columns: minmax(55px, 185px) auto minmax(55px, 185px);
    align-items: center;
    gap: clamp(12px, 2vw, 22px);
    color: #dbeafe;
    width: min(620px, 100%);
}

.hero-logo-sub span {
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.9), transparent);
}

.hero-logo-sub strong {
    font-size: clamp(1rem, 2vw, 1.85rem);
    letter-spacing: 0.42em;
    padding-left: 0.42em;
    text-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.hero-code-card .hero-badge {
    margin: 4px auto 18px;
    padding: 11px 24px;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    color: #e0f2fe;
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.92), rgba(12, 74, 110, 0.94));
    border: 1px solid rgba(125, 211, 252, 0.45);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.18), inset 0 1px 0 rgba(255,255,255,0.18);
}

.hero-code-card h1 {
    max-width: 1080px;
    margin: 0 auto;
    color: #edf6ff;
    font-size: clamp(3.2rem, 8.4vw, 7.4rem);
    line-height: 0.9;
    letter-spacing: -0.078em;
    font-weight: 950;
    text-shadow: 0 5px 0 rgba(15, 23, 42, 0.28), 0 18px 38px rgba(0,0,0,0.38);
}

.route-strip {
    display: grid;
    grid-template-columns: auto auto minmax(300px, 620px) auto auto;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2.2vw, 24px);
    margin: clamp(22px, 4vw, 38px) auto 0;
    width: min(1080px, 100%);
}

.flag-card {
    width: clamp(82px, 12vw, 142px);
    aspect-ratio: 1.55 / 1;
    display: grid;
    place-items: center;
    padding: clamp(7px, 1vw, 10px);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.42));
    border: 1px solid rgba(125, 211, 252, 0.34);
    box-shadow: 0 14px 30px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.12);
}

.flag-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.32), 0 8px 18px rgba(0,0,0,0.26);
}

.route-strip .route-arrow {
    color: #91d5ff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.46), 0 8px 20px rgba(0,0,0,0.42);
}

.car-stage {
    min-width: 0;
    padding: 0 clamp(8px, 1.3vw, 18px);
    line-height: 0;
}

.tesla-learn-photo {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    opacity: 1;
    background: transparent;
    mix-blend-mode: normal;
    filter: none;
}


.trip-location-card {
    width: min(560px, calc(100% - 24px));
    margin: clamp(14px, 2.2vw, 22px) auto 0;
    padding: clamp(14px, 2vw, 18px) clamp(18px, 3vw, 30px);
    border-radius: 26px;
    background:
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.16), transparent 65%),
        rgba(8, 17, 31, 0.56);
    border: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.trip-location-heading {
    color: #eaf4ff;
    font-size: clamp(1.02rem, 2vw, 1.38rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    text-shadow: 0 10px 22px rgba(0,0,0,0.38);
}

.trip-location-label {
    margin-top: 8px;
    color: #ffffff;
    font-size: clamp(1.05rem, 2.1vw, 1.44rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 22px rgba(0,0,0,0.42);
}

.trip-location-updated {
    margin-top: 8px;
    color: #93a4ba;
    font-size: 0.86rem;
    font-weight: 650;
}

.trip-location-card[data-location-status="error"],
.trip-location-card[data-location-status="empty"] {
    opacity: 0.82;
}


.hero-intro {
    max-width: 760px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
    margin: 28px auto 0;
}

.hero-code-card .hero-actions {
    margin-top: 26px;
}

@media (max-width: 900px) {
    .hero-code-card {
        border-radius: 28px;
    }

    .route-strip {
        grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
        gap: 9px;
    }

    .flag-card {
        border-radius: 18px;
    }

    .flag-card img {
        border-radius: 12px;
    }
}

@media (max-width: 620px) {
    .hero-front {
        min-height: 74vh;
    }

    .hero-front .hero-inner-centered {
        margin-bottom: 7vh;
    }

    .hero-code-card {
        padding: 22px 12px 26px;
        border-radius: 24px;
    }

    .hero-logo-sub {
        grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
    }

    .hero-logo-sub strong {
        letter-spacing: 0.26em;
        padding-left: 0.26em;
    }

    .route-strip {
        grid-template-columns: auto auto minmax(145px, 1fr) auto auto;
        gap: 6px;
    }

    .flag-card {
        width: clamp(54px, 17vw, 72px);
        padding: 5px;
        border-radius: 14px;
    }

    .flag-card img {
        border-radius: 9px;
    }

    .route-strip .route-arrow {
        font-size: clamp(1.2rem, 7vw, 2rem);
    }

    .hero-code-card h1 {
        font-size: clamp(2.35rem, 13vw, 4.2rem);
    }

    .hero-logo-main {
        font-size: clamp(1.7rem, 9vw, 3rem);
    }

    
.trip-location-card {
    width: min(560px, calc(100% - 24px));
    margin: clamp(14px, 2.2vw, 22px) auto 0;
    padding: clamp(14px, 2vw, 18px) clamp(18px, 3vw, 30px);
    border-radius: 26px;
    background:
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.16), transparent 65%),
        rgba(8, 17, 31, 0.56);
    border: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.trip-location-heading {
    color: #eaf4ff;
    font-size: clamp(1.02rem, 2vw, 1.38rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    text-shadow: 0 10px 22px rgba(0,0,0,0.38);
}

.trip-location-label {
    margin-top: 8px;
    color: #ffffff;
    font-size: clamp(1.05rem, 2.1vw, 1.44rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 22px rgba(0,0,0,0.42);
}

.trip-location-updated {
    margin-top: 8px;
    color: #93a4ba;
    font-size: 0.86rem;
    font-weight: 650;
}

.trip-location-card[data-location-status="error"],
.trip-location-card[data-location-status="empty"] {
    opacity: 0.82;
}


.hero-intro {
        margin-top: 18px;
    }
}


.route-map-wrap {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 17, 31, 0.42);
    margin-top: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.route-map-canvas {
    width: 100%;
    height: min(64vh, 680px);
    min-height: 420px;
}

.route-map-canvas .leaflet-container {
    background: #dbeafe;
}

.route-map-canvas .leaflet-popup-content-wrapper,
.route-map-canvas .leaflet-popup-tip {
    background: #0f172a;
    color: #eaf4ff;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.route-map-canvas .leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.92);
    color: #eaf4ff;
    border-color: rgba(148, 163, 184, 0.24);
}

.route-stops-section {
    margin-top: 24px;
}

.route-stops-header {
    margin-bottom: 16px;
}

.route-stops-header h3 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: -0.04em;
}

.route-stops-header p {
    margin: 8px 0 0;
}

.route-stop-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.route-stop-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: flex-start;
    border-radius: 20px;
    padding: 16px;
    background: rgba(8, 17, 31, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.route-stop-step {
    min-width: 70px;
    border-radius: 999px;
    padding: 8px 10px;
    text-align: center;
    font-weight: 850;
    font-size: 0.86rem;
    color: #f8fafc;
    background: linear-gradient(180deg, rgba(59,130,246,0.35), rgba(14,165,233,0.2));
    border: 1px solid rgba(125, 211, 252, 0.18);
}

.route-stop-title {
    font-weight: 900;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.route-stop-country {
    margin-top: 2px;
    color: #93c5fd;
    font-weight: 750;
}

.route-stop-note {
    margin-top: 8px;
    color: #93a4ba;
    line-height: 1.45;
    font-size: 0.95rem;
}

@media (max-width: 920px) {
    .route-stop-list {
        grid-template-columns: 1fr;
    }

    .route-map-canvas {
        height: 460px;
    }
}

@media (max-width: 620px) {
    .route-map-canvas {
        height: 380px;
        min-height: 320px;
    }

    .route-stop-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .route-stop-step {
        min-width: 0;
        width: fit-content;
    }
}


/* v1.10.0 separat kartside */
.map-page-body {
    min-height: 100vh;
}

.map-page-header {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.map-page-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 70px;
}

.map-page-card {
    padding: clamp(20px, 3vw, 36px);
}

.map-page-card h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.route-map-wrap {
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(8, 17, 31, 0.42);
    margin-top: 20px;
    box-shadow:
        0 20px 54px rgba(0,0,0,0.24),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.route-map-canvas {
    width: 100%;
    height: min(68vh, 760px);
    min-height: 480px;
}

.route-map-canvas .leaflet-container {
    background: #dbeafe;
}

.route-map-canvas .leaflet-popup-content-wrapper,
.route-map-canvas .leaflet-popup-tip {
    background: #0f172a;
    color: #eaf4ff;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.route-map-canvas .leaflet-popup-content {
    color: #eaf4ff;
    font-weight: 650;
}

.route-map-canvas .leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.95);
    color: #eaf4ff;
    border-color: rgba(148, 163, 184, 0.24);
}

.location-log-section {
    margin-top: 26px;
    border-radius: 24px;
    background: rgba(8, 17, 31, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.14);
    padding: clamp(16px, 2.5vw, 24px);
}

.location-log-header {
    margin-bottom: 12px;
}

.location-log-header h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: -0.05em;
}

.location-log-header p {
    margin: 8px 0 0;
}


.location-log-stats {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.location-log-total,
.location-log-average-temp {
    margin: 0;
    line-height: 1.45;
}

.location-log-total {
    font-weight: 950;
    color: #eaf4ff;
}

.location-log-average-temp {
    color: #b9c9dc;
    font-weight: 750;
}

.location-log-total.is-empty,
.location-log-average-temp.is-empty {
    display: none;
}

.location-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: #dbeafe;
    font-size: clamp(0.86rem, 1.5vw, 0.98rem);
}

.location-log-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.55;
    overflow-wrap: break-word;
}

.location-log-row {
    padding-left: 4.5ch;
    text-indent: -4.5ch;
}

.location-log-summary {
    margin-top: 14px;
    padding-top: 16px !important;
    border-top: 1px solid rgba(125, 211, 252, 0.32);
    border-bottom: 0 !important;
    font-weight: 900;
    color: #eaf4ff;
}

.location-log-list li:last-child {
    border-bottom: 0;
}

.location-log-empty {
    color: #93a4ba;
}

.map-note {
    color: #93a4ba;
    line-height: 1.6;
}


.map-header-side {
    display: grid;
    gap: 12px;
    justify-items: end;
    min-width: min(360px, 100%);
}

.map-theme-toggle {
    border: 1px solid rgba(125, 211, 252, 0.24);
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.88));
    color: #eaf4ff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 850;
    cursor: pointer;
    box-shadow:
        0 10px 24px rgba(0,0,0,0.22),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.map-theme-toggle:hover {
    border-color: rgba(125, 211, 252, 0.42);
    transform: translateY(-1px);
}

.map-theme-toggle[aria-pressed="true"] {
    background:
        linear-gradient(180deg, rgba(14, 116, 144, 0.9), rgba(15, 23, 42, 0.9));
    border-color: rgba(56, 189, 248, 0.45);
}

@media (max-width: 760px) {
    .map-page-header,
    .map-page-shell {
        width: min(100% - 24px, 1280px);
    }

    .map-card-header {
        flex-direction: column;
    }

    .map-header-side {
        width: 100%;
        justify-items: stretch;
    }

    .map-current-location {
        width: 100%;
        text-align: left;
    }

    .map-style-picker {
        justify-self: stretch;
    }

    .map-style-select {
        min-width: 0;
    }

    .route-map-canvas {
        height: 520px;
        min-height: 360px;
    }

    .location-log-row {
        padding-left: 0;
        text-indent: 0;
    }
}


/* v1.11.0 overordnet reiseplan */
.plan-page-body {
    min-height: 100vh;
}

.plan-page-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto 70px;
}

.plan-hero-card,
.plan-section,
.plan-principles,
.plan-privacy-note {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 16% 0%, rgba(56, 189, 248, 0.14), transparent 38%),
        radial-gradient(circle at 90% 12%, rgba(249, 115, 22, 0.12), transparent 35%),
        rgba(15, 23, 42, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    padding: clamp(22px, 3vw, 38px);
    margin-bottom: 28px;
}

.plan-hero-card::before,
.plan-section::before,
.plan-principles::before,
.plan-privacy-note::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.plan-hero-card > *,
.plan-section > *,
.plan-principles > *,
.plan-privacy-note > * {
    position: relative;
    z-index: 1;
}

.plan-hero-card h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
}

.plan-hero-card p,
.plan-section-header p,
.plan-principle-card p,
.plan-privacy-note p {
    color: var(--muted);
    line-height: 1.65;
}

.plan-hero-card p {
    max-width: 820px;
    margin: 18px 0 0;
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.plan-section-header {
    margin-bottom: 20px;
}

.plan-section-header h2,
.plan-privacy-note h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.plan-section-header p {
    max-width: 820px;
    margin: 10px 0 0;
}

.plan-timeline {
    display: grid;
    gap: 14px;
}

.plan-day-card {
    display: grid;
    grid-template-columns: 138px 1fr;
    gap: 18px;
    align-items: start;
    padding: clamp(16px, 2vw, 22px);
    border-radius: 24px;
    background: rgba(8, 17, 31, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.plan-day-date {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    padding: 10px 12px;
    color: #eaf4ff;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.24), rgba(15, 23, 42, 0.86));
    border: 1px solid rgba(125, 211, 252, 0.22);
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.plan-day-content h3 {
    margin: 0;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    letter-spacing: -0.045em;
}

.plan-day-content p {
    margin: 8px 0 0;
    color: #b6c3d4;
    line-height: 1.55;
}

.plan-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.plan-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbeafe;
    font-size: 0.83rem;
    font-weight: 750;
}

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

.plan-principle-card {
    border-radius: 22px;
    padding: clamp(16px, 2vw, 22px);
    background: rgba(8, 17, 31, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.plan-principle-card h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.035em;
}

.plan-principle-card p {
    margin: 9px 0 0;
}

.plan-privacy-note {
    border-color: rgba(249, 115, 22, 0.22);
    background:
        radial-gradient(circle at 18% 0%, rgba(249, 115, 22, 0.14), transparent 38%),
        rgba(15, 23, 42, 0.74);
}

@media (max-width: 720px) {
    .plan-page-shell {
        width: min(100% - 24px, 1160px);
    }

    .plan-day-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .plan-day-date {
        width: fit-content;
    }

    .plan-principle-grid {
        grid-template-columns: 1fr;
    }
}


.route-point-tooltip {
    background: rgba(15, 23, 42, 0.96);
    color: #eaf4ff;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.34);
    padding: 8px 10px;
    font-weight: 700;
    line-height: 1.35;
}

.route-point-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.96);
}

.route-point-tooltip-tag {
    display: inline-flex;
    width: fit-content;
    margin-top: 4px;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(125, 211, 252, 0.14);
    border: 1px solid rgba(125, 211, 252, 0.18);
    color: #f8fafc;
    font-size: 0.86em;
}


.route-number-marker-wrap {
    background: transparent;
    border: 0;
}

.route-number-marker {
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--marker-color, #f97316);
    border: 3px solid var(--marker-border, #fb7185);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    box-shadow:
        0 9px 20px rgba(0,0,0,0.38),
        inset 0 1px 0 rgba(255,255,255,0.24);
}

.route-number-marker[style*="#020617"] {
    color: #f8fafc;
}


.location-log-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: start;
    gap: 10px;
}

.location-log-number {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(125, 211, 252, 0.24);
    color: #eaf4ff;
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1;
}

.location-log-text {
    min-width: 0;
}

/* v1.11.16 location log override */

.location-log-row {
    display: block;
    list-style: none;
}

.location-log-number,
.location-log-text {
    display: inline;
}


.route-admin-current {
    display: grid;
    gap: 4px;
    margin: 16px 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.18);
}

.route-admin-current strong {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.route-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}

.inline-form {
    margin: 0;
}

.route-admin-list {
    margin-top: 18px;
}

.route-admin-table {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.route-admin-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.route-admin-row-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

@media (max-width: 700px) {
    .route-admin-row {
        grid-template-columns: 1fr;
    }
}


.route-edit-details {
    margin-top: 10px;
}

.route-edit-details summary {
    cursor: pointer;
    color: #bae6fd;
    font-weight: 800;
}

.route-edit-form {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.48);
}

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

.inline-check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    font-weight: 800;
}

.inline-check input {
    width: auto;
}

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


.location-log-summary {
    margin-top: 12px;
    padding-top: 16px !important;
    border-top: 2px solid rgba(125, 211, 252, 0.22) !important;
    font-weight: 950;
    color: #eaf4ff;
}


.route-number-marker.is-current-route-marker {
    position: relative;
    transform: scale(1.12);
    box-shadow:
        0 0 0 6px rgba(56, 189, 248, 0.20),
        0 0 24px rgba(56, 189, 248, 0.72),
        0 9px 20px rgba(0,0,0,0.38),
        inset 0 1px 0 rgba(255,255,255,0.24);
}

.route-number-marker.is-current-route-marker::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 999px;
    border: 2px solid rgba(125, 211, 252, 0.55);
    animation: route-current-pulse 1.8s ease-out infinite;
}

@keyframes route-current-pulse {
    0% {
        transform: scale(0.85);
        opacity: 0.75;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}


.trip-location-meta {
    margin-top: 8px;
    font-size: clamp(0.82rem, 1.6vw, 0.98rem);
    font-weight: 850;
    color: #dbeafe;
    opacity: 0.96;
}



.trip-location-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    font-size: clamp(0.82rem, 1.6vw, 0.98rem);
    font-weight: 850;
    color: #dbeafe;
    opacity: 0.96;
}

.trip-location-meta-divider {
    color: rgba(191, 219, 254, 0.84);
}

.weather-status-inline,
.drive-status-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.weather-status-icon,
.parking-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tesla-status-car {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 16px;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.16));
}

.tesla-status-car .car-body {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 4px;
    height: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 7px 10px 6px 6px;
}

.tesla-status-car .car-body::before {
    content: "";
    position: absolute;
    left: 7px;
    top: -5px;
    width: 13px;
    height: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(219, 234, 254, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: none;
    border-radius: 9px 9px 2px 2px;
    transform: skewX(-18deg);
}

.tesla-status-car .car-body::after {
    content: "";
    position: absolute;
    left: 9px;
    top: -3px;
    width: 9px;
    height: 4px;
    background: rgba(15, 23, 42, 0.62);
    border-radius: 4px 5px 1px 1px;
    transform: skewX(-18deg);
}

.tesla-status-car .wheel {
    position: absolute;
    bottom: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #0f172a 0 18%, #cbd5e1 19% 24%, #0f172a 25% 48%, #e2e8f0 49% 57%, #111827 58% 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.tesla-status-car .wheel.left {
    left: 6px;
}

.tesla-status-car .wheel.right {
    right: 6px;
}

.drive-status-inline.is-driving .wheel {
    animation: tesla-wheel-spin 0.9s linear infinite;
}

@keyframes tesla-wheel-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.upload-progress {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.46);
}

.upload-progress-bar {
    width: 100%;
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.20);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.28);
}

.upload-progress-bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #22c55e);
    transition: width 0.18s ease;
}

.upload-progress small {
    display: block;
    margin-top: 8px;
    color: #b6c7de;
    font-weight: 800;
}

.deploy-form code,
.admin-panel code {
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 7px;
    padding: 1px 5px;
}



.post-media img,
.current-media-preview img,
.selected-file-preview img,
.media-viewer img {
    image-orientation: from-image;
}


.processing-placeholder {
    border: 1px dashed rgba(125, 211, 252, 0.35);
    background: rgba(14, 165, 233, 0.10);
}

.processing-placeholder small {
    color: #bfdbfe;
}



.image-transform-editor {
    display: grid;
    gap: 7px;
    color: #d7e3f4;
    font-weight: 850;
    font-size: 0.96rem;
}

.image-transform-editor select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.70);
    color: #e5eefc;
    padding: 10px 12px;
    font: inherit;
    font-weight: 800;
}

.selected-transform-editor {
    margin-top: 10px;
}



.video-inline-preview {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    border-radius: inherit;
    background: rgba(15, 23, 42, 0.72);
}

.video-processing-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 3;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(125, 211, 252, 0.28);
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 900;
}

/* HLS video bruker automatisk kvalitet via hls.js når tilgjengelig. */



.video-status-summary {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 14px;
    background: rgba(14, 165, 233, 0.09);
    color: #cfe6ff;
    font-weight: 800;
}


/* v1.0.30 mobile layout fix */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
}

.auth-shell {
    width: 100%;
    min-width: 0;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    place-items: center;
}

.auth-card {
    width: min(460px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    min-width: 0;
    overflow: hidden;
}

.auth-card h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

.page-shell,
.admin-shell,
.topbar,
.admin-header,
.site-footer,
.hero-inner,
.plan-page-shell,
.map-page-shell,
.map-page-header {
    max-width: calc(100vw - 24px);
}

.post-card,
.admin-panel,
.empty-state,
.hero-card,
.map-card,
.plan-hero-card,
.plan-section,
.plan-principles,
.plan-privacy-note {
    min-width: 0;
    overflow: hidden;
}

.post-card {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.media-grid {
    width: 100%;
    min-width: 0;
}

.media-tile {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.media-tile img,
.media-tile video {
    max-width: 100%;
}

@media (max-width: 760px) {
    .auth-shell {
        min-height: 100dvh;
        justify-items: center;
        align-items: center;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .auth-card {
        padding: 22px 18px;
        border-radius: 26px;
    }

    .auth-card h1 {
        font-size: clamp(2rem, 10vw, 2.75rem);
        line-height: 0.98;
        letter-spacing: -0.06em;
    }

    .auth-card p {
        font-size: clamp(1rem, 5vw, 1.18rem);
        line-height: 1.25;
    }

    .page-shell,
    .admin-shell,
    .topbar,
    .admin-header,
    .site-footer,
    .hero-inner,
    .plan-page-shell,
    .map-page-shell,
    .map-page-header {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }

    .post-card {
        padding: 22px 16px;
        border-radius: 26px;
    }

    .post-title {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
        line-height: 1;
        flex-wrap: wrap;
    }

    .post-body {
        font-size: 1rem;
    }

    .media-grid,
    .media-grid.single,
    .media-grid.double,
    .media-grid.multi {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .media-tile,
    .media-grid.single .media-tile {
        aspect-ratio: 4 / 3;
        min-height: 0;
        max-height: none;
        border-radius: 20px;
    }

    .media-tile img,
    .media-tile video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hero-actions,
    .hero-actions-centered {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-actions .button {
        flex: 1 1 135px;
        min-width: 0;
        max-width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .auth-card {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        padding: 20px 16px;
    }

    .auth-card h1 {
        font-size: clamp(1.75rem, 9.5vw, 2.35rem);
    }

    .post-card {
        padding: 20px 14px;
    }

    .media-tile,
    .media-grid.single .media-tile {
        border-radius: 18px;
    }
}


/* v1.0.33 video worker progress */
.video-worker-panel {
    display: grid;
    gap: 12px;
    margin: 14px 0 18px;
    padding: 16px;
    border: 1px solid rgba(125, 211, 252, 0.24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.12), transparent 38%),
        rgba(8, 17, 31, 0.48);
}

.video-worker-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.video-worker-header strong {
    display: block;
    color: #eaf4ff;
    font-size: 1.04rem;
}

.video-worker-header p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.video-worker-state {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    color: #eaf4ff;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.video-worker-panel[data-state="running"] .video-worker-state {
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(125, 211, 252, 0.34);
}

.video-worker-panel[data-state="completed"] .video-worker-state {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(74, 222, 128, 0.34);
}

.video-worker-panel[data-state="stale"] .video-worker-state {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(251, 191, 36, 0.38);
}

.video-worker-panel[data-state="failed"] .video-worker-state,
.video-worker-panel[data-state="error"] .video-worker-state {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
}

.video-worker-progressbar {
    width: 100%;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 5px rgba(0,0,0,0.3);
}

.video-worker-progressbar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #60a5fa, #22c55e);
    transition: width 450ms ease;
    position: relative;
    overflow: hidden;
}

.video-worker-panel[data-state="running"] .video-worker-progressbar span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: translateX(-100%);
    animation: video-progress-shine 1.4s linear infinite;
}

@keyframes video-progress-shine {
    to {
        transform: translateX(100%);
    }
}

.video-worker-meta,
.video-worker-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #cfe6ff;
    font-size: 0.92rem;
    font-weight: 800;
}

.video-worker-counts {
    color: var(--muted);
    font-weight: 650;
}

@media (max-width: 700px) {
    .video-worker-header {
        flex-direction: column;
    }

    .video-worker-state {
        width: fit-content;
    }
}


/* v1.0.40: scroll/pan for zoomed images in lightbox */
.lightbox-content {
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    padding: 72px 18px 88px;
    align-items: start;
    justify-items: center;
}

.lightbox-content.is-zoomed {
    place-items: start center;
    cursor: grab;
}

.lightbox-content.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.lightbox-content img.lightbox-image {
    max-width: none;
    max-height: none;
    transform-origin: top center;
    touch-action: pan-x pan-y;
}

.lightbox-zoom-controls {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(10px);
}

.lightbox-zoom-controls button,
.lightbox-zoom-controls span {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.10);
    color: #f8fafc;
    min-width: 38px;
    padding: 8px 12px;
    font-weight: 900;
}

.lightbox-zoom-controls span {
    min-width: 64px;
    text-align: center;
    background: transparent;
    border-color: transparent;
}

/* v1.0.40: split weather and vehicle status */
.trip-location-weather {
    margin-top: 10px;
}

.trip-location-vehicle {
    margin-top: 6px;
    font-size: clamp(0.78rem, 1.45vw, 0.94rem);
    opacity: 0.94;
}

.vehicle-status-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .trip-location-vehicle {
        gap: 8px;
    }

    .vehicle-status-inline,
    .drive-status-inline {
        font-size: 0.9em;
    }

    .lightbox-zoom-controls {
        top: auto;
        bottom: max(58px, calc(env(safe-area-inset-bottom) + 58px));
        max-width: calc(100vw - 24px);
    }

    .lightbox-caption {
        bottom: max(14px, env(safe-area-inset-bottom));
    }
}


.vehicle-status-unavailable {
    color: rgba(226, 232, 240, 0.72);
    font-style: italic;
}


/* v1.0.49: simpler route leg editor */
.route-leg-edit-form {
    display: grid;
    gap: 14px;
}

.route-leg-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.16);
    color: #bfdbfe;
    font-weight: 850;
}

.route-leg-summary strong {
    color: #f8fafc;
}

.route-leg-grid {
    align-items: end;
}

.route-edit-advanced {
    margin-top: 2px;
    padding-top: 2px;
}

.route-edit-advanced summary {
    cursor: pointer;
    color: rgba(191, 219, 254, 0.82);
    font-weight: 800;
}

.route-edit-advanced p {
    margin: 8px 0 0;
}

@media (max-width: 720px) {
    .route-leg-summary {
        font-size: 0.92rem;
    }
}


/* v1.0.50: route editor fixed date format and leg km hint */
.field-hint {
    display: block;
    margin-top: 6px;
    color: rgba(203, 213, 225, 0.62);
    font-size: 0.78rem;
    line-height: 1.35;
}


/* v1.0.53: vertical right-side zoom controls and real 2-axis pan */
.lightbox {
    padding: 0;
    overflow: hidden;
}

.lightbox.show {
    display: block;
}

.lightbox-content {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: auto;
    display: block;
    padding: 0;
    touch-action: none;
}

.lightbox-content.is-zoomed {
    cursor: grab;
    touch-action: none;
}

.lightbox-content.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.lightbox-image-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    touch-action: none;
}

.lightbox-content img.lightbox-image {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    max-width: none;
    max-height: none;
    transform-origin: center center;
    touch-action: none;
    margin: 0;
    will-change: transform;
}

.lightbox-zoom-controls {
    position: fixed;
    top: 50%;
    right: max(14px, env(safe-area-inset-right));
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 1002;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    opacity: 0.35;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.lightbox-zoom-controls:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.82);
}

.lightbox-zoom-controls button,
.lightbox-zoom-controls span {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.13);
    color: #f8fafc;
    width: 54px;
    min-width: 54px;
    min-height: 44px;
    padding: 8px 8px;
    font-weight: 900;
    text-align: center;
}

.lightbox-zoom-controls span {
    width: 58px;
    min-width: 58px;
    min-height: 34px;
    background: transparent;
    border-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-zoom-controls [data-zoom-reset] {
    font-size: 0.78rem;
}

@media (max-width: 520px) {
    .lightbox-content {
        padding: 0;
    }

    .lightbox-zoom-controls {
        top: 50%;
        right: max(8px, env(safe-area-inset-right));
        bottom: auto;
        left: auto;
        transform: translateY(-50%);
        max-width: none;
    }

    .lightbox-zoom-controls button,
    .lightbox-zoom-controls span {
        width: 50px;
        min-width: 50px;
        min-height: 42px;
    }
}


/* v1.0.54: keep close button above zoomed image and reduce zoom control opacity */
.lightbox-close {
    z-index: 1010;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    z-index: 1000;
}

.lightbox-caption {
    z-index: 1004;
}

.lightbox-zoom-controls {
    z-index: 1006;
    opacity: 0.35;
}

.lightbox-zoom-controls:hover {
    opacity: 1;
}


/* v1.0.55: zoom controls stay 35% after click/focus, 100% only on hover */
.lightbox-zoom-controls {
    opacity: 0.35 !important;
}

.lightbox-zoom-controls:hover {
    opacity: 1 !important;
}

.lightbox-zoom-controls:focus-within {
    opacity: 0.35 !important;
}

.lightbox-zoom-controls:hover:focus-within {
    opacity: 1 !important;
}

/* v1.0.59: video quality selector for HLS playback */
.lightbox-video-quality-controls {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: max(18px, env(safe-area-inset-left));
    z-index: 1008;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 900;
}

.lightbox-video-quality-controls label {
    opacity: 0.85;
}

.lightbox-video-quality-controls select {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: #f8fafc;
    padding: 6px 10px;
    font: inherit;
    cursor: pointer;
}

.lightbox-video-quality-controls option {
    background: #0f172a;
    color: #f8fafc;
}

@media (max-width: 520px) {
    .lightbox-video-quality-controls {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
        right: 74px;
        justify-content: space-between;
        border-radius: 18px;
    }

    .lightbox-video-quality-controls select {
        min-width: 0;
        max-width: 160px;
    }
}

.video-worker-schedule-hint {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(180, 210, 255, 0.16);
}

.video-worker-schedule-hint code {
    display: block;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    overflow-wrap: anywhere;
    white-space: normal;
}

/* v1.0.68 admin navigation and diagnostics */
.admin-header-dashboard {
    align-items: flex-start;
}

.admin-header-title {
    min-width: 240px;
}

.admin-title-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.admin-title-link:hover h1 {
    color: #bae6fd;
}

.admin-main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    max-width: 760px;
}

.admin-main-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(15, 23, 42, 0.52);
    color: #dbeafe;
    text-decoration: none;
    font-weight: 850;
    line-height: 1.1;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.admin-main-nav-link:hover,
.admin-main-nav-link.active {
    border-color: rgba(125, 211, 252, 0.44);
    background: rgba(14, 165, 233, 0.16);
    color: #ffffff;
}

.admin-main-nav-link.logout {
    background: rgba(30, 41, 59, 0.72);
}

.admin-section-intro h2,
.diagnostic-panel h2 {
    margin-top: 0;
}

.diagnostic-grid {
    align-items: start;
}

.inline-code-block {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.34);
    color: #dbeafe;
    font-size: 0.86rem;
    line-height: 1.35;
}

.diagnostic-table-scroll {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.22);
}

.diagnostic-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 0.9rem;
}

.diagnostic-table th,
.diagnostic-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    text-align: left;
    vertical-align: top;
}

.diagnostic-table th {
    color: #bae6fd;
    font-weight: 900;
    background: rgba(15, 23, 42, 0.44);
}

.diagnostic-table td {
    color: #dbeafe;
    overflow-wrap: anywhere;
}

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

.diagnostic-details {
    margin-top: 12px;
}

.diagnostic-details summary {
    cursor: pointer;
    font-weight: 900;
    color: #eaf4ff;
}

.diagnostic-pre {
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.56);
    color: #dbeafe;
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .admin-header-dashboard {
        align-items: stretch;
    }

    .admin-main-nav {
        justify-content: flex-start;
        width: 100%;
        gap: 8px;
    }

    .admin-main-nav-link {
        flex: 1 1 calc(50% - 8px);
        padding: 10px 11px;
        font-size: 0.92rem;
    }

    .admin-main-nav-link.logout {
        flex-basis: 100%;
    }

    .health-grid.diagnostic-grid {
        grid-template-columns: 1fr;
    }
}

.admin-user-item > div {
    display: grid;
    gap: 3px;
}

.admin-current-user {
    align-self: center;
    font-size: 0.9rem;
    font-weight: 800;
}

/* v1.0.68: manual route point editor and mobile video viewport */
.route-manual-add {
    margin: 18px 0;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: rgba(14, 165, 233, 0.07);
}

.route-manual-add > summary {
    cursor: pointer;
    font-weight: 950;
    color: #eaf4ff;
}

.route-manual-form {
    margin-top: 14px;
}

.route-manual-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

@media (max-width: 760px) and (orientation: portrait) {
    .lightbox.has-video .lightbox-content {
        padding: 0;
        overflow: hidden;
        place-items: center;
    }

    .lightbox.has-video .lightbox-content video {
        width: 100vw;
        height: var(--mobile-video-viewport-height, 108dvh);
        max-width: none;
        max-height: none;
        object-fit: cover;
        border-radius: 0;
        box-shadow: none;
        background: #000;
    }

    .lightbox.has-video .lightbox-caption {
        left: 12px;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 8px 10px;
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.34);
    }
}

/* v1.0.68: pinch zoom support for touch screens */
.lightbox-content.is-pinching {
    cursor: zoom-in;
    user-select: none;
}

.selected-file-remove {
    justify-self: start;
    width: auto;
    min-height: 0;
    padding: 8px 14px;
    font-size: 0.92rem;
}

.selected-file-item .selected-file-remove {
    margin-top: -2px;
}

.delete-check {
    padding: 9px 12px;
    border: 1px solid rgba(248, 113, 113, 0.34);
    border-radius: 14px;
    background: rgba(127, 29, 29, 0.18);
    width: fit-content;
}

/* v1.0.70: edge-to-edge video lightbox on mobile landscape */
@media (max-height: 760px) and (orientation: landscape) and (pointer: coarse) {
    .lightbox.has-video,
    .lightbox.has-video.is-video-landscape-fullscreen {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        background: #000;
    }

    .lightbox.has-video .lightbox-content,
    .lightbox.has-video.is-video-landscape-fullscreen .lightbox-content {
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        padding: 0;
        overflow: hidden;
        place-items: center;
        background: #000;
    }

    .lightbox.has-video .lightbox-content video,
    .lightbox.has-video.is-video-landscape-fullscreen .lightbox-content video {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        object-fit: cover;
        border-radius: 0;
        box-shadow: none;
        background: #000;
    }

    .lightbox.has-video .lightbox-caption {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        padding: 7px 10px;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.34);
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        pointer-events: none;
    }

    .lightbox.has-video .lightbox-close {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
    }
}

.lightbox:fullscreen,
.lightbox:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    padding: 0;
    background: #000;
}

.lightbox:fullscreen.has-video .lightbox-content,
.lightbox:-webkit-full-screen.has-video .lightbox-content {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.lightbox:fullscreen.has-video .lightbox-content video,
.lightbox:-webkit-full-screen.has-video .lightbox-content video {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

/* v1.0.82: center image lightbox in the viewport, independent of zoom controls */
.lightbox:not(.has-video) .lightbox-content {
    padding: 0 !important;
    display: block;
}

.lightbox-image-stage {
    min-width: 100%;
    min-height: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.lightbox-content img.lightbox-image {
    margin: 0;
}

/* v1.0.82: media order controls in post editor */


/* v1.0.84: absolute image stage so zoomed images can pan fully to all edges */
.lightbox:not(.has-video) .lightbox-content {
    padding: 0 !important;
    display: block;
}

.lightbox-image-stage {
    position: relative;
    display: block;
    min-width: 100vw;
    min-height: 100dvh;
    box-sizing: border-box;
}

.lightbox-content img.lightbox-image {
    position: absolute;
    margin: 0;
    max-width: none;
    max-height: none;
}

/* v1.0.86: deterministic image canvas for full-edge pan and live pinch anchor */
.lightbox:not(.has-video) .lightbox-content {
    padding: 0 !important;
    display: block;
    overflow: auto;
    overflow-anchor: none;
}

.lightbox-image-stage {
    position: relative;
    display: block;
    box-sizing: border-box;
    overflow: visible;
    flex: 0 0 auto;
}

.lightbox-content img.lightbox-image {
    position: absolute;
    display: block;
    margin: 0;
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform: none;
    transform-origin: 0 0;
    user-select: none;
    -webkit-user-drag: none;
}

/* v1.0.86: prevent browser touch gestures from stealing image pinch/pan */
.lightbox:not(.has-video) .lightbox-content,
.lightbox:not(.has-video) .lightbox-image-stage,
.lightbox:not(.has-video) img.lightbox-image {
    touch-action: none;
    overscroll-behavior: contain;
}

/* v1.0.88: transform-based image pan/zoom. No scroll canvas; the image itself is clamped to all edges. */
.lightbox:not(.has-video) .lightbox-content {
    padding: 0 !important;
    display: block !important;
    overflow: hidden !important;
    overflow-anchor: none;
    touch-action: none;
}

.lightbox:not(.has-video) .lightbox-image-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100dvh !important;
    display: block !important;
    overflow: hidden !important;
    box-sizing: border-box;
    touch-action: none;
}

.lightbox:not(.has-video) .lightbox-content img.lightbox-image {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;
    transform-origin: center center !important;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    touch-action: none;
}


.app-version-top {
    position: fixed;
    top: max(6px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    z-index: 20;
    font-size: 0.62rem;
    line-height: 1;
    color: rgba(226, 232, 240, 0.42);
    letter-spacing: 0.02em;
    pointer-events: none;
    user-select: none;
}

/* v1.0.108: tracking and project lock controls */
.flash-warning {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.14);
    color: #fde68a;
}

.setting-toggle-list {
    display: grid;
    gap: 0.85rem;
    margin: 1rem 0;
}

.setting-toggle-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.48);
}

.setting-toggle-row input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    accent-color: #38bdf8;
}

.setting-toggle-row strong,
.setting-toggle-row small {
    display: block;
}

.setting-toggle-row small {
    margin-top: 0.18rem;
    color: rgba(226, 232, 240, 0.68);
    line-height: 1.4;
}

.setting-toggle-row.danger-toggle {
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(127, 29, 29, 0.18);
}

.setting-toggle-row.danger-toggle input[type="checkbox"] {
    accent-color: #f87171;
}
