/*
 * Cyclograde Modern Design System
 * Based on homepage1.scala.html design and GoodUI principles
 * - Visual hierarchy and clarity
 * - Consistency across pages
 * - Card-based design
 * - Clear CTAs and progress indicators
 * - Whitespace and readability
 */

/* The browser's own rule for [hidden] is display: none at the weakest specificity there is, so any
   author rule that sets display — Bulma's .help, a flex row, a grid — silently outranks it and an
   element the script "hid" stays on the page. Both halves of that have already shipped as bugs, so
   the attribute is made to mean what it says once, here. Code toggling visibility should set
   el.hidden rather than reach for a class. */
[hidden] {
  display: none !important;
}

/* ===============================
   HERO SECTIONS
   =============================== */

/* Modern SaaS Hero (homepage1 style) */
.hero-section-modern {
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 55%, white) 0%, color-mix(in srgb, var(--secondary-light) 50%, white) 100%);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    /* Same 1rem as every other block on the guest home, the only page using this hero. */
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.hero-section-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-blue-light) 0%, transparent 70%);
    opacity: 0.3;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* The two documents and the copy, under the title. The profile is wide and the tube strip is
   tall, so the strip stands on the right over both the profile and the copy, and the copy runs
   the profile's width. The strip column is a fixed measure rather than a share of the row: the
   strip's type is set to be read from the saddle, and at a third of the row it was twice the size
   of anything on the profile. 15rem shows it a little smaller than it prints. One column on a
   phone, the strip between the profile and the copy, narrowed so it does not run to three
   screens. */
.hero-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    grid-template-areas:
        "profile strip"
        "copy strip";
    gap: 1.25rem 2rem;
    align-items: start;
}

.hero-main-profile {
    grid-area: profile;
}

.hero-main-strip {
    grid-area: strip;
}

.hero-main-copy {
    grid-area: copy;
}

/* A size down from the copy the hero carried beside a picture: it now sits under one, and the
   strip beside it is only as tall as the profile and the copy together, so every line the copy
   saves is a line less the strip has to be widened to fill. */
.hero-main .hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.hero-main .hero-action-text {
    font-size: 1rem;
}

.hero-main figure {
    margin: 0;
    text-align: center;
}

.hero-main img {
    display: block;
    width: 100%;
    /* The width and height attributes give the ratio before the file arrives; this keeps it. */
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--gray);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.hero-main figcaption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
}

@media screen and (max-width: 768px) {
    .hero-main {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "profile"
            "strip"
            "copy";
    }

    .hero-main-strip {
        width: 60%;
        justify-self: center;
    }
}

.hero-icon {
    color: white;
}

.hero-title-row {
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 2.05rem;
    font-weight: 800;
    color: var(--foreground);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title-row .hero-title {
    margin-bottom: 0;
}

.hero-title .icon-text {
    align-items: flex-end;
    display: inline-flex;
    gap: 0.5rem;
    line-height: 1.2;
}


.hero-subtitle {
    font-size: 1.4rem;
    color: var(--foreground);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-action-row {
    display: grid;
    grid-template-columns: 13.5rem 1fr;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.hero-action-row + .hero-action-row {
    margin-top: 1rem;
}

.hero-action-button {
    width: 100%;
}

@media screen and (max-width: 768px) {
    .hero-action-row {
        grid-template-columns: 1fr;
    }

    .hero-action-button {
        width: auto;
    }
}

.hero-action-text {
    font-size: 1.2rem;
    color: var(--foreground);
    line-height: 1.5;
}

/* Page Header Hero (for secondary pages) */
.page-header {
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 55%, white) 0%, color-mix(in srgb, var(--secondary-light) 50%, white) 100%);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-blue-light) 0%, transparent 70%);
    opacity: 0.2;
    z-index: 0;
}

.page-header-content {
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--gray-dark);
    max-width: 600px;
    margin: 0 auto;
}

/* Compact Page Header (for pages that need less vertical space) */
.page-header-compact {
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 55%, white) 0%, color-mix(in srgb, var(--secondary-light) 50%, white) 100%);
    border-radius: 12px;
    padding: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header-compact::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -3%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--accent-blue-light) 0%, transparent 70%);
    opacity: 0.2;
    z-index: 0;
}

.page-header-compact .page-header-content {
    position: relative;
    z-index: 1;
}

.page-header-compact .page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.15rem;
}

.page-header-compact .page-subtitle {
    font-size: 1rem;
    color: var(--gray-dark);
    max-width: 600px;
    margin: 0 auto;
}

/* The track a page is about (_trackSubtitle): the name reads like text, not like a caption. */
.page-header-compact .page-subtitle.track-subtitle {
    font-size: 1.1rem;
}

.track-subtitle-name {
    color: var(--foreground);
    font-weight: 500;
}

/* ===============================
   FEATURE CARDS
   =============================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

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

.feature-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--gray);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: white;
}

.feature-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.feature-icon.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.feature-icon.tertiary {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

.feature-icon.warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.feature-icon.info {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--gray-dark);
    line-height: 1.6;
}

/* ===============================
   CONTENT SECTIONS
   =============================== */

.content-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.content-section.compact {
    background: transparent;
    padding: 0.25rem 0;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0.5rem;
}

.content-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-section-title i {
    color: var(--secondary);
}

.content-section p {
    color: var(--gray-dark);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* Showcase Section */
.showcase-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
}

.showcase-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.showcase-description {
    color: var(--gray-dark);
    margin-bottom: 2rem;
    /* Wide enough that a sentence of ordinary length lands on one line. At 600px it broke after
       "avec des cyclosportives, des" while the images underneath ran the full width of the block,
       which reads as a paragraph cut in half rather than as a measure. Still capped, because a
       line running the whole 1120px is too long to track back to. */
    max-width: 60rem;
}

/* Custom: center grid-item captions under showcase images (safe, preserves Bulma aspect ratios) */
.fixed-grid .grid-item {
    text-align: center;
}
.fixed-grid .grid-item figure {
    margin: 0 auto;
    display: block;
    line-height: 0;
}

.fixed-grid .grid-item figure img {
    display: block;
    width: 100%;
    height: auto;
}
.fixed-grid .grid-item span {
    margin-top: 0.5rem;
    display: inline-block;
}

.fixed-grid .grid-item .showcase-caption {
    display: block;
    margin-top: 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--foreground);
}

.showcase-also {
    margin-top: 1rem;
    color: var(--gray-dark);
    font-style: italic;
}

/* ===============================
   CTA SECTIONS
   =============================== */

.cta-section {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 20px;
    margin-top: 3rem;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.cta-description {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-button {
    background: white;
    color: var(--primary-text);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Vibrant CTA variant: pastel tones respecting site palette */
.cta-section.vibrant {
    /* Single pastel background (soft green derived from --primary-light) */
    background: rgba(129,199,132,0.12);
    /* The guest home stacks a dozen blocks, so the call to action takes its place in that rhythm
       instead of the 3rem the base rule claims. There the CTA closes a list; here it is one block
       among the others, and a wider gap reads as a break in the page. */
    margin-top: 1rem;
    box-shadow: 0 6px 16px rgba(34, 34, 34, 0.04);
    border: 1px solid rgba(129,199,132,0.18);
}

.cta-section.vibrant .cta-title {
    color: var(--foreground);
    text-shadow: none;
}

.cta-section.vibrant .cta-description,
.cta-section.vibrant .cta-note {
    color: rgba(51,51,51,0.95);
}

.cta-section.vibrant .cta-button {
    background: rgba(255,255,255,0.96);
    color: var(--primary-text);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.cta-section.vibrant .cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Align CTA button and adjacent message vertically */
.cta-actions {
    display: flex;
    justify-content: center; /* center the group horizontally in the enclosing box */
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    margin: 0.5rem 0;
}

.cta-actions-grid {
    display: inline-grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.5rem;
    align-items: center;
    margin: 0.5rem auto 0;
}

.cta-messages {
    display: flex;
    flex-direction: column; /* stack each message on its own line */
    align-items: flex-start; /* keep messages to the right of the button */
    gap: 0.2rem;
}

.cta-messages .cta-comment {
    color: rgba(51,51,51,0.95);
    font-size: 1rem;
    line-height: 1.2;
}

/* Responsive: on small screens, stack vertically with button on top */
@media (max-width: 640px) {
    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    .cta-messages {
        align-items: center;
        text-align: center;
    }

    /* Two columns of "auto 1fr" need more room than a 360px phone has, and the grid does not
       shrink below its content: it simply reached past the right edge and took the page with it. */
    .cta-actions-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

/* Note / helper text below CTA button */
.cta-note {
    color: inherit;
    margin-top: 1.5rem;
    font-size: 0.98rem;
    opacity: 0.95;
}

/* ===============================
   FORM SECTIONS (for newtrack, login, etc.)
   =============================== */

.form-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-step-number {
    width: 40px;
    height: 40px;
    background: var(--secondary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.form-section-description {
    color: var(--gray-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Modern Input Styling */
/* The eye at the right of a password field: a control, inside an icon slot Bulma makes inert. */
.password-toggle {
    cursor: pointer;
    pointer-events: all;
}

.modern-input {
    border: 2px solid var(--gray);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.modern-input:not(:placeholder-shown) {
    border-color: var(--primary);
}

.modern-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
    outline: none;
}

.modern-input.is-danger {
    border-color: var(--danger);
    box-shadow: none;
}

.modern-input.is-danger:focus,
.modern-input.is-danger:focus-visible {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.3);
    outline: none;
}

.modern-select {
    border: 2px solid var(--gray);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.modern-select:focus-within {
    border-color: var(--secondary);
    outline: none;
}

/* ===============================
   BUTTONS
   =============================== */

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--on-primary);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 35%, transparent);
    color: var(--on-primary);
}

.btn-primary.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-mid) 100%);
    color: var(--on-secondary);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--secondary) 35%, transparent);
    color: var(--on-secondary);
}

.btn-light {
    background: var(--gray-light);
    color: var(--foreground);
    border: 1px solid var(--gray);
    padding: 0.875rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-light:hover {
    background: var(--gray);
    color: var(--foreground);
}

/* ===============================
   DATA TABLES
   =============================== */

.modern-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table thead {
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--gray) 100%);
}

.modern-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--foreground);
    border-bottom: 2px solid var(--gray);
}

.modern-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray);
    color: var(--foreground);
}

.modern-table tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.05);
}

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

.track-title-link {
    color: var(--primary-text);
    text-decoration: underline;
    font-weight: 500;
}

.speed-profile-name,
.track-name {
    color: var(--primary-text);
    font-weight: 500;
}

.modern-table th.track-actions-header {
    text-align: right;
}

.modern-table td.track-actions-cell {
    position: relative;
    text-align: right;
}

.track-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* The menus are separate buttons, and with no gap they read as one segmented control and are
       easy to mis-tap. Matches the spacing inside the dropdowns they open. */
    gap: 0.45rem;
}

.track-actions-menu {
    position: relative;
    display: inline-block;
}

.track-actions-toggle {
    min-width: 2.2rem;
}

.track-actions-dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 30;
    min-width: auto;
    width: max-content;
    background: var(--background);
    border: 1px solid var(--gray);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.track-actions-delete-zone {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--gray);
}

.track-actions-dropdown .button {
    justify-content: flex-start;
}

/* Opened upward, when downward would be cut off (track-actions.js decides). */
.track-actions-dropdown.is-up {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

/* Hung from the toggle's left edge, when the right would run off the left of the screen (same). */
.track-actions-dropdown.is-left {
    left: 0;
    right: auto;
}

/* The table's scroll container lets a menu out while one is open that fits neither way inside
   it — a table of one row, and the tallest menu. Sideways scrolling comes back on close. */
.modern-table-container.has-open-menu {
    overflow: visible;
}

/* ===============================
   STATS / INFO BOXES
   =============================== */

.stats-box {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stats-box.borderless {
    background: transparent;
    box-shadow: none;
    border-left: none;
    padding: 0.5rem 0;
}

/* A stats box carrying a sentence rather than a figure. The paragraph in this card is styled
   for a number — 1.5rem and bold — which is right for "2/10" and shouts when it holds prose. */
.stats-box.is-prose .stats-content p {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--gray-dark);
    margin-bottom: 0.75rem;
}

.stats-box.secondary {
    border-left-color: var(--secondary);
}

/* flex-shrink: 0 because a card carrying a paragraph would otherwise squeeze the square into a
   sliver to give the text its room. */
.stats-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-dark);
}

.stats-box.secondary .stats-icon {
    background: var(--secondary-tint);
    color: var(--secondary);
}

.stats-content h4 {
    font-size: 0.875rem;
    color: var(--gray-dark);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stats-content p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin: 0;
}

/* ===============================
   TRACK STATISTICS BOX
   =============================== */

.track-info-box {
    background: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin: 1rem 0;
    border: 1px solid var(--gray);
}

/* stat cards */
.stats-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

.stats-section--divider {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray);
}

/* The same figures on one line, under the title, on the track page and the edit page. Stacked
   they cost four rows before the rider reaches the drawing, which is what they came to see. */
.track-info-box--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.track-info-box--inline .stats-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* A rule between the groups rather than above them, now that they sit side by side. Dropped when
   the row wraps, where a dangling vertical rule reads as a mistake. */
.track-info-box--inline .stats-section--divider {
    border-left: 1px solid var(--gray);
    padding-left: 1.25rem;
}

@media screen and (max-width: 768px) {
    .track-info-box--inline .stats-section--divider {
        border-left: none;
        padding-left: 0;
    }
}

.stats-section--meta {
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 100px;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-dark);
    font-weight: 500;
}

.stat-card-header i {
    font-size: 0.72rem;
    color: var(--primary-dark);
}

.stat-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
}

/* icon colour variants: named under their header, which is what gives the icon its colour above,
   so the variant outranks it by specificity rather than by force */
.stat-card-header .stat-icon--elevation { color: #9c27b0; }
.stat-card-header .stat-icon--time      { color: var(--secondary); }
.stat-card-header .stat-icon--speed     { color: #ff9800; }
.stat-card-header .stat-icon--estimated { color: #00bcd4; }

/* meta chips (bottom info row) */
.stat-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 0.78rem;
    white-space: nowrap;
}

.stat-meta i {
    font-size: 0.7rem;
    color: var(--primary-dark);
}

.stat-meta-label {
    color: var(--gray-dark);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-meta-value {
    font-weight: 600;
    color: var(--foreground);
}

@media (max-width: 768px) {
    .track-info-box {
        padding: 0.5rem 0.75rem;
    }

    .stats-section {
        gap: 0.9rem;
    }

    .stat-card-value {
        font-size: 1rem;
    }

    .stat-meta {
        font-size: 0.72rem;
        padding: 0.2rem 0.45rem;
    }
}

/* ===============================
   INFO CARDS
   =============================== */

.info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray);
    margin-bottom: 1.5rem;
}

.info-card-included {
  margin-bottom: 1.5rem;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.info-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.info-card-content {
    color: var(--gray-dark);
    line-height: 1.7;
}

/* A help card or a section intro may list its steps: Bulma strips the bullets from every list, and a
   list with no bullets reads as one paragraph broken oddly. */
.info-card-content ul,
.section-intro ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.info-card-content-black {
    line-height: 1.7;
}

.info-card-content a {
    color: var(--primary-text);
    font-weight: 500;
}

/* Underlined rather than recoloured: every lighter green falls under 4.5:1 on white. */
.info-card-content a:hover {
    text-decoration: underline;
}

.apropos-story-content .info-card-title {
    margin: 2rem 0 0.75rem;
}

.apropos-story-content .info-card-title:first-of-type {
    margin-top: 0;
}

.apropos-image-block {
    margin: 1rem 0 2rem;
}

.apropos-image {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--gray);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.apropos-image-time {
    max-width: 300px;
    height: auto;
}

.apropos-image-gra {
    max-width: 420px;
}

.apropos-image-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.apropos-image-block figcaption {
    margin-top: 0.5rem;
    text-align: center;
    color: var(--gray-dark);
    font-size: 0.9rem;
}

.help-prepare-image-block {
    margin-top: 0.9rem;
}

/* The route sheet's three places, drawn: three figures a row, one a row on a phone. */
.help-crono-where {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.9rem;
}

.help-crono-where figure {
    margin: 0;
}

.help-crono-where img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--gray);
    border-radius: 10px;
}

