:root {
  --ink: #0b1b2a;
  --muted: #657582;
  --paper: #f4f7f9;
  --panel: #ffffff;
  --line: #dce5ec;
  --green: #0877c9;
  --green-soft: #eaf6ff;
  --orange: #eb5b1f;
  --orange-soft: #fff1ea;
  --shadow: 0 22px 60px rgba(11, 27, 42, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(8,119,201,.12), transparent 28rem),
    linear-gradient(180deg, #ffffff, var(--paper));
  font-family: "Fira Sans", sans-serif;
  min-height: 100vh;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  border-bottom: 3px solid var(--orange);
  background: rgba(11, 27, 42, .97);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: baseline; gap: 12px; color: white; text-decoration: none; }
.brand strong { font: 800 25px "Poppins", sans-serif; letter-spacing: -.055em; }
.brand span { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.28); color: #9fd6ff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.market-switch { display: flex; gap: 5px; background: rgba(255,255,255,.10); padding: 4px; border-radius: 12px; }
.market {
  border: 0;
  border-radius: 9px;
  padding: 8px 13px;
  color: #c8d7e3;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}
.market.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(0,0,0,.16); }

main { max-width: 1240px; margin: 0 auto; padding: 62px 28px 72px; }
.hero { max-width: 850px; margin-bottom: 45px; }
.eyebrow { color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .15em; margin-bottom: 15px; }
h1, h2, h3 { font-family: "Poppins", sans-serif; }
h1 { margin: 0; font-size: clamp(44px, 6vw, 72px); letter-spacing: -.055em; line-height: .98; }
h1 em { color: var(--green); font-style: normal; }
.hero > p { max-width: 690px; color: var(--muted); font-size: 18px; line-height: 1.65; margin: 23px 0; }
.trust-row { display: flex; gap: 12px; flex-wrap: wrap; }
.trust-row span { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px; font-size: 12px; font-weight: 600; }

.workspace { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(480px, 1.35fr); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.vehicle-panel, .search-panel { padding: 34px; }
.vehicle-panel { border-right: 1px solid var(--line); background: #f8fbfd; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.panel-heading > div { display: flex; gap: 12px; align-items: center; }
.step { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--green); border-radius: 50%; font-size: 12px; font-weight: 700; }
h2 { font-size: 22px; margin: 0; letter-spacing: -.025em; }
.text-button { border: 0; color: var(--green); background: transparent; font-size: 13px; font-weight: 700; padding: 7px 0; }
label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 13px; font-weight: 700; }
.upload-zone { margin-bottom: 14px; }
.upload-button {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 15px;
  border: 1px dashed #7daed0;
  border-radius: 13px;
  color: var(--ink);
  background: #f3f7f3;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-button:hover { border-color: var(--green); background: var(--green-soft); }
.upload-button .upload-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; background: var(--green); font-size: 21px; }
.upload-button strong, .upload-button small { display: block; }
.upload-button strong { font-size: 13px; }
.upload-button small { color: var(--muted); margin-top: 2px; font-weight: 500; }
.upload-privacy { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 600; line-height: 1.35; }
.upload-button small kbd { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; font: 600 10px "Fira Sans", sans-serif; color: var(--ink); }
.upload-button.paste-ready { border-color: var(--green); background: var(--green-soft); }
.upload-status { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 11px; }
.upload-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-ticker { display: flex; align-items: center; gap: 8px; min-height: 28px; margin: 7px 2px 0; padding: 5px 8px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow: hidden; }
.ticker-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(229,110,54,.12); }
#feature-ticker-text { opacity: 1; transform: translateY(0); transition: opacity .38s ease, transform .38s ease; }
#feature-ticker-text.leaving { opacity: 0; transform: translateY(-5px); }
#feature-ticker-text.entering { opacity: 0; transform: translateY(5px); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  #feature-ticker-text { transition: none; }
}
.ocr-loader { position: relative; display: inline-block; width: 20px; height: 20px; overflow: visible !important; flex: 0 0 auto; }
.ocr-loader.done { animation: none !important; }
.ocr-loader.done::before, .ocr-loader.done::after { display: none !important; }
.ocr-loader.done { width: 20px; height: 20px; border-radius: 50%; background: var(--green); }
.ocr-loader.done::marker { display: none; }
.ocr-loader.done { box-shadow: inset 0 0 0 6px var(--green); }

