/* NARI — ATELIER v1.1 (tokens from ChatGPT guideline update) */
:root {
  --bg: #FFF9F3;
  --surface: #FFFFFF;
  --surface-2: #F6EEE5;
  --line: #E8DDD1;
  --ink: #111827;
  --ink-2: #6B3F1F;
  --muted: #5B6472;
  --copper: #9A5B2E;
  --copper-ink: #FFFFFF;
  --accent: #9A5B2E;
  --copper-soft: #F5E6D8;
  --navy: #0F2A43;
  --ok: #1F7A4D;
  --ok-soft: #E3F3EA;
  --danger: #C2361F;
  --map-land: #EFE9E1;
  --map-road: #FFFFFF;
  --map-block: #E4DCD1;
  --shadow: 0 6px 24px rgba(15, 42, 67, .08);
  --r: 20px;
  --r-sm: 14px;
  --font-ar: "Alexandria", "Noto Sans Arabic", system-ui, sans-serif;
  --font-en: "Manrope", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F2A43;
  --surface: #1E3A5F;
  --surface-2: #173252;
  --line: #2C4A6E;
  --ink: #FFFFFF;
  --ink-2: #E6EDF5;
  --muted: #B4C3D3;
  --accent: #E0AD7B;
  --copper-soft: #2F3F55;
  --ok: #6FD3A0;
  --ok-soft: #1B4A45;
  --map-land: #16314F;
  --map-road: #2A4B70;
  --map-block: #1B3A5C;
  --shadow: 0 6px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-ar);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.num { font-family: var(--font-en); font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }

.device {
  position: relative;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 600px) {
  body { background: #E9E1D7; padding: 24px 0; }
  :root[data-theme="dark"] body { background: #08182A; }
  .device { height: min(900px, calc(100dvh - 48px)); border-radius: 36px; box-shadow: 0 30px 80px rgba(15, 42, 67, .25); }
}
main { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 96px; }
main.no-tabs { padding-bottom: 0; }

/* icons */
i[data-i] { display: inline-flex; width: 24px; height: 24px; flex: none; }
i[data-i] svg { width: 100%; height: 100%; }

/* top bar */
.top { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; min-height: 60px; }
.top h1 { flex: 1; margin: 0; text-align: center; font-size: 20px; font-weight: 600; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.icon-btn.ghost { background: transparent; border-color: transparent; }
.loc { flex: 1; display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); }
.loc i { width: 18px; height: 18px; color: var(--accent); }

/* home */
.hero { text-align: center; padding: 6px 16px 18px; }
/* Logo (ChatGPT final): copper N mark + NARI in Manrope 800, no Arabic */
.brand { display: inline-flex; align-items: center; gap: 12px; direction: ltr; }
.brand .mark { height: 44px; width: auto; }
.brand .word { font: 800 30px var(--font-en); letter-spacing: .22em; line-height: 1; color: var(--ink); }
.hero h2 { margin: 12px 0 0; font-size: 24px; font-weight: 600; }
.hero p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.main-card { margin: 0 16px; padding: 18px; background: linear-gradient(135deg, var(--copper-soft), var(--surface)); }
.main-card .row { display: flex; align-items: center; gap: 12px; }
.main-card h3 { margin: 0; font-size: 24px; font-weight: 700; }
.main-card p { margin: 0; color: var(--muted); font-size: 14px; }
.main-card .car { width: 120px; margin-inline-start: auto; }
.where {
  margin-top: 14px; width: 100%; min-height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  font-size: 17px; font-weight: 500; text-align: start;
}
.where > i { color: var(--accent); }
.where .go { margin-inline-start: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--copper); color: #fff; display: grid; place-items: center; }

.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px 0; }
.svc { padding: 14px; display: flex; flex-direction: column; gap: 6px; min-height: 128px; }
.svc .car { width: 92px; align-self: flex-end; }
.svc b { font-size: 18px; font-weight: 600; }
.svc span { font-size: 13px; color: var(--muted); }

.section-title { margin: 22px 16px 10px; font-size: 18px; font-weight: 600; }
.recent { margin: 0 16px; }
.recent a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; border-bottom: 1px solid var(--line); }
.recent a:last-child { border-bottom: 0; }
.recent .pin { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); }
.recent b { display: block; font-size: 15px; font-weight: 500; }
.recent small { color: var(--muted); font-size: 13px; }

