/* Component styles. Only custom properties from tokens.css; phone sizes are the
   defaults and the tokens switch to tablet values from 768 px. */

/* Status colours that need a dark-mode twin not present in tokens.json roles. */
:root {
  --soon-bg: var(--c-brand-lime-pale);
  --soon-fg: var(--c-brand-lime-chip-text);
  --tint-selected: color-mix(in srgb, var(--c-selected) 12%, var(--c-surface));
  --tint-danger: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface));
  --tint-success: color-mix(in srgb, var(--c-success) 12%, var(--c-surface));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --soon-bg: color-mix(in srgb, var(--c-brand-lime) 20%, var(--c-surface));
    --soon-fg: var(--c-brand-lime);
  }
}
:root[data-theme="dark"] {
  --soon-bg: color-mix(in srgb, var(--c-brand-lime) 20%, var(--c-surface));
  --soon-fg: var(--c-brand-lime);
}

/* ---- Icon ------------------------------------------------------------------ */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Button ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--size-secondary-button);
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-ui);
  font-size: var(--type-body);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.btn--primary {
  min-height: var(--size-primary-button);
  width: 100%;
  background: var(--c-brand-lime);
  color: var(--c-brand-charcoal);
}
.btn--primary:hover {
  background: var(--c-brand-lime-strong);
}
.btn--hero {
  min-height: var(--size-primary-button-hero);
}
.btn--secondary {
  background: var(--c-surface);
  border-color: var(--c-border);
  color: var(--c-text);
}
.btn--secondary:hover {
  border-color: var(--c-text-2);
}
.btn--danger {
  background: var(--c-surface);
  border-color: var(--c-danger);
  color: var(--c-danger);
}
.btn--danger:hover {
  background: var(--tint-danger);
}
.btn--icon {
  width: var(--size-icon-row-button);
  min-height: var(--size-icon-row-button);
  padding: 0;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- Field ------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Same weight as <label> for a group's caption (e.g. "Marka"). */
p.field__label {
  margin: 0;
  font-weight: 600;
}
/* A unit inside the input's right end ("km"). */
.field__box {
  position: relative;
}
.field__box > .field__input {
  width: 100%;
  padding-right: 64px;
}
.field__unit {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--c-text-2);
  font-family: var(--font-data);
  font-size: var(--type-body);
  pointer-events: none;
}
/* "Shfaq"/"Fshih" under a password field, right-aligned (app.js adds it). */
.field__reveal {
  align-self: flex-end;
  margin-top: -4px;
}
.phone-field__row {
  display: flex;
  gap: 8px;
}
.phone-field__code {
  flex: 0 0 auto;
  width: auto;
  min-width: 7.5rem;
}
.phone-field__number {
  flex: 1 1 auto;
  min-width: 0;
}
/* The plate input looks like a plate: the number in mono on white. The
   country picker is tappable, so it takes the graphite stub, never the
   plate-only band blue (docs/35). */
