:root {
  --bg: #eceff3; --surface: #ffffff; --ink: #11161d; --muted: #566170; --line: #d3d9e0;
  --accent: #f5b800; --accent-ink: #1b1500; --link: #0b5cad; --ok: #1d7f49; --bad: #b3342a;
  --sheet: rgba(236, 239, 243, .95);
  --f-display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --f-body: "Hanken Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1116; --surface: #171d25; --ink: #eef1f5; --muted: #9aa6b4; --line: #2a333e;
    --accent: #ffc61a; --accent-ink: #1b1500; --link: #6db3ff; --ok: #4cc382; --bad: #ff7b6e;
    --sheet: rgba(13, 17, 22, .93); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  padding: 0 max(16px, env(safe-area-inset-left)) 48px max(16px, env(safe-area-inset-left));
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(6, 8, 12, .18), rgba(6, 8, 12, .5)), url("bg.jpg") center top / cover no-repeat;
}
.wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
header { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero { height: clamp(150px, 42vw, 330px); }
.checker { height: 10px; border-radius: 2px; background: repeating-conic-gradient(var(--ink) 0 25%, var(--accent) 0 50%) 0 0 / 20px 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.wa { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.nav { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.nav a { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); font-weight: 700; border-radius: 7px; }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.panel { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; }
h2 { font-family: var(--f-display); font-size: 24px; line-height: 1.15; margin: 0; text-wrap: balance; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
input, select { min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 500; width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; min-width: 0; }
.muted { color: var(--muted); font-size: 14px; }
.notice { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; color: var(--muted); background: var(--surface); }
.cars { display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.car { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; }
.car .name { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.car .dist { font-family: var(--f-display); font-weight: 800; font-size: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.car .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.car .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plate { border: 1px solid var(--ink); border-radius: 4px; padding: 0 6px; font-weight: 700; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { flex: 1 1 120px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--f-display); font-size: 28px; font-variant-numeric: tabular-nums; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.pill.on { color: var(--ok); } .pill.off { color: var(--muted); } .pill.blk { color: var(--bad); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#findFlow { display: flex; flex-direction: column; gap: 16px; }
.priceBox { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; font-weight: 700; }
.priceBox .priceNum { font-family: var(--f-display); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; direction: ltr; }
.ov { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
input.amt { width: 104px; padding: 8px 10px; border-radius: 10px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; opacity: .9; }
.amts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.total { font-weight: 600; margin: 8px 0; }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.status { font-size: 14px; min-height: 20px; color: var(--ok); }
.status.err { color: var(--bad); }
#map { height: 340px; border-radius: 10px; border: 1px solid var(--line); }
body[dir="rtl"] { font-family: "IBM Plex Sans Arabic", var(--f-body); }
body[dir="rtl"] h2 { font-family: "IBM Plex Sans Arabic", var(--f-display); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }
