:root {
  --forest-950: #002922;
  --forest-900: #003b2f;
  --forest-800: #0b4a3c;
  --mint: #78faae;
  --mint-deep: #34d986;
  --ink: #161718;
  --ink-soft: #4e5552;
  --paper: #f2f4f2;
  --white: #ffffff;
  --line: #d9dedb;
  --danger: #b42318;
  --warning: #8a4f08;
  --success: #116a3d;
  --shadow: 0 18px 50px rgba(0, 41, 34, .09);
  --radius: 22px;
  --radius-small: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--forest-950); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { border: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wordmark {
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .075em;
}
.brand-line, .brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand-link { text-decoration: none; }
.brand-divider { width: 1px; height: 22px; background: currentColor; opacity: .32; }
.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--forest-800);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow.light { color: var(--mint); }
.muted { color: var(--ink-soft); }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.button:active { transform: scale(.98); }
.button-primary { background: var(--forest-900); color: var(--white); }
.button-primary:hover { background: var(--forest-800); }
.button-mint { background: var(--mint); color: var(--ink); }
.button-mint:hover { background: #9cffc5; }
.button-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); min-height: 42px; padding: 10px 17px; }
.button-outline:hover { background: var(--ink); color: var(--white); }
.button-ghost { color: var(--forest-950); background: rgba(120,250,174,.42); min-height: 38px; padding: 9px 14px; font-size: 13px; }
.button-text { background: transparent; color: var(--forest-800); min-height: 40px; }
.button-wide { width: 100%; }
.icon-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--forest-950);
  background: rgba(255,255,255,.78);
  cursor: pointer;
}
.icon-button.subtle { width: 40px; height: 40px; background: #f1f3f2; }
.icon-button.danger { color: var(--danger); }
.icon-button:hover { background: var(--mint); }

.alert {
  padding: 13px 15px;
  border-radius: var(--radius-small);
  font-weight: 700;
  font-size: 14px;
}
.alert-error { color: #7f1d1d; background: #fee2e2; border: 1px solid #fecaca; }
.alert-success { color: #0d5d36; background: #dcfce7; border: 1px solid #bbf7d0; }
.page-alert { margin: 18px 0 -2px; }

/* Login */
.login-page { min-height: 100vh; min-height: 100dvh; background: var(--forest-950); }
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}
.login-visual {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  padding: calc(40px + var(--safe-top)) clamp(28px, 5vw, 76px) 48px;
  color: var(--white);
  background:
    radial-gradient(circle at 80% 65%, rgba(120,250,174,.2), transparent 35%),
    linear-gradient(135deg, var(--forest-950), var(--forest-900));
}
.login-visual::after {
  content: "";
  position: absolute;
  left: -10%; right: -10%; bottom: -23%;
  height: 56%;
  background: var(--mint);
  opacity: .08;
  transform: rotate(-7deg);
}
.login-copy { position: relative; z-index: 2; margin-top: clamp(70px, 13vh, 150px); max-width: 680px; }
.login-copy h1 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(52px, 6.3vw, 94px);
  line-height: .94;
  letter-spacing: -.055em;
  font-weight: 850;
}
.login-copy p { max-width: 540px; margin: 24px 0 0; color: rgba(255,255,255,.76); font-size: clamp(17px, 1.5vw, 21px); }
.login-car {
  position: absolute;
  z-index: 2;
  width: min(74%, 840px);
  height: auto;
  right: -2%;
  bottom: 1%;
  filter: drop-shadow(0 30px 26px rgba(0,0,0,.38));
}
.login-panel {
  display: grid;
  place-items: center;
  padding: calc(40px + var(--safe-top)) clamp(26px, 5vw, 76px) calc(40px + var(--safe-bottom));
  background: var(--paper);
}
.login-card { width: min(100%, 470px); }
.app-icon-mini {
  width: 58px; height: 58px; margin-bottom: 30px;
  display: grid; place-items: center;
  border-radius: 18px;
  color: var(--white); background: var(--forest-900);
  box-shadow: inset 0 0 0 4px rgba(120,250,174,.24);
  font-weight: 900; letter-spacing: -.05em;
}
.login-card h2 { margin: 0 0 13px; font-size: clamp(30px, 3vw, 42px); line-height: 1.04; letter-spacing: -.035em; }
.login-card > .muted { margin: 0 0 25px; }
.stack-form { display: grid; gap: 11px; margin-top: 20px; }
.stack-form label, .entry-form label { color: #313734; font-size: 13px; font-weight: 800; }
.password-field { position: relative; }
.password-field input { padding-right: 96px; }
.reveal-password {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 10px;
  border-radius: 999px; color: var(--forest-800); background: transparent;
  font-size: 12px; font-weight: 800; cursor: pointer;
}
input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="text"] {
  width: 100%; min-height: 54px;
  padding: 13px 15px;
  border: 1.5px solid #bec6c1;
  border-radius: 12px;
  color: var(--ink); background: var(--white);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus { border-color: var(--forest-800); box-shadow: 0 0 0 4px rgba(120,250,174,.3); }
.privacy-note { margin: 24px 0 0; color: #6a716d; font-size: 12px; }
.privacy-note span { color: var(--mint-deep); margin-right: 6px; }
.ios-install-tip { margin-top: 17px; padding: 13px 14px; border-radius: 12px; color: var(--forest-900); background: rgba(120,250,174,.25); font-size: 13px; }

/* Application */
.app-page { min-height: 100vh; }
.offline-banner {
  position: fixed; z-index: 100; left: 50%; top: calc(8px + var(--safe-top)); transform: translateX(-50%);
  padding: 9px 14px; border-radius: 999px; color: white; background: var(--warning);
  font-size: 12px; font-weight: 800; box-shadow: var(--shadow);
}
.topbar {
  position: sticky; z-index: 50; top: 0;
  padding-top: var(--safe-top);
  color: var(--forest-950); background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(0,59,47,.1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar-inner {
  width: min(100% - 40px, 1120px); min-height: 70px;
  margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form, .history-actions form { margin: 0; }
.app-shell { width: min(100% - 40px, 1120px); margin: 0 auto; padding-bottom: 70px; }
.vehicle-hero {
  position: relative; min-height: 350px; margin-top: 24px; overflow: hidden;
  border-radius: 26px; color: var(--white); background: var(--forest-900); box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-angle {
  position: absolute; z-index: -1; inset: 0 42% 0 0;
  background: var(--forest-950); clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}
.hero-copy { position: relative; z-index: 3; width: 52%; padding: 48px; }
.hero-copy h1 { margin: 0; font-size: clamp(46px, 6vw, 76px); line-height: .96; letter-spacing: -.055em; }
.hero-copy > p { margin: 10px 0 17px; color: rgba(255,255,255,.69); }
.hero-copy .button { margin-top: 25px; }
.status-pill { display: inline-flex; padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-good { color: #d7ffe8; background: rgba(29,166,95,.28); }
.status-warn { color: #fff2d2; background: rgba(210,121,22,.31); }
.status-neutral { color: var(--forest-950); background: var(--mint); }
.hero-car {
  position: absolute; z-index: 2; right: -2.5%; bottom: 3%;
  width: min(60%, 670px); height: auto;
  filter: drop-shadow(0 25px 24px rgba(0,0,0,.34));
}
.hero-registration {
  position: absolute; z-index: 4; right: 28px; top: 24px;
  padding: 8px 12px; border-radius: 7px;
  color: var(--ink); background: rgba(255,255,255,.93);
  font-size: 12px; font-weight: 850; letter-spacing: .09em;
}
.quick-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin: 18px 0 28px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--line);
}
.quick-stats article { padding: 19px 22px; background: var(--white); }
.quick-stats span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 12px; }
.quick-stats strong { font-size: 18px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 22px; align-items: start; }
.content-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.content-card h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); line-height: 1.08; letter-spacing: -.035em; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.card-badge { padding: 8px 11px; border-radius: 999px; color: var(--forest-900); background: rgba(120,250,174,.28); font-size: 11px; font-weight: 850; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.metric { min-height: 128px; padding: 18px; border-radius: 16px; background: #f2f4f2; }
.metric-featured { color: var(--white); background: var(--forest-900); }
.metric-alert { color: #7c2d12; background: #ffedd5; }
.metric span, .metric small { display: block; }
.metric span { margin-bottom: 9px; color: inherit; opacity: .72; font-size: 12px; font-weight: 700; }
.metric strong { display: block; margin-bottom: 6px; font-size: clamp(23px, 3vw, 31px); line-height: 1; letter-spacing: -.04em; }
.metric small { opacity: .65; font-size: 11px; }
.progress-block { margin-top: 25px; }
.progress-block + .progress-block { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; font-size: 12px; }
.progress-label span { color: var(--ink-soft); }
progress { width: 100%; height: 9px; display: block; overflow: hidden; border: 0; border-radius: 999px; background: #e2e6e3; }
progress::-webkit-progress-bar { background: #e2e6e3; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--forest-900); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--forest-900); border-radius: 999px; }
.muted-progress progress::-webkit-progress-value { background: var(--mint-deep); }
.muted-progress progress::-moz-progress-bar { background: var(--mint-deep); }
.entry-card { position: sticky; top: calc(94px + var(--safe-top)); }
.entry-card > .muted { margin: 12px 0 23px; font-size: 14px; }
.entry-form { display: grid; gap: 9px; }
.odometer-input { position: relative; }
.odometer-input input { height: 72px; padding-right: 60px; font-size: 27px; font-weight: 800; letter-spacing: -.03em; }
.odometer-input span { position: absolute; right: 17px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-weight: 750; }
.form-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 11px; margin: 4px 0 10px; }
.form-row > div { display: grid; gap: 7px; }
label small { color: var(--ink-soft); font-weight: 500; }
.history-card { margin-top: 22px; }
.history-heading { align-items: center; }
.export-actions { display: flex; gap: 8px; }
.history-list { margin-top: 22px; border-top: 1px solid var(--line); }
.history-row { min-height: 82px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.history-date { width: 54px; height: 54px; display: grid; place-content: center; border-radius: 14px; text-align: center; color: var(--forest-900); background: rgba(120,250,174,.22); }
.history-date strong { font-size: 20px; line-height: 1; }
.history-date span { margin-top: 2px; font-size: 10px; font-weight: 750; }
.history-main { min-width: 0; }
.history-main strong { display: block; font-size: 21px; letter-spacing: -.025em; }
.history-main span { display: block; overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-actions { display: flex; gap: 4px; }

.myskoda-card { margin-top: 22px; scroll-margin-top: 92px; }
.sync-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.sync-status {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 8px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 850; white-space: nowrap;
}
.sync-status > span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255,255,255,.36); }
.sync-status-ok { color: #0d5d36; background: #dcfce7; }
.sync-status-warn { color: #8a4f08; background: #ffedd5; }
.sync-status-off { color: #5f6763; background: #ecefed; }
.sync-intro { max-width: 760px; margin: 13px 0 0; }
.sync-alert { margin-top: 18px; }
.sync-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.sync-grid article { min-height: 126px; padding: 18px; border-radius: 16px; background: #f2f4f2; }
.sync-grid span, .sync-grid small { display: block; color: var(--ink-soft); }
.sync-grid span { margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.sync-grid strong { display: block; font-size: clamp(18px, 2.4vw, 25px); line-height: 1.08; letter-spacing: -.03em; }
.sync-grid small { margin-top: 8px; font-size: 11px; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.sync-actions form { margin: 0; }
.sync-connect-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr); gap: 38px; align-items: start; margin-top: 7px; }
.sync-benefits { display: grid; gap: 9px; margin: 22px 0 0; padding: 0; list-style: none; }
.sync-benefits li { position: relative; padding-left: 26px; color: #313734; font-size: 14px; }
.sync-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }
.sync-connect-form { margin-top: 0; padding: 21px; border-radius: 17px; background: #f2f4f2; }
.sync-connect-form .privacy-note { margin-top: 4px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.details-list { margin: 24px 0 0; }
.details-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.details-list dt { color: var(--ink-soft); }
.details-list dd { margin: 0; font-weight: 800; text-align: right; }
.device-card > .muted { margin: 14px 0 21px; }
.app-footer {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 30px;
  padding: 42px max(20px, calc((100vw - 1120px) / 2)) calc(42px + var(--safe-bottom));
  color: rgba(255,255,255,.78); background: var(--forest-950);
}
.app-footer p { max-width: 600px; margin: 12px 0 0; font-size: 12px; }
.app-footer a { color: var(--mint); font-weight: 800; text-decoration: none; white-space: nowrap; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 470px; padding-bottom: 30px; }
  .login-copy { margin-top: 55px; }
  .login-copy h1 { font-size: clamp(48px, 13vw, 68px); }
  .login-copy p { width: 62%; font-size: 15px; }
  .login-car { width: 70%; right: -10%; bottom: 2%; }
  .login-panel { padding-top: 42px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .sync-connect-layout { grid-template-columns: 1fr; gap: 24px; }
  .entry-card { position: static; }
  .vehicle-hero { min-height: 410px; }
  .hero-copy { width: 66%; padding: 38px; }
  .hero-car { width: 65%; right: -13%; }
  .hero-angle { right: 25%; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .login-visual { min-height: 420px; padding: calc(26px + var(--safe-top)) 22px 24px; }
  .login-copy { margin-top: 42px; }
  .login-copy h1 { font-size: 50px; }
  .login-copy p { width: 76%; margin-top: 16px; }
  .login-car { width: 84%; right: -22%; bottom: -1%; }
  .login-panel { padding: 34px 22px calc(35px + var(--safe-bottom)); }
  .app-icon-mini { margin-bottom: 24px; }
  .topbar-inner, .app-shell { width: min(100% - 28px, 1120px); }
  .topbar-inner { min-height: 62px; }
  .model-name { display: none; }
  .topbar .brand-divider { display: none; }
  .install-button { display: none !important; }
  .vehicle-hero { min-height: 445px; margin-top: 14px; border-radius: 22px; }
  .hero-angle { inset: 0 0 44% 0; clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%); }
  .hero-copy { width: 100%; padding: 31px 25px; }
  .hero-copy h1 { font-size: 48px; }
  .hero-copy .button { margin-top: 19px; }
  .hero-car { width: 97%; right: -15%; bottom: -3%; }
  .hero-registration { top: auto; right: 19px; bottom: 18px; }
  .quick-stats { grid-template-columns: 1fr; }
  .quick-stats article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; }
  .quick-stats span { margin: 0; }
  .quick-stats strong { font-size: 14px; text-align: right; }
  .content-card { padding: 23px 19px; border-radius: 19px; }
  .section-heading { align-items: flex-start; }
  .card-badge { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
  .metric { min-height: 117px; padding: 14px; }
  .metric strong { font-size: 21px; }
  .form-row { grid-template-columns: 1fr; }
  .history-heading { align-items: flex-end; }
  .export-actions .button { min-width: 49px; padding: 10px 11px; }
  .history-row { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; }
  .history-date { width: 46px; height: 46px; border-radius: 12px; }
  .history-main strong { font-size: 18px; }
  .history-main span { max-width: 47vw; }
  .history-actions { gap: 0; }
  .sync-heading { align-items: center; }
  .sync-status { padding: 7px 10px; font-size: 11px; }
  .sync-grid { grid-template-columns: 1fr; gap: 8px; }
  .sync-grid article { min-height: 104px; }
  .sync-actions { display: grid; grid-template-columns: 1fr; }
  .sync-actions .button, .sync-actions form { width: 100%; }
  .sync-connect-form { padding: 17px 14px; }
  .icon-button.subtle { width: 44px; height: 44px; }
  .detail-grid { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; padding: 34px 22px calc(34px + var(--safe-bottom)); }
}

@media (max-width: 340px) {
  .metric-grid { grid-template-columns: 1fr; }
  .history-main span { max-width: 36vw; }
  .login-copy p { width: 82%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
