/* ==========================================================================
   B58 Mini App — "Night Garage" design system
   Display: Russo One · Body: Golos Text · Data: IBM Plex Mono
   ========================================================================== */

:root {
  color-scheme: light;

  /* base */
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --ink: #0d1117;
  --muted: #5d6b78;
  --line: rgba(16, 34, 52, 0.13);

  /* brand */
  --brand: #0a66b2;
  --blue: #16588e;
  --cyan: #2fb1e3;
  --red: #e63322;
  --ok: #2f8f5b;
  --warning: #d9970c;
  --carbon: #12181f;

  /* components */
  --chip: #eaf0f6;
  --chip-ink: #3a4855;
  --badge-bg: #e3f0fa;
  --badge-ink: #0a5290;
  --tint-bg: #f4f9fe;
  --tint-line: #cfe2f2;
  --input-bg: #ffffff;
  --btn-g1: #0a66b2;
  --btn-g2: #123f6d;
  --hero-scrim: rgba(10, 14, 19, 0.55);
  --surface-a: rgba(255, 255, 255, 0.68);
  --card-a: rgba(255, 255, 255, 0.82);

  --shadow-soft: 0 10px 30px rgba(13, 17, 23, 0.08);
  --shadow-pop: 0 18px 44px rgba(13, 17, 23, 0.16);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 9px;

  --font-body: "Golos Text", "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Russo One", "Arial Black", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;

  font-family: var(--font-body);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0f14;
  --surface: #141a22;
  --surface-2: #1a222c;
  --ink: #edf3f9;
  --muted: #90a0b0;
  --line: rgba(150, 180, 210, 0.15);

  --brand: #3ea0e6;
  --blue: #6db4e6;
  --cyan: #45c6f0;
  --red: #ff5a49;

  --carbon: #1d2733;
  --chip: #1e2833;
  --chip-ink: #c0cdda;
  --badge-bg: #14293c;
  --badge-ink: #8ec7ef;
  --tint-bg: #131d29;
  --tint-line: #29455e;
  --input-bg: #0f151d;
  --btn-g1: #1f7ec2;
  --btn-g2: #14507f;
  --hero-scrim: rgba(5, 8, 12, 0.62);
  --surface-a: rgba(20, 26, 34, 0.6);
  --card-a: rgba(21, 28, 37, 0.76);

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(58% 42% at 12% -8%, rgba(47, 177, 227, 0.16), transparent 62%),
    radial-gradient(46% 36% at 92% -6%, rgba(230, 51, 34, 0.09), transparent 60%),
    radial-gradient(70% 46% at 50% 112%, rgba(22, 88, 142, 0.11), transparent 58%),
    radial-gradient(rgba(13, 17, 23, 0.05) 1px, transparent 1.3px) 0 0 / 22px 22px,
    var(--bg);
  touch-action: manipulation;
  line-height: 1.45;
}

/* aurora: повільні градієнтні плями за контентом */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(32% 26% at 28% 18%, rgba(69, 198, 240, 0.18), transparent 65%),
    radial-gradient(28% 24% at 78% 8%, rgba(22, 88, 142, 0.20), transparent 65%),
    radial-gradient(26% 22% at 62% 88%, rgba(230, 51, 34, 0.10), transparent 65%);
  filter: blur(46px);
  animation: aurora 28s ease-in-out infinite alternate;
}

@keyframes aurora {
  to {
    transform: translate3d(5%, 4%, 0) scale(1.08);
  }
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(58% 42% at 12% -8%, rgba(69, 198, 240, 0.12), transparent 62%),
    radial-gradient(46% 36% at 92% -6%, rgba(255, 90, 73, 0.08), transparent 60%),
    radial-gradient(70% 46% at 50% 112%, rgba(31, 126, 194, 0.12), transparent 58%),
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1.3px) 0 0 / 22px 22px,
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

body.is-busy {
  cursor: wait;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.12;
  text-transform: uppercase;
}

