/* EVScanner's screen appearance. PDF styling lives in functions/templates/certificate-print.css. */
/* iOS: systemGroupedBackground, secondarySystemGroupedBackground, label,
   secondaryLabel, separator, and SwiftUI system colors resolved in dark mode.
   AccentColor.colorset uses Display P3; CardModifier uses an 18-point radius. */
:root { color-scheme: dark; --page: #000; --surface: #1c1c1e; --raised: #29292c; --line: rgb(84 84 88 / 50%); --text: #fff; --muted: rgb(235 235 245 / 60%); --accent: #009ee0; --green: #30d158; --red: #ff4245; --orange: #ff9230; --yellow: #ffd600; --greenish-yellow: rgb(85% 100% 15%); }
@supports (color: color(display-p3 0 0 0)) {
  :root { --accent: color(display-p3 0.1764705882 0.6078431373 0.8549019608); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button:disabled { opacity: .65; cursor: wait; }
h1, h2, p { margin: 0; }
svg { display: block; }
[hidden] { display: none !important; }
.sf-symbol-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex-shrink: 0; fill: currentColor; stroke: none; }
.page-width { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; padding: 12px 20px; background: var(--accent); color: #06121a; border-radius: 12px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 104px; border-bottom: 1px solid #242427; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 650; letter-spacing: -.4px; }
.brand img { border-radius: 10px; }
.header-controls { display: flex; gap: 8px; }
.select-control select { min-height: 44px; max-width: 160px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.page-intro { padding: 48px 0 30px; }
.eyebrow { display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 650; letter-spacing: 1.7px; text-transform: uppercase; color: var(--accent); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
h1 { max-width: 850px; margin: 0; font-size: clamp(32px, 3.2vw, 42px); line-height: 1.12; font-weight: 720; letter-spacing: -1.5px; text-wrap: balance; }
.primary-actions { display: flex; gap: 12px; flex-shrink: 0; }
.button { min-height: 48px; padding: 12px 19px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; font-size: 14px; line-height: 1.3; font-weight: 650; transition: background .15s, border-color .15s; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: #74c3f2; }
.button-secondary { background: var(--raised); border-color: #414145; }
.button-secondary:hover { background: #37373b; border-color: #5c5c63; }
.button .icon { width: 19px; height: 19px; }
.surface { background: var(--surface); border: 1px solid #2a2a2d; border-radius: 18px; }
.identity-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.vehicle-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 28px; }
.vehicle-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.vehicle-identity h2 { font-size: 21px; letter-spacing: -.5px; line-height: 1.35; }
.vehicle-icon { background: #2a2a2e; border: 1px solid #39393e; border-radius: 16px; display: grid; place-items: center; width: 58px; height: 58px; flex-shrink: 0; color: #a7a7af; }
.vehicle-icon .icon { width: 31px; height: 31px; }
.vin { color: var(--muted); font-size: 11px; margin-top: 5px; display: flex; gap: 10px; align-items: center; }
.vin span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; letter-spacing: 1px; overflow-wrap: anywhere; }
.validation-card { display: flex; align-items: center; gap: 18px; padding: 23px 28px; border-color: rgb(48 209 88 / 25%); }
.validation-icon { display: grid; place-items: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; background: rgb(48 209 88 / 12%); color: var(--green); }
.validation-icon .icon { width: 32px; height: 32px; }
.validation-copy { min-width: 0; }
.validation-copy h2 { font-size: 17px; line-height: 1.35; font-weight: 650; letter-spacing: -.25px; }
.validation-copy p { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.overview-grid, .details-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 20px; }
.health-card { grid-row: span 2; padding: 26px 30px 22px; display: flex; flex-direction: column; align-items: center; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; }
.card-heading h2, .details-title { font-size: 17px; font-weight: 650; line-height: 1.35; letter-spacing: -.25px; }
.health-card h2 { color: var(--accent); }
.card-description { margin-top: 10px; padding-bottom: 19px; border-bottom: 1px solid var(--line); width: 100%; color: var(--muted); font-size: 14px; }
.health-gauge { position: relative; width: min(100%, 306px); aspect-ratio: 1; margin: 22px auto 14px; }
.gauge-ring { width: 100%; height: 100%; }
.gauge-disc { fill: white; fill-opacity: .1; }
.gauge-mask { fill: none; stroke: white; stroke-width: 13.33px; stroke-linecap: round; }
/* StateOfHealthGaugeView: angular stops at 0%, 12.5%, 25%, 50% of 270°.
   The final red stop colors the rounded start cap in the otherwise hidden gap. */
.gauge-gradient { width: 100%; height: 100%; background: conic-gradient(from 225deg, var(--red) 0deg, var(--orange) 33.75deg, var(--yellow) 67.5deg, var(--green) 135deg, var(--green) 300deg, var(--red) 350deg); }
.gauge-reading { position: absolute; inset: 32% 5% auto; text-align: center; }
.soh-number { display: block; font-size: clamp(58px, 6.2vw, 78px); font-weight: 720; line-height: 1.15; letter-spacing: -4px; font-variant-numeric: tabular-nums; }
.gauge-unit { display: block; color: #b1b1b8; font-size: 23px; font-weight: 600; margin-top: 1px; }
.health-status { position: absolute; left: 50%; bottom: 8.33%; transform: translateX(-50%); max-width: 70%; padding: 5px 15px; border-radius: 20px; text-transform: uppercase; font-size: 14px; font-weight: 800; line-height: 1.4; letter-spacing: .8px; white-space: nowrap; color: #000; }
.bg-green { background: var(--green); }
.bg-teal { background: var(--greenish-yellow); }
.bg-yellow { background: var(--yellow); }
.bg-orange { background: var(--orange); }
.bg-red { background: var(--red); }
.bg-secondary { background: #b1b1ba; }
.health-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: auto; font-size: 12px; color: var(--muted); }
.health-footnote .status-dot { background: var(--green); width: 5px; height: 5px; }
.health-footnote strong { color: #dddde2; font-weight: 600; }
.stat-card { padding: 26px 30px; display: flex; align-items: flex-start; flex-direction: column; }
.accent-icon { color: var(--accent); width: 30px; height: 30px; }
.stat-value { margin-top: 20px; display: flex; align-items: center; gap: 12px; font-size: clamp(32px, 3.3vw, 43px); line-height: 1.2; font-weight: 650; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.trend-arrow { width: 28px; height: 28px; }
.trend-down { transform: rotate(90deg); }
.stat-caption { display: block; margin-top: 7px; color: #c0c0c7; font-size: 14px; }
.stat-note { margin-top: 20px; color: var(--muted); font-size: 13px; }
.stat-baseline { display: flex; justify-content: space-between; gap: 20px; width: 100%; padding-top: 16px; margin-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stat-baseline strong { color: #dddde3; font-weight: 500; }
.details-grid { margin-top: 20px; }
.detail-card { padding: 26px 28px 18px; }
.facts { margin: 20px 0 0; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.vin-value { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .2px; }
.measurements-card { margin-top: 20px; padding: 0 28px; }
.measurements-heading { padding: 24px 0; }
.details-title { display: block; }
.measurement-facts { margin: 0 0 15px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; border-top: 1px solid var(--line); }
.measurement-facts > div { gap: 16px; }
.measurement-facts > div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.measurement-facts dd { white-space: nowrap; }
.share-card { display: flex; align-items: center; justify-content: space-between; gap: 36px; margin-top: 20px; padding: 30px; }
.share-content { max-width: 670px; }
.share-card h2 { font-size: 25px; letter-spacing: -.65px; margin: 8px 0; }
.share-card p { color: var(--muted); font-size: 14px; max-width: 560px; }
.share-card .button { margin-top: 20px; }
.qr-wrapper { flex-shrink: 0; text-align: center; font-size: 11px; color: var(--muted); }
.qr-code { margin-bottom: 10px; }
.qr-code svg { display: block; }
.app-promo { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "icon title action" "icon description action"; column-gap: 22px; row-gap: 8px; padding: 30px; margin: 20px 0 32px; }
.app-promo img { grid-area: icon; align-self: center; border-radius: 13px; }
.app-promo h2 { grid-area: title; font-size: 22px; line-height: 1.35; letter-spacing: -.5px; }
.app-promo p { grid-area: description; font-size: 14px; line-height: 1.7; color: var(--muted); }
.app-link { grid-area: action; align-self: center; justify-self: start; white-space: nowrap; }
.app-link .icon { width: 15px; height: 15px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 25px 0 35px; border-top: 1px solid #29292c; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { padding-block: 10px; }
.site-footer a:hover { color: white; }
.share-toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 16px); width: max-content; max-width: calc(100% - 32px); text-align: center; padding: 14px 22px; border-radius: 14px; background: #f0f0f4; color: #17171b; box-shadow: 0 8px 28px #0005; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; }
.share-toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1000px) {
  .title-row { display: block; }
  .primary-actions { margin-top: 22px; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { min-height: 86px; gap: 12px; flex-wrap: wrap; padding-block: 16px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand img { width: 33px; height: 33px; border-radius: 9px; }
  .select-control select { padding: 8px; font-size: 12px; border-radius: 11px; }
  .header-controls { gap: 6px; }
  .page-intro { padding: 30px 0 24px; }
  h1 { font-size: 35px; line-height: 1.13; letter-spacing: -1.2px; }
  .eyebrow { font-size: 10px; letter-spacing: 1.35px; }
  .primary-actions { gap: 9px; margin-top: 22px; }
  .primary-actions .button { flex: 1; padding: 12px 11px; font-size: 13px; gap: 8px; }
  .identity-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
  .vehicle-banner { align-items: flex-start; flex-direction: column; gap: 15px; padding: 21px; }
  .validation-card { align-items: flex-start; gap: 13px; padding: 21px; }
  .validation-icon { width: 40px; height: 40px; }
  .validation-icon .icon { width: 27px; height: 27px; }
  .validation-copy h2 { font-size: 16px; }
  .validation-copy p { font-size: 13px; }
  .vehicle-identity { width: 100%; gap: 13px; }
  .vehicle-identity h2 { font-size: 18px; }
  .vehicle-icon { width: 43px; height: 43px; border-radius: 13px; }
  .vehicle-icon .icon { width: 26px; height: 26px; }
  .vin { align-items: flex-start; gap: 6px; font-size: 10px; }
  .vin span { font-size: 10px; letter-spacing: .3px; }
  .overview-grid, .details-grid { grid-template-columns: 1fr; gap: 16px; }
  .health-card { grid-row: auto; padding: 23px 24px; }
  .health-gauge { width: min(100%, 300px); margin-top: 22px; }
  .soh-number { font-size: 67px; letter-spacing: -3px; }
  .card-heading h2, .details-title { font-size: 17px; }
  .card-description { font-size: 13px; }
  .stat-card, .detail-card { padding: 24px; }
  .stat-value { font-size: 38px; margin-top: 22px; }
  .stat-note { margin-top: 16px; }
  .details-grid, .measurements-card, .share-card { margin-top: 16px; }
  .facts > div { font-size: 12px; gap: 16px; }
  .facts dt { max-width: 48%; }
  .facts dd { max-width: 61%; }
  .measurements-card { padding-inline: 24px; }
  .measurement-facts { grid-template-columns: 1fr; }
  .measurement-facts > div:not(:last-child) { border-bottom: 1px solid var(--line); }
  .share-card { flex-wrap: wrap; justify-content: center; gap: 26px; padding: 25px; }
  .share-content { width: 100%; }
  .share-card h2 { font-size: 24px; }
  .share-card .button { width: 100%; font-size: 13px; }
  .app-promo { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "icon title" "description description" "action action"; gap: 16px; padding: 25px; margin: 16px 0 24px; }
  .app-promo img { width: 44px; height: 44px; border-radius: 11px; }
  .app-promo h2 { align-self: center; font-size: 20px; }
  .app-link { justify-self: stretch; font-size: 13px; }
  .site-footer { align-items: flex-start; flex-direction: column-reverse; gap: 15px; padding: 22px 0 30px; }
  .site-footer nav { width: 100%; gap: 24px; }
}
@media (max-width: 359px) {
  .page-width { width: calc(100% - 24px); }
  .brand { font-size: 14px; gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .header-controls { gap: 4px; }
  .select-control select { padding-inline: 5px; }
  h1 { font-size: 30px; }
  .primary-actions { flex-direction: column; }
  .health-card { padding-inline: 18px; }
  .soh-number { font-size: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  :root { color-scheme: light; --page: white; --surface: white; --text: #161619; --muted: #555; --line: #ccc; }
  .site-header, .primary-actions, .share-card, .app-promo, .site-footer, .share-toast { display: none; }
  .page-width { width: 100%; }
  .page-intro { padding-top: 0; }
  .surface { break-inside: avoid; border-color: #bbb; }
  .overview-grid, .details-grid { grid-template-columns: 1fr 1fr; }
  .health-card { grid-row: span 2; }
  .health-gauge { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: white; }
}