/* map */
.map { position: relative; height: 300px; background: var(--map-land); overflow: hidden; }
.map svg.city { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .float { position: absolute; z-index: 2; }
.map .back { top: 14px; inset-inline-start: 16px; }
.map .gps { bottom: 30px; inset-inline-start: 16px; }
.eta-chip {
  bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 15px;
  padding: 8px 14px; border-radius: 999px; display: flex; gap: 6px; align-items: center; white-space: nowrap;
}

.panel { position: relative; margin-top: -20px; background: var(--bg); border-radius: 24px 24px 0 0; padding: 14px 16px 16px; z-index: 3; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }

.route { position: relative; padding: 4px 14px; }
.route .stop { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.route .stop + .stop { border-top: 1px solid var(--line); }
.route .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); flex: none; }
.route .dot.to { border: 0; background: var(--copper); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.route b { display: block; font-size: 15px; font-weight: 600; }
.route small { color: var(--muted); font-size: 13px; }
.route .swap { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); }

.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 72px; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); text-align: start;
}
.opt[aria-checked="true"] { border-color: var(--copper); background: var(--copper-soft); }
.opt .car { width: 70px; }
.opt .meta { flex: 1; min-width: 0; }
.opt .car { width: 60px; flex: none; }
.opt b { display: block; font-size: 17px; font-weight: 600; }
.opt .facts { display: flex; gap: 12px; color: var(--muted); font-size: 13px; }
.opt .facts span { display: inline-flex; align-items: center; gap: 4px; }
.opt .facts i { width: 16px; height: 16px; }
.price { font: 800 20px var(--font-en); white-space: nowrap; }
.price small { font: 600 13px var(--font-ar); margin-inline-start: 3px; }

.pay-line {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; min-height: 56px; width: 100%;
  background: var(--surface-2); border: 0; border-radius: var(--r-sm); font-size: 15px; text-align: start;
}
.pay-line i { color: var(--ok); }
.pay-line .chev { margin-inline-start: auto; color: var(--muted); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 20px; margin-top: 14px;
  border: 0; border-radius: 16px; background: var(--copper); color: var(--copper-ink);
  font-size: 18px; font-weight: 600;
}
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.sticky-cta { position: sticky; bottom: 0; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 4; }

/* segmented (rental period) */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.seg button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-weight: 600; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--copper); color: #fff; }

.list { display: grid; gap: 12px; padding: 4px 16px 16px; }
.rent-card { padding: 14px; position: relative; }
.rent-card .fav { position: absolute; top: 8px; inset-inline-end: 8px; }
.rent-card .car { width: 180px; display: block; margin: 0 auto 6px; }
.rent-card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rent-card h3 { margin: 0; font-size: 19px; font-weight: 600; }
.rent-card .price { color: var(--accent); }
.specs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.specs span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.specs i { width: 16px; height: 16px; }

/* stepper (intercity) */
.steps { display: flex; justify-content: space-between; padding: 6px 16px 14px; position: relative; }
.steps::before { content: ""; position: absolute; top: 22px; inset-inline: 40px; height: 2px; background: var(--line); }
.steps div { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); width: 60px; }
.steps b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font: 700 14px var(--font-en); color: var(--muted); }
.steps .on b { background: var(--copper); border-color: var(--copper); color: #fff; }
.steps .done b { background: var(--copper-soft); border-color: var(--copper); color: var(--accent); }
.steps .on { color: var(--ink); font-weight: 600; }

.body { padding: 0 16px 16px; }
.body h3 { font-size: 18px; font-weight: 600; margin: 14px 0 10px; }
.dest { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; min-height: 84px; width: 100%; text-align: start; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); }
.dest[aria-checked="true"] { border-color: var(--copper); background: var(--copper-soft); }
.dest .thumb { width: 84px; height: 64px; border-radius: 10px; flex: none; }
.dest b { font-size: 19px; font-weight: 600; flex: 1; }
.dest small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
[aria-checked="true"] .radio { border-color: var(--copper); }
[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--copper); }

