/* =============================================================================
   Nomad Riders Go: design system
   -----------------------------------------------------------------------------
   Brand source: nomadriders.gr + the channel logo. Forest greens, rust and coral
   accents, warm paper neutrals, Space Grotesk (display) + Manrope (text).
   Every colour below is a token; components use tokens, never raw values, so the
   light and dark themes stay in step. Bootstrap's own variables are mapped onto
   these tokens, so stock Bootstrap markup (forms, tables, alerts) is on-brand too.
   ============================================================================= */

/* --- Fonts (bundled in wwwroot/fonts, so the app works offline) --------------
   Variable fonts, one file per script. Space Grotesk has no Greek glyphs, so Greek
   text in a display heading falls through to Manrope's Greek per glyph. OFL 1.1:
   see fonts/OFL-*.txt. */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url('fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('fonts/manrope-greek-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* --- Tokens: shared ------------------------------------------------------ */
:root {
    --nr-font-display: 'Space Grotesk', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --nr-font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Brand palette (from nomadriders.gr) */
    --nr-forest-900: #1d2b1f;
    --nr-forest-800: #2f4735;
    --nr-forest-700: #3e5540;
    --nr-forest-600: #475948;
    --nr-forest-500: #566d57;
    --nr-forest-300: #768d75;
    --nr-forest-100: #d0e9ce;
    --nr-rust: #9b4427;
    --nr-rust-700: #82381f;
    --nr-coral: #ff8f6b;
    --nr-coral-600: #f4774f;
    --nr-sun: #ffcd57;
    --nr-ink: #161616;

    --nr-radius-sm: 10px;
    --nr-radius: 16px;
    --nr-radius-lg: 24px;
    --nr-container: 1200px;
    --nr-gutter: clamp(1rem, 3vw, 2rem);
    --nr-topbar-h: 64px;
    --nr-tabbar-h: 64px;
    --nr-ease: cubic-bezier(0.22, 1, 0.36, 1);
    /* Topographic contour lines: the ride-map texture behind hero/brand panels */
    --nr-topo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400' viewBox='0 0 600 400'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Cpath d='M-20 320c80-40 130-10 200-50s110-120 200-110 140 90 240 60'/%3E%3Cpath d='M-20 345c90-35 140-5 210-45s120-115 205-105 135 85 225 60'/%3E%3Cpath d='M-20 370c95-30 150 0 220-40s125-110 210-100 130 80 210 60'/%3E%3Cpath d='M-20 290c70-45 120-15 190-55s100-125 195-115 145 95 255 60'/%3E%3Cpath d='M-20 260c60-50 110-20 180-60s95-130 190-120 150 100 270 60'/%3E%3Cpath d='M240 150c20-30 60-40 90-20s30 55 0 70-75 5-90-50z'/%3E%3Cpath d='M255 152c15-20 45-27 66-13s21 38 0 49-54 3-66-36z'/%3E%3Cpath d='M-20 60c100 30 160-20 260 0s140 70 240 40 100-30 140-20'/%3E%3Cpath d='M-20 30c100 30 170-20 270 0s140 65 240 35 100-30 130-20'/%3E%3C/g%3E%3C/svg%3E");

    /* Back-compat aliases for older component CSS further down this file. */
    --nr-accent: var(--nr-cta);
    --nr-accent-hover: var(--nr-cta-hover);
    --nr-accent-active: var(--nr-cta-hover);
}

/* --- Tokens: light (the brand's home theme) ----------------------------- */
[data-bs-theme="light"] {
    --nr-bg: #f6f3ee;
    --nr-surface: #ffffff;
    --nr-surface-2: #efeae2;
    --nr-border: #e2dcd1;
    --nr-text: #161616;
    --nr-text-muted: #5b6359;
    --nr-primary: #3e5540;          /* links, icons, focus */
    --nr-primary-strong: #2f4735;
    --nr-primary-soft: #e4ecdf;
    --nr-on-primary: #ffffff;
    --nr-cta: #9b4427;              /* primary buttons: rust on paper */
    --nr-cta-hover: #82381f;
    --nr-on-cta: #ffffff;
    --nr-trail: #d4572a;            /* route lines on maps, elevation chart */
    --nr-me: #2b7bd6;               /* the rider's own position on maps (the usual GPS blue) */
    --nr-chart-bg: #f3efe8;
    --nr-shadow-sm: 0 1px 2px rgba(22, 22, 22, 0.06);
    --nr-shadow: 0 1px 2px rgba(22, 22, 22, 0.05), 0 10px 30px -12px rgba(22, 22, 22, 0.18);
    --nr-skeleton-bg: rgba(22, 22, 22, 0.06);
    --nr-skeleton-shimmer: rgba(22, 22, 22, 0.1);

    --bs-body-bg: var(--nr-bg);
    --bs-body-color: var(--nr-text);
    --bs-emphasis-color: #000000;
    --bs-secondary-color: var(--nr-text-muted);
    --bs-secondary-bg: var(--nr-surface);
    --bs-tertiary-bg: var(--nr-surface-2);
    --bs-border-color: var(--nr-border);
    --bs-border-color-translucent: rgba(22, 22, 22, 0.08);
    --bs-primary: #3e5540;
    --bs-primary-rgb: 62, 85, 64;
    --bs-link-color: #3e5540;
    --bs-link-color-rgb: 62, 85, 64;
    --bs-link-hover-color: #2f4735;
    --bs-link-hover-color-rgb: 47, 71, 53;
    --nr-route-card-title: var(--nr-text);
}

/* --- Tokens: dark -------------------------------------------------------- */
[data-bs-theme="dark"] {
    --nr-bg: #0e1310;
    --nr-surface: #151c17;
    --nr-surface-2: #1c251e;
    --nr-border: #283329;
    --nr-text: #eceee8;
    --nr-text-muted: #9ca698;
    --nr-primary: #a4c79e;          /* sage, readable on dark */
    --nr-primary-strong: #c2dcbd;
    --nr-primary-soft: rgba(164, 199, 158, 0.13);
    --nr-on-primary: #10200f;
    --nr-cta: #ff8f6b;              /* coral with ink text: AA on dark */
    --nr-cta-hover: #ffa486;
    --nr-on-cta: #1d0e07;
    --nr-trail: #ff7a4d;
    --nr-me: #4c9bf0;
    --nr-chart-bg: #121915;
    --nr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --nr-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -14px rgba(0, 0, 0, 0.7);
    --nr-skeleton-bg: rgba(255, 255, 255, 0.05);
    --nr-skeleton-shimmer: rgba(255, 255, 255, 0.09);

    --bs-body-bg: var(--nr-bg);
    --bs-body-color: var(--nr-text);
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: var(--nr-text-muted);
    --bs-secondary-bg: var(--nr-surface);
    --bs-tertiary-bg: var(--nr-surface-2);
    --bs-border-color: var(--nr-border);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.07);
    --bs-primary: #a4c79e;
    --bs-primary-rgb: 164, 199, 158;
    --bs-link-color: #a4c79e;
    --bs-link-color-rgb: 164, 199, 158;
    --bs-link-hover-color: #c2dcbd;
    --bs-link-hover-color-rgb: 194, 220, 189;
    --nr-route-card-title: var(--nr-text);
}

/* --- Base ---------------------------------------------------------------- */
html, body {
    font-family: var(--nr-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6, .nr-display {
    font-family: var(--nr-font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bs-emphasis-color);
    text-wrap: balance;
}

p { text-wrap: pretty; }

a { text-decoration: none; color: var(--bs-link-color); }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

::selection { background: var(--nr-coral); color: var(--nr-ink); }

:focus-visible {
    outline: 2px solid var(--nr-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Blazor's FocusOnNavigate moves focus to the page <h1> after each navigation, for screen
   readers. That focus is programmatic, not a keyboard user's, so it must not draw a box. */
h1:focus, h1:focus-visible, #nr-main:focus { outline: none; }

.text-primary { color: var(--nr-primary) !important; }
.text-secondary { color: var(--nr-text-muted) !important; }

/* Small uppercase label above a heading: "MOTORCYCLE ROUTES · GREECE" */
.nr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--nr-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nr-primary);
}

/* Section headings in the brand's shouty style: "FOR THE ROAD" */
.nr-section-title {
    font-family: var(--nr-font-display);
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    margin: 0;
}

.nr-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.nr-section-head p { margin: 0.35rem 0 0; color: var(--nr-text-muted); }

.nr-link-arrow {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    color: var(--nr-primary);
}
.nr-link-arrow i { transition: transform 200ms var(--nr-ease); display: inline-block; }
.nr-link-arrow:hover i { transform: translateX(3px); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
    --bs-btn-border-radius: 12px;
    --bs-btn-font-weight: 700;
    --bs-btn-padding-x: 1.05rem;
    font-family: var(--nr-font-body);
    letter-spacing: 0.005em;
}
.btn-lg { --bs-btn-border-radius: 14px; --bs-btn-padding-y: 0.7rem; --bs-btn-padding-x: 1.4rem; }
.btn-sm { --bs-btn-border-radius: 10px; }

.btn-primary {
    --bs-btn-color: var(--nr-on-cta);
    --bs-btn-bg: var(--nr-cta);
    --bs-btn-border-color: var(--nr-cta);
    --bs-btn-hover-color: var(--nr-on-cta);
    --bs-btn-hover-bg: var(--nr-cta-hover);
    --bs-btn-hover-border-color: var(--nr-cta-hover);
    --bs-btn-active-color: var(--nr-on-cta);
    --bs-btn-active-bg: var(--nr-cta-hover);
    --bs-btn-active-border-color: var(--nr-cta-hover);
    --bs-btn-disabled-color: var(--nr-on-cta);
    --bs-btn-disabled-bg: var(--nr-cta);
    --bs-btn-disabled-border-color: var(--nr-cta);
    --bs-btn-focus-shadow-rgb: 155, 68, 39;
}

.btn-outline-primary {
    --bs-btn-color: var(--nr-primary);
    --bs-btn-border-color: color-mix(in srgb, var(--nr-primary) 45%, transparent);
    --bs-btn-hover-color: var(--nr-on-primary);
    --bs-btn-hover-bg: var(--nr-primary);
    --bs-btn-hover-border-color: var(--nr-primary);
    --bs-btn-active-color: var(--nr-on-primary);
    --bs-btn-active-bg: var(--nr-primary-strong);
    --bs-btn-active-border-color: var(--nr-primary-strong);
}

.btn-outline-secondary {
    --bs-btn-color: var(--nr-text);
    --bs-btn-border-color: var(--nr-border);
    --bs-btn-bg: var(--nr-surface);
    --bs-btn-hover-color: var(--nr-text);
    --bs-btn-hover-bg: var(--nr-surface-2);
    --bs-btn-hover-border-color: var(--nr-border);
    --bs-btn-active-color: var(--nr-text);
    --bs-btn-active-bg: var(--nr-surface-2);
    --bs-btn-active-border-color: var(--nr-border);
}

/* Forest button for secondary brand actions ("Open the map") */
.btn-forest {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nr-forest-700);
    --bs-btn-border-color: var(--nr-forest-700);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nr-forest-800);
    --bs-btn-hover-border-color: var(--nr-forest-800);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--nr-forest-900);
    --bs-btn-active-border-color: var(--nr-forest-900);
}

/* On a dark/green surface (hero, footer) */
.btn-on-dark {
    --bs-btn-color: #fff;
    --bs-btn-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-border-color: rgba(255, 255, 255, 0.35);
    --bs-btn-hover-color: var(--nr-ink);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: var(--nr-ink);
    --bs-btn-active-bg: #fff;
    --bs-btn-active-border-color: #fff;
    backdrop-filter: blur(6px);
}

/* The brand's tilted coral "JOIN THE RIDE" sticker */
.nr-sticker {
    display: inline-block;
    background: var(--nr-coral);
    color: var(--nr-rust-700);
    font-family: var(--nr-font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 0.55rem 0.9rem 0.5rem;
    border-radius: 10px;
    transform: rotate(-4deg);
    box-shadow: 0 10px 24px -10px rgba(155, 68, 39, 0.55);
    transition: transform 250ms var(--nr-ease);
}
a.nr-sticker:hover { text-decoration: none; transform: rotate(-1deg) scale(1.03); color: var(--nr-rust-700); }

/* --- Forms ----------------------------------------------------------------- */
.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--nr-border);
    background-color: var(--nr-surface);
    color: var(--nr-text);
}
.form-control-lg, .form-select-lg { border-radius: 14px; font-size: 1rem; padding: 0.7rem 1rem; }
.form-control::placeholder { color: color-mix(in srgb, var(--nr-text-muted) 75%, transparent); }
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--nr-primary);
    box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--nr-primary) 22%, transparent);
    background-color: var(--nr-surface);
    color: var(--nr-text);
}
.form-label { font-weight: 600; font-size: 0.9rem; }
.form-check-input:checked { background-color: var(--nr-forest-700); border-color: var(--nr-forest-700); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--nr-forest-500); border-color: var(--nr-forest-500); }

/* --- Cards & surfaces ----------------------------------------------------- */
.card {
    --bs-card-bg: var(--nr-surface);
    --bs-card-border-color: var(--nr-border);
    --bs-card-border-radius: var(--nr-radius);
    --bs-card-inner-border-radius: calc(var(--nr-radius) - 1px);
    box-shadow: var(--nr-shadow-sm);
}

.alert { border-radius: var(--nr-radius-sm); }
.alert-secondary {
    --bs-alert-bg: var(--nr-surface-2);
    --bs-alert-border-color: var(--nr-border);
    --bs-alert-color: var(--nr-text-muted);
}

.table { --bs-table-bg: transparent; --bs-table-border-color: var(--nr-border); }
.list-group {
    --bs-list-group-bg: var(--nr-surface);
    --bs-list-group-border-color: var(--nr-border);
    --bs-list-group-border-radius: var(--nr-radius);
    --bs-list-group-action-hover-bg: var(--nr-surface-2);
}
.dropdown-menu {
    --bs-dropdown-bg: var(--nr-surface);
    --bs-dropdown-border-color: var(--nr-border);
    --bs-dropdown-border-radius: 14px;
    --bs-dropdown-link-hover-bg: var(--nr-surface-2);
    --bs-dropdown-link-active-bg: var(--nr-primary-soft);
    --bs-dropdown-link-active-color: var(--nr-text);
    --bs-dropdown-padding-x: 0.35rem;
    --bs-dropdown-item-border-radius: 10px;
    box-shadow: var(--nr-shadow);
}
.dropdown-item { border-radius: 10px; font-weight: 600; font-size: 0.92rem; padding: 0.5rem 0.75rem; }
.dropdown-item i { width: 1.25rem; display: inline-block; color: var(--nr-text-muted); }

/* --- App shell -------------------------------------------------------------
   Desktop: sticky top bar (logo, nav, account) + content + footer.
   Mobile (< 992px): slim top bar (logo, theme, account) + bottom tab bar, the
   pattern native apps use, so the MAUI head feels like an app, not a website. */
.nr-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.nr-container {
    width: 100%;
    max-width: calc(var(--nr-container) + 2 * var(--nr-gutter));
    margin: 0 auto;
    padding-left: var(--nr-gutter);
    padding-right: var(--nr-gutter);
}

