/* =========================================================
   모빌체크 차량검수 — Design Tokens & Common Components
   레이아웃 개념: 점검자 앱은 480px 모바일 셸, 고객 리포트는 A4(210×297mm) 문서
   ========================================================= */
:root {
  color-scheme: light;

  /* Brand — 정비소 작업복의 짙은 청록(페트롤) */
  --c-primary: #0D5C63;
  --c-primary-dark: #08434A;
  --c-primary-light: #E5F0F0;
  --c-primary-tint: #F2F8F8;
  /* 보조색 1개 — 측정·경고 계열 앰버 */
  --c-accent: #C47F17;
  --c-accent-light: #FCF3E3;

  /* Neutral */
  --c-black: #111414;
  --c-gray-900: #1E2324;
  --c-gray-700: #475052;
  --c-gray-500: #788285;
  --c-gray-400: #9AA3A5;
  --c-gray-300: #C8CFD0;
  --c-gray-200: #E2E7E8;
  --c-gray-100: #EEF2F2;
  --c-gray-50: #F6F8F8;
  --c-white: #FFFFFF;

  /* Semantic — 검수 판정 */
  --c-good: #11805A;
  --c-good-light: #E6F4EE;
  --c-fair: #B26B00;
  --c-fair-light: #FDF2DF;
  --c-bad: #D92D20;
  --c-bad-light: #FDECEA;
  --c-error: #D92D20;

  /* Kakao brand */
  --c-kakao: #FEE500;
  --c-kakao-text: #191919;
  --c-naver: #03C75A;

  /* Type */
  --ff: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --fs-display: clamp(28px, 6vw, 34px);
  --fs-h1: 24px;
  --fs-h2: 20px;
  --fs-h3: 17px;
  --fs-body-l: 16px;
  --fs-body: 15px;
  --fs-sm: 14px;
  --fs-cap: 13px;
  --fs-xs: 12px;

  /* Space (8px grid) */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-64: 64px;

  /* Shape */
  --r-btn: 8px;
  --r-input: 10px;
  --r-card: 16px;
  --r-sheet: 20px;
  --r-img: 12px;
  --shadow-1: 0 2px 8px rgba(17, 20, 20, .04), 0 12px 32px rgba(17, 20, 20, .06);
  --shadow-2: 0 -8px 32px rgba(17, 20, 20, .10);

  --ease: cubic-bezier(.2, .6, .2, 1);
  --t: .3s var(--ease);

  --app-w: 480px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
}

body {
  font-family: var(--ff);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--c-gray-900);
  background: #DFE6E6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- App Shell (mobile) ---------- */
.app {
  position: relative;
  max-width: var(--app-w);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--c-white);
  display: flex;
  flex-direction: column;
}

@media (min-width: 520px) {
  .app {
    box-shadow: 0 0 0 1px rgba(17, 20, 20, .04), 0 24px 64px rgba(17, 20, 20, .10);
  }
}

.app--gray {
  background: var(--c-gray-50);
}

.app__main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app--tabbar .app__main {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

.app--cta .app__main {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.page-pad {
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- App Bar ---------- */
.appbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 8px;
  background: var(--c-white);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t);
}

.appbar.is-scrolled {
  border-bottom-color: var(--c-gray-200);
}

.appbar--gray {
  background: var(--c-gray-50);
}

.appbar__title {
  flex: 1;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar__title--center {
  text-align: center;
}

.appbar__brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--c-gray-900);
  transition: background var(--t);
}

.icon-btn:hover {
  background: var(--c-gray-100);
}

.icon-btn:active {
  background: var(--c-gray-200);
}

.icon-btn svg,
.ico {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico--sm {
  width: 18px;
  height: 18px;
}

.ico--xs {
  width: 16px;
  height: 16px;
}

.icon-btn--spacer {
  visibility: hidden;
}

/* Brand mark */
.brandmark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--c-primary);
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 28px;
}

.brandmark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Bottom Tab Bar ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: 100%;
  max-width: var(--app-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--c-white);
  border-top: 1px solid var(--c-gray-200);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--c-gray-500);
  transition: color var(--t);
  min-height: 44px;
}

.tabbar__item svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar__item:hover {
  color: var(--c-gray-900);
}

.tabbar__item.is-active {
  color: var(--c-primary);
  font-weight: 600;
}

