/* Navigator: a compact, touch-friendly owner and parts workspace. */
:root {
  color-scheme: light;
  --ink: #181a18;
  --muted: #65685f;
  --canvas: #f5f4ef;
  --paper: #fff;
  --line: #dfdfd6;
  --accent: #f6a05a;
  --accent-hover: #f8b578;
  --accent-soft: #ffecd9;
  --focus: #96501c;
  --radius: 16px;
  --bottom-space: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; background: var(--canvas); scroll-padding-top: 110px; }
body { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: default; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); }
h1[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.16; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 720; }
h2 { font-size: 22px; font-weight: 680; }
h3 { font-size: 19px; font-weight: 680; }
small { font-size: 12px; font-weight: 400; }

.top {
  position: sticky;
  z-index: 20;
  top: 0;
  background: #fdfcf9;
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1280px;
  min-height: 88px;
  margin: 0 auto;
  padding: 10px 32px;
}
.brand { flex: 0 0 auto; display: block; border-radius: 6px; }
.brand img { width: 118px; height: 62px; object-fit: contain; }
.location { color: var(--muted); font-size: 13px; }
.install {
  min-height: 42px;
  margin-left: auto;
  padding: 9px 17px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}
.tabs {
  position: sticky;
  top: 120px;
  display: grid;
  gap: 8px;
}
.tabs a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #55594f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.tabs svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabs a.active, .tabs a[aria-current="page"], .tabs a[aria-current="true"], .tabs a[aria-selected="true"] {
  color: #fff;
  background: var(--ink);
}
.tabs a.active svg, .tabs a[aria-current="page"] svg, .tabs a[aria-current="true"] svg, .tabs a[aria-selected="true"] svg { color: var(--accent); }
main, main > section { min-width: 0; }
main > section { scroll-margin-top: 115px; }
.intro { max-width: 660px; margin: 12px 0 28px; color: var(--muted); }

