/* rmd-maps — glass UI for the Meta Ray-Ban Display (600x600 additive screen).
   Near-black panels read as transparent on the additive display; bright text +
   a single teal accent carry the design. Original implementation. */
:root {
  --bg: #05080a;
  --panel: rgba(9, 14, 18, 0.74);
  --panel-solid: #0a1014;
  --stroke: rgba(255, 255, 255, 0.14);
  --ink: #f3f7f8;
  --ink-dim: #9fb0b4;
  --accent: #34d3b4;          /* teal-green */
  --accent-ink: #04140f;
  --route: #38bdf8;           /* cyan route line */
  --danger: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 600px; height: 600px; overflow: hidden; background: var(--bg); }
body {
  font-family: -apple-system, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none;
}
#app { position: relative; width: 600px; height: 600px; }
.screen { position: absolute; inset: 0; }
.screen.hidden { display: none; }
.hidden { display: none !important; }
/* the `hidden` attribute must win even over our explicit display:flex panels */
[hidden] { display: none !important; }
svg { display: block; width: 100%; height: 100%; }

/* ---- header --------------------------------------------------------------*/
.header {
  position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}
.header h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.app-badge { display: inline-flex; width: 30px; height: 30px; border-radius: 9px;
  align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--stroke); }
.app-badge img { width: 22px; height: 22px; }
.header-meta { margin-left: auto; font-size: 13px; color: var(--ink-dim); max-width: 230px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.back-btn { width: 38px; height: 38px; border-radius: 11px; background: var(--panel);
  border: 1px solid var(--stroke); color: var(--ink); display: inline-flex; padding: 8px; }
.back-btn svg { width: 20px; height: 20px; }

/* ---- map (full-bleed, feathered edges) -----------------------------------*/
.content { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; background: #000; z-index: 1;
  -webkit-mask-image: radial-gradient(125% 120% at 50% 46%, #000 62%, transparent 100%);
  mask-image: radial-gradient(125% 120% at 50% 46%, #000 62%, transparent 100%); }
.leaflet-container { background: #000 !important; font: inherit; }
.leaflet-control-zoom, .leaflet-control-attribution a { display: none !important; }
.leaflet-control-attribution { background: transparent !important; color: rgba(255,255,255,0.18) !important;
  font-size: 9px !important; padding: 0 4px !important; }
.leaflet-bar, .leaflet-touch .leaflet-bar { border: none !important; box-shadow: none !important; }
/* route line glow so the cyan trace pops over the busy basemap (additive screen) */
.leaflet-overlay-pane svg path.leaflet-interactive { filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.95)); }
/* position marker (chevron) + cone live in an overlay pane drawn by app.js */

.trail { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* ---- chrome auto-hide ----------------------------------------------------*/
#home.dimchrome .chrome { opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.chrome { transition: opacity .25s ease; }

/* ---- search dock ---------------------------------------------------------*/
.dock { position: absolute; left: 16px; right: 70px; bottom: 18px; z-index: 20;
  display: flex; flex-direction: column; gap: 10px; }
.where { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--ink);
  font-size: 19px; font-weight: 600; box-shadow: var(--shadow); }
.where-ic { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.where-text { color: var(--ink-dim); font-weight: 600; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- chips / quick destinations -----------------------------------------*/
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 999px;
  color: var(--ink); font-size: 15px; font-weight: 600; backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); white-space: nowrap; }
.chip svg { width: 17px; height: 17px; color: var(--accent); }
.chip .ck { width: 18px; height: 18px; border-radius: 999px; background: var(--accent);
  color: var(--accent-ink); font-size: 12px; font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.on svg { color: var(--accent); }

.overlay-row { position: absolute; left: 16px; right: 70px; z-index: 20;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#modes { bottom: 74px; }
#alts { bottom: 122px; }

/* ---- summary pill --------------------------------------------------------*/
.summary { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 22;
  min-width: 200px; max-width: 380px; padding: 9px 18px; text-align: center;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 999px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.summary-main { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.summary-eta { font-size: 22px; font-weight: 800; color: var(--accent); }
.summary-dist { font-size: 15px; color: var(--ink-dim); }
.summary-to { font-size: 13px; color: var(--ink-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- next-turn banner ----------------------------------------------------*/
.turn { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 25;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.turn-ic { width: 40px; height: 40px; flex: 0 0 auto; color: var(--accent); }
.turn-ic svg { width: 40px; height: 40px; }
.turn-dist { font-size: 26px; font-weight: 800; line-height: 1.05; }
.turn-text { font-size: 16px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 430px; }

.gps-note, .offline { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 24;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-dim);
  background: var(--panel); border: 1px solid var(--stroke); }

/* ---- sent (phone hand-off) ----------------------------------------------*/
.sent { position: absolute; left: 16px; right: 70px; bottom: 18px; z-index: 26;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--accent);
  border-radius: var(--radius); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.sent-title { font-size: 13px; color: var(--accent); font-weight: 700; }
.sent-label { font-size: 17px; font-weight: 600; margin: 3px 0 10px; }
.sent-row { display: flex; gap: 8px; }

/* ---- prominent action pill (Start / End) --------------------------------*/
.pill-wrap { position: absolute; left: 16px; right: 70px; bottom: 18px; z-index: 23;
  display: flex; justify-content: center; }
.pill { min-width: 180px; padding: 15px 28px; border-radius: 999px; border: none;
  background: var(--accent); color: var(--accent-ink); font-size: 20px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(52, 211, 180, 0.35); }
.pill.danger { background: var(--danger); color: #1a0606; box-shadow: 0 8px 24px rgba(255, 107, 107, 0.32); }

/* ---- side action rail ----------------------------------------------------*/
.rail { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 28;
  display: flex; flex-direction: column; gap: 8px; }
.act { width: 50px; height: 50px; border-radius: 14px; display: inline-flex; align-items: center;
  justify-content: center; background: var(--panel); border: 1px solid var(--stroke); color: var(--ink);
  font-size: 24px; font-weight: 700; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.act svg { width: 22px; height: 22px; }
.act.primary { color: var(--accent); border-color: rgba(52, 211, 180, 0.5); }
.act.textbtn { font-size: 13px; font-weight: 700; }
.act.danger { color: var(--danger); }

/* ---- focus ring (D-pad) --------------------------------------------------*/
.focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.where.focus, .chip.focus, .pill.focus, .act.focus, .row.focus, .back-btn.focus, .key.focus {
  outline: 3px solid var(--accent); outline-offset: 2px; }
.pill.focus { outline-color: #fff; }

/* ---- lists (results / places / steps / saveas) --------------------------*/
.list-content { padding: 64px 14px 14px; height: 100%; overflow-y: auto; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 14px; color: var(--ink); }
.row-icon { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.row-icon svg { width: 24px; height: 24px; }
.pl-badge { width: 28px; height: 28px; border-radius: 9px; background: var(--accent);
  color: var(--accent-ink); font-size: 15px; font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 auto; }
.row-body { min-width: 0; flex: 1; }
.row-title { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { margin-left: auto; font-size: 14px; color: var(--accent); font-weight: 700; flex: 0 0 auto; }
.empty-hint { color: var(--ink-dim); font-size: 15px; text-align: center; padding: 24px 10px; }

/* ---- on-glasses keyboard (search) ---------------------------------------*/
.kb-text-wrap { margin: 0 2px 10px; padding: 12px 14px; min-height: 46px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--stroke); font-size: 18px; }
.kb-placeholder { color: var(--ink-dim); }
.kb-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 0 2px 10px; }
.key { padding: 11px 0; border-radius: 9px; background: var(--panel); border: 1px solid var(--stroke);
  color: var(--ink); font-size: 16px; font-weight: 600; text-align: center; }
.key.wide { grid-column: span 2; }
.key.go { background: var(--accent); color: var(--accent-ink); }

/* ---- lock / pin ----------------------------------------------------------*/
.centered { display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 16px; padding: 24px; text-align: center; }
.sub-status { font-size: 15px; color: var(--ink-dim); max-width: 460px; }
.sub-status.err { color: var(--danger); min-height: 18px; }
.pin { display: flex; gap: 10px; }
.pin .digit { width: 44px; height: 58px; border-radius: 12px; background: var(--panel);
  border: 1px solid var(--stroke); display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; }
.pin .digit.active { border-color: var(--accent); color: var(--accent); }