h2 {
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-shell {
  width: min(100%, 540px);
  max-width: 540px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 14px 34px;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
}

.topbar > div {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

/* M-tricolor flag */
.eyebrow::before {
  content: "";
  width: 22px;
  height: 12px;
  flex: none;
  background: linear-gradient(90deg, var(--cyan) 0 33%, var(--blue) 33% 66%, var(--red) 66% 100%);
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
}

.icon-button {
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-a);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 1.15rem;
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease;
}

.icon-button:active {
  transform: rotate(80deg) scale(0.94);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.garage-hero {
  position: relative;
  min-height: 168px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  border-radius: var(--r-lg);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(64% 70% at 88% -12%, rgba(69, 198, 240, 0.24), transparent 62%),
    linear-gradient(180deg, transparent 20%, var(--hero-scrim) 72%, rgba(5, 8, 12, 0.9) 100%),
    url("https://images.unsplash.com/photo-1487754180451-c456f719a1fc?auto=format&fit=crop&w=1200&q=80") center / cover;
  box-shadow:
    var(--shadow-pop),
    0 0 44px color-mix(in srgb, var(--cyan) 14%, transparent);
  isolation: isolate;
}

/* slanted tricolor blades, top-right */
.garage-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  width: 58px;
  height: 20px;
  background:
    linear-gradient(115deg, transparent 0 4%, var(--cyan) 4% 30%, transparent 30% 37%, var(--blue) 37% 63%, transparent 63% 70%, var(--red) 70% 96%, transparent 96%);
  opacity: 0.95;
}

/* holographic sheen: світловий пробіг раз на ~8 секунд */
.garage-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 32%,
    rgba(255, 255, 255, 0.13) 45%,
    rgba(69, 198, 240, 0.12) 51%,
    transparent 64%
  );
  transform: translateX(-130%);
  animation: hero-sheen 8s ease-in-out infinite;
}

@keyframes hero-sheen {
  0%,
  58% {
    transform: translateX(-130%);
  }

  78%,
  100% {
    transform: translateX(130%);
  }
}

.garage-hero > div {
  position: relative;
  min-width: 0;
}

.garage-hero p {
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.garage-hero strong {
  display: block;
  max-width: 30ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.18;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Cards & shared surfaces
   -------------------------------------------------------------------------- */

.demo-auth,
.car-detail,
.booking-form,
.contact-band,
.notifications {
  background: var(--surface-a);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}

.demo-auth {
  margin-top: 14px;
  padding: 14px;
}

.demo-auth label,
.booking-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  padding: 11px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  accent-color: var(--brand);
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

textarea {
  resize: vertical;
}

.select-row button,
.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--btn-g1), var(--btn-g2));
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--btn-g2) 45%, transparent),
    0 0 22px color-mix(in srgb, var(--cyan) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.select-row button:active,
.primary-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--btn-g2) 40%, transparent);
}

@media (hover: hover) {
  .select-row button:hover,
  .primary-button:hover {
    filter: brightness(1.08);
  }
}

/* --------------------------------------------------------------------------
   Segmented tabs
   -------------------------------------------------------------------------- */

.segmented {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.segmented button {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 180ms ease, color 180ms ease;
}

.segmented button.active {
  background: var(--carbon);
  color: #fff;
  box-shadow: 0 6px 16px rgba(13, 17, 23, 0.28);
}

:root[data-theme="dark"] .segmented button.active {
  background: linear-gradient(150deg, var(--btn-g1), var(--btn-g2));
  box-shadow: 0 4px 18px color-mix(in srgb, var(--cyan) 30%, transparent);
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 10px color-mix(in srgb, var(--red) 55%, transparent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  vertical-align: 1px;
}

.tab-badge[hidden] {
  display: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panel-in 320ms ease backwards;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 12px;
  min-width: 0;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--tint-line);
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ghost-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--brand);
  padding: 0 14px;
  font-weight: 700;
  transition: border-color 140ms ease, transform 120ms ease;
}

.ghost-button:active {
  transform: scale(0.98);
}

/* --------------------------------------------------------------------------
   Garage: car cards
   -------------------------------------------------------------------------- */

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

.car-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 114px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-a);
  box-shadow: var(--shadow-soft);
  text-align: left;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  animation: rise 360ms ease backwards;
}

.car-card:nth-child(2) {
  animation-delay: 60ms;
}

.car-card:nth-child(3) {
  animation-delay: 120ms;
}

.car-card:active {
  transform: scale(0.985);
}

@property --ring-angle {
  syntax: "<angle>";
  initial-value: 135deg;
  inherits: false;
}

.car-card.active {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(
      from var(--ring-angle),
      var(--cyan),
      var(--brand) 30%,
      var(--red) 52%,
      var(--brand) 74%,
      var(--cyan)
    ) border-box;
  box-shadow:
    0 12px 30px color-mix(in srgb, var(--brand) 26%, transparent),
    0 0 24px color-mix(in srgb, var(--cyan) 16%, transparent);
  animation: ring-spin 7s linear infinite;
}

