/* =====================================================================
   TourAndBike – styles
   All colours and sizes live in the variables below: change them here
   and the whole app follows (e.g. --control-height: 44px for smaller buttons).
   ===================================================================== */

:root {
    /* Colours */
    --color-bg:            #EEF1EE;
    --color-surface:       #FFFFFF;
    --color-text:          #17201C;
    --color-muted:         #55625B;
    --color-border:        #DDE3DF;
    --color-input-border:  #C9D2CD;
    --color-accent:        #0E6B5C;
    --color-accent-hover:  #0A5246;
    --color-accent-soft:   #DDEFEA;
    --color-focus:         #8FD3C4;
    --color-segment-bg:    #E1E7E3;
    --color-switch-off:    #8A9690;
    --color-tour-bg:       #FCF4EA;
    --color-tour-border:   #F0D9BD;
    --color-tour-text:     #8A4B0F;
    --color-badge-bg:      #FCEBD9;
    --color-danger:        #B42318;
    --color-danger-soft:   #FDECEA;

    /* Typography */
    --font-family:   system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size:     16px;
    --font-size-sm:  14px;
    --font-size-xs:  12px;

    /* Sizes */
    --control-height: 48px;   /* buttons, chips, stepper */
    --input-height:   52px;   /* text fields */
    --row-height:     72px;   /* trip list rows */
    --nav-width:      96px;
    --list-width:     460px;
    --radius-sm:      10px;
    --radius:         12px;
    --radius-lg:      20px;
    --gap:            16px;
    --shadow-panel:   0 1px 2px rgba(23, 32, 28, .06);
}

@media (max-width: 1199px) {
    :root { --list-width: 400px; }
}

/* --- base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.spacer { flex: 1 1 0; }

/* --- app frame ------------------------------------------------------- */
.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

.nav {
    flex: 0 0 var(--nav-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    overflow-y: auto;
}

.nav__logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--color-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.nav__item {
    width: 80px;
    min-height: 64px;
    border-radius: 16px;
    color: var(--color-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}
.nav__item:hover { background: var(--color-bg); }
.nav__item[aria-current="page"] {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-weight: 700;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding: 20px 24px 24px;
}

/* --- page header + toolbar --------------------------------------------- */
.page-header,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* --- buttons ------------------------------------------------------------ */
.btn {
    height: var(--control-height);
    padding: 0 20px;
    border-radius: var(--radius);
    border: 1px solid var(--color-input-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--color-bg); }
.btn:disabled { opacity: .5; cursor: default; }

.btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #FFFFFF;
}
.btn--primary:hover { background: var(--color-accent-hover); }

.btn--danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #FFFFFF;
}
.btn--danger:hover { background: #8F1C13; }

.btn--soft {
    background: var(--color-bg);
    border-color: transparent;
}
.btn--soft:hover { background: var(--color-segment-bg); }

.btn--icon {
    width: var(--control-height);
    padding: 0;
}

.btn--danger-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-danger);
}
.btn--danger-ghost:hover { background: var(--color-danger-soft); }

/* --- year stepper ------------------------------------------------------ */
.year-stepper {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 2px;
}
.year-stepper__btn {
    width: var(--control-height);
    height: var(--control-height);
    border: 0;
    border-radius: 999px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.year-stepper__btn:hover { background: var(--color-bg); }
.year-stepper__value {
    min-width: 72px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.year-stepper.is-inactive .year-stepper__value { color: var(--color-muted); }

/* --- switch (toggle) --------------------------------------------------- */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--control-height);
    padding: 0 8px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    font-size: 15px;
    font-weight: 500;
}
.switch__track {
    position: relative;
    width: 52px;
    height: 32px;
    border-radius: 999px;
    background: var(--color-switch-off);
    transition: background .15s;
}
.switch__knob {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: left .15s;
}
.switch[aria-checked="true"] .switch__track { background: var(--color-accent); }
.switch[aria-checked="true"] .switch__knob { left: 24px; }