.nr-skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    background: var(--nr-cta);
    color: var(--nr-on-cta);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-weight: 700;
}
.nr-skip-link:focus { top: 0.75rem; }

.nr-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding-top: env(safe-area-inset-top, 0px);
    background: color-mix(in srgb, var(--nr-bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid color-mix(in srgb, var(--nr-border) 70%, transparent);
}

.nr-topbar-inner {
    height: var(--nr-topbar-h);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Global back button, far left of the top bar (Watchario's site-back). Quiet chrome, not a destination. */
.nr-back-btn {
    width: 36px;
    height: 36px;
    margin-right: 0.15rem;
    border-radius: 12px;
    border: 1px solid var(--nr-border);
    background: transparent;
    color: var(--nr-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.nr-back-btn:hover, .nr-back-btn:focus-visible { background: var(--nr-surface-2); color: var(--nr-text); }
.nr-back-btn:active { transform: scale(0.94); }

.nr-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    color: inherit;
}
.nr-logo:hover { text-decoration: none; }
.nr-logo img { height: 44px; width: auto; display: block; }
.nr-logo .nr-logo-light { display: block; }
.nr-logo .nr-logo-dark { display: none; }
[data-bs-theme="dark"] .nr-logo .nr-logo-light { display: none; }
[data-bs-theme="dark"] .nr-logo .nr-logo-dark { display: block; }

/* The "GO" in Nomad Riders Go: a tiny coral sticker beside the mark */
.nr-logo-go {
    font-family: var(--nr-font-display);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    background: var(--nr-coral);
    color: var(--nr-rust-700);
    padding: 0.18rem 0.42rem 0.14rem;
    border-radius: 6px;
    transform: rotate(-6deg) translateY(-6px);
}

.nr-topnav { display: flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; }

.nr-topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: var(--nr-text-muted);
    font-weight: 700;
    font-size: 0.92rem;
    transition: background-color 160ms ease, color 160ms ease;
}
.nr-topnav-link:hover { color: var(--nr-text); background: var(--nr-surface-2); text-decoration: none; }
.nr-topnav-link.active { color: var(--nr-primary-strong); background: var(--nr-primary-soft); }
[data-bs-theme="dark"] .nr-topnav-link.active { color: var(--nr-primary-strong); }

.nr-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.nr-icon-round {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--nr-border);
    background: var(--nr-surface);
    color: var(--nr-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.nr-icon-round:hover { background: var(--nr-surface-2); text-decoration: none; color: var(--nr-text); }
.nr-icon-round:active { transform: scale(0.96); }

/* Theme toggle: one button, the icon shows the theme you'd switch TO. */
.nr-theme-toggle .bi-sun-fill { display: none; }
[data-bs-theme="dark"] .nr-theme-toggle .bi-sun-fill { display: inline-block; }
[data-bs-theme="dark"] .nr-theme-toggle .bi-moon-stars-fill { display: none; }

/* Account chip: avatar initial + name, opens the account dropdown */
.nr-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--nr-border);
    background: var(--nr-surface);
    color: var(--nr-text);
    font-weight: 700;
    font-size: 0.9rem;
    max-width: 220px;
}
.nr-account-btn:hover { background: var(--nr-surface-2); }
.nr-account-btn .nr-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--nr-forest-700);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--nr-font-display);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.nr-avatar-admin { background: var(--nr-rust); }

.nr-main {
    flex: 1;
    padding-top: clamp(1.25rem, 2.5vw, 2rem);
    padding-bottom: 4rem;
}

/* Bottom tab bar (mobile / app) */
.nr-tabbar { display: none; }

