/* Recall Relay phone app (/app/). Its own stylesheet, so the website's site.css is never touched.
   Same design system as the website: signage type, navy ink on cool paper, safety yellow only as the tag
   band (the top bar), hazard-label colors for severity. Mobile first; two columns from 600px wide (a
   foldable's inner screen, tablets, phones in landscape). Dark mode follows the phone's setting. */
/* the hidden attribute always wins (.a-btn-wide's display: flex used to show the hidden install button) */
[hidden] { display: none !important; }
@font-face { font-family: "Heros Cn"; src: url("/static/fonts/texgyreheroscn-bold.woff2") format("woff2"), url("/static/fonts/texgyreheroscn-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Heros"; src: url("/static/fonts/texgyreheros-regular.woff2") format("woff2"), url("/static/fonts/texgyreheros-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Heros"; src: url("/static/fonts/texgyreheros-bold.woff2") format("woff2"), url("/static/fonts/texgyreheros-bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --paper: #EDF0F2;
  --sheet: #FFFFFF;
  --ink: #13213C;
  --ink-2: #4B5873;
  --rule: #CDD4DC;
  --signal: #FFC400;       /* the tag band only */
  --danger: #C8102E;
  --warning: #DB6206;
  --caution-bg: #FFE27A;
  --btn: #13213C;          /* the main button */
  --btn-text: #FFFFFF;
  --focus: #13213C;
  --field: #FFFFFF;
  /* text in a hazard color: readable (4.5:1 or more) on the card, unlike the plain fills */
  --danger-text: #C8102E;  /* 5.9:1 on white */
  --warning-text: #A84A00; /* 5.8:1 on white, 5.0:1 on paper */
  --clear-text: #1E7F4F;   /* 5.0:1 on white */
  --danger-line: #C8102E;  /* the colored edge of a My products card */
  --warning-line: #DB6206;
  --clear-line: #1E7F4F;

  --display: "Heros Cn", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --text: "Heros", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --app-wrap: 1040px;
  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  --radius: 14px;
  --tap: 48px;
  color-scheme: light;
}

/* the phone's dark mode: deep navy, light text, the same accents */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1428;
    --sheet: #15223F;
    --ink: #E8ECF3;
    --ink-2: #AEB8CA;
    --rule: #2C3B5C;
    --btn: #E8ECF3;
    --btn-text: #13213C;
    --focus: #E8ECF3;        /* 13:1 on the card; safety yellow stays the tag band's alone */
    --field: #0F1A33;
    --danger-text: #FF7A8A;  /* 6.3:1 on the dark card */
    --warning-text: #FFA060; /* 7.8:1 */
    --clear-text: #5CD69B;   /* 8.7:1 */
    --danger-line: #FF7A8A;  /* the hazard red is only 2.7:1 on the dark card */
    --warning-line: #DB6206; /* 4.3:1 */
    --clear-line: #5CD69B;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
       font: 400 1.0625rem/1.5 var(--text); overflow-x: clip; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 0.3em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
p { margin: 0 0 10px; }
.a-skip { position: absolute; left: -9999px; top: 0; }
.a-skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--sheet); padding: 10px 14px; border-radius: 8px; }

.a-wrap { width: 100%; max-width: var(--app-wrap); margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter-l); }
.a-main { flex: 1; padding: 20px 0 32px; }
.a-narrow { max-width: 720px; margin: 0 auto; }

/* ---------- the tag band: the top bar ---------- */
.a-bar { position: sticky; top: 0; z-index: 20; background: #FFC400; color: #13213C;
         padding: env(safe-area-inset-top) var(--gutter-r) 0 var(--gutter-l); }
.a-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px;
            max-width: var(--app-wrap); margin: 0 auto; }
.a-logo { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); text-decoration: none;
          font: 700 1.5rem/1 var(--display); white-space: nowrap; }
.a-logo svg { width: 28px; height: 28px; flex: none; }
.a-bar-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap);
             margin-right: -10px; border-radius: 50%; color: #13213C; }