.tabbar__item--new {
  color: var(--c-primary);
}

.tabbar__item--new .tabbar__plus {
  width: 36px;
  height: 28px;
  border-radius: 8px;
  background: var(--c-primary);
  color: #fff;
  display: grid;
  place-items: center;
}

.tabbar__item--new .tabbar__plus svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  line-height: 1;
}

.h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.desc {
  font-size: var(--fs-sm);
  color: var(--c-gray-700);
  line-height: 1.6;
}

.caption {
  font-size: var(--fs-cap);
  color: var(--c-gray-500);
  font-weight: 500;
  line-height: 1.5;
}

.text-primary { color: var(--c-primary); }
.text-good { color: var(--c-good); }
.text-fair { color: var(--c-fair); }
.text-bad { color: var(--c-bad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  font-size: var(--fs-body-l);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t), transform .15s var(--ease);
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(.985);
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--primary {
  background: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-primary-dark);
}

.btn--secondary {
  background: var(--c-white);
  color: var(--c-gray-900);
  border-color: var(--c-gray-300);
}

.btn--secondary:hover {
  border-color: var(--c-gray-500);
  background: var(--c-gray-50);
}

.btn--tonal {
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
}

.btn--tonal:hover {
  background: #D6E8E8;
}

.btn--ghost {
  background: var(--c-gray-100);
  color: var(--c-gray-900);
}

.btn--ghost:hover {
  background: var(--c-gray-200);
}

.btn--danger {
  background: var(--c-white);
  color: var(--c-bad);
  border-color: #F3C4BF;
}

.btn--kakao {
  background: var(--c-kakao);
  color: var(--c-kakao-text);
}

.btn--kakao:hover {
  background: #F5DC00;
}

.btn--sm {
  height: 40px;
  padding: 0 14px;
  font-size: var(--fs-sm);
}

.btn--md {
  height: 48px;
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn.is-disabled {
  background: var(--c-gray-200);
  color: var(--c-gray-400);
  border-color: transparent;
  cursor: not-allowed;
  transform: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-primary);
  min-height: 32px;
}

.text-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--t);
}

.text-link:hover svg {
  transform: translateX(2px);
}

.text-link--gray {
  color: var(--c-gray-700);
  font-weight: 500;
}

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

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-gray-900);
  display: flex;
  align-items: center;
  gap: 4px;
}

.field__req {
  color: var(--c-bad);
  font-weight: 600;
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--c-gray-500);
  line-height: 1.5;
}

.field__msg {
  font-size: var(--fs-xs);
  line-height: 1.5;
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.field__msg--ok { color: var(--c-good); }
.field__msg--warn { color: var(--c-fair); }
.field__msg--err { color: var(--c-error); }

.field__row {
  display: flex;
  gap: 8px;
}

.field__row > * {
  flex: 1;
  min-width: 0;
}

.field__row > .btn {
  flex: 0 0 auto;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--c-gray-300);
  border-radius: var(--r-input);
  background: var(--c-white);
  font-size: var(--fs-body);
  color: var(--c-gray-900);
  transition: border-color var(--t), box-shadow var(--t);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--c-gray-400);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--c-gray-500);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: inset 0 0 0 1px var(--c-primary);
}

.input[readonly],
.input:disabled {
  background: var(--c-gray-50);
  color: var(--c-gray-700);
  border-color: var(--c-gray-200);
}

.input.is-error {
  border-color: var(--c-error);
  box-shadow: inset 0 0 0 1px var(--c-error);
}

.select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475052' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
}

.textarea {
  height: auto;
  min-height: 120px;
  padding: 14px 16px;
  line-height: 1.6;
  resize: vertical;
}

.input-unit {
  position: relative;
}

.input-unit .input {
  padding-right: 52px;
}

.input-unit__unit {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-sm);
  color: var(--c-gray-500);
  pointer-events: none;
}

.input-icon {
  position: relative;
}

.input-icon .input {
  padding-left: 46px;
}

.input-icon > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--c-gray-500);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-gray-500);
  background: var(--c-gray-100);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 4px;
}

/* Segmented control */
.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seg__opt {
  position: relative;
  flex: 1;
  min-width: 0;
}