.help-crono-where figcaption {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--gray-dark);
}

@media (max-width: 768px) {
    .help-crono-where {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The seven days are a disclosure, not fine print: grey-on-blue at 0.8rem made it
   invisible, which is the one thing a disclosure must not be. */
.hero-action-note {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.95rem;
    color: var(--foreground);
    opacity: 0.75;
}

/* The three how-it-works columns, and the two entry points below them. */
.home-step {
    height: 100%;
    background: white;
    border: 1px solid var(--gray);
    border-radius: 16px;
    padding: 1.5rem;
}

.home-step-link {
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

/* One shape for every card on this page, and the same one the help page uses for its
   titled blocks (.info-card-header): badge and heading on a line, the explanation at
   full width underneath.
 *
 * It gives the text back the whole card — the three-across columns have 297px of
 * measure and could not spare the 76px a badge in the margin was taking — and it needs
 * no separate rule on a phone, because the header row is short by construction.
 *
 * 40px like the help page rather than the 60px of .feature-icon: beside a heading it is
 * a marker, not a picture. */
.home-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.home-step-header .feature-title {
    margin-bottom: 0;
}

.home-step-badge {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
}

.home-step-badge.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.home-step-badge.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

.home-step-badge.tertiary {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

/* The three outputs. Equal height and natural width: the photos are portrait but of
   three different shapes, and forcing a common box would crop the route sheet — which
   is the one whose whole point is that it is long and thin. */
.home-outputs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem 2.5rem;
    margin-top: 1.25rem;
}

.home-outputs figure {
    margin: 0;
    text-align: center;
}

.home-outputs img {
    display: block;
    height: 380px;
    width: auto;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--gray);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* The line above each row of photographs, naming what the row shows. */
/* Five photographs in one row under the cards, all 800px tall and of very different widths:
   at this height the five add up to about 800px plus gaps, one row on a desktop.
 *
 * Two classes on purpose. `.home-outputs--formats img` has the same specificity as the
 * `.home-outputs img` rules further down, so it would lose to them on source order and
 * the phone would show both rows the same size. */
.home-outputs.home-outputs--formats img {
    height: 300px;
}

/* A figure is as wide as its photograph, not as wide as its caption: five captions at their
   natural width add up to more than the row and pushed two photographs onto a second line. The
   floor keeps the sticker's caption, over an 88px photograph, from breaking on every word. */
.home-outputs--formats figure {
    width: min-content;
    min-width: 9rem;
}

/* Never narrower than its natural width at that height: the floor above squeezed the two widest
   photographs to the floor's width while their height stayed fixed, and they came out distorted. */
.home-outputs--formats img {
    max-width: none;
}

@media screen and (max-width: 768px) {
    .home-outputs.home-outputs--formats img {
        height: 220px;
    }
}

.home-outputs figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--gray-dark);
}

@media screen and (max-width: 768px) {
    .home-outputs img {
        height: 300px;
    }
}

/* The closing landscape band. The photograph is 2.06:1 but the band is wider than that, so the
 * browser crops it rather than the file: the same asset then serves the band and the taller crop
 * a phone needs, where a 3:1 sliver would show nothing readable. */
.home-panorama {
    /* Spaced like a .showcase-section rather than to its own taste, so the band sits in the
       page rhythm the whole guest home keeps: 1rem between every block. */
    margin: 1rem 0;
}

.home-panorama img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
}

@media screen and (max-width: 768px) {
    .home-panorama img {
        aspect-ratio: 16 / 10;
        /* The taller crop takes a narrower slice of the width, and the rider sits at 84% of it.
           Centred, the slice ends at 89% and leaves them against the edge; nudged right, they
           keep some road in front of them. */
        object-position: 62% center;
    }
}

.help-prepare-sticker-options {
    list-style: decimal outside;
    padding: 0;
    margin: 0.5rem 0 0 1.25rem;
}

.help-prepare-bullets {
    list-style: disc outside;
    padding: 0;
    margin: 0.5rem 0 0 1.25rem;
}

/* A notification sets its own text colour (dark green in the intro's box): its paragraphs take it
   rather than the grey .content-section p gives every other paragraph, or the box mixes the two. */
.help-content .notification p {
    color: inherit;
}

/* Three kinds of reference in the help text, each with a look of its own so a reader can tell
   at a glance what clicking or looking for it means:
   - a page of the site: its name in dark semibold behind a window icon, a link when the page
     has one URL for everyone (My tracks) and plain text when it does not (one track's edit page);
   - another part of this help: a blue link behind a section sign, that jumps within the page;
   - a button of the site: drawn as a small light button, the same face the track page's own
     buttons have, scaled to the text and doing nothing — a span, never a button element, so it
     is not focusable and a screen reader reads its label as part of the sentence. */
.help-content .help-ref-page {
    color: var(--foreground);
    font-weight: 600;
    white-space: nowrap;
}

.help-content a.help-ref-page {
    text-decoration: underline;
    text-decoration-color: var(--gray);
    text-underline-offset: 0.2em;
}

.help-content .help-ref-page svg,
.help-content .help-ref-page i {
    font-size: 0.85em;
    color: var(--gray-dark);
}

.help-content a.help-ref-section {
    color: var(--secondary-dark);
    font-weight: 500;
}

.help-content a.help-ref-section::before {
    content: "§\00a0";
}

/* A fourth kind: a site that is not Cyclograde. The usual "opens elsewhere" arrow after the name,
   smaller than the text, since these links open in a new tab and leave the help behind. */
.help-content a.help-ref-external svg,
.help-content a.help-ref-external i {
    font-size: 0.75em;
    margin-left: 0.15em;
    vertical-align: baseline;
}

/* No nowrap: one inline-flex box already moves whole to the next line rather than break, and its
   label wraps inside it only when wider than the column. On a phone a long label kept on one line
   pushed the help page to 371 px in a 360 px screen. */
.help-content .help-ui-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0 0.55em;
    font-size: 0.85em;
    line-height: 1.7;
    font-weight: 500;
    color: var(--foreground);
    background-color: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: 4px;
    vertical-align: baseline;
    cursor: default;
}

/* Body text is the same grey in the help whether it sits in a paragraph or a list item: the dark
   grey .feature-list gives its items elsewhere made every list in a card read louder than the
   paragraphs around it. Titles (strong) and tables keep their own darker colour. */
.help-content .feature-list li {
    color: inherit;
}

.feature-list li .help-prepare-sticker-options li,
.feature-list li .help-prepare-bullets li {
    display: list-item;
    padding: 0;
    margin-bottom: 0.6rem;
}

.help-prepare-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.help-prepare-image {
    display: block;
    height: 260px;
    width: auto;
    border: 1px solid var(--gray);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* The two photographs that stand on their own rather than in the grid. Centred because
   a single narrow picture left-aligned under a full-width paragraph reads as a stray
   rather than as a figure — most visibly the sticker, which is 94px across. */
.help-prepare-image-single {
    height: auto;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
}

/* A sticker on a tube is a tall narrow strip, so this one is sized by its height.
   Capping the width instead — which is what the wider, angled photograph before it
   needed — made the strip about seven hundred pixels tall. */
.help-prepare-image-sticker {
    height: 320px;
    width: auto;
    max-width: none;
}

/* A tall narrow picture the text flows round, on the right. On a phone the text column would be
   too narrow beside it, so it goes back under the title, centred and shorter. */
.help-prepare-image-aside {
    float: right;
    margin: 0.4rem 0 0.75rem 1.25rem;
}

@media (max-width: 768px) {
    .help-prepare-image-aside {
        float: none;
        margin: 0.75rem 0;
    }

    /* More specific than the phone rule further down that stretches every help picture to the
       full width: the tall sticker strip would come out a metre tall that way. */
    .help-prepare-image-aside .help-prepare-image-sticker {
        height: 240px;
        width: auto;
        max-width: none;
        margin-inline: auto;
    }
}

@media (max-width: 768px) {
    .apropos-story-content .info-card-title {
        margin-top: 1.5rem;
    }

    .apropos-image-block {
        margin-bottom: 1.5rem;
    }

    .apropos-image-gra {
        max-width: 100%;
    }

    .help-prepare-image {
        height: auto;
        width: 100%;
        max-width: 100%;
    }
}

/* ===============================
   LOGIN / AUTH FORMS
   =============================== */

.auth-container {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: block;
    width: auto;
    max-width: 220px;
    height: auto;
    margin: 0 auto 1rem;
}

.auth-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.auth-title-row .auth-title {
    margin-bottom: 0;
}

.auth-title-icon {
    color: var(--primary-dark);
    font-size: 1.25rem;
    line-height: 1;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--gray-dark);
}

.auth-form .field {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.auth-form .input-icon-wrapper {
    position: relative;
}

.auth-form .input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-dark);
}

.auth-form .input-icon-wrapper input {
    padding-left: 3rem;
}

/* ===============================
   IMAGE DISPLAY
   =============================== */

.image-showcase {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.image-showcase img {
    width: 100%;
    height: auto;
    display: block;
}

.image-rounded {
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ===============================
   LISTS
   =============================== */

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--foreground);
    line-height: 1.5;
}

/* A flex item will not shrink below its content's width, so a wide table inside an item pushed
   the whole page sideways on a phone instead of scrolling in its own .table-container. */
.feature-list li > div {
    min-width: 0;
}

/* The column that explains the sample, set apart from the four that are the sheet's own: the
   site's blue, which no Bulma colour class carries. */
.help-crono-example th.help-crono-explain {
    color: var(--secondary-dark);
}

/* A route-sheet line is one line on the sheet; wrapped here it would describe a different strip. */
.help-crono-example td code {
    white-space: nowrap;
}

.feature-list li i {
    color: var(--primary-dark);
    margin-top: 0.25rem;
}

.numbered-list {
    counter-reset: list-counter;
    list-style: none;
    padding: 0;
}

.numbered-list li {
    counter-increment: list-counter;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray);
}

.numbered-list li:last-child {
    border-bottom: none;
}

.numbered-list li::before {
    content: counter(list-counter);
    background: var(--secondary-dark);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ===============================
   PLOT DISPLAY AREA
   =============================== */

.plot-display {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.plot-display img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Submit row: side-by-side button + generation status */
.submit-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.submit-row__status {
    flex: 1;
    min-width: 240px;
    margin: 0;
    padding: 1rem 1.5rem;
}

.submit-row__status .status-message-container {
    padding: 0;
    background: transparent;
    border: none;
    text-align: left;
}

/* ===============================
   MAP CONTAINER
   =============================== */

.map-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ===============================
   RESPONSIVE ADJUSTMENTS
   =============================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .hero-section-modern,
    .page-header {
        padding: 1.25rem 1.25rem;
    }

    .page-header-compact {
        padding: 0.5rem 1rem;
    }

    .page-header-compact .page-title {
        font-size: 1.25rem;
    }

    .page-header-compact .page-subtitle {
        font-size: 0.85rem;
    }

    .page-header-compact .page-subtitle.track-subtitle {
        font-size: 0.95rem;
    }

    .content-section,
    .showcase-section {
        padding: 1.5rem;
    }

    .feature-grid {
        gap: 1.5rem;
    }

    .feature-grid--2x2 {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .cta-section {
        padding: 2rem 1.5rem;
    }

    .cta-title {
        font-size: 1.5rem;
    }
}

/* ===============================
   UTILITY CLASSES
   =============================== */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.text-center { text-align: center; }
.text-muted { color: var(--gray-dark); }

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}

/* Better focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Custom focus indicator for SVG slider to prevent default black border while maintaining accessibility */
svg#speedSlider:focus {
    outline: none;
}

svg#speedSlider:focus-visible {
    outline: 2px dashed var(--primary);
    outline-offset: 4px;
}

/* ===============================
   SPEED PROFILE GRAPH
   =============================== */

.speed-graph-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.speed-graph {
    width: 100%;
    max-width: 550px;
    height: auto;
    min-height: 220px;
}

.speed-graph .speed-point-group {
    cursor: pointer;
}

.speed-graph .speed-point-visible {
    /* No transform on hover - keep point stable */
}

.speed-graph .speed-tooltip {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.speed-graph .speed-point-group:hover .speed-tooltip {
    opacity: 1;
}

.speed-graph-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-dark);
}

.speed-graph-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.speed-graph-legend .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary);
}

.speed-graph-legend .legend-dot.flat {
    background-color: var(--primary);
}

.speed-graph-legend .legend-dot.descent {
    background-color: var(--secondary);
}

.speed-graph-legend .legend-dot.climb {
    background-color: #FF9800;
}

/* ===============================
   ENHANCED FORM ELEMENTS
   =============================== */

/* ---- Shared Base Styles ---- */

/* Base checkbox container styles (shared by .modern-checkbox and .tooltip.bordered) */
.checkbox-container-base,
.modern-checkbox,
.tooltip.bordered {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--gray);
    border-radius: var(--form-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.checkbox-container-base:hover,
.modern-checkbox:hover,
.tooltip.bordered:hover {
    border-color: var(--primary-light);
    background: rgba(76, 175, 80, 0.03);
    box-shadow: 0 4px 12px var(--primary-tint);
}

.checkbox-container-base:has(input:checked),
.modern-checkbox.is-checked,
.modern-checkbox:has(input:checked),
.tooltip.bordered:has(input:checked) {
    border-color: var(--primary);
    background: rgba(76, 175, 80, 0.08);
}

/* Base custom checkbox input styles */
.modern-checkbox input[type="checkbox"],
.tooltip.bordered label.checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    border: 2px solid var(--gray);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.modern-checkbox input[type="checkbox"]:hover,
.tooltip.bordered label.checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-light);
}

.modern-checkbox input[type="checkbox"]:checked,
.tooltip.bordered label.checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
}

