:root {
  --bg: #111418;
  --panel: rgba(28, 32, 38, 0.92);
  --text: #f2f4f7;
  --muted: #a3acb9;
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input { font: inherit; color: inherit; }
button { min-height: 52px; min-width: 52px; padding: 0 14px; white-space: nowrap; border: 0; border-radius: 12px;
  background: #2a313b; cursor: pointer; font-weight: 600; }
button:active { background: #3a4452; }
button[type=submit], #type-send { background: var(--accent); }
input[type=text], input[type=password] { min-height: 52px; padding: 0 14px; border-radius: 12px;
  border: 1px solid #3a4452; background: #0c0f12; }

/* login */
body.login { display: grid; place-items: center; padding: 16px; }
.card { width: min(420px, 100%); display: grid; gap: 12px; background: var(--panel);
  padding: 28px; border-radius: 18px; }
.card h1 { margin: 0 0 8px; font-size: 28px; }
.err { color: var(--danger); margin: 0; }
.hint { color: var(--muted); font-size: 15px; margin: 0; }

/* viewer */
body.viewer { overflow: hidden; touch-action: none; user-select: none; }
/* The toolbar is its own strip above the map so it never covers Google's controls. */
#bar { position: fixed; top: 0; left: 0; right: 0; height: 68px; display: flex; gap: 8px;
  align-items: center; padding: 8px 12px; background: var(--panel); overflow-x: auto; }
#screen { position: fixed; top: 68px; left: 0; width: 100vw; height: calc(100vh - 68px);
  display: block; background: #000; }
#typebar { position: fixed; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 8px;
  align-items: center; flex-wrap: wrap; background: var(--panel); padding: 8px; border-radius: 16px; }
#typebar[hidden] { display: none; }
#go-form { display: flex; gap: 8px; }
#dest { width: min(360px, 40vw); }
#typed { flex: 1; min-width: 160px; }
.pill { padding: 6px 12px; border-radius: 999px; font-size: 15px; background: #2a313b; color: var(--muted); }
button.pill { min-height: 44px; font-weight: 600; }
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--warn); }
#overlay { position: fixed; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center;
  background: rgba(0, 0, 0, 0.7); font-size: 22px; }
#overlay[hidden] { display: none; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--panel);
  padding: 12px 18px; border-radius: 12px; max-width: 90vw; }
#toast[hidden] { display: none; }

#drive.on { background: var(--ok); color: #04210f; }
#reroute[hidden] { display: none; }

/* turn-by-turn banner (Drive mode) */
#guide { position: fixed; top: 80px; left: 12px; display: flex; align-items: center; gap: 14px;
  max-width: min(560px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 16px;
  background: #0b6b3a; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
#guide[hidden] { display: none; }
#g-icon { font-size: 56px; line-height: 1; min-width: 56px; text-align: center; }
#g-dist { font-size: 34px; font-weight: 700; line-height: 1.1; }
#g-text { font-size: 22px; line-height: 1.25; }
#g-voice { margin-left: auto; background: rgba(255, 255, 255, 0.15); }
#g-voice.off { opacity: 0.5; }
#g-eta { position: fixed; left: 12px; bottom: 12px; padding: 10px 16px; border-radius: 12px;
  background: var(--panel); font-size: 22px; font-weight: 600; }
#g-eta[hidden] { display: none; }
#northup[hidden] { display: none; }
.phone-link { display: grid; place-items: center; min-width: 52px; min-height: 52px; border-radius: 12px;
  background: #2a313b; text-decoration: none; font-size: 24px; }
