:root {
  color-scheme: dark;
  --bg: #05070a;
  --bg-raised: #0b0f15;
  --card: rgba(255, 255, 255, 0.045);
  --card-strong: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f7f8fb;
  --muted: #8992a2;
  --dim: #5f6673;
  --accent: #5e6ad2;
  --accent-hot: #7170ff;
  --success: #22c55e;
  --gold: #d6a84f;
  --danger: #ef4444;
  --radius-xl: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 72% -12%, rgba(94, 106, 210, 0.32), transparent 34%),
    radial-gradient(circle at 0% 22%, rgba(28, 105, 212, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(172px + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #1c69d4, #0d2b63);
  color: white;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 35px rgba(28, 105, 212, 0.28);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-hot);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 25px; letter-spacing: -0.05em; line-height: 1; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -0.035em; }
h3 { margin-bottom: 4px; font-size: 14px; letter-spacing: -0.015em; }
p { color: var(--muted); line-height: 1.45; }

.status-pill {
  margin-left: auto;
  border: 1px solid rgba(214, 168, 79, 0.38);
  background: rgba(214, 168, 79, 0.12);
  color: #f5d38b;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill.active-premium {
  border-color: rgba(34,197,94,.42);
  background: rgba(34,197,94,.13);
  color: #86efac;
}
[hidden] { display: none !important; }

.search-card,
.panel,
.premium-card,
.metrics article {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.035));
  box-shadow: 0 18px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.06);
}

.search-card {
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 12px;
}

.search-copy { margin-bottom: 12px; }
.lookup-form { display: flex; gap: 10px; }
.lookup-form input {
  min-width: 0;
  flex: 1;
  height: 52px;
  border: 1px solid rgba(255,255,255,.08);
  outline: 0;
  border-radius: 16px;
  background: rgba(0,0,0,.24);
  color: var(--text);
  padding: 0 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.lookup-form input:focus { border-color: var(--accent-hot); box-shadow: 0 0 0 4px rgba(113,112,255,.14); }
.lookup-form button,
.premium-card button,
.support-button {
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  padding: 0 17px;
  font-weight: 800;
}

.examples { margin-top: 10px; color: var(--dim); font-size: 12px; }
code { color: #c6cbff; font-family: "JetBrains Mono", monospace; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.metrics article { border-radius: 18px; padding: 13px 12px; }
.metrics strong { display: block; font-size: 24px; line-height: 1; }
.metrics span { display: block; margin-top: 5px; color: var(--dim); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.preview-note {
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.panel { border-radius: 20px; padding: 14px; margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title button {
  border: 0;
  background: transparent;
  color: var(--accent-hot);
  font-size: 12px;
  font-weight: 700;
}
.panel-title span { color: var(--dim); font-size: 11px; }

.list { display: grid; gap: 8px; }
.list-item,
.vehicle-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.055);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 11px;
}
.list-item { transition: transform .18s ease, background .18s ease; }
.list-item:active { transform: scale(.985); }
.list-item p { margin-bottom: 0; font-size: 12px; }
.list-item .meta { margin-left: auto; color: var(--success); font-size: 11px; font-weight: 700; }
.compact .list-item:nth-child(n+3) { display: none; }

.empty-item {
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.plate,
.plate-large {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  background: #111722;
  color: white;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}
.plate { padding: 8px 9px; font-size: 12px; }
.plate-large { padding: 11px 12px; font-size: 15px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.detail-item {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 14px;
  background: rgba(0,0,0,.20);
  padding: 10px;
}
.detail-item span { display: block; color: var(--dim); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.detail-item strong { display: block; margin-top: 4px; color: var(--text); font-size: 13px; line-height: 1.28; overflow-wrap: anywhere; }
.result-list { display: grid; gap: 8px; margin-top: 12px; }
.result-count { margin: 0; color: var(--dim); font-size: 11px; text-align: center; }
.result-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  padding: 10px;
  text-align: left;
}
.result-card p { margin: 0; font-size: 12px; }
.button-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.button-grid button {
  min-height: 40px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
}
.button-grid button.danger {
  border-color: rgba(239,68,68,.28);
  background: rgba(239,68,68,.10);
  color: #fecaca;
}

.premium-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  border-color: rgba(214,168,79,.22);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 14px;
  background:
    linear-gradient(135deg, rgba(214,168,79,.14), transparent 45%),
    linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.035));
}
.premium-card p { margin-bottom: 0; font-size: 12px; }
.premium-card button { height: 44px; background: var(--gold); color: #17120a; white-space: nowrap; }

.tabbar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 398px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  background: rgba(12, 15, 21, .82);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 55px rgba(0,0,0,.45);
}
.tabbar button {
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}
.tabbar button.active { background: rgba(255,255,255,.075); color: var(--text); }

.premium-dialog {
  width: min(calc(100% - 28px), 390px);
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #0b0f15;
  color: var(--text);
  padding: 0;
  box-shadow: 0 28px 80px rgba(0,0,0,.7);
}
.premium-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(8px); }
.premium-dialog form { position: relative; padding: 22px; }
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 20px;
}
.plans { display: grid; gap: 10px; margin: 18px 0; }
.plans button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  padding: 14px;
  text-align: left;
}
.plans span { color: var(--muted); font-size: 12px; }
.support-button { width: 100%; height: 48px; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -14px);
  width: min(calc(100% - 32px), 398px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(113,112,255,.3);
  border-radius: 16px;
  background: rgba(14,18,26,.94);
  color: var(--text);
  padding: 12px 14px;
  font-size: 13px;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .button-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .premium-card { grid-template-columns: 1fr; }
}