/* Shared checkbox checkmark (::after pseudo-element) */
.modern-checkbox input[type="checkbox"]:checked::after,
.tooltip.bordered label.checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: var(--checkbox-checkmark-left);
    top: var(--checkbox-checkmark-top);
    width: var(--checkbox-checkmark-width);
    height: var(--checkbox-checkmark-height);
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Accessibility: Focus-visible states for custom form controls */
.modern-checkbox input[type="checkbox"]:focus-visible,
.tooltip.bordered label.checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.radio-card-wrapper .card-header input[type="radio"]:focus-visible,
label.radio .card .card-header input[type="radio"]:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* ---- Enhanced Select Dropdown ---- */

.select.modern-select {
    border: none;
    padding: 0;
    height: auto;
}

.select.modern-select select {
    border: 2px solid var(--primary);
    border-radius: var(--form-border-radius);
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 280px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: auto;
    line-height: 1.5;
}

.select.modern-select select:hover {
    border-color: var(--secondary-light);
    box-shadow: 0 4px 12px var(--secondary-tint);
}

.select.modern-select select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.15);
    outline: none;
}

.select.modern-select::after {
    border-color: var(--primary);
    border-width: 2px;
    right: 1.25rem;
}

/* ---- Checkbox Icon and Label Styles ---- */

.modern-checkbox .checkbox-icon,
.tooltip.bordered label.checkbox .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-container-size);
    height: var(--icon-container-size);
    border-radius: var(--icon-border-radius);
    background: var(--primary-tint);
    color: var(--primary-dark);
    flex-shrink: 0;
}

.modern-checkbox .checkbox-label {
    font-weight: 500;
    color: var(--foreground);
    flex: 1;
}

.modern-checkbox .checkbox-help {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-top: 0.25rem;
}

/* Tooltip enhanced for checkboxes */
.tooltip.bordered.modern-checkbox {
    position: relative;
}

.tooltip.bordered.modern-checkbox .tooltiptext {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    margin-left: 0;
}

/* Enhanced Radio Button Cards */
/* Supports both .radio-card-wrapper class and label.radio elements */
.radio-card-wrapper,
label.radio {
    display: block;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.radio-card-wrapper .card,
label.radio .card {
    border: 2px solid var(--gray);
    border-radius: var(--card-border-radius);
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
}

.radio-card-wrapper:hover .card,
label.radio:hover .card {
    border-color: var(--primary-light);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.12);
    transform: translateY(-4px);
}

.radio-card-wrapper.is-selected .card,
.radio-card-wrapper:has(input:checked) .card,
label.radio:has(input:checked) .card {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.2);
    background: rgba(76, 175, 80, 0.03);
}

.radio-card-wrapper .card-header,
label.radio .card .card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.75rem;
    background: transparent;
    box-shadow: none;
}

.radio-card-wrapper .card-header input[type="radio"],
label.radio .card .card-header input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    border: 2px solid var(--gray);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.radio-card-wrapper .card-header input[type="radio"]:hover,
label.radio .card .card-header input[type="radio"]:hover {
    border-color: var(--primary-light);
}

.radio-card-wrapper .card-header input[type="radio"]:checked,
label.radio .card .card-header input[type="radio"]:checked {
    border-color: var(--primary);
    background: white;
}

.radio-card-wrapper .card-header input[type="radio"]:checked::after,
label.radio .card .card-header input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: var(--radio-dot-offset);
    top: var(--radio-dot-offset);
    width: var(--checkbox-dot-size);
    height: var(--checkbox-dot-size);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
}

label.radio:has(input:checked) .card .card-header {
    color: var(--primary-text);
}

.radio-card-wrapper .card-content,
label.radio .card .card-content {
    padding: 0.5rem 1.25rem 1.25rem;
}

.radio-card-wrapper .card-content .content,
label.radio .card .card-content .content {
    font-size: 0.9rem;
    color: var(--gray-dark);
    line-height: 1.5;
}

.radio-card-wrapper .card-image,
label.radio .card .card-image {
    margin: 0.5rem 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.radio-card-wrapper .card-image figure {
    margin: 0;
}

/* Grid cell spacing for radio cards */
.grid .cell .radio-card-wrapper,
.grid .cell > label.radio {
    height: 100%;
}

.grid .cell > label.radio .card {
    height: 100%;
}

/* Tooltip-specific styles (non-duplicated) */
.tooltip.bordered {
    width: 100%;
}

/* ---- Plot Style Grid ---- */
/* Cap card width so they don't stretch beyond their 4-col desktop size on narrower layouts */
.plot-style-grid .plot-style-item {
    max-width: 280px;
}

.tooltip.bordered label.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%;
}

.tooltip.bordered label.checkbox .fixed-width-label-200 {
    font-weight: 500;
    color: var(--foreground);
    flex: 1;
    width: auto;
}

.tooltip.bordered label.checkbox input[type="checkbox"] {
    margin-left: auto;
}

.tooltip.bordered .tooltiptext {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    margin-left: 0;
    white-space: normal;
}

/* ---- Time Display Radio Group ---- */

.time-display-radios {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-display-radios label.radio.tooltip.bordered {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
    min-width: 160px;
}

.time-display-radios label.radio.tooltip.bordered .fixed-width-label-200 {
    font-weight: 500;
    color: var(--foreground);
    flex: 1;
    width: auto;
}

.time-display-radios label.radio.tooltip.bordered input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    border: 2px solid var(--gray);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
}

.time-display-radios label.radio.tooltip.bordered input[type="radio"]:hover {
    border-color: var(--primary-light);
}

.time-display-radios label.radio.tooltip.bordered input[type="radio"]:checked {
    background: white;
    border-color: var(--primary);
}

.time-display-radios label.radio.tooltip.bordered input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--checkbox-dot-size);
    height: var(--checkbox-dot-size);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.time-display-radios label.radio.tooltip.bordered input[type="radio"]:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* ===============================
   FORM VALIDATION ERROR STYLING
   =============================== */

/* Fix Issue 1: Ensure validation error messages use consistent font size with the website */
.validation-error.help {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Additional styling for better visibility */
.validation-error.help.is-danger {
    color: var(--danger);
    font-weight: 500;
}

/* ===============================
   LOADING SPINNER FOR FORMS
   =============================== */

/* Fix Issue 3: Loading spinner for form submissions - less intrusive inline version */
.form-loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary-tint);
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    margin-top: 1rem;
}

.form-loading-spinner {
    color: var(--primary-dark);
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.form-loading-spinner div {
    transform-origin: 16px 16px;
}

.form-loading-spinner div:after {
    top: 1.6px;
    left: 14.4px;
    width: 3.2px;
    height: 8.8px;
}

.form-loading-message {
    color: var(--primary-text);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

/* ===============================
   NOTIFICATION POSITIONING
   =============================== */

.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 600px;
    width: 90%;
}

/* ===============================
   UTILITY SPACING CLASSES
   =============================== */

/* Additional margin utilities for specific use cases not covered by mb-1 through mb-5, mt-1 through mt-5 */
/* Note: Use mt-1 (0.5rem), mt-2 (1rem), mt-3 (1.5rem), mt-4 (2rem), mt-5 (3rem) when possible */
.mt-0-375rem { margin-top: 0.375rem; }  /* ~6px at 16px base */
.mt-0-625rem { margin-top: 0.625rem; }  /* ~10px at 16px base */
.pb-0-3em { padding-bottom: 0.3em; }

/* ===============================
   LINK STYLES
   =============================== */

.link-primary {
    color: var(--primary-text);
}

.link-primary:hover {
    text-decoration: underline;
}

/* ===============================
   TEXT ALIGNMENT
   =============================== */

.text-right { text-align: right; }
.text-left { text-align: left; }

/* ===============================
   WIDTH UTILITIES
   =============================== */

.w-100 { width: 100%; }

/* ===============================
   BUTTON UTILITIES
   =============================== */

.btn-justify-center {
    justify-content: center;
}

/* ===============================
   ICON UTILITIES
   =============================== */

.icon-large {
    font-size: 3rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.icon-medium {
    font-size: 1rem;
}

/* ===============================
   FORM STEP NUMBER VARIANTS
   =============================== */

.form-step-number.small {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
}

.form-step-number.secondary {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-darker) 100%);
}

.form-step-number.gray {
    background: var(--gray-dark);
}

/* ===============================
   CARD DESCRIPTION TEXT
   =============================== */

.card-description-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-dark);
}

/* ===============================
   SPEED SLIDER CONTAINER
   =============================== */

.speed-slider-container {
    padding: 1.5rem;
    background: white;
    border: 2px solid var(--gray);
    border-radius: 12px;
}

.speed-slider-label {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

.speed-slider-value {
    color: var(--primary-text);
    font-size: 1.1rem;
}

.speed-slider-svg-container {
    position: relative;
    height: 75px;
}

.speed-slider-svg {
    width: 100%;
    height: 75px;
    cursor: pointer;
}

.speed-slider-point {
    cursor: grab;
}

/* ===============================
   SECTION HEADINGS
   =============================== */

.section-heading {
    margin: 0;
    font-weight: 600;
}

/* ===============================
   CTA SECTION VARIANT
   =============================== */

.cta-section.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
}

/* ===============================
   DIVIDER STYLES
   =============================== */

.divider-top {
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray);
}

.hr-spacious {
    margin: 2rem 0;
}

/* ===============================
   FORM SECTION VARIANTS
   =============================== */

.form-section.highlighted {
    border: 2px solid var(--primary);
    background: rgba(76, 175, 80, 0.03);
}

/* Fix file upload box alignment - ensure CTA and filename have same width */
.file.is-boxed.has-name .file-name {
    max-width: none;
}

/* ===============================
   BUTTON SIZE VARIANTS
   =============================== */

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

/* ===============================
   SECTION PADDING UTILITIES
   =============================== */

.section {
    padding-top: 0.2rem; /* Override Bulma default (3rem) to keep navbar closer to top */
}

.section-compact {
    padding: 0.05rem 1rem 1rem 1rem; /* Minimal top padding for tightest spacing after navbar */
}

/* ===============================
   ALERT / NOTIFICATION BOXES
   =============================== */

.alert-box {
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-box.danger {
    background-color: var(--danger-tint);  /* Using --danger color */
    border: 1px solid var(--danger);
    color: #c0392b;
}

.alert-box.success {
    background-color: var(--primary-tint);  /* Using --primary color for success */
    border: 1px solid var(--primary);
    color: var(--primary-text);
}

.alert-box.info {
    background-color: var(--secondary-tint);  /* Using --secondary color for info */
    border: 1px solid var(--secondary);
    color: var(--secondary-dark);
}

.alert-box.warning {
    background-color: rgba(243, 156, 18, 0.1);
    border: 1px solid #f39c12;
    color: #d68910;
}

/* ===============================
   LINK UTILITIES
   =============================== */

.link-bold {
    font-weight: 500;
}

/* ===============================
   TABLE UTILITIES
   =============================== */

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

.table-narrow {
    max-width: 500px;
    border: 1px solid var(--gray);
}

.table-header-center {
    text-align: center;
    border-bottom: 2px solid var(--gray);
}

.table-cell-center {
    text-align: center;
    padding: 0.5rem;
}

.table-row-light {
    border-bottom: 1px solid var(--gray-light);
}

.input-narrow-centered {
    max-width: 120px;
    margin: 0 auto;
}

/* ===============================
   ERROR PAGE STYLES
   =============================== */

.page-header.error {
    background: linear-gradient(135deg, var(--danger-tint) 0%, rgba(255, 152, 0, 0.1) 100%);
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--danger);
    line-height: 1;
    margin-bottom: 1rem;
}

.page-title.error {
    color: var(--danger);
}

/* ===============================
   MAP CONTAINER
   =============================== */

.map-full {
    width: 100%;
    height: 700px;
    margin-bottom: 0;
}

/* Map + side panel layout */
.map-with-side-panel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
}

.map-with-side-panel .map-full {
    flex: 1;
    min-width: 320px;
    width: auto;
}

.map-with-side-panel > .map-wrapper {
    flex: 1;
    min-width: 320px;
    position: relative;
}

.map-with-side-panel > .map-wrapper .map-full {
    width: 100%;
}

.places-side-panel {
    /* Its own column down the left of the page now, so it no longer needs to order itself
       within the map row, and no longer has a height tied to the map's. */
    /* Wide enough for a name: at 280 "Villard-Bonnot [Maison des Délices]" was three dots after
       the first word, and the list is the thing this panel is for. */
    width: 340px;
    flex-shrink: 0;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 70px;
    overflow-y: auto;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    font-size: 12px;
}

.places-side-panel .control-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.places-side-panel .place-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0;
    padding: 5px 6px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* The elevation panel's lines reuse the place lines, but a reason is a sentence, not a name: it
   wraps instead of ending in an ellipsis on one line (owner, 2026-11-09, the Marmotte's eleven
   suggestions, every one cut). A flatten's reason is a button that shows its stretch. */
.places-side-panel .elevation-proposal .place-name-display,
.places-side-panel .elevation-op .place-name-display {
    white-space: normal;
    overflow: visible;
    line-height: 1.35;
}
.places-side-panel .elevation-proposal-show {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 11px;
    line-height: 1.35;
    text-align: left;
    color: inherit;
    cursor: pointer;
}
.places-side-panel .elevation-proposal-show:hover,
.places-side-panel .elevation-proposal-show:focus-visible {
    text-decoration: underline;
}
.places-side-panel .elevation-proposal.is-shown {
    background: #e3f0fc;
    box-shadow: inset 4px 0 0 #1e88e5;
}

/* A point's number: the same badge in the editor's list, on the track's page, in the lists of the
   places pages and in a map tooltip. */
