:root {
  --ink: #1a2b36;
  --muted: #4d5f6d;
  --paper: #f5f7f8;
  --surface: #ffffff;
  --line: #ccd5dd;
  --teal: #0f5d7f;
  --teal-deep: #0b3d52;
  --mint: #3d788d;
  --yellow: #8b5a00;
  --coral: #9d3528;
  --shadow: none;
  --radius-control: 4px;
  --radius-compact: 6px;
  --radius-card: 10px;
  --radius-panel: 14px;
  --link: #0e5d7d;
  --focus: rgba(17, 98, 128, 0.22);
}

html {
  background: var(--paper);
  overflow-x: hidden;
  perspective: 1800px;
  perspective-origin: left center;
}

html[data-page-direction="backward"] {
  perspective-origin: right center;
}

body.is-entering {
  opacity: 0;
}

body.is-entering-forward {
  transform: translate3d(3%, 0, -24px) rotateY(-8deg);
  transform-origin: right center;
}

body.is-entering-backward {
  transform: translate3d(-3%, 0, -24px) rotateY(8deg);
  transform-origin: left center;
}

body.is-entering-forward.is-ready,
body.is-entering-backward.is-ready {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotateY(0);
  transition: opacity 420ms ease-out, transform 620ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

body.is-leaving {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  pointer-events: none;
}

body.is-leaving-forward {
  transform-origin: left center;
  animation: book-page-turn-forward 620ms cubic-bezier(0.55, 0.05, 0.45, 0.95) forwards;
}

body.is-leaving-backward {
  transform-origin: right center;
  animation: book-page-turn-backward 620ms cubic-bezier(0.55, 0.05, 0.45, 0.95) forwards;
}

@keyframes book-page-turn-forward {
  0% {
    opacity: 1;
    filter: brightness(1);
    transform: rotateY(0deg) translateX(0);
    box-shadow: none;
  }
  34% {
    opacity: 1;
    filter: brightness(0.98);
    transform: rotateY(-13deg) translateX(-1%);
    box-shadow: -10px 0 24px rgba(21, 34, 42, 0.08);
  }
  100% {
    opacity: 0.38;
    filter: brightness(0.76);
    transform: rotateY(-82deg) translateX(-3%);
    box-shadow: -44px 0 72px rgba(21, 34, 42, 0.28);
  }
}

@keyframes book-page-turn-backward {
  0% {
    opacity: 1;
    filter: brightness(1);
    transform: rotateY(0deg) translateX(0);
    box-shadow: none;
  }
  34% {
    opacity: 1;
    filter: brightness(0.98);
    transform: rotateY(13deg) translateX(1%);
    box-shadow: 10px 0 24px rgba(21, 34, 42, 0.08);
  }
  100% {
    opacity: 0.38;
    filter: brightness(0.76);
    transform: rotateY(82deg) translateX(3%);
    box-shadow: 44px 0 72px rgba(21, 34, 42, 0.28);
  }
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--teal-deep);
  background: var(--paper);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.page-loader.is-complete {
  opacity: 0;
  visibility: hidden;
}

.page-loader-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 3px solid color-mix(in srgb, var(--teal) 20%, transparent);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: loader-spin 800ms linear infinite;
}

.page-loader-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

@media (prefers-reduced-motion: reduce) {
  body.is-entering,
  body.is-entering.is-ready,
  .page-loader,
  .page-loader.is-complete {
    transition: none;
  }

  body.is-entering-forward,
  body.is-entering-backward { transform: none; }
  body.is-leaving-forward,
  body.is-leaving-backward { animation: none; }
  .page-loader-mark { animation: none; }
}

/* Landing page editorial system */
.landing-page {
  --landing-display: Georgia, "Times New Roman", serif;
  --landing-body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --landing-space: 120px;
}

.section-premium {
  padding-top: 120px;
  padding-bottom: 120px;
}

.landing-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 14px;
}

.landing-legal-links a,
.auth-legal-links {
  color: var(--muted);
  font-size: 0.875rem;
}

.legal-document {
  max-width: 1080px;
  min-height: 100vh;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.75;
}

.legal-content h1,
.legal-content h2 {
  color: var(--teal-deep);
  font-family: Georgia, "Times New Roman", serif;
}

.legal-content h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.legal-content h2 {
  margin-top: 2.2rem;
  font-size: 1.35rem;
}

.legal-content li + li {
  margin-top: 0.5rem;
}

.legal-updated,
.legal-related {
  color: var(--muted);
}

.legal-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 800px;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.auth-legal-links {
  margin: 1rem 0 0;
  text-align: center;
}

.landing-page p,
.landing-page .landing-text-link,
.landing-page .landing-login,
.landing-page .landing-proof,
.landing-page .landing-footer {
  font-family: var(--landing-body);
}