/* --- search ------------------------------------------------------------ */
.search {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--control-height);
    padding: 0 4px 0 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-muted);
}
.search:focus-within { border-color: var(--color-accent); outline: 3px solid var(--color-focus); }
.search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size);
}
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- segmented control (sorting) ---------------------------------------- */
.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--color-segment-bg);
    border-radius: var(--radius);
}
.segmented button {
    height: calc(var(--control-height) - 8px);
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #4A5650;
    font-size: 15px;
    font-weight: 600;
}
.segmented button[aria-pressed="true"] {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* --- panels (master / detail) ------------------------------------------- */
.panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: var(--gap);
}

.panel {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.panel--list   { flex: 0 0 var(--list-width); }
.panel--detail { flex: 1 1 auto; min-width: 0; }
.panel--message {
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
}
.panel--message p { margin: 0; font-size: 18px; }

/* --- trip list ---------------------------------------------------------- */
.list-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 16px 20px 10px;
}
.list-summary__count { font-size: 17px; font-weight: 700; }
.list-summary__text  { font-size: 15px; color: var(--color-muted); font-variant-numeric: tabular-nums; }

.trip-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-message {
    margin: 24px 16px;
    color: var(--color-muted);
}

.trip-row {
    width: 100%;
    min-height: var(--row-height);
    padding: 12px 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}
.trip-row:hover { background: var(--color-bg); }
.trip-row[aria-current="true"] { background: var(--color-accent-soft); }

.trip-row__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}
.trip-row__weekday { font-size: var(--font-size-xs); font-weight: 600; color: var(--color-muted); text-transform: uppercase; }
.trip-row__day     { font-size: 16px; font-weight: 700; }
.trip-row__year    { font-size: var(--font-size-xs); color: var(--color-muted); }

.trip-row__main  { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trip-row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-row__meta  { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); color: var(--color-muted); min-width: 0; }

.trip-row__nums { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.trip-row__km   { font-weight: 600; }
.trip-row__dur  { font-size: var(--font-size-sm); color: var(--color-muted); }

.badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-badge-bg);
    color: var(--color-tour-text);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* --- detail ------------------------------------------------------------- */
.detail-empty {
    margin: auto;
    padding: 24px;
    color: var(--color-muted);
    text-align: center;
}

.trip-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.detail-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 0 24px;
}
.detail-title { margin: 0; font-size: 20px; font-weight: 700; }
.back-btn { display: none; padding: 0 14px 0 8px; }

.detail-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #E6EBE8;
}
.dirty-hint {
    margin-right: auto;
    color: var(--color-tour-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* --- form fields -------------------------------------------------------- */
.field-group { display: flex; flex-direction: column; gap: 8px; }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.field--grow { flex: 1 1 auto; }
.field__label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-muted);
}

.input {
    width: 100%;
    height: var(--input-height);
    padding: 0 14px;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 17px;
}
.input:focus { outline: 3px solid var(--color-focus); outline-offset: 0; border-color: var(--color-accent); }
textarea.input {
    height: auto;
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
    font-size: var(--font-size);
}
.input--num { font-variant-numeric: tabular-nums; }

/* iPad/iPhone (Safari): date fields have their own minimum width and ignore width: 100%,
   so they overlapped the neighbouring field in the 3-column row. */
.input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    display: block;
    line-height: var(--input-height);
}
.input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.input.is-invalid { border-color: var(--color-danger); }

.field-error {
    color: var(--color-danger);
    font-size: 13px;
    font-weight: 500;
}

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

.title-row { display: flex; align-items: flex-start; gap: 10px; }
.title-row .star-btn { margin-top: calc(var(--font-size-sm) * 1.4 + 6px); }

