/* Updated 2026-11-25: Fixed step counter for 3-panel layout */
* { box-sizing: border-box; }

:root {
    --ink: #1f2328;
    --muted: #5b6168;
    --line: #d8dbe0;
    --accent: #b5462b;
    --bg: #f6f4ef;
}

html, body { margin: 0; height: 100%; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

#app { display: flex; height: 100vh; }

.landing {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f7f6f2;
}

.landing-container {
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(24px, 6vw, 88px);
}

.landing-nav {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6e3dc;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #273c37;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .13em;
}

.landing-brand svg {
    width: 39px;
    height: 39px;
}

.brand-light {
    color: #8d9187;
    font-weight: 500;
}

.landing-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #273c37;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.landing-nav-cta span {
    color: #b5462b;
    font-size: 20px;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 5%;
    min-height: 640px;
    padding: 60px 0 82px;
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 23px;
    color: #737c70;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
}

.hero-copy > .eyebrow span {
    width: 22px;
    height: 2px;
    background: #b5462b;
}

.hero-copy h1,
.section-heading h2,
.landing-how h2,
.landing-final-cta h2 {
    margin: 0;
    color: #253b36;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -.055em;
}

.hero-copy h1 {
    font-size: clamp(48px, 5.7vw, 78px);
    line-height: .99;
}

.hero-copy h1 em,
.section-heading h2 em,
.landing-how h2 em {
    color: #b5462b;
    font-weight: 400;
}

.hero-description {
    max-width: 490px;
    margin: 25px 0 28px;
    color: #66716b;
    font-size: 17px;
    line-height: 1.75;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    min-height: 54px;
    padding: 0 22px;
    border-radius: 4px;
    background: #b5462b;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s ease, transform .2s ease;
}

.hero-cta:hover {
    transform: translateY(-2px);
    background: #96391f;
}

.hero-cta span {
    font-size: 20px;
    font-weight: 400;
}

.hero-note {
    margin: 13px 0 0;
    color: #85877f;
    font-size: 12px;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 45px;
    color: #727970;
    font-size: 11px;
}

.hero-highlights span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hero-highlights b {
    color: #b5462b;
    font-size: 10px;
    letter-spacing: .08em;
}

.hero-art {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 510px;
    isolation: isolate;
}

.hero-art::before {
    position: absolute;
    z-index: -2;
    width: min(94%, 490px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 44% 42%, #e8e5d7 0 34%, #eeece3 34.2% 55%, #f2f0e9 55.2%);
    content: "";
}

.art-orbit {
    position: absolute;
    z-index: -1;
    border: 1px solid #dad8cd;
    border-radius: 50%;
    transform: rotate(-24deg);
}

.orbit-one {
    width: 106%;
    height: 70%;
}

.orbit-two {
    width: 76%;
    height: 112%;
    transform: rotate(25deg);
}

.poster-sheet {
    position: relative;
    display: block;
    width: min(72%, 360px);
    min-width: 240px;
    height: auto;
    padding: 6px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(43, 48, 39, .22), 0 2px 6px rgba(43, 48, 39, .08);
    transform: rotate(3deg);
    transition: transform .35s ease;
}

.hero-art:hover .poster-sheet { transform: rotate(1deg) scale(1.02); }

/* Sits just under the poster, overlapping only its blank bottom margin. */
.art-sticker {
    position: relative;
    z-index: 1;
    align-self: flex-end;
    margin: -22px 2% 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #354b43;
    box-shadow: 0 8px 20px rgba(43, 48, 39, .16);
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    transform: rotate(-4deg);
}

.art-sticker span { color: #f3bd72; font-size: 18px; }

.launch-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    padding: 6px 14px 6px 6px;
    border: 1px solid #ecd3c8;
    border-radius: 999px;
    background: #fbeee8;
    color: #6f3a29;
    font-size: 13px;
    font-weight: 600;
}

.launch-badge-tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: #b5462b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.landing-sports {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 0 70px;
}

.landing-sports article {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(43, 48, 39, .06), 0 8px 24px rgba(43, 48, 39, .06);
}

.landing-sports article > span {
    display: grid;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: #f1efe6;
    font-size: 24px;
}