@media (max-width: 991.98px) {
    .nr-topnav, .nr-topbar .nr-account-name, .nr-topbar .nr-signin-label { display: none; }
    .nr-account-btn { padding: 0.2rem; }
    /* Signed out on a phone: the sign-in button is a circle like the language and theme buttons beside it. */
    .nr-signin-btn { width: 40px; height: 40px; padding: 0; border-radius: 999px; font-size: 1.1rem; }
    .nr-logo img { height: 38px; }
    :root { --nr-topbar-h: 58px; }

    .nr-tabbar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        height: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        background: color-mix(in srgb, var(--nr-surface) 90%, transparent);
        backdrop-filter: saturate(1.4) blur(16px);
        -webkit-backdrop-filter: saturate(1.4) blur(16px);
        border-top: 1px solid var(--nr-border);
    }

    .nr-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        color: var(--nr-text-muted);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        -webkit-tap-highlight-color: transparent;
        min-width: 0;
        padding: 0 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nr-tab:hover { text-decoration: none; color: var(--nr-text); }
    .nr-tab i {
        font-size: 1.25rem;
        line-height: 1;
        padding: 0.2rem 0.95rem;
        border-radius: 999px;
        transition: background-color 200ms var(--nr-ease), color 200ms ease;
    }
    .nr-tab.active { color: var(--nr-primary-strong); }
    .nr-tab.active i { background: var(--nr-primary-soft); color: var(--nr-primary-strong); }

    .nr-main { padding-bottom: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px) + 2rem); }
    .nr-footer { padding-bottom: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* --- Footer: the brand's green "JOIN THE RIDE" band ----------------------- */
.nr-footer {
    background: var(--nr-forest-800);
    color: rgba(255, 255, 255, 0.78);
    margin-top: auto;
}
[data-bs-theme="dark"] .nr-footer { background: #121a14; border-top: 1px solid var(--nr-border); }

.nr-footer-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem 0 2.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.nr-footer-cta h2 {
    color: #fff;
    font-size: clamp(1.4rem, 1rem + 1.8vw, 2.2rem);
    text-transform: uppercase;
    margin: 0 0 0.4rem;
}
.nr-footer-cta p { margin: 0; max-width: 44ch; }
.nr-footer-cta .nr-sticker { font-size: clamp(1.1rem, 0.9rem + 1vw, 1.5rem); justify-self: start; }

.nr-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0 1.5rem;
    font-size: 0.85rem;
}
.nr-footer-bottom img { height: 34px; opacity: 0.9; }
.nr-footer a { color: #fff; }
.nr-footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nr-footer-links a { color: rgba(255, 255, 255, 0.78); font-weight: 600; }
.nr-footer-links a:hover { color: #fff; }

@media (max-width: 767.98px) {
    .nr-footer-cta { grid-template-columns: 1fr; padding: 2.25rem 0 1.75rem; }
}

/* --- Page headers --------------------------------------------------------- */
.nr-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.nr-page-header h1 {
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
    margin: 0.2rem 0 0;
    line-height: 1.08;
}
.nr-page-header h1 > .bi { display: none; } /* legacy icon prefixes: the eyebrow carries context now */
.nr-page-header p { margin: 0.35rem 0 0; color: var(--nr-text-muted); }

/* Sticky variant (admin route form): pinned under the top bar, full-bleed. */
.nr-sticky-header {
    position: sticky;
    top: calc(var(--nr-topbar-h) + env(safe-area-inset-top, 0px));
    z-index: 1020;
    background: color-mix(in srgb, var(--nr-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin: calc(-1 * clamp(1.25rem, 2.5vw, 2rem)) calc(-1 * var(--nr-gutter)) 1.25rem;
    padding: 0.85rem var(--nr-gutter);
    border-bottom: 1px solid var(--nr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.nr-sticky-header h1 { font-size: 1.35rem; margin: 0; flex-shrink: 0; }
.nr-sticky-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nr-draft-switch { display: flex; align-items: center; gap: 0.4rem; padding-left: 0; margin-right: 0.25rem; white-space: nowrap; }
.nr-draft-switch .form-check-input { margin: 0; float: none; width: 2.4em; height: 1.3em; cursor: pointer; }
.nr-draft-switch .form-check-label { font-weight: 600; cursor: pointer; }
/* Phones: the editor's sticky header is ONE row: the pencil icon and the Save button only.
   "Save & Close" is hidden there (two buttons crowded the screen); the title text is kept for
   screen readers only. */
@media (max-width: 575.98px) {
    .nr-sticky-header { flex-wrap: nowrap; gap: 0.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
    .nr-sticky-header h1 { font-size: 1.3rem; display: flex; align-items: center; gap: 0.35rem; }
    .nr-sticky-title-text {
        position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .nr-sticky-actions { flex-wrap: nowrap; margin-left: auto; }
    .nr-sticky-actions .btn { white-space: nowrap; }
    .nr-sticky-actions .nr-save-close { display: none; }
}
/* A form label with an action button on the same row (WikiLoc URL + Fetch). */

/* --- Home hero ------------------------------------------------------------ */
.nr-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--nr-radius-lg);
    background:
        radial-gradient(120% 90% at 85% 10%, rgba(255, 143, 107, 0.18), transparent 55%),
        linear-gradient(160deg, var(--nr-forest-700) 0%, var(--nr-forest-800) 55%, var(--nr-forest-900) 100%);
    color: rgba(255, 255, 255, 0.86);
    padding: clamp(1.75rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
    isolation: isolate;
}

/* Topographic contour lines: the ride-map texture behind the hero */
.nr-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.16;
    background-image: var(--nr-topo);
    background-size: 600px 400px;
}

.nr-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: center;
    gap: 2rem;
}

.nr-hero .nr-eyebrow { color: var(--nr-forest-100); }

.nr-hero h1 {
    color: #fff;
    font-size: clamp(2.3rem, 1.4rem + 4.4vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    margin: 0.9rem 0 1rem;
}
.nr-hero h1 em { font-style: normal; color: var(--nr-coral); }

.nr-hero-lead { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); max-width: 46ch; margin: 0 0 1.6rem; }
.nr-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.nr-hero-art { position: relative; display: flex; justify-content: center; }
.nr-hero-art img {
    width: min(100%, 340px);
    height: auto;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.35));
    transform: rotate(-3deg);
}
.nr-hero-art .nr-sticker { position: absolute; right: 4%; bottom: 2%; font-size: 1.05rem; }

@media (max-width: 767.98px) {
    .nr-hero-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .nr-hero-art { order: -1; justify-content: flex-start; }
    .nr-hero-art img { width: 132px; transform: rotate(-4deg); }
    .nr-hero-art .nr-sticker { right: 0; bottom: auto; top: 0.4rem; font-size: 0.9rem; }
    .nr-hero h1 { margin-top: 0.5rem; }
}

/* --- Stat bento ------------------------------------------------------------ */
.nr-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}
@media (max-width: 767.98px) { .nr-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.nr-tile {
    border-radius: var(--nr-radius);
    padding: 1.1rem 1.15rem 1rem;
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    /* Badge on the left and the number on the right of the same row; the label below them. */
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon value" "label label";
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.7rem;
    align-content: space-between;
    min-height: 108px;
    box-shadow: var(--nr-shadow-sm);
}
.nr-tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nr-primary-soft);
    color: var(--nr-primary-strong);
    font-size: 1.05rem;
    grid-area: icon;
}
.nr-tile-value {
    grid-area: value;
    justify-self: end;
    text-align: end;
    white-space: nowrap;
    font-family: var(--nr-font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--bs-emphasis-color);
}
.nr-tile-label { grid-area: label; font-size: 0.82rem; color: var(--nr-text-muted); font-weight: 600; }

.nr-tile-coral { background: var(--nr-coral); border-color: transparent; }
.nr-tile-coral .nr-tile-value, .nr-tile-coral .nr-tile-label { color: var(--nr-ink); }
.nr-tile-coral .nr-tile-icon { background: rgba(155, 68, 39, 0.16); color: var(--nr-rust-700); }
.nr-tile-forest { background: var(--nr-forest-600); border-color: transparent; }
.nr-tile-forest .nr-tile-value { color: #fff; }
.nr-tile-forest .nr-tile-label { color: rgba(255, 255, 255, 0.75); }
.nr-tile-forest .nr-tile-icon { background: rgba(255, 255, 255, 0.14); color: #fff; }
.nr-tile-ink { background: #232523; border-color: transparent; }
.nr-tile-ink .nr-tile-value { color: #fff; }
.nr-tile-ink .nr-tile-label { color: rgba(255, 255, 255, 0.65); }
.nr-tile-ink .nr-tile-icon { background: rgba(255, 64, 64, 0.16); color: #ff6b6b; }

/* --- Chips ----------------------------------------------------------------- */
.nr-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.1;
    background: var(--nr-surface-2);
    color: var(--nr-text);
    border: 1px solid var(--nr-border);
    white-space: nowrap;
}
.nr-chip-forest { background: var(--nr-primary-soft); color: var(--nr-primary-strong); border-color: transparent; }

/* Difficulty, colour-coded AND labelled (never colour alone) */
.nr-diff { border-color: transparent; }
.nr-diff::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.nr-diff-1 { background: #e3efdc; color: #2f5a2a; }
.nr-diff-2 { background: #fdf0cc; color: #7a5a00; }
.nr-diff-3 { background: #ffe1d6; color: #9b4427; }
.nr-diff-4 { background: #2b2b2b; color: #ffcd57; }
[data-bs-theme="dark"] .nr-diff-1 { background: rgba(140, 200, 120, 0.16); color: #b5e0a6; }
[data-bs-theme="dark"] .nr-diff-2 { background: rgba(255, 205, 87, 0.15); color: #ffd97a; }
[data-bs-theme="dark"] .nr-diff-3 { background: rgba(255, 143, 107, 0.16); color: #ffab90; }
[data-bs-theme="dark"] .nr-diff-4 { background: rgba(255, 255, 255, 0.1); color: #ffcd57; }

.nr-draft-badge {
    display: inline-block;
    background: var(--nr-sun);
    color: #3d2c00;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.nr-card-admin-actions {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 2;
    display: flex;
    gap: 0.3rem;
    padding: 0.3rem;
    background: color-mix(in srgb, var(--nr-surface) 88%, transparent);
    border: 1px solid var(--nr-border);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--nr-shadow-sm);
}

.nr-icon-btn {
    background: var(--nr-surface-2);
    border: 1px solid var(--nr-border);
    color: var(--nr-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.nr-icon-btn:hover { background: var(--nr-surface); color: var(--nr-text); }
.nr-icon-btn-danger:hover {
    background: color-mix(in srgb, #d63c2f 12%, transparent);
    color: #c0352a;
    border-color: color-mix(in srgb, #d63c2f 45%, transparent);
}

/* --- Route detail ------------------------------------------------------------ */

.nr-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}
.nr-detail-head h1 {
    font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem);
    line-height: 1.05;
    margin: 0.45rem 0 0;
    max-width: 24ch;
}
.nr-detail-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* Rating summary under the route title: tap to jump to #nr-ratings (scroll-margin clears the top bar). */
.nr-rating-summary {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.45rem;
    margin-top: 0.65rem;
    font-size: 0.92rem;
    color: var(--nr-text-muted);
    text-decoration: none;
}
.nr-rating-summary strong { color: var(--nr-text); }
.nr-rating-summary:hover { color: var(--nr-text); text-decoration: none; }
.nr-rating-summary:hover .nr-rating-cta { text-decoration: underline; }
/* "Rate it": a small pill, so it reads as a button wherever the line wraps (as "· Rate it" text it
   started a phone's second line with a stray dot). */
.nr-rating-cta {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.65rem; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--nr-primary) 45%, transparent);
    color: var(--nr-primary-strong); font-weight: 700; font-size: 0.85rem; line-height: 1.4;
}
.nr-rating-summary:hover .nr-rating-cta { text-decoration: none; background: color-mix(in srgb, var(--nr-primary) 12%, transparent); }
#nr-ratings { scroll-margin-top: calc(var(--nr-topbar-h) + 1rem); }
.nr-detail-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Phones: a tidy grid instead of a ragged wrap. Download GPX (the main action) full width on top, Save
   and Share side by side, then the admin's edit / publish / delete as one even row. */
@media (max-width: 575.98px) {
    /* minmax(0, 1fr) and wrapping labels: with 1fr + nowrap a long label ("Sign in to save" in Greek)
       made the grid wider than the phone, and the whole page zoomed out to fit it. */
    .nr-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .nr-detail-actions > .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 0; text-align: center; }
    .nr-detail-actions > .btn-primary { grid-column: 1 / -1; order: -1; }
    .nr-detail-actions > .nr-admin-actions-header { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nr-detail-actions > .nr-admin-actions-header .btn { justify-content: center; padding: 0.4rem 0.35rem; font-size: 0.85rem; min-width: 0; }
}

:root { --nr-card-w: 300px; } /* every card in a horizontal row or card grid: routes, waypoints, videos */
:root { --nr-aside-w: 320px; --nr-aside-gap: 1.75rem; }
.nr-stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
@media (max-width: 767.98px) { .nr-stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* With the sidebar beside the content (>= 1100px, see .nr-detail-layout), the stat row uses the
   SAME columns: three tiles over the main column and the 4th exactly as wide as the sidebar below
   it. The 4th column's start is fixed by its width (aside-w from the right edge); a spacer column
   makes the gap before it the layout's gap (spacer = aside-gap minus the two 0.75rem gaps around it),
   so the 3rd tile also ends where the main column ends. */
@media (min-width: 1100px) {
    .nr-stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) calc(var(--nr-aside-gap) - 1.5rem) var(--nr-aside-w); }
    .nr-stat-tiles > :nth-child(4) { grid-column: 5; }
}

.nr-stat {
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    padding: 0.9rem 1rem;
    box-shadow: var(--nr-shadow-sm);
}
.nr-stat-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nr-text-muted);
}
.nr-stat-label i { color: var(--nr-primary); }
.nr-stat-value {
    font-family: var(--nr-font-display);
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--bs-emphasis-color);
    margin-top: 0.25rem;
    line-height: 1.1;
}
.nr-stat-value small { font-size: 0.55em; font-weight: 600; color: var(--nr-text-muted); margin-left: 0.15em; letter-spacing: 0; }

.nr-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--nr-aside-w);
    gap: var(--nr-aside-gap);
    align-items: start;
}
.nr-detail-aside { position: sticky; top: calc(var(--nr-topbar-h) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 1099.98px) {
    .nr-detail-layout { grid-template-columns: minmax(0, 1fr); }
    .nr-detail-aside { position: static; order: -1; }
}

.nr-panel {
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--nr-shadow-sm);
}
.nr-panel h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; margin: 0 0 0.75rem; }

.nr-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; margin: 0; font-size: 0.9rem; }
.nr-facts dt { font-weight: 600; color: var(--nr-text-muted); }
.nr-facts dd { margin: 0; font-weight: 700; text-align: right; }

.nr-detail-section { margin-bottom: 2rem; }
.nr-detail-section > h2 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.nr-detail-section > h2 i { color: var(--nr-primary); font-size: 1.05rem; }
.nr-subhead {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.nr-subhead > i { color: var(--nr-primary); font-size: 1.05rem; }
.nr-subhead > span { text-transform: none; letter-spacing: 0; font-family: var(--nr-font-body); }
.nr-description { font-size: 1.02rem; line-height: 1.65; white-space: pre-wrap; margin: 0; }

/* --- Auth (sign in / register) ------------------------------------------------ */
.nr-auth {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
    max-width: 980px;
    margin: clamp(0rem, 3vw, 2.5rem) auto;
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    overflow: hidden;
    box-shadow: var(--nr-shadow);
}
.nr-auth-brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(160deg, var(--nr-forest-700), var(--nr-forest-900));
    color: rgba(255, 255, 255, 0.82);
    padding: 2.5rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.nr-auth-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.14; background-image: var(--nr-topo); background-size: 600px 400px; }
.nr-auth-brand img { width: 170px; height: auto; transform: rotate(-3deg); }
.nr-auth-brand h2 { color: #fff; text-transform: uppercase; font-size: 1.9rem; line-height: 1; margin: auto 0 0; }
.nr-auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; font-weight: 600; }
.nr-auth-brand li { display: flex; gap: 0.55rem; align-items: center; }
.nr-auth-brand li i { color: var(--nr-coral); }

.nr-auth-form { padding: clamp(1.5rem, 4vw, 2.75rem); }
.nr-auth-form h1 { font-size: 1.85rem; margin: 0 0 0.35rem; }
.nr-auth-form > p { color: var(--nr-text-muted); margin: 0 0 1.5rem; }
.nr-auth-switch { text-align: center; color: var(--nr-text-muted); margin: 1.5rem 0 0; font-size: 0.92rem; }

@media (max-width: 767.98px) {
    .nr-auth { grid-template-columns: 1fr; border-radius: var(--nr-radius); }
    .nr-auth-brand { padding: 1.5rem; flex-direction: row; align-items: center; }
    .nr-auth-brand img { width: 84px; }
    .nr-auth-brand h2 { font-size: 1.3rem; margin: 0; }
    .nr-auth-brand ul { display: none; }
}

/* Legacy login container (kept for any page still using it) */
.nr-login-container {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius-lg);
    padding: 2.25rem 2rem;
    box-shadow: var(--nr-shadow);
}
.nr-login-container h1 { text-align: center; margin: 0 0 1.5rem; font-size: 1.6rem; }

/* --- Embedded video grid (route detail / admin form) -------------------- */
.nr-video-card {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.nr-video-card iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }


/* --- Map page ---------------------------------------------------------------------
   The /map page is one column exactly as tall as the visible screen: the header on top, the map
   filling the rest. So the map always fits, even on small phones, and the page itself never has to
   scroll (which is what lets one finger pan the map instead; see init(fullScreen) in
   nomadRidersMap.js). 100dvh follows the browser's address bar as it shows and hides.
   Height = screen − top bar − main's top padding − a bottom gap (desktop), and on phones also
   − the bottom tab bar and the safe-area insets. */
.nr-map-page {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--nr-topbar-h) - env(safe-area-inset-top, 0px) - clamp(1.25rem, 2.5vw, 2rem) - 1.5rem);
    min-height: 300px;
}
.nr-map-page .nr-page-header { flex-shrink: 0; margin-bottom: 0.85rem; }
.nr-map-page .nr-fullmap { flex: 1 1 auto; min-height: 0; height: auto; }
.nr-shell:has(.nr-map-page) .nr-main { padding-bottom: 1.5rem; }

@media (max-width: 991.98px) {
    .nr-map-page {
        height: calc(100dvh - var(--nr-topbar-h) - env(safe-area-inset-top, 0px)
                     - var(--nr-tabbar-h) - env(safe-area-inset-bottom, 0px) - 1.25rem - 0.75rem);
    }
    /* Every pixel goes to the map: a one-line header, no footer under it. */
    .nr-map-page .nr-page-header { margin-bottom: 0.6rem; align-items: center; }
    .nr-map-page .nr-page-header h1 { font-size: 1.35rem; margin: 0; }
    .nr-map-page .nr-page-header .nr-eyebrow,
    .nr-map-page .nr-page-header p { display: none; }
    .nr-shell:has(.nr-map-page) .nr-main { padding-bottom: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.75rem); }
    .nr-shell:has(.nr-map-page) .nr-footer { display: none; }
}

.nr-fullmap {
    width: 100%;
    border-radius: var(--nr-radius);
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

.nr-map {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
    .nr-map { aspect-ratio: 4 / 3; }
}

.nr-marker {
    background: transparent !important;
    border: none !important;
    font-size: 1.4rem;
    text-align: center;
    line-height: 1;
}

/* Waypoints when the map is zoomed out (nomadRidersMap.js toggles .nr-map-far below zoom 14): a small
   coral dot with a white ring instead of the icon, so a route's pins don't cover its track. */
.nr-wp > span { display: inline-block; }
.nr-map-far .nr-wp > span {
    font-size: 0; width: 11px; height: 11px; margin-top: 6px; border-radius: 50%;
    background: var(--nr-cta, #ff8f6b); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.nr-marker-start { color: #4caf50; }
.nr-marker-end { color: var(--nr-trail); }

/* GPX rubber-band editor anchor — small draggable dot. */
.nr-gpx-anchor {
    background: transparent !important;
    border: none !important;
}

.nr-gpx-anchor span {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1976d2;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

.nr-gpx-anchor span:active {
    cursor: grabbing;
    background: #ff9800;
}

/* Gesture-handling hint shown when the user tries to scroll/pan the map
   with one finger or wheel-without-Ctrl, mirroring Google Maps embed UX. */
.nr-map-gesture {
    position: relative;
}

.nr-map-gesture-hint {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nr-map-gesture-hint-show {
    opacity: 1;
}

/* --- Offline map (/offline-maps; js/nomadOfflineMaps.js): one button, all of Greece ------------ */
.nr-off-card { display: flex; flex-direction: column; gap: 1rem; max-width: 40rem; }
.nr-off [data-when] { display: none; }
/* Shown per state; "revert" gives each element its normal display (a span inline, a p block, a button inline-block). */
.nr-off[data-off-state="loading"] [data-when~="loading"], .nr-off[data-off-state="none"] [data-when~="none"],
.nr-off[data-off-state="offline"] [data-when~="offline"], .nr-off[data-off-state="nogl"] [data-when~="nogl"],
.nr-off[data-off-state="downloading"] [data-when~="downloading"], .nr-off[data-off-state="paused"] [data-when~="paused"],
.nr-off[data-off-state="paused-error"] [data-when~="paused-error"], .nr-off[data-off-state="full"] [data-when~="full"],
.nr-off[data-off-state="saved"] [data-when~="saved"] { display: revert; }
.nr-off[data-off-state="downloading"] .nr-off-progress { display: flex; }
.nr-off[data-off-stale="0"] .nr-off-stale, .nr-off[data-off-stale="0"] .nr-off-update { display: none !important; }
.nr-off-hero { display: flex; align-items: center; gap: 0.9rem; }
.nr-off-icon {
    flex: none; width: 3.25rem; height: 3.25rem; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    background: var(--nr-primary-soft); color: var(--nr-primary); font-size: 1.6rem;
}
.nr-off-note { color: var(--nr-text-muted); }
.nr-off-progress { flex-direction: column; gap: 0.4rem; }
.nr-off-bar { height: 10px; border-radius: 999px; background: var(--nr-surface-2); overflow: hidden; }
.nr-off-bar > span { display: block; height: 100%; width: 0; background: var(--nr-cta); transition: width 0.3s; }
@media (prefers-reduced-motion: reduce) { .nr-off-bar > span { transition: none; } }
.nr-off-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nr-off-buttons .btn { flex: 1 1 11rem; min-width: 0; white-space: normal; }
.nr-off-del-confirm { display: none; }
.nr-off[data-off-confirm="1"] .nr-off-del-ask { display: none; }
.nr-off[data-off-confirm="1"] .nr-off-del-confirm { display: inline; }
.nr-off[data-off-confirm="1"] .nr-off-delete { background: var(--bs-danger); color: var(--bs-white); }

/* --- Layers button (every map; nomadBaseMap.js): Map / Terrain / Satellite, like Google's --- */
.nr-layers { position: relative; }
.nr-layers-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
    background: var(--nr-surface); color: var(--nr-text); box-shadow: var(--nr-shadow-sm); font-size: 1.25rem;
}
.nr-layers-btn:focus-visible, .nr-layers-choice:focus-visible { outline: 3px solid var(--nr-cta); outline-offset: 2px; }
.nr-layers-panel {
    position: absolute; right: 0; top: 52px; z-index: 1000; width: min(18rem, calc(100vw - 2rem));
    padding: 0.75rem; border-radius: 16px; background: var(--nr-surface); color: var(--nr-text); box-shadow: var(--nr-shadow);
}
.nr-layers-panel[hidden] { display: none; }
.nr-layers-title { font-weight: 700; margin-bottom: 0.5rem; }
.nr-layers-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.nr-layers-choice {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0; border: 0; background: none;
    color: var(--nr-text); font-size: 0.8rem; font-weight: 600; text-align: center;
}
.nr-layers-choice small { font-size: 0.65rem; color: var(--nr-text-muted); font-weight: 500; }
.nr-layers-choice:disabled { opacity: 0.55; }
.nr-layers-swatch {
    width: 100%; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--nr-border); display: flex;
    align-items: center; justify-content: center; font-size: 1.5rem; color: #fff;
}
.nr-layers-map .nr-layers-swatch { background: linear-gradient(135deg, #f3f1ea 0 55%, #a8d4f0 55%); color: #3e5540; }
.nr-layers-terrain .nr-layers-swatch { background: linear-gradient(160deg, #cfdcc6, #8fa58a 60%, #a8d4f0 60%); color: #2f4735; }
.nr-layers-satellite .nr-layers-swatch { background: linear-gradient(160deg, #4a5d3a, #6b5a3c 55%, #16324a 55%); }
.nr-layers-choice.is-on .nr-layers-swatch { border-color: var(--nr-cta); box-shadow: 0 0 0 2px var(--nr-cta); }
.nr-layers-choice.is-on { color: var(--nr-cta); }
.nr-layers-offline {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px solid var(--nr-border);
    font-weight: 600; text-decoration: none;
}
/* The map credits folded into an "i" (nomadBaseMap.js compactAttribution); a tap unfolds them. */
/* 12px off the corner: the maps' rounded corners (16px) cut the circle. ".leaflet-container" outranks Leaflet's own margin: 0. */
.leaflet-container .leaflet-control-attribution.nr-attr { cursor: pointer; border-radius: 12px; margin: 0 12px 12px 0; padding: 2px 8px; }
.leaflet-control-attribution.nr-attr.is-folded {
    width: 24px; height: 24px; padding: 0; font-size: 0; overflow: hidden; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--nr-surface) 85%, transparent); color: var(--nr-text); box-shadow: var(--nr-shadow-sm);
}
.leaflet-control-attribution.nr-attr.is-folded::before { content: "i"; font: 700 13px/1 Georgia, serif; font-style: italic; }
.leaflet-control-attribution.nr-attr.is-folded * { pointer-events: none; }
/* MapLibre inside Leaflet: Leaflet's own attribution line is the one shown. */
.leaflet-container .maplibregl-ctrl-bottom-right, .leaflet-container .maplibregl-ctrl-bottom-left { display: none; }

/* --- "Show my location" (every map; nomadRidersMap.js _installLocate) ------ */
/* "Full screen" on a map in a page (nomadRidersMap.js _installMaximize): a fixed layer over the whole screen,
   above the top bar (1030) and the tab bar, below toasts. !important beats Leaflet's inline position: relative. */
.nr-max { margin-top: 10px; }
.nr-max-btn { font-size: 1.05rem; }
.leaflet-container.nr-map-max {
    position: fixed !important; inset: 0; z-index: 1060; width: auto !important; height: auto !important;
    margin: 0; border-radius: 0 !important; border: 0; aspect-ratio: auto; max-height: none;
}
.nr-map-max .leaflet-top { top: env(safe-area-inset-top, 0px); }
.nr-map-max .leaflet-bottom { bottom: env(safe-area-inset-bottom, 0px); }
html.nr-map-maxed, html.nr-map-maxed body { overflow: hidden; overscroll-behavior: none; }
.nr-locate a { display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--nr-text); }
.nr-locate a.is-on { color: var(--nr-primary); }
.nr-locate a.is-busy i { animation: nr-locate-pulse 1s ease-in-out infinite; }
@keyframes nr-locate-pulse { 50% { opacity: .35; } }
.nr-me > span {
    display: block; width: 18px; height: 18px; border-radius: 50%;
    background: var(--nr-me); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 4px rgba(0, 0, 0, .35);
}
.nr-me-ring { fill: var(--nr-me); fill-opacity: .15; stroke: var(--nr-me); stroke-opacity: .5; }
.nr-map-notice { inset: auto 0 0 0; padding: .6rem 1rem; font-size: .9rem; }

/* --- Ride recorder (/record, Pages/RecordRide + js/nomadRecorder.js) ----------- */
.nr-rec { display: flex; flex-direction: column; gap: 1rem; }
.nr-rec-map { height: min(52vh, 460px); min-height: 260px; border-radius: 16px; overflow: hidden; border: 1px solid var(--nr-border); }
.nr-rec-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 767.98px) {
    .nr-rec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nr-rec-stats > :first-child { grid-column: 1 / -1; }   /* distance, the number that matters, full width */
}
.nr-rec-stats .nr-stat-value span { font-variant-numeric: tabular-nums; }
.nr-rec-status { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; color: var(--nr-text-muted); }
#nr-rec-gps > span, #nr-rec-wake > span, #nr-rec-gps[data-gps="idle"], #nr-rec-wake[data-wake="off"] { display: none; }
#nr-rec-gps[data-gps="waiting"] .nr-rec-gps-waiting,
#nr-rec-gps[data-gps="weak"] .nr-rec-gps-weak,
#nr-rec-gps[data-gps="good"] .nr-rec-gps-good,
#nr-rec-wake[data-wake="on"] .nr-rec-wake-on,
#nr-rec-wake[data-wake="unsupported"] .nr-rec-wake-unsupported { display: inline; }
#nr-rec-gps[data-gps="weak"], #nr-rec-wake[data-wake="unsupported"], #nr-rec-gaps-row { color: var(--nr-cta); }
.nr-rec-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.nr-rec-actions .btn { flex: 1 1 12rem; min-width: 0; white-space: normal; }
.nr-rec-note { flex-basis: 100%; color: var(--nr-text-muted); }
/* Which buttons and notes show is decided by the attributes nomadRecorder.js sets on #nr-rec (the page itself
   never re-renders), so the controls keep working with no server connection. */
.nr-rec [data-when], .nr-rec [data-note], .nr-rec .nr-rec-msg, .nr-rec .nr-rec-discard-confirm { display: none; }
.nr-rec[data-rec-state="loading"] [data-when~="loading"],
.nr-rec[data-rec-state="nogeo"] [data-when~="nogeo"],
.nr-rec[data-rec-state="idle"] [data-when~="idle"],
.nr-rec[data-rec-state="recording"] [data-when~="recording"],
.nr-rec[data-rec-state="paused"] [data-when~="paused"],
.nr-rec[data-rec-state="finished"] [data-when~="finished"] { display: block; }
.nr-rec[data-rec-state] .nr-rec-actions[data-when] { display: none; }
.nr-rec[data-rec-state="idle"] .nr-rec-actions[data-when~="idle"],
.nr-rec[data-rec-state="recording"] .nr-rec-actions[data-when~="recording"],
.nr-rec[data-rec-state="paused"] .nr-rec-actions[data-when~="paused"],
.nr-rec[data-rec-state="finished"] .nr-rec-actions[data-when~="finished"] { display: flex; }
.nr-rec[data-rec-resumed="1"] [data-note="resumed"],
.nr-rec[data-rec-resumed="0"] [data-note="paused"],
.nr-rec[data-rec-few="1"] [data-note="few"],
.nr-rec[data-rec-few="0"][data-rec-sent="1"] [data-note="sent"] { display: block; }
.nr-rec[data-rec-few="1"] .nr-rec-needs-points { display: none; }
.nr-rec[data-rec-msg="resumed"] .nr-rec-msg[data-msg="resumed"],
.nr-rec[data-rec-msg="denied"] .nr-rec-msg[data-msg="denied"],
.nr-rec[data-rec-msg="nofix"] .nr-rec-msg[data-msg="nofix"],
.nr-rec[data-rec-msg="wpsaved"] .nr-rec-msg[data-msg="wpsaved"],
.nr-rec[data-rec-msg="badphoto"] .nr-rec-msg[data-msg="badphoto"],
.nr-rec[data-rec-msg="screenoff"] .nr-rec-msg[data-msg="screenoff"] { display: list-item; color: var(--nr-cta); }
.nr-rec .nr-rec-wps-row { display: none; }
.nr-rec[data-rec-wps="1"] .nr-rec-wps-row { display: list-item; }
.nr-rec-panel { display: flex; flex-direction: column; gap: 1rem; }

/* Full screen while recording or paused (data-rec-focus="1", set by nomadRecorder.js), like WikiLoc's recorder:
   the map IS the screen, a top bar with time + distance and a Stats toggle, and three big thumb buttons at the
   bottom (pause/continue, stop, add a waypoint). Over the site's own bars; "exit full screen" shows the page. */
.nr-rec-top, .nr-rec-fabs, .nr-rec-sheet, .nr-rec-sheet-pane { display: none; }
.nr-rec { --nr-rec-top-h: calc(env(safe-area-inset-top, 0px) + 4rem); }
html:has(.nr-rec[data-rec-focus="1"]) { overflow: hidden; }
.nr-rec[data-rec-focus="1"] {
    position: fixed; inset: 0; z-index: 1065; display: block; background: var(--nr-bg);
}
.nr-rec[data-rec-focus="1"] > .nr-rec-actions:not([data-when="finished"]),
.nr-rec[data-rec-focus="1"] > .nr-skeleton { display: none !important; }
/* Cards over the map: the finished ride's actions, the "no location" warning, the keep-the-screen-on tip. */
.nr-rec[data-rec-focus="1"][data-rec-state="finished"] > .nr-rec-actions[data-when="finished"],
.nr-rec[data-rec-focus="1"][data-rec-state="nogeo"] > .alert,
.nr-rec[data-rec-focus="1"][data-rec-state="idle"] > .nr-rec-tip {
    position: absolute; z-index: 1002; left: 0.75rem; right: 0.75rem; margin: 0;
    padding: 0.9rem 1rem; border-radius: 18px; background: var(--nr-surface); box-shadow: var(--nr-shadow);
}
.nr-rec[data-rec-focus="1"][data-rec-state="finished"] > .nr-rec-actions[data-when="finished"] { bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem); }
.nr-rec[data-rec-focus="1"][data-rec-state="nogeo"] > .alert { top: calc(var(--nr-rec-top-h) + 0.75rem); }
.nr-rec[data-rec-focus="1"][data-rec-state="idle"] > .nr-rec-tip { bottom: calc(env(safe-area-inset-bottom, 0px) + 6.75rem); }
/* The big round buttons show per state (they are inline-flex, not block). */
.nr-rec[data-rec-state="idle"] .nr-rec-fab[data-when~="idle"],
.nr-rec[data-rec-state="recording"] .nr-rec-fab[data-when~="recording"],
.nr-rec[data-rec-state="paused"] .nr-rec-fab[data-when~="paused"] { display: inline-flex; }
/* .nr-rec-fab.nr-rec-fab-start: the generic round-button rule comes later in this file and must not win. */
.nr-rec-fab.nr-rec-fab-start {
    margin: 0 auto; width: auto; max-width: 100%; padding: 0 2rem; gap: 0.6rem; background: var(--nr-cta); color: var(--nr-on-cta);
    font-size: 1.15rem; font-weight: 700; white-space: nowrap;
}
.nr-rec-fab.nr-rec-fab-start i { font-size: 1.6rem; }
/* "You have an unfinished recording from …" over the map, while paused after a reload. */
.nr-rec .nr-rec-msg-unfinished { display: none; }
.nr-rec[data-rec-state="paused"][data-rec-resumed="1"] .nr-rec-msg-unfinished { display: list-item; }
/* The finished card: New route across, Download GPX and Delete side by side under it. */
.nr-rec-finished .btn { flex: 1 1 100%; }
.nr-rec-finished .btn.nr-rec-half {
    flex: 1 1 calc(50% - 0.6rem); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    white-space: nowrap; font-size: 1.1rem;
}
.nr-rec-photo-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nr-rec-photo-btns .btn { flex: 1 1 9rem; min-width: 0; white-space: normal; }
.nr-rec[data-rec-focus="1"] .nr-rec-top {
    display: flex; align-items: center; gap: 0.5rem; position: absolute; top: 0; left: 0; right: 0; z-index: 1002;
    height: var(--nr-rec-top-h); padding: env(safe-area-inset-top, 0px) 0.75rem 0;
    background: var(--nr-forest-800); color: var(--bs-white);
}
.nr-rec-top-btn {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    min-width: 2.75rem; height: 2.75rem; padding: 0 0.75rem; border: 0; border-radius: 999px;
    background: rgba(255, 255, 255, 0.14); color: inherit; font-weight: 600; font-size: 1rem;
}
.nr-rec-top-btn:focus-visible, .nr-rec-fab:focus-visible, .nr-rec-kind:focus-visible { outline: 3px solid var(--nr-cta); outline-offset: 2px; }
.nr-rec-top-mid { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1.15; }
.nr-rec-top-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.nr-rec-top-label .nr-rec-dot { display: inline-block; vertical-align: middle; }
.nr-rec-top-time { display: block; font-family: var(--nr-font-display); font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Phones: the Stats button is its icon only, so the time and distance never run into it. */
@media (max-width: 575.98px) { .nr-rec-top-stats span { display: none; } }
.nr-rec[data-rec-focus="1"][data-rec-stats="1"] .nr-rec-top-stats { background: var(--nr-cta); color: var(--nr-on-cta); }
/* !important: Leaflet writes an inline position: relative on the map element when it starts, which made the
   full-screen map 0 px tall. */
.nr-rec[data-rec-focus="1"] .nr-rec-map {
    position: absolute !important; top: var(--nr-rec-top-h); left: 0; right: 0; bottom: 0;
    height: auto; min-height: 0; border: 0; border-radius: 0;
}
.nr-rec[data-rec-focus="1"] .nr-rec-panel { display: none; }
.nr-rec[data-rec-focus="1"][data-rec-stats="1"] .nr-rec-panel {
    display: flex; position: absolute; top: var(--nr-rec-top-h); left: 0; right: 0; z-index: 1001;
    max-height: calc(100% - var(--nr-rec-top-h) - 7.5rem); overflow: auto;
    padding: 0.75rem; background: var(--nr-bg); box-shadow: var(--nr-shadow);
}
.nr-rec[data-rec-focus="1"] .nr-rec-msgs {
    position: absolute; z-index: 1003; top: calc(var(--nr-rec-top-h) + 0.6rem); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 2rem);
}
.nr-rec[data-rec-focus="1"] .nr-rec-msg {
    padding: 0.45rem 0.9rem; border-radius: 999px; background: var(--nr-surface); box-shadow: var(--nr-shadow-sm); font-weight: 600;
}
.nr-rec[data-rec-focus="1"] .nr-rec-fabs {
    display: flex; align-items: flex-end; gap: 0.9rem; position: absolute; z-index: 1002; left: 0; right: 0;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); padding: 0 1rem; pointer-events: none;
}
.nr-rec-fab {
    pointer-events: auto; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    width: 4.25rem; height: 4.25rem; border: 0; border-radius: 999px;
    background: var(--nr-surface); color: var(--nr-text); box-shadow: var(--nr-shadow); font-size: 2rem;
}
.nr-rec-fab-go { background: var(--nr-cta); color: var(--nr-on-cta); }
.nr-rec-fab-stop { color: var(--bs-danger); }
.nr-rec-fab-stop .nr-rec-fab-confirm { display: none; font-size: 1rem; font-weight: 700; }
/* Confirming, Stop grows into a pill that takes the free width but never pushes the waypoint button off screen. */
.nr-rec[data-rec-confirm-finish="1"] .nr-rec-fab-stop {
    width: auto; flex: 1 1 auto; min-width: 0; padding: 0 1rem; background: var(--bs-danger); color: var(--bs-white); font-size: 1.5rem;
}
.nr-rec[data-rec-confirm-finish="1"] .nr-rec-fab-stop .nr-rec-fab-confirm { line-height: 1.1; text-align: left; }
.nr-rec[data-rec-confirm-finish="1"] .nr-rec-fab-wp { margin-left: 0; }
.nr-rec-top .nr-rec-dot { background: var(--bs-danger); }
.nr-rec[data-rec-confirm-finish="1"] .nr-rec-fab-stop .nr-rec-fab-confirm { display: inline; }
.nr-rec-fab-wp { margin-left: auto; width: 4.75rem; height: 4.75rem; background: var(--nr-cta); color: var(--nr-on-cta); font-size: 1.5rem; gap: 0.15rem; }
.nr-rec-fab-wp .bi-flag-fill { font-size: 1.1rem; align-self: flex-end; margin-bottom: 1rem; }
/* Leaflet's zoom and follow buttons stay clear of the big buttons. */
.nr-rec[data-rec-focus="1"] .leaflet-bottom { bottom: calc(env(safe-area-inset-bottom, 0px) + 6.5rem); }

/* Adding a waypoint: a full-screen sheet, kind grid first, then the form. */
.nr-rec[data-rec-sheet="kind"] .nr-rec-sheet:not(.nr-rec-sheet-pocket, .nr-rec-sheet-live),
.nr-rec[data-rec-sheet="form"] .nr-rec-sheet:not(.nr-rec-sheet-pocket, .nr-rec-sheet-live),
.nr-rec[data-rec-sheet="pocket"] .nr-rec-sheet-pocket,
.nr-rec[data-rec-sheet="live"] .nr-rec-sheet-live {
    display: block; position: fixed; inset: 0; z-index: 1075; overflow: auto; background: var(--nr-bg);
}
.nr-rec[data-rec-sheet="kind"] .nr-rec-sheet-pane[data-pane="kind"],
.nr-rec[data-rec-sheet="form"] .nr-rec-sheet-pane[data-pane="form"],
.nr-rec[data-rec-sheet="pocket"] .nr-rec-sheet-pane[data-pane="pocket"],
.nr-rec[data-rec-sheet="live"] .nr-rec-sheet-pane[data-pane="live"] { display: flex; flex-direction: column; min-height: 100%; }
.nr-rec-sheet-head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 0.75rem;
    padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) 0.75rem 0.6rem; background: var(--nr-forest-800); color: var(--bs-white);
}
.nr-rec-sheet-head h2 { margin: 0; font-size: 1.15rem; color: inherit; text-transform: none; letter-spacing: 0; }
.nr-rec-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; padding: 0.9rem; }
@media (min-width: 576px) { .nr-rec-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.nr-rec-kind {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 6.5rem;
    padding: 0.6rem 0.4rem; border: 1px solid var(--nr-border); border-radius: 14px; background: var(--nr-surface-2); color: var(--nr-text);
    font-weight: 600; font-size: 0.9rem; text-align: center; overflow-wrap: anywhere;
}
.nr-rec-kind i { font-size: 2rem; }
.nr-rec-form { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem; flex: 1 1 auto; }
.nr-rec-form .form-label { margin: 0.5rem 0 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nr-text-muted); }
.nr-rec-wp-preview { max-width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; align-self: flex-start; }
.nr-rec-form-kind { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.nr-rec-wp-kind {
    display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--nr-border); border-radius: 999px;
    padding: 0.4rem 0.9rem; background: var(--nr-surface); color: var(--nr-text); font-weight: 600;
}
.nr-rec-wp-kind i { font-size: 1.25rem; }
.nr-rec-form-actions {
    position: sticky; bottom: 0; display: flex; gap: 0.6rem;
    padding: 0.75rem 1rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem); background: var(--nr-bg); border-top: 1px solid var(--nr-border);
}
/* Waypoints on the recording map. */
.nr-rec-wp {
    display: flex !important; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--nr-cta); color: var(--nr-on-cta); border: 2px solid var(--bs-white); box-shadow: var(--nr-shadow-sm); font-size: 0.95rem;
}
.nr-rec[data-rec-confirm="1"] .nr-rec-discard-ask { display: none; }
.nr-rec[data-rec-confirm="1"] .nr-rec-discard-confirm { display: inline; }
.nr-rec[data-rec-confirm="1"] .nr-rec-discard { background: var(--bs-danger); border-color: var(--bs-danger); color: var(--bs-white); }
/* While recording on another page of the site: a small pill back to the recorder (nomadRecorder.js). */
.nr-rec-pill {
    position: fixed; z-index: 1070; left: 50%; transform: translateX(-50%);
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    display: inline-flex; align-items: center; gap: 0.5rem; max-width: calc(100vw - 2rem);
    padding: 0.45rem 0.9rem; border-radius: 999px; background: var(--nr-surface); color: var(--nr-text);
    border: 1px solid var(--nr-border); box-shadow: 0 4px 16px rgba(0, 0, 0, .2); font-weight: 600; font-size: .9rem;
    text-decoration: none;
}
@media (min-width: 992px) { .nr-rec-pill { bottom: 1.25rem; } }
.nr-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nr-cta); animation: nr-locate-pulse 1.2s ease-in-out infinite; flex: none; }