.plate-field__row {
  display: flex;
  overflow: hidden;
  background: #fff;
  border: 3px solid var(--c-brand-charcoal);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 2px #fff;
}
.plate-field__row:focus-within {
  box-shadow: 0 0 0 3px var(--c-focus);
}
.plate-field[data-invalid] .plate-field__row {
  box-shadow: 0 0 0 3px var(--c-danger);
}
.plate-field__row > .field__input {
  border: 0;
  border-radius: 0;
}
.plate-field__row > .field__input:focus-visible {
  outline: none;
}
.plate-field__country {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5rem;
  background: var(--c-brand-charcoal);
  color: #fff;
  font-weight: 700;
}
.plate-field__country option {
  background: var(--c-surface);
  color: var(--c-text);
}
.plate-field__number {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 60px;
  background: #fff;
  color: var(--c-brand-charcoal);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plate-field__other {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plate-field__other-code {
  max-width: 8rem;
  text-transform: uppercase;
}
/* The "Tjetër" code shows only while "Tjetër" is picked. Without :has the rule
   is dropped and the input simply stays visible. */
.plate-field:not(:has(.plate-field__country option[value=""]:checked)) .plate-field__other {
  display: none;
}
.field__optional {
  margin-left: 8px;
  font-size: var(--type-meta);
  font-weight: 400;
  color: var(--c-text-2);
}
.field__hint {
  font-size: var(--type-meta);
  color: var(--c-text-2);
}
.field__input--big {
  min-height: var(--size-numeric-input);
  font-size: var(--type-numeric);
  font-weight: 600;
}
.field[data-invalid] .field__input {
  border-color: var(--c-danger);
  background: var(--tint-danger);
}
.field__error {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--type-meta);
  font-weight: 600;
  color: var(--c-danger);
}
.field__error .icon {
  width: 20px;
  height: 20px;
}

/* ---- Chip + Segmented (checkbox / radio backed) -------------------------------- */
.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.chip,
.segmented__option {
  position: relative;
  display: block;
}
.chip__input,
.segmented__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.chip__face {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--size-chip);
  padding: 8px 14px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  font-weight: 600;
  line-height: 1.2;
}
.chip__sub {
  font-size: var(--type-meta);
  font-weight: 400;
  color: var(--c-text-2);
}
.chip__input:checked + .chip__face,
.segmented__input:checked + .segmented__face {
  background: var(--tint-selected);
  border-color: var(--c-selected);
  color: var(--c-selected);
}
.chip__input:checked + .chip__face .chip__sub {
  color: inherit;
}
.chip__face {
  position: relative;
  padding-right: 26px;
}
.chip__check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: none;
}
.chip__check .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.chip__input:checked + .chip__face .chip__check {
  display: flex;
}
.chip__input:focus-visible + .chip__face,
.segmented__input:focus-visible + .segmented__face {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

.segmented__legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
}
.segmented__options {
  display: flex;
}
.segmented__option {
  flex: 1 1 0;
  min-width: 0;
}
.segmented__face {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--size-secondary-button);
  padding: 0 6px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  margin-left: -2px;
  font-weight: 600;
}
.segmented__option:first-child .segmented__face {
  margin-left: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.segmented__option:last-child .segmented__face {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.segmented__input:checked + .segmented__face {
  position: relative;
  z-index: 1;
}

/* ---- Plate chip + make tile -------------------------------------------------------- */
.plate {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1.5px solid var(--c-brand-graphite);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-brand-charcoal);
  line-height: 1;
  vertical-align: middle;
}
.plate__stub {
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: var(--c-brand-graphite);
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
}
/* Real plates with the blue band (docs/06 §Country). Plate-only colour: never
   for links, selection or anything tappable (docs/35 Plate chip colour). */
.plate--band .plate__stub {
  background: var(--c-plate-band);
  color: #fff;
}
.plate__no {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--c-brand-charcoal); /* a real plate: dark on white in both themes */
  font-weight: 600;
  font-size: var(--type-meta);
}
.plate--md .plate__no {
  padding: 6px 10px;
  font-size: var(--type-data);
}
.plate--lg .plate__stub {
  padding: 0 10px;
  font-size: 16px;
}
.plate--lg .plate__no {
  padding: 8px 14px;
  font-size: calc(var(--type-data) + 5px);
}
.plate--on-dark {
  border-color: #fff;
}

.make-tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--c-brand-graphite);
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
}
.make-tile--due {
  background: var(--c-brand-lime);
  color: var(--c-brand-charcoal);
}

/* ---- Status ------------------------------------------------------------------------ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.2;
}
.status .icon {
  width: 18px;
  height: 18px;
}
.status--overdue {
  background: var(--tint-danger);
  color: var(--c-danger);
}
.status--soon {
  background: var(--soon-bg);
  color: var(--soon-fg);
}
.status--ok,
.status--later {
  background: var(--c-bg);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.status--done {
  background: var(--tint-success);
  color: var(--c-success);
}

/* ---- Money --------------------------------------------------------------------------- */
.money--unknown {
  color: var(--c-text-2);
}

/* ---- Card ---------------------------------------------------------------------------- */
.card {
  padding: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.card__title {
  margin-bottom: 8px;
}

/* ---- List row: one link, optional sibling action ---------------------------------------- */
.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.row__main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 12px;
  min-height: var(--size-list-row);
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}
a.row__main:hover {
  background: var(--c-bg);
}
.row__body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.row__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.row__sub {
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 4px;
}
.row__trailing {
  display: flex;
  flex: none;
  align-items: center;
  color: var(--c-text-2);
}
.row__action {
  display: flex;
  flex: none;
  align-items: center;
  padding-right: 10px;
}

/* ---- Sheet ---------------------------------------------------------------------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(21 24 25 / 0.55);
}
.sheet__panel {
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--c-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet__title {
  font-size: var(--type-question);
}

/* ---- VIN scan sheet (docs/06 §VIN entry) ------------------------------------------------ */
.vin-field__scan {
  align-self: flex-start;
  min-height: 48px;
}
.vin-scan__hint,
.vin-scan__status {
  margin: 0 0 8px;
  font-size: var(--type-meta);
  color: var(--c-text-2);
}
.vin-scan__video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}

