/* App shell, public shell, navigation, error pages. One <nav> markup, three layouts
   (UI spec §2): phone bottom bar < 768 px, labelled 88 px rail 768-1279 px, full
   sidebar >= 1280 px. Same HTML, CSS media queries only. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--c-brand-charcoal);
  color: #fff;
  border-radius: var(--radius-lg);
}
.skip-link:focus {
  left: 8px;
}

/* ---- Wordmark: HISTORIKU. with the lime period --------------------------------------- */
.wordmark {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--c-text);
}
.wordmark__dot {
  color: var(--c-accent-line);
}

/* ---- Main area ------------------------------------------------------------------------ */
.app__main {
  padding: 16px 16px calc(var(--size-nav-item) + 24px + env(safe-area-inset-bottom));
}
.app__main:focus {
  outline: none;
}

/* ---- Navigation: phone bottom bar (default) ------------------------------------------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav__list {
  display: flex;
}
.nav__cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}
.nav__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--size-nav-item);
  padding: 4px 2px;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--c-text-2);
  font-size: var(--type-meta-min, 13px);
  font-weight: 600;
  text-decoration: none;
}
.nav__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav__item--active {
  color: var(--c-selected);
  box-shadow: inset 0 3px 0 var(--c-selected);
}
/* Phone shows Home, Vehicles, Reminders and More only. */
.nav__cell--wide,
.nav__brand,
.nav__logout {
  display: none;
}

/* Due badge: lime, charcoal text. The number is aria-hidden; the words are visually hidden. */
.badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--c-brand-lime);
  color: var(--c-brand-charcoal);
  border-radius: 11px;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

/* ---- More sheet ----------------------------------------------------------------------- */
.more {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.more__item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--size-list-row);
  padding: 0 16px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  color: var(--c-text);
  font-size: var(--type-body);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.install {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.more .install {
  margin-top: 0;
}
.install__hint {
  margin: 0;
  color: var(--c-text-muted, var(--c-text));
  font-size: var(--type-small, 14px);
}
.install[hidden] {
  display: none;
}

/* ---- Public shell --------------------------------------------------------------------- */
.public__head {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 16px;
  background: var(--c-brand-charcoal);
}
.public__brand {
  text-decoration: none;
}
.public__head .wordmark {
  color: #fff;
}
.public__main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}
.public__main:focus {
  outline: none;
}

/* ---- Error pages ---------------------------------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-block: 24px;
}
.error-page__status {
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text-2);
}
.error-page .btn {
  margin-top: 12px;
}

/* ---- Tablet: labelled 88 px rail ------------------------------------------------------ */
@media (min-width: 768px) {
  .app {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
  }
  .nav {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    right: auto;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 8px 0;
    border-top: 0;
    border-right: 1px solid var(--c-border);
  }
  .nav__list {
    flex-direction: column;
  }
  .nav__cell {
    flex: none;
  }
  .nav__cell--wide,
  .nav__logout {
    display: flex;
  }
  .nav__cell--phone-only {
    display: none;
  }
  .nav__item {
    flex: none;
    width: 100%;
    min-height: 64px;
    padding: 6px 4px;
    gap: 4px;
  }
  .nav__item--active {
    box-shadow: inset 3px 0 0 var(--c-selected);
  }
  .nav__logout {
    margin-top: auto;
  }
  .badge {
    top: 6px;
    left: calc(50% + 8px);
  }
  .app__main {
    padding: 24px;
  }
  .toast-region {
    left: 88px;
    bottom: 24px;
  }
}

/* ---- Counter PC: full sidebar --------------------------------------------------------- */
@media (min-width: 1280px) {
  .app {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .nav__brand {
    display: block;
    padding: 20px 16px 16px;
    text-decoration: none;
  }
  .nav__item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: var(--size-nav-item);
    padding: 0 16px;
    font-size: var(--type-body);
  }
  .badge {
    position: static;
    margin-left: auto;
  }
  .toast-region {
    left: 200px;
  }
}