/* Pocket mode (2026-11-06, nomadRecorder.js): the phone in a pocket, the screen black, every touch ignored, the GPS
   still recording. Locking the phone would stop the GPS (both browser engines turn it off for a hidden page), so the
   page keeps its wake lock and turns itself off instead: pure black, faint grey text (an OLED screen draws almost
   nothing for it), and a two-second hold on the circle as the only way out. Over everything: the sheets, and the
   "Install the app" card, which pops up 3 s after a load and covered the circle (caught by the local test). */
.nr-rec-pocket { display: none; }
/* The recorder is its own stacking context (fixed, 1065), so the overlay's z-index counts only inside it: the
   whole recorder moves above the install card (1080), the reconnect pill and toasts (1090) and the photo viewer
   (2000) while the screen is black. */
.nr-rec[data-rec-focus="1"][data-rec-pocket="1"] { z-index: 2100; }
.nr-rec[data-rec-pocket="1"] .nr-rec-pocket {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    position: fixed; inset: 0; z-index: 2100; background: #000; color: #6f6f6f;
    padding: calc(env(safe-area-inset-top, 0px) + 3rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 3rem);
    touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
    cursor: default;
}
html:has(.nr-rec[data-rec-pocket="1"]) { background: #000; overscroll-behavior: none; }
html:has(.nr-rec[data-rec-pocket="1"]) body { overscroll-behavior: none; }
.nr-rec-pocket-status { text-align: center; font-variant-numeric: tabular-nums; }
.nr-rec-pocket-label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.nr-rec-pocket-label .nr-rec-dot { display: inline-block; vertical-align: middle; background: #7a2f1e; animation: none; }
.nr-rec-pocket-time { font-family: var(--nr-font-display); font-size: 2.6rem; font-weight: 700; color: #8c8c8c; line-height: 1.2; }
.nr-rec-pocket-dist { font-size: 1rem; }
/* The hold ring: --p (0..100) is written by nomadRecorder.js while the circle is held. */
.nr-rec-pocket-unlock {
    position: relative; width: 7rem; height: 7rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--nr-coral) calc(var(--p, 0) * 1%), #2a2a2a 0); color: #8c8c8c; font-size: 0.8rem; font-weight: 600;
    text-align: center; line-height: 1.2;
}
.nr-rec-pocket-unlock::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #000; }
.nr-rec-pocket-unlock span { position: relative; padding: 0 0.75rem; }
.nr-rec-pocket-unlock.is-holding { color: #d0d0d0; }
/* The Pocket button in the top bar shows only while recording (the generic [data-when] rule hides it otherwise). */
.nr-rec[data-rec-state="recording"] .nr-rec-top-pocket[data-when~="recording"] { display: inline-flex; }
@media (max-width: 575.98px) { .nr-rec-top-pocket span { display: none; } }
/* The guide (a sheet like the waypoint screens). Each phone sees its own "lock it to this app" steps. */
.nr-rec-pocket-help { padding: 1rem; flex: 1 1 auto; }
.nr-rec-pocket-help h3 { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nr-text-muted); margin: 1.25rem 0 0.5rem; }
.nr-rec-pocket-help ol { padding-left: 1.25rem; }
.nr-rec-pocket-help li { margin-bottom: 0.4rem; }
.nr-rec-pocket-warn { padding: 0.75rem 0.9rem; border-radius: 12px; background: var(--nr-surface-2); color: var(--nr-cta); font-weight: 600; }
.nr-rec-pocket-os { display: none; }
.nr-rec[data-rec-os="android"] .nr-rec-pocket-os[data-os="android"],
.nr-rec[data-rec-os="ios"] .nr-rec-pocket-os[data-os="ios"],
.nr-rec[data-rec-os="desktop"] .nr-rec-pocket-os[data-os="desktop"] { display: block; }
.nr-rec-pocket-help .nr-rec-pocket-os[data-os="desktop"] { color: var(--nr-text-muted); }
/* "In your pocket? Use pocket mode." and the stats panel's guide link: a text button, no form. */
.nr-rec-link { border: 0; padding: 0; background: none; color: var(--nr-primary); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.nr-rec-sheet-pocket .nr-rec-form-actions .btn[data-when] { display: none; }
.nr-rec[data-rec-state="recording"] .nr-rec-sheet-pocket .nr-rec-form-actions .btn[data-when~="recording"] { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }

/* Follow my ride (2026-11-11, nomadRecorder.js): the round button beside Stop, red with "LIVE" while sharing, and
   its sheet. data-rec-live / -featured / -copied / -canshare are set on #nr-rec by the module. */
.nr-rec-fab.nr-rec-fab-live { width: 3.5rem; height: 3.5rem; font-size: 1.5rem; flex-direction: column; gap: 0; }
.nr-rec-fab-live-on { display: none; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1; }
.nr-rec[data-rec-live="1"] .nr-rec-fab-live { background: var(--bs-danger); color: var(--bs-white); font-size: 1.2rem; }
.nr-rec[data-rec-live="1"] .nr-rec-fab-live-on { display: block; }
@media (max-width: 359.98px) { .nr-rec[data-rec-focus="1"] .nr-rec-fabs { gap: 0.5rem; padding: 0 0.6rem; } }
.nr-rec [data-live] { display: none; }
.nr-rec[data-rec-live="0"] [data-live="off"], .nr-rec[data-rec-live="1"] [data-live="on"] { display: block; }
.nr-rec[data-rec-live="0"] .nr-rec-form-actions .btn[data-live="off"],
.nr-rec[data-rec-live="1"] .nr-rec-form-actions .btn[data-live="on"] { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.nr-rec-live-on { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--bs-danger); }
.nr-rec-live-on .nr-rec-dot { background: var(--bs-danger); }
.nr-rec-live-copied, .nr-rec-live-send, .nr-rec-live-featured, .nr-rec-live-msg { display: none; }
.nr-rec[data-rec-copied="1"] .nr-rec-live-copy { display: none; }
.nr-rec[data-rec-copied="1"] .nr-rec-live-copied { display: inline; }
.nr-rec[data-rec-canshare="1"] .nr-rec-live-send { display: inline-block; }
.nr-rec[data-rec-live-featured="1"] .nr-rec-live-featured { display: block; margin-top: 1rem; font-weight: 600; color: var(--nr-cta); }
.nr-rec[data-rec-msg="livefail"] .nr-rec-live-msg[data-msg="livefail"] { display: block; margin-top: 1rem; font-weight: 600; color: var(--bs-danger); }
.nr-rec[data-rec-msg="liveended"] .nr-rec-msg[data-msg="liveended"] { display: list-item; color: var(--nr-cta); }
.nr-rec-pocket-live { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: #7a2f1e; margin-bottom: 0.25rem; }

/* Follow my ride: the follower's page (/live/{token}, Pages/LiveRide.razor). A map page like /map, with the ride's
   status and numbers in one row above the map. The rider's marker is coral while live, grey when quiet or ended. */
.nr-live-page .nr-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.nr-live-head { min-width: 0; }
.nr-live-head h1 { overflow-wrap: anywhere; }
.nr-live-name { margin: 0; color: var(--nr-text-muted); overflow-wrap: anywhere; }
.nr-live-status {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.85rem; border-radius: 999px;
    font-weight: 700; font-size: 0.9rem; background: var(--nr-surface-2); color: var(--nr-text); white-space: nowrap;
}
.nr-live-status[data-status="live"] { background: var(--bs-danger); color: var(--bs-white); letter-spacing: 0.06em; }
.nr-live-status[data-status="live"] .nr-rec-dot { background: var(--bs-white); }
.nr-live-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.6rem; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.nr-live-stats li { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.nr-live-stats i { color: var(--nr-primary); }
.nr-live-ago { color: var(--nr-text-muted); font-weight: 500; }
.nr-live-page .nr-offline-inline { flex-shrink: 0; }
@media (max-width: 991.98px) {
    /* /map hides the header's text on phones; here the ride's name is worth its line. */
    .nr-map-page.nr-live-page .nr-page-header .nr-live-name { display: block; font-size: 0.9rem; }
    .nr-live-stats { font-size: 0.9rem; }
}
.nr-live-rider { display: flex !important; align-items: center; justify-content: center; }
.nr-live-rider-dot {
    position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--nr-coral); color: #1d1d1b; border: 3px solid var(--bs-white); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); font-size: 1rem;
}
.nr-live-rider[data-status="live"] .nr-live-rider-dot::after {
    content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--nr-coral); opacity: 0.6;
    animation: nr-locate-pulse 1.6s ease-in-out infinite;
}
.nr-live-rider[data-status="quiet"] .nr-live-rider-dot,
.nr-live-rider[data-status="ended"] .nr-live-rider-dot { background: #9a9a9a; }
.nr-live-ring { fill: var(--nr-coral); fill-opacity: 0.12; stroke: var(--nr-coral); stroke-opacity: 0.4; }

/* Join the ride (2026-11-19): followers who share their position. Forest green (the rider is coral, "you" are blue),
   grey without a signal; markers that would overlap merge into one bubble with a count (NomadLive.crowd). */
.nr-crowd-one, .nr-crowd-many { display: flex !important; align-items: center; justify-content: center; }
.nr-crowd-one span, .nr-crowd-many span {
    display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; line-height: 1;
    color: #fff; background: var(--nr-forest-700, #3e5540); border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    font-family: var(--nr-font-display); font-variant-numeric: tabular-nums;
}
.nr-crowd-one span { width: 28px; height: 28px; font-size: 0.72rem; letter-spacing: 0.02em; }
.nr-crowd-one.is-quiet span { background: #9a9a9a; }
.nr-crowd-many span { width: 36px; height: 36px; font-size: 0.95rem; box-shadow: 0 0 0 5px rgba(62, 85, 64, .3), 0 1px 6px rgba(0, 0, 0, .35); cursor: pointer; }
.nr-crowd-many.is-badge span { width: 28px; height: 28px; font-size: 0.78rem; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.nr-crowd-popup ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.nr-crowd-popup li { overflow-wrap: anywhere; }
.nr-live-me { margin-left: auto; }
.nr-live-sharing {
    display: inline-flex; align-items: center; gap: 0.4rem; border: 0; border-radius: 999px; padding: 0.25rem 0.35rem 0.25rem 0.75rem;
    background: var(--nr-primary); color: var(--bs-white); font-weight: 600; font-size: 0.85rem;
}
.nr-live-stats .nr-live-sharing i { color: inherit; }
.nr-live-sharing-stop { background: rgba(255, 255, 255, .2); border-radius: 999px; padding: 0.1rem 0.6rem; }
.nr-live-note { flex-shrink: 0; margin: 0 0 0.5rem; color: var(--nr-text-muted); font-size: 0.9rem; }
.nr-live-join {
    flex-shrink: 0; margin: 0 0 0.6rem; padding: 0.8rem 1rem; border-radius: var(--bs-border-radius-lg, 0.75rem);
    background: var(--nr-surface); border: 1px solid var(--bs-border-color); box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}
.nr-live-join h2 { font-size: 1.05rem; margin: 0 0 0.25rem; display: flex; align-items: center; gap: 0.45rem; overflow-wrap: anywhere; }
.nr-live-join h2 i { color: var(--nr-primary); }
.nr-live-join p { margin: 0 0 0.6rem; font-size: 0.92rem; }
.nr-live-join-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.nr-live-join-form .form-control { flex: 1 1 12rem; min-width: 0; max-width: 20rem; }
.nr-live-join-form .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.nr-live-join-error { color: var(--bs-danger); font-weight: 600; }
.nr-live-join .nr-live-join-fine { margin: 0; font-size: 0.8rem; color: var(--nr-text-muted); }

/* The owner's ride, offered on every page (Components/LiveRideBanner): a card under the top bar. */
.nr-live-banner {
    position: fixed; z-index: 1060; left: 0; right: 0; margin: 0 auto;
    top: calc(var(--nr-topbar-h) + env(safe-area-inset-top, 0px) + 0.6rem);
    display: flex; align-items: center; gap: 0.75rem; width: max-content; max-width: calc(100vw - 1.5rem);
    padding: 0.55rem 0.6rem 0.55rem 0.85rem; border-radius: 16px; background: var(--nr-surface); color: var(--nr-text);
    border: 1px solid var(--nr-border); box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
    animation: nr-install-in 320ms var(--nr-ease);
}
.nr-live-banner-dot .nr-rec-dot { display: block; width: 12px; height: 12px; background: var(--bs-danger); }
.nr-live-banner-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.nr-live-banner-text strong { font-size: 0.95rem; }
.nr-live-banner-text span { font-size: 0.85rem; color: var(--nr-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-live-banner .btn { flex: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.nr-live-banner-close {
    flex: none; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 999px; background: transparent; color: var(--nr-text-muted);
}
.nr-live-banner-close:hover { background: var(--nr-surface-2); }

/* --- Waypoint cards ----------------------------------------------------- */




/* --- Photo grid --------------------------------------------------------- */
.nr-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

@media (max-width: 575.98px) {
    .nr-photo { aspect-ratio: 1 / 1; }
}

/* --- Elevation chart canvas wrapper ------------------------------------- */
.nr-elevation-chart {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.nr-elevation-chart canvas { display: block; width: 100%; }

/* --- Tag/badge ---------------------------------------------------------- */
.nr-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

/* --- Searchable video picker (admin route form) ------------------------ */
.nr-video-picker-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    background: var(--bs-tertiary-bg);
}

.nr-video-picker-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 100ms ease;
}

.nr-video-picker-item:last-child { border-bottom: 0; }

.nr-video-picker-item:hover { background: var(--nr-surface-2); }

.nr-video-picker-item.selected {
    background: var(--nr-primary-soft);
}

.nr-video-picker-checkbox {
    width: 1.4rem;
    flex-shrink: 0;
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    line-height: 1;
    text-align: center;
}

.nr-video-picker-item.selected .nr-video-picker-checkbox {
    color: var(--nr-accent);
}

.nr-video-picker-item img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--nr-surface-2);
}

.nr-video-picker-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nr-video-picker-meta .title {
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--bs-emphasis-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.nr-video-picker-meta .date {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

/* --- Skeletons ---------------------------------------------------------- */
.nr-skeleton {
    background: var(--nr-skeleton-bg);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.nr-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        var(--nr-skeleton-shimmer),
        transparent
    );
    transform: translateX(-100%);
    animation: nr-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes nr-skeleton-shimmer {
    100% { transform: translateX(100%); }
}

.nr-skeleton-img {
    aspect-ratio: 16 / 10;
    border-radius: 10px 10px 0 0;
}

@media (max-width: 575.98px) {
    .nr-skeleton-img { aspect-ratio: 4 / 3; }
}

.nr-skeleton-line {
    height: 0.8rem;
    margin-bottom: 0.55rem;
}

.nr-skeleton-line.short { width: 40%; }
.nr-skeleton-line.medium { width: 65%; }
.nr-skeleton-line.long { width: 85%; }

/* --- Toast container ---------------------------------------------------- */
.nr-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    max-width: 360px;
    pointer-events: none;
}

.nr-toast {
    pointer-events: auto;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--nr-accent);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--bs-body-color);
    animation: nr-toast-in 220ms ease-out;
}

.nr-toast.nr-toast-leaving { animation: nr-toast-out 200ms ease-in forwards; }

.nr-toast-success { border-left-color: #2e7d32; }
.nr-toast-success .nr-toast-icon { color: #4caf50; }
.nr-toast-info { border-left-color: #1565c0; }
.nr-toast-info .nr-toast-icon { color: #42a5f5; }
.nr-toast-warning { border-left-color: #ef6c00; }
.nr-toast-warning .nr-toast-icon { color: #ffa726; }
.nr-toast-error { border-left-color: #c0352a; }
.nr-toast-error .nr-toast-icon { color: #ef5350; }

.nr-toast-icon { font-size: 1.15rem; flex-shrink: 0; line-height: 1.2; }
.nr-toast-body { flex: 1; min-width: 0; font-size: 0.92rem; }
.nr-toast-title { font-weight: 600; margin-bottom: 0.15rem; color: var(--bs-emphasis-color); }
.nr-toast-close {
    background: transparent;
    border: 0;
    color: var(--bs-secondary-color);
    padding: 0;
    cursor: pointer;
    line-height: 1;
}
.nr-toast-close:hover { color: var(--bs-emphasis-color); }

@keyframes nr-toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes nr-toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* --- Reconnect modal ---------------------------------------------------- */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1080;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal > div {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-emphasis-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    max-width: 360px;
    text-align: center;
}

/* --- Reduced motion (ported from Watchario) -------------------------------
   Riders who ask the OS for less motion get a static skeleton instead of a sweeping
   shimmer, toasts that appear and leave without sliding, and cards that don't lift on hover.
   Safe to switch the toast animations off: ToastContainer removes a toast on a timer
   (Task.Delay), not on animationend, so nothing waits for an event that would never fire. */
@media (prefers-reduced-motion: reduce) {
    .nr-skeleton::after { animation: none; display: none; }
    .nr-toast,
    .nr-toast.nr-toast-leaving { animation: none; }
    .nr-card,
    .nr-card:hover,
    .nr-card-media img { transition: none; transform: none; }
    html { scroll-behavior: auto; }
}

/* --- Accounts: ratings, favorites ---------------------------------------- */
.nr-stars { color: #f5b301; white-space: nowrap; display: inline-flex; gap: 0.1rem; }
.nr-stars-input { display: flex; font-size: 1.75rem; gap: 0.2rem; }
.nr-star-option { cursor: pointer; line-height: 1; padding: 0.1rem; border-radius: 4px; }
.nr-star-option:focus-within { outline: 2px solid var(--nr-accent); outline-offset: 2px; }
.nr-review-list { display: flex; flex-direction: column; gap: 0.75rem; }
.nr-review {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
/* Comments are plain text: keep the rider's line breaks, never render markup. */
.nr-review-text { white-space: pre-line; overflow-wrap: anywhere; }

/* Ride reports (Components/RideReports): a row of square photo thumbnails that open in PhotoViewer. */
.nr-report-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.4rem; max-width: 560px; }
.nr-report-photo {
    padding: 0; border: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--nr-surface-2);
    cursor: zoom-in;
}
.nr-report-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nr-report-photo:focus-visible { outline: 3px solid var(--nr-primary); outline-offset: 2px; }
.nr-report-date { max-width: 14rem; }
.nr-report-files li { overflow-wrap: anywhere; }
.nr-fav-thumb {
    width: 64px; height: 44px; object-fit: cover; border-radius: 6px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
}

/* --- Route filters ------------------------------------------------------------- */
.nr-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 0.75rem;
    align-items: end;
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--nr-shadow-sm);
}
/* Grid items default to min-width:auto, i.e. "at least as wide as my content": a long option
   ("Οποιαδήποτε δυσκολία") then pushed the select past its column. Let cells shrink instead. */
.nr-filter { min-width: 0; }
.nr-filters .form-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nr-text-muted); margin-bottom: 0.3rem; }
.nr-filters .input-group-text { background: var(--nr-surface-2); border-color: var(--nr-border); color: var(--nr-text-muted); border-radius: 0 12px 12px 0; }
@media (max-width: 991.98px) {
    .nr-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nr-filter-submit { grid-column: 1 / -1; }
}

/* --- Empty state ---------------------------------------------------------------- */
.nr-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--nr-border);
    border-radius: var(--nr-radius);
    background: var(--nr-surface);
}
.nr-empty > i { font-size: 2.4rem; color: var(--nr-primary); }
.nr-empty h2 { font-size: 1.25rem; margin: 0.75rem 0 0.35rem; }
.nr-empty p { color: var(--nr-text-muted); margin: 0 auto 1rem; max-width: 40ch; }

/* --- Route editor: waypoint list scroll box ----------------------------------------
   Caps the list at ~60% of the viewport and scrolls inside it, with a fade at the bottom edge
   so it reads as "there's more". Focusable (tabindex) so keyboard users can scroll it too. */
.nr-waypoint-scroller {
    max-height: min(60vh, 640px);
    overflow-y: auto;
    overscroll-behavior-y: auto;   /* at the top or bottom a swipe goes on to scroll the page (contain trapped it) */
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--nr-border) transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
    padding-bottom: 1.25rem;
}
.nr-waypoint-scroller > .list-group-item:last-child { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* --- Dropdowns -------------------------------------------------------------------------
   The open list of a native <select> is drawn by the OS, which is why it looked like a 1998
   Windows menu. Customizable select (appearance: base-select) hands it to CSS: Chromium 135+,
   i.e. Chrome/Edge, Android's WebView (the MAUI app) and WebView2. Other browsers keep their
   native picker, which on iOS/macOS is the platform-correct one anyway. Still a real <select>:
   keyboard, screen readers and Blazor @bind behave exactly as before. */
@supports (appearance: base-select) {
    select.form-select,
    select.form-select::picker(select) {
        appearance: base-select;
    }

    select.form-select {
        display: block;
        position: relative;
        padding-right: 2.2rem;    /* room for the chevron, which is pinned, so long text ellipsizes before it */
        cursor: pointer;
        white-space: nowrap;   /* the chosen value stays on one line; long Greek labels ellipsize */
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        max-width: 100%;
    }
    select.form-select > button, select.form-select selectedcontent {
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    /* Long values ("Όλες οι περιοχές" on a phone) must stop before the pinned chevron. The chosen
       text lives in the select's internal button, which ignores text-overflow, and the explicit
       <button><selectedcontent> markup doesn't work under Blazor (it inserts the button before the
       options exist, and Chromium leaves selectedcontent empty until the value changes). So clip
       at the CONTENT box: overflow: clip + overflow-clip-margin: content-box cuts the text where the
       right padding (the chevron's reserved space) begins. */
    select.form-select { overflow: clip; overflow-clip-margin: content-box; }

    /* The chevron is Bootstrap's own background arrow, not ::picker-icon: a background is not
       clipped by the content-box clip above, a pseudo-element in the padding area is. */
    select.form-select::picker-icon { display: none; }
    select.form-select:open { border-color: var(--nr-primary); box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--nr-primary) 22%, transparent); }

    select.form-select::picker(select) {
        border: 1px solid var(--nr-border);
        border-radius: 14px;
        background: var(--nr-surface);
        color: var(--nr-text);
        box-shadow: var(--nr-shadow);
        padding: 0.35rem;
        margin-block: 6px;
        max-height: min(60vh, 360px);
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity 160ms ease, transform 200ms var(--nr-ease), overlay 200ms allow-discrete, display 200ms allow-discrete;
    }
    select.form-select:open::picker(select) { opacity: 1; transform: none; }
    @starting-style {
        select.form-select:open::picker(select) { opacity: 0; transform: translateY(-4px); }
    }

    select.form-select option {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.55rem 0.7rem;
        border-radius: 10px;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--nr-text);
        background: transparent;
        cursor: pointer;
    }
    select.form-select option:hover,
    select.form-select option:focus-visible {
        background: var(--nr-surface-2);
        outline: none;
    }
    select.form-select option:checked {
        background: var(--nr-primary-soft);
        color: var(--nr-primary-strong);
    }
    select.form-select option::checkmark {
        order: 1;
        margin-left: auto;
        content: "✓";
        font-weight: 800;
        color: var(--nr-primary);
    }
}

@media (prefers-reduced-motion: reduce) {
    select.form-select::picker(select), select.form-select::picker-icon { transition: none; }
}

/* --- Language switcher ------------------------------------------------------------ */
.nr-flag { display: block; width: 22px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); flex-shrink: 0; }
.nr-lang-menu { min-width: 11rem; }
.nr-lang-menu .dropdown-item.active { background: var(--nr-primary-soft); color: var(--nr-text); }

/* --- Horizontal scroll rows (HScroller.razor + js/nomadScroller.js) -------------------
   One row of cards that scrolls sideways: waypoints, videos, nearby routes. Snaps to cards;
   on phones each card is ~82% wide so the next one peeks in and the row reads as swipeable.
   The ‹ › buttons exist only for mouse users (hover + fine pointer) and only while there is
   somewhere to go in that direction; the JS toggles [hidden]. */
.nr-hscroll { position: relative; }

.nr-hscroll-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    padding: 0.25rem 0 0.85rem;   /* no side padding: snap would park the row a few px in */
    scrollbar-width: none;
}
.nr-hscroll-row::-webkit-scrollbar { display: none; }
.nr-hscroll-row:focus-visible { outline-offset: 4px; border-radius: var(--nr-radius); }

.nr-hscroll-row > * {
    flex: 0 0 var(--nr-hscroll-item, 300px);
    max-width: var(--nr-hscroll-item, var(--nr-card-w));
    scroll-snap-align: start;
    min-width: 0;
}

@media (max-width: 767.98px) {
    /* Full-bleed on phones, cards peek from the edge. */
    .nr-hscroll-row {
        margin-inline: calc(-1 * var(--nr-gutter));
        padding-inline: var(--nr-gutter);
        scroll-padding-inline: var(--nr-gutter);
    }
    .nr-hscroll-row > * { flex-basis: 82%; max-width: 82%; }
}

/* Base state: no buttons for anyone. Only a real pointer device opts in below. */
.nr-hscroll-btn { display: none; }

@media (hover: hover) and (pointer: fine) {
    .nr-hscroll-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 999px;
        border: 1px solid var(--nr-border);
        background: var(--nr-surface);
        color: var(--nr-text);
        font-size: 1.05rem;
        /* ring + shadow so the chip separates from both bright and dark photos */
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), var(--nr-shadow);
        opacity: 0;
        cursor: pointer;
        transition: opacity 160ms ease, transform 160ms var(--nr-ease), background-color 160ms ease;
    }
    .nr-hscroll-btn--prev { left: -14px; }
    .nr-hscroll-btn--next { right: -14px; }
    .nr-hscroll:hover > .nr-hscroll-btn,
    .nr-hscroll-btn:focus-visible { opacity: 1; }
    .nr-hscroll-btn:hover { background: var(--nr-surface-2); transform: translateY(-50%) scale(1.08); }
    .nr-hscroll > .nr-hscroll-btn[hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nr-hscroll-btn { transition: none; }
}



/* /videos: the same tiles as the home row, in a responsive grid. */
.nr-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--nr-card-w)), 1fr));
    gap: 1.25rem 1rem;
}