.places-side-panel .place-number,
.placesearch-rows .place-number,
.map-tooltip .place-number {
    background-color: var(--secondary-dark);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: bold;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.places-side-panel .place-number[onclick],
.places-side-panel button.place-number {
    cursor: pointer;
}

.places-side-panel button.place-number:hover {
    background-color: var(--secondary-darker);
}

.places-side-panel .place-icon {
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

/* The icons of a place's extra types, after the primary's and quieter: what else the spot is
   (ADR-0042). In the panels and in the catalogue list's type cell alike. */
.places-side-panel .place-icon.place-extra-icon,
.place-extra-icon {
    color: #999;
    font-size: 11px;
}

/* showtrack: read-only name span */
.places-side-panel .place-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.places-side-panel .place-secondary {
    font-size: 10px;
    color: #888;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* edittrack: name display span */
.places-side-panel .place-name-display {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* edittrack: action buttons. Shown or hidden and edit are the same light grey, as an edit is
   everywhere else on the site: the red of the delete is the one colour of a row (owner,
   2026-11-19). */
.places-side-panel .edit-btn,
.places-side-panel .visibility-btn {
    background-color: #f5f5f5;
    color: #363636;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}

.places-side-panel .edit-btn:hover,
.places-side-panel .visibility-btn:hover {
    background-color: #e8e8e8;
}

/* The camera that opens the pictures of the spot on Panoramax: no wider than its glyph, so the
   name keeps the room it had. */
.places-side-panel .place-panoramax {
    color: var(--secondary-dark);
    padding: 0 2px;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}

.places-side-panel .place-panoramax:hover {
    color: var(--secondary-darker);
}

/* The catalogue map's markers: the type's icon in a disc of the type's colour, a kept point
   filled and a candidate outlined, a priority point ringed (ADR-0041 §4). Named with
   Leaflet's own class so these rules win over leaflet.css, which the page loads after this file. */
.leaflet-marker-icon.trackpoint-marker {
    position: absolute;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --tp-colour: #607D8B;
}

/* Font Awesome swaps the <i> for an inline SVG on a text baseline: pinned at the disc's centre
   by its own middle, whatever the baseline or the icon's width (owner, 2026-10-23). */
.leaflet-marker-icon.trackpoint-marker svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 13px;
    margin: 0;
    transform: translate(-50%, -50%);
}

.trackpoint-disc.is-kept {
    background: var(--tp-colour);
    color: white;
}

.trackpoint-disc.is-candidate {
    background: white;
    color: var(--tp-colour);
    border-color: var(--tp-colour);
}

/* A waypoint of a GPX file: outlined and dashed, the generic colour, until it is adopted. */
.trackpoint-disc.is-waypoint {
    background: white;
    color: #C2185B;
    border: 2px dashed #C2185B;
}

/* How many waypoints a marker stands for, when the file stacks several at one spot: a small
   count on the disc's shoulder (ADR-0042). */
.trackpoint-marker .trackpoint-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: #C2185B;
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    box-sizing: border-box;
}

/* A candidate or a file's spot kept already (owner, 2026-10-27): its icon faded and its edge
   dotted, with a green tick on the shoulder the count badge leaves free, which still shows when
   the kept point is drawn over it. */
.trackpoint-disc.is-adopted {
    border-style: dotted;
}

.trackpoint-disc.is-adopted > svg,
.trackpoint-disc.is-adopted > i {
    opacity: 0.4;
}

.trackpoint-marker .trackpoint-adopted {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #27AE60;
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

/* One colour per family of types: places, landmarks, food and drink, the services, the manual
   types. A café and a church tell apart at a glance; two kinds of bread do not need to. */
.trackpoint-disc.is-type-city, .trackpoint-disc.is-type-village,
.trackpoint-disc.is-type-hamlet, .trackpoint-disc.is-type-isolated { --tp-colour: #1F4E99; }
.trackpoint-disc.is-type-pass { --tp-colour: #7A4E2D; }
.trackpoint-disc.is-type-town_hall { --tp-colour: #6A3FA0; }
.trackpoint-disc.is-type-church { --tp-colour: #5D6D7E; }
.trackpoint-disc.is-type-rail_station { --tp-colour: #37474F; }
.trackpoint-disc.is-type-city_limit, .trackpoint-disc.is-type-city_entry,
.trackpoint-disc.is-type-city_exit { --tp-colour: #455A64; }
.trackpoint-disc.is-type-cafe, .trackpoint-disc.is-type-bakery,
.trackpoint-disc.is-type-restaurant, .trackpoint-disc.is-type-supermarket { --tp-colour: #E67E22; }
.trackpoint-disc.is-type-pharmacy { --tp-colour: #C0392B; }
.trackpoint-disc.is-type-hotel { --tp-colour: #148F77; }
.trackpoint-disc.is-type-water_point { --tp-colour: #2E86DE; }
.trackpoint-disc.is-type-food_supply { --tp-colour: #27AE60; }
.trackpoint-disc.is-type-repair_shop { --tp-colour: #B9770E; }
.trackpoint-disc.is-type-generic { --tp-colour: #C2185B; }
.trackpoint-disc.is-type-other { --tp-colour: #607D8B; }

/* The line beside the candidates button lights up on every update, so a second failure after a
   first one reads as a new answer and not as the old line left behind. */
@keyframes trackpoints-hint-flash {
    from { background-color: #ffdd57; }
    to { background-color: transparent; }
}

.trackpoints-hint.is-fresh {
    animation: trackpoints-hint-flash 1.2s ease-out;
    border-radius: 3px;
    padding: 0 4px;
}

/* The map page's features above it, one box each under its name, the boxes of a row as tall as
   the tallest so their edges line up (owner, 2026-10-27). */
.trackpoints-tool {
    height: 100%;
}

/* A long file name shrinks to its ellipsis rather than pushing a phone's page sideways. */
.trackpoints-tool .file,
.trackpoints-tool .file-label {
    max-width: 100%;
}

.trackpoints-tool .file-name {
    min-width: 0;
}

.trackpoints-tool-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

/* The map's save line rings on every answer: a second adoption reads the same words. */
@keyframes trackpoints-notice-ring {
    from { box-shadow: 0 0 0 3px #ffdd57; }
    to { box-shadow: 0 0 0 3px transparent; }
}

.trackpoints-notice.is-fresh {
    animation: trackpoints-notice-ring 1.2s ease-out;
}

/* The passes map (ADR-0048): a colour per state, set here once; the legend's swatches read them
   as classes and passes-map.js reads them for the points it draws on the canvas. */
.passes-page {
    --pass-seed: #2b6cb0;
    --pass-edited: #c05621;
    --pass-added: #2f855a;
    --pass-unnamed: #4a5568;
    --pass-deleted: #c53030;
    /* The passes of the outside lists, which are not the table's: a ring each, of another hue. */
    --pass-source-ign: #6b46c1;
    --pass-source-osm: #0e7490;
}

.pass-swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border-radius: 50%;
    vertical-align: middle;
}

.pass-swatch.is-seed { background: var(--pass-seed); }
.pass-swatch.is-edited { background: var(--pass-edited); }
.pass-swatch.is-added { background: var(--pass-added); }
/* A ring, as on the map: a pass without a name, or deleted, is not proposed on a track. */
.pass-swatch.is-unnamed { border: 2px solid var(--pass-unnamed); }
.pass-swatch.is-deleted { border: 2px solid var(--pass-deleted); }
.pass-swatch.is-source-ign { border: 3px solid var(--pass-source-ign); }
.pass-swatch.is-source-osm { border: 3px solid var(--pass-source-osm); }

/* The IGN's importances, one small box each on a line under its list. */
.passes-side-panel .passes-importances {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.6rem;
    padding: 2px 0 4px 1.4rem;
    font-size: 12px;
}

.passes-side-panel .passes-importances-label {
    flex-basis: 100%;
    color: #555;
}

.passes-side-panel .passes-importance input[type="checkbox"] {
    margin-right: 0.15rem;
}

.passes-side-panel .passes-legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.2;
}

.passes-side-panel .passes-legend-row input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}

.passes-side-panel .passes-legend-count {
    margin-left: auto;
    color: #555;
}

.passes-side-panel .passes-list {
    margin: 0;
    list-style: none;
}

.passes-side-panel .passes-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 4px 6px;
    border: none;
    border-radius: 3px;
    background: none;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.passes-side-panel .passes-row:hover,
.passes-side-panel .passes-row:focus-visible,
.passes-side-panel .passes-row.is-selected {
    background: #e3f0fc;
}

.passes-side-panel .passes-row-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.passes-side-panel .passes-row-kind {
    color: #555;
    font-size: 11px;
}

.passes-side-panel .passes-row-meta {
    flex-shrink: 0;
    color: #555;
    font-size: 12px;
}

/* A panel each side of the map, narrower than the editor's so that the map keeps its room. */
.places-side-panel.passes-side-panel {
    width: 300px;
}

/* On a phone the list is the page's own length, not a 300 px window to scroll inside. */
@media (max-width: 960px) {
    .places-side-panel.passes-side-panel {
        width: 100%;
        max-height: none;
        position: static;
    }

    /* In one column the map comes first, then the pass picked, then the list. */
    .passes-page .map-with-side-panel .map-full { order: 1; }
    .passes-page .passes-detail-panel { order: 2; }
    .passes-page .passes-list-panel { order: 3; }
}

.passes-side-panel .pass-detail {
    font-size: 13px;
}

/* The marker to drag: a ring over the pass's disc, wide enough for a finger. */
.pass-handle {
    box-sizing: border-box;
    border: 3px solid #000;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

.pass-handle:active {
    cursor: grabbing;
}

.passes-side-panel .pass-detail-empty {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.passes-side-panel .pass-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.passes-side-panel .pass-detail-title {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.passes-side-panel .pass-detail .field {
    margin-bottom: 0.5rem;
}

.passes-side-panel .pass-detail-pictures {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

/* The history of the pass picked: a line per change, what it changed indented under it. */
.passes-side-panel .pass-history-show {
    height: auto;
    padding: 0;
}

.passes-side-panel .pass-history {
    margin: 0.5rem 0 0;
    list-style: none;
    font-size: 12px;
    line-height: 1.4;
}

.passes-side-panel .pass-history-head {
    margin-top: 0.4rem;
    font-weight: 600;
}

.passes-side-panel .pass-history-detail {
    padding-left: 0.75rem;
    overflow-wrap: anywhere;
}

.passes-side-panel .pass-history-none {
    color: #555;
}

.pass-detail-facts {
    margin-bottom: 0.5rem;
    background: none;
}

.pass-detail-facts th {
    width: 50%;
    font-weight: 600;
}

/* The map page's type panel: a line per candidate type, box, disc, name, in a column that
   lines up because the disc has one fixed size and the box one fixed width. */
.trackpoints-side-panel {
    width: 260px;
}

.trackpoints-side-panel .trackpoints-type-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.2;
}

.trackpoints-side-panel .trackpoints-type-row input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}

.trackpoint-swatch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --tp-colour: #607D8B;
}

.trackpoint-swatch svg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 11px;
    margin: 0;
    transform: translate(-50%, -50%);
}

.trackpoint-marker.is-priority {
    box-shadow: 0 0 0 3px #ffdd57, 0 1px 3px rgba(0, 0, 0, 0.4);
}

.places-side-panel .delete-btn {
    background-color: var(--danger-dark);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
}

.places-side-panel .delete-btn:hover {
    background-color: var(--danger-darker);
}

@media (max-width: 960px) {
    .map-with-side-panel {
        flex-direction: column;
    }

    /* Reset flex so the map uses its intrinsic height: 700px (flex: 1 in
       column mode collapses height to 0 when the container is auto-height) */
    .map-with-side-panel .map-full {
        flex: none;
        width: 100%;
        height: 700px;
    }

    .map-with-side-panel > .map-wrapper {
        flex: none;
        width: 100%;
    }

    .places-side-panel {
        width: 100%;
        height: auto;
        max-height: 300px;
        flex-shrink: 1;
    }
}

.elevation-profile-container {
    width: 100%;
    margin-bottom: 1em;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    background: var(--background);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Custom elevation chart theme — neutral grey */
.cyclograde-theme {
    --ele-bg: rgba(180, 180, 180, 0.15);
    --ele-axis: var(--gray-dark);
    --ele-area: #9e9e9e;
    --ele-brush: rgba(120, 120, 120, 0.25);
    --ele-line: #757575;
}

/* The climbs on the chart, over the grey area, in the colours of the climb list beside it (the
   --difficulty-* of main.css; owner, 2026-11-04). Drawn by frontend/track-elevation-profile.js. */
.cyclograde-theme .area path.cyclograde-climb {
    fill: var(--ele-area);
    fill-opacity: 0.7;
    stroke: none;
    pointer-events: none;
}
/* A suggestion's stretch on the chart, the blue of its halo on the map (frontend/edit-track.js). */
.cyclograde-theme .area rect.cyclograde-stretch-band {
    fill: #1e88e5;
    fill-opacity: 0.3;
    stroke: #1e88e5;
    stroke-width: 2;
    pointer-events: none;
}
.cyclograde-theme .area path.cyclograde-climb.cat4 { fill: var(--difficulty-cat4); }
.cyclograde-theme .area path.cyclograde-climb.cat3 { fill: var(--difficulty-cat3); }
.cyclograde-theme .area path.cyclograde-climb.cat2 { fill: var(--difficulty-cat2); }
.cyclograde-theme .area path.cyclograde-climb.cat1 { fill: var(--difficulty-cat1); }
.cyclograde-theme .area path.cyclograde-climb.hc { fill: var(--difficulty-hc); }

/* ===============================
   WELCOME PAGE STYLES
   =============================== */

.welcome-icon {
    font-size: 5rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.welcome-message-box {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--primary-tint);
    border-radius: 12px;
}

.welcome-message-text {
    color: var(--foreground);
    line-height: 1.7;
}

.icon-text-primary {
    color: var(--primary-dark);
    margin-right: 0.5rem;
}

/* ===============================
   PRICING TABLE ICONS
   =============================== */

.icon-check-primary {
    color: var(--primary-dark);
}

.icon-times-danger {
    color: var(--danger);
}

/* ===============================
   MAP VARIANTS
   =============================== */

.map-medium {
    width: 100%;
    height: 500px;
    margin-bottom: 2rem;
}

/* ===============================
   IMAGE UTILITIES
   =============================== */

.img-half {
    width: 50%;
    height: auto;
}

.img-full {
    width: 100%;
    height: auto;
}

.img-cover-300 {
    object-fit: cover;
    height: 300px;
    width: 100%;
}

/* ===============================
   TEXT SIZE UTILITIES
   =============================== */

.text-sm {
    font-size: 0.9rem;
}

/* ===============================
   PADDING UTILITIES
   =============================== */

.pb-0-3em,
.pb-03em {  /* legacy alias */
    padding-bottom: 0.3em;
}

/* ===============================
   TABLE COLUMN WIDTHS
   =============================== */

.w-40 { width: 40%; }
.w-60 { width: 60%; }


.status-message-container {
    text-align: center;
    padding: 2rem;
    background: var(--primary-tint);
    border: 2px solid var(--primary-light);
    border-radius: 10px;
}

.status-message-primary {
    font-size: 1.1rem;
    color: var(--primary-text);
}

.status-message-muted {
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-top: 0.5rem;
}

.status-icon {
    margin-right: 0.5rem;
}

/* ===============================
   HELP PAGE STYLES
   =============================== */

/* ---- The table of contents, beside the text ----
   A grid of two columns from Bulma's desktop breakpoint up: the list, sticky under the navbar
   and scrolling on its own when longer than the window, and the text. One column below it, the
   list first — folded, because open it is a whole screen of links before a word of help. The
   text keeps its measure: the list sits beside it, not inside it. */
.help-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.help-toc {
    background-color: var(--gray-light);
    border-left: 4px solid var(--secondary);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.help-toc summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary);
}

.help-toc ul {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.help-toc ul ul {
    margin: 0.15rem 0 0.4rem 0.9rem;
    font-size: 0.88em;
}

.help-toc a {
    display: block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--foreground);
    text-decoration: none;
}

.help-toc a:hover {
    background-color: white;
}

.help-toc a[aria-current="location"] {
    background-color: white;
    color: var(--secondary-dark);
    font-weight: 600;
}

.help-toc ul ul ul {
    margin-left: 0.7rem;
    font-size: 0.95em;
}

/* Sections numbered by the stylesheet, not written in the templates: the publishing section is
   shown to publishers only, and a number written by hand would leave a gap for everyone else. The
   contents count the same way, so an entry and its title carry the same number. The icon comes
   first in the title, before the number. */
.help-content {
    counter-reset: help-section;
}

.help-content > .content-section {
    counter-increment: help-section;
}

.help-content > .content-section > .content-section-title::before {
    content: counter(help-section) ".";
}

.help-content > .content-section > .content-section-title > :is(i, svg) {
    order: -1;
}

#help-toc-list {
    counter-reset: help-toc;
}

#help-toc-list > li {
    counter-increment: help-toc;
}

#help-toc-list > li > a::before {
    content: counter(help-toc) ". ";
}

/* A sub-section: a level down, drawn inside its section rather than as a card of its own —
   the catalogue and the quality of a GPX are two ways of getting a track, not two chapters. */
.content-section.is-sub {
    box-shadow: none;
    border-radius: 0;
    border-left: 3px solid var(--gray);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 2rem 0 0;
}

.content-section-title.is-sub {
    font-size: 1.25rem;
}

/* The page's name in its own column, a third of the row, wrapping when it must: on a phone a
   name that will not wrap is a table that will not fit. */
/* A page as the reader will see it, full width of the text, framed. */
.help-screenshot-block {
    margin: 0.75rem 0 1rem;
}

.help-screenshot {
    display: block;
    width: 100%;
    border: 1px solid var(--gray);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.help-sitemap-table th {
    width: 32%;
}

.help-glossary dt {
    font-weight: 600;
    margin-top: 0.75rem;
}

.help-glossary dd {
    margin-left: 0;
    color: var(--gray-dark);
}

/* A jump from the list lands under the fixed navbar, not behind it. */
.help-content .content-section,
.help-content [id] {
    scroll-margin-top: 80px;
}

@media screen and (min-width: 1024px) {
    .help-layout {
        grid-template-columns: 16rem minmax(0, 1fr);
    }

    .help-toc {
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    /* Always open beside the text: the summary is a heading here, not a toggle. */
    .help-toc summary {
        pointer-events: none;
        list-style: none;
    }

    .help-toc summary::-webkit-details-marker {
        display: none;
    }
}

/* Section spacing utilities */
.section-intro {
    margin-bottom: 1.5rem;
}

.section-tip {
    margin-top: 1.5rem;
}

/* A track's area, one value a line and never split across two (owner, 2026-10-28). */
.track-area {
    white-space: nowrap;
}

/* Image modal/lightbox */
.image-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* The full track description, opened from the catalogue's blurb. Shares the .image-modal backdrop
   with the plot lightbox and swaps the image for a readable panel: prose needs a light ground, a
   measure it can be read at, and its own scrollbar when it is long. */
.description-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 44rem;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    animation: zoomIn 0.3s;
}

.description-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* A link, not a button: it sits inside a sentence and a button's box would break the line. */
.description-more {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--primary-text);
    text-decoration: underline;
    cursor: pointer;
}

.description-more:hover {
    text-decoration: none;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 95vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.2s;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
}

/* ===============================
   CONTEXTUAL HELP MODAL
   =============================== */

/* Help Button */
.help-button {
    background: transparent;
    border: none;
    color: #ff6b35; /* Orange color for better visibility */
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.help-button:hover {
    color: #ff4500; /* Darker orange on hover */
    transform: scale(1.1);
}

.help-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Help Modal */
.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.help-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray);
}

.help-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-modal-title i {
    color: var(--primary-dark);
}

.help-modal-close {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-close:hover {
    color: var(--gray-dark);
}

.help-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    color: var(--gray-dark);
    line-height: 1.6;
}

.help-modal-body p {
    margin-bottom: 1rem;
}

/* Bullets back on the unordered list: Bulma strips them from every list. */
.help-modal-body ul {
    list-style: disc;
}

.help-modal-body ul,
.help-modal-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-modal-body li {
    margin-bottom: 0.5rem;
}

.help-modal-body strong {
    color: var(--gray-dark);
    font-weight: 600;
}

.help-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray);
    text-align: right;
}

.help-modal-link {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.help-modal-link:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .help-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }

    .help-modal-header,
    .help-modal-body,
    .help-modal-footer {
        padding: 1rem;
    }
}

/* ===============================
   PROFILE PLOT ZOOM CONTROLS
   =============================== */

.plot-expand-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.plot-controls-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Responsive adjustments for showtrack button bar */
@media (max-width: 768px) {
    .plot-expand-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* The row of buttons under a track page's title (_trackNav, and the track page's own bar), on
       the pages that give their content no side gutter of their own: on a phone it sat on the
       screen edge. The same 0.75 rem as the cards of the device export. The editor's container
       already carries a 1 rem gutter (px-4), so the row takes none there. */
    .track-nav {
        padding: 0 0.75rem;
    }

    #ractive-container.px-4 .track-nav {
        padding: 0;
    }
}


#plotfile {
    width: 100%;
    display: block;
}

.plotfile-wrapper {
    position: relative;
    display: block;
    margin-bottom: 0.75rem;
}

/* The profile as an inline SVG, hovered over (ADR-0033). Absent for a track drawn before the
   engine existed: the image above stays visible and none of this applies. */
#profile-interactive {
    position: relative;
    display: block;
}

.profile-svg {
    width: 100%;
    height: auto;
    display: block;
    touch-action: pan-y;
}

#profile-interactive.is-interactive .profile-svg {
    cursor: crosshair;
}

.profile-crosshair {
    display: none;
    pointer-events: none;
}

.profile-crosshair.is-visible {
    display: block;
}

.profile-crosshair line {
    stroke: var(--profile-hover);
    stroke-width: 2;
    stroke-dasharray: 8 6;
}

.profile-crosshair circle {
    fill: var(--profile-hover);
}

/* Everything drawn for the place or the climb under the pointer, lifted off the page together. */
.profile-hot {
    filter: drop-shadow(0 0 4px var(--profile-hover));
}

/* On paper the drawing is the PNG: it is the file the rider downloads, at print resolution, and
   the hover layer has nothing to offer a sheet of paper. */
@media print {
    #profile-interactive {
        display: none;
    }

    /* Forced because the [hidden] rule above is forced too, and only a forced rule of higher
       specificity can bring the image back on paper. */
    #plotfile[hidden] {
        display: block !important;
    }
}

/* The chart under the map answers a click with a point on the track, the way the map does. The
   rectangle the chart listens on is the band over the curve, not the whole container. */
.elevation-profile-container.is-pickable .overlay {
    cursor: crosshair;
}

/* ---- The edit page's picked point and its panel (ADR-0033) ---- */

/* A place on the map: a numbered disc, the same number as in the list and on the chart. Filled,
   not the hollow ring it replaced — on a tile a ring reads as a hole, a disc as a mark — and a
   white edge so it stands on a road of any colour. Two classes: leaflet.css is loaded after this
   file on the edit page and sets every marker icon to display: block, which on one class alone
   would win on order and leave the number in the disc's top-left corner. */
.leaflet-marker-icon.place-marker,
.place-marker-disc {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: #209cee;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* A place sharing its spot with an earlier one: a sixty-pixel box centred on the spot, the line
   drawn across it and the disc set in one corner of it. The corners are the four sides the edit
   page steps aside to, in its own order. The box itself keeps Leaflet's own positioning — it is
   already absolute, and made relative it fell into the pane's flow and stacked under its
   neighbours, thirty pixels off its spot for each one before it. */
.place-marker-offset svg {
    position: absolute;
    left: 0;
    top: 0;
}

.place-marker-offset line {
    stroke: #209cee;
    stroke-width: 2;
}

/* The box covers the disc on the spot and its neighbours: only the disc set aside answers the
   pointer, so that the hover of a disc under the box says that disc and not this one. */
.leaflet-marker-icon.place-marker-offset.leaflet-interactive {
    pointer-events: none;
}

.leaflet-marker-icon.place-marker-offset.leaflet-interactive .place-marker-disc {
    pointer-events: auto;
}

/* Above the line, whatever the paint order does. */
.place-marker-disc {
    position: absolute;
    z-index: 1;
}

.place-marker-disc.is-ne { left: 42px; top: 6px; }
.place-marker-disc.is-se { left: 42px; top: 36px; }
.place-marker-disc.is-nw { left: 0; top: 6px; }
.place-marker-disc.is-sw { left: 0; top: 36px; }

/* A pin on the picked point, not a bubble of text. The glyph sits on the text baseline by
   default, which would hang its point below the place it marks. Near-black: the green it was
   drawn in vanished into the map's own greens. */
.selected-point-pin {
    display: block;
    margin: 0 auto;
    vertical-align: bottom;
    font-size: 22px;
    color: var(--foreground);
}

/* Leaflet reserves twenty pixels under every popup for the tip of the bubble, and there is no
   bubble here. Without this the pin floats that far above the point it marks, which is worse
   than the sentence it replaced. Two classes, because leaflet.css is loaded after this file on
   the edit page and its own .leaflet-popup rule would otherwise win on order alone. */
.leaflet-popup.selected-point-popup {
    margin-bottom: 0;
}

.selected-point-popup .leaflet-popup-content-wrapper {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* The width is the pin's, because Leaflet centres the container on the point: any other width
   carries the pin off to one side by half the difference. */
.selected-point-popup .leaflet-popup-content {
    margin: 0;
    line-height: 1;
    text-align: center;
}

.selected-point-popup .leaflet-popup-tip-container {
    display: none;
}

/* One row at the foot of the options panel: the two buttons and the help mark beside them, rather
   than three full-width things stacked. */
.panel-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.panel-actions .button {
    flex: 0 1 auto;
    min-width: 0;
}

.panel-actions .help-button {
    flex: 0 0 auto;
    margin: 0;
}

/* The drawing, in its own view of the editor. */
.edittrack-summary-plot {
    position: relative;
    margin-bottom: 1rem;
}

.profile-readout {
    position: absolute;
    top: 0.25rem;
    transform: translateX(-50%);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbdbdb;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
}

.plotfile-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

/*
 * The mark in the header keeps its shape.
 *
 * It was drawn 140 px wide and whatever height the box gave it, which came out 59: the round of
 * the logo rendered as an ellipse 32 by 41 (2026-09-20). Pinning the height to the navbar's band
 * and letting the width follow is the way round it that survives a change of logo, the mark having
 * grown wider when its word was enlarged.
 */
.navbar-brand img.navbar-item {
    width: auto;
    height: 2.6rem;
    max-height: none;
    padding-block: 0;
}

.landing-logo-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.85rem 0 0.35rem;
}

.landing-logo-bar a {
    display: inline-flex;
    align-items: center;
}

.landing-logo-bar img {
    display: block;
    width: 150px;
    height: auto;
}

.landing-page-promo,
.landing-page-cta {
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.9rem;
}

.landing-page-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    background: white;
    border: 1px solid color-mix(in srgb, var(--secondary) 16%, white);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.landing-page-promo-copy,
.landing-page-cta-copy {
    flex: 1 1 420px;
}

.landing-page-promo-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-dark, var(--secondary));
}

.landing-page-promo-text,
.landing-page-cta-text {
    margin: 0;
    color: var(--foreground);
    line-height: 1.55;
}

.landing-page-promo-text {
    font-size: 0.98rem;
}

.landing-page-promo-actions,
.landing-page-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.landing-page-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 18%, white) 0%, color-mix(in srgb, var(--accent-blue-light) 40%, white) 100%);
    border: 1px solid color-mix(in srgb, var(--secondary) 24%, white);
}