.star-btn {
    flex: 0 0 var(--input-height);
    width: var(--input-height);
    height: var(--input-height);
    border-radius: var(--radius);
    border: 1px solid var(--color-input-border);
    background: var(--color-surface);
    color: var(--color-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}
.star-btn svg { fill: none; }
.star-btn[aria-pressed="true"] {
    background: var(--color-badge-bg);
    border-color: var(--color-tour-border);
    color: #B45309;
}
.star-btn[aria-pressed="true"] svg { fill: currentColor; }

/* Date · distance · duration · speed in one row; the date gets a bit more room */
.grid-4 {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 10px;
}
.grid-4 .field__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Calculated average speed: looks like a field, but read-only on the grey background */
.speed-box {
    display: flex;
    align-items: center;
    height: var(--input-height);
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
}

/* --- trip form: compact (~90 %) so the detail column on the tablet stays calm --- */
.trip-form {
    --input-height:   47px;
    --control-height: 43px;
    --font-size-sm:   13px;
}
.trip-form .detail-head { padding-top: 6px; }               /* was 16px */
.trip-form .detail-body { gap: 16px; padding-top: 4px; }   /* was 12px */
.trip-form .input       { padding: 0 12px; font-size: 16px; }
.trip-form .chips       { gap: 7px; }
.trip-form .chip        { padding: 0 16px; font-size: 14px; }
.trip-form .chip--small { min-height: 36px; padding: 0 13px; }

/* --- chips (vehicles, destination suggestions) -------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }

.chip {
    min-height: var(--control-height);
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--color-input-border);
    background: var(--color-surface);
    font-size: 15px;
    font-weight: 500;
}
.chip:hover { background: var(--color-bg); }
.chip[aria-pressed="true"] {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #FFFFFF;
}
.chip--small {
    min-height: 40px;
    padding: 0 14px;
    border-color: var(--color-border);
    background: #F4F6F4;
    font-size: var(--font-size-sm);
}
.chips__label { align-self: center; font-size: var(--font-size-sm); color: var(--color-muted); }

/* --- linked tour -------------------------------------------------------- */
.tour-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 14px 16px;
    border: 1px solid var(--color-tour-border);
    border-radius: 16px;
    background: var(--color-tour-bg);
    color: var(--color-tour-text);
}
.tour-card__text  { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tour-card__title { color: var(--color-text); font-weight: 600; }
.tour-card__range { font-size: var(--font-size-sm); color: #6B4A27; }
.tour-card .btn   { height: 44px; border-color: #E5C9A6; }
.tour-card .btn--ghost { background: transparent; border-color: transparent; color: var(--color-tour-text); }

.tour-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 16px;
    border: 2px dashed var(--color-input-border);
    border-radius: 16px;
}
.tour-empty span { flex: 1 1 auto; color: var(--color-muted); }

/* --- dialogs ------------------------------------------------------------ */
.dialog {
    width: min(560px, calc(100vw - 48px));
    max-height: min(80vh, 720px);
    padding: 20px 24px 24px;
    border: 0;
    border-radius: 24px;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.dialog[open] { display: flex; flex-direction: column; gap: 14px; }
.dialog::backdrop { background: rgba(23, 32, 28, .45); }
.dialog--small { width: min(440px, calc(100vw - 48px)); }

.dialog__head  { display: flex; align-items: center; gap: 12px; }
.dialog__head .dialog__title { flex: 1 1 auto; }
.dialog__title { margin: 0; font-size: 20px; font-weight: 700; }
.dialog__text  { margin: 0; color: var(--color-muted); }
.dialog__form  { display: flex; flex-direction: column; gap: 14px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.dialog__hint  { margin: 0; font-size: var(--font-size-sm); color: var(--color-muted); }

.dialog__list {
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pick-row {
    min-height: 64px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #E6EBE8;
    border-radius: 14px;
    background: var(--color-surface);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}
.pick-row:hover { background: var(--color-bg); }
.pick-row__title { font-weight: 600; }
.pick-row__sub   { font-size: var(--font-size-sm); color: var(--color-muted); }

/* --- toast -------------------------------------------------------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    max-width: calc(100vw - 48px);
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--color-text);
    color: #FFFFFF;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 100;
}
.toast[data-kind="error"] { background: var(--color-danger); }

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

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--color-bg);
}
.stats__item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stats__item span   { font-size: 13px; color: var(--color-muted); }
.stats__item strong { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.field-group__head { display: flex; align-items: center; gap: 12px; }
.field-group__head .field__label { flex: 1 1 auto; }

.btn--compact { height: 44px; padding: 0 16px; border-radius: var(--radius-sm); }
.btn--accent-soft {
    background: var(--color-accent-soft);
    border-color: transparent;
    color: var(--color-accent);
}
.btn--accent-soft:hover { background: #CDE6DF; }

.album-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 12px 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    color: var(--color-accent);
}
.album-card__text  { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.album-card__title { color: var(--color-text); font-weight: 600; overflow-wrap: anywhere; }
.album-card__link  { font-size: var(--font-size-sm); font-weight: 500; color: var(--color-accent); }
.album-card .btn   { height: 44px; }

.sub-list {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
}
.sub-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto 48px;
    gap: 12px;
    align-items: center;
    min-height: 60px;
    padding: 4px 4px 4px 16px;
    border-bottom: 1px solid var(--color-bg);
}
.sub-row:last-child { border-bottom: 0; }
.sub-row__date  { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.sub-row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-row__title a { color: inherit; text-decoration: none; }
.sub-row__title a:hover { text-decoration: underline; }
.sub-row__nums  { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sub-row .btn--icon { width: 44px; height: 44px; color: var(--color-muted); }

.empty-box {
    margin: 0;
    padding: 16px;
    border: 2px dashed var(--color-input-border);
    border-radius: 16px;
    color: var(--color-muted);
}

/* dialogs of the tours page */
.dialog--wide { width: min(680px, calc(100vw - 48px)); max-height: min(88vh, 860px); }
.dialog__titles { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dialog__sub    { font-size: var(--font-size-sm); color: var(--color-muted); }
.dialog__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dialog__filters .input { flex: 1 1 200px; height: var(--control-height); min-width: 0; font-size: var(--font-size); }
.dialog__list { flex: 1 1 auto; min-height: 120px; }

.check-row {
    width: 100%;
    min-height: 64px;
    padding: 8px 14px;
    border: 1px solid #E6EBE8;
    border-radius: 14px;
    background: var(--color-surface);
    text-align: left;
    display: grid;
    grid-template-columns: 32px 96px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.check-row:hover { background: var(--color-bg); }
.check-row[aria-pressed="true"] {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
}
.check-row__box {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-switch-off);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}
.check-row__box svg { visibility: hidden; }
.check-row[aria-pressed="true"] .check-row__box { background: var(--color-accent); border-color: var(--color-accent); }
.check-row[aria-pressed="true"] .check-row__box svg { visibility: visible; }
.check-row__date  { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.check-row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.check-row__nums  { font-variant-numeric: tabular-nums; text-align: right; }

.btn--ghost-plain {
    background: transparent;
    border-color: transparent;
    color: var(--color-muted);
}
.btn--ghost-plain:hover { background: var(--color-bg); }

.trip-row--tour { grid-template-columns: 64px 84px minmax(0, 1fr) auto; }

/* preview picture of a tour: in the list (square, cropped) and in the form */
.tour-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--color-bg);
}
.tour-thumb--empty {
    display: grid;
    place-items: center;
    color: var(--color-input-border);
}
.picture-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
}
.picture-card__img {
    width: 160px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--color-bg);
}
.picture-card .btn { height: 44px; }
.trip-row--tour .trip-row__day { font-size: 15px; white-space: nowrap; }
.trip-row--tour .trip-row__meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pick-row[aria-current="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); }

.album-pick { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.album-new {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: #F4F6F4;
}
.album-new__title { font-weight: 700; }

/* --- setup page ----------------------------------------------------------- */
.panel--form {
    width: 100%;
    max-width: 760px;
    overflow-y: auto;
}

.settings {
    display: flex;
    flex-direction: column;
    padding: 8px 24px 0;
}
.settings__title { margin: 16px 0 4px; font-size: 20px; font-weight: 700; }
.settings__title--sub { margin-top: 32px; font-size: 17px; }

.setting {
    display: flex;
    align-items: center;
    gap: 16px 24px;
    padding: 16px 0;
    border-bottom: 1px solid #E6EBE8;
}
.setting--stacked { flex-direction: column; align-items: stretch; }
.setting__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.setting__name { font-weight: 600; }
.setting__hint { font-size: var(--font-size-sm); color: var(--color-muted); }

.stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 2px;
    background: var(--color-surface);
}
.stepper__btn {
    width: var(--control-height);
    height: var(--control-height);
    border: 0;
    border-radius: 999px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stepper__btn:hover { background: var(--color-bg); }
.stepper__btn:disabled { opacity: .35; cursor: default; }
.stepper__value { min-width: 48px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.settings__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 -24px;
    padding: 14px 24px;
    background: var(--color-surface);
    border-top: 1px solid #E6EBE8;
}

/* --- account: password change (setup page) ------------------------------ */
.settings--account { padding-bottom: 24px; }
.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    padding: 16px 0;
}
.settings__actions { display: flex; justify-content: flex-end; }

/* --- setup: sub navigation (Einstellungen / Fahrzeuge) ------------------- */
.segmented--nav a {
    display: inline-flex;
    align-items: center;
    height: calc(var(--control-height) - 8px);
    padding: 0 16px;
    border-radius: 9px;
    color: #4A5650;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.segmented--nav a:hover { background: rgba(255, 255, 255, .5); }
.segmented--nav a[aria-current="page"] {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* --- setup: vehicles ----------------------------------------------------- */
.list-group-title {
    margin: 12px 14px 4px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.list-group-title:first-child { margin-top: 0; }

.vehicle-row {
    width: 100%;
    min-height: var(--row-height);
    padding: 12px 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}
.vehicle-row:hover { background: var(--color-bg); }
.vehicle-row[aria-current="true"] { background: var(--color-accent-soft); }
.vehicle-row.is-retired .trip-row__title,
.vehicle-row.is-retired .trip-row__km { color: var(--color-muted); }

.chip--edit {
    border-style: dashed;
    background: transparent;
    color: var(--color-accent);
}
.field-hint { margin: -8px 0 0; font-size: var(--font-size-sm); color: var(--color-muted); }

/* Overview: kilometres per year with a small bar */
.year-list {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
}
.year-row {
    display: grid;
    grid-template-columns: 52px minmax(40px, 1fr) 92px 72px 64px 48px;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    padding: 4px 16px;
    border-bottom: 1px solid var(--color-bg);
    font-variant-numeric: tabular-nums;
}
.year-row:last-child { border-bottom: 0; }
.year-row--head {
    min-height: 36px;
    background: #F4F6F4;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-muted);
}
.year-row--head span:nth-child(n+3) { text-align: right; }
.year-row__year { font-weight: 700; }
.year-row__num  { text-align: right; white-space: nowrap; }
.year-row__count { color: var(--color-muted); }
.year-row__bar {
    height: 10px;
    border-radius: 999px;
    background: var(--color-bg);
    overflow: hidden;
}
.year-row__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--color-accent);
    opacity: .75;
}

/* Vehicle types dialog */
.type-list { gap: 8px; }
.type-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px var(--control-height);
    gap: 8px;
    align-items: center;
}
.type-row .input { height: var(--control-height); }
.type-row__count { font-size: var(--font-size-sm); color: var(--color-muted); text-align: right; font-variant-numeric: tabular-nums; }
.type-row .btn--icon:disabled { opacity: .3; }
.type-add { display: flex; gap: 10px; }
.type-add .input { flex: 1 1 auto; height: var(--control-height); }

/* --- setup: destinations ------------------------------------------------- */
.list-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 16px 0;
}
.list-tools .search { flex: 1 1 200px; }
.list-tools .segmented button { padding: 0 12px; }

.rename-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: -6px;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--color-tour-border);
    border-radius: 16px;
    background: var(--color-tour-bg);
}
.rename-box__text { flex: 1 1 200px; font-size: var(--font-size-sm); color: var(--color-tour-text); }

.recent-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 92px 76px 56px;
    gap: 12px;
    align-items: center;
    min-height: 48px;
    padding: 4px 16px;
    border-bottom: 1px solid var(--color-bg);
    color: inherit;
    text-decoration: none;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--color-bg); }