.field { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.field label { color: var(--muted); font-size: 14px; min-width: 70px; }
.field input, .field select { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 12px 0; outline: none; }
.field:focus-within { border-color: var(--copper); }
.stepper { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.stepper .ctl { display: flex; align-items: center; gap: 14px; }
.stepper output { font: 700 20px var(--font-en); min-width: 24px; text-align: center; }
.note { font-size: 14px; color: var(--muted); background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-sm); display: flex; gap: 8px; }
.note i { color: var(--accent); width: 20px; height: 20px; }

.summary { padding: 4px 14px; }
.summary div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); font-size: 15px; }
.summary div:last-child { border-bottom: 0; }
.summary span { color: var(--muted); }
.summary strong { font-weight: 600; }

/* live ride */
.driver { display: flex; align-items: center; gap: 12px; padding: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--copper-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.driver b { display: block; font-size: 18px; font-weight: 600; }
.driver small { color: var(--muted); font-size: 14px; }
.plate { margin-inline-start: auto; text-align: center; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; font: 800 16px var(--font-en); line-height: 1.2; }
.plate small { display: block; font: 500 11px var(--font-ar); color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.act { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; }
.act.sos { background: var(--danger); color: #fff; border-color: var(--danger); font-weight: 700; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* payment summary */
.done-head { text-align: center; padding: 18px 16px 6px; }
.check { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; background: var(--copper); color: #fff; display: grid; place-items: center; }
.check i { width: 40px; height: 40px; }
.done-head h2 { margin: 0; font-size: 22px; font-weight: 600; }
.cash-box { margin: 16px; padding: 20px; text-align: center; background: var(--copper-soft); border: 1.5px solid var(--copper); border-radius: var(--r); }
.cash-box p { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.cash-box .big { font: 800 44px var(--font-en); margin: 4px 0 0; color: var(--ink); }
.cash-box .big small { font: 700 20px var(--font-ar); margin-inline-start: 6px; }

/* bottom sheet */
.sheet-wrap { position: absolute; inset: 0; z-index: 20; background: rgba(8, 20, 34, .45); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--bg); border-radius: 24px 24px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { text-align: center; margin: 4px 0 2px; font-size: 20px; font-weight: 600; }
.sheet .sub { text-align: center; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.stars { display: flex; justify-content: center; gap: 6px; direction: ltr; }
.stars button { width: 48px; height: 48px; border: 0; background: transparent; color: var(--line); padding: 4px; }
.stars button.on { color: #E3A33B; }
.stars i { width: 38px; height: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.chips button[aria-pressed="true"] { background: var(--copper-soft); border-color: var(--copper); color: var(--ink); font-weight: 600; }
.pay-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 0 14px; margin-top: 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); text-align: start; font-size: 16px; }
.pay-opt[aria-checked="true"] { border-color: var(--copper); background: var(--copper-soft); }
.pay-opt small { color: var(--muted); font-size: 13px; display: block; }
.pay-opt[disabled] { opacity: .55; }

/* network banner */
.net { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; font-weight: 500; background: #FDF0D5; color: #5A3B05; }
.net.off { background: #3A1F14; color: #FFE7DA; }
.net button { margin-inline-start: auto; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid currentColor; background: transparent; font-weight: 600; font-size: 13px; }

/* tabs */
.tabs {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 12px; color: var(--muted); }
.tabs a.on { color: var(--accent); font-weight: 600; }

.toast { position: absolute; left: 16px; right: 16px; bottom: 96px; z-index: 40; padding: 12px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-size: 15px; text-align: center; box-shadow: var(--shadow); }
:root[data-theme="dark"] .toast { background: #fff; color: var(--navy); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty i { width: 56px; height: 56px; color: var(--accent); margin-bottom: 8px; }
.settings { margin: 0 16px; }
.settings .item { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 14px; border-bottom: 1px solid var(--line); width: 100%; background: transparent; border-inline: 0; border-top: 0; text-align: start; font-size: 16px; }
.settings .item:last-child { border-bottom: 0; }
.settings .item span { margin-inline-start: auto; color: var(--muted); font-size: 14px; }
.trip { display: flex; gap: 12px; align-items: center; padding: 14px; }
.trip b { display: block; font-size: 16px; font-weight: 600; }
.trip small { color: var(--muted); font-size: 13px; }
.trip .price { margin-inline-start: auto; font-size: 17px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
