/* Niro Navi — auto-scherm: groot, donker, weinig tekst. */
:root {
  --bg: #0B1116; --panel: #121A21; --line: #22303B; --fg: #EEF3F6; --mut: #8FA1AE;
  --acc: #2FD07A; --acc-ink: #04220F; --warn: #FFB020; --bad: #FF4D4F; --blue: #3EA6FF;
  --r: 16px; --pad: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 500 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; opacity: .6; }

/* Manevra */
#maneuver { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 10px; z-index: 5;
  display: flex; gap: 14px; align-items: center; background: #0F7A3E; color: #fff; border-radius: var(--r);
  padding: 12px 18px 12px 12px; max-width: min(560px, calc(100% - 20px)); box-shadow: 0 8px 24px #0008; }
#mv-icon { width: 76px; height: 76px; flex: none; }
#mv-icon svg { width: 100%; height: 100%; }
#mv-dist { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#mv-road { font-size: 21px; font-weight: 600; opacity: .95; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.mv-txt { min-width: 0; }
#mv-next { position: absolute; left: 12px; bottom: -34px; background: #0A5A2D; padding: 4px 12px; border-radius: 0 0 10px 10px; font-size: 15px; }

/* Uyarı */
#alert { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 120px);
  background: var(--bad); color: #fff; font-weight: 800; font-size: 22px; padding: 10px 20px; border-radius: 999px; box-shadow: 0 6px 20px #000a; white-space: nowrap; }

/* Hız */
#speedbox { position: absolute; z-index: 5; left: 10px; bottom: calc(var(--barh, 84px) + 12px); display: flex; gap: 10px; align-items: flex-end; }
#speed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; text-align: center; min-width: 96px; }
#speed b { display: block; font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; }
#speed span { font-size: 13px; color: var(--mut); }
#speed.over b { color: var(--bad); }
#limit { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #111; border: 7px solid #E1251B;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; }

/* Kaart-knoppen */
#mapbtns { position: absolute; z-index: 5; right: 10px; bottom: calc(var(--barh, 84px) + 12px); display: flex; flex-direction: column; gap: 10px; }
.round { width: 58px; height: 58px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; font-size: 16px; box-shadow: 0 4px 14px #0007; }
.round svg { width: 28px; height: 28px; }
.round.on { background: var(--blue); color: #fff; }

/* Alt çubuk */
#bar { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line);
  padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px); display: flex; flex-direction: column; gap: 8px; }
#trip { display: flex; align-items: center; gap: 18px; padding: 0 6px; }
#trip > div { display: flex; flex-direction: column; line-height: 1.05; }
#trip b { font-size: 28px; font-variant-numeric: tabular-nums; }
#trip span { font-size: 13px; color: var(--mut); }
#trip .danger { margin-left: auto; }
#tabs { display: flex; gap: 6px; }
.tab { flex: 1; min-height: 56px; border-radius: 12px; background: #18232C; font-weight: 700; font-size: 17px; position: relative; }
.tab.on { background: var(--acc); color: var(--acc-ink); }
#rit-dot { position: absolute; top: 8px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* Paneller */
.panel { position: absolute; z-index: 8; top: calc(env(safe-area-inset-top, 0px) + 8px); bottom: calc(var(--barh, 84px) + 8px); right: 8px; width: min(460px, calc(100% - 16px));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px #000a; overscroll-behavior: contain; }
.panel header { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { margin: 0; font-size: 22px; }
.panel h3 { margin: 4px 0 0; font-size: 16px; color: var(--mut); text-transform: uppercase; letter-spacing: .08em; }
.x { width: 48px; height: 48px; font-size: 32px; line-height: 1; border-radius: 12px; background: #18232C; }
input[type=search], input[type=password], .fld input, .fld select, select {
  width: 100%; min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: #0D141A; padding: 0 14px; font-size: 18px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { background: #18232C; border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; min-height: 58px; }
.list li.on { outline: 2px solid var(--acc); }
.list li .t { flex: 1; min-width: 0; }
.list li .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .t small { color: var(--mut); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .r { text-align: right; font-variant-numeric: tabular-nums; color: var(--mut); white-space: nowrap; }
.list li .go { min-width: 54px; min-height: 46px; border-radius: 10px; background: var(--acc); color: var(--acc-ink); font-weight: 800; }
.badge { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #22303B; text-transform: uppercase; letter-spacing: .04em; }
.badge.zakelijk { background: #0F7A3E; } .badge.prive { background: #5B4A9E; } .badge.woon-werk { background: #8A5A12; }
.badge.kobi { background: var(--blue); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > select { flex: 1; min-width: 140px; width: auto; }
.primary, .ghost, .danger { min-height: 52px; padding: 0 18px; border-radius: 12px; font-weight: 800; }
.primary { background: var(--acc); color: var(--acc-ink); }
.ghost { background: #18232C; }
.danger { background: var(--bad); color: #fff; }
.big { width: 100%; min-height: 62px; font-size: 20px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 50px; border-radius: 12px; background: #18232C; font-weight: 700; }
.seg button.on { background: var(--acc); color: var(--acc-ink); }
.muted { color: var(--mut); margin: 0; }
.small { font-size: 13px; }
.card { background: #18232C; border-radius: 12px; padding: 12px 14px; }
.card b { font-size: 20px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.g { background: #18232C; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.g span { font-size: 13px; color: var(--mut); }
.g b { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.g i { font-style: normal; font-size: 12px; color: var(--mut); }
.sw { display: flex; gap: 12px; align-items: center; min-height: 50px; font-size: 18px; }
.sw input { width: 26px; height: 26px; accent-color: var(--acc); }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--mut); }
.fld input, .fld select { color: var(--fg); }
#fav-row { display: flex; gap: 6px; flex-wrap: wrap; }
#fav-row button { min-height: 44px; padding: 0 14px; border-radius: 999px; background: #18232C; font-weight: 700; }

/* Giriş */
#login { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: grid; place-items: center; padding: 16px; }
#login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
#login h1 { margin: 0 0 8px; font-size: 34px; }
.err { color: var(--bad); min-height: 1.2em; margin: 0; }

dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r); width: min(460px, calc(100% - 24px)); padding: var(--pad); }
dialog::backdrop { background: #000a; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h3 { margin: 0; font-size: 22px; }

#toast { position: absolute; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(var(--barh, 84px) + 24px); background: #000d; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: 90%; text-align: center; }

/* Kleine schermen in de auto (800×480): compacter */
@media (max-height: 520px) {
  #mv-icon { width: 60px; height: 60px; } #mv-dist { font-size: 34px; } #mv-road { font-size: 18px; }
  .tab { min-height: 48px; font-size: 16px; } #speed b { font-size: 34px; } #limit { width: 54px; height: 54px; font-size: 20px; border-width: 6px; }
  .round { width: 50px; height: 50px; }
}
@media (max-width: 560px) { .panel { left: 8px; width: auto; } #trip { gap: 12px; } #trip b { font-size: 24px; } }