.recent-row__vehicle { min-width: 0; color: var(--color-muted); font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row__speed { color: var(--color-muted); }

/* --- home ------------------------------------------------------------------ */
.home-greeting { display: flex; flex-direction: column; gap: 2px; }
.home-greeting__date { color: var(--color-muted); font-size: 15px; }

.home {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: var(--gap);
    max-width: 1100px;
}
.home-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-panel);
    min-width: 0;
}
.home-card--wide { grid-column: 1 / -1; }
.home-card__head { display: flex; align-items: baseline; gap: 12px; }
.home-card__head .home-card__label { flex: 1 1 auto; }
.home-card__label {
    margin: 0;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.home-card__link { color: var(--color-accent); font-size: var(--font-size-sm); font-weight: 600; text-decoration: none; }
.home-card__link:hover { text-decoration: underline; }
.home-card__foot { margin: auto 0 0; font-size: var(--font-size-sm); color: var(--color-muted); }
.home-card__foot--split { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.trend-up   { color: var(--color-accent); }
.trend-down { color: var(--color-tour-text); }

/* last trip: same structure as a row of the trip list, a bit larger */
.home-trip {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: #F4F6F4;
    color: inherit;
    text-decoration: none;
}
.home-trip:hover, .home-tour:hover { background: var(--color-accent-soft); }
.home-trip__title { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }

/* last tour with a bigger preview picture */
.home-tour {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: #F4F6F4;
    color: inherit;
    text-decoration: none;
}
/* Landscape format (3:2) – most tour pictures are landscape */
.home-tour__picture {
    flex: 0 0 200px;
    width: 200px;
    height: 134px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--color-surface);
}
.home-tour__picture--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-tour-text);
    background: var(--color-tour-bg);
}
.home-tour__text  { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.home-tour__range { color: var(--color-muted); font-size: var(--font-size-sm); }
.home-tour__nums  { font-size: 15px; font-variant-numeric: tabular-nums; }
.home-tour__album { color: var(--color-accent); font-size: var(--font-size-sm); font-weight: 500; }

/* km per month */
.month-bars {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
    height: 110px;
    padding: 4px 4px 0;
}
.month-bars__col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-height: 0; }
.month-bars__bar {
    width: 100%;
    max-width: 36px;
    border-radius: 6px 6px 2px 2px;
    background: var(--color-accent);
    opacity: .8;
}
.month-bars__label { font-size: var(--font-size-xs); color: var(--color-muted); font-weight: 600; }