.landing-page h1,
.landing-page h2,
.landing-page h3 {
  font-family: var(--landing-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.landing-page p {
  line-height: 1.7;
}

.landing-page .btn {
  border-radius: 0;
  border-width: 1px;
  box-shadow: none;
  font-family: var(--landing-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-height: 48px;
  padding: 14px 20px;
  text-transform: uppercase;
}

.landing-page .btn-primary {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: var(--surface);
}

.landing-page .btn-primary:hover,
.landing-page .btn-primary:focus-visible {
  background: var(--teal);
  border-color: var(--teal);
}

.landing-page .btn-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.landing-page .btn-secondary:hover,
.landing-page .btn-secondary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.landing-nav {
  padding-top: 34px;
}

.landing-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(52px, 8vw, 120px);
  min-height: 0;
  padding-top: var(--landing-space);
  padding-bottom: var(--landing-space);
}

.landing-hero h1 {
  font-size: clamp(56px, 6.7vw, 92px);
  line-height: 0.96;
}

.landing-hero p {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  max-width: 500px;
}

.landing-dashboard-preview {
  border-radius: 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  transform: rotate(1.2deg) translateY(18px);
}

.preview-dot {
  border-radius: 0;
  background: var(--ink);
}

.preview-dot:nth-child(2),
.preview-dot:nth-child(3) {
  background: var(--muted);
}

.preview-service > span {
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
}

.landing-overview {
  padding-top: var(--landing-space);
  padding-bottom: var(--landing-space);
}

.landing-overview > div:first-child {
  max-width: 520px;
  margin-left: 8%;
}

.landing-overview h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
}

.landing-feature-grid {
  grid-template-columns: 1.1fr 0.86fr 1.28fr;
  gap: 56px 34px;
  margin-top: 92px;
}

.landing-feature-grid article {
  border-top-width: 1px;
  padding-top: 22px;
}

.landing-feature-grid article:nth-child(2),
.landing-feature-grid article:nth-child(5),
.landing-feature-grid article:nth-child(8) {
  transform: translateY(30px);
}

.landing-feature-grid h3 {
  font-size: 22px;
  line-height: 1.1;
}

.landing-feature-grid p {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  font-size: 13px;
}

.landing-footer {
  padding-top: 32px;
}

@media (max-width: 900px) {
  .landing-hero {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .landing-overview {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .landing-overview > div:first-child {
    margin-left: 0;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr 0.86fr;
    margin-top: 64px;
  }
}

@media (max-width: 520px) {
  .landing-hero {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .landing-dashboard-preview {
    transform: none;
  }

  .landing-overview {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
    gap: 38px;
    margin-top: 50px;
  }

  .landing-feature-grid article:nth-child(2),
  .landing-feature-grid article:nth-child(5),
  .landing-feature-grid article:nth-child(8) {
    transform: none;
  }
}

[data-theme="dark"] {
  --ink: #e0e0e0;
  --muted: #aab4c8;
  --paper: #121417;
  --surface: #1b2028;
  --line: #303947;
  --teal: #8fc4d9;
  --teal-deep: #e5edf1;
  --mint: #8fc4d9;
  --yellow: #e1b44c;
  --coral: #e58b7d;
  --shadow: none;
  --radius-control: 4px;
  --radius-compact: 6px;
  --radius-card: 10px;
  --radius-panel: 14px;
  --link: #b8e8f7;
  --focus: rgba(143, 196, 217, 0.32);
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea {
  background: #171b21;
  border-color: #3a4555;
}
[data-theme="dark"] body {
  background: #121417;
}
[data-theme="dark"] body,
[data-theme="dark"] body * {
  color: #ffffff;
}
[data-theme="dark"] .card {
  background: #1b2028;
  border-color: #303947;
  box-shadow: none;
}
[data-theme="dark"] .dashboard-summary > .stat-primary {
  background: linear-gradient(135deg, #1b2028 0%, #22323a 100%);
  border-color: #45606a;
  border-top-color: #b2e3ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .dashboard-summary > .stat-primary .stat-label,
[data-theme="dark"] .dashboard-summary > .stat-primary .stat-note {
  color: #b9c9d2;
}
[data-theme="dark"] .dashboard-summary > .stat-primary .stat-value {
  color: #f3f8fa;
  text-shadow: 0 1px 0 #101418;
}
[data-theme="dark"] .dashboard-summary > .stat-primary .stat-value span {
  color: #b2e3ee;
}
html[data-theme="dark"] body,
html[data-theme="dark"] body * {
  color: #ffffff !important;
}
html[data-theme="dark"] body ::placeholder {
  color: #ffffff !important;
  opacity: 0.82;
}
[data-theme="dark"] .car-icon {
  background: #294233;
}
[data-theme="dark"] .status,
[data-theme="dark"] .btn-secondary {
  color: #9fd6b5;
  background: #263b31;
}
[data-theme="dark"] .btn-danger {
  color: #ffb366;
  background: #493323;
}
[data-theme="dark"] .total-box {
  background: #202d26;
}
[data-theme="dark"] .notice,
[data-theme="dark"] .service-reminder {
  background: #3d2d20;
  color: #ffb366;
  border-color: #80532e;
}
[data-theme="dark"] .password-toggle:hover,
[data-theme="dark"] .password-toggle:focus-visible {
  background: #263b31;
}
[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus {
  outline: 3px solid rgba(143, 196, 217, 0.3);
  outline-offset: 1px;
}
[data-theme="dark"] .sidebar {
  background: #1b2028;
  color: #e0e0e0;
  border-right: 1px solid #303947;
}
[data-theme="dark"] {
  color-scheme: dark;
}
[data-theme="dark"] .nav-label,
[data-theme="dark"] .user-role {
  color: #a9bdc6;
}
[data-theme="dark"] .nav a,
[data-theme="dark"] .nav-settings {
  color: #aab4c8;
}
[data-theme="dark"] .nav a:hover,
[data-theme="dark"] .nav a.active,
[data-theme="dark"] .nav-settings:hover,
[data-theme="dark"] .nav-settings.active {
  color: #ffffff;
  background: #303947;
}
[data-theme="dark"] .nav-settings,
[data-theme="dark"] .theme-toggle {
  border-color: #3a4555;
}
[data-theme="dark"] .sidebar-footer {
  border-top-color: #303947;
}
[data-theme="dark"] .signout {
  color: #aab4c8;
}
[data-theme="dark"] .theme-toggle {
  color: #e0e0e0;
}
[data-theme="dark"] .theme-toggle:hover {
  background: #303947;
}
[data-theme="dark"] .auth-intro {
  background: #1b2028;
  color: #e0e0e0;
  border-right: 1px solid #303947;
}
[data-theme="dark"] .auth-copy p {
  color: #aab4c8;
}
[data-theme="dark"] .auth-form-side {
  background: #121417;
}

* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  line-height: 1.5;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}
a {
  color: var(--link);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.btn,
.nav a,
.nav-settings,
.icon-button,
.password-toggle {
  min-height: 44px;
}
.landing-page {
  min-height: 100vh;
  background: var(--paper);
}
.landing-nav,
.landing-hero,
.landing-overview,
.landing-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
}
.landing-nav .brand {
  padding: 0;
  color: var(--ink);
}
.landing-nav-actions,
.landing-actions,
.landing-proof {
  display: flex;
  align-items: center;
  gap: 18px;
}
.landing-login,
.landing-text-link {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 80px;
  align-items: center;
  min-height: 610px;
  padding: 72px 0 100px;
}
.landing-hero-copy {
  max-width: 560px;
}
.landing-hero h1 {
  max-width: 520px;
  color: var(--teal-deep);
  font-size: 76px;
  line-height: 0.98;
  margin-bottom: 26px;
}
.landing-hero p {
  max-width: 480px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  margin: 0 0 30px;
}
.landing-actions {
  flex-wrap: wrap;
  margin-bottom: 54px;
}
.landing-proof {
  flex-wrap: wrap;
  color: var(--muted);
  font: 10px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.landing-proof span {
  padding-left: 12px;
  border-left: 2px solid var(--yellow);
}
.landing-dashboard-preview {
  min-height: 390px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
  transform: rotate(1.5deg);
}
.preview-top,
.preview-heading,
.preview-stats,
.preview-route {
  display: flex;
  align-items: center;
}
.preview-top {
  gap: 6px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
}
.preview-dot:nth-child(2) { background: var(--coral); }
.preview-dot:nth-child(3) { background: var(--teal); }
.preview-label {
  margin-left: auto;
  color: var(--muted);
  font: 10px "DM Mono", monospace;
}
.preview-heading {
  justify-content: space-between;
  padding: 38px 0 26px;
}
.preview-heading span {
  font-size: 25px;
  font-weight: 800;
}
.preview-heading strong {
  color: var(--muted);
  font: 10px "DM Mono", monospace;
}
.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preview-stats div {
  min-height: 100px;
  padding: 15px;
  background: var(--paper);
  border-radius: 8px;
}
.preview-stats small,
.preview-route small {
  display: block;
  color: var(--muted);
  font: 9px "DM Mono", monospace;
  text-transform: uppercase;
}
.preview-stats strong {
  display: block;
  margin-top: 18px;
  color: var(--teal);
  font: 500 20px "DM Mono", monospace;
}
.preview-route {
  gap: 18px;
  margin-top: 24px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.route-line {
  width: 4px;
  height: 48px;
  border-radius: 3px;
  background: var(--coral);
}
.preview-route strong,
.preview-route span:last-child {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}
.preview-route strong i {
  color: var(--coral);
  font-style: normal;
  padding: 0 5px;
}
.preview-route span:last-child { color: var(--muted); }
.preview-service {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.preview-live {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}
.live-pulse {
  width: 12px;
  height: 12px;
  border: 3px solid var(--mint);
  border-radius: 50%;
}
.preview-live strong,
.preview-live span:last-child {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.preview-live span:last-child { color: var(--muted); }
.preview-live b {
  margin-left: auto;
  color: var(--coral);
  font: 500 11px "DM Mono", monospace;
}
.preview-service > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--teal-deep);
  background: var(--mint);
  font-weight: 800;
}
.preview-service strong {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}
.preview-service b {
  margin-left: auto;
  color: var(--teal);
  font: 500 12px "DM Mono", monospace;
}
.landing-overview {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}
.landing-overview h2 {
  max-width: 400px;
  margin-top: 12px;
  font-size: 34px;
}
.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 55px;
}
.landing-feature-grid article {
  padding-top: 16px;
  border-top: 3px solid var(--teal);
}
.feature-number {
  color: var(--coral);
  font: 11px "DM Mono", monospace;
}
.landing-feature-grid h3 { margin: 22px 0 10px; font-size: 16px; }
.landing-feature-grid p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.landing-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.landing-footer span:first-child { color: var(--ink); font-weight: 800; }
.landing-footer a { color: var(--teal); font-weight: 800; }
.landing-page .landing-legal-links {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 4px;
}
.landing-page .landing-legal-links a,
.auth-legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-compact);
  background: var(--surface);
  color: var(--link);
  font-size: 0.925rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.landing-page .landing-legal-links a:hover,
.auth-legal-links a:hover {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--surface) 88%, var(--teal) 12%);
  color: var(--teal-deep);
}
html[data-theme="dark"] body .landing-page .landing-legal-links a,
html[data-theme="dark"] body .auth-legal-links a {
  color: var(--link) !important;
}
.landing-page .landing-legal-links a:focus-visible,
.auth-legal-links a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.landing-pricing {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
.landing-pricing > div:first-child { max-width: 520px; }
.landing-pricing h2 { margin: 12px 0; color: var(--teal-deep); font-size: 42px; }
.landing-pricing p { color: var(--muted); line-height: 1.7; }
.landing-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.landing-price-card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.landing-price-card.featured { border-color: var(--teal); box-shadow: none; }
.landing-price { display: flex; flex-direction: column; gap: 6px; margin: 20px 0 8px; }
.landing-price strong { color: var(--teal-deep); font-size: 28px; }
.landing-price span { color: var(--muted); font-size: 12px; }
.landing-price-card .btn { margin-top: 12px; }
.landing-plan-features {
  display: grid;
  gap: 9px;
  min-height: 132px;
  margin: 18px 0 0;
  padding: 16px 0 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.landing-plan-features li::marker {
  color: var(--teal);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled,
.btn[aria-busy="true"] {
  cursor: wait;
  opacity: 0.62;
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.app-status {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}
.app-status-success { color: #21643d; border-color: #a9d8b8; background: #effaf2; }
.app-status-error { color: #8b3029; border-color: #edb6af; background: #fff3f1; }
.app-status-info { border-left: 3px solid var(--teal); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
@media (forced-colors: active) {
  .btn,
  .field input,
  .field select,
  .field textarea,
  .card,
  .notice {
    border: 1px solid ButtonText;
  }
  .btn-primary,
  .btn-secondary {
    color: ButtonText;
    background: Canvas;
  }
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid Highlight;
  }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.sidebar {
  background: var(--teal-deep);
  color: #e8f3eb;
  padding: 29px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 12px 39px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 20px;
}
.brand-mark {
  background: var(--yellow);
  color: var(--teal-deep);
  width: 33px;
  height: 33px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
}
.brand-mark[src] {
  padding: 0;
  object-fit: cover;
}
.nav-label {
  color: #aab4c8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  padding: 0 13px 11px;
}
.nav {
  display: grid;
  gap: 6px;
}
.nav a {
  color: #c4ccda;
  border-radius: var(--radius-compact);
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  transition: 0.2s ease;
}
.nav a:hover,
.nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
}
.nav-settings {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  height: 40px;
  margin: 18px 0 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-card);
  color: #c4ccda;
  font-size: 13px;
  font-weight: 700;
}
.nav-settings .nav-icon {
  font-size: 18px;
}
.nav-settings:hover,
.nav-settings.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 20px 12px 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.user-name {
  font-size: 12px;
  font-weight: 800;
}
.user-role {
  color: #aab4c8;
  font-size: 10px;
  margin-top: 2px;
}
.signout {
  background: none;
  border: 0;
  padding: 0;
  color: #b6c0d0;
  font-size: 12px;
}
.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-compact);
  color: #e0e5ee;
  background: transparent;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 16px;
  width: 100%;
  text-align: left;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.auth-theme-toggle {
  color: var(--teal);
  border-color: var(--line);
  background: var(--surface);
  margin-bottom: 22px;
  width: auto;
}
.auth-theme-toggle:hover {
  background: var(--mint);
}

.error-page {
  width: min(680px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 96px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.error-page-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 34px;
  padding: 8px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border-radius: var(--radius-card);
}
.error-page-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.error-page h1 {
  max-width: 620px;
  margin: 10px 0 16px;
  color: var(--teal-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.error-page-copy {
  max-width: 480px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}
.error-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main {
  padding: 40px 52px 60px;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
}
.eyebrow {
  color: var(--teal);
  font:
    500 11px "DM Mono",
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 11px;
}
h1 {
  font-size: 34px;
  letter-spacing: -0.055em;
  margin: 0;
  line-height: 1.1;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.04em;
  margin: 0;
}
h3 {
  font-size: 14px;
  margin: 0;
}
.top-date {
  text-align: right;
  color: var(--muted);
  font:
    11px "DM Mono",
    monospace;
  line-height: 1.8;
}
.top-date strong {
  display: block;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 13px;
}
.grid {
  display: grid;
  gap: 20px;
}
.stats-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 22px;
}
.dashboard-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}
.dashboard-supporting-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.dashboard-intro {
  max-width: 500px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.dashboard-actions .eyebrow {
  margin-bottom: 5px;
}
.dashboard-actions h2 {
  font-size: 16px;
}
.dashboard-action-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dashboard-action-link {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.live-trip-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  border-radius: var(--radius-compact);
  background: var(--surface);
}
.live-trip-panel .eyebrow {
  margin-bottom: 5px;
}
.live-trip-panel h2 {
  font-size: 16px;
}
.live-trip-panel .row-sub {
  margin-bottom: 0;
}
.live-trip-controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.live-trip-panel .notice {
  grid-column: 1 / -1;
  margin: 0;
}
.two-col {
  grid-template-columns: 1.15fr 0.85fr;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 23px;
}
.stat {
  min-height: 132px;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--mint);
}
.stat-primary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 178px;
  padding: 28px;
  border-radius: var(--radius-panel);
}
.stat-primary .stat-value {
  font-size: 48px;
  margin: 12px 0 8px;
}
.distance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.distance-breakdown div {
  display: grid;
  gap: 4px;
}
.distance-breakdown span {
  color: var(--muted);
  font-size: 11px;
}
.distance-breakdown strong {
  color: var(--ink);
  font: 500 14px "DM Mono", monospace;
}
.stat-value span {
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 400;
}
.stat-compact {
  min-height: 112px;
  padding: 16px;
  border-radius: var(--radius-compact);
}
.stat-compact .stat-value {
  font-size: 22px;
  margin: 12px 0 5px;
}
.stat:nth-child(2) { border-top-color: #d7a649; }
.stat:nth-child(3) { border-top-color: #7b9fc5; }
.stat:nth-child(4) { border-top-color: #c98272; }
.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.stat-value {
  font:
    500 30px "DM Mono",
    monospace;
  margin: 15px 0 6px;
  letter-spacing: 0;
}
.stat-note {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.text-link {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.text-link:hover {
  text-decoration: underline;
}
.vehicle-row,
.log-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.vehicle-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(300px, 1.7fr) auto;
  align-items: center;
  gap: 22px;
  padding: 20px 0;
}
.vehicle-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.vehicle-plate {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--teal);
  background: var(--paper);
  font: 500 10px "DM Mono", monospace;
  letter-spacing: 0.06em;
}
.vehicle-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.vehicle-detail {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.vehicle-detail span,
.vehicle-detail small {
  color: var(--muted);
  font-size: 10px;
}
.vehicle-detail strong {
  font: 500 12px "DM Mono", monospace;
  white-space: nowrap;
}
.vehicle-detail small {
  white-space: nowrap;
}
.service-overdue {
  color: var(--coral) !important;
}
.vehicle-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.vehicle-row:first-of-type,
.log-row:first-of-type {
  border-top: 0;
}
.car-icon {
  width: 38px;
  height: 38px;
  background: #e7edf5;
  color: var(--teal);
  border-radius: var(--radius-compact);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.row-main {
  flex: 1;
}
.row-title {
  font-size: 13px;
  font-weight: 800;
}
.row-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.vehicle-driver-reports {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 8px;
  align-items: baseline;
}
.vehicle-driver-report-label {
  color: var(--teal-deep);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vehicle-driver-report {
  color: var(--muted);
  font-size: 11px;
}
.vehicle-driver-report-muted {
  color: var(--muted);
  font-style: italic;
}
.row-value {
  text-align: right;
  font:
    500 12px "DM Mono",
    monospace;
}
.status {
  font:
    10px "DM Mono",
    monospace;
  color: var(--teal);
  background: #e8f0eb;
  padding: 5px 7px;
  border-radius: var(--radius-compact);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
}
.field.full {
  grid-column: 1/-1;
}
.field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.setting-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.setting-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-control);
  padding: 12px;
  outline: none;
  width: 100%;
  min-height: 44px;
  font: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(36, 90, 117, 0.2);
  outline-offset: 1px;
}
.field input:invalid:not(:placeholder-shown),
.field select:invalid,
.field textarea:invalid:not(:placeholder-shown) {
  border-color: var(--coral);
}
.field input::placeholder,
.field textarea::placeholder {
  color: #7b8794;
  opacity: 1;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 62px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  padding: 6px 7px;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  background: #e8f0eb;
  outline: none;
}
.auth-name-fields {
  margin-bottom: 15px;
}
.auth-name-fields[hidden] {
  display: none;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 21px;
}
.btn {
  border: 0;
  border-radius: var(--radius-control);
  padding: 12px 16px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
}
.btn-primary {
  background: var(--teal);
  color: white;
}
.btn-primary:hover {
  background: var(--teal-deep);
}
.btn-secondary {
  color: var(--teal);
  background: var(--surface);
  border: 1px solid var(--line);
}
.btn-danger {
  color: #a85c28;
  background: #fff0e6;
}
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px 13px;
  white-space: nowrap;
}
.table td {
  padding: 15px 12px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.mono {
  font-family: "DM Mono", monospace;
}
.report-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 22px;
}
.report-controls .field {
  min-width: 150px;
}
.report-topbar {
  align-items: end;
  margin-bottom: 24px;
}
.report-lede {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 0;
}
.report-surface {
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
}
.report-surface .report-controls {
  margin: 0;
  padding: 20px;
  background: color-mix(in srgb, var(--paper) 72%, var(--surface));
  border-bottom: 1px solid var(--line);
}
.report-surface .report-controls .field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font: 10px "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.report-surface .report-controls .btn {
  min-height: 42px;
}
.report-surface #report-output {
  padding: 0 20px 20px;
}
.report-surface .total-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 20px 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.report-surface .total-box {
  min-height: 82px;
  padding: 15px 16px;
  border-left: 0;
  background: var(--surface);
}
.report-surface .total-box strong {
  color: var(--ink);
  font-size: 18px;
}
.report-surface .table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-compact);
  background: var(--surface);
}
.report-surface .table {
  margin: 0;
}
.report-surface .table thead {
  background: color-mix(in srgb, var(--paper) 80%, var(--surface));
}
.report-surface .table th {
  padding-top: 13px;
  padding-bottom: 13px;
  color: var(--muted);
}
.report-surface .table td {
  padding-top: 13px;
  padding-bottom: 13px;
  border-top-color: color-mix(in srgb, var(--line) 75%, transparent);
}
.report-surface .table tbody tr:hover {
  background: color-mix(in srgb, var(--teal) 7%, var(--surface));
}
.report-surface .notice {
  margin: 20px 0 0 !important;
  border-left: 3px solid var(--yellow);
}
[data-theme="dark"] .report-surface .report-controls {
  background: #171d24;
  border-bottom-color: #3a4654;
}
[data-theme="dark"] .report-surface,
[data-theme="dark"] .report-surface #report-output {
  color: #ffffff;
  background: #1b2028 !important;
}
[data-theme="dark"] .report-surface .table-wrap,
[data-theme="dark"] .report-surface .table,
[data-theme="dark"] .report-surface .table tbody,
[data-theme="dark"] .report-surface .table tr,
[data-theme="dark"] .report-surface .table td,
[data-theme="dark"] .report-surface .table th {
  background-color: #1b2028 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .report-surface .table thead,
[data-theme="dark"] .report-surface .table thead tr,
[data-theme="dark"] .report-surface .table thead th {
  background-color: #202a32 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .report-surface .table tbody tr:hover,
[data-theme="dark"] .report-surface .table tbody tr:hover td {
  background-color: #263741 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .report-surface .total-strip {
  border-color: #3a4654;
  background: #3a4654;
}
[data-theme="dark"] .report-surface .total-box {
  background: #202a32;
}
[data-theme="dark"] .report-surface .total-box label,
[data-theme="dark"] .report-surface .table th {
  color: #c6d2dc;
}
[data-theme="dark"] .report-surface .total-box strong,
[data-theme="dark"] .report-surface .table td {
  color: #ffffff;
}
[data-theme="dark"] .report-surface .table thead {
  background: #202a32;
}
[data-theme="dark"] .report-surface .table td {
  border-top-color: #34414e;
}
[data-theme="dark"] .report-surface .table tbody tr:hover {
  background: #263741;
}
[data-theme="dark"] .report-surface .notice {
  background: #3b3022;
  border-color: #765b32;
  color: #ffffff;
}
.total-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.total-box {
  border-left: 3px solid var(--teal);
  padding: 10px 14px;
  background: #f1f7f3;
}
.total-box label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.total-box strong {
  display: block;
  font:
    500 19px "DM Mono",
    monospace;
  margin-top: 7px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px 10px;
  font-size: 12px;
}
.help-panel {
  max-width: 860px;
}
.help-results {
  margin-top: 24px;
}
.help-item {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.help-item summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.help-item p {
  max-width: 680px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.service-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.service-file {
  border: 0;
  padding: 0;
  color: var(--teal);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
}
.service-modal {
  max-height: min(90vh, 760px);
  overflow-y: auto;
}
.service-record-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 22px;
}
.service-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}
.service-record {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.service-record-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.service-record-head span {
  color: var(--muted);
  font: 10px "DM Mono", monospace;
}
.service-record p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 9px 0 0;
}
.field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.notice {
  padding: 12px 14px;
  background: #fff4e9;
  color: #8a4d24;
  border: 1px solid #efc49f;
  border-radius: var(--radius-compact);
  font-size: 11px;
  margin-bottom: 18px;
}
.service-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: #fff4e9;
  color: #8a4d24;
  border: 1px solid #efc49f;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius-card);
}
.service-reminder strong,
.service-reminder span {
  display: block;
}
.service-reminder strong {
  font-size: 12px;
}
.service-reminder span {
  margin-top: 4px;
  font-size: 11px;
}
.subscription-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: #eaf6ff;
  color: #1f5c8a;
  border: 1px solid #a9d6f5;
  border-left: 4px solid var(--teal-deep, #1f5c8a);
  border-radius: var(--radius-card);
}
.subscription-banner-warning {
  background: #fff0ec;
  color: #ad4938;
  border-color: #f3b7a8;
  border-left-color: #ad4938;
}
.subscription-banner strong,
.subscription-banner span {
  display: block;
}
.subscription-banner strong {
  font-size: 12px;
}
.subscription-banner span {
  margin-top: 4px;
  font-size: 11px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
}
.auth-intro {
  background: var(--teal-deep);
  color: white;
  padding: 48px 8vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-intro .brand {
  padding: 0;
}
.auth-copy {
  max-width: 440px;
}
.auth-copy h1 {
  font-size: clamp(42px, 5vw, 68px);
  letter-spacing: -0.08em;
  margin-bottom: 20px;
}
.auth-copy p {
  color: #c4ccda;
  font-size: 14px;
  line-height: 1.8;
}
.auth-tag {
  font:
    11px "DM Mono",
    monospace;
  color: var(--yellow);
}
.auth-form-side {
  display: grid;
  place-items: center;
  padding: 40px;
}
.auth-box {
  width: min(100%, 390px);
  border-radius: var(--radius-panel);
}
.auth-box h2 {
  font-size: 25px;
  margin-bottom: 8px;
}
.auth-box > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 28px;
}
.auth-box .field {
  margin-bottom: 15px;
}
.auth-box .btn {
  width: 100%;
  margin-top: 10px;
}
.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 22px;
}
.auth-switch button {
  border: 0;
  color: var(--teal);
  font-weight: 800;
  background: none;
}
.auth-link {
  display: block;
  margin: 16px auto 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.auth-link:hover {
  text-decoration: underline;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  padding: 7px;
  line-height: 1;
  border-radius: var(--radius-compact);
}
.icon-button:hover {
  color: #a85c28;
  background: #fff0e6;
}
.signout-mobile {
  display: none;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 14px 18px;
    display: block;
    overflow: hidden;
  }
  .brand {
    padding: 0 4px 14px;
    display: flex;
    align-items: center;
  }
  .signout-mobile {
    display: inline-block;
    width: auto;
    margin: 0 0 0 auto;
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .nav a {
    padding: 10px 11px;
    white-space: nowrap;
    min-height: 38px;
  }
  .main {
    padding: 30px 22px 45px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-summary {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .dashboard-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-action-links {
    justify-content: flex-start;
    width: 100%;
  }
  .dashboard-supporting-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .live-trip-panel {
    grid-template-columns: 1fr;
  }
  .live-trip-controls {
    justify-content: flex-start;
  }
  .vehicle-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .vehicle-actions {
    justify-content: flex-start;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 45px;
    min-height: auto;
    padding: 55px 0 75px;
  }
  .landing-hero h1 {
    font-size: 58px;
  }
  .landing-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-price-grid {
    grid-template-columns: 1fr;
  }
  .auth-intro {
    min-height: 320px;
    padding: 28px 25px;
  }
  .auth-copy h1 {
    font-size: 43px;
  }
  .auth-form-side {
    padding: 40px 25px;
  }
}
@media (max-width: 520px) {
  .landing-nav,
  .landing-hero,
  .landing-overview,
  .landing-pricing,
  .landing-footer {
    width: min(100% - 32px, 1180px);
  }
  .landing-nav-actions .btn {
    padding: 10px;
  }
  .landing-login {
    display: none;
  }
  .landing-hero h1 {
    font-size: 48px;
  }
  .landing-hero p {
    font-size: 14px;
  }
  .landing-dashboard-preview {
    min-height: 330px;
    padding: 17px;
    transform: none;
  }
  .preview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .preview-stats {
    grid-template-columns: 1fr;
  }
  .preview-stats div {
    min-height: auto;
  }
  .preview-stats strong {
    margin-top: 8px;
  }
  .landing-feature-grid {
    grid-template-columns: 1fr;
  }
  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .vehicle-details {
    grid-template-columns: 1fr 1fr;
  }
  .vehicle-detail:last-child {
    grid-column: 1 / -1;
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 30, 27, 0.58);
}
.modal {
  width: min(100%, 480px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: none;
  padding: 24px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  padding: 2px 7px;
}
@media (max-width: 520px) {
  .topbar {
    margin-bottom: 26px;
  }
  .top-date {
    display: none;
  }
  h1 {
    font-size: 29px;
  }
  .stats-grid {
    gap: 10px;
  }
  .dashboard-supporting-stats {
    grid-template-columns: 1fr;
  }
  .distance-breakdown {
    gap: 8px;
  }
  .card {
    padding: 18px;
  }
  .stat {
    min-height: 112px;
  }
  .stat-value {
    font-size: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .total-strip {
    grid-template-columns: 1fr;
  }
  .service-reminder {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media print {
  .sidebar,
  .topbar,
  .report-controls {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .main {
    padding: 0;
    max-width: none;
  }
  .card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .total-strip {
    break-inside: avoid;
  }
}

/* Map modal base */
#map-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#map-modal {
  width: 92%;
  max-width: 1100px;
  height: 82%;
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.06);
}

/* Header */
#map-modal > .modal-header {
  display:flex;
  gap:8px;
  align-items:center;
  padding:10px 14px;
.dashboard-summary > .stat-primary {
  background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--teal) 8%, var(--surface)) 100%);
  border: 1px solid color-mix(in srgb, var(--teal) 38%, var(--line));
  border-top: 3px solid var(--teal);
}
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: var(--surface);
}
#map-modal .modal-title { font-weight:700; margin-right:8px; }

/* Theme toggle */
#map-theme-toggle {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:8px;
  border: 1px solid rgba(0,0,0,0.06);
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
}
#map-theme-toggle:focus { outline: 2px solid var(--focus); outline-offset:2px; }

/* Map container and results column */
#map-container { flex:1; min-height:0; background: var(--map-bg); }
#map-search-results { width:320px; border-left:1px solid rgba(0,0,0,0.06); overflow:auto; background: var(--panel-bg); padding:10px; }

/* Result rows */
#map-results-list > div { padding:10px; border-bottom:1px solid rgba(0,0,0,0.04); cursor:pointer; }
#map-results-list > div:hover { background: rgba(0,0,0,0.02); }

/* Selected label and confirm */
#map-selected-label { color: var(--muted); font-size:14px; }
#map-select-confirm { margin-left:8px; }

/* Light / dark variables */
:root {
  --card-bg: #ffffff;
  --panel-bg: #fafafa;
  --map-bg: #e9eef5;
  --text-color: #111827;
  --muted: #6b7280;
  --btn-bg: #ffffff;
  --btn-text: #111827;
  --focus: #2563eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #0b1220;
    --panel-bg: #07101a;
    --map-bg: #07101a;
    --text-color: #e6eef8;
    --muted: #9aa6b2;
    --btn-bg: #0f1724;
    --btn-text: #e6eef8;
    --focus: #60a5fa;
  }
}

/* Small responsive tweaks */
@media (max-width: 720px) {
  #map-search-results { display:none; }
  #map-modal { height: 88%; }
}

/* ============================================================
   Mobile polish — touch targets, readable layouts, small screens
   ============================================================ */

/* Larger, easier-to-tap controls everywhere */
@media (max-width: 900px) {
  .btn {
    min-height: 46px;
    padding: 12px 18px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-small {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .icon-button {
    min-width: 42px;
    min-height: 42px;
  }
  .field input,
  .field select,
  .field textarea {
    min-height: 46px;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }
  /* Settings & analytics grids collapse to one column */
  .grid.two-col,
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
  .analytics-card {
    grid-column: auto !important;
  }
  /* Anomaly and stat rows wrap nicely */
  .anomaly-item {
    flex-direction: column;
    gap: 6px;
  }
  .stat-row {
    flex-wrap: wrap;
  }
  .stat-row strong {
    white-space: normal;
    text-align: left;
  }
  /* Gauge stacks vertically */
  .gauge-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .gauge-wrap svg {
    margin: 0 auto;
  }
  /* Report controls stack */
  .report-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .report-controls .field {
    min-width: 0;
  }
  .report-surface .total-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Service reminder buttons full width */
  .service-reminder .btn {
    width: 100%;
  }
  /* Form action buttons stack full width */
  .form-actions .btn,
  .form-actions a.btn {
    flex: 1 1 100%;
  }
  /* Notices / banners easier to read */
  .alert-banner,
  .notice,
  .service-reminder {
    font-size: 14px;
    padding: 12px 14px;
  }
}

@media (max-width: 520px) {
  .main {
    padding: 22px 14px 40px;
  }
  .report-controls {
    grid-template-columns: 1fr;
  }
  .report-surface .total-strip {
    grid-template-columns: 1fr;
  }
  .btn,
  .btn-small {
    width: 100%;
  }
  /* Nav pills get slightly larger tap areas */
  .nav a {
    padding: 12px 14px;
    min-height: 44px;
    font-size: 14px;
  }
  /* Modal fills the screen with safe padding */
  .modal-backdrop {
    padding: 10px;
  }
  .modal {
    padding: 18px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    border-radius: 14px;
  }
  /* Preview/landing type scales down a touch more */
  .landing-hero h1 {
    font-size: 40px;
  }
  .auth-copy h1 {
    font-size: 34px;
  }
}

/* Extra-small devices */
@media (max-width: 360px) {
  .main {
    padding: 18px 10px 36px;
  }
  .landing-hero h1 {
    font-size: 34px;
  }
  h1 {
    font-size: 26px;
  }
  .card {
    padding: 14px;
  }
}

/* Make sure tables that must scroll do so smoothly on touch */
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

/* Safe-area padding for notched phones (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar,
  .main {
    padding-bottom: calc(45px + env(safe-area-inset-bottom));
  }
  @media (max-width: 900px) {
    .nav {
      padding-bottom: calc(2px + env(safe-area-inset-bottom));
    }
  }
}

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3000;
  padding: 18px max(20px, calc((100% - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -8px 30px rgb(20 52 47 / 12%);
}
.checkout-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}
.checkout-card {
  width: min(560px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.checkout-card h1 {
  margin: 10px 0 14px;
}
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cookie-banner p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
}
.cookie-banner strong {
  display: block;
  color: var(--ink);
}
.cookie-banner-actions,
.consent-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cookie-banner-actions .btn {
  white-space: nowrap;
}
.terms-settings-card {
  grid-column: 1 / -1;
}
.consent-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, var(--line));
  border-radius: var(--radius-compact);
  color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 12%, var(--surface));
}
.consent-warning[hidden] {
  display: none;
}
.consent-warning p {
  margin: 0;
  color: inherit;
  font-weight: 700;
}
.terms-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.smart-review-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(7 25 24 / 65%);
}
.smart-review {
  width: min(620px, 100%);
  max-height: 90vh;
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.smart-review h2 {
  margin: 10px 0;
}
.smart-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.consent-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(7 25 24 / 65%);
}
.consent-modal-backdrop[hidden] {
  display: none;
}
.consent-modal {
  width: min(720px, 100%);
  max-height: min(760px, 90vh);
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.consent-legal-text {
  max-height: 410px;
  margin: 20px 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}
.consent-legal-text p {
  margin: 0 0 14px;
}
.consent-legal-text p:last-child {
  margin-bottom: 0;
}
.consent-legal-text strong {
  color: var(--ink);
}

.billing-current-summary {
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--teal);
  background: var(--paper);
}

.billing-current-summary > strong,
.billing-plan-caption {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.96fr 1.18fr;
  gap: 14px;
  margin-top: 20px;
}

.billing-plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.billing-plan-current {
  border-color: var(--teal);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.billing-plan-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.billing-plan-heading h3 {
  margin: 0;
  font-size: 19px;
}

.billing-plan-heading strong {
  color: var(--teal);
  font: 500 14px "DM Mono", monospace;
  white-space: nowrap;
}

.billing-plan-caption {
  margin: 18px 0 8px;
}

.billing-plan-features {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.billing-plan .btn {
  width: 100%;
  margin-top: auto;
}

@media (max-width: 900px) {
  .billing-plan-grid {
    grid-template-columns: 1.08fr 0.92fr;
  }
}

@media (max-width: 520px) {
  .billing-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .cookie-banner-content,
  .consent-warning {
    align-items: stretch;
    flex-direction: column;
  }
  .cookie-banner-actions .btn {
    flex: 1 1 100%;
  }
}

/* Keep landing composition ahead of legacy responsive defaults. */
.landing-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(52px, 8vw, 120px);
  min-height: 0;
  padding-top: var(--landing-space);
  padding-bottom: var(--landing-space);
}

.landing-overview {
  padding-top: var(--landing-space);
  padding-bottom: var(--landing-space);
}

.landing-feature-grid {
  grid-template-columns: 1.1fr 0.86fr 1.28fr;
  gap: 56px 34px;
  margin-top: 92px;
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .landing-overview {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr 0.86fr;
    margin-top: 64px;
  }
}

@media (max-width: 520px) {
  .landing-hero {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .landing-overview {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
    gap: 38px;
    margin-top: 50px;
  }
}