.landing-sports h3 {
    margin: 2px 0 4px;
    color: #344840;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 400;
}

.landing-sports p {
    margin: 0;
    color: #737a71;
    font-size: 13px;
    line-height: 1.6;
}

.landing-features {
    padding: 76px 0 88px;
    border-top: 1px solid #e6e3dc;
}

.section-heading h2,
.landing-how h2 {
    font-size: clamp(37px, 4vw, 52px);
    line-height: 1.05;
}

.section-heading .eyebrow,
.landing-how .eyebrow {
    margin-bottom: 17px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 43px;
}

.feature-card {
    position: relative;
    min-height: 200px;
    padding: 24px 21px;
    border: 1px solid #e4e2d9;
    background: rgba(255, 255, 255, .46);
}

.feature-number {
    color: #b5462b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}

.feature-card h3,
.how-steps h3 {
    margin: 28px 0 8px;
    color: #344840;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    font-weight: 400;
}

.feature-card p,
.how-steps p {
    margin: 0;
    color: #737a71;
    font-size: 13px;
    line-height: 1.7;
}

.landing-how {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 10%;
    padding: 75px 0 88px;
    border-top: 1px solid #e6e3dc;
}

.how-steps {
    display: grid;
    gap: 23px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.how-steps li {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 18px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2dfd7;
}

.how-steps li > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #d5d4c9;
    border-radius: 50%;
    color: #b5462b;
    font-size: 10px;
    font-weight: 700;
}

.how-steps h3 { margin: 0 0 4px; }

.landing-print-story {
    padding: 75px 0 88px;
    border-top: 1px solid #e6e3dc;
}

.print-story-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.print-story-text {
    max-width: 600px;
}

.print-story-text .eyebrow {
    margin-bottom: 10px;
    color: #b5462b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.print-story-text h2 {
    margin: 0 0 20px;
    font-size: clamp(28px, 5vw, 44px);
    letter-spacing: -.035em;
    line-height: 1.1;
}

.print-story-text h2 em {
    font-style: normal;
    color: #b5462b;
}

.print-story-text p {
    margin: 0;
    color: #737a71;
    font-size: 15px;
    line-height: 1.8;
}

.landing-final-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
    padding: 36px 42px;
    background: #344840;
}

.landing-final-cta .eyebrow {
    margin-bottom: 10px;
    color: #c1c7bb;
}

.landing-final-cta h2 {
    color: #fffefa;
    font-size: clamp(25px, 3vw, 36px);
    letter-spacing: -.035em;
}

.landing-final-cta .hero-cta {
    flex-shrink: 0;
    background: #d06848;
}

.landing-final-cta .hero-cta:hover { background: #bd5637; }

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    border-top: 1px solid #e6e3dc;
    color: #82867d;
    font-size: 12px;
}

.landing-footer .landing-brand {
    transform: scale(.82);
    transform-origin: left center;
}

@media (max-width: 1000px) {
    .landing-hero { gap: 2%; }
    .hero-copy h1 { font-size: clamp(48px, 6vw, 66px); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .landing-sports { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { min-height: 170px; }
}

@media (max-width: 800px) {
    .landing-container { padding: 0 24px; }
    .landing-nav { height: 76px; }
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 62px 0 55px;
    }
    .hero-copy h1 { font-size: clamp(50px, 10vw, 70px); }
    .hero-description { max-width: 560px; font-size: 16px; }
    .hero-highlights { margin-top: 30px; }
    .hero-art { min-height: 0; margin-top: 4px; padding: 40px 0; }
    .poster-sheet { width: min(66%, 340px); }
    .landing-how { grid-template-columns: 1fr; gap: 35px; }
    .landing-print-story { padding: 58px 0; }
    .landing-final-cta { padding: 30px; }
}

@media (max-width: 560px) {
    .landing-container { padding: 0 20px; }
    .landing-nav { height: 68px; }
    .landing-brand { font-size: 11px; }
    .landing-brand svg { width: 34px; height: 34px; }
    .landing-nav-cta { gap: 6px; font-size: 12px; }
    .landing-hero { padding: 48px 0 35px; }
    .hero-copy h1 { font-size: clamp(44px, 12vw, 59px); }
    .hero-description { margin: 20px 0 23px; font-size: 15px; }
    .hero-highlights { gap: 12px 16px; font-size: 10px; }
    .hero-art { min-height: 0; margin: 10px -8px 0; padding: 30px 0 34px; overflow: clip; }
    .poster-sheet { width: 70%; min-width: 220px; padding: 4px; }
    .art-sticker { margin-top: -16px; padding: 10px 11px; font-size: 8px; }
    .landing-features, .landing-how { padding: 58px 0; }
    .landing-print-story { padding: 48px 0; }
    .feature-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 30px; }
    .launch-badge { flex-wrap: wrap; border-radius: 14px; font-size: 12px; }
    .landing-sports { padding-bottom: 50px; }
    .feature-card { min-height: auto; padding: 20px; }
    .feature-card h3 { margin-top: 17px; }
    .section-heading h2, .landing-how h2 { font-size: 40px; }
    .landing-final-cta { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 22px; padding: 25px 22px; }
    .landing-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding: 15px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-cta, .poster-sheet { transition: none; }
}