.primary, .secondary, .device-actions button, .device-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.primary { color: var(--ink); background: var(--accent); }
.secondary, .device-actions button, .device-actions a { color: var(--ink); border-color: #cdd0c6; background: var(--paper); }
.primary:disabled, .secondary:disabled { color: #76766f; background: #e7e6df; border-color: #e0dfd6; }

.garage-hero {
  position: relative;
  isolation: isolate;
  min-height: 326px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  background: var(--ink);
}
.garage-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 59%;
  content: "";
  background: url("./assets/ride.webp") center 48% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 26%);
  mask-image: linear-gradient(to right, transparent, #000 26%);
}
.hero-copy {
  position: relative;
  width: 56%;
  max-width: 520px;
  padding: 38px 28px 38px 36px;
}
.hero-copy h1 { font-size: clamp(32px, 3.1vw, 43px); }
.hero-copy p { margin: 17px 0 26px; color: #e3e5dc; font-size: 16px; line-height: 1.55; }
.hero-copy .primary { box-shadow: 0 1px 0 #0002; }
.garage-hero :focus-visible { outline-color: var(--accent); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.quick {
  position: relative;
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 126px;
  padding: 24px 48px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
}
.quick strong { font-size: 17px; font-weight: 670; line-height: 1.3; }
.quick > span:not(.arrow) { color: var(--muted); font-size: 13px; }
.quick .arrow { position: absolute; top: 24px; right: 21px; font-size: 24px; line-height: 1; }

.panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.form-grid > div, .field { min-width: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 620; line-height: 1.35; }
label small { margin-left: 5px; color: var(--muted); }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 49px;
  padding: 12px 13px;
  border: 1px solid #bfc2b8;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  line-height: 1.45;
}
select { padding-right: 28px; text-overflow: ellipsis; }
input::placeholder, textarea::placeholder { color: #6b6e65; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { color: #777a71; background: #f4f4ef; border-color: var(--line); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
textarea { min-height: 126px; resize: vertical; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
.subtle { margin: 13px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.notice { margin-bottom: 24px; padding: 16px 18px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); }
.notice a { font-weight: 650; }

.garage-list { display: grid; gap: 16px; }
.garage-list:not(:empty) { margin-top: 24px; }
.device-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.device-info { min-width: 0; flex: 1 1 0; }
.device-info h2, .device-info h3 { margin: 8px 0; font-size: 21px; }
.device-info p { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.device-info > img { max-width: 180px; max-height: 120px; object-fit: contain; }
.device-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 5px; color: #6a421f; background: var(--accent-soft); font-size: 11px; font-weight: 650; line-height: 1.3; letter-spacing: .025em; }
.device-actions { flex: 0 1 230px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.device-actions button, .device-actions a { min-height: 42px; padding: 9px 12px; font-size: 12px; }
.device-actions .primary { border-color: transparent; background: var(--accent); }
.device-actions .quiet { border-color: transparent; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.device-actions .danger, .device-actions [data-action="delete"], .device-actions [data-action="remove"] { color: #9c302a; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 14px; font-size: 13px; }
.result-head p { color: var(--muted); }
.result-head a { font-weight: 600; }
.result-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.part-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow-wrap: anywhere; }
.part-card + .part-card { margin-top: 12px; }
.result-list > .part-card + .part-card { margin-top: 0; }
.part-card h2, .part-card h3 { margin: 4px 0 10px; font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: -.01em; }
.part-card > strong, .part-card code, .part-card .sku, .part-card .part-sku { display: inline-block; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.part-card p { margin: 7px 0; }
.part-card > a { display: inline-block; min-height: 36px; margin-top: 6px; padding: 7px 0; font-size: 13px; font-weight: 600; }
.part-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.part-meta strong { color: var(--ink); font-weight: 650; }
.part-meta > * { min-width: 0; }
.part-card .subtle { font-size: 12px; }
.empty { padding: 32px 24px; border: 1px dashed #c8cbbf; border-radius: var(--radius); background: #fafaf6; color: var(--muted); text-align: center; }
.empty h2, .empty h3, .empty strong { color: var(--ink); }
.empty p + p { margin-top: 8px; }
#more-parts { display: flex; margin: 24px auto 0; min-width: 190px; }
#retry-parts { margin: 8px 0 20px; }
.service-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: start; gap: 20px; }
.contact { display: grid; gap: 16px; padding: 24px 20px; }
.contact h2 { font-size: 18px; }
.contact a { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.contact a[href^="tel:"] { font-size: 16px; font-weight: 650; text-decoration: none; }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 42px; padding: 22px 0 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer a { margin-left: auto; }

dialog {
  width: min(540px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 28px;
  border: 1px solid #e0e0d8;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 96px #0003;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #10150fd1; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.dialog-head h2 { font-size: 25px; }
.close { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: #f0f1eb; font-size: 27px; font-weight: 400; line-height: 1; }
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.dialog-actions > a:last-child { grid-column: 1 / -1; justify-self: center; padding: 8px 0; font-size: 14px; }
#request-preview { min-height: 190px; background: #f7f7f2; font-size: 14px; line-height: 1.65; }
#request-status:not(:empty) { margin-top: 16px; font-size: 14px; font-weight: 600; }
#install-dialog p + p { margin-top: 16px; }
.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 (hover: hover) {
  a:hover { text-decoration-thickness: 2px; }
  .primary:hover { background: var(--accent-hover); }
  .secondary:hover, .device-actions button:hover, .device-actions a:hover, .install:hover { background: #f0f1e9; }
  .device-actions .primary:hover { background: var(--accent-hover); }
  .quick:hover { border-color: #b9bdb0; background: #fdfdf9; }
  .tabs a:not(.active):not([aria-current]):not([aria-selected="true"]):hover { background: #eaece3; color: var(--ink); }
  .close:hover { background: #e3e6dc; }
}

@media (max-width: 1050px) {
  .layout { grid-template-columns: 174px minmax(0, 1fr); gap: 24px; padding: 28px 24px; }
  .top-inner { padding-right: 24px; padding-left: 24px; }
  .tabs a { padding: 12px; gap: 10px; font-size: 13px; }
  .hero-copy { width: 60%; padding: 32px 22px 32px 28px; }
  .hero-copy p { font-size: 15px; }
  .garage-hero::before { width: 56%; background-position: 55% center; }
  .quick-grid { gap: 12px; }
  .quick { padding: 22px 40px 22px 20px; }
  .quick strong { font-size: 15px; }
  .quick .arrow { right: 15px; }
  .service-layout { grid-template-columns: minmax(0, 1fr); }
  .contact { grid-template-columns: 1fr auto; align-items: center; }
  .contact h2 { grid-column: 1 / -1; }
  .device-card { align-items: flex-start; flex-direction: column; gap: 16px; }
  .device-actions { flex-basis: auto; justify-content: flex-start; }
}

@media (max-width: 760px) {
  :root { --bottom-space: calc(80px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: 88px; }
  body { padding-bottom: var(--bottom-space); }
  .top-inner { min-height: 76px; gap: 15px; padding: 7px 20px; }
  .brand img { width: 106px; height: 56px; }
  .location { font-size: 12px; }
  .install { min-height: 38px; padding: 8px 12px; font-size: 12px; }
  .layout { display: block; max-width: 650px; padding: 24px 20px 20px; }
  .tabs {
    position: fixed;
    z-index: 30;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 7px max(12px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #dbddd3;
    background: #fdfdf9;
    box-shadow: 0 -3px 20px #18201808;
  }
  .tabs a { flex-direction: column; justify-content: center; gap: 5px; min-height: 58px; padding: 7px 2px; border-radius: 10px; font-size: 11px; font-weight: 650; line-height: 1.1; text-align: center; }
  .tabs svg { flex-basis: 22px; width: 22px; height: 22px; }
  .tabs a.active, .tabs a[aria-current="page"], .tabs a[aria-current="true"], .tabs a[aria-selected="true"] { color: var(--ink); background: var(--accent-soft); }
  .tabs a.active svg, .tabs a[aria-current="page"] svg, .tabs a[aria-current="true"] svg, .tabs a[aria-selected="true"] svg { color: #9a4c13; }
  main > section { scroll-margin-top: 96px; }
  h1 { font-size: 32px; }
  .intro { margin-bottom: 22px; font-size: 15px; }
  .garage-hero { min-height: 0; border-radius: 16px; }
  .garage-hero::before { position: relative; z-index: 0; display: block; width: 100%; height: 200px; background-position: center 45%; -webkit-mask-image: none; mask-image: none; }
  .hero-copy { width: 100%; max-width: none; padding: 26px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-copy p { max-width: 420px; margin: 13px 0 23px; font-size: 15px; }
  .quick-grid { margin-top: 16px; }
  .quick { align-content: start; min-height: 142px; padding: 19px 16px 40px; }
  .quick strong { font-size: 15px; }
  .quick > span:not(.arrow) { font-size: 12px; }
  .quick .arrow { top: auto; right: 16px; bottom: 15px; font-size: 22px; }
  .panel { padding: 22px; border-radius: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .field { margin-bottom: 20px; }
  .result-head { gap: 9px; margin-top: 20px; }
  .part-card { padding: 18px; }
  .part-card h2, .part-card h3 { font-size: 16px; }
  .part-meta { gap: 6px 12px; font-size: 12px; }
  .device-card { padding: 22px; }
  .device-actions { gap: 8px; width: 100%; }
  .device-actions a, .device-actions button { min-height: 44px; }
  .contact { gap: 12px; }
  footer { margin-top: 32px; padding-bottom: 12px; }
  dialog { width: calc(100vw - 28px); max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding: 24px; border-radius: 16px; }
  .dialog-head { gap: 10px; margin-bottom: 22px; }
  .dialog-head h2 { font-size: 23px; }
}

@media (max-width: 380px) {
  .top-inner { gap: 10px; padding-inline: 16px; }
  .brand img { width: 94px; height: 50px; }
  .location { font-size: 11px; }
  .install { min-height: 36px; padding: 7px 10px; font-size: 11px; }
  .layout { padding: 20px 16px 16px; }
  h1 { font-size: 29px; }
  .garage-hero::before { height: 174px; }
  .hero-copy { padding: 22px; }
  .hero-copy h1 { font-size: 30px; }
  .hero-copy .primary { width: 100%; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .quick { min-height: 99px; padding: 18px 48px 18px 20px; }
  .quick .arrow { top: 20px; bottom: auto; right: 19px; }
  .panel, .device-card, .part-card { padding: 18px; }
  .device-info h2, .device-info h3 { font-size: 19px; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact h2 { grid-column: auto; }
  .dialog-actions { grid-template-columns: minmax(0, 1fr); }
  .dialog-actions > a:last-child { grid-column: auto; }
  dialog { padding: 20px; }
  .dialog-head h2 { font-size: 21px; }
  .dialog-head .close { flex-basis: 40px; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .tabs a[aria-current="page"], .tabs a.active, .primary { border: 2px solid ButtonText; }
  .garage-hero { border: 1px solid CanvasText; }
}
#parts-current {
  margin: 0.45rem 0 0;
  overflow-wrap: anywhere;
}

@media (min-width: 381px) {
  #parts-current {
    display: none;
  }
}