/* ---- Auth pages (signup, login) ------------------------------------------------------- */
.auth {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--form-max);
}
.auth__lead {
  color: var(--c-text-2);
}
.auth__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.auth__form .btn {
  width: 100%;
}
.auth__error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--c-danger);
  border-radius: var(--radius-lg);
  background: var(--tint-danger);
  font-weight: 600;
  color: var(--c-danger);
}
.auth__alt {
  color: var(--c-text-2);
}
.auth__alt a {
  margin-left: 6px;
  font-weight: 600;
}
/* The code of a magic link opened on another device: read off one screen, typed on another. */
.auth__code {
  font-family: var(--font-data);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}
/* The magic-link request sits below the password form, set apart by a rule. */
.auth__magic {
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.check__label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--touch-min);
  font-weight: 400;
  cursor: pointer;
}
.check__input {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--c-brand-graphite);
}
.field[data-invalid] .check__input {
  outline: 2px solid var(--c-danger);
  outline-offset: 2px;
}

/* ---- Home (UI spec §6 header) ---------------------------------------------------------- */
.home__head {
  margin-bottom: 16px;
}
.home__garage {
  text-transform: uppercase;
}
.home__date {
  color: var(--c-text-2);
}
.home__empty {
  color: var(--c-text-2);
}
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  font-weight: 600;
}
.banner--info {
  border: 2px solid var(--c-info);
  background: color-mix(in srgb, var(--c-info) 10%, var(--c-surface));
}
.banner--danger {
  border: 2px solid var(--c-danger);
  background: color-mix(in srgb, var(--c-danger) 10%, var(--c-surface));
}
.banner--warning {
  border: 2px solid var(--c-warning);
  background: color-mix(in srgb, var(--c-warning) 10%, var(--c-surface));
}
.banner__link,
.banner__mail {
  display: inline-block;
  margin-left: 6px;
  min-height: 44px;
  line-height: 44px;
  user-select: text;
}
.banner--success {
  border: 2px solid var(--c-success);
  background: color-mix(in srgb, var(--c-success) 10%, var(--c-surface));
}

/* ---- Settings (docs/20 §Settings) ------------------------------------------------------ */
.settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: var(--content-max);
}
.settings__facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.settings__facts dt {
  color: var(--c-text-2);
}
.settings__facts dd {
  margin: 0;
  font-weight: 600;
}
.settings__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--form-max);
}
.settings__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 0;
}
/* An invite that hit a deactivated member offers "Riaktivizo" instead. */
.settings__offer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--c-info);
  border-radius: var(--radius-lg);
  font-weight: 600;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: var(--type-meta);
  font-weight: 600;
  color: var(--c-text-2);
}

/* Settings → Favorites: one card per favorite; move buttons are 56 px (UI spec §13). */
.settings__lead {
  color: var(--c-text-2);
}
.fav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.fav__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fav__actions {
  display: flex;
  flex: none;
  gap: 8px;
}
.fav__up .icon {
  transform: rotate(180deg);
}
.fav__edit summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  color: var(--c-info);
}
.fav__edit[open] summary {
  margin-bottom: 8px;
}

