/* The header control (garage.js, [data-garage="nav"]) and the vehicle picker
   dialog (garage-picker.js). Linked by the pages that use styles.css and by the
   homepage, which uses home.css; the two do not define the same variables, so
   every var() here carries its own fallback. */

.garageNav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.garageNavText {
  max-width: min(32ch, 60vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 2px solid var(--orange, #c83a1c);
  padding: 5px 0 3px;
}
.garageNav:hover .garageNavText { color: var(--orange, #c83a1c); }
.garageNav:focus-visible { outline: 2px solid var(--orange, #c83a1c); outline-offset: 3px; }
.garageNavChevron { font-size: 0.8em; }

/* The mount sits last in each page's own nav (.previewNav, or .mainNav on the
   homepage). Those navs were laid out for links alone: on a phone they spread
   one row of links edge to edge, so there the control takes a row of its own
   rather than pushing the page sideways. */
.garageNavMount { display: flex; align-items: center; min-width: 0; }
.garageNavMount:empty { display: none; }
@media (max-width: 900px) {
  .previewNav .garageNav,
  .mainNav .garageNav { font-size: 14px; }
}
@media (max-width: 700px) {
  .previewNav:has(.garageNavMount),
  .mainNav:has(.garageNavMount) { flex-wrap: wrap; row-gap: 2px; }
  .previewNav .garageNavMount,
  .mainNav .garageNavMount { flex-basis: 100%; }
}

.garagePicker {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--ink, #131918);
  background: var(--paper, #faf8f1);
  color: var(--ink, #131918);
  overflow: auto;
}
.garagePicker::backdrop { background: rgba(17, 17, 15, 0.55); }
.garagePicker [hidden] { display: none !important; }

.gpBody {
  padding: 18px 20px 22px;
  font-family: var(--ag-mono, var(--mono, "IBM Plex Mono", "Courier New", Courier, monospace));
  font-size: 14px;
  line-height: 1.45;
}
.gpHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.gpTitle {
  margin: 0;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gpClose {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--ink, #131918);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.gpClose:hover { border-color: var(--orange, #c83a1c); color: var(--orange, #c83a1c); }

.gpHeading {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gpSaved { margin-bottom: 18px; }
.gpSavedList { list-style: none; margin: 0; padding: 0; }
.gpSavedList li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line, #aeb2ad);
}
.gpSavedList label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  cursor: pointer;
}
.gpSavedList input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--orange, #c83a1c); }
.gpRemove {
  flex-shrink: 0;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--ink, #131918);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.gpRemove:hover { border-color: var(--orange, #c83a1c); color: var(--orange, #c83a1c); }

.gpTabs {
  display: flex;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ink, #131918);
}
.gpTab {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--ink, #131918);
  border-bottom: 0;
  background: var(--ink, #131918);
  color: var(--paper, #faf8f1);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.gpTab + .gpTab { margin-left: 6px; }
.gpTab[aria-selected="false"] {
  background: transparent;
  color: var(--ink, #131918);
  border-color: var(--line, #aeb2ad);
}
.gpTab[aria-selected="false"]:hover { color: var(--orange, #c83a1c); border-color: var(--orange, #c83a1c); }
.gpTab:focus-visible { outline: 2px solid var(--orange, #c83a1c); outline-offset: 2px; }

.gpField { display: grid; gap: 4px; margin-bottom: 12px; }
.gpField > span { font-weight: 700; }
.gpField small { font-weight: 400; color: var(--muted, #596163); }
.gpField select,
.gpField input {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--line, #aeb2ad);
  background: #fff;
  color: var(--ink, #131918);
  font: inherit;
}
.gpField select:disabled { opacity: 0.55; }
.gpField select:focus-visible,
.gpField input:focus-visible { outline: 2px solid var(--orange, #c83a1c); outline-offset: 1px; }
.gpVin { box-sizing: border-box; letter-spacing: 0.08em; text-transform: uppercase; }
.gpNote { margin: 0 0 12px; color: var(--muted, #596163); }
.gpDecoded {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--ink, #131918);
  background: rgba(19, 25, 24, 0.05);
}

.gpHints p {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--orange, #c83a1c);
  background: rgba(200, 58, 28, 0.07);
}

.gpResult {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line, #aeb2ad);
  background: #fff;
}
.gpVehicle { margin: 0; font-weight: 700; }
.gpCoverage { margin: 2px 0 0; color: var(--muted, #596163); }
.gpStatus { margin: 0 0 12px; color: var(--orange, #c83a1c); }
.gpStatus:empty { display: none; }

.gpAdd {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ink, #131918);
  background: var(--ink, #131918);
  color: var(--paper, #faf8f1);
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.gpAdd:hover:not(:disabled) { background: var(--orange, #c83a1c); border-color: var(--orange, #c83a1c); }
.gpAdd:disabled {
  background: transparent;
  color: var(--muted, #596163);
  border-color: var(--line, #aeb2ad);
  cursor: not-allowed;
}
