/*
 * Baseline layout stylesheet for very old car head-unit WebViews
 * (Chromium 40-60). Those engines cannot parse most of the modern
 * Tailwind v4 output (oklch(), @property, color-mix(), :where(), @layer),
 * so they end up rendering the page almost unstyled: default blue
 * underlined links, full-size icons and no grid.
 *
 * Everything below is written in plain, pre-2016 CSS with literal color
 * values (no custom properties, no grid, no flex gap) and is scoped to
 * .legacy-webview so modern browsers never see it.
 */

.legacy-webview,
.legacy-webview body {
  background: #16181c;
  color: #f7f5f0;
  font-family: Barlow, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.legacy-webview * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  max-width: 100%;
}

.legacy-webview a,
.legacy-webview a:visited {
  color: #f7f5f0;
  text-decoration: none;
}

.legacy-webview img,
.legacy-webview svg {
  max-width: 100%;
  height: auto;
}

/* App icon boxes carry inline width/height; keep the image inside them. */
.legacy-webview img[alt$="icon"] {
  width: 100%;
  height: 100%;
  display: block;
}

.legacy-webview h1,
.legacy-webview h2,
.legacy-webview h3 {
  font-family: "Bebas Neue", Barlow, Arial, sans-serif;
  font-weight: normal;
  margin: 0 0 8px;
}

/* --- Card grids: no CSS grid / flex gap support, use inline-block --- */
.legacy-webview [class*="grid"] {
  display: block;
  font-size: 0; /* kill inline-block whitespace */
}

.legacy-webview [class*="grid"] > * {
  display: inline-block;
  vertical-align: top;
  width: 48%;
  margin: 0 1% 12px;
  font-size: 12px;
  background: #201e1a;
  border: 1px solid #33302a;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

@media (min-width: 700px) {
  .legacy-webview [class*="grid"] > * { width: 31.3%; }
}
@media (min-width: 1000px) {
  .legacy-webview [class*="grid"] > * { width: 23%; }
}

/* Flex rows lose `gap`; give children breathing room instead. */
.legacy-webview [class*="flex"] > * {
  margin-right: 6px;
}
.legacy-webview [class*="flex-col"] > * {
  margin-right: 0;
  margin-bottom: 6px;
}

/* Buttons / install actions */
.legacy-webview button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  margin: 8px 0 0;
  border: 0;
  border-radius: 8px;
  background: #e04a2f;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}

.legacy-webview input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #444951;
  border-radius: 8px;
  background: #2b2e34;
  color: #f7f5f0;
  font-size: 13px;
}

/* Decorative overlays that can't render correctly here */
.legacy-webview [aria-hidden="true"] {
  display: none;
}

.legacy-webview [class*="fixed"] {
  position: static;
}