@keyframes ring-spin {
  to {
    --ring-angle: 495deg;
  }
}

.car-card > span {
  min-width: 0;
}

.car-card img {
  width: 96px;
  height: 94px;
  object-fit: cover;
  border-radius: calc(var(--r-md) - 5px);
}

.car-card h3 {
  margin: 3px 0 7px;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.car-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--chip-ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.car-meta span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  text-transform: uppercase;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Car detail: gauges & history
   -------------------------------------------------------------------------- */

.car-detail {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}

/* -------- Car showcase -------- */

.showcase-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}

.showcase-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* фото плавно розчиняється в картці */
.showcase-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 90% 0%, rgba(69, 198, 240, 0.22), transparent 60%),
    linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--surface) 92%, transparent) 100%);
  pointer-events: none;
}

.plate {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: stretch;
  border: 2px solid #14181d;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fb;
  color: #14181d;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.plate-eu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 5px;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
}

.plate-eu::before {
  content: "";
  width: 11px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(180deg, #3b82f6 50%, #facc15 50%);
}

.plate-num {
  padding: 5px 10px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.showcase-body {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.showcase-body h2 {
  font-size: 1.15rem;
}

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

.stat-row div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.stat-row dt {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-row dd {
  margin: 3px 0 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

@property --v {
  syntax: "<number>";
  initial-value: 0;
  inherits: false;
}

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

.ring {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.ring-dial {
  --track: color-mix(in srgb, var(--line) 85%, transparent);
  --tone-a: var(--cyan);
  --tone-b: var(--brand);
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--tone-a), var(--tone-b) calc(var(--v) * 1%), var(--track) calc(var(--v) * 1%));
  box-shadow: 0 0 16px color-mix(in srgb, var(--tone-a) 30%, transparent);
  animation: ring-fill 900ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes ring-fill {
  from {
    --v: 0;
  }
}

.ring-dial::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--surface);
}

.ring-dial strong {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.ring-mid .ring-dial {
  --tone-a: #f2b134;
  --tone-b: var(--warning);
}

.ring-low .ring-dial {
  --tone-a: #ff7a6b;
  --tone-b: var(--red);
}

.ring-empty .ring-dial {
  background: var(--track);
  box-shadow: none;
  animation: none;
}

.ring small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ring-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
}

.next-service {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--tint-line);
  border-radius: var(--r-sm);
  background: var(--tint-bg);
  color: var(--badge-ink);
}

.next-service span {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.next-service strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.section-sub {
  margin: 2px 0 -4px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.car-detail > .car-meta {
  margin-top: 8px;
}

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

.health-item {
  padding: 11px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.health-item small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-item strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
}

.bar {
  position: relative;
  height: 8px;
  margin-top: 8px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--line) 78%, transparent);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--brand));
  box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 55%, transparent);
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* gauge tick marks */
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 11px, var(--surface-2) 11px 13px);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Timeline (history & appointments)
   -------------------------------------------------------------------------- */

.timeline,
.receipt-list {
  display: grid;
  gap: 10px;
}

.timeline {
  position: relative;
  padding-left: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue) 50%, var(--red));
  opacity: 0.55;
}

.history-item,
.appointment-item,
.receipt-item,
.notification-item,
.empty-state {
  position: relative;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-a);
  box-shadow: var(--shadow-soft);
  animation: rise 360ms ease backwards;
}

.history-item:nth-child(2),
.appointment-item:nth-child(2),
.receipt-item:nth-child(2),
.notification-item:nth-child(2) {
  animation-delay: 60ms;
}

.history-item:nth-child(3),
.appointment-item:nth-child(3),
.receipt-item:nth-child(3),
.notification-item:nth-child(3) {
  animation-delay: 120ms;
}