/* ---- Settings → Messages ------------------------------------------------------------------ */
.messages textarea.field__input {
  min-height: 120px;
  resize: vertical;
}
.messages code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}
.messages__preview {
  padding: 12px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
}
.messages__preview-label {
  margin: 0 0 4px;
  font-size: 0.875rem;
  color: var(--c-text-2);
}
.messages__bubble {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.messages__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Confirm dialog (native <dialog>, docs/47) ------------------------------------------ */
.dialog {
  width: min(100% - 32px, 440px);
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  color: var(--c-text);
}
.dialog::backdrop {
  background: rgb(21 24 25 / 0.55);
}
.dialog__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dialog__form h2 {
  font-size: var(--type-question);
}
.dialog__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Vehicle detail (UI spec 7): charcoal header, contact card, sections. */
.vehicle {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--content-max);
}
.vehicle__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--c-brand-charcoal);
  color: #fff;
}
.vehicle__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vehicle__back,
.vehicle__head a:not(.btn) {
  color: var(--c-brand-cobalt-light);
}
.vehicle__model {
  font-family: var(--font-brand);
  font-size: var(--type-screen-title);
  font-weight: 800;
  line-height: 1.05;
}
.vehicle__owner {
  font-size: 19px;
}
.vehicle__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.vehicle__km {
  font-family: var(--font-mono);
}
.btn--compact {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
}
.vehicle .btn--secondary.btn--compact {
  background: transparent;
  border-color: var(--c-brand-steel);
  color: #fff;
}
.contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact__phone {
  font-family: var(--font-mono);
  font-size: 19px;
}
.contact__actions {
  display: flex;
  gap: 12px;
}
.vehicle__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vehicle__empty {
  color: var(--c-text-2);
}
/* Plate and ownership history (collapsed on the vehicle page). */
.history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.history li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: var(--touch-min);
}
/* Direct children only: a plate chip's number is .mono too and keeps its own
   dark-on-white colour. */