/* Every group of the catalogue is its own table under its own heading, and a table sizes its
   columns from its own rows — so the name column started in one place under June and another under
   the editions already ridden, and at ten months the page was ten different grids. Fixed widths
   give every group one geometry, whatever happens to be in it. */
.catalogue-table {
    table-layout: fixed;
}

/* A picture of a button inside a sentence: looks like the real one, does nothing. */
.button-sample { pointer-events: none; cursor: default; vertical-align: baseline; }

/* Five columns since the elevation profile's (owner, 2026-10-26), their widths adding to 100%: the
   four of before, kept at 100% with a fifth added, pushed the table past its box. Below 36rem the
   table keeps that width and its box scrolls, rather than squeezing a date into two lines. */
.catalogue-table { min-width: 36rem; }
.catalogue-table th:nth-child(1), .catalogue-table td:nth-child(1) { width: 14%; }
.catalogue-table th:nth-child(2), .catalogue-table td:nth-child(2) { width: 32%; }
.catalogue-table th:nth-child(3), .catalogue-table td:nth-child(3) { width: 18%; }
.catalogue-table th:nth-child(4), .catalogue-table td:nth-child(4) { width: 22%; }
.catalogue-table th:nth-child(5), .catalogue-table td:nth-child(5) { width: 14%; }

/* Costs nothing, asks for nothing — the line that has to be read before a signup button is worth
   reading at all. */
.landing-page-cta-note {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    color: var(--gray-dark);
}

.landing-page-cta-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--foreground);
}

.landing-page-cta-text {
    font-size: 0.96rem;
    max-width: 44rem;
}

.plotfile-target {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--foreground);
}

.plotfile-expand-btn {
    background: var(--background, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 7px;
    padding: 0.3rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--foreground);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s ease;
}

.plotfile-expand-btn:hover {
    background: var(--hover-background, #f5f5f5);
    opacity: 1;
}

.leaflet-control-zoom-level {
    background: rgba(255, 255, 255, 0.75);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #555;
    pointer-events: none;
    box-shadow: none;
    border: none;
}

@media (max-width: 768px) {
    .landing-logo-bar {
        padding-top: 0.65rem;
    }

    .landing-logo-bar img {
        width: 132px;
    }

    .landing-page-promo,
    .landing-page-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    /* The 420px basis is a width, for the side-by-side layout above this breakpoint. Once the
       block stacks, the main axis is vertical and the same number becomes a minimum height: three
       lines of text in a 420px box, and a call to action 582px tall on a 390px phone — the exact
       figure this page was reshaped to get rid of, reappearing at the bottom instead of the top. */
    .landing-page-promo-copy,
    .landing-page-cta-copy {
        flex: 0 1 auto;
    }

    .landing-page-promo-actions,
    .landing-page-cta-actions {
        width: 100%;
    }

    .landing-page-promo-actions .button,
    .landing-page-cta-actions .button {
        width: 100%;
        justify-content: center;
    }
}

.plot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.plot-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--foreground);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background-color 0.2s ease;
}

.plot-lightbox-close:hover {
    background-color: var(--gray-light);
}

.plot-lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}

/* ============================================================
   Climbs Section (showtrack page)
   ============================================================ */

.climbs-section {
    margin: 1rem 0;
}

.climbs-section-header {
    display: flex;
    align-items: center;
    /* The title, one badge per difficulty and the view toggle, on one line that could not wrap. A
       track with several categories of climb pushed the toggle 149px past the right edge of a
       390px screen, and because the row is in the page rather than in a scroller, the whole page
       scrolled sideways with it. */
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.climbs-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-dark);
    margin: 0;
}

.climbs-section-title i {
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.climbs-count-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    line-height: 1.4;
    color: white;
}

.climbs-count-badge--cat4 {
    background: var(--difficulty-cat4);
}

.climbs-count-badge--cat3 {
    background: var(--difficulty-cat3);
}

.climbs-count-badge--cat2 {
    background: var(--difficulty-cat2);
}

.climbs-count-badge--cat1 {
    background: var(--difficulty-cat1);
}

.climbs-count-badge--hc {
    background: var(--difficulty-hc);
}

