/*
 * Component ownership ----------------------------------------------------
 * DaisyUI owns reusable component structure and interaction states. This
 * file owns TripDB theme tokens and app/domain compositions around those
 * primitives; do not introduce a parallel primitive name or implementation.
 */

:root {
    --brand-frame: #01241d;
    --brand-forest: #012a22;
    --brand-field: #075b41;
    --brand-leaf: #38a55f;
    --brand-celadon: #d5ecb9;
    --brand-gold: #f1c24d;
    --brand-route: #ffca4b;
    --brand-cream: #f1edcf;
    --rail-width: 228px;
    --page-gutter: clamp(24px, 3.5vw, 64px);
}

/* Re-resolve app aliases whenever a Daisy theme starts a nested boundary. */
:root,
[data-theme] {
    color-scheme: light;
    --bg: var(--color-base-100, #f8f5e9);
    --surface: color-mix(in oklab, var(--color-base-100, #f8f5e9) 90%, white 10%);
    --surface-raised: color-mix(in oklab, var(--color-base-100, #f8f5e9) 84%, white 16%);
    --surface-muted: var(--color-base-200, #efeadb);
    --line: color-mix(in oklab, var(--color-base-content, #17372f) 13%, transparent);
    --line-strong: color-mix(in oklab, var(--color-base-content, #17372f) 23%, transparent);
    --text: var(--color-base-content, #17372f);
    --muted: color-mix(in oklab, var(--color-base-content, #17372f) 78%, transparent);
    --muted-faint: color-mix(in oklab, var(--color-base-content, #17372f) 72%, transparent);
    --accent: var(--color-primary, #075b41);
    --accent-strong: color-mix(in oklab, var(--color-primary, #075b41) 84%, black);
    --accent-soft: color-mix(in oklab, var(--color-primary, #075b41) 13%, transparent);
    --focus-ring: var(--brand-field);
    --warning-soft: color-mix(in oklab, var(--color-secondary, #e6b43d) 26%, transparent);
    --danger: color-mix(in oklab, var(--color-error, #b94b3f) 82%, black);
    --shadow: 0 22px 60px color-mix(in oklab, var(--brand-forest) 17%, transparent);
    --shadow-soft: 0 12px 36px color-mix(in oklab, var(--brand-forest) 11%, transparent);
}

[data-theme="tripdark"] {
    color-scheme: dark;
    --surface: color-mix(in oklab, var(--color-base-100) 95%, white 5%);
    --surface-raised: color-mix(in oklab, var(--color-base-100) 90%, white 10%);
    --accent-strong: color-mix(in oklab, var(--color-primary) 90%, white);
    --danger: var(--color-error);
    --focus-ring: var(--brand-celadon);
    --shadow: 0 26px 70px rgb(0 0 0 / 0.4);
    --shadow-soft: 0 14px 38px rgb(0 0 0 / 0.25);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --surface: color-mix(in oklab, var(--color-base-100) 95%, white 5%);
        --surface-raised: color-mix(in oklab, var(--color-base-100) 90%, white 10%);
        --accent-strong: color-mix(in oklab, var(--color-primary) 90%, white);
        --danger: var(--color-error);
        --focus-ring: var(--brand-celadon);
        --shadow: 0 26px 70px rgb(0 0 0 / 0.4);
        --shadow-soft: 0 14px 38px rgb(0 0 0 / 0.25);
    }
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    width: 100%;
    max-width: 100%;
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at 6% -8%, color-mix(in oklab, var(--brand-celadon) 16%, transparent), transparent 30rem),
        radial-gradient(circle at 92% -5%, color-mix(in oklab, var(--brand-gold) 14%, transparent), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overflow-x: hidden;
    transition: background-color 180ms ease, color 180ms ease;
}

body.has-modal {
    overflow: hidden;
}

a {
    text-decoration: none;
}

:where(a:not(.btn, .tab)) {
    color: inherit;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 8px;
    transform: translateY(calc(-100% - 16px));
    border: 2px solid var(--focus-ring);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--text);
    padding: 10px 14px;
    font-weight: 750;
    box-shadow: var(--shadow);
}

.skip-link:focus {
    transform: translateY(0);
}

.page :where(p, li, dd) a:not(.btn) {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

button {
    font: inherit;
}

button:not(.btn):not(:disabled) {
    cursor: pointer;
}

button:not(.btn):disabled {
    cursor: not-allowed;
}

.card {
    --radius-box: 20px;
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.card-border {
    border-color: var(--line);
}

details.card.collapse {
    display: grid;
}

.card--padded {
    padding: 16px 18px;
}

.app-frame {
    width: min(1180px, calc(100% - 40px));
    max-width: 100%;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.page-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.page-header h1,
.modal h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 4.2vw, 60px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.page-header__meta {
    margin: 10px 0 0;
}

.page-header > div:first-child > p:not(.eyebrow),
.page-header__meta {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.6;
}

.account-sessions {
    display: grid;
    gap: 16px;
}

.account-sessions h2 {
    margin: 2px 0 4px;
    font-size: 21px;
}

.account-sessions p {
    margin: 0;
    color: var(--muted);
}

.session-list {
    display: grid;
    gap: 10px;
}

.session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.session-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.session-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 0;
}

.session-card__facts div {
    display: grid;
    gap: 1px;
}

.session-card__facts dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.session-card__facts dd {
    margin: 0;
    font-size: 13px;
}

.stats-panel {
    margin-bottom: 20px;
    overflow: hidden;
}

.stats-panel__summary {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 17px 52px 17px 20px;
}

.stats-panel__summary-title {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.stats-panel__summary-title h2,
.stats-panel__summary-heading,
.stat-chart h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
}

.summary-metrics {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.summary-metrics > span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 8px 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

.summary-metrics > span strong {
    color: var(--accent);
    font-size: 16px;
    line-height: 1;
}

.summary-metric-label {
    line-height: 1.1;
}

.stats-panel__content {
    display: grid;
    gap: 12px;
    padding: var(--tripdb-collapse-content-gap) 14px 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.metric-grid > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 10px;
}

.metric-grid dt,
.stat-chart__row span:first-child {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}

.metric-grid dt {
    text-transform: uppercase;
}

.metric-grid dd {
    margin: 0;
    font-size: 23px;
    font-weight: 820;
    line-height: 1.05;
}

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

.stat-chart {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
}

.stat-chart__rows {
    display: grid;
    gap: 8px;
}

.stat-chart__row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) minmax(90px, 1fr) 36px;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.stat-chart__row span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-chart__track {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.stat-chart__bar {
    display: block;
    width: var(--bar-width);
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.stat-chart__bar--season {
    background: var(--brand-route);
}

.stat-chart__row strong {
    text-align: right;
}

.stat-chart__empty {
    margin: 0;
    color: var(--muted);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 126px auto;
    align-items: end;
    gap: 14px;
    min-width: 0;
    margin-bottom: 22px;
}

.toolbar--map-filters {
    grid-template-columns: minmax(0, 1fr);
}

.map-filter-fields {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(118px, 0.75fr));
    gap: 12px;
}

.map-radius-filter {
    max-width: 720px;
}

.map-radius-filter__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.map-radius-mode {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.map-radius-filter > small {
    color: var(--muted);
}

.map-filter-actions .status-text {
    flex: 1 1 260px;
    white-space: normal;
}

.toolbar--meeting {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.toolbar--meeting .filter-toggle-row {
    grid-column: 1 / -1;
}

.toolbar--unit-form {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
}

@media (max-width: 1000px) {
    .toolbar--unit-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.toolbar--unit-form .unit-slug-field {
    position: relative;
}

.toolbar--unit-form .unit-slug-field__help {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.unit-create-panel {
    margin-bottom: 16px;
}

.unit-create-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 14px 52px 14px 16px;
}

.unit-create-panel__summary strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1.2;
}

.unit-create-form {
    display: grid;
    gap: 14px;
    border-top: 0;
    padding: 16px;
}

.unit-create-form__primary,
.unit-create-form__advanced-fields {
    display: grid;
    gap: 12px;
    padding: 0;
}

.unit-create-form__primary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 0;
}

.unit-create-form__gutter {
    padding-inline: 16px;
}

.unit-create-form__advanced-fields {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    min-width: 0;
}

.unit-create-form__name {
    grid-column: span 2;
}

.unit-create-form__location {
    grid-column: span 2;
}

.unit-create-form__advanced {
    border-top: 0;
    padding-top: 0;
}

.unit-create-form__advanced > .collapse-title,
.unit-settings-advanced > .collapse-title {
    color: var(--accent-strong);
    font-weight: 760;
}

.unit-settings-primary {
    margin-bottom: 14px;
}

.unit-settings-advanced {
    border-top: 0;
    padding-top: 0;
}

.unit-settings-groups {
    display: grid;
    gap: 10px;
}

.unit-settings-advanced > .collapse-title {
    width: 100%;
    min-height: 44px;
    padding: 12px 52px 12px 12px;
}

.unit-invite-form {
    align-items: end;
    margin-bottom: 20px;
}

.unit-invite-form .field--wide {
    grid-column: 1 / -1;
}

.unit-invite-form__actions {
    align-self: end;
}

.unit-invite-form__help {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.toolbar--import-upload {
    grid-template-columns: minmax(220px, 320px) minmax(320px, 1fr) auto;
    align-items: start;
}

.toolbar--import-preview {
    grid-template-columns: minmax(240px, 360px) auto;
}

.form-actions {
    align-self: end;
}

.toolbar--import-upload .import-upload__source {
    grid-column: 1;
    grid-row: 1;
}

.toolbar--import-upload .import-upload__source-help {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
}

.toolbar--import-upload .import-upload__file {
    grid-column: 2;
    grid-row: 1;
}

.toolbar--import-upload .import-upload__notes {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: start;
}

.toolbar--import-upload .import-upload__actions {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    align-self: end;
    justify-content: flex-end;
}

.toolbar--import-upload .import-upload__actions .btn {
    min-height: 44px;
}

/*
 * TripDB form composition: labels, Daisy controls, help, and validation are
 * laid out as one field. Daisy continues to own each control's structure and
 * state; keep this layer about relationships between those primitives.
 */
.field {
    display: grid;
    align-content: start;
    gap: 7px;
}

.form-help {
    margin: -6px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.modal--members h3 {
    margin: 24px 0 8px;
}

.modal--members .form-help {
    margin: 0 0 16px;
}

.modal--members .table-region + h3 {
    margin-top: 24px;
}

.field-label {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.field-help {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.field-required {
    display: inline-flex;
    align-items: flex-start;
    color: var(--danger);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    vertical-align: text-top;
}

.field--search {
    min-width: 0;
}

.field--numeric .input {
    width: 76px;
}

.field--wide {
    grid-column: 1 / -1;
}

.field--bounded {
    width: min(100%, var(--field-max-inline-size, 360px));
    max-width: 100%;
}

.filter-primary-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(118px, 1fr));
    align-items: end;
    gap: 12px;
    min-width: 0;
}

.filter-primary-row--compact {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.choice-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 8px 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.choice-fieldset {
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 16px;
    background: var(--surface);
    padding: 12px 14px 14px;
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.choice-fieldset > .fieldset-legend {
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 4px;
    transform: translateY(8px);
}

@media (hover: hover) {
    .choice-card:not(:has(input:disabled)):hover {
        border-color: var(--accent);
        background: var(--accent-soft);
    }
}

.choice-card:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.58;
}

.choice-card:has(input:focus-visible) {
    outline: 3px solid var(--focus-ring);
    outline-offset: -3px;
}

.choice-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

@media (hover: hover) {
    .choice-card:has(input:checked:not(:disabled)):hover {
        border-color: var(--accent-strong);
        background: color-mix(in oklab, var(--color-primary) 24%, var(--surface));
        box-shadow: inset 0 0 0 1px var(--accent);
    }
}

.choice-card:has(input:checked:not(:disabled)):active {
    background: color-mix(in oklab, var(--color-primary) 34%, var(--surface));
    translate: 0 1px;
}

.choice-card--compact {
    padding: 6px 9px;
    font-size: 13px;
    font-weight: 760;
    white-space: nowrap;
}

.choice-card--stacked {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
}

.closeout-outcome-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.choice-card .checkbox,
.choice-card .radio {
    margin: 0;
}

.choice-card--stacked > :is(.checkbox, .radio) {
    margin-top: 2px;
}

.import-option__body {
    display: grid;
    gap: 1px;
}

.import-option .import-option__title {
    color: var(--text);
    font-size: 14px;
    font-weight: 760;
}

.import-option .import-option__hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
}

.activity-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.activity-picker--compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.activity-picker__group {
    display: grid;
    align-content: start;
    gap: 6px;
}

.activity-picker__title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.activity-picker__choices {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 6px;
}

.activity-picker__choices .choice-card {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
}

.activity-picker__custom {
    max-width: 360px;
    margin-top: 10px;
}

.checkbox-row--compact {
    align-self: end;
}

.nav-links a:focus-visible,
.map-selection__trip-choice:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.inline-control,
.range-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-control .range {
    min-width: 240px;
}

.range-control output,
.inline-control span,
.status-text {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.btn[data-shortlist-add] {
    min-width: 96px;
}

.table-region {
    overflow-x: auto;
}

.table-region--modal {
    overflow-x: visible;
}

.result-summary {
    margin: 0 0 12px;
    border: 0;
    color: var(--muted);
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 720;
}

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

.filter-constraint-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-constraint-row > .field {
    width: 112px;
}

.htmx-indicator {
    visibility: hidden;
    opacity: 0;
    transition: opacity 120ms ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    visibility: visible;
    opacity: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1120px;
    table-layout: fixed;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 22%;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 17%;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 13%;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 8%;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 10%;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 12%;
}

.data-table th:nth-child(7),
.data-table td:nth-child(7) {
    width: 18%;
}

.import-review-table {
    min-width: 0;
}

.import-review-table th:nth-child(1),
.import-review-table td:nth-child(1) {
    width: 8%;
}

.import-review-table th:nth-child(2),
.import-review-table td:nth-child(2) {
    width: 20%;
}

.import-review-table th:nth-child(3),
.import-review-table td:nth-child(3) {
    width: 15%;
}

.import-review-table th:nth-child(4),
.import-review-table td:nth-child(4) {
    width: 14%;
}

.import-review-table th:nth-child(5),
.import-review-table td:nth-child(5) {
    width: 13%;
}

.import-review-table th:nth-child(6),
.import-review-table td:nth-child(6) {
    width: 13%;
}

.import-review-table th:nth-child(7),
.import-review-table td:nth-child(7) {
    width: 17%;
}

.import-review-table td {
    overflow-wrap: anywhere;
}

.import-review-table td[data-label="Review"] {
    line-height: 1.35;
}

.modal-table {
    min-width: 0;
}

.modal-table th,
.modal-table td {
    overflow-wrap: anywhere;
}

.members-table th:nth-child(1),
.members-table td:nth-child(1) {
    width: 24%;
}

.members-table th:nth-child(2),
.members-table td:nth-child(2) {
    width: 36%;
}

.members-table th:nth-child(3),
.members-table td:nth-child(3) {
    width: 28%;
}

.members-table th:nth-child(4),
.members-table td:nth-child(4) {
    width: 12%;
}

.invites-table th:nth-child(1),
.invites-table td:nth-child(1) {
    width: 38%;
}

.invites-table th:nth-child(2),
.invites-table td:nth-child(2) {
    width: 16%;
}

.invites-table th:nth-child(3),
.invites-table td:nth-child(3) {
    width: 18%;
}

.invites-table th:nth-child(4),
.invites-table td:nth-child(4) {
    width: 18%;
}

.invites-table th:nth-child(5),
.invites-table td:nth-child(5) {
    width: 10%;
}

.units-table {
    min-width: 1180px;
}

.unit-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.unit-identity__text {
    min-width: 0;
}

.unit-identity__text > strong,
.unit-identity__text > .row-note {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.units-access-table {
    min-width: 0;
}

.units-table th:nth-child(1),
.units-table td:nth-child(1) {
    width: 23%;
}

.units-table th:nth-child(2),
.units-table td:nth-child(2) {
    width: 18%;
}

.units-table th:nth-child(3),
.units-table td:nth-child(3) {
    width: 15%;
}

.units-table th:nth-child(4),
.units-table td:nth-child(4) {
    width: 13%;
}

.units-table th:nth-child(5),
.units-table td:nth-child(5) {
    width: 31%;
}

.member-role-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.data-table th {
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    overflow-wrap: anywhere;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    white-space: normal;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    vertical-align: middle;
}

.data-table td[data-label="Difficulty"] {
    white-space: nowrap;
}

.data-table td[data-label="Difficulty"] .badge {
    max-width: none;
}

.clickable-row {
    cursor: pointer;
}

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

.row-note {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.trip-row-badges {
    display: flex;
    flex-wrap: wrap;
    margin-top: 7px;
    gap: 5px;
    min-width: 0;
}

.trip-row-facts {
    display: flex;
    flex-wrap: wrap;
    margin-top: 6px;
    gap: 4px 10px;
    color: var(--muted);
    font-size: 13px;
}

.filter-toggle-row .choice-card {
    position: relative;
}

.filter-toggle-row {
    min-width: 0;
}

.filter-toggle-row .checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

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

.table-actions__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
}

.table-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
}

.data-table--discovery .table-actions__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-table--discovery .table-actions__inner .btn {
    min-width: 0;
}

.data-table--discovery .table-actions__copy {
    grid-column: 1 / -1;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 42px 20px;
    text-align: center;
}

.empty-state :is(h2, h3, p) {
    margin: 0;
}

.empty-state h2,
.empty-state h3 {
    font-size: 20px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.empty-state__actions {
    margin-top: 8px;
}

.supporting-copy {
    display: block;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.map-shell {
    height: 600px;
    min-height: 380px;
    max-height: calc(100vh - 300px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface-muted);
    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
}

.map-marker {
    align-items: center;
    background: var(--brand-field);
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgb(15 23 42 / 28%);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    min-height: 0;
    min-width: 22px;
    padding: 0 4px;
    transform: translateZ(0);
}

.map-marker:empty {
    padding: 0;
}

.map-marker:hover {
    box-shadow: 0 0 0 4px rgb(56 165 95 / 28%), 0 8px 18px rgb(0 24 19 / 32%);
}

.map-marker:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgb(7 91 65 / 90%), 0 8px 18px rgb(0 24 19 / 32%);
}

.map-marker--shared {
    background: var(--brand-route);
    color: #18352f;
    height: 30px;
    min-width: 30px;
}

.map-marker--cluster {
    background: var(--accent);
    color: var(--color-primary-content, #ffffff);
    height: 38px;
    min-width: 38px;
}

.map-route-endpoint {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 5px 14px rgb(15 23 42 / 32%);
    font-size: 11px;
    font-weight: 900;
    min-height: 0;
    pointer-events: none;
}

.map-route-marker {
    appearance: none;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
}

.map-route-marker:hover {
    box-shadow: 0 0 0 4px rgb(56 165 95 / 30%), 0 5px 14px rgb(0 24 19 / 34%);
}

.map-route-marker:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgb(7 91 65 / 90%), 0 5px 14px rgb(0 24 19 / 34%);
}

.map-route-endpoint--start {
    background: var(--brand-field);
    color: #ffffff;
}

.map-route-endpoint--end {
    background: var(--brand-route);
    color: #18352f;
}

.maplibregl-popup-content {
    background: #ffffff;
    color: #18352f;
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow);
}

.maplibregl-popup-close-button {
    z-index: 1;
    top: 5px;
    right: 5px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #c6d0cd;
    border-radius: 8px;
    background: #edf2f0;
    color: #18352f;
    padding: 0;
    font-size: 20px;
    font-weight: 750;
    line-height: 1;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.maplibregl-popup-close-button:hover {
    border-color: var(--brand-field);
    background: #dfe9e6;
}

.maplibregl-popup-close-button:focus-visible {
    outline: 2px solid var(--brand-field);
    outline-offset: 2px;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: #ffffff;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: #ffffff;
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #ffffff;
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #ffffff;
}

.map-popup {
    display: grid;
    gap: 8px;
    min-width: 220px;
    max-width: 320px;
}

.map-popup__header {
    display: grid;
    gap: 3px;
    padding-right: 34px;
}

.map-popup__header span {
    color: #5c6d67;
    font-size: 13px;
}

.map-popup__preview {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fbfcfc;
    color: #18352f;
    padding: 9px 10px;
}

.map-popup__preview strong {
    font-size: 13px;
}

.map-popup__preview > span {
    color: #5c6d67;
    font-size: 13px;
}

.map-popup .badge {
    border-color: #d8bd79;
    background: #f7ecd2;
    color: #533f14;
}

.map-popup .badge-ghost {
    border-color: #c6d0cd;
    background: #edf2f0;
    color: #42524d;
}

.map-popup__preview-badges,
.map-popup__actions,
.map-popup__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.map-popup__controls {
    justify-content: space-between;
}

.map-popup__controls span {
    color: #5c6d67;
    font-size: 13px;
    font-weight: 750;
}

.map-selection__card {
    display: grid;
    gap: 16px;
}

.map-selection__detail {
    display: grid;
    gap: 14px;
}

.map-selection__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.map-selection__header h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.map-selection__header p,
.map-selection__card > p {
    margin: 0;
    color: var(--muted);
}

.map-selection__actions,
.map-selection__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-selection__facts {
    margin-top: 0;
}

.map-selection__chooser {
    display: grid;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.map-selection__chooser h3 {
    margin: 0;
    font-size: 16px;
}

.map-selection__chooser p {
    margin: 2px 0 0;
    color: var(--muted);
}

.map-selection__choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
}

.map-selection__trip-choice {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 9px;
    text-align: left;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        translate 80ms ease;
}

.map-selection__trip-choice span {
    color: var(--muted);
    font-size: 13px;
}

.map-selection__trip-choice.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

@media (hover: hover) {
    .map-selection__trip-choice:not(.is-active):hover {
        border-color: var(--accent);
        background: var(--accent-soft);
    }

    .map-selection__trip-choice.is-active:hover {
        border-color: var(--accent-strong);
        background: color-mix(in oklab, var(--color-primary) 24%, var(--surface));
        box-shadow: inset 0 0 0 1px var(--accent);
    }
}

.map-selection__trip-choice:active {
    background: color-mix(in oklab, var(--color-primary) 34%, var(--surface));
    translate: 0 1px;
}

.empty-state--compact {
    padding: 24px;
}

/*
 * Atomic HTMX modal integration. Daisy owns the app's normal primitives, but
 * its modal component is deliberately excluded until this complete shell,
 * lifecycle, and all server-rendered payloads can migrate together.
 */
#modal {
    position: relative;
    z-index: 200;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100dvw;
    max-width: 100dvw;
    z-index: 100;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgb(4 24 20 / 0.7);
    padding: 24px;
    backdrop-filter: blur(10px);
}

.modal-backdrop--detail {
    align-items: center;
    justify-items: center;
}

.modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface-raised);
    box-shadow: 0 35px 100px rgb(0 0 0 / 0.42);
    color: var(--text);
    padding: 20px;
}

.modal--form {
    width: min(820px, 100%);
}

#trip-form {
    width: min(900px, 100%);
}

.modal--compact {
    width: min(460px, 100%);
}

#trip-closeout-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

#trip-closeout-form .modal__header {
    position: relative;
    top: auto;
}

.trip-closeout-form__body {
    min-height: 0;
    overflow-y: auto;
    padding: 0 4px 16px 0;
}

#trip-closeout-form .modal__actions {
    position: relative;
    z-index: 20;
    margin-top: 0;
    box-shadow: 0 -10px 20px rgba(26, 37, 34, 0.08);
}

.modal__header,
.modal__actions {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-color: var(--line);
    background: color-mix(in oklab, var(--surface-raised) 95%, transparent);
    backdrop-filter: blur(16px);
}

.modal__header {
    position: sticky;
    top: -20px;
    z-index: 20;
    margin: -20px -20px 18px;
    border-bottom: 1px solid var(--line);
    padding: 20px 20px 14px;
    justify-content: space-between;
}

.modal__header > div:first-child {
    min-width: 0;
}

.modal__actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin: 20px -20px -20px;
    border-top: 1px solid var(--line);
    padding: 14px 20px 16px;
}

.modal__actions .btn-error {
    margin-right: auto;
}

.icon-button[data-close-modal] {
    font-size: 22px;
}

.detail-hero p {
    margin: 4px 0 0;
    color: var(--muted);
}

.detail-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.detail-map-card {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.detail-map-card__map {
    position: relative;
    height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(21, 127, 118, 0.13) 23px 24px),
        repeating-linear-gradient(90deg, transparent 0 23px, rgba(21, 127, 118, 0.13) 23px 24px),
        #e7f2ef;
}

.detail-map-card__tiles {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.detail-map-card__tile {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
    opacity: 0;
}

.detail-map-card__tile[data-loaded="true"] {
    opacity: 1;
}

.detail-map-card__route-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 1px;
    height: 1px;
    overflow: visible;
    pointer-events: none;
}

.detail-map-card__route-path {
    fill: none;
    stroke: var(--brand-route);
    stroke-width: 5px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.detail-map-card__route-path--halo {
    stroke: var(--brand-forest);
    stroke-width: 9px;
}

.detail-map-card__route-endpoint {
    filter: drop-shadow(0 2px 3px rgb(15 23 42 / 28%));
}

.detail-map-card__route-endpoint-halo {
    fill: #fff;
    stroke: rgba(15, 23, 42, 0.22);
    stroke-width: 1px;
}

.detail-map-card__route-endpoint-dot {
    fill: var(--brand-field);
}

.detail-map-card__route-endpoint--end .detail-map-card__route-endpoint-dot {
    fill: var(--brand-route);
}

.detail-map-card__route-endpoint--end .detail-map-card__route-endpoint-label {
    fill: #18352f;
}

.detail-map-card__route-endpoint-label {
    dominant-baseline: central;
    fill: #fff;
    font-size: 8px;
    font-weight: 800;
    text-anchor: middle;
}

.detail-map-card__pin {
    position: relative;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 4px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    background: var(--accent);
    box-shadow: var(--shadow);
    transform: rotate(-45deg);
}

.detail-map-card__pin::after {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #ffffff;
    content: "";
}

.detail-map-card__pin--fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -70%) rotate(-45deg);
}

.detail-map-card__attribution {
    position: absolute;
    right: 6px;
    bottom: 4px;
    z-index: 3;
    border-radius: 4px;
    border: 1px solid rgb(24 53 47 / 18%);
    background: #ffffff;
    color: #18352f;
    font-size: 11px;
    font-weight: 650;
    padding: 2px 6px;
}

.detail-map-card__attribution:hover,
.detail-map-card__attribution:focus-visible {
    color: #0c5a47;
}

.detail-map-card__caption {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.detail-map-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 13px 14px;
}

.detail-grid dt {
    margin-bottom: 4px;
    color: var(--muted-faint);
    font-size: 9px;
    font-weight: 740;
    letter-spacing: 0.08em;
}

.detail-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 13px;
}

.detail-section {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 16px;
}

.detail-section h3 {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
}

.detail-section p {
    margin: 0;
    color: var(--muted);
}

.detail-section.import-notes-field > .collapse-title {
    min-height: 40px;
    padding: 8px 52px 8px 12px;
}

.detail-section.import-notes-field {
    border-top: 0;
    padding-top: 0;
}

.detail-section.import-notes-field > .collapse-content {
    padding: var(--tripdb-collapse-content-gap) 0 0;
}

.detail-section.import-notes-field p {
    max-height: 170px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 10px 12px;
    font-size: 13px;
    white-space: pre-wrap;
}

.detail-tags {
    border-top: 0;
    padding-top: 0;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.form-grid.unit-invite-form {
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) auto;
}

.form-grid--nested {
    margin-top: 8px;
}

.trip-form-intro {
    max-width: 560px;
    margin-bottom: 12px;
}

.trip-form-layout {
    display: grid;
    gap: 10px;
}

.trip-form-section {
    overflow: hidden;
    padding: 14px;
}

.trip-form-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.trip-form-section h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.2;
}

.trip-form-section__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
    align-items: start;
    gap: 14px;
    margin: 0;
    padding: 14px 52px 14px 14px;
}

.trip-form-section[open] > .trip-form-section__summary {
    margin-bottom: var(--tripdb-collapse-content-gap);
    border-bottom-color: var(--tripdb-collapse-control-border);
}

.trip-form-section__kicker,
.trip-form-section__title {
    display: block;
}

.trip-form-section__kicker {
    margin: 0 0 2px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    text-transform: uppercase;
}

.trip-form-section__title {
    color: var(--text);
    font-size: 16px;
    font-weight: 780;
    line-height: 1.2;
}

.trip-form-section__hint {
    width: 190px;
    max-width: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.trip-form-section__body {
    display: grid;
    gap: 12px;
    padding: 0;
}

.trip-form-section__body > .form-grid--nested {
    margin-top: 0;
}

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

.trip-form-metrics .field {
    align-content: start;
}

.trip-form-toggles .choice-card {
    flex: 1 1 150px;
    min-width: 0;
}

.lifecycle-field {
    margin: 0;
    border: 0;
    padding: 0;
}

.lifecycle-field > .field-label {
    margin-bottom: 3px;
    color: var(--text);
    font-weight: 760;
}

.lifecycle-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.lifecycle-option span,
.lifecycle-option small {
    display: block;
}

.lifecycle-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 560;
    line-height: 1.35;
}

.trip-form-actions {
    align-items: center;
}

.trip-form-actions__primary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.trip-form-actions__note {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.geocode-field {
    position: relative;
}

.geocode-options {
    position: relative;
    z-index: 2;
}

.geocode-options__list,
.geocode-options__empty {
    position: absolute;
    inset-inline: 0;
    top: 4px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.geocode-options__empty {
    color: var(--muted);
    padding: 10px 12px;
}

.geocode-options__status {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.geocode-option {
    display: grid;
    width: 100%;
    gap: 3px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    text-align: left;
}

.geocode-option:last-child {
    border-bottom: 0;
}

.geocode-option:hover,
.geocode-option:focus {
    background: var(--accent-soft);
}

.geocode-option:focus-visible {
    z-index: 1;
    outline: 3px solid var(--focus-ring);
    outline-offset: -3px;
}

.geocode-option span {
    color: var(--text);
    font-size: 14px;
    font-weight: 720;
    line-height: 1.25;
}

.geocode-option small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.import-notes-field {
    border-top: 0;
    padding-top: 0;
}

.import-notes-field > .collapse-title {
    min-height: 40px;
    padding: 8px 52px 8px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.import-notes-field > .collapse-content {
    padding: var(--tripdb-collapse-content-gap) 0 0;
}

.import-notes-field .textarea {
    margin-top: 0;
}

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

.calendar-event {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
}

.calendar-event__date {
    display: grid;
    align-content: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--accent-soft), var(--surface-muted));
    padding: 12px;
    text-align: center;
}

.calendar-event__date span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.calendar-event__date strong {
    font-size: 20px;
}

.calendar-event__body {
    display: grid;
    align-content: start;
    gap: 10px;
}

.calendar-event__body header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.calendar-event__body h2,
.calendar-event__body p {
    margin: 0;
}

.calendar-event__body h2 {
    font-size: 19px;
    line-height: 1.2;
}

.calendar-event__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.calendar-event__body p {
    color: var(--muted);
}

.calendar-event__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.calendar-event__meta div {
    border-radius: 8px;
    background: var(--surface-muted);
    padding: 8px 10px;
}

.calendar-event__meta span,
.calendar-event__notes h3 {
    display: block;
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.calendar-event__meta strong {
    display: block;
    font-size: 14px;
    line-height: 1.25;
}

.calendar-event__notes {
    display: grid;
    gap: 4px;
}

.calendar-event__description {
    white-space: pre-line;
}

.calendar-event__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meeting-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 16px;
}

.meeting-results__candidates {
    min-width: 0;
}

.meeting-card-grid {
    display: grid;
    gap: 14px;
}

.meeting-card {
    gap: 16px;
}

.meeting-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.meeting-card__header > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.meeting-card__header form {
    flex: 0 0 auto;
}

.meeting-card__header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
}

.meeting-card__header p,
.meeting-card > p {
    margin: 0;
    color: var(--muted);
}

.meeting-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.meeting-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.shortlist-panel {
    position: sticky;
    top: 84px;
    scroll-margin-top: 84px;
    gap: 14px;
}

.shortlist-panel h2 {
    margin: 0;
    font-size: 20px;
}

.shortlist-panel__actions {
    align-items: center;
    margin: 0;
}

.shortlist-panel__actions form {
    margin: 0;
}

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

.shortlist__item {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px;
}

.shortlist__item strong,
.shortlist__item span {
    display: block;
}

.shortlist__item span {
    color: var(--muted);
    font-size: 13px;
}

.shortlist__status,
.shortlist__item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.shortlist__status {
    margin-top: 7px;
}

.shortlist__item-actions {
    align-items: center;
}

.shortlist__item-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

@media (max-width: 980px) {
    .filter-primary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-primary-row .field--search {
        grid-column: 1 / -1;
    }

    .table-region {
        overflow-x: visible;
    }

    .result-summary {
        margin-bottom: 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .data-table th:nth-child(n),
    .data-table td:nth-child(n) {
        width: 100%;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        margin: -1px;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .data-table {
        border-collapse: separate;
        border-spacing: 0 10px;
    }

    .data-table tbody tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: 0 8px 20px rgba(26, 37, 34, 0.08);
        overflow: hidden;
    }

    .data-table td {
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
    }

    .data-table td::before {
        display: block;
        margin-bottom: 3px;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 760;
        text-transform: uppercase;
    }

    .data-table td:first-child {
        display: block;
        background: var(--surface);
        padding: 12px;
    }

    .data-table td:first-child::before {
        display: none;
    }

    .data-table .table-actions {
        text-align: left;
        white-space: normal;
    }

    .data-table .table-actions__inner {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .data-table .table-actions__inner .btn {
        width: auto;
    }

    .data-table .table-actions--empty {
        display: none;
    }

    .member-role-form {
        grid-template-columns: 1fr auto;
        max-width: 360px;
    }

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

@media (min-width: 761px) and (max-width: 980px) {
    .trip-results-table tbody tr,
    .data-table--discovery tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trip-results-table td:nth-child(n),
    .data-table--discovery td:nth-child(n) {
        width: auto;
        min-width: 0;
    }

    .trip-results-table td:first-child,
    .trip-results-table td:nth-child(6),
    .trip-results-table .table-actions,
    .data-table--discovery td:first-child,
    .data-table--discovery td:nth-child(6),
    .data-table--discovery .table-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .app-frame {
        width: min(100% - 20px, 1180px);
    }

    .page-header,
    .map-selection__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-toggle-row::-webkit-scrollbar,
    .activity-picker__choices::-webkit-scrollbar {
        display: none;
    }

    .page {
        padding: 20px 0 32px;
    }

    .page-header__actions,
    .button-row {
        width: 100%;
    }

    .button-row .btn {
        flex: 1 1 150px;
        width: auto;
    }

    .page-header > .btn {
        align-self: flex-start;
        width: auto;
        flex: 0 0 auto;
    }

    .session-card {
        align-items: stretch;
        flex-direction: column;
    }

    .session-card form,
    .session-card .btn {
        width: 100%;
    }

    .layout-switch {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .button-row {
        justify-content: flex-start;
    }

    .input,
    .select,
    .textarea,
    .file-input {
        min-height: 44px;
        font-size: 16px;
    }

    .toolbar,
    .unit-create-form__primary,
    .unit-create-form__advanced-fields,
    .stats-panel__body,
    .form-grid,
    .detail-grid,
    .meeting-layout {
        grid-template-columns: 1fr;
    }

    .unit-create-form__name {
        grid-column: auto;
    }

    .unit-create-form__location {
        grid-column: auto;
    }

    .summary-metrics {
        display: grid;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .summary-metrics > span {
        display: grid;
        min-width: 0;
        min-height: 54px;
        align-content: center;
        justify-items: center;
        gap: 3px;
        text-align: center;
        white-space: normal;
    }

    .summary-metric-label {
        overflow-wrap: anywhere;
    }

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

    .toolbar .btn {
        width: 100%;
    }

    .filter-primary-row {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        gap: 8px;
    }

    .filter-toggle-row {
        flex-wrap: wrap;
        overflow: visible;
        margin-inline: 0;
        padding: 0;
        scroll-snap-type: none;
    }

    .filter-toggle-row .choice-card {
        flex: 0 1 auto;
        min-height: 42px;
    }

    .filter-constraint-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .filter-constraint-row > .field {
        width: 100%;
    }

    .inline-control {
        align-items: stretch;
    }

    .field--numeric .input {
        width: 100%;
    }

    .calendar-event__body header {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-event__badges {
        justify-content: flex-start;
    }

    .calendar-event__meta {
        grid-template-columns: 1fr;
    }

    .calendar-event__date {
        padding: 10px;
    }

    .shortlist-panel {
        position: static;
        margin-top: 0;
    }

    .range-control {
        align-items: stretch;
        flex-direction: column;
    }

    .range-control .range {
        min-width: 0;
    }

    .badge {
        min-height: 24px;
        font-size: 12px;
    }

    .map-shell {
        height: min(58vh, 430px);
        min-height: 320px;
        max-height: none;
    }

    .maplibregl-popup-content {
        max-width: calc(100vw - 40px);
        padding: 8px;
    }

    .map-popup {
        width: min(270px, calc(100vw - 64px));
        min-width: 0;
        gap: 5px;
    }

    .map-popup__header span,
    .map-popup__preview > span {
        font-size: 12px;
        line-height: 1.25;
    }

    .map-popup__preview {
        gap: 2px;
        padding: 6px 8px;
    }

    .map-popup .badge {
        min-height: 20px;
        padding: 2px 7px;
        font-size: 10px;
    }

    .map-popup__actions .btn {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .card--padded {
        padding: 14px;
    }

    .map-selection__actions .btn,
    .trip-card__actions .btn {
        flex: 1 1 120px;
    }

    .map-selection__choice-list {
        grid-template-columns: 1fr;
        max-height: 220px;
    }

    .activity-picker {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .activity-picker__choices {
        gap: 6px;
    }

    .activity-picker__choices .choice-card {
        min-height: 40px;
    }

    .activity-picker__custom {
        max-width: none;
        margin-top: 8px;
    }

    .trip-form-intro {
        margin: -4px 0 10px;
    }

    .trip-form-layout {
        gap: 9px;
    }

    .trip-form-section {
        padding: 10px;
    }

    .trip-form-section__header,
    .trip-form-section__summary {
        gap: 10px;
    }

    .trip-form-section__summary {
        grid-template-columns: minmax(0, 1fr);
        margin: 0;
        padding: 10px 52px 10px 12px;
    }

    .trip-form-section[open] > .trip-form-section__summary {
        margin-bottom: var(--tripdb-collapse-content-gap);
    }

    .trip-form-section__hint {
        grid-column: 1 / -1;
        width: auto;
        max-width: none;
        margin-top: 2px;
        text-align: left;
    }

    .form-grid--nested {
        gap: 10px;
        grid-template-columns: 1fr;
    }

    .trip-form-toggles .choice-card {
        flex-basis: min(100%, 180px);
    }

    .geocode-options__list {
        max-height: min(320px, 45vh);
        overflow-y: auto;
    }

    .modal-backdrop {
        align-items: end;
        justify-items: stretch;
        padding: 10px 0 0;
    }

    .modal {
        width: 100%;
        max-height: 92dvh;
        border-bottom: 0;
        border-radius: 14px 14px 0 0;
        padding: 16px;
    }

    .modal__header {
        top: -16px;
        margin: -16px -16px 14px;
        padding: 16px;
    }

    .modal__actions {
        display: grid;
        grid-template-columns: 1fr;
        margin: 18px -16px -16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .modal__actions .btn {
        width: 100%;
    }

    .modal__actions .btn-error {
        order: 3;
        margin-right: 0;
    }

    .modal__actions .btn-primary {
        order: 2;
    }

    .unit-invite-form__actions .btn,
    .member-role-form .btn {
        width: 100%;
    }

    .member-role-form {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .trip-form-actions__primary {
        display: grid;
        order: 2;
        width: 100%;
        gap: 8px;
    }

    .trip-form-actions__note {
        text-align: center;
    }

    .modal-backdrop--detail .modal {
        width: min(390px, calc(100dvw - 24px));
        max-height: calc(100dvh - 24px);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 14px;
    }

    .modal-backdrop--detail .modal__header {
        top: -14px;
        margin: -14px -14px 12px;
        padding: 14px;
    }

    .modal-backdrop--detail .modal__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 16px -14px -14px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .modal-backdrop--detail .modal__actions .btn {
        width: 100%;
    }

    .modal-backdrop--detail .modal__actions > .btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .closeout-outcome-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .closeout-outcome-options .choice-card {
        justify-content: center;
        min-width: 0;
        text-align: center;
        white-space: normal;
    }

    .closeout-outcome-options .choice-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .modal-backdrop--detail .detail-map-card__map {
        height: 180px;
    }

    .modal-backdrop--detail .detail-grid {
        gap: 8px;
        margin-bottom: 14px;
    }

    .modal-backdrop--detail .detail-grid div {
        padding: 8px 10px;
    }

}

/* Current-unit control center */
.unit-control-header__identity,
.unit-profile-presentation,
.unit-logo-editor {
    display: flex;
    min-width: 0;
    gap: 16px;
}

.unit-control-header__identity {
    align-items: center;
}

.unit-avatar--control {
    width: 64px;
    height: 64px;
}

.unit-avatar--profile {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
}

.unit-setup-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.4fr);
    gap: 22px;
    margin-bottom: 18px;
}

.unit-setup-card h2,
.unit-control-card h2 {
    margin: 2px 0 6px;
    font-size: 20px;
}

.unit-setup-card p,
.unit-control-card p {
    margin: 0;
    color: var(--muted);
}

.unit-setup-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.unit-setup-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 10px;
}

.unit-setup-list li.is-complete {
    background: color-mix(in oklab, var(--color-success, #2f855a) 8%, var(--surface));
}

.unit-setup-list__status {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-weight: 800;
}

.unit-setup-list .is-complete .unit-setup-list__status {
    background: var(--color-success, #2f855a);
    color: var(--surface);
}

.unit-setup-list strong,
.unit-setup-list small {
    display: block;
}

.unit-setup-list small {
    margin-top: 2px;
    color: var(--muted);
}

.unit-setup-card__actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.unit-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.unit-control-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-margin-top: 20px;
}

.unit-control-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.unit-control-card--danger {
    border-color: color-mix(in oklab, var(--color-error, #b94b3f) 38%, var(--line));
}

.unit-control-facts {
    display: grid;
    gap: 8px;
    margin: 0;
}

.unit-control-facts > div {
    display: grid;
    grid-template-columns: minmax(100px, 0.4fr) minmax(0, 1fr);
    gap: 12px;
}

.unit-control-facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.unit-control-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.unit-profile-presentation {
    align-items: flex-start;
}

.unit-profile-presentation .unit-control-facts {
    flex: 1 1 auto;
}

.modal--unit-settings {
    width: min(760px, calc(100vw - 32px));
}

.unit-settings-section {
    display: grid;
    gap: 14px;
    margin-top: 0;
    padding: var(--tripdb-collapse-content-gap) 14px 16px;
}

details.collapse > .collapse-content > .form-help:first-child {
    margin: 0 0 2px;
}

.unit-coordinate-details {
    --tripdb-collapse-summary-radius: 10px;
    border: 0;
    padding: 0;
}

.unit-coordinate-details > .collapse-title {
    min-height: 42px;
    padding: 10px 52px 10px 12px;
    color: var(--muted);
    font-weight: 700;
}

.unit-coordinate-details__content {
    display: grid;
    gap: 12px;
    padding: var(--tripdb-collapse-content-gap) 12px 12px;
}

.unit-coordinate-details__content .form-grid {
    margin-top: 0;
}

.unit-logo-editor {
    align-items: end;
}

.unit-logo-editor > :first-child {
    flex: 0 0 110px;
}

.unit-logo-editor > .field {
    flex: 1 1 auto;
}

.unit-logo-editor__preview {
    position: relative;
    display: block;
    width: 72px;
    height: 72px;
    margin-top: 6px;
}

.unit-logo-editor__preview > img {
    position: absolute;
    inset: 0;
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: var(--surface);
    object-fit: contain;
}

.unit-invite-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 10px;
}

.unit-role-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.unit-role-guide > div {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 10px;
}

.unit-role-guide span {
    color: var(--muted);
    font-size: 12px;
}

.unit-invite-history {
    margin-top: 22px;
    border-top: 0;
    padding-top: 0;
}

.unit-invite-history > .collapse-title {
    min-height: 40px;
    padding: 8px 52px 8px 12px;
    color: var(--accent-strong);
    font-weight: 760;
}

.unit-invite-history > .collapse-content {
    padding: var(--tripdb-collapse-content-gap) 0 0;
}

.unit-invite-history .table-region {
    margin-top: 0;
}

.modal--members .members-table th:nth-child(1),
.modal--members .members-table td:nth-child(1) {
    width: 34%;
}

.modal--members .members-table th:nth-child(2),
.modal--members .members-table td:nth-child(2) {
    width: 44%;
}

.modal--members .members-table th:nth-child(3),
.modal--members .members-table td:nth-child(3) {
    width: 22%;
}

@media (max-width: 980px) {
    .modal--members .members-table th:nth-child(n),
    .modal--members .members-table td:nth-child(n) {
        width: 100%;
    }
}

.import-readiness-callout {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
}

.import-readiness-callout p {
    margin: 3px 0 0;
    color: var(--muted);
}

@media (max-width: 860px) {
    .unit-setup-card,
    .unit-control-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .unit-control-header__identity,
    .unit-profile-presentation,
    .unit-logo-editor {
        align-items: stretch;
        flex-direction: column;
    }

    .import-readiness-callout {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .unit-control-card > header {
        align-items: stretch;
        flex-direction: column;
    }

    .unit-setup-list li {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .unit-setup-list li .btn {
        grid-column: 2;
        justify-self: start;
    }

    .unit-setup-card__actions,
    .unit-control-card__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .unit-role-guide,
    .unit-invite-link {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .app-frame {
        width: calc(100% - 16px);
    }

    .toolbar {
        margin-inline: -2px;
    }

    .data-table td::before {
        margin-bottom: 1px;
    }

    .map-shell {
        height: 360px;
        min-height: 300px;
    }

    .detail-map-card__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .map-selection__actions {
        display: flex;
        width: 100%;
    }

    .map-selection__actions .btn {
        flex: 1 1 96px;
    }

    .modal {
        max-height: 94dvh;
        padding: 12px;
    }

    .modal__header {
        top: -12px;
        margin: -12px -12px 12px;
        padding: 12px;
    }

    .modal__actions {
        margin: 14px -12px -12px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .trip-form-section__header,
    .trip-form-section__summary {
        flex-wrap: wrap;
    }

    .trip-form-section {
        padding: 9px;
    }

    .trip-form-section__summary {
        grid-template-columns: minmax(0, 1fr);
        margin: 0;
        padding: 9px 52px 9px 12px;
    }

    .trip-form-section[open] > .trip-form-section__summary {
        margin-bottom: var(--tripdb-collapse-content-gap);
    }

    .trip-form-section__hint {
        grid-column: 1 / -1;
        width: auto;
        max-width: none;
        text-align: left;
    }

    .trip-form-section__title {
        font-size: 15px;
    }

    .trip-form-actions__note {
        display: none;
    }

}

/* Scout-year leaderboard */
.leaderboard-period-form {
    display: grid;
    min-width: min(100%, 330px);
    gap: 6px;
}

.leaderboard-period-form__control {
    display: flex;
    gap: 8px;
}

.leaderboard-period-form__control .select {
    flex: 1 1 auto;
    min-width: 0;
}

.leaderboard-period {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(460px, 1.3fr);
    align-items: center;
    gap: 20px;
    background:
        radial-gradient(circle at 82% 0%, color-mix(in oklab, var(--color-secondary) 18%, transparent), transparent 38%),
        linear-gradient(135deg, color-mix(in oklab, var(--accent) 8%, var(--surface-raised)), var(--surface-raised));
    padding: 20px;
}

.leaderboard-period h2,
.leaderboard-standing h2,
.leaderboard-board h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 500;
}

.leaderboard-period__metrics,
.leaderboard-standing__breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leaderboard-standing__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}

.leaderboard-standing__result {
    display: flex;
    gap: 8px;
}

.leaderboard-standing__breakdown {
    padding: 0 20px 20px;
}

.leaderboard-standing__breakdown small {
    display: block;
    margin-top: 3px;
}

.leaderboard-standing__unranked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 20px 20px;
}

.leaderboard-standing__notice {
    margin: 0 20px 20px;
}

.leaderboard-board__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 12px;
}

.leaderboard-table {
    min-width: 820px;
}

.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) { width: 8%; }
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) { width: 32%; }
.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3) { width: 13%; }
.leaderboard-table th:nth-child(n+4),
.leaderboard-table td:nth-child(n+4) { width: 15.66%; }

.leaderboard-table tbody th {
    background: transparent;
    color: var(--text);
    font-size: inherit;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}

.leaderboard-table tbody tr:last-child > * {
    border-bottom: 0;
}

.leaderboard-table tbody tr.is-current > * {
    background: var(--accent-soft);
}

.leaderboard-table tbody tr.is-current > :first-child {
    box-shadow: inset 4px 0 0 var(--accent);
}

.leaderboard-rank {
    min-width: 30px;
    justify-content: center;
}

.leaderboard-unit {
    display: grid;
    gap: 2px;
}

.leaderboard-unit strong,
.leaderboard-unit small {
    overflow-wrap: anywhere;
}

.leaderboard-unit small,
.leaderboard-table td > small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.leaderboard-unit em {
    width: max-content;
    margin-top: 3px;
    font-style: normal;
}

.leaderboard-table__points strong {
    color: var(--accent-strong);
    font-size: 20px;
}

.leaderboard-empty {
    box-shadow: none;
}

.leaderboard-empty h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.discovery-stats__leaderboard-link {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.discovery-stats__leaderboard-link > span {
    display: grid;
    gap: 3px;
}

.discovery-stats__leaderboard-link small {
    color: var(--muted);
}

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

    .leaderboard-table,
    .leaderboard-table tbody {
        display: grid;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }

    .leaderboard-table tbody tr {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        width: 100%;
        overflow: hidden;
    }

    .leaderboard-table.data-table tbody tr > th,
    .leaderboard-table.data-table tbody tr > td {
        display: block;
        width: auto;
        min-width: 0;
    }

    .leaderboard-table tbody td:first-child,
    .leaderboard-table tbody th[scope="row"],
    .leaderboard-table__points {
        grid-row: 1;
        border-bottom: 1px solid var(--line);
        background: var(--surface-raised);
    }

    .leaderboard-table tbody th[scope="row"] {
        grid-column: 2 / 6;
    }

    .leaderboard-table__points {
        grid-column: 6;
        text-align: right;
    }

    .leaderboard-table tbody td:first-child,
    .leaderboard-table tbody .leaderboard-table__points {
        padding-right: 6px;
        padding-left: 6px;
    }

    .leaderboard-table tbody tr:last-child > td:first-child,
    .leaderboard-table tbody tr:last-child > th[scope="row"],
    .leaderboard-table tbody tr:last-child > .leaderboard-table__points {
        border-bottom: 1px solid var(--line);
    }

    .leaderboard-table tbody td:nth-child(n+4) {
        border-bottom: 0;
        background: var(--surface-muted);
    }

    .leaderboard-table.data-table tbody tr.is-current > * {
        background: var(--accent-soft);
    }

    .leaderboard-table tbody td:nth-child(4) { grid-column: 1 / 3; }
    .leaderboard-table tbody td:nth-child(5) { grid-column: 3 / 5; }
    .leaderboard-table tbody td:nth-child(6) { grid-column: 5 / 7; }

    .leaderboard-table tbody tr.is-current > :first-child {
        box-shadow: inset 4px 0 0 var(--accent);
    }
}

@media (max-width: 760px) {
    .leaderboard-table tbody tr {
        grid-template-columns: repeat(15, minmax(0, 1fr));
    }

    .leaderboard-table tbody td:first-child {
        grid-column: 1 / 3;
    }

    .leaderboard-table tbody th[scope="row"] {
        grid-column: 3 / 13;
    }

    .leaderboard-table__points {
        grid-column: 13 / 16;
    }

    .leaderboard-table tbody td:first-child,
    .leaderboard-table tbody .leaderboard-table__points {
        padding-right: 4px;
        padding-left: 4px;
    }

    .leaderboard-table tbody td:nth-child(4) { grid-column: 1 / 6; }
    .leaderboard-table tbody td:nth-child(5) { grid-column: 6 / 11; }
    .leaderboard-table tbody td:nth-child(6) { grid-column: 11 / 16; }

    .leaderboard-period-form,
    .leaderboard-period-form__control {
        width: 100%;
    }

    .leaderboard-period,
    .leaderboard-standing__heading {
        padding: 16px;
    }

    .leaderboard-period__metrics,
    .leaderboard-standing__breakdown {
        grid-template-columns: 1fr;
    }

    .leaderboard-standing__heading,
    .leaderboard-standing__unranked,
    .leaderboard-board__heading,
    .discovery-stats__leaderboard-link {
        align-items: stretch;
        flex-direction: column;
    }

    .leaderboard-standing__breakdown {
        padding: 0 16px 16px;
    }

    .leaderboard-standing__unranked,
    .leaderboard-standing__notice {
        margin: 0 16px 16px;
    }

    .leaderboard-standing__unranked .btn,
    .discovery-stats__leaderboard-link .btn {
        width: 100%;
    }
}

.ui-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ui-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
    overflow-x: clip;
}

.desktop-rail {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--rail-width);
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 26px 18px 22px;
    border-right: 1px solid rgb(213 236 185 / 0.12);
    background:
        radial-gradient(circle at 14% 3%, rgb(95 186 112 / 0.2), transparent 14rem),
        linear-gradient(180deg, #032f28 0%, #011d18 56%, #001612 100%);
    color: var(--brand-cream);
    backdrop-filter: blur(22px);
}

.desktop-rail::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(152deg, transparent 0 76%, rgb(255 202 75 / 0.06) 76.2% 76.6%, transparent 76.8%),
        radial-gradient(circle at 72% 16%, rgb(213 236 185 / 0.08), transparent 9rem);
    content: "";
    pointer-events: none;
}

.desktop-rail > * {
    position: relative;
    z-index: 1;
}

.app-shell__content {
    min-height: 100vh;
    margin-left: var(--rail-width);
}

.app-shell__content > .app-frame {
    width: min(1500px, calc(100% - (2 * var(--page-gutter))));
}

.topbar,
.mobile-dock {
    display: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: var(--text);
    letter-spacing: 0;
}

.brand__mark {
    display: inline-grid;
    width: 41px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0;
}

.brand__mark--adventure {
    overflow: visible;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.brand__mark-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 0 0.7px rgb(241 237 207 / 0.58))
        drop-shadow(0 8px 12px rgb(0 24 19 / 0.26));
}

.brand__text {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.brand__name {
    display: flex;
    min-width: 0;
    gap: 0.26em;
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.brand__name,
.brand__location {
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__location {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.1;
    white-space: nowrap;
}

.brand__name span:last-child {
    color: var(--brand-route);
}

.brand__tagline {
    color: rgb(241 237 207 / 0.62);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand--rail {
    align-items: center;
    color: var(--brand-cream);
}

.brand--rail .brand__mark {
    width: 49px;
    height: 57px;
}

.brand--rail .brand__text {
    gap: 5px;
}

.brand--rail .brand__name {
    display: grid;
    gap: 0;
    font-size: 20px;
    line-height: 0.86;
}

.rail-nav,
.nav-links.nav-links--desktop {
    display: grid;
    gap: 6px;
    margin-top: 38px;
}

.nav-links .nav-link {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 45px;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;
    border: 0;
    border-radius: 13px;
    padding: 0 13px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 680;
    text-align: left;
    transition: 150ms ease;
}

.nav-links .nav-link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.nav-links .nav-link--active {
    background: var(--accent-soft);
    color: var(--text);
}

.nav-links .nav-link--active::before {
    position: absolute;
    left: -18px;
    width: 4px;
    height: 22px;
    border-radius: 0 5px 5px 0;
    background: var(--accent);
    content: "";
}

.nav-links .nav-account-link {
    max-width: none;
    overflow: visible;
    border: 0;
    font-weight: 680;
}

.nav-links .nav-account-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-rail .nav-links .nav-link {
    color: rgb(241 237 207 / 0.7);
}

.desktop-rail .nav-links .nav-link:hover {
    background: rgb(213 236 185 / 0.08);
    color: var(--brand-cream);
}

.desktop-rail .nav-links .nav-link--active {
    background: linear-gradient(90deg, rgb(56 165 95 / 0.2), rgb(213 236 185 / 0.08));
    color: var(--brand-celadon);
}

.desktop-rail .nav-links .nav-link--active::before {
    background: var(--brand-route);
    box-shadow: 0 0 12px rgb(255 202 75 / 0.45);
}

.rail-context {
    display: grid;
    grid-template-columns: 41px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid rgb(213 236 185 / 0.13);
    border-radius: 14px;
    color: inherit;
    padding: 20px 8px 14px;
    transition: background-color 150ms ease;
}

.rail-context:hover {
    background: rgb(213 236 185 / 0.08);
}

.rail-context:focus-visible {
    outline: 3px solid var(--brand-route);
    outline-offset: 2px;
}

.rail-context .eyebrow {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1px;
    color: var(--brand-gold);
}

.rail-context__action {
    color: rgb(241 237 207 / 0.62);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.rail-context > span:last-child,
.rail-context > span:last-child strong,
.rail-context > span:last-child small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-context > span:last-child strong {
    color: var(--brand-cream);
    font-size: 13px;
    transition: color 150ms ease;
}

.rail-context:hover > span:last-child strong {
    color: var(--brand-celadon);
}

.rail-context > span:last-child small {
    margin-top: 3px;
    color: rgb(241 237 207 / 0.58);
    font-size: 11px;
}

.unit-avatar {
    position: relative;
    display: block;
    width: 41px;
    height: 41px;
    overflow: hidden;
    border-radius: 13px;
    background: linear-gradient(140deg, var(--brand-gold), var(--brand-leaf));
    color: var(--brand-forest);
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 8px 20px rgb(0 16 12 / 0.28);
    transform: rotate(-3deg);
}

.unit-avatar__fallback {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: auto auto;
    place-content: center;
    gap: 1px;
}

.unit-avatar__fallback small {
    align-self: end;
    margin-bottom: 1px;
    font-size: 9px;
}

.unit-avatar--logo {
    transform: none;
}

.unit-avatar__image {
    position: absolute;
    inset: 3px;
    display: block;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border-radius: 10px;
    background: rgb(241 237 207 / 0.94);
    object-fit: contain;
}

.unit-avatar__image[hidden] {
    display: none;
}

.unit-avatar--table {
    flex: 0 0 auto;
}

.rail-footer {
    border-top: 1px solid rgb(213 236 185 / 0.13);
    padding-top: 10px;
}

.theme-toggle.btn {
    --btn-p: 12px;
    gap: 11px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 720;
}

.desktop-rail a:not(.btn):focus-visible {
    outline-color: var(--brand-route);
}

.page {
    padding: 42px 0 80px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.layout-switch {
    --tab-height: 42px;
    margin-bottom: 18px;
}

.btn {
    --size: 42px;
    --btn-p: 15px;
    --fontsize: 12px;
    font-weight: 780;
    line-height: 1;
    text-transform: none;
}

.input,
.select,
.textarea,
.file-input {
    --size: 44px;
    border-color: var(--line-strong);
    /* Preserve Daisy's select chevrons, which are background images. */
    background-color: var(--surface);
    color: var(--text);
}

.field :is(.input, .select, .textarea, .file-input) {
    width: 100%;
}

.textarea {
    min-height: 88px;
}

.checkbox,
.radio,
.range {
    accent-color: var(--accent);
}

.stats-panel__scope-note {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.result-pagination {
    justify-content: center;
    margin: 18px 0 4px;
}

.result-pagination .status-text {
    min-width: 110px;
    text-align: center;
}

.data-table tbody tr.clickable-row:hover {
    background: var(--accent-soft);
}

.badge {
    --size: 25px;
    --badge-color: color-mix(in oklab, var(--color-secondary) 46%, var(--line));
    --badge-bg: color-mix(in oklab, var(--color-secondary) 18%, var(--surface));
    --badge-fg: var(--text);
    font-size: 11px;
    font-weight: 780;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.badge-success {
    --badge-color: color-mix(in oklab, var(--color-success) 44%, var(--line));
    --badge-bg: color-mix(in oklab, var(--color-success) 15%, var(--surface));
    --badge-fg: var(--text);
}

.badge-info {
    --badge-color: color-mix(in oklab, var(--color-info) 44%, var(--line));
    --badge-bg: color-mix(in oklab, var(--color-info) 15%, var(--surface));
    --badge-fg: var(--text);
}

.badge-warning {
    --badge-color: color-mix(in oklab, var(--color-warning) 50%, var(--line));
    --badge-bg: color-mix(in oklab, var(--color-warning) 17%, var(--surface));
    --badge-fg: var(--text);
}

.badge-ghost {
    --badge-color: var(--line-strong);
    --badge-bg: var(--surface-muted);
    --badge-fg: var(--text);
}

.badge-accent {
    --badge-color: color-mix(in oklab, var(--color-accent) 42%, var(--line));
    --badge-bg: color-mix(in oklab, var(--color-accent) 14%, var(--surface));
    --badge-fg: var(--text);
}

.trip-difficulty-badge {
    width: max-content;
    max-width: none;
    flex-shrink: 0;
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: keep-all;
}

.trip-difficulty-badge--easy {
    border-color: color-mix(in oklab, #166534 38%, var(--line));
    background: #dcfce7;
    color: #166534;
}

.trip-difficulty-badge--moderate {
    border-color: color-mix(in oklab, #92400e 38%, var(--line));
    background: #fef3c7;
    color: #92400e;
}

.trip-difficulty-badge--hard {
    border-color: color-mix(in oklab, #9a3412 38%, var(--line));
    background: #ffedd5;
    color: #9a3412;
}

.trip-difficulty-badge--strenuous {
    border-color: color-mix(in oklab, #be123c 38%, var(--line));
    background: #ffe4e6;
    color: #be123c;
}

.trip-explorer-hero {
    display: grid;
    min-height: 430px;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
    overflow: hidden;
    margin-bottom: 26px;
    border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line));
    border-radius: 28px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.trip-explorer-hero__art {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    background: #163f36;
}

.trip-explorer-hero__art::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 68%, rgb(4 28 24 / 0.24));
    content: "";
    pointer-events: none;
}

.trip-explorer-hero__art svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.trip-explorer-hero__activity,
.trip-explorer-hero__route {
    position: absolute;
    z-index: 2;
    top: 24px;
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 999px;
    background: rgb(3 30 25 / 0.7);
    padding: 0 12px;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.trip-explorer-hero__activity {
    left: 24px;
    color: white;
}

.trip-explorer-hero__route {
    right: 24px;
    border-color: rgb(255 202 93 / 0.35);
    color: #ffdc88;
}

.trip-explorer-hero__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 4vw, 58px);
}

.trip-explorer-hero__content h2 {
    max-width: 570px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 4.1vw, 61px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.trip-explorer-hero__location {
    margin: 14px 0 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: 790;
}

.trip-explorer-hero__story {
    display: -webkit-box;
    overflow: hidden;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.trip-explorer-hero__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0 0;
}

.trip-explorer-hero__facts div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-muted);
    padding: 11px clamp(8px, 1vw, 12px);
}

.trip-explorer-hero__facts dt {
    overflow: hidden;
    color: var(--muted-faint);
    font-size: 10px;
    font-weight: 830;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.trip-explorer-hero__facts dd {
    margin-top: 4px;
    font-size: clamp(11px, 1vw, 12px);
    font-weight: 760;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

.trip-explorer-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.trip-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.trip-card.card {
    --trip-card-art-height: 112px;
    --trip-card-art-top: 44px;
    --radius-box: 22px;

    overflow: hidden;
    min-width: 0;
    padding: 0;
}

.trip-card__art {
    position: relative;
    display: block;
    overflow: hidden;
    min-block-size: var(--trip-card-art-height);
    block-size: var(--trip-card-art-height);
    flex: 0 0 var(--trip-card-art-height);
    background:
        radial-gradient(circle at 76% 25%, #ffdc83 0 22px, transparent 23px),
        repeating-radial-gradient(ellipse at 0 110%, transparent 0 17px, rgb(232 245 235 / 0.16) 18px 19px, transparent 20px 34px),
        linear-gradient(135deg, #477a68, #123d34 76%);
}

.trip-card__art::after {
    position: absolute;
    z-index: 0;
    top: var(--trip-card-art-top);
    right: -8%;
    left: -8%;
    height: calc(var(--trip-card-art-height) - var(--trip-card-art-top) - 1px);
    background: color-mix(in oklab, var(--accent) 74%, #0f332d);
    clip-path: polygon(0 100%, 17% 42%, 28% 77%, 43% 14%, 57% 73%, 70% 35%, 82% 76%, 100% 20%, 100% 100%);
    content: "";
    opacity: 0.86;
}

.trip-card.card.trip-card--trail:nth-child(4n + 2) .trip-card__art {
    background:
        radial-gradient(circle at 80% 22%, #ffe29a 0 22px, transparent 23px),
        repeating-radial-gradient(ellipse at 0 115%, transparent 0 17px, rgb(225 248 250 / 0.18) 18px 19px, transparent 20px 34px),
        linear-gradient(135deg, #4d99a2, #17536c 78%);
}

.trip-card.card.trip-card--trail:nth-child(4n + 3) .trip-card__art {
    background:
        radial-gradient(circle at 76% 22%, #ffd681 0 22px, transparent 23px),
        repeating-radial-gradient(ellipse at 0 115%, transparent 0 17px, rgb(255 236 215 / 0.17) 18px 19px, transparent 20px 34px),
        linear-gradient(135deg, #a95d60, #4b354a 78%);
}

.trip-card.card.trip-card--trail:nth-child(4n + 4) .trip-card__art {
    background:
        radial-gradient(circle at 76% 22%, #fff0bd 0 22px, transparent 23px),
        repeating-radial-gradient(ellipse at 0 115%, transparent 0 17px, rgb(234 243 241 / 0.18) 18px 19px, transparent 20px 34px),
        linear-gradient(135deg, #718b93, #344f50 78%);
}

.trip-card.card.trip-card--water .trip-card__art {
    background:
        radial-gradient(circle at 79% 23%, #ffe29a 0 20px, transparent 21px),
        repeating-radial-gradient(ellipse at 0 28%, transparent 0 17px, rgb(226 249 249 / 0.24) 18px 20px, transparent 21px 38px),
        linear-gradient(145deg, #55a6a7, #176477 54%, #123e5a);
}

.trip-card.card.trip-card--water {
    --trip-card-art-top: 54px;
}

.trip-card.card.trip-card--water .trip-card__art::after {
    right: 0;
    left: 0;
    background: color-mix(in oklab, #38a8b5 72%, #0d4058);
    clip-path: polygon(0 34%, 8% 43%, 16% 34%, 24% 43%, 32% 34%, 40% 43%, 48% 34%, 56% 43%, 64% 34%, 72% 43%, 80% 34%, 88% 43%, 96% 34%, 100% 38%, 100% 100%, 0 100%);
    opacity: 0.78;
}

.trip-card.card.trip-card--winter .trip-card__art {
    background:
        radial-gradient(circle at 78% 23%, #fff5d2 0 20px, transparent 21px),
        repeating-radial-gradient(ellipse at 0 110%, transparent 0 18px, rgb(255 255 255 / 0.22) 19px 20px, transparent 21px 37px),
        linear-gradient(140deg, #90b9c7, #4a7188 58%, #27475f);
}

.trip-card.card.trip-card--winter .trip-card__art::after {
    background: color-mix(in oklab, #dceef2 78%, #58788b);
    clip-path: polygon(0 100%, 13% 58%, 27% 78%, 43% 31%, 58% 75%, 74% 48%, 88% 73%, 100% 47%, 100% 100%);
    opacity: 0.86;
}

.trip-card.card.trip-card--cycling .trip-card__art {
    background:
        radial-gradient(circle at 80% 23%, #ffe49c 0 21px, transparent 22px),
        repeating-linear-gradient(165deg, transparent 0 20px, rgb(250 241 196 / 0.15) 21px 23px, transparent 24px 42px),
        linear-gradient(140deg, #86a65e, #376944 58%, #1b4b3e);
}

.trip-card.card.trip-card--cycling {
    --trip-card-art-top: 61px;
}

.trip-card.card.trip-card--cycling .trip-card__art::after {
    right: -3%;
    left: -3%;
    background: color-mix(in oklab, #d6a548 72%, #47723f);
    clip-path: polygon(0 72%, 12% 58%, 25% 64%, 38% 42%, 51% 54%, 64% 28%, 77% 49%, 90% 36%, 100% 43%, 100% 100%, 0 100%);
    opacity: 0.82;
}

.trip-card.card.trip-card--camp .trip-card__art {
    background:
        radial-gradient(circle at 78% 23%, #ffd777 0 21px, transparent 22px),
        repeating-linear-gradient(100deg, transparent 0 27px, rgb(229 244 226 / 0.12) 28px 30px, transparent 31px 48px),
        linear-gradient(140deg, #708b59, #285846 61%, #163d36);
}

.trip-card.card.trip-card--camp {
    --trip-card-art-top: 45px;
}

.trip-card.card.trip-card--camp .trip-card__art::after {
    right: 14%;
    left: 14%;
    background: color-mix(in oklab, var(--accent) 68%, #173d35);
    clip-path: polygon(0 100%, 15% 59%, 25% 100%, 38% 100%, 50% 20%, 62% 100%, 76% 100%, 86% 54%, 100% 100%);
    opacity: 0.84;
}

.trip-card.card.trip-card--service .trip-card__art {
    background:
        radial-gradient(circle at 79% 23%, #ffe29a 0 21px, transparent 22px),
        repeating-linear-gradient(90deg, transparent 0 30px, rgb(224 245 226 / 0.13) 31px 34px, transparent 35px 52px),
        linear-gradient(140deg, #79a070, #34694f 62%, #1b493d);
}

.trip-card.card.trip-card--service {
    --trip-card-art-top: 57px;
}

.trip-card.card.trip-card--service .trip-card__art::after {
    right: -2%;
    left: -2%;
    background: color-mix(in oklab, #66a65e 70%, #214c3d);
    clip-path: polygon(0 100%, 0 68%, 8% 68%, 12% 25%, 16% 68%, 28% 68%, 32% 37%, 36% 68%, 49% 68%, 53% 18%, 57% 68%, 69% 68%, 73% 34%, 77% 68%, 89% 68%, 93% 28%, 97% 68%, 100% 68%, 100% 100%);
    opacity: 0.85;
}

.trip-card.card > * {
    position: relative;
    z-index: 1;
}

.trip-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 19px 19px 0;
}

.trip-card__header > div:first-child {
    min-width: 0;
}

.trip-card__header h2 {
    margin: 0 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.025em;
    overflow-wrap: break-word;
    word-break: normal;
}

.trip-card__header p,
.trip-card__note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.trip-card__badges {
    display: flex;
    min-width: 0;
    flex-basis: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 5px;
}

.trip-card .badge {
    white-space: nowrap;
}

.trip-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 14px 19px;
}

.trip-card__facts div {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 7px 8px;
}

.trip-card__facts dt {
    margin-bottom: 3px;
    color: var(--muted-faint);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.trip-card__facts dd {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.trip-card__planning {
    display: flex;
    overflow: hidden;
    min-height: 50px;
    max-height: 50px;
    align-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    margin: -2px 19px 12px;
}

.trip-card__planning span {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.trip-card__note {
    display: -webkit-box;
    overflow: hidden;
    min-height: 44px;
    padding: 0 19px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.trip-card__tags {
    overflow: hidden;
    max-height: 58px;
    margin: 0 19px 14px;
}

.trip-card__actions {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 13px 19px 17px;
}

.meeting-card__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.meeting-card__facts div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 8px 9px;
}

.meeting-card__facts dt {
    margin-bottom: 3px;
    color: var(--muted-faint);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meeting-card__facts dd {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.trip-card--discovery .trip-card__header p:first-child {
    min-height: 38px;
}

/* Shared unit/public explorer composition. */
.explorer-header {
    margin-bottom: 22px;
}

.explorer-views {
    width: fit-content;
}

.workflow-nav {
    --tab-height: 58px;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    margin: 0 0 18px;
}

.workflow-nav__item {
    --tab-p: 12px;

    min-width: 0;
    justify-content: space-between;
    gap: 8px;
}

.workflow-nav__item strong {
    display: inline-grid;
    min-width: 28px;
    min-height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 3px 7px;
    font-size: 11px;
}

.workflow-nav__item.tab-active strong {
    background: var(--accent);
    color: var(--color-primary-content);
}

.metric-grid dd a {
    color: inherit;
    text-underline-offset: 3px;
}

.trip-explorer-hero--compact {
    min-height: 330px;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

.trip-explorer-hero--compact .trip-explorer-hero__content {
    padding: clamp(27px, 3vw, 42px);
}

.trip-explorer-hero--compact .trip-explorer-hero__content h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: clamp(34px, 3.25vw, 49px);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.trip-explorer-hero--compact .trip-explorer-hero__story {
    margin-top: 13px;
    -webkit-line-clamp: 3;
}

.trip-explorer-hero--compact .trip-explorer-hero__facts,
.trip-explorer-hero--compact .trip-explorer-hero__actions {
    margin-top: 17px;
}

.explorer-filters {
    grid-template-columns: minmax(0, 1fr);
}

.explorer-filter-more {
    overflow: visible;
    border: 0;
    background: transparent;
}

.explorer-filter-more > summary {
    min-height: 46px;
    cursor: pointer;
    color: var(--text);
    padding: 14px 52px 14px 16px;
    font-size: 12px;
    font-weight: 780;
}

.explorer-filter-more__content {
    display: grid;
    gap: 14px;
    padding: var(--tripdb-collapse-content-gap) 16px 16px;
}

.filter-toggle-group {
    display: grid;
    gap: 7px;
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0;
}

.filter-toggle-group > .field-label {
    margin-bottom: 2px;
    color: var(--muted-faint);
}

.explorer-filter-more__unit {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.map-filter-panel {
    width: 100%;
}

.map-filter-panel > summary {
    min-height: 42px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.map-filter-panel__content {
    display: grid;
    gap: 14px;
    padding: var(--tripdb-collapse-content-gap) 0 0;
}

.map-filter-panel.collapse[open] > .map-filter-panel__content.collapse-content {
    padding-bottom: 16px;
}

.explorer-privacy-status {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: -6px 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 6px 7px 6px 12px;
    font-size: 12px;
}

.explorer-privacy-status strong {
    color: var(--text);
}

@media (min-width: 761px) {
    .trip-explorer-hero--compact {
        min-block-size: 470px;
        block-size: 470px;
        max-block-size: 470px;
    }

    .trip-explorer-hero--compact .trip-explorer-hero__story {
        -webkit-line-clamp: 2;
    }
}

.explorer-filter-more .filter-constraint-row {
    grid-column: auto;
}

.explorer-filter-more .filter-constraint-row > .field {
    width: 150px;
}

.map-explorer {
    display: flex;
    flex-direction: column;
}

.map-explorer__filters {
    order: 1;
}

.map-explorer__status {
    order: 1;
    margin: 8px 4px 12px;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

.map-explorer__map {
    order: 2;
}

.map-explorer__selection {
    order: 3;
}

.trip-card__header .eyebrow {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 10px;
    line-height: 1.35;
}

@supports (grid-template-rows: subgrid) {
    .trip-card.card {
        display: grid;
        grid-row: span 7;
        grid-template-rows: subgrid;
        row-gap: 0;
    }

    .trip-card.card.trip-card--unit {
        grid-row: span 8;
    }

    .trip-card.card .trip-card__header {
        display: grid;
        grid-row: span 2;
        grid-template-rows: subgrid;
    }
}

.calendar-event__date strong,
.calendar-event__body h2 {
    font-family: Georgia, "Times New Roman", serif;
}

.maplibregl-ctrl-attrib {
    background: rgb(255 255 255 / 94%) !important;
    color: #18352f !important;
}

.maplibregl-ctrl-attrib a {
    color: #0c5a47 !important;
    font-weight: 600;
}

.map-selection {
    margin-top: 18px;
}

.modal__header:not(.detail-hero) {
    border-radius: 20px 20px 0 0;
}

.modal__header:not(.detail-hero) h2 {
    font-size: clamp(30px, 4vw, 44px);
}

.modal--detail,
.modal-backdrop--detail .modal--detail {
    position: relative;
    width: min(1120px, calc(100vw - 48px));
    max-width: none;
    max-height: calc(100dvh - 42px);
    overflow: hidden;
    border-radius: 28px;
    padding: 0;
}

.trip-detail-page__back {
    width: min(1120px, 100%);
    margin: 0 auto 12px;
}

.trip-detail-page__surface {
    width: min(1120px, 100%);
    max-height: none;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.trip-detail-page__surface .detail-modal__body {
    max-height: none;
    overflow: visible;
}

.trip-detail-page__surface .modal__actions {
    position: static;
}

.detail-modal__body {
    width: 100%;
    max-height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
}

.detail-hero {
    position: relative;
    top: auto;
    min-height: 280px;
    overflow: hidden;
    align-items: flex-end;
    margin: 0 0 30px;
    border: 0;
    border-radius: 27px 27px 0 0;
    background:
        radial-gradient(circle at 78% 16%, rgb(255 213 119 / 0.78) 0 42px, transparent 43px),
        repeating-radial-gradient(ellipse at 0 115%, transparent 0 27px, rgb(220 242 225 / 0.13) 28px 30px, transparent 31px 55px),
        linear-gradient(135deg, #527967, #0a302b 74%);
    color: white;
    padding: 38px 42px;
}

.detail-hero::before {
    position: absolute;
    z-index: 0;
    right: -5%;
    bottom: 0;
    left: -5%;
    height: 78%;
    background: rgb(10 54 46 / 0.82);
    clip-path: polygon(0 100%, 10% 62%, 20% 79%, 34% 22%, 46% 75%, 59% 37%, 72% 81%, 86% 28%, 100% 66%, 100% 100%);
    content: "";
}

.detail-hero--water {
    background:
        radial-gradient(circle at 78% 16%, rgb(255 226 154 / 0.82) 0 42px, transparent 43px),
        repeating-radial-gradient(ellipse at 0 25%, transparent 0 27px, rgb(226 249 249 / 0.2) 28px 30px, transparent 31px 55px),
        linear-gradient(135deg, #55a6a7, #176477 58%, #123e5a);
}

.detail-hero--water::before {
    height: 54%;
    background: rgb(20 103 118 / 0.82);
    clip-path: polygon(0 34%, 8% 43%, 16% 34%, 24% 43%, 32% 34%, 40% 43%, 48% 34%, 56% 43%, 64% 34%, 72% 43%, 80% 34%, 88% 43%, 96% 34%, 100% 38%, 100% 100%, 0 100%);
}

.detail-hero--winter {
    background:
        radial-gradient(circle at 78% 16%, rgb(255 245 210 / 0.9) 0 42px, transparent 43px),
        radial-gradient(circle at 20% 24%, rgb(255 255 255 / 0.35) 0 3px, transparent 4px),
        linear-gradient(135deg, #91becd, #4f748d 58%, #27485f);
}

.detail-hero--winter::before {
    background: rgb(214 236 241 / 0.88);
    clip-path: polygon(0 100%, 13% 58%, 27% 78%, 43% 31%, 58% 75%, 74% 48%, 88% 73%, 100% 47%, 100% 100%);
}

.detail-hero--cycling {
    background:
        radial-gradient(circle at 78% 16%, rgb(255 226 154 / 0.88) 0 42px, transparent 43px),
        repeating-linear-gradient(165deg, transparent 0 34px, rgb(250 241 196 / 0.13) 35px 38px, transparent 39px 69px),
        linear-gradient(135deg, #91aa68, #47734e 58%, #204b3d);
}

.detail-hero--cycling::before {
    height: 58%;
    background: rgb(42 101 65 / 0.84);
    clip-path: polygon(0 100%, 0 66%, 13% 48%, 25% 58%, 39% 35%, 52% 54%, 66% 27%, 80% 49%, 91% 38%, 100% 47%, 100% 100%);
}

.detail-hero--camp {
    background:
        radial-gradient(circle at 78% 16%, rgb(255 215 119 / 0.82) 0 42px, transparent 43px),
        repeating-linear-gradient(100deg, transparent 0 38px, rgb(229 244 226 / 0.12) 39px 42px, transparent 43px 75px),
        linear-gradient(135deg, #708b59, #285846 61%, #163d36);
}

.detail-hero--camp::before {
    right: 10%;
    left: 10%;
    height: 72%;
    background: rgb(24 78 62 / 0.86);
    clip-path: polygon(0 100%, 12% 58%, 21% 100%, 36% 100%, 50% 18%, 64% 100%, 79% 100%, 88% 54%, 100% 100%);
}

.detail-hero--service {
    background:
        radial-gradient(circle at 78% 16%, rgb(255 226 154 / 0.86) 0 42px, transparent 43px),
        repeating-linear-gradient(90deg, transparent 0 46px, rgb(224 245 226 / 0.13) 47px 51px, transparent 52px 84px),
        linear-gradient(135deg, #75a074, #356b52 58%, #17463b);
}

.detail-hero--service::before {
    height: 62%;
    background: rgb(31 91 69 / 0.86);
    clip-path: polygon(0 100%, 0 68%, 8% 68%, 12% 25%, 16% 68%, 28% 68%, 32% 37%, 36% 68%, 49% 68%, 53% 18%, 57% 68%, 69% 68%, 73% 34%, 77% 68%, 89% 68%, 93% 28%, 97% 68%, 100% 68%, 100% 100%);
}

.detail-hero::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(0deg, rgb(3 29 25 / 0.84), transparent 72%);
    content: "";
}

.detail-hero > * {
    position: relative;
    z-index: 2;
}

.detail-hero h1,
.detail-hero h2 {
    max-width: 820px;
    color: white;
    font-size: clamp(38px, 5vw, 60px);
}

.detail-hero > div > p:not(.eyebrow) {
    margin: 12px 0 0;
    color: rgb(255 255 255 / 0.72);
}

.detail-hero .eyebrow {
    color: var(--brand-route);
}

.detail-hero__badges .badge {
    border-color: rgb(255 255 255 / 0.18);
    background: rgb(4 30 25 / 0.58);
    color: white;
    backdrop-filter: blur(8px);
}

.icon-button.detail-modal__close.btn {
    position: absolute;
    z-index: 30;
    top: 16px;
    right: 16px;
    margin: 0;
    backdrop-filter: blur(8px);
}

.detail-modal__body > :not(.modal__header):not(.modal__actions) {
    margin-right: 36px;
    margin-left: 36px;
}

.modal--detail .detail-map-card {
    width: auto;
    max-width: 100%;
}

.modal--detail .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.detail-story {
    border: 0;
    border-left: 4px solid var(--brand-route);
    border-radius: 0 16px 16px 0;
    background: linear-gradient(90deg, var(--warning-soft), transparent);
    padding: 18px 20px;
}

.detail-story h3 {
    margin-bottom: 8px;
    font-size: clamp(24px, 3vw, 32px);
}

.detail-story p:last-child {
    color: var(--muted);
    line-height: 1.7;
}

.modal--detail .modal__actions {
    position: sticky;
    z-index: 5;
    bottom: 0;
    margin: 26px 0 0;
    border-radius: 0 0 27px 27px;
    padding: 16px 36px;
}

@media (max-width: 1200px) {
    .trip-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .desktop-rail {
        display: none;
    }

    .app-shell__content {
        margin-left: 0;
        padding-top: 74px;
    }

    .topbar.mobile-topbar {
        position: fixed;
        z-index: 60;
        inset: 0 0 auto;
        display: block;
        border-bottom: 1px solid rgb(213 236 185 / 0.13);
        background:
            radial-gradient(circle at 8% 0, rgb(95 186 112 / 0.18), transparent 12rem),
            linear-gradient(100deg, #032f28, #011d18);
        color: var(--brand-cream);
        box-shadow: 0 10px 30px rgb(0 29 23 / 0.14);
    }

    .topbar__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px auto;
        align-items: center;
        min-height: 74px;
        gap: 9px;
    }

    .brand--topbar {
        overflow: hidden;
        color: var(--brand-cream);
    }

    .brand--topbar .brand__location {
        color: rgb(241 237 207 / 0.62);
    }

    .theme-toggle--icon.btn {
        --btn-p: 0;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
    }

    .mobile-nav {
        position: relative;
        display: block;
        flex: 0 0 auto;
    }

    .mobile-nav summary {
        display: flex;
        min-height: 42px;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: var(--surface-raised);
        color: var(--text);
        padding: 0 12px;
        font-size: 12px;
        font-weight: 780;
        cursor: pointer;
        list-style: none;
    }

    .topbar .mobile-nav > summary {
        border-color: rgb(213 236 185 / 0.18);
        background: rgb(213 236 185 / 0.06);
        color: var(--brand-cream);
    }

    .topbar .mobile-nav > summary:hover {
        background: rgb(213 236 185 / 0.12);
        color: var(--brand-celadon);
    }

    .topbar .mobile-nav[open] > summary {
        border-color: rgb(255 202 75 / 0.62);
        background: rgb(213 236 185 / 0.15);
        color: var(--brand-route);
    }

    .topbar a:not(.btn):focus-visible,
    .topbar button:not(.btn):focus-visible,
    .topbar summary:focus-visible {
        outline-color: var(--brand-route);
    }

    .mobile-nav summary::-webkit-details-marker {
        display: none;
    }

    .mobile-nav__links {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        display: grid;
        width: min(330px, calc(100vw - 20px));
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--surface-raised);
        box-shadow: var(--shadow);
        padding: 10px;
    }

    .mobile-nav__links .nav-link {
        display: flex;
        min-height: 48px;
        align-items: center;
        gap: 9px;
        border-radius: 12px;
        padding: 0 11px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 720;
    }

    .mobile-nav__links .nav-link--active {
        background: var(--accent-soft);
        color: var(--text);
    }

    .mobile-nav__links .nav-account-link {
        grid-column: 1 / -1;
        border: 1px solid var(--line);
    }

    .mobile-dock {
        position: fixed;
        z-index: 55;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        height: 70px;
        border-top: 1px solid var(--line);
        background: color-mix(in oklab, var(--surface-raised) 92%, transparent);
        padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        backdrop-filter: blur(20px) saturate(140%);
    }

    .mobile-dock a {
        display: grid;
        min-width: 0;
        flex: 1 1 0;
        place-content: center;
        justify-items: center;
        gap: 3px;
        border-radius: 12px;
        color: var(--muted);
        font-size: 8px;
        font-weight: 760;
    }

    .mobile-dock a.is-active {
        background: var(--accent-soft);
        color: var(--text);
    }

    .mobile-dock .ui-icon {
        width: 21px;
        height: 21px;
    }

    body.has-modal .mobile-dock {
        display: none;
    }

    .app-shell__content > .app-frame,
    .topbar .app-frame {
        width: min(100% - 28px, 1500px);
    }

    .page {
        padding: 28px 0 100px;
    }

    .map-filter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-filter-fields .field--search {
        grid-column: 1 / -1;
    }

    .map-radius-filter {
        max-width: none;
    }

    .map-radius-filter__heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar--import-upload {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar--import-upload .import-upload__source {
        grid-column: 1;
        grid-row: 1;
    }

    .toolbar--import-upload .import-upload__file {
        grid-column: 2;
        grid-row: 1;
    }

    .toolbar--import-upload .import-upload__source-help {
        grid-column: 1;
        grid-row: 2;
    }

    .toolbar--import-upload .import-upload__notes {
        grid-column: 2;
        grid-row: 2;
        justify-self: stretch;
    }

    .toolbar--import-upload .import-upload__actions {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
        justify-content: flex-end;
    }

    .trip-explorer-hero {
        grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
    }
}

@media (min-width: 761px) and (max-width: 1200px) {
    .mobile-dock {
        justify-content: center;
        column-gap: 8px;
    }

    .mobile-dock a {
        min-width: 100px;
        max-width: 160px;
        flex: 1 1 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 760px) {
    .brand__mark {
        width: 38px;
        height: 44px;
    }

    .brand__name {
        font-size: 17px;
    }

    .brand__location {
        font-size: 9px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .page-header {
        gap: 15px;
        margin-bottom: 20px;
    }

    .page-header h1,
    .modal h2 {
        font-size: clamp(34px, 11vw, 48px);
    }

    .page-header__actions .btn {
        flex: 1 1 130px;
        width: auto;
    }

    .toolbar {
        gap: 12px;
    }

    .stats-panel__summary {
        /* Align the compact toggle with the title row, above the metrics. */
        --tripdb-collapse-toggle-top: 35px;
        grid-template-columns: 1fr;
        align-items: start;
        padding: 12px 52px 12px 12px;
    }

    .stats-panel__summary > .summary-metrics {
        /* The toggle is confined to the title row; reclaim its gutter below. */
        width: calc(100% + 40px);
        margin-inline-end: -40px;
    }

    .map-filter-fields {
        grid-template-columns: 1fr;
    }

    .map-filter-fields .field--search {
        grid-column: auto;
    }

    .trip-explorer-hero {
        min-height: 0;
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .trip-explorer-hero__art {
        min-height: 235px;
    }

    .trip-explorer-hero__art::after {
        background: linear-gradient(0deg, rgb(4 28 24 / 0.24), transparent 45%);
    }

    .trip-explorer-hero__activity,
    .trip-explorer-hero__route {
        top: 16px;
        max-width: calc(50% - 23px);
        overflow: hidden;
        padding: 0 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .trip-explorer-hero__activity {
        left: 16px;
    }

    .trip-explorer-hero__route {
        right: 16px;
    }

    .trip-explorer-hero__content {
        padding: 27px 21px 24px;
    }

    .trip-explorer-hero__content h2 {
        font-size: clamp(36px, 11vw, 48px);
    }

    .trip-explorer-hero__story {
        -webkit-line-clamp: 5;
    }

    .trip-card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .trip-card.card {
        --trip-card-art-height: 105px;
        --trip-card-art-top: 39px;
    }

    .trip-card.card.trip-card--water {
        --trip-card-art-top: 49px;
    }

    .trip-card.card.trip-card--cycling {
        --trip-card-art-top: 56px;
    }

    .trip-card.card.trip-card--camp {
        --trip-card-art-top: 40px;
    }

    .trip-card.card.trip-card--service {
        --trip-card-art-top: 52px;
    }

    .trip-card--discovery .trip-card__header p:first-child {
        min-height: 0;
    }

    .toolbar--import-upload .import-upload__source,
    .toolbar--import-upload .import-upload__source-help,
    .toolbar--import-upload .import-upload__file,
    .toolbar--import-upload .import-upload__notes,
    .toolbar--import-upload .import-upload__actions {
        grid-column: auto;
        grid-row: auto;
    }

    .toolbar--import-upload .import-upload__notes {
        justify-self: stretch;
    }

    .toolbar--import-upload .import-upload__actions,
    .toolbar--import-upload .import-upload__actions .btn {
        width: 100%;
    }

    .meeting-layout > .shortlist-panel {
        order: -1;
    }

    .trip-card__header {
        grid-template-columns: 1fr;
        padding: 17px 17px 0;
    }

    .trip-card__badges,
    .trip-row-badges {
        justify-content: flex-start;
    }

    .trip-card__facts {
        margin-right: 17px;
        margin-left: 17px;
    }

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

    .trip-card__note {
        padding: 0 17px;
    }

    .trip-card__tags {
        margin-right: 17px;
        margin-left: 17px;
    }

    .trip-card__actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
        gap: 8px;
        padding: 12px 17px 16px;
    }

    .trip-card__actions .btn {
        min-width: 0;
    }

    .btn {
        min-height: 44px;
        padding: 10px 14px;
    }

    .shortlist__item-actions .btn {
        min-height: 44px;
    }

    .data-table tbody tr {
        border-radius: 18px;
        background: var(--surface-raised);
        box-shadow: var(--shadow-soft);
    }

    .data-table td:first-child {
        background: var(--surface-muted);
    }

    .modal-backdrop--detail {
        align-items: stretch;
        justify-items: stretch;
        padding: 0;
    }

    .modal-backdrop--detail .modal--detail {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .detail-modal__body {
        height: 100%;
        max-height: 100%;
    }

    .detail-hero,
    .modal-backdrop--detail .detail-hero {
        top: auto;
        min-height: 300px;
        align-items: flex-end;
        margin: 0 0 26px;
        border-radius: 0;
        padding: 36px 21px 29px;
    }

    .detail-hero h1,
    .detail-hero h2 {
        font-size: 38px;
    }

    .detail-modal__close {
        top: 16px;
        width: 42px;
        height: 42px;
    }

    .detail-modal__body > :not(.modal__header):not(.modal__actions) {
        margin-right: 21px;
        margin-left: 21px;
    }

    .modal--detail .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .modal--detail .detail-map-card {
        width: calc(100% - 42px);
        max-width: calc(100% - 42px);
        margin-right: 21px;
        margin-left: 21px;
    }

    .detail-map-card__map {
        min-width: 0;
        max-width: 100%;
    }

    .detail-story {
        padding: 16px 17px;
    }

    .modal--detail .modal__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 22px;
        border-radius: 0;
        padding: 13px 21px calc(13px + env(safe-area-inset-bottom));
    }

    .modal--detail .modal__actions .btn {
        min-width: 0;
        white-space: normal;
    }

    .modal--detail .modal__actions > .btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .calendar-event {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .explorer-views {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .explorer-views .tab {
        width: auto;
        min-width: 0;
        padding-inline: 9px;
    }

    .workflow-nav {
        --tab-height: 52px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workflow-nav__item {
        --tab-p: 10px;
    }

    .trip-explorer-hero--compact .trip-explorer-hero__content h2 {
        font-size: clamp(32px, 10vw, 42px);
    }

    .explorer-filter-more__content {
        padding-inline: 12px;
    }

    .explorer-filter-more .filter-constraint-row > .field {
        width: 100%;
    }

    .map-explorer__map {
        order: 1;
        margin-bottom: 16px;
    }

    .map-explorer__status {
        order: 2;
        margin: 0 4px 16px;
    }

    .map-explorer__filters {
        order: 3;
    }

    .map-explorer__selection {
        order: 2;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .app-shell__content > .app-frame,
    .topbar .app-frame {
        width: calc(100% - 20px);
    }

    .topbar__inner {
        grid-template-columns: minmax(0, 1fr) 42px 42px;
        padding: 8px 0;
    }

    .brand--topbar .brand__location {
        display: none;
    }

    .mobile-nav summary span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .mobile-nav summary {
        width: 42px;
        justify-content: center;
        padding: 0;
    }

    .page {
        padding-top: 23px;
    }

    .page-header h1,
    .modal h2 {
        font-size: 36px;
    }

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

    .meeting-card__facts {
        grid-template-columns: 1fr;
    }

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

    .lifecycle-options {
        grid-template-columns: 1fr;
    }

    .trip-explorer-hero__facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .trip-card--discovery .trip-card__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trip-card--discovery .trip-card__actions:has(> :nth-child(3)) > :last-child {
        grid-column: 1 / -1;
    }

    .trip-card__actions .btn {
        min-height: 42px;
        white-space: normal;
    }
}

/* Import mapping, review, and durable batch history */
.import-workflow-nav {
    flex-wrap: nowrap;
    margin-bottom: 0;
}

.import-workflow-header {
    display: block;
}

.import-workflow-header__copy {
    min-width: 0;
}

.import-workflow-header__title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
}

.import-workflow-header__title-row .import-workflow-nav {
    width: max-content;
    max-width: 100%;
}

.disclosure-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.disclosure-info-grid > * {
    display: grid;
    align-content: start;
    min-width: 0;
    gap: 4px;
}

.import-upload__notes .import-option {
    max-width: 560px;
}

.import-result-actions {
    justify-content: flex-end;
}

.import-source-summary,
.import-attention-callout,
.import-rollback-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.import-source-summary > div,
.import-attention-callout > div,
.import-rollback-card > div,
.import-result-summary,
.import-rollback-blocked {
    display: grid;
    gap: 4px;
}

.import-mapping-groups {
    display: grid;
    gap: 14px;
}

.import-mapping-group {
    padding: 0;
    overflow: clip;
}

.import-mapping-group > summary,
.import-report-details > summary {
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 52px 18px 20px;
}

.import-mapping-group > summary small,
.import-mode-option small,
.import-batch-summary span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.data-table--fit {
    min-width: 0;
}

.import-mapping-group > .collapse-content.table-region {
    border-top: 0;
    padding: 0;
}

.import-mapping-table th:nth-child(1),
.import-mapping-table td:nth-child(1) {
    width: 31%;
}

.import-mapping-table th:nth-child(2),
.import-mapping-table td:nth-child(2) {
    width: 27%;
}

.import-mapping-table th:nth-child(3),
.import-mapping-table td:nth-child(3) {
    width: 42%;
}

.import-mapping-table .select {
    width: 100%;
}

@media (max-width: 980px) {
    .import-mapping-group > .collapse-content.table-region {
        padding: 0 12px 12px;
    }
}

.import-duplicate-override {
    background: var(--warning-soft);
    padding: 10px 12px;
}

.import-dated-idea-acknowledgement {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    border-color: color-mix(in oklab, var(--color-secondary) 55%, var(--line));
    background: var(--warning-soft);
}

.import-dated-idea-acknowledgement small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.import-review-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.import-review-bulk-actions {
    margin: 0;
}

.import-review-table--compact th:nth-child(1),
.import-review-table--compact td:nth-child(1) {
    width: 9%;
}

.import-review-table--compact th:nth-child(2),
.import-review-table--compact td:nth-child(2) {
    width: 18%;
}

.import-review-table--compact th:nth-child(3),
.import-review-table--compact td:nth-child(3) {
    width: 17%;
}

.import-review-table--compact th:nth-child(4),
.import-review-table--compact td:nth-child(4) {
    width: 23%;
}

.import-review-table--compact th:nth-child(5),
.import-review-table--compact td:nth-child(5) {
    width: 33%;
}

.import-attention-note {
    color: var(--text);
    font-weight: 700;
}

.import-review-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.import-sticky-actions {
    position: sticky;
    z-index: 12;
    bottom: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: color-mix(in oklab, var(--surface-raised) 94%, transparent);
    padding: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.import-sticky-actions .status-text {
    text-align: center;
}

.import-batch-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.import-batch-metric {
    display: grid;
    gap: 2px;
}

.import-batch-summary strong {
    font-size: 26px;
}

.import-batch-view-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-batch-view-switcher {
    margin-bottom: 0;
}

.import-batch-view-row .import-batch-download {
    margin-left: auto;
}

.import-report-details > :not(summary) {
    margin-right: 20px;
    margin-left: 20px;
}

@media (max-width: 900px) {
    .import-workflow-header__title-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .import-workflow-header__title-row .import-workflow-nav {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .disclosure-info-grid {
        grid-template-columns: 1fr;
    }

    .import-result-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin-top: 0;
    }

    .import-result-actions .btn {
        width: 100%;
    }

    .import-source-summary,
    .import-attention-callout,
    .import-rollback-card,
    .import-review-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .import-batch-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-sticky-actions {
        bottom: 76px;
        grid-template-columns: 1fr 1fr;
    }

    .import-sticky-actions .status-text {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .import-sticky-actions .btn {
        white-space: normal;
    }

    .import-batch-view-row {
        align-items: stretch;
        flex-direction: column;
    }

    .import-batch-view-row .import-batch-download {
        margin-left: 0;
    }
}

/* Compact, contextual help and focused leaderboard polish. */
.surface-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.surface-stack > * {
    margin-block: 0;
}

.context-help {
    flex: 0 0 auto;
}

.context-help__trigger.btn {
    --size: 30px;
    --btn-p: 0;
    --fontsize: 12px;
    min-width: 30px;
    font-weight: 850;
}

.context-help[open] {
    z-index: 100;
}

.context-help__panel {
    z-index: 100;
    width: min(360px, calc(100vw - 48px));
    max-height: min(480px, 70vh);
    overflow-y: auto;
    color: var(--text);
}

.context-help__panel h3 {
    margin: 0 0 8px;
    padding-right: 28px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 600;
}

.context-help__close.btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 23px;
}

.context-help__panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.context-help__panel p + p,
.context-help__facts + p {
    margin-top: 10px;
}

.context-help__facts {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
}

.context-help__facts > div {
    display: grid;
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
    gap: 9px;
}

.context-help__facts dt {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.context-help__facts dd {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.unit-control-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-period__metrics > div,
.leaderboard-standing__breakdown > div {
    border: 1px solid var(--line);
}

.leaderboard-standing {
    overflow: visible;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 32%),
        var(--surface-raised);
}

.leaderboard-standing__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.leaderboard-standing__result > span {
    min-width: 86px;
    justify-content: space-between;
}

.leaderboard-standing__result > span strong {
    font-size: 20px;
}

.leaderboard-scoring-help .context-help__panel {
    width: min(430px, calc(100vw - 48px));
}

.leaderboard-standing__breakdown progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    margin-top: 9px;
    border: 0;
    border-radius: 999px;
    appearance: none;
}

.leaderboard-standing__breakdown progress::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--surface);
}

.leaderboard-standing__breakdown progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--color-secondary));
}

.leaderboard-standing__breakdown progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--color-secondary));
}

.leaderboard-rank[data-rank="1"] {
    border-color: color-mix(in oklab, var(--color-secondary) 78%, var(--line));
    background: color-mix(in oklab, var(--color-secondary) 24%, var(--surface-raised));
    color: var(--text);
}

.leaderboard-rank[data-rank="2"] {
    border-color: color-mix(in oklab, #c5ccd3 65%, var(--line));
    background: color-mix(in oklab, #c5ccd3 20%, var(--surface-raised));
    color: var(--text);
}

.leaderboard-rank[data-rank="3"] {
    border-color: color-mix(in oklab, #b97a45 58%, var(--line));
    background: color-mix(in oklab, #b97a45 17%, var(--surface-raised));
    color: var(--text);
}

@media (max-width: 760px) {
    .leaderboard-standing__tools {
        width: 100%;
    }

    .leaderboard-standing__result {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex: 1 1 auto;
        width: auto;
    }

    .leaderboard-standing__result > span {
        min-width: 0;
    }
}

@media (max-width: 820px) {
    .context-help__panel,
    .dropdown-end .context-help__panel,
    .leaderboard-scoring-help .context-help__panel {
        position: fixed;
        top: 50%;
        right: 16px;
        left: 16px;
        width: auto;
        max-height: calc(100dvh - 32px);
        transform: translateY(-50%);
    }
}

.trip-explorer-hero--compact .trip-explorer-hero__location {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (min-width: 761px) and (max-width: 1100px) {
    .trip-explorer-hero--compact .trip-explorer-hero__content {
        min-height: 0;
        overflow: hidden;
        padding: 22px 18px 20px;
    }

    .trip-explorer-hero--compact .trip-explorer-hero__story {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 760px) {
    .trip-explorer-hero--compact {
        min-block-size: 620px;
        block-size: 620px;
        max-block-size: 620px;
        grid-template-rows: 175px minmax(0, 1fr);
    }

    .trip-explorer-hero--compact .trip-explorer-hero__art {
        min-block-size: 175px;
        block-size: 175px;
        max-block-size: 175px;
    }

    .trip-explorer-hero--compact .trip-explorer-hero__content {
        min-height: 0;
        overflow: hidden;
    }

    .trip-explorer-hero--compact .trip-explorer-hero__content h2,
    .trip-explorer-hero--compact .trip-explorer-hero__story {
        -webkit-line-clamp: 2;
    }
}