@media (max-width: 999px) {
    .home { grid-template-columns: minmax(0, 1fr); }
}

/* --- statistics ------------------------------------------------------------ */
.stats-page {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    max-width: 1100px;
}
.stats-page__hint { margin: 0 4px; }

/* year comparison curve */
.curve { width: 100%; height: auto; display: block; }
.curve__grid { stroke: var(--color-border); stroke-width: 1; }
.curve__axis { fill: var(--color-muted); font-size: 13px; font-family: var(--font-family); }
.curve__line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.curve__dot { stroke: var(--color-surface); stroke-width: 2; }
.curve-legend__empty { color: var(--color-muted); }
.home-card__hint { font-size: var(--font-size-sm); color: var(--color-muted); }

/* tick box in the year column: chooses the years of the chart */
.year-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px; }
.year-pick__box {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.year-pick__box:disabled { cursor: default; opacity: .4; }
.year-pick__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pick-color, transparent); }
.curve-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }
.curve-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.curve-legend__swatch { width: 22px; height: 4px; border-radius: 2px; }

/* tables (years, vehicle types) */
.stat-table {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
}
.stat-row {
    display: grid;
    grid-template-columns: 120px minmax(40px, 1fr) 100px 64px 80px 64px 76px;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    padding: 4px 16px;
    border-bottom: 1px solid var(--color-bg);
    font-variant-numeric: tabular-nums;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row--head {
    min-height: 36px;
    background: #F4F6F4;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-muted);
}
.stat-row--head span:nth-child(n+3) { text-align: right; }
.stat-row--total { background: #F4F6F4; font-weight: 700; }
.stat-row.is-current { background: var(--color-accent-soft); }
.stat-row__year { font-weight: 700; white-space: nowrap; }
.stat-row__best { color: #C2410C; }
.stat-row__num  { text-align: right; white-space: nowrap; }
.stat-row__muted { color: var(--color-muted); }

.stat-row--types { grid-template-columns: minmax(120px, 1.3fr) minmax(80px, 1fr) 100px 64px 80px 64px; }
.stat-row--type { font-weight: 600; min-height: 0; padding-top: 8px; padding-bottom: 0; border-bottom: 0; line-height: 1.15; }
.stat-row--type:not(:nth-child(2)) { border-top: 1px solid var(--color-border); }
.stat-row--type:has(+ .stat-row--type), .stat-row--type:last-child { padding-bottom: 8px; }
/* vehicles sit close together and close to their type */
.stat-row--vehicle {
    min-height: 0;
    padding-top: 3px;      /* fixed padding instead of a centred min-height, so the  */
    padding-bottom: 0;     /* gap above stays the same for first, middle and last row */
    border-bottom: 0;
    line-height: 1.2;
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}
.stat-row--vehicle:has(+ .stat-row--type), .stat-row--vehicle:last-child { padding-bottom: 10px; }
.stat-row--vehicle .stat-row__name { padding-left: 18px; }
.stat-row__name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share { display: flex; align-items: center; gap: 8px; min-width: 0; }
.share .year-row__bar { flex: 1 1 auto; }
.share__pct { flex: 0 0 40px; text-align: right; font-size: var(--font-size-sm); font-weight: 500; color: var(--color-muted); }

/* collapsible year groups */
.stat-group {
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-panel);
}
.stat-group[open] { padding-bottom: 16px; }
.stat-group .stat-table { margin: 0 16px; }
.stat-group__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    min-height: 60px;
    padding: 10px 16px 10px 20px;
    cursor: pointer;
    list-style: none;
}
.stat-group__head::-webkit-details-marker { display: none; }
.stat-group__title { font-size: 20px; font-weight: 700; min-width: 64px; }
.stat-group__sum { flex: 1 1 auto; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.stat-group__sum strong { color: var(--color-text); }
.stat-group__chevron { color: var(--color-muted); transition: transform .15s; }
.stat-group[open] .stat-group__chevron { transform: rotate(180deg); }

@media (max-width: 999px) {
    .stat-row { grid-template-columns: 112px 0 92px 52px 72px 56px 64px; gap: 8px; padding: 4px 12px; }
    .stat-row > .year-row__bar { visibility: hidden; }
    .stat-row--types { grid-template-columns: minmax(100px, 1fr) 0 88px 48px 68px 52px; }
    .stat-row--types .share,
    .stat-row--head > :nth-child(2) { visibility: hidden; }
}

/* --- statistics: months heat map ------------------------------------------ */
.heat { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.heat__row {
    display: grid;
    grid-template-columns: 52px repeat(12, minmax(44px, 1fr)) 72px;
    gap: 3px;
    align-items: center;
    font-variant-numeric: tabular-nums;
}
.heat__row--head { font-size: var(--font-size-xs); font-weight: 600; color: var(--color-muted); text-align: center; }
.heat__row--head > :first-child { text-align: left; }
.heat__row--head > :last-child, .heat__sum { text-align: right; }
.heat__year { font-weight: 700; }
.heat__cell {
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--color-text);
    background: color-mix(in srgb, var(--color-accent) calc(var(--level) * 100%), #F1F4F2);
}
.heat__cell.is-dark { color: #FFFFFF; }
.heat__cell.is-future { background: transparent; border: 1px dashed var(--color-border); }
.heat__sum { font-weight: 600; padding-left: 6px; }
.heat__row--avg { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--color-border); }
.heat__avg { text-align: center; font-size: 13px; color: var(--color-muted); }

/* --- statistics: vehicle report ------------------------------------------ */
.report-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.report-nav .chip { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.report-nav .chip[aria-pressed="true"] { color: #FFFFFF; }
.chip--retired { opacity: .65; }
.report-title { margin: 0; flex: 1 1 auto; font-size: 22px; font-weight: 700; }

.report-row {
    display: grid;
    grid-template-columns: 96px minmax(120px, 2fr) 76px 72px minmax(120px, 1fr) minmax(0, 1.4fr);
    gap: 12px;
    align-items: center;
    min-height: 36px;
    padding: 2px 16px;
    border-bottom: 1px solid var(--color-bg);
    color: inherit;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.report-row:last-child { border-bottom: 0; }
a.report-row:hover { background: var(--color-bg); }
.report-row--head {
    min-height: 32px;
    background: #F4F6F4;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-muted);
}
.report-row--head > :nth-child(3), .report-row--head > :nth-child(4) { text-align: right; }
.report-row__date  { color: var(--color-muted); }
.report-row__title, .report-row__tour { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-row__tour  { font-size: var(--font-size-sm); color: var(--color-tour-text); }
.speed { display: flex; align-items: center; gap: 8px; min-width: 0; }
.speed__bar { flex: 1 1 auto; height: 10px; border-radius: 999px; background: var(--color-bg); overflow: hidden; }
.speed__bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #A7D7A0, #4F9D57); }
.speed__value { flex: 0 0 44px; text-align: right; }

@media (max-width: 999px) {
    .report-row { grid-template-columns: 100px minmax(0, 1fr) 64px 70px 56px; gap: 10px; padding: 2px 12px; }
    .report-row > :last-child { display: none; }
    .speed__bar { display: none; }
}

/* --- GPX track in the trip form ---------------------------------------------- */
.track-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
}
.track-map {
    position: relative;
    z-index: 0;              /* keeps Leaflet's layers below dialogs and the toast */
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.track-map__msg { margin: 0; color: var(--color-muted); font-size: var(--font-size-sm); }
.stats--track { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
.track-card__hint { margin: 0; font-size: var(--font-size-sm); color: var(--color-tour-text); }
.track-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.track-card__file {
    flex: 1 1 200px;
    min-width: 0;
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- setup: GPX import ------------------------------------------------------- */
.import-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.import-progress { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.import-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; }
.import-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.import-tools .segmented button { padding: 0 12px; font-size: 14px; }
.import-list {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
}
.import-list:empty { display: none; }
.import-row {
    display: grid;
    grid-template-columns: 32px minmax(180px, 1fr) minmax(240px, 1.3fr);
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-bg);
}
.import-row:last-child { border-bottom: 0; }
.import-row--done  { background: #F1F8F5; }
.import-row--error { background: var(--color-danger-soft); }
.import-row__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.import-row__file { font-weight: 600; overflow-wrap: anywhere; }
.import-row__meta { font-size: var(--font-size-sm); color: var(--color-muted); }
.import-row__action { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.import-row__select, .import-row__title { height: 44px; font-size: 15px; }
.import-row__hint { font-size: var(--font-size-sm); color: var(--color-tour-text); }
.import-row__ok { color: var(--color-accent); font-weight: 600; }
.import-row__ok a { color: inherit; }
.import-row__error { color: var(--color-danger); font-size: var(--font-size-sm); font-weight: 500; }
.import-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: 0 -2px 12px rgba(23, 32, 28, .08);
    font-weight: 600;
}
kbd { padding: 1px 6px; border: 1px solid var(--color-border); border-radius: 6px; background: #F4F6F4; font-size: 13px; }

@media (max-width: 999px) {
    .import-row { grid-template-columns: 32px minmax(0, 1fr); }
    .import-row__action { grid-column: 2; }
}

/* --- logout button in the navigation rail ------------------------------- */
.nav__logout { margin-top: auto; }
.nav__item--button { border: 0; background: transparent; }

/* --- login page ---------------------------------------------------------- */
.login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login__card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.login__brand { display: flex; align-items: center; gap: 14px; }
.login__logo  { margin-bottom: 0; flex: 0 0 auto; }
.login__title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.login__error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-weight: 600;
}
.login__submit { width: 100%; margin-top: 4px; }

/* Native checkbox, big enough for fingers */
.check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--control-height);
    font-weight: 500;
    cursor: pointer;
}
.check input {
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

/* --- portrait tablet / narrow window: list OR detail -------------------- */
@media (max-width: 999px) {
    .panel--list   { flex: 1 1 auto; }
    .panel--detail { display: none; }
    body.show-detail .panel--list   { display: none; }
    body.show-detail .panel--detail { display: flex; }
    .back-btn { display: inline-flex; }
}

/* Narrow detail column: stack date / distance / duration */
@media (max-width: 1099px) and (min-width: 1000px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 > :first-child { grid-column: 1 / -1; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .year-row { grid-template-columns: 48px 0 1fr 64px 56px 40px; gap: 10px; }
    .year-row__bar { visibility: hidden; }
    .recent-row { grid-template-columns: 92px 0 80px 68px 48px; gap: 8px; }
    .recent-row__vehicle { visibility: hidden; }
}