.climbs-empty {
    font-size: 0.85rem;
    color: var(--gray-dark);
    font-style: italic;
    padding: 0.4rem 0;
}

.climbs-summary {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.6rem 0 0.9rem;
    border-bottom: 1px solid var(--gray);
    margin-bottom: 0.9rem;
}

.climbs-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.climbs-summary-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-dark);
}

.climbs-summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

/* ===============================
   SIMPLE CLIMBS LIST VIEW
   =============================== */

.climbs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.climb-row {
    overflow: hidden;
}

.climb-row-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-light);
}

.climb-row-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.8rem;
    height: 1.6rem;
    padding: 0 0.45rem;
    border-radius: 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
}

.climb-row--cat4  .climb-row-badge { background: var(--difficulty-cat4); }
.climb-row--cat3  .climb-row-badge { background: var(--difficulty-cat3); }
.climb-row--cat2  .climb-row-badge { background: var(--difficulty-cat2); }
.climb-row--cat1  .climb-row-badge { background: var(--difficulty-cat1); }
.climb-row--hc    .climb-row-badge { background: var(--difficulty-hc); }

/* The same badge away from the climb list, where there is no .climb-row-- to hang the colour on:
   the route sheet's climb picker, where a rider ticks the climbs one by one. It carries the colour
   itself so the scale is the one they have just read on the track page, learnt once. */
.climb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.8rem;
    height: 1.4rem;
    padding: 0 0.45rem;
    border-radius: 0.7rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
    vertical-align: middle;
}

.climb-badge--cat4 { background: var(--difficulty-cat4); }
.climb-badge--cat3 { background: var(--difficulty-cat3); }
.climb-badge--cat2 { background: var(--difficulty-cat2); }
.climb-badge--cat1 { background: var(--difficulty-cat1); }
.climb-badge--hc   { background: var(--difficulty-hc); }

/* A climb whose category did not reach the browser: it still gets its line and its box, and the
   grey says the category is missing rather than dressing it as an easy one. */
.climb-badge--none { background: var(--gray-light, #b5b5b5); }

/* The climb dialog is wider than Bulma's 640 px, for the second column of boxes on the right of
   each climb. On a phone Bulma's own full-width card is kept. */
@media screen and (min-width: 769px) {
    .climb-picker-card {
        width: 780px;
    }
}

/* The box of the second column, in the middle of its cell and of its row. */
.climb-picker-table td {
    vertical-align: middle;
}

/* The second column as narrow as its header allows, the header wrapping onto two lines rather than
   taking the climb's room: on a phone it squeezed each climb to a word a line. */
.climb-picker-table th:last-child,
.climb-picker-table td.climb-picker-steps {
    width: 6.5rem;
    white-space: normal;
}

/* On a phone a climb's line wraps as text does: the badge and the kilometre on the first line,
   the figures under them, rather than four columns a word wide. */
@media screen and (max-width: 768px) {
    .climb-picker-table .checkbox {
        flex-wrap: wrap;
        row-gap: 0.15rem;
    }
}

/* One width for all five, so what follows the badge lines up and the list can be read down rather
   than across. 5.2rem holds the longest of them — "Très Diff.", "Very hard" — at this size. */
#climb-picker-list .climb-badge {
    width: 5.2rem;
}

#climb-picker-list .checkbox {
    display: flex;
    align-items: center;
}

.climb-row-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    flex-shrink: 0;
    white-space: nowrap;
}

.climb-row-stats {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

.climb-row-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
}

.climb-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 5px;
    flex-shrink: 0;
}

.climb-stat-icon--elevation { background: #dcfce7; color: #15803d; }
.climb-stat-icon--time      { background: #ede9fe; color: #6d28d9; }

.climb-stat-icon i {
    font-size: 0.7rem;
    line-height: 1;
}

.climb-row-bar-track {
    height: 7px;
    background: var(--gray);
}

.climb-row-bar {
    height: 100%;
    border-radius: 0 3px 3px 0;
    transition: width 0.3s ease;
}

.climb-row--cat4  .climb-row-bar { background: var(--difficulty-cat4); }
.climb-row--cat3  .climb-row-bar { background: var(--difficulty-cat3); }
.climb-row--cat2  .climb-row-bar { background: var(--difficulty-cat2); }
.climb-row--cat1  .climb-row-bar { background: var(--difficulty-cat1); }
.climb-row--hc    .climb-row-bar { background: var(--difficulty-hc); }

/* The track page's list: the length bar, a pill inset like the text around it, between the stats
   and the sentence, takes the category's colour like the badge (owner, 2026-10-06). */
/* The badge sits by the number, where the eye starts; the window's button alone goes right. */
.climbs-list--plain .climb-row-header {
    justify-content: flex-start;
}
.climbs-list--plain .climb-row-explain {
    margin-left: auto;
    height: 1.6rem;
    font-size: 0.72rem;
}
/* The window with the two drawings (ADR-0036): the help modal's frame, wider for the SVGs. */
.climb-explainer-content {
    max-width: 1000px;
    max-height: 90vh;
}
.climb-explainer-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1rem 0 0.3rem;
}
.climb-explainer-body p {
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0.25rem 0;
}
.climb-explainer-body svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 0.4rem 0;
}
.climb-explainer-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.climb-explainer-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.climb-explainer-legend .climb-explainer-swatch {
    width: 1rem;
    height: 1rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}
/* The climb's length and mean in its sentence, and every figure of 10 % or more, stand out; a
   gradient takes the colour of its band in the default detailed profile (owner, 2026-10-06). */
.climb-figure,
.climb-pct {
    padding: 0 0.3em;
    border-radius: 4px;
    white-space: nowrap;
}
.climb-figure {
    background-color: #e3ebf5;
    color: #1f3550;
}
.climb-pct--easy {
    background-color: #fdd9b4;
    color: #3d2410;
}
.climb-pct--moderate {
    background-color: #fda762;
    color: #3d2410;
}
.climb-pct--firm {
    background-color: #f87f2c;
    color: #2a1405;
}
.climb-pct--demanding {
    background-color: #e25508;
    color: #fff;
}
.climb-pct--very-demanding {
    background-color: #b03903;
    color: #fff;
}
.climb-pct--extreme {
    background-color: #812804;
    color: #fff;
}
.climb-explainer-help {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--gray);
}
.climbs-list--plain .climb-row-number {
    font-size: 0.9rem;
    color: var(--foreground);
}
.climbs-list--plain .climb-row-body {
    padding: 0.5rem 0.75rem 0.25rem;
}
.climbs-list--plain .climb-row-slopes {
    margin: 0 0 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
}
.climbs-list--plain .climb-row-stat {
    font-weight: 500;
}
.climb-stat-icon--summit { background: #fef3c7; color: #b45309; }
/* No frame around a climb: a line between two, under the bar (owner, 2026-10-06). */
.climbs-list--plain {
    gap: 0;
}
.climbs-list--plain .climb-row + .climb-row {
    border-top: 1px solid var(--gray);
    padding-top: 0.5rem;
}
.climbs-list--plain .climb-row-bar-track {
    height: 6px;
    margin: 0.35rem 0.75rem 0.5rem;
    border-radius: 999px;
    background: var(--gray);
}
.climbs-list--plain .climb-row-bar {
    border-radius: 999px;
}
.climbs-list--plain .climb-row-body--sentence {
    padding-top: 0;
}
/* The four quarters of the climb, gentlest to steepest, as one strip of four equal cells: the
   figures are the content, so the cells carry no colour of their own — a border and dividers. */
/* The sentence behind an info icon drawn like the stats' icons; the average is a stat itself. */
.climbs-list--plain .climb-row-summary {
    margin: 0 0 0.45rem;
    line-height: 1.5;
}
.climb-row-summary .climb-stat-icon {
    vertical-align: -0.2rem;
    margin-right: 0.15rem;
}
.climb-stat-icon--summary { background: var(--gray-light); color: var(--gray-dark); }
.climb-quartiles {
    display: inline-flex;
    border: 1px solid var(--gray-dark);
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}
.climb-quartile {
    min-width: 3.4rem;
    padding: 0.1rem 0.45rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground);
    border-left: 1px solid var(--gray-dark);
}
.climb-quartile:first-child {
    border-left: none;
}
/* Not bold: the climb's number and badge above it are the title (owner, 2026-10-06). */
.climb-row-summary {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--foreground);
}
.climb-quartiles-caption {
    font-size: 0.82rem;
    color: var(--gray-dark);
}
/* Said once, above the list, with the example: what the four cells are and what they are not. */
.climbs-explainer {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--gray-dark);
}

/* ===============================
   FILTER BAR (published tracks catalogue)
   =============================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    padding: 1rem 1.25rem;
    background: var(--gray-light);
    border-radius: var(--radius);
    border: 1px solid var(--gray);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-dark);
}

/* Pill buttons for kind filter */
.filter-pills {
    display: flex;
    gap: 0.35rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--gray);
    background: var(--background);
    color: var(--foreground);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.filter-pill input[type="radio"] {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.filter-pill:focus-within {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.filter-pill:hover {
    border-color: var(--secondary);
    color: var(--secondary-dark);
    background: rgba(33, 150, 243, 0.06);
}

.filter-pill.is-active,
.filter-pill:has(input:checked) {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: #ffffff;
    font-weight: 600;
}

.filter-pill.is-active:hover,
.filter-pill:has(input:checked):hover {
    background: var(--secondary-darker);
    border-color: var(--secondary-darker);
}

/* Styled select for geo filters */
.filter-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.filter-select-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--gray-dark);
    pointer-events: none;
    z-index: 1;
    font-size: 0.75rem;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.4rem 2.2rem 0.4rem 1.9rem;
    border: 1px solid var(--gray);
    border-radius: var(--form-border-radius);
    background: var(--background);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    color: var(--foreground);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 160px;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.15);
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-pills {
        flex-wrap: wrap;
    }

    .filter-select {
        min-width: 100%;
    }
}

/* ===============================
   EXPORT OPTIONS PREVIEW
   The right-hand column of the cronotabella and TCX options pages.
   =============================== */

/* Every options section carries the blue step circle. The preview is what those options produce
   rather than one more of them, so it is marked in the primary green: which side of the page the
   reader is looking at is then legible before a word is read. */
.export-preview .form-step-number {
  background: var(--primary);
}

.export-preview .form-section-title {
  color: var(--primary-text);
}

.export-preview {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--gray);
  /* Follows the options column rather than scrolling away from it: the whole point is to see the
     effect of a box while the box is still under the cursor. */
  position: sticky;
  top: 1rem;
}

/* The explanations under each field. Bulma's .help is 0.75rem, which is small for text doing real
   work — every one of these says what an option costs. Scoped to this form so the rest of the
   site's help text is left where it was. */
#export-options-form .help {
  font-size: 0.875rem;
  line-height: 1.5;
}

.export-preview-caption,
.export-preview-note {
  color: var(--gray-dark);
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* Said in the warning colour rather than the caption grey: lines the panel cannot hold are
   dropped from the file without appearing anywhere in the picture below, so this is the only
   place the rider can learn about them. */
.export-preview-warning {
  /* Red rather than the amber this used to be: lines are being dropped from what the rider asked
     for, and the sheet they print will be missing them. That is a failure to act on, not a note. */
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.export-preview-warning .icon {
  flex: none;
  /* Aligned to the first line of the text rather than centred on a paragraph that wraps. */
  margin-top: 0.1rem;
}

/*
 * The two things a sheet can do to a name it cannot fit, said in the colours it draws them in:
 * orange for a name abbreviated and still readable, red for one that lost letters. The rider
 * reads the count here and finds the same colour on the picture below (2026-09-20).
 */
.export-preview-flag {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.export-preview-flag-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.export-preview-flag .icon {
  flex: none;
}

/* The two colours the exporter marks a preview with: an abbreviated line and a cut one. The help
   behind each warning names its colour in words, so these have to be the same ink — which
   TrackCronoExporterTest checks against the exporter's own constants. */
.export-preview-flag.is-shortened .export-preview-flag-line {
  color: #c47000;
}

.export-preview-flag.is-cut .export-preview-flag-line {
  color: #c01c1c;
}

.export-preview-flag .option-help {
  margin-top: 0.15rem;
}

.export-preview-warning-fix {
  display: block;
  margin-top: 0.15rem;
  font-weight: 500;
}

.export-preview-tally {
  margin-bottom: 0.75rem;
}

.export-preview-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
}

.export-preview-breakdown {
  color: var(--gray-dark);
  font-size: 0.8rem;
}

/* The list can run to hundreds of points, and the strip to dozens of lines; both scroll inside the
   panel rather than stretching it. Sized against the window rather than in rem: the panel follows
   the options column down the page, so what it can use is what the screen has. */
.export-preview-scroll {
  max-height: 62vh;
  min-height: 12rem;
  overflow-y: auto;
}

/* The handlebar panel is wider than it is tall — the reverse of everything this frame was sized
   for. Reserving twelve rems of height for it leaves the preview a thin line floating in white,
   and beside a five-twelfths column it is drawn at a fifth of its size. Given the page's whole
   width it is drawn at more than half, so the row stacks and the preview goes first. */
.columns.export-columns-wide {
  display: flex;
  flex-direction: column-reverse;
}

.columns.export-columns-wide > .column {
  width: 100%;
  max-width: 100%;
  flex: none;
}

.crono-render-frame.is-wide {
  min-height: 0;
  overflow-y: hidden;
  overflow-x: auto;
  border: 1px solid var(--gray);
  border-radius: 8px;
}

/* The 420 px cap below is the strip's own natural width. The panel's is five times that, so the
   cap drew it at a fifth of its size — the whole reason it looked tiny beside the strip. Given
   the stacked row it gets about 1100 px, a little over life size for an 18 cm bar. */
.crono-render-frame.is-wide .crono-render-image {
  max-width: 100%;
}

.export-preview-table {
  margin-bottom: 0;
}

.export-preview-table code {
  background: transparent;
  padding: 0;
  color: var(--foreground);
}

.export-preview-km,
.export-preview-type {
  color: var(--gray-dark);
  white-space: nowrap;
}

.export-preview-km {
  text-align: right;
}

/* --- the route sheet preview: the exported PNG itself --------------------------
   The other two options pages simulate their export in HTML because a TCX or a FIT has no picture
   to show. This one has: the file is an image, so the preview is that image, fetched from the
   export URL. Nothing here can drift from what the rider downloads, because it is what they
   download. */

.crono-render-frame {
  /* A mountain route's sheet is far taller than the column, so the frame caps its height and
     scrolls rather than pushing the buttons off screen. Sized against the window like the course
     point list on the other two options pages: the panel follows the options column down the
     page, so what it can use is what the screen has. */
  max-height: 62vh;
  min-height: 12rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: var(--gray-light);
}

.crono-render-image {
  /* Its natural 420 px is 3.56 cm at 300 dpi, so on screen it lands near three times life size —
     which is the only reason text meant to be read at arm's length is legible here. */
  width: 100%;
  max-width: 420px;
  height: auto;
  align-self: flex-start;
  background: white;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  cursor: zoom-in;
}

/* The count on the left, the way to enlarge the sheet on the right, level with it. Aligned to the
   top rather than centred: the count is one line and the breakdown under it is three, so centring
   put the button beside the breakdown instead of beside the number it belongs to. */
.export-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.export-preview-head .export-preview-body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Enlarging the sheet belongs with the preview, not in the row of actions under the form: it
   verifies what is there rather than producing anything. */
.crono-render-expand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--gray);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.85rem;
  cursor: pointer;
}