/* App view */
.app-view {
    display: flex;
    flex: 1;
    min-width: 0;
}

.app {
    display: flex;
    height: 100vh;
}

/* Three-panel layout */
.settings-panel {
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px 22px 28px;
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
    overflow-y: auto;
}

.map-pane {
    position: relative;
    flex: 1;
    min-width: 0;
}

#map { position: absolute; inset: 0; background: #e9ecef; }
#map.drawing, #map.drawing .leaflet-interactive { cursor: crosshair; }
#map.over-selection, #map.over-selection .leaflet-interactive { cursor: move; }

.map-hint {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000;
    background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px;
    pointer-events: none;
}

.preview-panel {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px 22px 28px;
    background: #fff;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

header h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
header a { color: var(--accent); }

.header-top { margin-bottom: 16px; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: var(--ink);
    background: var(--bg);
}

.btn-back:active {
    background: var(--line);
}

section { display: flex; flex-direction: column; gap: 10px; counter-increment: step; }
h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.settings-panel { counter-reset: step; }
.step {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--ink); color: #fff; font-size: 12px;
}
/* Steps are numbered automatically, so hidden (other mode) sections are skipped. */
.step::before { content: counter(step); }

.mode-switch { margin-bottom: 14px; }

.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 16px 12px; border: 2px dashed var(--line); border-radius: 8px; cursor: pointer;
    text-align: center; font-size: 13px; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone strong { color: var(--ink); font-size: 14px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #fbf3f0; }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.dropzone.loaded { border-style: solid; border-color: var(--accent); }
.dropzone.error { border-color: #b42318; }
.field input[type="color"] { width: 100%; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.stats-fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.stats-fields .check { font-size: 13px; }
.stats-fields input[type="text"] {
    font: inherit; font-size: 14px; color: var(--ink); min-width: 0;
    padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.stats-fields input[type="text"]:disabled { background: var(--bg); color: var(--muted); }

.climb-fields { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 6px 8px; align-items: center; }
.climb-fields input[type="checkbox"] { accent-color: var(--accent); }
.climb-fields input[type="text"],
.climb-fields input[type="number"] {
    font: inherit; font-size: 14px; color: var(--ink); min-width: 0;
    padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.climb-fields input[type="text"]:disabled,
.climb-fields input[type="number"]:disabled { background: var(--bg); color: var(--muted); }
.climb-fields small { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.climb-km-input {
    width: 70px !important;
    text-align: center;
}
.climb-remove-btn {
    padding: 4px 8px !important;
    font-size: 12px !important;
    min-width: auto !important;
}
.btn-add-climb {
    font: inherit; height: 32px; padding: 0 10px;
    border-radius: 6px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s ease;
}
.btn-add-climb:hover { border-color: var(--accent); background: #fbf3f0; }
.btn-add-climb:active { background: var(--line); }

.climb-marker { width: 20px; height: 18px; }
.climb-marker.manual { width: 14px; height: 14px; }
.climb-marker svg { display: block; overflow: visible; }

.route-start-marker svg, .route-finish-marker svg { display: block; overflow: visible; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
[hidden] { display: none !important; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
    font: inherit; font-size: 14px; color: var(--ink);
    padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.field textarea { resize: vertical; }
.typography-controls { display: flex; flex-direction: column; gap: 10px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field input[type="range"] { accent-color: #000; }
.field strong { color: var(--ink); }
.field a { color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { accent-color: var(--accent); }

.segmented { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented label { flex: 1; text-align: center; padding: 8px 4px; font-size: 13px; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--ink); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

.tones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tones label {
    display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
    padding: 6px 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; color: var(--ink); text-align: center;
}
.tones input { position: absolute; opacity: 0; pointer-events: none; }
.tones label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tones label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatch { width: 100%; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.tone-filters { position: absolute; width: 0; height: 0; }

.map-info {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
    font-size: 12px; line-height: 1.4; transition: opacity .2s;
}
.map-info[hidden] {
    display: none;
}
.map-info.loading { opacity: .55; }
.map-info h3 { margin: 0 0 6px; font-size: 13px; }
.map-info dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.map-info dt { color: var(--muted); }
.map-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.map-info dd.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.map-info a { color: var(--accent); }

.map-info-container { position: relative; }
.btn-info {
    position: absolute; top: 0; right: 0; width: 28px; height: 28px; padding: 0;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
    background: transparent; border: none; cursor: pointer; color: var(--muted);
    transition: color .2s;
}
.btn-info:hover { color: var(--ink); }
.btn-info[aria-expanded="true"] { color: var(--accent); }

.btn {
    font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 12px; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
#downloadBtn { background: #000; border-color: #000; color: #fff; }

.export-options {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    background: #fafaf9;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.export-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.export-option input[type="radio"] {
    cursor: pointer;
    margin: 0;
}

.export-option span {
    user-select: none;
}

.note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.note.warn { color: #9a5b00; }
.status { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.status.error { color: #b42318; }

.preview-section { 
    align-items: center;
    flex: 1;
    display: flex;
    justify-content: center;
}

.preview {
    position: relative;
    width: 100%;
    max-width: 240px;
    aspect-ratio: auto;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.12);
}
.preview > div { position: absolute; }
.preview.stale .preview-map { opacity: .45; }
.preview-map {
    background: #eceae4 center / cover no-repeat; outline: 1px solid var(--ink);
    display: grid; place-items: center; color: var(--muted); font-size: 11px;
}

.climb-loading {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin-top: 2px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}
.preview-title { text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-text { text-align: center; color: var(--muted); overflow: hidden; line-height: 1.35; }
.preview > svg.preview-meta { position: absolute; overflow: hidden; pointer-events: none; }
.preview > svg.preview-route { position: absolute; overflow: hidden; pointer-events: none; }
.preview > svg.preview-profile { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.preview-stats { display: flex; align-items: flex-start; }
.preview-stats > div { flex: 1; min-width: 0; text-align: center; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.preview-stats > div + div { border-left: 1px solid #c9ccd1; }
.preview-stats b { display: block; }
.preview-stats small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

@media (max-width: 1200px) {
    .settings-panel {
        width: 300px;
    }

    .preview-panel {
        width: 260px;
    }
}

@media (max-width: 800px) {
    .app-view {
        flex-direction: column;
    }

    .map-pane {
        height: 50vh;
        flex: none;
    }

    .settings-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--line);
        order: -1;
    }

    .preview-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--line);
        order: 1;
    }

}

/* Scale bar control */
.scale-bar-control {
    background: white;
    padding: 8px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    color: var(--muted);
    min-width: 60px;
}

.scale-bar {
    display: flex;
    height: 8px;
    border: 1px solid var(--muted);
    margin-bottom: 2px;
    background: white;
}

.scale-segment {
    border-right: 1px solid var(--muted);
}

.scale-segment:last-child {
    border-right: none;
}

.scale-segment.dark {
    background: var(--muted);
}

.scale-segment.light {
    background: white;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    text-align: center;
    color: var(--ink);
}

.scale-label {
    flex: 1;
    padding: 1px 0;
}

.scale-label:first-child {
    text-align: left;
}

.scale-label:last-child {
    text-align: right;
}