.a-bar-btn svg { width: 24px; height: 24px; }
.a-bar-btn:focus-visible, .a-logo:focus-visible { outline-color: #13213C; }

/* ---------- type ---------- */
.a-h1 { font: 700 clamp(2.1rem, 8vw, 2.9rem)/1.04 var(--display); margin: 4px 0 8px; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.a-h1-sm { font-size: clamp(1.75rem, 6.5vw, 2.3rem); }
.a-h2 { font: 700 1.6rem/1.15 var(--display); margin: 0 0 12px; }
.a-lede { color: var(--ink-2); font-size: 1.0625rem; margin: 0 0 16px; max-width: 34em; }
.a-muted { color: var(--ink-2); font-size: 0.9375rem; }
.a-fine { color: var(--ink-2); font-size: 0.875rem; line-height: 1.45; margin: 10px 0; }
.a-fine a { color: var(--ink); font-weight: 700; }
.a-empty { color: var(--ink-2); background: var(--sheet); border: 1px dashed var(--rule); border-radius: var(--radius);
           padding: 18px 16px; margin: 0; }

/* ---------- cards, fields, buttons ---------- */
.a-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.a-sec { margin-top: 28px; }
.a-label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: 8px; }
.a-search-row { display: flex; gap: 10px; }
.a-input { flex: 1; min-width: 0; height: 56px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 12px;
           background: var(--field); color: var(--ink); font: 400 1.125rem var(--text); }  /* 18px: phones don't zoom in */
.a-input::placeholder { color: var(--ink-2); opacity: .8; }
.a-input:focus { outline: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink-2); }
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 20px;
         border-radius: 12px; border: 2px solid var(--btn); font: 700 1.0625rem/1.2 var(--text); text-decoration: none;
         cursor: pointer; text-align: center; touch-action: manipulation; }
.a-btn-ink { background: var(--btn); color: var(--btn-text); }
.a-btn-line { background: transparent; color: var(--ink); border-color: var(--ink); min-height: var(--tap); }
.a-btn-wide { display: flex; width: 100%; margin-top: 14px; }
.a-btn-scan { display: flex; width: 100%; margin-top: 12px; background: transparent; color: var(--ink); border-color: var(--ink); }
.a-btn-scan svg { width: 26px; height: 26px; flex: none; }
.a-btn:active { transform: translateY(1px); }
.a-note { margin: 12px 0 0; padding: 12px 14px; border-left: 4px solid var(--ink); background: var(--paper); border-radius: 0 8px 8px 0; font-size: 0.9375rem; }
.a-card .a-note { background: var(--paper); }
.a-alert { border-left: 6px solid var(--danger); background: var(--sheet); padding: 14px 16px; margin: 16px 0; border-radius: 0 10px 10px 0; }
.a-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ---------- severity and agency ---------- */
.a-sev { display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 5px 9px; border-radius: 8px;
         font: 700 0.9375rem/1.15 var(--display); letter-spacing: .01em; overflow-wrap: anywhere; }