.crono-render-expand:hover,
.crono-render-expand:focus-visible {
  border-color: var(--primary);
  color: var(--primary-text);
}

/* A way back to the track, not a third export. Set apart from the two buttons so the eye does not
   count it among them. */
.export-actions-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: center;
}

/* Set apart from the two buttons only while they are side by side. Stacked on a phone they share
   one left edge, and an indent there reads as a mistake rather than as separation. */
@media screen and (min-width: 769px) {
  .export-actions-back {
    margin-left: 0.75rem;
  }
}

@media (max-width: 768px) {
  .export-preview {
    position: static;
  }
}

/* The cronotabella in the lightbox. Tall and narrow rather than wide, so it is the height that has
   to fit the window; letting the width lead would show a strip a few millimetres across. */
.crono-lightbox-img {
  max-height: 92vh;
  max-width: 40vw;
  background: white;
}

/* One stat per line, under the total. The two previews answer the same question and read the
   same way, so a rider moving between them is not re-learning the shape of the answer. */
.export-preview-stats {
  /* One line, not one line each. These are four short counts read together as the make-up of the
     total above them, and stacked they took four lines of a column the preview needs for the
     sheet itself. They wrap where the column is too narrow, which is the only place a break
     earns its height. */
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  color: var(--gray-dark);
  font-size: 0.85rem;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.4rem;
}

.export-preview-stats li:not(:last-child)::after {
  /* A bullet rather than a middle dot, in the text's own grey rather than the rule grey: at
     0.85rem a "·" on #E0E0E0 was there in the markup and invisible on the screen. Punctuation
     between the counts, not content — it belongs to the layout and carries nothing to translate. */
  content: "•";
  margin-left: 0.35rem;
  color: var(--gray-dark);
}

/* A climb's category, drawn the way a Garmin Edge draws it: the number in a circle. Taken from the
   photographs in public/images/help/, which is also where the flag for a place came from. */
.export-preview-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

/* "HC" needs more room than a digit, so its circle becomes a pill rather than being squashed. */
.export-preview-cat.is-wide {
  width: auto;
  padding: 0 0.35em;
  border-radius: 999px;
}

/* ===============================
   ARTICLES (ADR-0023)
   =============================== */

/* The article card is a plain .content-section, set in the template rather than restyled here, so
 * it is the same block as every other page's. A narrower reading measure was tried and dropped:
 * prose reads better at 65 to 75 characters a line, but one page at a different width in a site
 * that is otherwise uniform reads as a mistake, and that costs more than the measure gains. */

.article-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray);
    padding-bottom: 1rem;
}

.article-date,
.article-list-date {
    display: block;
    color: var(--gray-dark);
    font-size: 0.9rem;
}

/* Title and date share a line to keep the list short; on a phone a long title pushes the date
   under it rather than squeezing either. */
.article-list-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 1rem;
    margin-bottom: 0.5rem;
}

.article-list-date {
    white-space: nowrap;
}

/* Not an error and not a warning: the article is there and readable, only in the other language.
   A coloured banner would say something went wrong. */
.article-language-note {
    color: var(--gray-dark);
    font-style: italic;
    margin-bottom: 1.5rem;
}

/* The body is Bulma's .content as well, which is what styles the headings, lists and links the
   Markdown renders to. Only what Bulma has no opinion about is set here. */
.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* A paragraph of images alone, rendered as figures by Descriptions.articleHtml: side by side, tops
   lined up, shrinking together until the row fits, with a rule between two so each caption reads as
   its own image's. A phone has no room for two, and stacks them with the rule across instead. */
.article-figures {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.article-body .article-figures figure {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    text-align: left;
}

.article-figures figure + figure {
    border-left: 1px solid var(--gray);
    padding-left: 1.5rem;
}

.article-body .article-figures img {
    margin: 0;
}

/* As wide as its image and no wider: the zero width keeps a long caption from stretching the figure
   it sits under, and the minimum gives it the figure's width back. */
.article-body .article-figures figcaption {
    width: 0;
    min-width: 100%;
    margin-top: 0.75rem;
    color: var(--gray-dark);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .article-figures {
        display: block;
    }

    .article-figures figure + figure {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--gray);
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
}

.article-back {
    margin-bottom: 2rem;
}

.article-back-top {
    margin-bottom: 1rem;
}

/* The card runs to the screen edge on a phone; the button would touch it. Same inset as .track-nav. */
@media (max-width: 768px) {
    .article-back {
        padding: 0 0.75rem;
    }
}

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

.article-list-item + .article-list-item {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray);
}

.article-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.article-list-summary {
    color: var(--foreground);
    margin: 0;
}


/* ---------------------------------------------------------------------------
   Compact option cards — the export pages
   ---------------------------------------------------------------------------
   Six option cards at full size ran down one column for 1800 px with the right
   half of the page empty below the preview, and every card spent 60 px on a
   badge and a heading before its first control. These are short choices read as
   a checklist, not a form to fill in, so the cards are tighter and sit two
   abreast where there is room. The guidance under each control stays: it is the
   reason a rider can answer at all, and dropping it would buy height at the
   price of the page's purpose.
   --------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------
   Where the sheet goes, chosen from two drawings rather than two words. The blue
   band on each shows the place on the bike, which is the whole question — "le
   long du tube" and "en travers du cintre" name it correctly and still leave a
   rider who has never seen one guessing. The card is the label, so the drawing
   is part of the click target; the radio stays, because it is what submits and
   what a keyboard and a screen reader read.
   --------------------------------------------------------------------------- */
/* The sentence and the two cards on one row, the sentence taking what the cards leave; one
   column on a phone, the sentence first. */
.export-target-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
}

/* A third of the row for the sentence, no more: wider, it read as the block's content and the
   cards as an afterthought at the far edge. */
.export-target-intro {
    flex: 1 1 260px;
    margin: 0;
}

@media screen and (min-width: 769px) {
    .export-target-intro {
        flex: 0 1 33%;
    }
}

.export-target-choices {
    /* Its width said outright: the two cards, the tube's twice as wide, and the gap between them.
       Left to its content the box measured one card wide beside the sentence and stacked the two.
       On a phone it takes the whole row, under the sentence, and the cards wrap inside it. */
    flex: 0 0 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

@media screen and (min-width: 769px) {
    .export-target-choices {
        flex-basis: calc(2 * 200px + 1rem + 230px + 1rem);
        /* Centred in what the sentence leaves, not flush against the block's edge. */
        margin: 0 auto;
    }
}

/* One card a place, as the other choices are drawn; the card's own styles do the rest. Small:
   the drawing only has to say which of two places, and the sheet's own preview is the picture
   worth the room on this page. */
.export-target-choice {
    /* Wide enough for "Sur le guidon, en travers du cintre" on two lines beside its radio: at
       170px it took four, and the two cards no longer matched. */
    flex: 0 1 230px;
    min-width: 0;
}

/* The tube's card draws the stem beside the tube: two pictures, so nearly twice as wide — a
   little less, so that the two cards still fit beside the sentence. */
.export-target-choice--two {
    flex-basis: calc(2 * 200px + 1rem);
}

.export-target-pictures {
    display: flex;
    gap: 0.5rem;
}

.export-target-pictures > .image {
    flex: 1 1 0;
}

/* A field that holds a time or a few digits: as wide as what it holds, not as the column — with
   room for the time control's picker icon, which at 7.5rem sat on the clear button's border. */
.input-short {
    width: 8.5rem;
}

/* ---------------------------------------------------------------------------
   A control's guidance, behind a button. The text is the reason a rider can
   answer at all, so none of it is dropped — but under every control it made the
   options column twice as long as the sheet it describes.
   --------------------------------------------------------------------------- */
.option-label-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
}

.option-label-row .label,
.option-label-row .checkbox {
    margin-bottom: 0;
}

.option-help-toggle {
    flex: none;
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
    color: var(--gray-dark);
    cursor: pointer;
}

.option-help-toggle:hover,
.option-help-toggle[aria-expanded="true"] {
    color: var(--secondary-dark);
}

/* A heading inside a card, for the things a card groups. In the primary green: it is the only
   colour on the card, and it makes the four blocks of the content card findable at a glance
   without a second rule or an indent. The text green, the only one that reaches 4.5:1 on white
   (ADR-0039). */
.option-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-text);
    margin: 0;
}

.option-subsection + .option-subsection,
.option-card-ruled > * + * {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-light);
}

/* The card header is not one of the options, so no rule under it. */
.option-card-ruled > .form-section-header + * {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.export-compact .form-section {
    padding: 1rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.export-compact .form-section-header {
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

.export-compact .form-step-number {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
}

.export-compact .form-section-title {
    font-size: 0.95rem;
}

.export-compact .field:not(:last-child) {
    margin-bottom: 0.6rem;
}

.export-compact .label {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.export-compact .help {
    margin-top: 0.15rem;
    line-height: 1.35;
}

/* The device export table carries one download per row. The primary button is sized to stand
   alone at the foot of a form, and seven of them at that size made every row a band; here they are
   cut to the height of a line of text, the grey TCX to the same size, and none of them wraps. */
.device-export-table td {
    vertical-align: middle;
}

.device-export-table .btn-primary,
.device-export-table .button {
    padding: 0.35rem 0.8rem;
    font-size: 0.875rem;
    height: auto;
    white-space: nowrap;
}

/* On a phone the four columns do not fit: at 390 px the table was 507 px wide in a 324 px frame,
   the transfer column off screen and every row a band. Each row becomes a card instead: the
   computer and its button on one line, then the two texts, each under its column title, which the
   cells carry in data-label since the header row is hidden. */
@media screen and (max-width: 768px) {
    .export-intro {
        padding: 0 0.75rem;
    }

    /* The sections of the device export and route sheet forms that sit outside the columns — the
       device table, the choice of where the sheet goes — had no side margin and ran into both
       screen edges, where the cards in the columns keep 0.75 rem. Both forms carry this id. */
    #export-options-form > .form-section {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }

    .device-export-table thead {
        display: none;
    }

    .device-export-table,
    .device-export-table tbody {
        display: block;
    }

    .device-export-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 0.75rem;
        border: 1px solid var(--gray);
        border-radius: 10px;
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.6rem;
    }

    .device-export-table td {
        display: block;
        border: none;
        padding: 0.15rem 0;
    }

    .device-export-table td:first-child {
        font-weight: 600;
    }

    .device-export-table td[data-label] {
        grid-column: 1 / -1;
    }

    .device-export-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--gray-dark);
    }
}

/* Two cards abreast on a wide screen, one below it, packed by multi-column
   rather than laid out on a grid: the option cards differ wildly in height — a
   two-line checkbox next to a card carrying a paragraph of guidance — and a grid
   row is as tall as its tallest cell, so the short card left ~450 px of white
   space beneath it. Columns pack each card under the previous one. Reading order
   becomes down the left column then down the right, which is fine here: the
   cards are independent questions, not steps. */
.export-option-grid {
    column-count: 2;
    column-gap: 1rem;
}

/* The sheet page places its cards instead of packing them. Three cards of very different heights
   pack into whatever balances, and which column a card lands in should be a decision: when the
   ride starts and how the sheet is printed on the left, what it carries — the long one a rider
   scrolls — on the right. */
.export-option-columns {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.export-option-column {
    flex: 1 1 0;
    min-width: 0;
}

@media screen and (max-width: 1215px) {
    .export-option-columns {
        display: block;
    }
}

.export-option-grid > .form-section {
    break-inside: avoid;
}

@media screen and (max-width: 1215px) {
    .export-option-grid {
        column-count: 1;
    }
}

/* The preview is already sticky — see .export-preview above, which says why. A
   second sticky wrapper round it nests one sticky context inside another and
   clips the table. */

/* The device table is reference, not a form: it can be quieter and tighter. */
.export-device-table td,
.export-device-table th {
    padding: 0.35em 0.6em;
    vertical-align: top;
}


/* ---------------------------------------------------------------------------
   The gutter a .columns row needs to sit in
   ---------------------------------------------------------------------------
   Bulma gives .columns a -0.75rem margin on each side and each .column a
   matching padding, so a row is meant to sit inside something with at least
   that much horizontal padding. The page container has none, so a row is 24 px
   wider than the page and the options pages scroll sideways — 414 px of row in
   a 390 px viewport.

   Fixed on the rows rather than on the container: the navbar sits in that same
   container, and padding it pushed the navbar 12 px further out at the widths
   where it already overflows. The outer gutter is what has nowhere to go; the
   padding on each .column still separates the columns from each other.

   Only below the widescreen breakpoint, which is where the container runs full
   width. Above it the container is already narrower than the viewport, the
   negative margins have room, and wide screens keep the spacing they have.
   --------------------------------------------------------------------------- */
@media screen and (max-width: 1215px) {
    .columns {
        margin-left: 0;
        margin-right: 0;
    }
}

/* =============================================================================
   The edit page (edittrack): the map's controls, the place and note dialogs, the columns.
   Moved here from a <style> block in the template, which loaded after leaflet.css where this file
   loads before it — hence the two-class selectors wherever a rule has to beat a Leaflet default.
   ============================================================================= */

/* No grabbing hand on the edit page's map: a click there picks a point. Two classes on the one
   element — Leaflet sets .leaflet-grab on the container itself — because leaflet.css is loaded
   after this file and its own .leaflet-grab rule would otherwise win on order; Leaflet's dragging
   rule has the same weight and still wins while the map is dragged. */
.leaflet-container.leaflet-grab {
    cursor: auto;
}

/* The map's bottom-left control: the one button that names how a place is added. Its own
   border and shadow, not the control's, so it does not sit in a white box on the map. */
.leaflet-control-add-place.leaflet-bar {
    border: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

/* The catalogue map's dialog, above the Leaflet panes for the same reason as the editor's below:
   Bulma's modal sits at 40 and the map's tiles paint over it (seen 2026-10-23). */
.trackpoint-dialog.is-active {
    z-index: 1100;
}

/* Add place dialog - must be above Leaflet map (z-index ~400-1000) */
/* A hidden place is still listed and still editable: it is kept, not deleted. */
/* The heading and the button that adds to what it counts, on one line. */
.control-title.title-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.span-mode-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}
/* The range is what the pickers came to, not a hint under one of them. */
.span-range-outcome {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background-color: var(--gray-light);
    font-size: 0.875rem;
}
/* The note is a separate matter from how the bounds were set; the rule says so. */
.span-dialog-separator {
    margin: 1.25rem 0;
    border: none;
    border-top: 1px solid var(--gray);
}
/* A note needs no selected point, so its button is not part of the pair above it. */
.add-control-separator {
    margin: 0.6rem 0;
    border: none;
    border-top: 1px solid var(--gray);
}
/* The toggles that govern a list, sitting with it rather than on another page. */
.profile-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    margin: 0.35rem 0 0.5rem;
    font-size: 0.8rem;
}
/* Hidden but kept: greyed on /edittrack, and the same way on the track page, where the crossed eye
   is a mark rather than a button (ADR-0032 §1). */
.place-item.place-hidden .place-name-display,
.place-item.place-hidden .place-name,
.place-item.place-hidden .place-icon {
    opacity: 0.45;
}
.place-hidden-mark {
    margin-left: auto;
    padding-left: 0.4rem;
    color: var(--gray-dark);
    font-size: 0.75rem;
}
.add-place-dialog.is-active {
    z-index: 1100;
}
.add-place-dialog .field-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}
.add-place-dialog .name-preview {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #363636;
    min-height: 2rem;
    display: flex;
    align-items: center;
}