.history-item::before,
.appointment-item::before {
  content: "";
  position: absolute;
  top: 19px;
  left: -16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.empty-state {
  display: grid;
  gap: 8px;
  border-style: dashed;
  box-shadow: none;
  text-align: left;
}

.empty-state h3 {
  margin: 0;
  font-size: 0.95rem;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.history-item h3,
.appointment-item h3,
.receipt-item h3,
.notification-item h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  line-height: 1.3;
}

.history-item p,
.appointment-item p,
.receipt-item p,
.notification-item p,
.contact-band p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.history-item strong {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.message-lines {
  display: grid;
  gap: 3px;
}

.message-lines p {
  position: relative;
  padding-left: 13px;
}

.message-lines p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.service-description {
  white-space: pre-line;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.work-tags span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
  padding: 4px 8px;
  color: var(--chip-ink);
  font-size: 0.74rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Booking form
   -------------------------------------------------------------------------- */

.booking-form {
  display: grid;
  gap: 13px;
  padding: 14px;
  margin-bottom: 14px;
}

.manual-car-fields {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--tint-line);
  border-radius: var(--r-md);
  background: var(--tint-bg);
}

.manual-car-fields[hidden] {
  display: none;
}

.manual-car-fields legend {
  padding: 0 6px;
  color: var(--badge-ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-row,
.grid-2 {
  display: grid;
  gap: 8px;
}

.mode-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-row label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.mode-row label:has(input:checked) {
  border-color: var(--brand);
  background: var(--badge-bg);
  color: var(--badge-ink);
  box-shadow:
    inset 0 0 0 1px var(--brand),
    0 0 14px color-mix(in srgb, var(--brand) 20%, transparent);
}

.mode-row input {
  width: auto;
  min-height: auto;
  margin: 0 7px 0 0;
}

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

.primary-button {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Receipts
   -------------------------------------------------------------------------- */

.receipt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.receipt-item > div {
  min-width: 0;
}

.receipt-item h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.receipt-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.receipt-item a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  padding: 4px 2px;
}

.apple-pay-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #05070a;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 120ms ease;
}

.apple-pay-button:active {
  transform: scale(0.97);
}

.apple-pay-button:disabled {
  opacity: 0.65;
}

.invoice-lines {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.invoice-group {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.invoice-group strong {
  color: var(--badge-ink);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-group p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.invoice-group p span:last-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  flex-shrink: 0;
  text-align: right;
}

.invoice-group small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Contacts & notifications
   -------------------------------------------------------------------------- */

.contact-band {
  display: grid;
  gap: 10px;
  padding: 16px;
}

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

.quick-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 140ms ease, transform 120ms ease;
}

.quick-actions a:active {
  transform: scale(0.97);
}

.notifications {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
}

.notification-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.notification-illustration,
.modal-illustration {
  display: grid;
  place-items: center;
}

.notification-illustration svg {
  width: 58px;
  height: 44px;
}

/* --------------------------------------------------------------------------
   Toast & loading
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 14px;
  bottom: 18px;
  left: 14px;
  z-index: 10;
  max-width: 460px;
  margin: 0 auto;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(13, 19, 26, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-loading {
  position: fixed;
  inset: auto 14px 20px;
  z-index: 18;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.app-loading[hidden] {
  display: none;
}

.loading-card {
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  background: rgba(13, 19, 26, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: var(--shadow-pop);
  animation: rise 260ms ease backwards;
}

.loading-card strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.loading-card p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.84rem;
  line-height: 1.35;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--cyan);
  animation: spin 760ms linear infinite;
}

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

/* --------------------------------------------------------------------------
   Status modal (bottom sheet)
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(7, 11, 16, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.status-modal {
  position: relative;
  width: min(100%, 540px);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 26px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface-a);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-pop);
  animation: sheet-up 340ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(48px);
  }
}

/* grab handle */
.status-modal::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transform: translateX(-50%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-illustration {
  min-height: 104px;
}

.modal-illustration svg {
  width: 172px;
  max-width: 74%;
}

.modal-eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.status-modal h2 {
  margin-bottom: 12px;
  font-size: 1.12rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.modal-lines {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.modal-lines p {
  position: relative;
  padding: 10px 11px 10px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.4;
}

.modal-lines p::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

/* --------------------------------------------------------------------------
   Skeleton
   -------------------------------------------------------------------------- */

.skeleton-card {
  min-height: 114px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--surface-2) 40%, var(--chip) 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* --------------------------------------------------------------------------
   Responsive & motion preferences
   -------------------------------------------------------------------------- */

@media (min-width: 760px) {
  .app-shell {
    padding-top: 30px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-inline: 10px;
  }

  .garage-hero {
    min-height: 148px;
    padding: 14px;
  }

  .garage-hero strong {
    font-size: 1.12rem;
  }

  .segmented button {
    font-size: 0.78rem;
  }

  .receipt-item {
    grid-template-columns: 1fr;
  }

  .receipt-actions {
    justify-self: start;
    justify-items: start;
  }

  .invoice-group p {
    display: grid;
    gap: 2px;
  }

  .invoice-group p span:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