/* InfiniteScroll: the invisible sentinel the observer watches, and the small "loading" line. */
.nr-infinite-sentinel { height: 1px; }
.nr-infinite-spinner { display: flex; gap: 0.5rem; align-items: center; justify-content: center; padding: 1.25rem 0; color: var(--nr-text-muted); font-weight: 600; font-size: 0.9rem; }

/* /admin/users on phones: one card per user instead of the table. */
.nr-user-cards { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.nr-user-card {
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    box-shadow: var(--nr-shadow-sm);
    padding: 0.9rem 1rem;
}
.nr-user-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.nr-user-card-id { min-width: 0; flex: 1; }
.nr-user-card-id > strong { overflow-wrap: anywhere; }
.nr-user-card-email { color: var(--nr-text-muted); font-size: 0.88rem; overflow-wrap: anywhere; margin-top: 0.15rem; }
.nr-user-card-head .form-switch { flex-shrink: 0; }
.nr-user-card-stats { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0.8rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--nr-border); }
.nr-user-card-stats dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--nr-text-muted); }
.nr-user-card-stats dd { margin: 0.1rem 0 0; font-weight: 700; color: var(--nr-text); }

/* Offline banner (MainLayout): route data on screen came from this device's saved copy. */
.nr-offline-banner {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.5rem var(--nr-gutter);
    background: color-mix(in srgb, var(--nr-sun, #ffcd57) 28%, var(--nr-surface));
    color: var(--nr-text);
    border-bottom: 1px solid var(--nr-border);
    font-size: 0.85rem; font-weight: 600; text-align: center;
}

/* "Install the app" card (Components/InstallPrompt). Bottom-right on desktop; on phones a full-width
   card ABOVE the tab bar (and its safe-area inset), never covering it. */
.nr-install {
    position: fixed;
    z-index: 1080;
    right: 1.25rem;
    bottom: 1.25rem;
    width: min(380px, calc(100vw - 2rem));
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 2.4rem 0.9rem 1rem;
    background: var(--nr-surface);
    color: var(--nr-text);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    box-shadow: var(--nr-shadow);
    animation: nr-install-in 320ms var(--nr-ease);
}
@media (max-width: 991.98px) {
    .nr-install {
        left: 0.75rem; right: 0.75rem; width: auto;
        bottom: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
    }
}
.nr-install-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.nr-install-body { min-width: 0; }
.nr-install-body h2 { font-size: 1rem; font-weight: 700; margin: 0 0 0.2rem; text-transform: none; letter-spacing: 0; }
.nr-install-body p { font-size: 0.85rem; color: var(--nr-text-muted); margin: 0 0 0.5rem; }
.nr-install-steps { margin: 0 0 0.4rem; padding-left: 1.1rem; font-size: 0.86rem; display: flex; flex-direction: column; gap: 0.3rem; }
.nr-install-key {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.05rem 0.4rem; border-radius: 6px;
    background: var(--nr-surface-2); border: 1px solid var(--nr-border);
    font-weight: 700; white-space: nowrap;
}
.nr-install-actions { display: flex; align-items: center; gap: 0.5rem; }
.nr-install-actions .btn-link { color: var(--nr-text-muted); text-decoration: none; padding-left: 0.25rem; }
.nr-install-close {
    position: absolute; top: 0.5rem; right: 0.5rem;
    width: 30px; height: 30px; border-radius: 8px; border: 0;
    background: transparent; color: var(--nr-text-muted);
}
.nr-install-close:hover { background: var(--nr-surface-2); color: var(--nr-text); }
@keyframes nr-install-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nr-install, .nr-live-banner, .nr-live-rider-dot::after { animation: none !important; } }

/* OfflineNotice: a page or section that could not load without a connection. */
.nr-offline-empty > i { color: var(--nr-text-muted); }
.nr-offline-inline { color: var(--nr-text-muted); margin: 0; display: flex; align-items: center; gap: 0.45rem; }
/* The card and its per-platform variants toggle with the `hidden` attribute (nomadInstall JS);
   their own display: flex would otherwise override it. */
.nr-install[hidden], .nr-install [hidden] { display: none !important; }

/* The early (pre-.NET) route map lives in an inner div that fills the map box (NomadRidersEarlyMaps). */
.nr-map-inner { position: absolute; inset: 0; }

/* Offline (MainLayout adds .nr-offline to the shell): anything that needs the server is shown but
   disabled. Mark such a control (or a whole form/section) with data-nr-online-only; it comes back by
   itself when the connection returns. Reading, browsing saved routes and the GPX download stay on. */
html[data-nr-offline] [data-nr-online-only],
.nr-shell.nr-offline [data-nr-online-only] {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.6);
    user-select: none;
}
html[data-nr-offline] form[data-nr-online-only] :is(input, textarea, select, button),
.nr-shell.nr-offline form[data-nr-online-only] :is(input, textarea, select, button) { cursor: not-allowed; }