/* Pass chooser dialog - must be above Leaflet map */
.pass-chooser-dialog.is-active {
    z-index: 1100;
}
.pass-chooser-dialog .modal-card {
    max-width: 360px;
}

/* Custom Leaflet control for validate button */
.leaflet-control-validate {
    background: white;
    padding: 10px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Map overlay for processing indicator */
.map-processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    border-radius: 4px;
}
.map-processing-overlay .form-loading-indicator {
    margin-top: 0;
    flex-direction: column;
    padding: 1.5rem 2.5rem;
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.leaflet-control-validate .button {
    font-size: 13px;
    font-weight: bold;
    padding: 8px 16px;
    height: auto;
}

.leaflet-control-reset-zoom {
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    border: 2px solid rgba(0,0,0,0.2);
}
.leaflet-control-reset-zoom:hover {
    background-color: #f4f4f4;
}
.leaflet-control-map-help {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.leaflet-control-map-help .help-button {
    margin-left: 0;
}
/* Options down the left for the whole page, not just beside the map: they govern
   every list and every drawing on the right. */
.edittrack-columns {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.edittrack-main {
    flex: 1;
    min-width: 0;
}
.edittrack-plot-preview {
    width: 100%;
    display: block;
}
/* In the corner of the picture rather than on a row of its own, which cost a line of
   height for one button. */
.edittrack-plot-expand {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}
/* Under the map and no wider than it: the two read as one thing. */
.edittrack-main .elevation-profile-container {
    width: 100%;
    position: relative;
}
/* What a click on the chart does, a new point or the map centred there: two buttons beside the
   chart's cross, in its corner (frontend/profile-pick-modes.js). */
/* The buttons stand in the chart's corner on every page that has some. */
.elevation-profile-container:has(> .elevation-pick-modes) {
    position: relative;
}
.elevation-pick-modes {
    position: absolute;
    top: 4px;
    right: 34px;
    z-index: 2;
    margin: 0;
    flex-wrap: nowrap;
}
.elevation-pick-modes .button {
    height: 22px;
    margin-bottom: 0;
    padding: 0 7px;
}
@media screen and (max-width: 1023px) {
    .edittrack-columns {
        flex-direction: column;
    }
}

/* A setting summarised on one line with the button that opens its dialog beside it. */
.edittrack-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* The style dialog holds the style cards the creation form shows, three abreast, so it is wider
   than the place dialog. */
.style-dialog-modal .modal-card {
    width: min(96vw, 1000px);
}

/* The speed dialog's two ways, side by side as cards. */
.speed-dialog-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.style-dialog-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media screen and (max-width: 768px) {
    .style-dialog-cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A small red box in the corner while something changed and the profile has not been redrawn:
   fixed, so it is there whichever part of the page the rider is on. Hidden until then. */
.edittrack-dirty {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1200;
    display: flex;
    /* The count above its two buttons: side by side, the box covered the page title below 1440px. */
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    margin: 0;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* On a phone the top-right box sat over the page title. At the foot of the screen, under the thumb,
   it covers only what can scroll clear of it. */
@media screen and (max-width: 768px) {
    /* Two classes, to outrank Bulma's .notification:not(:last-child), whose margin lifts the bar off
       the foot of the screen. */
    .notification.edittrack-dirty {
        margin-bottom: 0;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        border-radius: 0;
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
    }

    /* Room for the bar while it shows, so the end of the page scrolls above it, not under it. */
    body:has(.edittrack-dirty:not(.nico-hidden)) {
        padding-bottom: 6rem;
    }

    /* A dialog keeps its buttons at its foot, where the bar would sit over them. */
    body:has(.modal.is-active) .edittrack-dirty {
        display: none;
    }
}

/* The options panel's selects and fields stop at half its width: stretched across it they read
   as wider than what they hold. */
.places-side-panel .edittrack-half {
    width: 50%;
}

.places-side-panel .select.edittrack-half select {
    width: 100%;
}

/* The places search page (ADR-0016, the search page): a stored place is a filled disc with a dark
   ring, a proposed one a filled disc with a green ring, a candidate the outlined disc, so the three
   tell apart at a glance (owner, 2026-11-05). */
.trackpoint-disc.is-stored {
    border: 3px solid #1F2937;
}

.trackpoint-disc.is-proposed {
    border: 3px solid #27AE60;
}

/* A candidate added by hand, before it is saved: the outlined disc with a thick green edge. */
.trackpoint-disc.is-candidate.is-added {
    border: 3px solid #27AE60;
    border-style: solid;
}

.trackpoint-disc.is-candidate.is-added > svg,
.trackpoint-disc.is-candidate.is-added > i {
    opacity: 1;
}

/* The places search's panel of tabs: its lists scroll inside it, the window's height less the
   page's header, so the map stays beside the row being read. On a phone it is the page's length. */
.placesearch-panes {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
}

@media screen and (max-width: 768px) {
    .placesearch-panes {
        max-height: none;
    }
}

/* The way back to an earlier state of a track, on the editor and on the two pages of the points:
   framed by a red dashed line, since it undoes work. */
.track-restore-block {
    border: 2px dashed var(--danger-dark);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}

/* The communes crossed, in the column of the tools: a long list scrolls inside its block, and the
   box of a row takes no more room than itself. */
.placesearch-communes {
    max-height: 16rem;
    overflow-y: auto;
}

.placesearch-communes td:first-child:has(input) {
    width: 1.5rem;
}

/* While the tool of the line is on, a click on the map changes the line: the pointer says so. */
#map-placesearch.is-picking,
#map-placesearch.is-picking .leaflet-grab {
    cursor: crosshair;
}

/* The changes in progress of the page of the points: above the lists, under every tab; a long
   list of changes scrolls inside the block. */
.placesearch-changes {
    max-height: 40vh;
    overflow-y: auto;
}
.placesearch-changes .place-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0;
    padding: 3px 6px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.75rem;
}
.placesearch-changes .buttons {
    gap: 0.25rem;
}
.placesearch-changes .buttons .button {
    margin: 0;
}
/* A stored point taken away, not yet saved: struck through, in the list and in the changes. */
.placesearch-removed-row td:not(.placesearch-stored-actions),
.placesearch-changes .place-item.is-removed .place-name-display {
    text-decoration: line-through;
    color: #7a7a7a;
}
.placesearch-edited-row td {
    background: #FFF8E1;
}
.placesearch-stored-actions {
    white-space: nowrap;
    text-align: right;
}
.placesearch-rows .button.placesearch-stored-action {
    height: 22px;
    padding: 0 5px;
}
.placesearch-changes .delete-btn {
    margin-left: auto;
    border: 0;
    background: none;
    color: #C62828;
    cursor: pointer;
}

/* A row with a place: a click shows it on the map. */
/* Under a candidate's name: its commune, its distance to the road and its origin, on one line. */
.placesearch-row-under {
    color: #7a7a7a;
    font-size: 0.7rem;
}
.placesearch-rows .button {
    height: auto;
    padding: 2px 6px;
    white-space: normal;
}
.placesearch-rows tbody tr[data-lat] {
    cursor: pointer;
}

/* A stored track point among the candidates, so the eye sees where one is missing. */
.placesearch-stored-row td {
    background: #EEF5FF;
}

/* A candidate added by hand, in the list: the whole row green until it is saved. */
.placesearch-added-row td {
    background: #E8F8EE;
}

/* ---- The editor's two views (frontend/edit-views.js) ----
   The drawing with what governs it, or the map with the points and the sections: one at a time,
   each the height of the window. The blocks of a view carry data-view, the columns the class of
   the view shown. */
.edittrack-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 8px 0;
}
/* The page's title, the blue band of the other pages on a line of its own, one line high. */
.edittrack-bar .page-header-compact {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
    padding: 4px 14px;
    border-radius: 8px;
    text-align: center;
}
/* The row of buttons under it: the views, a clear line, the ways out, the super-user's pages. */
.edittrack-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    flex: 1 1 100%;
}
.edittrack-actions .button,
.edittrack-actions .buttons {
    margin-bottom: 0;
}
.edittrack-actions .plot-expand-controls,
.edittrack-actions .plot-controls-group {
    margin: 0;
    padding: 0;
}
.edittrack-bar-separator {
    align-self: stretch;
    width: 2px;
    margin: 0 6px;
    background: #7a7a7a;
    border-radius: 1px;
}
.edittrack-bar .page-header-compact .page-title {
    /* Read, not seen: the line beside it says the same and names the track. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.edittrack-bar .page-header-compact .page-subtitle.track-subtitle {
    max-width: none;
    margin: 0;
    font-size: 1.05rem;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.edittrack-bar .track-subtitle-name {
    font-weight: 700;
}
/* What a rider's page does not have, on the tint of the super-user's tag. */
.edittrack-privileged {
    padding: 6px 8px;
    border-radius: 4px;
}
.places-side-panel .edittrack-privileged > .control-title:first-child {
    margin-top: 0;
}
/* The editor's panel is cards one under the other, each lightly shadowed: the way to the other
   view, the lists, the way back to an earlier state, the buttons. The panel itself is only what
   scrolls them. */
.edittrack-columns .places-side-panel {
    background: transparent;
    box-shadow: none;
    padding: 3px 4px;
}
.edittrack-card,
.edittrack-columns .places-side-panel > .track-restore-block {
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}
.edittrack-bar .track-nav {
    margin: 0;
    padding: 0;
}
.edittrack-views {
    margin: 0;
    flex-wrap: nowrap;
}
.edittrack-views .button {
    margin-bottom: 0;
}
.is-view-map [data-view="profile"],
.is-view-profile [data-view="map"] {
    display: none;
}
.edittrack-pane > .control-title:first-child {
    margin-top: 0 !important;
}
/* The save buttons stay at the foot of the panel while its lists scroll under them. */
.edittrack-columns .places-side-panel .panel-actions {
    position: sticky;
    bottom: -3px;
    /* Over a select's arrow, which Bulma raises to 4 */
    z-index: 5;
    margin: 0;
    padding: 0.6rem 12px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
@media screen and (min-width: 1024px) {
    .edittrack-columns:not(.is-elevation-focus) {
        height: calc(100vh - var(--edittrack-top, 116px) - 12px);
        height: calc(100dvh - var(--edittrack-top, 116px) - 12px);
        min-height: 460px;
        align-items: stretch;
    }
    .edittrack-columns:not(.is-elevation-focus) .places-side-panel {
        position: static;
        max-height: none;
    }
    .edittrack-columns:not(.is-elevation-focus) .edittrack-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .is-view-map .map-with-side-panel {
        flex: 1;
        min-height: 0;
        align-items: stretch;
    }
    .is-view-map .map-with-side-panel > .map-wrapper .map-full {
        height: 100%;
    }
    .is-view-map .elevation-profile-container {
        flex: none;
        margin-bottom: 0;
    }
    /* The drawing whole in the window: no wider than its height allows, by its own proportions. */
    .is-view-profile .edittrack-summary-plot {
        width: 100%;
        max-width: calc((100vh - var(--edittrack-top, 116px) - 12px) * var(--plot-ratio, 2));
        margin: 0 auto;
    }
}
@media screen and (max-width: 1023px) {
    /* One column: what the view shows first, then the panel at its own height, the page
       scrolling and no list inside it. */
    .edittrack-columns .edittrack-main {
        order: 1;
        width: 100%;
    }
    .edittrack-columns .places-side-panel {
        order: 2;
        position: static;
        width: 100%;
        max-height: none;
    }
    .is-view-map .map-with-side-panel .map-full {
        height: min(56vh, 520px);
    }
    .edittrack-views {
        flex: 1 1 100%;
        margin-left: 0;
        min-width: 0;
    }
    /* The names of the two views are long: on a narrow screen each wraps inside its button */
    .edittrack-views .button {
        flex: 1;
        min-width: 0;
        height: auto;
        white-space: normal;
    }
    .edittrack-actions {
        min-width: 0;
    }
    .edittrack-bar-separator {
        display: none;
    }
    .edittrack-columns .places-side-panel .panel-actions {
        bottom: 0;
    }
}

/* ---- The editor's large elevation view (frontend/elevation-focus.js) ----
   The editor's own columns over the whole window: the map and the chart down the left, the
   Altitude panel and the save buttons down the right. Nothing is copied, the class moves what is
   there. Under the dialogs (Bulma's modal is 40), so a point picked on the map still opens its own. */
.elevation-focus-close {
    display: none;
}
@media screen and (max-width: 1023px) {
    /* One column already: there is no room to gain. */
    .elevation-focus-open {
        display: none;
    }
}
.edittrack-columns.is-elevation-focus {
    position: fixed;
    inset: 0;
    z-index: 35;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    background: var(--background, #fff);
}
.is-elevation-focus .places-side-panel {
    order: 2;
    width: 460px;
    max-height: none;
    position: static;
    font-size: 13px;
}
.is-elevation-focus .places-side-panel > [data-view="map"] > :not(#elevation-fix) {
    display: none;
}
.is-elevation-focus #elevation-panel {
    margin-top: 0 !important;
}
.is-elevation-focus .elevation-focus-open {
    display: none;
}
.is-elevation-focus .elevation-focus-close {
    display: inline-block;
}
.is-elevation-focus .places-side-panel .elevation-proposal-show {
    font-size: 13px;
}
.is-elevation-focus .edittrack-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.is-elevation-focus .edittrack-summary-plot {
    display: none;
}
.is-elevation-focus .map-with-side-panel {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
.is-elevation-focus .map-with-side-panel > .map-wrapper .map-full {
    height: 100%;
}
.is-elevation-focus .elevation-profile-container {
    flex: none;
    margin-bottom: 0;
}
/* The count of changes waiting floats at the top right of the page, where the panel now is: it
   goes to the foot of the window, under the panel's lists. */
.has-elevation-focus .edittrack-dirty {
    top: auto;
    bottom: 1.5rem;
    right: 1.5rem;
}

/* A point's tooltip on a map (frontend/place-tooltip.js): the title, the line under it, the grid
   of label and value, two short pairs to a line, and the status tag. */
.map-tooltip-under {
    color: #7a7a7a;
}

.map-tooltip-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    column-gap: 0.6em;
    justify-content: start;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #dbdbdb;
}

.map-tooltip-label {
    color: #7a7a7a;
}

.map-tooltip-label.is-wide {
    grid-column: 1;
}

.map-tooltip-value.is-wide {
    grid-column: 2 / -1;
}

.map-tooltip-state {
    margin-top: 4px;
}