.seg__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.seg__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 10px;
  border: 1px solid var(--c-gray-300);
  border-radius: var(--r-input);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-gray-700);
  background: var(--c-white);
  transition: all var(--t);
  white-space: nowrap;
}

.seg__opt input:hover + span {
  border-color: var(--c-gray-500);
}

.seg__opt input:checked + span {
  border-color: var(--c-primary);
  background: var(--c-primary-tint);
  color: var(--c-primary-dark);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--c-primary);
}

.seg__opt input:focus-visible + span {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.seg--wrap .seg__opt {
  flex: 0 0 auto;
}

/* Rating (양호/보통/불량) */
.rate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.rate__opt {
  position: relative;
}

.rate__opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.rate__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--c-gray-200);
  background: var(--c-white);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-gray-700);
  transition: all var(--t);
}

.rate__opt span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-gray-300);
  transition: background var(--t);
}

.rate__opt input:hover + span {
  border-color: var(--c-gray-400);
}

.rate__opt input:focus-visible + span {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.rate__opt--good input:checked + span {
  background: var(--c-good-light);
  border-color: var(--c-good);
  color: var(--c-good);
  font-weight: 600;
}

.rate__opt--good input:checked + span::before { background: var(--c-good); }

.rate__opt--fair input:checked + span {
  background: var(--c-fair-light);
  border-color: var(--c-fair);
  color: var(--c-fair);
  font-weight: 600;
}

.rate__opt--fair input:checked + span::before { background: var(--c-fair); }

.rate__opt--bad input:checked + span {
  background: var(--c-bad-light);
  border-color: var(--c-bad);
  color: var(--c-bad);
  font-weight: 600;
}

.rate__opt--bad input:checked + span::before { background: var(--c-bad); }

/* Checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: var(--fs-body);
  position: relative;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
}

.check__box {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  border: 1.5px solid var(--c-gray-300);
  display: grid;
  place-items: center;
  background: var(--c-white);
  transition: all var(--t);
}

.check__box svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.check input:checked + .check__box {
  background: var(--c-primary);
  border-color: var(--c-primary);
}

.check input:checked + .check__box svg {
  opacity: 1;
}

.check input:focus-visible + .check__box {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.check--round .check__box {
  border-radius: 50%;
}

/* Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-gray-700);
  min-height: 44px;
  position: relative;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  right: 0;
}

.switch__track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--c-gray-300);
  position: relative;
  transition: background var(--t);
  flex: 0 0 44px;
}

.switch__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform var(--t);
}

.switch input:checked + .switch__track {
  background: var(--c-primary);
}

.switch input:checked + .switch__track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Chip */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--c-gray-200);
  background: var(--c-white);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-gray-700);
  white-space: nowrap;
  transition: all var(--t);
  position: relative;
}

.chip:hover {
  border-color: var(--c-gray-400);
}

.chip.is-active,
.chip[aria-pressed="true"],
.chip[aria-selected="true"] {
  background: var(--c-gray-900);
  border-color: var(--c-gray-900);
  color: #fff;
}

.chip__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-gray-500);
}

.chip.is-active .chip__count,
.chip[aria-selected="true"] .chip__count {
  color: rgba(255, 255, 255, .7);
}

.chip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.badge--good { background: var(--c-good-light); color: var(--c-good); }
.badge--fair { background: var(--c-fair-light); color: var(--c-fair); }
.badge--bad { background: var(--c-bad-light); color: var(--c-bad); }
.badge--draft { background: var(--c-accent-light); color: #8A5A0F; }
.badge--done { background: var(--c-primary-light); color: var(--c-primary-dark); }
.badge--issued { background: var(--c-gray-900); color: #fff; }
.badge--gray { background: var(--c-gray-100); color: var(--c-gray-700); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}

/* ---------- Cards / Section ---------- */
.section {
  padding-top: var(--sp-24);
  padding-bottom: var(--sp-24);
}

.section + .section {
  border-top: 8px solid var(--c-gray-50);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--sp-16);
}

.card {
  background: var(--c-white);
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-card);
}

.card--pad {
  padding: 20px;
}

.card--flat {
  border: 0;
  background: var(--c-gray-50);
}

/* ---------- Car list item ---------- */
.car-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--c-gray-100);
  transition: background var(--t);
  min-height: 72px;
}

.car-item:last-child {
  border-bottom: 0;
}