.history li > .mono {
  color: var(--c-text-2);
}
/* Active reminders on the vehicle page. */
.reminders {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
ul.reminders {
  gap: 0;
}
/* Bell · title and source, then status and due day; Send on the right. */
.reminders__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon text send"
    ".    meta send";
  align-items: center;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
}
.reminders__row:last-child {
  border-bottom: 0;
}
.reminders__row > .icon {
  grid-area: icon;
  align-self: start;
}
.reminders__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.reminders__meta > .mono {
  color: var(--c-text-2);
  white-space: nowrap;
}
.reminders__send {
  grid-area: send;
}
.reminders__next {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--c-text-2);
}
.reminders__text {
  grid-area: text;
  display: flex;
  flex-direction: column;
}
.reminders__from,
.reminders__text > .mono {
  color: var(--c-text-2);
}
.vehicle .banner {
  margin: 0;
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-list .btn {
  justify-content: flex-start;
  width: 100%;
}

/* ---- Home sections and tablet panes (UI spec §6, §12) --------------------------------------- */
.home__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.home__add {
  margin-top: 16px;
}
.panes__list {
  display: none;
}
@media (min-width: 1000px) {
  .panes {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .panes__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 24px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
  }
}

/* ---- Add Service: full screen on the phone, side sheet from 768 px (UI spec §8, §12) --------- */
.visit-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: var(--form-max);
}
.visit-sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.visit-sheet__title {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: var(--type-screen-title);
  line-height: 1.1;
  text-transform: uppercase;
}
.visit-sheet__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 0;
  color: var(--c-text-2);
}
.visit__stepno {
  margin: 0;
  font-weight: 600;
  color: var(--c-text-2);
}
.panes--sheet .panes__list {
  display: none;
}
@media (max-width: 767.98px) {
  .panes--sheet .panes__vehicle {
    display: none;
  }
}
@media (min-width: 768px) {
  .panes.panes--sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 24px;
    align-items: start;
  }
  .panes--sheet > .visit-sheet {
    grid-column: 2;
    position: sticky;
    top: 24px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 28px rgb(0 0 0 / 0.18);
  }
  .panes--sheet > .visit-sheet:only-child {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .visit__stepno,
  .review {
    display: none;
  }
  .chips--single {
    grid-template-columns: 1fr;
  }
}
.chips--single {
  grid-template-columns: 1fr;
}
.steps:not([data-ready]) .review {
  display: none;
}
.datebox > summary {
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  gap: 0.35em;
  cursor: pointer;
  font-family: var(--font-data);
}
.datebox__change {
  color: var(--c-link);
  text-decoration: underline;
}
.reminder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.reminder__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reminder__summary p {
  margin: 0;
}
.reminder__other {
  display: none;
  flex-direction: column;
  gap: 12px;
}
.steps:not([data-ready]) .reminder__other,
.reminder:has(input[name="reminder"][value="other"]:checked) .reminder__other,
.reminder__other:has([aria-invalid="true"]) {
  display: flex;
}
.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.results .btn {
  width: 100%;
  justify-content: flex-start;
}
.override {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.override legend {
  padding: 0 6px;
  font-weight: 700;
}
.parts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}
.parts__title {
  margin: 0;
  font-weight: 700;
}
.parts__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.part-row__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.part-row__name {
  flex: 1 1 12rem;
  margin: 0;
  font-weight: 600;
}
.part-row__code {
  margin-left: 8px;
  font-weight: 400;
  color: var(--c-text-muted);
}
.part-row__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.part-row__qty .field__input {
  width: 7rem;
}
.results__meta {
  margin-left: auto;
  color: var(--c-text-muted);
}
.results__empty {
  color: var(--c-text-muted);
}
.review {
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.review h2 {
  margin: 0 0 8px;
  font-size: var(--type-body);
}
.review dl {
  display: grid;
  margin: 0;
}
.review dl > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review dt {
  flex: 0 0 76px;
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.review dd {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.link {
  min-height: var(--touch-min);
  padding: 0 8px;
  background: none;
  border: 0;
  color: var(--c-link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.visit__confirm {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--c-warning);
  border-radius: var(--radius-lg);
}
.visit__confirm p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
/* "Si herën e kaluar": one tap ticks the last visit's items. */
.repeat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--size-chip);
  margin-bottom: 4px;
  padding: 10px 14px;
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-lg);
  color: var(--c-text);
  font: inherit;
  text-align: left;
}
.repeat:hover {
  border-color: var(--c-selected);
}
.repeat__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.repeat__sub {
  overflow: hidden;
  color: var(--c-text-2);
  font-size: var(--type-meta);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visit__save {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: var(--c-bg);
}
/* On the phone the visit sheet is the whole task: the tab bar goes (the sheet
   has its own close button) so it cannot cover the sticky Save or Continue. */
@media (max-width: 767.98px) {
  .app:has(.visit-sheet) .nav {
    display: none;
  }
  .app:has(.visit-sheet) .app__main {
    padding-bottom: 0;
  }
  .visit__save,
  .visit-sheet .steps[data-ready] .step:not(:last-of-type) .step__nav {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .visit-sheet .steps[data-ready] .step:not(:last-of-type) .step__nav {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: var(--c-bg);
  }
}
.toast-region .toast {
  pointer-events: auto;
}

/* ---- Vehicle timeline (UI spec §7.5-7.6) ----------------------------------------------------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__note {
  color: var(--c-text-2);
  font-size: var(--type-meta);
  text-align: center;
}
.visit-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.visit-card--saved {
  border-color: var(--c-accent-line);
  outline: 3px solid var(--c-accent-line);
}
.visit-card__head {
  display: flex;
  justify-content: space-between;
  margin: 0;
  font-weight: 600;
}
.visit-card__items {
  margin: 0;
  padding-left: 20px;
}
.visit-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
}
/* Icon in its own column so a long line never pushes it onto a row of its
   own; the closure note sits under the text. Lime means "active": a
   reminder that a later visit closed, and the closing line itself, are grey. */
.visit-card__reminder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 8px;
  margin: 0;
  color: var(--c-accent-text);
}
.visit-card__reminder > .icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}
.visit-card__reminder--closed {
  color: var(--c-text-2);
}
.visit-card__reminder-status {
  grid-column: 2;
  color: var(--c-text-2);
}
.visit-card__foot {
  justify-content: space-between;
  color: var(--c-text-2);
}
.visit-card__amount {
  margin-left: auto;
  color: var(--c-text);
}
.visit-card__edit {
  color: var(--c-link, var(--c-text));
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.visit-edit {
  display: grid;
  gap: var(--space-4, 1rem);
}
.visit-edit__h {
  font-family: var(--font-display, inherit);
}
.visit-card__note summary {
  min-height: var(--touch-min);
  color: var(--c-link);
  cursor: pointer;
}

/* ---- Due cards on Home and the tablet list pane (UI spec §6, §12) --------------------------- */
.due__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.due__cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.due-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 2px solid var(--c-accent-line);
  border-radius: var(--radius-md);
  background: var(--c-surface, #fff);
}
.due-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.due-card__link {
  display: flex;
  flex-direction: column;
  min-height: var(--touch-min);
  color: inherit;
  text-decoration: none;
}
.due-card__model {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
}
.due-card__owner {
  color: var(--c-text-2);
}
.due-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0;
}
.due-card__send {
  width: 100%;
}
.due--pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Vehicle pane strip: contact card + active reminders side by side (UI spec §12) ---------- */
.vehicle__strip {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* The contact card's title is a label, not a section heading. */
.vehicle__strip .card__title {
  color: var(--c-text-2);
  font-family: var(--font-data);
  font-size: var(--type-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (min-width: 768px) {
  /* A wide screen does not need a full-width "Shto vizitë". */
  .vehicle > .btn--hero {
    align-self: flex-start;
    min-width: 320px;
  }
}
@media (min-width: 1000px) {
  /* The list pane is the way back; the "Ballina" link would repeat it. */
  .panes:not(.panes--sheet) .vehicle__back {
    visibility: hidden;
  }
}
@media (min-width: 1000px) {
  .vehicle__strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.home__low-stock {
  margin: 16px 0 0;
}

/* ---- CSV import (docs/15 steps 1-5, UI spec §13) ---------------------------------------------- */
.import__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  border: 0;
}
.import__footer {
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: var(--c-bg);
}
.import__footer .btn {
  width: 100%;
}
.import__encoding {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--form-max);
}
.import__totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.import__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.import__row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.import__row--error {
  border-color: var(--c-danger);
}
.import__cells {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.import__cells > div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 8px;
}
.import__cells dt {
  color: var(--c-text-2);
}
.import__cells dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.import__issue {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--c-danger);
  font-size: var(--type-meta);
}
.import__issue--warning {
  color: var(--soon-fg);
}
@media (min-width: 768px) {
  .import__totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .import__footer .btn {
    width: auto;
  }
}

/* ---- Onboarding wizard (docs/17, UI spec §13) ------------------------------------------------- */
.onboarding {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--form-max);
  margin: 0 auto;
}
.onboarding__progress {
  margin: 0;
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.onboarding__bar {
  display: flex;
  gap: 4px;
}
.onboarding__bar s {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--c-border);
  text-decoration: none;
}
.onboarding__bar s[data-on] {
  background: var(--c-brand-lime);
}
.onboarding__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.onboarding__footer {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  background: var(--c-bg);
}
.onboarding__footer .btn {
  width: 100%;
}
.onboarding__fav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding__module {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 56px;
}
.onboarding__module input {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}
.onboarding__module-text {
  display: flex;
  flex-direction: column;
}
.onboarding__checklist {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.onboarding__checklist h2,
.onboarding__checklist p {
  margin: 0;
}
.onboarding__checklist-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding__checklist-actions .btn {
  width: 100%;
}
@media (min-width: 768px) {
  .onboarding__footer {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }
  .onboarding__footer .btn,
  .onboarding__checklist-actions .btn {
    width: auto;
  }
  .onboarding__checklist-actions {
    flex-direction: row;
  }
}

/* ---- Settings → Audit log: rows become cards below 768 px (UI spec §2) -------------------- */
.audit__row .row__main {
  align-items: flex-start;
}
.audit__meta {
  color: var(--c-text-2);
  font-size: var(--type-meta);
  overflow-wrap: anywhere;
}
.audit__more {
  list-style: none;
}
.audit__filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: none;
}
.audit__filter .settings__actions {
  grid-column: 1 / -1;
}
.settings__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings__group-title {
  margin: 0;
  color: var(--c-text-2);
  font-family: var(--font-data);
  font-size: var(--type-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.settings__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 16px;
}
.settings__legal a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  color: var(--c-link);
}