/* --- NrCard: the ONE card (routes, videos, waypoints) -------------------------------------------------
   16:9 picture with corner badges and an info strip across its bottom; a body with only the title,
   always two lines tall. Same size everywhere, so rows line up. Markup: Components/NrCard.razor. */
.nr-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--nr-surface);
    border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--nr-shadow-sm);
    transition: transform 260ms var(--nr-ease), box-shadow 260ms var(--nr-ease), border-color 200ms ease;
}
.nr-card:hover { color: inherit; text-decoration: none; transform: translateY(-4px); box-shadow: var(--nr-shadow);
    border-color: color-mix(in srgb, var(--nr-primary) 35%, var(--nr-border)); }
.nr-card:focus-visible { outline-offset: 3px; }
.nr-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--nr-surface-2);
    overflow: hidden;
    flex-shrink: 0;
}
.nr-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms var(--nr-ease); }
.nr-card:hover .nr-card-media img { transform: scale(1.04); }
.nr-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; color: var(--nr-text-muted); opacity: 0.5; }
.nr-card-corner { position: absolute; top: 0.6rem; z-index: 2; display: flex; gap: 0.35rem; }
.nr-card-tl { left: 0.6rem; }
.nr-card-tr { right: 0.6rem; }
.nr-card-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: rgba(17, 17, 17, 0.78); color: #fff;
    font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.55rem; border-radius: 999px;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.nr-video-badge i { color: #ff4d4d; }
.nr-rating-badge .bi-star-fill { color: #ffc531; }
.nr-rating-badge span { color: rgba(255, 255, 255, 0.75); font-weight: 600; }

/* The info strip on the bottom of the picture: white text on a soft dark gradient, legible on any photo
   or map. Never catches clicks (the card link / the video's play link sit underneath). */
.nr-card-strip {
    position: absolute; inset: auto 0 0 0; z-index: 1;
    padding: 1.6rem 0.75rem 0.55rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
    color: #fff;
    display: flex; flex-direction: column; gap: 0.25rem;
    pointer-events: none;
}
.nr-card-strip:empty { display: none; }
.nr-card-strip-eyebrow { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-card-strip-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.nr-card-strip-text { font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0.3rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.nr-card-strip .nr-route-meta { display: inline-flex; flex-wrap: nowrap; gap: 0.7rem; font-size: 0.78rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.nr-card-strip .nr-route-meta i { opacity: 0.9; }
.nr-card-strip .nr-chip { flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

/* Body: the title only, always two lines tall, so every card is the same height. */
/* The body overlaps the picture by 1px and sits above it: during the hover lift the card sits at a
   fractional offset (e.g. -3.1px) and the zooming picture's last row antialiased into that half pixel
   as a light line for a moment. The opaque body now always covers that row. */
.nr-card-body { padding: 0.8rem 1rem 0.9rem; position: relative; z-index: 3; margin-top: -1px; background: var(--nr-surface); }
.nr-card-title {
    margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3rem; letter-spacing: -0.01em;
    color: var(--nr-route-card-title, var(--nr-text));
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.6rem;
}
.nr-card-title-1 { -webkit-line-clamp: 1; min-height: 1.3rem; line-height: 1.3rem; }
.nr-card-extra { margin: 0; font-size: 0.85rem; line-height: 1.3rem; min-height: 1.3rem; /* = one title line, so the body stays two title-lines tall */ color: var(--nr-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* VideoTile inside the card: the play link (before play) and the player (after) fill the picture. */
.nr-video-tile-link, .nr-card-media > iframe { display: block; width: 100%; height: 100%; border: 0; }
.nr-video-tile-play {
    position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2.6rem; opacity: 0.92;
    transition: opacity 200ms ease;
}
.nr-card:hover .nr-video-tile-play { opacity: 1; }
.nr-video-tile-play i { filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4)); }
/* RouteCard's wrapper: the admin's buttons (RouteAdminActions) sit top-left over the card, outside its
   link. The rating lives bottom-right in the strip, so the two never meet. */
.nr-route-card-wrap { position: relative; height: 100%; container-type: inline-size; }
/* Narrow cards (the 300px rows on Home and nearby routes): the rating drops its "(count)" and the stats
   sit closer, so distance, climb, time AND the stars all fit on one line. Wider cards (the /routes
   grid) keep the count. A container query, so it follows the card's own width, not the screen's. */
@container (max-width: 340px) {
    .nr-rating-badge > span { display: none; }
    .nr-card-strip .nr-route-meta { gap: 0.5rem; }
}
.nr-card-strip-end { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.nr-admin-actions-header { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nr-admin-actions-header .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
/* --- Route editor: the WikiLoc import panel (AdminRouteForm) ------------------------------------
   Three numbered steps (link, GPX drop zone, the bookmark) and a checklist of what the route has. */
.nr-import { border-color: color-mix(in srgb, var(--nr-primary) 35%, var(--bs-border-color)); }
.nr-import-head { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.nr-import-status { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.nr-import-status li {
    display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 600;
    padding: 0.2rem 0.6rem; border-radius: 999px; color: var(--nr-text-muted);
    background: var(--nr-surface-2, var(--bs-tertiary-bg)); border: 1px solid var(--bs-border-color);
}
.nr-import-status li.is-done { color: var(--nr-primary); border-color: color-mix(in srgb, var(--nr-primary) 45%, transparent); }

.nr-import-steps { list-style: none; counter-reset: nr-step; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.nr-import-steps > li { counter-increment: nr-step; position: relative; padding-left: 2.4rem; min-width: 0; }
.nr-import-steps > li::before {
    content: counter(nr-step); position: absolute; left: 0; top: 0;
    width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 0.9rem; color: var(--nr-on-primary, #fff); background: var(--nr-primary);
}
.nr-import-url { display: flex; gap: 0.5rem; }
.nr-import-url > .form-control { min-width: 0; }
.nr-import-url > .btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 575.98px) {
    .nr-import-url { flex-direction: column; }
    .nr-import-steps > li { padding-left: 2.1rem; }
}

.nr-dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem; text-align: center; min-height: 7.5rem; padding: 1rem;
    border: 2px dashed color-mix(in srgb, var(--nr-primary) 45%, var(--bs-border-color)); border-radius: 12px;
    background: color-mix(in srgb, var(--nr-primary) 5%, transparent); transition: background-color .15s, border-color .15s;
}
.nr-dropzone > .bi { font-size: 1.8rem; color: var(--nr-primary); }
.nr-dropzone:hover, .nr-dropzone:focus-within { background: color-mix(in srgb, var(--nr-primary) 11%, transparent); border-color: var(--nr-primary); }
.nr-dropzone.is-busy { opacity: 0.8; }
/* The real file input covers the zone (invisible), so a click opens the picker and a drop lands on it. */
.nr-dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.nr-dropzone-input:disabled { cursor: progress; }

.nr-import-setup { margin-top: 0.4rem; }
.nr-import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.5rem; }
.nr-import-setup > summary { cursor: pointer; font-size: 0.875rem; font-weight: 600; color: var(--nr-primary); width: fit-content; }
@media (prefers-reduced-motion: reduce) { .nr-dropzone { transition: none; } }

/* Import panel, compact (2026-11-03): the checklist as one row of small chips that scrolls sideways on a
   phone instead of stacking into four lines; the "read the saved GPX again" icon in the drop zone's
   corner; the bookmark fold after the numbered steps. */
.nr-import-head { align-items: center; }
.nr-dropzone-refresh {
    position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2;
    width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; display: grid; place-items: center;
    color: var(--nr-primary); background: var(--nr-surface); border: 1px solid var(--bs-border-color);
}
.nr-dropzone-refresh:hover { background: color-mix(in srgb, var(--nr-primary) 12%, var(--nr-surface)); }
.nr-import-alt { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--bs-border-color); }
@media (max-width: 575.98px) {
    .nr-import-status {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 2rem);
        margin: 0 -1rem; padding: 0 1rem 0.15rem;
    }
    .nr-import-status::-webkit-scrollbar { display: none; }
    .nr-import-status li { flex: none; font-size: 0.75rem; padding: 0.15rem 0.5rem; }
}

/* The import panel is a <details>, folded by default (2026-11-04): the summary is the old header (title +
   checklist) with a chevron, so a glance still says what the route has. */
.nr-import-summary {
    list-style: none; cursor: pointer; display: block;
    padding: var(--bs-card-spacer-y, 1rem) var(--bs-card-spacer-x, 1rem);
}
.nr-import-summary::-webkit-details-marker { display: none; }
.nr-import-summary .nr-import-head { margin-bottom: 0.4rem; }
.nr-import-chevron { font-size: 0.9rem; margin-left: 0.35rem; color: var(--nr-text-muted); display: inline-block; transition: transform .15s; }
.nr-import[open] .nr-import-chevron { transform: rotate(180deg); }
.nr-import-hint { display: block; font-size: 0.8rem; color: var(--nr-text-muted); }
.nr-import[open] .nr-import-hint { display: none; }
.nr-import:not([open]) .nr-import-summary .nr-import-head { margin-bottom: 0.25rem; }
@media (prefers-reduced-motion: reduce) { .nr-import-chevron { transition: none; } }
@media (prefers-reduced-motion: reduce) { .nr-locate a.is-busy i, .nr-rec-dot { animation: none; } }

/* A file dragged over the route editor: the WHOLE page is the drop target (nomadWikiLoc.js sets
   html.nr-drag-import), so this outline + label says so. pointer-events: none keeps the drop on the page. */
html.nr-drag-import body::after {
    content: attr(data-nr-drop-label); position: fixed; inset: 0.75rem; z-index: 2000; pointer-events: none;
    display: grid; place-items: center; font: 700 1.25rem/1.3 var(--nr-font-display, inherit); text-align: center; padding: 1rem;
    color: var(--nr-primary); background: color-mix(in srgb, var(--nr-bg) 82%, transparent);
    border: 3px dashed var(--nr-primary); border-radius: 18px;
}

/* Routes by riders (2026-11-04): the owner badge on /admin/users and the byline on a rider's route. */
.nr-owner-badge { background: var(--nr-cta); color: var(--nr-on-cta, #fff); }
.nr-route-byline { margin: -0.25rem 0 0.5rem; font-size: 0.9rem; color: var(--nr-text-muted); }

/* The /map page's pins: the Nomad Riders logo in a round badge with a pointer (nomadRidersMap.js). */
.nr-logo-pin { background: transparent !important; border: none !important; }
.nr-logo-pin > span {
    display: block; width: 38px; height: 38px; border-radius: 50%; position: relative;
    background: #2f4735 url('img/pin-logo.png') center / 78% no-repeat;
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.nr-logo-pin > span::after {
    content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
    border: 6px solid transparent; border-top: 7px solid #fff; border-bottom: 0;
}
.nr-logo-pin.is-rider > span { background-color: #9b4427; }

/* Waypoint photo viewer (Components/PhotoViewer). The dark backdrop covers the shell, bottom tab bar
   included; the photo is as large as the screen allows, the caption sits under it. */
.nr-wp-open { cursor: zoom-in; border-radius: 14px; }
.nr-wp-open:focus-visible { outline: 3px solid var(--nr-primary); outline-offset: 2px; }
.nr-viewer {
    position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
    /* One column no wider than the screen: with an auto column a 1200 px photo widened the grid past the
       viewport, and a phone zoomed the whole page out to fit it (cut-off arrows, no close button). */
    grid-template-columns: minmax(0, 1fr); overflow: hidden;
    background: rgba(8, 10, 9, 0.94); padding: max(3.5rem, env(safe-area-inset-top)) 0.75rem max(1rem, env(safe-area-inset-bottom));
    overscroll-behavior: contain; touch-action: pan-y pinch-zoom; outline: none;
}
.nr-viewer-figure { margin: 0; width: 100%; max-width: 1200px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.nr-viewer-figure img {
    max-width: 100%; max-height: calc(100dvh - 10rem); object-fit: contain; border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); background: #111;
}
.nr-viewer-figure figcaption { color: #eef1ec; text-align: center; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.95rem; }
.nr-viewer-figure figcaption span { color: #b9c2b6; font-size: 0.85rem; }
.nr-viewer-count { font-variant-numeric: tabular-nums; }
.nr-viewer-btn {
    position: absolute; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; display: grid; place-items: center;
    color: #fff; background: rgba(255, 255, 255, 0.14); font-size: 1.25rem;
}
.nr-viewer-btn:hover, .nr-viewer-btn:focus-visible { background: rgba(255, 255, 255, 0.26); }
.nr-viewer-close { top: max(0.75rem, env(safe-area-inset-top)); right: 0.75rem; }
.nr-viewer-prev { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.nr-viewer-next { right: 0.75rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 575.98px) {
    /* Phones swipe; the arrows move down beside the caption so they never cover the photo. */
    .nr-viewer-prev, .nr-viewer-next { top: auto; bottom: max(1rem, env(safe-area-inset-bottom)); transform: none; }
}

/* --- Track editor (Pages/RouteTrackEditor + js/nomadTrackEdit.js) --------------------------------------
   One viewport-high screen like /map: a header, then the map over the elevation profile with the panel
   beside it; on phones the panel goes under the map with one pane at a time (dead ends / select). */
.nr-te {
    display: flex; flex-direction: column; gap: 0.75rem;
    height: calc(100dvh - var(--nr-topbar-h) - env(safe-area-inset-top, 0px) - clamp(1.25rem, 2.5vw, 2rem) - 1.5rem);
    min-height: 480px;
}
.nr-shell:has(.nr-te) .nr-main { padding-bottom: 1.5rem; }
.nr-shell:has(.nr-te) .nr-footer { display: none; }
.nr-te-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.nr-te-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.nr-te-title strong { font-family: var(--nr-font-display); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-te-eyebrow, .nr-te-section {
    font-family: var(--nr-font-display); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--nr-text-muted); margin: 0;
}
.nr-te-head-actions { display: flex; align-items: center; gap: 0.5rem; }
.nr-te-icon {
    width: 2.6rem; height: 2.6rem; border-radius: 12px; border: 1px solid var(--bs-border-color);
    background: transparent; color: var(--nr-text); display: grid; place-items: center; font-size: 1.1rem;
}
.nr-te-icon:disabled { opacity: 0.4; }
.nr-te-save { display: inline-flex; align-items: center; gap: 0.4rem; }
.nr-te-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 1rem; }
.nr-te-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.nr-te-map { flex: 1 1 auto; min-height: 260px; border-radius: var(--nr-radius); overflow: hidden; border: 1px solid var(--bs-border-color); }
.nr-te-profile-wrap { flex: none; background: var(--nr-surface); border: 1px solid var(--bs-border-color); border-radius: var(--nr-radius); padding: 0.6rem 0.9rem 0.8rem; }
.nr-te-profile-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.4rem; font-size: 0.875rem; }
.nr-te-hint, .nr-te-muted { color: var(--nr-text-muted); font-size: 0.875rem; }
.nr-te-selinfo { margin-left: auto; }
.nr-te-profile { position: relative; height: 120px; touch-action: none; cursor: crosshair; user-select: none; }
.nr-te-profile svg { display: block; }
.nr-te-handle {
    position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
    background: #ffcd57; border: 3px solid #1d1d1b; box-sizing: border-box; cursor: ew-resize;
}
.nr-te-handle::before { content: ""; position: absolute; left: 50%; top: -60px; bottom: -60px; width: 3px; margin-left: -1.5px; background: #ffcd57; z-index: -1; }
.nr-te-side {
    flex: 0 0 360px; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1.1rem;
    background: var(--nr-surface); border: 1px solid var(--bs-border-color); border-radius: var(--nr-radius); padding: 1rem;
}
.nr-te-modes { display: none; }
.nr-te-pane { display: flex; flex-direction: column; gap: 0.6rem; }
.nr-te-deadends { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.nr-te-dead { border: 1px solid var(--bs-border-color); border-radius: 14px; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.nr-te-dead.is-current { border-color: #ff8f6b; }
.nr-te-dead-head { display: flex; align-items: center; gap: 0.5rem; }
.nr-te-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff8f6b; flex: none; }
.nr-te-dead-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
.nr-te-dead-actions .btn { min-width: 0; }
.nr-te-pager { display: none; align-items: center; justify-content: space-between; }
.nr-te-sel-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.nr-te-sel-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 0; }
.nr-te-warn { margin: 0; font-size: 0.875rem; color: var(--bs-danger); }
.nr-te-stats dl { margin: 0.4rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; font-size: 0.9rem; }
.nr-te-stats dt { font-weight: 400; color: var(--nr-text-muted); }
.nr-te-stats dd { margin: 0; text-align: right; }
.nr-te-stats dd span { color: var(--nr-text-muted); }
.nr-te-waypoints { display: flex; flex-direction: column; gap: 0.35rem; }

@media (max-width: 991.98px) {
    .nr-te {
        height: calc(100dvh - var(--nr-topbar-h) - env(safe-area-inset-top, 0px)
                     - var(--nr-tabbar-h) - env(safe-area-inset-bottom, 0px) - 1.25rem - 0.75rem);
        gap: 0.5rem; min-height: 0;
    }
    .nr-shell:has(.nr-te) .nr-main { padding-bottom: calc(var(--nr-tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.75rem); }
    .nr-te-reset, .nr-te-eyebrow { display: none; }
    .nr-te-head { flex-wrap: nowrap; gap: 0.5rem; }
    .nr-te-title { flex: 1 1 0; }
    .nr-te-title strong { font-size: 1rem; }
    .nr-te-save span:last-child { display: none; }
    .nr-te-save { width: 2.6rem; height: 2.6rem; padding: 0; justify-content: center; }
    .nr-te-body { flex-direction: column; gap: 0.5rem; }
    .nr-te-map { min-height: 0; }
    .nr-te-profile { height: 90px; }
    .nr-te-handle { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
    .nr-te-side { flex: 0 0 auto; max-height: 44%; padding: 0.75rem; gap: 0.75rem; }
    .nr-te-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
    .nr-te-modes button {
        min-height: 2.5rem; border-radius: 10px; border: 1px solid var(--bs-border-color); background: transparent;
        color: var(--nr-text); font-weight: 600; font-size: 0.875rem;
    }
    .nr-te-modes button.is-on { background: var(--nr-primary); border-color: var(--nr-primary); color: var(--nr-on-primary, #fff); }
    .nr-te-pane { display: none; }
    .nr-te-pane.is-on { display: flex; }
    .nr-te-pane .nr-te-section { display: none; }
    .nr-te-dead { display: none; }
    .nr-te-dead.is-current { display: flex; }
    .nr-te-pager { display: flex; }
    .nr-te-stats { display: none; }
}

/* "or" divider + Google button on the sign-in / register forms */
.nr-auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0; color: var(--nr-text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.nr-auth-or::before, .nr-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--nr-border); }
.nr-google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; background: var(--nr-surface); color: var(--nr-text); }

/* ---- Route page: weather at the start (RouteWeather, roadmap A1) ---- */
.nr-weather-hint { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-weight: 600; }
.nr-weather-hint i { color: var(--nr-primary); }
.nr-weather-days {
    list-style: none; margin: 0; padding: 0 0 0.25rem;
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem;
}
/* Phones: the seven days scroll sideways INSIDE the row (the page itself never gets wider than the screen). */
@media (max-width: 767.98px) {
    .nr-weather-days { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 5.75rem; overflow-x: auto; scroll-snap-type: x proximity; }
    .nr-weather-day { scroll-snap-align: start; }
}
.nr-weather-day {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 0;
    padding: 0.65rem 0.35rem 0.6rem; text-align: center;
    background: var(--nr-surface); border: 1px solid var(--nr-border); border-top: 3px solid var(--nr-border);
    border-radius: var(--nr-radius-sm);
}
.nr-weather-day.is-good { border-top-color: var(--nr-primary); }
.nr-weather-day.is-fair { border-top-color: var(--nr-sun); }
.nr-weather-day.is-poor { border-top-color: var(--nr-cta); }
.nr-weather-day.is-best { background: var(--nr-primary-soft); border-color: var(--nr-primary); }
.nr-weather-date { display: flex; flex-direction: column; line-height: 1.15; }
.nr-weather-date strong { font-family: var(--nr-font-display); text-transform: capitalize; }
.nr-weather-date small, .nr-weather-temp small, .nr-weather-meta small { color: var(--nr-text-muted); }
.nr-weather-icon { font-size: 1.7rem; color: var(--nr-primary); line-height: 1; }
.nr-weather-temp { display: flex; gap: 0.35rem; align-items: baseline; }
.nr-weather-temp strong { font-size: 1.1rem; }
.nr-weather-meta { font-size: 0.8rem; color: var(--nr-text-muted); white-space: nowrap; }
.nr-weather-wind { display: flex; flex-direction: column; align-items: center; line-height: 1.2; font-size: 0.8rem; color: var(--nr-text-muted); max-width: 100%; }
.nr-weather-wind > span:not(.visually-hidden) { white-space: nowrap; }
.nr-weather-gust { white-space: nowrap; }
.nr-weather-best {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--nr-primary); color: var(--nr-on-primary); border-radius: 999px; padding: 0.05rem 0.5rem;
}
.nr-weather-sun { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--nr-text-muted); }
.nr-weather-sun i { color: var(--nr-primary); }
.nr-weather-sun { align-items: center; }
.nr-weather-credit { margin-left: auto; }
/* A credit folded into an "i" (the maps' look, .nr-attr): tap shows it as a bubble above the "i" (the row never
   moves), it folds again after 3 s or a tap elsewhere (nomadTheme.js, [data-nr-credit]). */
.nr-credit {
    position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    background: var(--nr-surface-2); color: var(--nr-text); box-shadow: var(--nr-shadow-sm);
}
.nr-credit::before { content: "i"; font: italic 700 13px/1 Georgia, serif; }
.nr-credit-text {
    position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; white-space: nowrap;
    padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; color: var(--nr-text-muted);
    background: var(--nr-surface); border: 1px solid var(--nr-border); box-shadow: var(--nr-shadow);
}
.nr-credit.is-folded .nr-credit-text { display: none; }
.nr-credit:focus-visible { outline: 2px solid var(--nr-primary); outline-offset: 2px; }

/* ---- Route page: "Take it with you" (RouteExports, roadmap A4) ---- */
.nr-more-formats { align-self: center; font-size: 0.9rem; font-weight: 600; text-decoration: none; }
@media (max-width: 575.98px) { .nr-detail-actions > .nr-more-formats { grid-column: 1 / -1; text-align: center; } }
.nr-export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.nr-export {
    display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; padding: 0.6rem 0.75rem;
    border: 1px solid var(--nr-border); border-radius: var(--nr-radius-sm); background: var(--nr-surface-2);
    color: var(--nr-text); text-decoration: none;
}
.nr-export:hover, .nr-export:focus-visible { border-color: var(--nr-primary); color: var(--nr-text); }
.nr-export strong { font-family: var(--nr-font-display); color: var(--nr-primary); }
.nr-export small { color: var(--nr-text-muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.nr-export-qr { display: flex; gap: 0.9rem; align-items: center; margin-top: 1rem; }
/* Black on white whatever the theme: what every camera reads best. */
.nr-export-qr img { flex: 0 0 auto; width: 132px; height: 132px; background: #fff; border-radius: var(--nr-radius-sm); padding: 4px; border: 1px solid var(--nr-border); }
.nr-export-qr p { margin: 0; font-size: 0.85rem; color: var(--nr-text-muted); min-width: 0; }
.nr-export-help { margin-top: 1rem; }
.nr-export-help summary { cursor: pointer; font-weight: 600; color: var(--nr-primary); }
.nr-export-help dl { margin: 0.6rem 0 0; font-size: 0.85rem; }
.nr-export-help dt { margin-top: 0.5rem; }
.nr-export-help dd { margin: 0; color: var(--nr-text-muted); }

/* ---- /map: search by area of passage (roadmap A2) ---- */
.nr-map-stage { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.nr-map-stage > .nr-fullmap { flex: 1 1 auto; min-height: 0; height: auto; }
.nr-area-bar {
    position: absolute; top: 0.6rem; left: 50%; transform: translateX(-50%); z-index: 1000;
    display: flex; align-items: center; gap: 0.4rem; max-width: calc(100% - 7.5rem);
    padding: 0.3rem; background: var(--nr-surface); border: 1px solid var(--nr-border); border-radius: 999px; box-shadow: var(--nr-shadow);
}
.nr-area-bar .btn { border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem; }
.nr-area-hint { font-size: 0.85rem; font-weight: 600; padding: 0 0.4rem; min-width: 0; }
/* Phones: two equal buttons in one row between the zoom buttons (left) and the layers button (right). */
@media (max-width: 575.98px) {
    .nr-area-bar { left: 3.4rem; right: 4.1rem; transform: none; max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--nr-radius-sm); }
    .nr-area-bar:has(.nr-area-hint) { grid-template-columns: minmax(0, 1fr) auto; }
    .nr-area-bar .btn { min-width: 0; height: 100%; justify-content: center; text-align: center; white-space: normal; font-size: 0.8rem; padding: 0.35rem 0.4rem; line-height: 1.15; border-radius: var(--nr-radius-sm); }
    .nr-area-hint { font-size: 0.8rem; }
}
/* While drawing, the map must get every finger movement: Leaflet's own CSS leaves "pan-x pan-y" on the container when
   its dragging is off, so the browser took the swipe as a page pan and cancelled the drawing at once. */
.leaflet-container.nr-map-drawing, .nr-map-drawing * { cursor: crosshair !important; touch-action: none !important; }
.nr-logo-pin.is-dim { opacity: 0.3; filter: grayscale(1); }
.nr-area-results {
    position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.6rem; z-index: 1000; max-height: 72%; overflow-y: auto;
    padding: 0.75rem 0.85rem; background: var(--nr-surface); border: 1px solid var(--nr-border);
    border-radius: var(--nr-radius); box-shadow: var(--nr-shadow);
}
.nr-area-results > header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.nr-area-results h2 { font-size: 1rem; margin: 0; }
.nr-area-empty, .nr-area-more { margin: 0; font-size: 0.9rem; color: var(--nr-text-muted); }
.nr-area-more { margin-top: 0.5rem; }