.car-item:hover .car-item__title {
  color: var(--c-primary);
}

.car-item__thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-gray-100);
}

.car-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.car-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.car-item__top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.car-item__plate {
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.car-item__title {
  font-size: var(--fs-sm);
  color: var(--c-gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t);
}

.car-item__meta {
  font-size: var(--fs-xs);
  color: var(--c-gray-500);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.car-item__meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--c-gray-400);
}

.car-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.car-item__chev {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--c-gray-400);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Progress ---------- */
.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--c-gray-100);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: 3px;
  background: var(--c-primary);
  transition: width .5s var(--ease);
}

/* ---------- Sticky bottom CTA ---------- */
.cta-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: 100%;
  max-width: var(--app-w);
  padding: 12px max(20px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  background: var(--c-white);
  border-top: 1px solid var(--c-gray-200);
  display: flex;
  gap: 8px;
}

.cta-bar .btn {
  flex: 1;
}

.cta-bar .btn--narrow {
  flex: 0 0 auto;
  padding: 0 18px;
}

/* ---------- Bottom Sheet / Modal ---------- */
.dim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 20, 20, .5);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.dim.is-open {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  width: 100%;
  max-width: var(--app-w);
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--c-white);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  transform: translate(-50%, 100%);
  transition: transform .4s var(--ease);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sheet.is-open {
  transform: translate(-50%, 0);
}

.sheet__grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-gray-300);
  margin: 10px auto 0;
  flex: 0 0 auto;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px 20px;
  flex: 0 0 auto;
}

.sheet__title {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet__body {
  padding: 4px 20px 20px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.sheet__foot {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--c-gray-100);
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.sheet__foot .btn {
  flex: 1;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 100;
  width: calc(100% - 48px);
  max-width: 360px;
  background: var(--c-white);
  border-radius: var(--r-card);
  padding: 28px 24px 20px;
  transform: translate(-50%, -46%);
  opacity: 0;
  transition: all .3s var(--ease);
  text-align: center;
}

.modal.is-open {
  transform: translate(-50%, -50%);
  opacity: 1;
}

.modal__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: var(--c-primary-light);
  color: var(--c-primary);
}

.modal__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal__icon--warn {
  background: var(--c-bad-light);
  color: var(--c-bad);
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.modal__text {
  font-size: var(--fs-sm);
  color: var(--c-gray-700);
  line-height: 1.6;
}

.modal__body {
  margin-top: 16px;
  text-align: left;
}

.modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.modal__actions .btn {
  flex: 1;
  height: 48px;
}

body.is-locked {
  overflow: hidden;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(min(100%, var(--app-w)) - 40px);
  width: max-content;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(30, 35, 36, .94);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .3s var(--ease);
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #6FD3A8;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Empty / Skeleton ---------- */
.empty {
  padding: 48px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-gray-100);
  display: grid;
  place-items: center;
  color: var(--c-gray-500);
  margin-bottom: 8px;
}

.empty__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty__title {
  font-size: var(--fs-body-l);
  font-weight: 600;
}

.skeleton {
  background: linear-gradient(90deg, var(--c-gray-100) 25%, var(--c-gray-50) 50%, var(--c-gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--c-gray-200);
  border-top-color: var(--c-primary);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Notice ---------- */
.notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--c-gray-50);
  font-size: var(--fs-cap);
  color: var(--c-gray-700);
  line-height: 1.55;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice--primary {
  background: var(--c-primary-tint);
  color: var(--c-primary-dark);
}

.notice--warn {
  background: var(--c-accent-light);
  color: #7A4E0B;
}

.notice--err {
  background: var(--c-bad-light);
  color: #A3241A;
}

.notice strong {
  font-weight: 600;
}

/* ---------- Divider / Key-Value ---------- */
.kv {
  display: grid;
  grid-template-columns: 112px 1fr;
  row-gap: 12px;
  column-gap: 12px;
  font-size: var(--fs-sm);
}

.kv dt {
  color: var(--c-gray-500);
}

.kv dd {
  color: var(--c-gray-900);
  font-weight: 500;
  min-width: 0;
}

.hr {
  height: 1px;
  background: var(--c-gray-200);
  border: 0;
  margin: 0;
}

/* ---------- Reveal motion ---------- */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal.is-pending {
  opacity: 0;
  transform: translateY(24px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