/* Randomized lightweight patterns inspired by cssloaders.github.io */
.loader-ring { border: 3px solid rgba(8,119,201,.18); border-top-color: var(--green); border-radius: 50%; animation: loader-spin .75s linear infinite; }
.loader-dots::before, .loader-dots::after { content: ""; position: absolute; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: loader-dots .8s ease-in-out infinite alternate; }
.loader-dots::before { left: 0; }
.loader-dots::after { right: 0; animation-delay: .4s; }
.loader-pulse { border-radius: 50%; background: var(--green); animation: loader-pulse .85s ease-in-out infinite; }
.loader-bars { border-radius: 2px; background: var(--green); animation: loader-bars .75s ease-in-out infinite; transform-origin: center; }
.loader-bars::before, .loader-bars::after { content: ""; position: absolute; top: 0; width: 5px; height: 20px; border-radius: 2px; background: var(--green); animation: loader-bars .75s ease-in-out infinite; }
.loader-bars { width: 5px; margin-left: 8px; }
.loader-bars::before { left: -8px; animation-delay: -.2s; }
.loader-bars::after { right: -8px; animation-delay: .2s; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-dots { from { transform: translateY(-4px); opacity: .35; } to { transform: translateY(4px); opacity: 1; } }
@keyframes loader-pulse { 0%, 100% { transform: scale(.55); opacity: .35; } 50% { transform: scale(1); opacity: 1; } }
@keyframes loader-bars { 0%, 100% { transform: scaleY(.4); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }
textarea, .component-search {
  width: 100%;
  border: 1px solid #cbd2cb;
  border-radius: 13px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 185px; padding: 16px; line-height: 1.55; font-size: 14px; }
textarea:focus, .component-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,119,201,.12); }
.manual-entry-divider { display: flex; align-items: center; gap: 10px; margin: 17px 0 14px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.manual-entry-divider::before, .manual-entry-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.manual-entry-divider span { max-width: 72%; }
.vehicle-entry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.vehicle-entry-form label { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.vehicle-entry-form input { width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #cbd2cb; border-radius: 9px; outline: 0; color: var(--ink); background: white; font-size: 12px; letter-spacing: 0; text-transform: none; }
.vehicle-entry-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,119,201,.10); }
.vehicle-entry-form .field-wide { grid-column: 1 / -1; }
.raw-ocr-panel { margin-top: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f7f7f2; }
.raw-ocr-panel summary { padding: 10px 12px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.raw-ocr-panel textarea { min-height: 145px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.matching-safety-notice { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--orange); border-radius: 0 8px 8px 0; color: #74503d; background: var(--orange-soft); font-size: 11px; line-height: 1.5; }
.matching-safety-notice strong { color: #9a461f; }
.input-actions { display: flex; gap: 9px; margin-top: 13px; }
.primary-button, .secondary-button, .component-search button, .copy-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 700;
}
.primary-button { color: white; background: var(--green); flex: 1; }
.primary-button span { float: right; }
.secondary-button { color: var(--ink); background: #eceee9; }

.vehicle-card { margin-top: 24px; padding: 20px; border: 1px solid #cbdacf; border-radius: 15px; background: var(--green-soft); }
.vehicle-card.needs-review { border-color: #e7b383; background: var(--orange-soft); }
.vehicle-card.needs-review .match-line { color: #9a461f; }
.vehicle-card.needs-review .status-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(229,110,54,.14); }
.match-line { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.match-line strong { margin-left: auto; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #20a268; box-shadow: 0 0 0 4px rgba(32,162,104,.13); }
.vehicle-card h3 { font-size: 22px; margin: 16px 0 3px; }
.vehicle-card > p { margin: 0; color: var(--muted); font-size: 13px; }
.vehicle-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 19px 0 15px; }
.vehicle-card dl div { border-top: 1px solid rgba(8,119,201,.18); padding-top: 8px; }
.vehicle-card dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.vehicle-card dd { margin: 3px 0 0; font-size: 13px; font-weight: 700; }
.vehicle-card .profile-note { padding-top: 12px; border-top: 1px solid rgba(8,119,201,.18); font-size: 11px; line-height: 1.5; }
.review-panel { margin-top: 16px; padding-top: 15px; border-top: 1px solid rgba(154,70,31,.2); }
.review-panel > strong { font-size: 13px; }
.review-panel > p { margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.review-panel .primary-button { width: 100%; background: #9a461f; }

.market-badge { border: 1px solid #b8c8be; border-radius: 99px; padding: 6px 10px; color: var(--green); font-size: 11px; font-weight: 700; }
.component-search { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; padding: 6px; }
.component-search > span { color: var(--muted); font-size: 22px; text-align: center; }
.component-search input { border: 0; outline: 0; min-width: 0; padding: 10px 7px; background: transparent; }
.component-search button { color: white; background: var(--orange); }
.quick-searches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 11px; color: var(--muted); font-size: 11px; }
.quick-searches button { border: 0; padding: 5px 9px; border-radius: 99px; color: var(--muted); background: #efeee8; font-size: 11px; }

.empty-state { min-height: 390px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: #eeeee8; color: var(--green); font-size: 30px; }
.empty-state h3 { color: var(--ink); margin: 0 0 7px; font-size: 17px; }
.empty-state p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.5; }

.results { margin-top: 28px; }
.results-summary { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.result-kicker, .part-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.results-summary h3 { margin: 3px 0 0; font-size: 22px; }
.confidence { display: flex; gap: 7px; align-items: center; color: var(--green); font-size: 12px; font-weight: 700; }
.confidence span { width: 8px; height: 8px; background: #20a268; border-radius: 50%; }
.part-hero { display: flex; align-items: center; justify-content: space-between; padding: 19px 20px; color: white; background: var(--green); border-radius: 14px; }
.part-hero .part-label { display: block; color: #b9d0c4; margin-bottom: 4px; }
.part-hero strong { font: 700 29px "Poppins"; letter-spacing: .02em; }
.copy-button { background: rgba(255,255,255,.14); color: white; }
.cross-reference-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 11px 0; }
.part-card { position: relative; padding: 14px 38px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.part-card span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.part-card strong { display: block; margin-top: 5px; font: 700 16px "Poppins"; }
.part-card small { display: block; color: var(--muted); margin-top: 4px; font-size: 10px; }
.google-part-link { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line); border-radius: 50%; background: #fff; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.google-part-link:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(20,38,30,.15); }
.google-part-link span { font-size: 12px; font-family: Arial, sans-serif; letter-spacing: 0; }
.google-part-link b { color: transparent; background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 25% 43%, #fbbc05 43% 64%, #ea4335 64% 82%, #4285f4 82%); background-clip: text; -webkit-background-clip: text; font-weight: 800; }
.fitment-box, .warning-box { border-radius: 13px; padding: 16px; margin-top: 11px; }
.fitment-box { display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--green-soft); }
.fitment-box > div { display: flex; gap: 11px; }
.fitment-icon { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--green); }
.fitment-box strong, .warning-box strong { font-size: 13px; }
.fitment-box p, .warning-box p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.fitment-box .secondary-button { white-space: nowrap; }
.warning-box { border: 1px solid #f0c9aa; background: var(--orange-soft); }
.warning-box strong { color: #a5461e; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 9px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

.oz-products { margin-top: 28px; padding: 30px 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.oz-products .panel-heading { margin-bottom: 12px; }
.oz-products .panel-heading a { text-decoration: none; white-space: nowrap; }
.oz-products-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.oz-roof-switch { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.oz-roof-switch button { border: 1px solid var(--line); border-radius: 99px; padding: 7px 13px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 600; }
.oz-roof-switch button small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.oz-roof-switch button[aria-selected="true"] { color: white; background: var(--green); border-color: var(--green); }
.oz-roof-switch button[aria-selected="true"] small { color: #cfe8fb; }
.oz-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.oz-product { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); background: white; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.oz-product:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,27,42,.12); }
.oz-product img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f6f9fb; }
.oz-product div { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px 13px; }
.oz-product span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.oz-product strong { font-size: 13px; line-height: 1.35; }
.oz-product em { color: var(--orange); font-style: normal; font-size: 13px; font-weight: 700; }
.oz-product em small { color: var(--muted); font-weight: 500; }
.oz-products-empty { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }

.jdm-card { margin-top: 28px; padding: 28px 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.jdm-card h2 { margin-bottom: 16px; }
.jdm-table-wrap { overflow-x: auto; }
.jdm-stats table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jdm-stats th, .jdm-stats td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.jdm-stats th[scope="row"], .jdm-stats thead th:first-child { text-align: left; white-space: normal; }
.jdm-stats thead th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.jdm-stats th[scope="row"] { font-weight: 600; }
.jdm-stats td { font-variant-numeric: tabular-nums; font-weight: 600; }
.jdm-stats tbody tr:last-child th, .jdm-stats tbody tr:last-child td { border-bottom: 0; }

.jdm-recent-empty { margin: 0; color: var(--muted); font-size: 13px; }
.jdm-recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.jdm-recent-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.jdm-recent-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11,27,42,.12); }
.jdm-recent-card img, .jdm-thumb-blank { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #eef3f7; }
.jdm-thumb-blank { display: block; border: 1px dashed var(--line); }
.jdm-recent-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jdm-recent-body strong { font-size: 13px; line-height: 1.3; }
.jdm-recent-year { color: var(--muted); font-size: 12px; font-weight: 600; }
.jdm-recent-part { font-size: 12px; overflow-wrap: anywhere; }
.jdm-recent-part small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.jdm-found { color: #20a268; font-weight: 700; }
.jdm-recent-body time { color: var(--muted); font-size: 11px; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .vehicle-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  h1 { font-size: 46px; }
}

@media (max-width: 560px) {
  .site-header { height: auto; padding: 15px 18px; align-items: flex-start; gap: 15px; }
  .market-switch { overflow-x: auto; }
  .market { padding: 7px 9px; }
  main { padding: 42px 15px; }
  .vehicle-panel, .search-panel { padding: 23px 18px; }
  .cross-reference-grid { grid-template-columns: 1fr; }
  .oz-products, .jdm-card { padding: 23px 18px; }
  .jdm-stats th, .jdm-stats td { padding: 8px 6px; }
  .oz-products .panel-heading { flex-direction: column; gap: 8px; }
  .oz-products-grid { grid-template-columns: repeat(2, 1fr); }
  .fitment-box { align-items: flex-start; flex-direction: column; }
  .vehicle-entry-form { grid-template-columns: 1fr; }
  .vehicle-entry-form .field-wide { grid-column: auto; }
}