.a-sev small { font: 400 0.6875rem/1.3 var(--text); margin-top: 2px; opacity: .92; }
.a-sev-high { background: var(--danger); color: #fff; }
.a-sev-medium { background: var(--warning); color: #fff; }
.a-sev-low { background: var(--caution-bg); color: #13213C; }
.a-plate { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 5px; font: 700 12px/18px var(--display); letter-spacing: .03em; }

/* ---------- recall rows ---------- */
.a-list { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.a-list > li + li { border-top: 1px solid var(--rule); }
.a-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px;
         min-height: 76px; text-decoration: none; }
.a-row:active { background: var(--paper); }
/* the list clips anything outside it (its rounded corners), so a row's focus ring is drawn inside the row */
.a-row:focus-visible { outline-offset: -3px; border-radius: 0; }
.a-list > li:first-child .a-row:focus-visible { border-radius: var(--radius) var(--radius) 0 0; }
.a-list > li:last-child .a-row:focus-visible { border-radius: 0 0 var(--radius) var(--radius); }
.a-list > li:only-child .a-row:focus-visible { border-radius: var(--radius); }
.a-row-text { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.a-row-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.a-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.875rem; color: var(--ink-2); }
.a-row-meta .a-plate { color: var(--ink); }
.a-row-basis { font-size: 0.8125rem; color: var(--ink-2); }
@media (hover: hover) { .a-row:hover .a-row-title { text-decoration: underline; } }

/* ---------- home ---------- */
.a-card-search { padding: 16px; }
.a-hero .a-h1 { margin-top: 0; }

/* My products (drawn by app.js) */
.a-mine { display: grid; gap: 12px; }
.a-mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.a-mine-item { background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--rule); border-radius: var(--radius); padding: 12px 8px 12px 14px; }
.a-mine-item.is-clear { border-left-color: var(--clear-line); }
.a-mine-item.is-hit { border-left-color: var(--warning-line); }
.a-mine-item.is-new { border-left-color: var(--danger-line); }
.a-mine-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.a-mine-name { min-width: 0; padding-top: 4px; }
.a-mine-name b { display: block; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.a-mine-sub { display: block; font-size: 0.8125rem; color: var(--ink-2); overflow-wrap: anywhere; }
.a-x { flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.a-x svg { width: 20px; height: 20px; }
.a-x:active { background: var(--paper); }
.a-mine-status { margin: 6px 6px 0 0; font-weight: 700; font-size: 0.9375rem; }
.a-mine-status.is-clear { color: var(--clear-text); }
.a-mine-status.is-hit { color: var(--warning-text); }
.a-mine-status.is-new { color: var(--danger-text); }
.a-mini { list-style: none; margin: 8px 6px 0 0; padding: 0; }
.a-mini li + li { border-top: 1px solid var(--rule); }
.a-mini a { display: block; padding: 10px 0; min-height: var(--tap); text-decoration: none; }
/* two lines at most (agency titles run to 140+ characters), so a long list never buries Latest recalls */
.a-mini-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
                font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.a-mini-meta { display: block; font-size: 0.8125rem; color: var(--ink-2); margin-top: 2px; }
.a-new { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; background: var(--danger); color: #fff;
         font: 700 0.75rem/1.5 var(--text); vertical-align: 1px; }
.a-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.a-dot-high { background: var(--danger); } .a-dot-medium { background: var(--warning); } .a-dot-low { background: var(--caution-bg); box-shadow: inset 0 0 0 1px #9a7a00; }
.a-mine-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 6px 0 0; }
.a-mine-links a, .a-linkbtn { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; font-size: 0.9375rem; color: var(--ink); }
.a-linkbtn { background: none; border: 0; padding: 0; font-family: inherit; text-decoration: underline; text-underline-offset: 0.3em; cursor: pointer; }

/* save to My products */
.a-save { margin: 20px 0 0; }
.a-save-h { font: 700 1.3rem/1.2 var(--display); margin: 0 0 4px; }
.a-save-why { margin: 0 0 12px; }
.a-saved { margin-top: 0; }

/* ---------- one recall ---------- */
.a-back { margin: 0 0 4px; }
.a-back a { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding-right: 12px; font-weight: 700; text-decoration: none; color: var(--ink-2); }
.a-back svg { width: 20px; height: 20px; }
.a-recall-meta { margin: 0 0 6px; }
.a-recall-title { margin-bottom: 16px; }
.a-sevbox { display: flex; gap: 14px; align-items: flex-start; }
.a-sevbox .a-sev { flex: none; min-width: 84px; }
.a-sevbox p { margin: 0 0 4px; }
.a-sev-label { font-size: 1.1875rem; line-height: 1.25; }
.a-official { min-height: 60px; padding: 12px 18px; white-space: normal; line-height: 1.25; margin: 16px 0; }
.a-facts { margin: 0 0 16px; padding: 4px 16px; }
.a-facts > div { padding: 14px 0; }
.a-facts > div + div { border-top: 1px solid var(--rule); }
.a-facts dt { font-weight: 700; margin-bottom: 4px; }
.a-facts dd { margin: 0; overflow-wrap: anywhere; }
.a-facts dd p { margin: 0 0 6px; }
.a-plain { list-style: none; margin: 0; padding: 0; }
.a-plain li + li { margin-top: 6px; }
.a-codes { display: flex; flex-wrap: wrap; gap: 8px; }
.a-codes span { font-variant-numeric: tabular-nums; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 8px; }

/* ---------- check my car (/app/cars) ---------- */
.a-btn-car svg { width: 26px; height: 26px; flex: none; }
select.a-input { width: 100%; padding: 0 10px; appearance: auto; }
.a-car-form, .a-car-vin { margin-top: 4px; }
.a-car-vin { margin-top: 16px; }
.a-car-fields { display: grid; gap: 14px; }
.a-car-fields .a-input { width: 100%; }
.a-car-answer { scroll-margin-top: 72px; }  /* below the sticky yellow bar (56px) */
/* /app/privacy and /app/terms: the website's policy text (its class names) in the app's type */
.a-legal .page-h1 { font: 700 clamp(1.75rem, 6.5vw, 2.3rem)/1.04 var(--display); margin: 4px 0 8px; }
.a-legal h2 { font: 700 1.35rem/1.2 var(--display); margin: 28px 0 8px; }
.a-legal .muted { color: var(--ink-2); font-size: 0.875rem; }
.a-legal .lede { color: var(--ink-2); font-size: 1.0625rem; }
.a-legal p, .a-legal li, .a-legal dd { line-height: 1.5; overflow-wrap: anywhere; }
.a-legal .legal-list { margin: 0; }
.a-legal .legal-list > div { padding: 12px 0; border-top: 1px solid var(--rule); }
.a-legal dt { font-weight: 700; margin-bottom: 4px; }
.a-legal dd { margin: 0; }
.a-legal a { color: var(--ink); font-weight: 700; }
.a-vin[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.a-car-form .a-btn-wide { margin-top: 16px; }
.a-vin { text-transform: uppercase; letter-spacing: .04em; }
.a-vin::placeholder { text-transform: none; letter-spacing: 0; }
.a-car-note p:last-child { margin-bottom: 0; }
.a-car-note a, .a-alert a, .a-similar a { font-weight: 700; }
.a-similar { margin-top: 12px; }
.a-similar .a-plain a { display: inline-flex; align-items: center; min-height: 40px; }
.a-cars { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.a-car.is-warning { border-left: 6px solid var(--danger-line); }
.a-advisory { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--danger); color: #fff; }
.a-advisory b { display: block; font: 700 1.3rem/1.2 var(--display); margin-bottom: 4px; }
.a-car-head { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
.a-car-title { font: 700 1.125rem/1.3 var(--text); margin: 2px 0 6px; overflow-wrap: anywhere; }
.a-car-facts { margin: 8px 0 0; }
.a-car-facts > div { padding: 12px 0; border-top: 1px solid var(--rule); }
.a-car-facts dt { font-weight: 700; margin-bottom: 4px; }
.a-car-facts dd { margin: 0; overflow-wrap: anywhere; }
.a-car-about { margin-top: 24px; }
@media (min-width: 600px) {
  .a-car-fields { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .a-car-head { grid-template-columns: 74px minmax(0, 1fr); gap: 10px; }
  .a-car-vin .a-search-row { flex-wrap: wrap; }
  .a-car-vin .a-search-row .a-input, .a-car-vin .a-search-row .a-btn { flex: 1 0 100%; }
}

/* ---------- pages of latest recalls ---------- */
.a-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.a-pager .a-btn { min-width: 120px; }

/* ---------- footer ---------- */
.a-foot { padding: 20px 0 calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.875rem; }
.a-foot p { margin: 0 0 8px; max-width: 46em; }
.a-foot nav { display: flex; gap: 8px 20px; }
.a-foot nav a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; color: var(--ink); }

/* ---------- the barcode scanner: full screen over everything ---------- */
.a-scanning { overflow: hidden; }
.a-scan { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; overflow: hidden; }
.a-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.a-scan-guide { position: absolute; left: 50%; top: 46%; width: min(78vw, 78vh, 440px); aspect-ratio: 1.6; transform: translate(-50%, -50%);
                border: 3px solid #fff; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.a-scan-guide::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: rgba(255, 255, 255, .8); }
.a-scan-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
              padding: calc(12px + env(safe-area-inset-top)) var(--gutter-r) 12px var(--gutter-l); }
.a-scan-top p { margin: 12px 0 0; font: 700 1.25rem/1.25 var(--display); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.a-scan-close { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer;
                display: inline-flex; align-items: center; justify-content: center; }
.a-scan-close svg { width: 22px; height: 22px; }
.a-scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
                 padding: 12px var(--gutter-r) calc(20px + env(safe-area-inset-bottom)) var(--gutter-l); }
.a-scan-bottom button { background: rgba(0, 0, 0, .55); color: #fff; border-color: #fff; max-width: 100%; }
.a-scan:focus-visible, .a-scan button:focus-visible { outline-color: #FFFFFF; }

/* ---------- wider screens: a foldable's inner screen, tablets, phones in landscape ---------- */
@media (min-width: 600px) {
  .a-main { padding-top: 28px; }
  /* the left column never gets narrower than a 320px phone's (300 + 28 + 240 still fits at 600px) */
  .a-home { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .a-home .a-latest { margin-top: 0; }
  .a-home .a-latest .a-h2 { margin-top: 6px; }
}
/* two columns on a narrow inner screen (a Fold opened, a 7-inch tablet, a split window): the search and weekly
   email boxes take the column's whole width, with their button underneath, instead of a cramped field */
@media (min-width: 600px) and (max-width: 779px) {
  .a-home .a-search-row { flex-wrap: wrap; }
  .a-home .a-search-row .a-input, .a-home .a-search-row .a-btn { flex: 1 0 100%; }
}
@media (min-width: 900px) {
  .a-home { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 40px; }
}
/* landscape phones are wide but short: keep the band and headings compact */
@media (max-height: 500px) and (orientation: landscape) {
  .a-bar-in { min-height: 48px; }
  .a-main { padding-top: 14px; }
  .a-h1 { font-size: 1.9rem; }
  .a-scan-top p { font-size: 1.05rem; margin-top: 6px; }
  .a-scan-guide { top: 50%; }
}
/* the narrowest phones (a folded cover screen, small Androids): a little tighter */
@media (max-width: 360px) {
  .a-logo { font-size: 1.3rem; gap: 8px; }
  .a-row { grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
  .a-sev { padding: 5px 7px; font-size: 0.875rem; }
  .a-btn { padding: 0 16px; }
  .a-card { padding: 14px; }
}

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