/* ---- Send sheet ----------------------------------------------------------------------- */
.handoff {
  display: grid;
  gap: 12px;
}
.handoff__to {
  margin: 0;
  color: var(--c-text-2);
}
.handoff__message {
  margin: 0;
  padding: 12px;
  background: var(--c-bg);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.handoff__reason,
.handoff__hint,
.handoff__note {
  margin: 0;
  font-size: var(--type-meta);
  color: var(--c-text-2);
}
.handoff__channels {
  display: grid;
  gap: 8px;
}
.handoff__channels .btn {
  width: 100%;
}
.handoff__error {
  margin: 0;
  color: var(--c-danger);
}
.handoff__more {
  display: grid;
  gap: 8px;
}
.handoff__action > summary {
  min-height: var(--size-secondary-button);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
.handoff__form,
.handoff__snooze {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}
.handoff__form .btn,
.handoff__snooze .btn {
  width: 100%;
}
.handoff__dismiss {
  min-height: var(--size-secondary-button);
  background: none;
  border: 0;
  color: var(--c-danger);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.handoff__more:empty,
.handoff__more > :empty {
  display: none;
}

/* ---- Toasts --------------------------------------------------------------------------- */
.toast-region {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--size-nav-item) + 24px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  max-width: 480px;
  padding: 14px 18px;
  background: var(--c-brand-charcoal);
  color: #fff;
  border-radius: var(--radius-lg);
  font-weight: 600;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3);
}

/* ---- Step form ------------------------------------------------------------------------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--form-max);
}
.steps__progress {
  display: flex;
  gap: 6px;
}
.steps__progress s {
  flex: 1 1 0;
  height: 6px;
  border-radius: 3px;
  background: var(--c-border);
  text-decoration: none;
}
.steps__progress s[data-on] {
  background: var(--c-brand-lime);
}
.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
.step__question {
  margin-bottom: 12px;
  padding: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: var(--type-question);
  line-height: 1.1;
  text-transform: uppercase;
}
.step__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Back/Next exist only on the phone, once app.js has taken over the form. */
.step__nav {
  display: none;
}
@media (max-width: 767.98px) {
  .steps[data-ready] .step__nav {
    display: flex;
    gap: 10px;
  }
  .steps[data-ready] .step__next {
    flex: 1 1 auto;
  }
  /* Back is an arrow next to Continue; its word stays for screen readers. */
  .steps[data-ready] [data-prev] {
    flex: none;
    min-width: var(--size-chip);
    padding-inline: 0;
  }
  .steps[data-ready] [data-prev] > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .steps[data-ready] .step:last-of-type .step__next {
    display: none;
  }
}
@media (min-width: 768px) {
  .steps__progress {
    display: none;
  }
}

/* ---- Wide screens: chips 3 across, sheet becomes a centred panel ---------------------------- */
@media (min-width: 768px) {
  .chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sheet {
    align-items: center;
  }
  .sheet__panel {
    max-width: 520px;
    border-radius: var(--radius-lg);
  }
  .toast-region {
    bottom: 24px;
  }
  .btn--primary {
    width: auto;
    min-width: 200px;
  }
}

/* ---- Dev gallery (/dev/ui) -------------------------------------------------------------------- */
.gallery__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px;
}
.gallery__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gallery__title {
  font-size: var(--type-body);
  letter-spacing: 0.08em;
  color: var(--c-text-2);
}
.gallery__stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: var(--form-max);
}
.gallery__cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.gallery__dark {
  display: inline-flex;
  padding: 10px;
  background: var(--c-brand-charcoal);
  border-radius: var(--radius-md);
}

/* ---- Add Vehicle: reveal groups, duplicate box, owner pick ------------------------------- */
/* Without JS everything shows; app.js marks the form ready and opens one group at a time. */
.steps[data-ready] .reveal:not([data-open]) {
  display: none;
}
.steps:not([data-ready]) .models {
  display: none;
}
.steps[data-ready][data-model-other] .models.reveal + .field,
.steps[data-ready] [data-models-for][data-open] ~ .field[data-show] {
  display: block;
}
.models {
  margin-top: 4px;
}
.more {
  margin-top: 12px;
}
.more > summary {
  min-height: var(--size-secondary-button);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.more > summary::-webkit-details-marker {
  display: none;
}
/* display: flex drops the native marker, so a chevron right after the label
   says the section opens: down when closed, up when open. */
.more > summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 150ms ease;
}
.more[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
@media (prefers-reduced-motion: reduce) {
  .more > summary::after {
    transition: none;
  }
}
.conflict {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 2px solid var(--c-danger, #b3261e);
  border-radius: var(--radius-lg);
}
.steps[data-blocked] .step__next,
.steps[data-blocked] [type="submit"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--size-secondary-button);
}
.check input {
  width: 24px;
  height: 24px;
}
.owner-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

/* ---- Search results (docs/21) ------------------------------------------------------------ */
.search__count {
  margin: 16px 0 8px;
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.search__empty {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

/* ---- Search box, current row, list helpers (UI spec §6, §12) -------------------------------- */
.field__input--search {
  min-height: var(--size-primary-button);
  border: 2px solid var(--c-brand-graphite);
}
.row__main[aria-current="true"] {
  background: color-mix(in srgb, var(--c-selected) 12%, var(--c-surface));
  box-shadow: inset 4px 0 0 var(--c-selected);
}
.row__work {
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.list__more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.list__more:empty {
  display: none;
}

/* ---- Kujtesat tab: tabs and due groups ------------------------------------------------------ */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: var(--size-secondary-button);
  padding: 0 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs__tab[aria-current="page"] {
  background: var(--tint-selected);
  border-color: var(--c-selected);
  color: var(--c-selected);
}
/* On the phone the strip scrolls: the right edge fades so the cut-off tab
   reads as "more this way". */
@media (max-width: 767.98px) {
  .tabs {
    padding-right: 24px;
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
}
.tabs__count {
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-border);
  color: var(--c-text);
  font-family: var(--font-data);
  font-size: var(--type-meta);
  text-align: center;
}
.tabs__tab--due .tabs__count {
  background: var(--c-brand-lime);
  color: var(--c-brand-charcoal);
}
.reminders__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.reminders__group-title {
  font-size: var(--type-meta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-2);
}
.row__action:empty {
  display: none;
}

/* ---- Switch (labelled checkbox row) -------------------------------------------- */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 14px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.switch__input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--c-selected);
}
.switch__label {
  font-weight: 600;
}

/* ---- Share links list (vehicle page, collapsed) ---------------------------------- */
.share-links__list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.share-links__row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.share-links__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.share-links__reason,
.share-links__note {
  color: var(--c-text-2);
  font-size: 0.9rem;
}
.share-links__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}
.share-links__facts dt {
  color: var(--c-text-2);
  font-size: 0.8125rem;
}
.share-links__facts dd {
  margin: 0;
}

/* ---- Estimates (docs/11, docs/20) ------------------------------------------------------ */
.est-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.est-filter {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.est-filter--active {
  border-color: var(--c-selected);
  background: color-mix(in srgb, var(--c-selected) 10%, var(--c-surface));
}
.est-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.est-vehicle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.est-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.est-form select.field__input {
  min-height: 48px;
}
.est-form textarea.field__input {
  min-height: 96px;
  resize: vertical;
}
/* Mode switch without JS: the radio that is checked decides which section shows. */
.est-form:has(input[name="mode"][value="quick"]:checked) .est-structured,
.est-form:has(input[name="mode"][value="structured"]:checked) .est-quick {
  display: none;
}
.est-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.est-lines__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.est-line {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.est-line__legend {
  padding: 0 6px;
  font-weight: 600;
}
.est-line__nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.est-totals__lines {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.est-totals__lines li,
.est-totals__sum {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.est-totals__sum {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}
.est-table {
  width: 100%;
  border-collapse: collapse;
}
.est-table th,
.est-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}
.est-table__cat {
  display: block;
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.est-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}
.est-facts__row dt {
  color: var(--c-text-2);
  font-size: var(--type-meta);
}
.est-facts__row dd {
  margin: 0;
  white-space: pre-line;
}

/* ---- Inventory (docs/12, docs/20) ------------------------------------------------------ */
.inv-search {
  margin: 0;
}
.inv-row {
  flex-wrap: wrap;
}
.inv-row .row__main {
  flex: 1 1 100%;
}
.inv-row__actions,
.inv-detail__actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
}
.inv-row__actions {
  padding: 0 12px 12px;
}
.inv-row__actions .btn,
.inv-detail__actions .btn {
  flex: 1 1 140px;
  min-height: 56px;
}
.inv-qty {
  font-size: var(--type-data);
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}
.inv-detail__qty {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.inv-detail__qty .inv-qty {
  font-size: var(--type-numeric);
}
.inv-detail__label {
  color: var(--c-text-2);
}
.inv-delta {
  font-weight: 700;
  white-space: nowrap;
  color: var(--c-success);
}
.inv-delta--neg {
  color: var(--c-danger);
}
.inv-form__nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* VIN field: grouped preview and 17-character counter (docs/06 §VIN entry) */
.vin-field__groups {
  min-height: 1.4em;
  margin: 0;
  letter-spacing: 0.06em;
  color: var(--c-text);
}
.vin-field__count {
  margin: 0;
  font-size: var(--type-meta);
  color: var(--c-text-2);
}
.vin-field__count[data-state="ok"] {
  color: var(--c-success);
}
.vin-field__count[data-state="over"] {
  color: var(--c-danger);
}
.vin-field__hint {
  margin: 0;
  font-size: var(--type-meta);
  color: var(--c-warning);
}

/* ---- Restock and correct (docs/12) ------------------------------------------------------ */
.inv-stock__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inv-stock__now {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.inv-stock__actions .btn {
  min-height: 56px;
  width: 100%;
}
