/* my.droidefb.com — one stylesheet for every page.
   Design tokens first (light, then dark), then base, layout, components.
   Theme: follows the device unless the user picked one (html[data-theme]). */

@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap;
  src: url("fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap;
  src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap;
  src: url("fonts/montserrat-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* brand */
  --brand-blue: #4CC8EE;          /* logo / website blue: decoration only, too light for text on white */
  --brand-gray: #535461;          /* logo / website gray */
  /* surfaces */
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #EEF0F4;
  --border: #DADDE4;
  --border-strong: #B9BDC8;
  /* text */
  --text: #2A2B33;
  --text-muted: #5C5E6B;
  --heading: var(--brand-gray);
  /* interactive accent: AA contrast for text and for white text on it */
  --accent: #0077A8;
  --accent-hover: #00628B;
  --on-accent: #FFFFFF;
  --accent-soft: #E2F4FB;
  /* states */
  --success: #1D7F48;
  --success-soft: #E3F5EA;
  --warning: #8A5A00;
  --warning-soft: #FFF4D6;
  --danger: #C02626;
  --danger-hover: #A11D1D;
  --danger-soft: #FDECEC;
  /* map */
  --track: #6D28D9;
  --track-casing: #FFFFFF;
  /* shape */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 22, 30, .06), 0 2px 8px rgba(20, 22, 30, .06);
  --shadow-pop: 0 8px 28px rgba(20, 22, 30, .18);
  --focus: 0 0 0 3px rgba(0, 119, 168, .45);
  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Montserrat", var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 60px;
}

/* Dark tokens: used when the device is dark and the user didn't pick light,
   or when the user picked dark. Same values in both blocks. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111218; --surface: #1A1C23; --surface-2: #23262F;
    --border: #30333E; --border-strong: #464A57;
    --text: #E7E8ED; --text-muted: #A3A6B3; --heading: #F1F2F5;
    --accent: #4CC8EE; --accent-hover: #7FD9F4; --on-accent: #08202A; --accent-soft: #12303B;
    --success: #4ADE80; --success-soft: #133222;
    --warning: #F5C451; --warning-soft: #352A0D;
    --danger: #FF7070; --danger-hover: #FF9494; --danger-soft: #3A1616;
    --track: #C084FC; --track-casing: #1A1C23;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-pop: 0 10px 30px rgba(0, 0, 0, .55);
    --focus: 0 0 0 3px rgba(76, 200, 238, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111218; --surface: #1A1C23; --surface-2: #23262F;
  --border: #30333E; --border-strong: #464A57;
  --text: #E7E8ED; --text-muted: #A3A6B3; --heading: #F1F2F5;
  --accent: #4CC8EE; --accent-hover: #7FD9F4; --on-accent: #08202A; --accent-soft: #12303B;
  --success: #4ADE80; --success-soft: #133222;
  --warning: #F5C451; --warning-soft: #352A0D;
  --danger: #FF7070; --danger-hover: #FF9494; --danger-soft: #3A1616;
  --track: #C084FC; --track-casing: #1A1C23;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-pop: 0 10px 30px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(76, 200, 238, .5);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; margin: 0; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip-link:focus { left: 8px; background: var(--surface); padding: 8px 12px; }

/* Logo: two images, one per theme */
.logo { display: block; height: 30px; width: auto; }
.logo-night { display: none; }
:root[data-theme="dark"] .logo-day { display: none; }
:root[data-theme="dark"] .logo-night { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-day { display: none; }
  :root:not([data-theme="light"]) .logo-night { display: block; }
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 28px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar .brand-sub {
  font: 600 .8rem/1 var(--font-head); color: var(--text-muted);
  padding-left: 10px; border-left: 1px solid var(--border); letter-spacing: .02em;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--text-muted); text-decoration: none; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; margin-top: 4px; border-radius: 2px; background: var(--brand-blue);
}
.topbar .nav-toggle { display: none; }

/* user menu (details/summary: works without JavaScript) */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-pop .menu-head { padding: 8px 12px 10px; }
.menu-pop .menu-label { padding: 6px 12px 2px; font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font: 700 .9rem/1 var(--font-head);
}
.user-menu > summary { padding: 4px; border-radius: 999px; }
.user-menu > summary:hover { background: var(--surface-2); }

.seg { display: flex; gap: 2px; padding: 3px; margin: 4px 8px 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.seg button { flex: 1; justify-content: center; padding: 6px 4px; font-size: .85rem; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }

/* -------------------------------------------------------------- page body */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; }
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; margin-bottom: 22px;
}
.page-header .lead { margin: 6px 0 0; color: var(--text-muted); max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crumbs { font-size: .9rem; margin-bottom: 8px; color: var(--text-muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.footer {
  max-width: 1160px; margin: 0 auto; padding: 18px 20px 32px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border);
}
.footer a { color: var(--text-muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #2A0B0B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #2A0B0B; } }
.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: .875rem; }
.btn-icon { min-width: 40px; padding: 8px; }
.btn-sm.btn-icon { min-width: 34px; padding: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------- form controls */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
select, input[type="text"], input[type="search"] {
  min-height: 40px; padding: 7px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
select { padding-right: 32px; }

/* ------------------------------------------------------- cards and banners */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

.flash, .banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; margin-bottom: 18px; border-radius: var(--radius);
  border: 1px solid transparent;
}
.flash svg, .banner svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.flash p, .banner p { margin: 0; }
.flash .close { margin-left: auto; }
.flash-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.flash-success svg { color: var(--success); }
.banner-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.banner-warning svg { color: var(--warning); }
.banner .banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ------------------------------------------------------------ track list */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.year { margin-top: 26px; }
.year-head { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 10px; }
.year-head h2 { font-size: 1.05rem; }

.list { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.list col.c-when { width: 23%; } .list col.c-num { width: 11%; } .list col.c-dev { width: 13%; } .list col.c-act { width: 92px; }
.list th {
  text-align: left; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.list td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr { transition: background-color .1s; }
.list tbody tr:hover { background: var(--surface-2); }
.list .col-num { text-align: right; }
.list .col-actions { text-align: right; width: 1%; white-space: nowrap; }
.list .when a { font-weight: 600; color: var(--text); text-decoration: none; }
.list .when a:hover { color: var(--accent); text-decoration: underline; }
.list .when .local { display: block; font-size: .85rem; color: var(--text-muted); }
.route { font-family: var(--mono); font-size: .9rem; letter-spacing: .01em; }
.route .arrow { color: var(--text-muted); padding: 0 .15em; }
.route-unknown { font-family: var(--font); font-style: italic; color: var(--text-muted); }
.device-tag {
  display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.row-actions { display: inline-flex; gap: 4px; align-items: center; }

/* Phones: rows become stacked cards */
@media (max-width: 760px) {
  .list thead { display: none; }
  .list, .list tbody, .list tr, .list td { display: block; }
  .list tr { padding: 14px 16px; border-bottom: 1px solid var(--border); position: relative; }
  .list tbody tr:last-child { border-bottom: 0; }
  .list td { padding: 0; border: 0; }
  .list td.when { padding-right: 96px; }
  .list td.route-cell { margin: 6px 0 8px; }
  .list td.stat { display: inline-block; margin-right: 14px; font-size: .9rem; color: var(--text-muted); text-align: left; }
  .list td.stat::before { content: attr(data-label) " "; font-size: .75rem; }
  .list td.col-actions { position: absolute; right: 10px; top: 10px; width: auto; }
  .list td.device-cell { display: none; }
  .list colgroup { display: none; }
}

/* ----------------------------------------------------- download menu, etc. */
.dl-menu .menu-pop { min-width: 260px; }
.dl-menu .menu-pop small { display: block; color: var(--text-muted); font-size: .8rem; }
.dl-menu .menu-pop a { align-items: flex-start; }
.dl-menu .fmt {
  flex: none; width: 44px; text-align: center; padding: 2px 0; margin-top: 1px;
  font: 700 .7rem/1.4 var(--mono); border-radius: 4px; background: var(--surface-2); color: var(--text-muted);
}

/* ------------------------------------------------------------ track page */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.figure { padding: 14px 16px; }
.figure .label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.figure .value { font: 700 1.45rem/1.25 var(--font-head); color: var(--heading); margin-top: 4px; font-variant-numeric: tabular-nums; }
.figure .value small { font: 600 .85rem var(--font); color: var(--text-muted); margin-left: 3px; }
.figure .sub { font-size: .85rem; color: var(--text-muted); }
@media (max-width: 760px) { .figures { grid-template-columns: repeat(2, 1fr); } .figure .value { font-size: 1.2rem; } }

.map-card { overflow: hidden; }
.map { height: min(62vh, 620px); min-height: 340px; background: var(--surface-2); }
.map-foot {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted);
}
.legend-swatch { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--track); box-shadow: 0 0 0 1.5px var(--track-casing); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; border: 2px solid #fff; }

.profile-card { margin-top: 18px; }
.profile-head { display: flex; flex-wrap: wrap; gap: 2px 16px; justify-content: space-between; align-items: baseline; padding: 14px 16px 0; }
.profile { display: block; width: 100%; height: 150px; touch-action: none; }
.profile .grid line { stroke: var(--border); stroke-width: 1; }
.profile .axis text { fill: var(--text-muted); font: 11px var(--font); }
.profile .area { fill: color-mix(in srgb, var(--track) 16%, transparent); }
.profile .line { fill: none; stroke: var(--track); stroke-width: 2; }
.profile .cursor line { stroke: var(--text-muted); stroke-dasharray: 3 3; }
.profile .cursor circle { fill: var(--track); stroke: var(--surface); stroke-width: 2; }
.profile-readout { font-variant-numeric: tabular-nums; }

/* map markers / labels (Leaflet) */
.apt-label {
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border-strong) !important; border-radius: 4px !important;
  box-shadow: var(--shadow) !important; font: 700 11px/1.2 var(--mono) !important; padding: 2px 6px !important;
}
.apt-label::before { display: none !important; }
.leaflet-container { font: 13px/1.4 var(--font); background: var(--surface-2); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--text-muted) !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-bar a, .leaflet-control-layers {
  background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important;
}
.leaflet-control-layers { border-radius: var(--radius-sm) !important; box-shadow: var(--shadow) !important; }
.leaflet-control-layers-expanded { padding: 8px 12px !important; }
.leaflet-bar { border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; }
.plain-note {
  position: absolute; z-index: 500; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  font-size: .85rem; color: var(--text-muted); box-shadow: var(--shadow); white-space: nowrap;
}

/* ------------------------------------------------------------ empty state */
.empty { text-align: center; padding: 48px 24px 40px; }
.empty .art { width: 120px; height: 80px; margin: 0 auto 16px; color: var(--brand-blue); }
.empty h2 { font-size: 1.3rem; margin-bottom: 8px; }
.empty p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 20px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 auto 8px; max-width: 520px; text-align: left; }
.steps li { counter-increment: step; display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.steps li::before {
  content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 700 .85rem var(--font-head);
  background: var(--accent-soft); color: var(--accent);
}
.ui { font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------- centered pages (sign-in) */
.center-page { min-height: calc(100vh - var(--topbar-h)); display: grid; place-items: center; padding: 32px 20px; }
.center-card { width: min(440px, 100%); padding: 36px 32px; text-align: center; }
.center-card .mark { width: 56px; height: 56px; margin: 0 auto 18px; }
.center-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.center-card p { color: var(--text-muted); }
.center-card .btn { width: 100%; min-height: 46px; margin-top: 10px; }
.btn-google { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-google:hover { background: var(--surface-2); color: var(--text); }
.fine { font-size: .8rem; color: var(--text-muted); margin-top: 18px; }
.code { font: 700 3.2rem/1 var(--font-head); color: var(--brand-blue); margin-bottom: 10px; }

/* --------------------------------------------------------- confirm dialog */
dialog.confirm {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
dialog.confirm::backdrop { background: rgba(12, 14, 20, .55); backdrop-filter: blur(2px); }
dialog.confirm form { padding: 22px 24px 20px; }
dialog.confirm h2 { font-size: 1.15rem; margin-bottom: 10px; }
dialog.confirm .what { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0; }
dialog.confirm .buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ------------------------------------------------- full-window map frame */
body.app-map { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.mapframe { flex: 1; display: flex; min-height: 0; position: relative; }
.mapframe .panel {
  width: 360px; flex: none; overflow: auto;
  background: var(--surface); border-right: 1px solid var(--border); padding: 18px;
  z-index: 1000;   /* above Leaflet's panes and controls */
}
.mapframe .map { flex: 1; height: auto; min-height: 0; }
.sheet-handle { display: none; }
.placeholder-box {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 16px;
  color: var(--text-muted); font-size: .9rem; margin-top: 14px;
}
.chart-switch { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); margin: 12px 0; }
.chart-switch button {
  flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 4px; font: 600 .85rem var(--font);
  color: var(--text-muted); cursor: pointer;
}
.chart-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chart-switch button[disabled] { cursor: not-allowed; opacity: .55; }

/* ----------------------------------------------------- phone: nav + sheet */
@media (max-width: 760px) {
  :root { --topbar-h: 56px; }
  .topbar-inner { gap: 12px; padding: 0 12px; }
  .topbar .brand-sub { display: none; }
  .logo { height: 26px; }
  .topbar .nav-toggle { display: inline-flex; order: -1; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--topbar-h);
    flex-direction: column; padding: 8px; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-pop);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav a[aria-current="page"]::after { display: none; }
  .brand { margin-right: auto; }
  .page { padding: 20px 14px 48px; }
  h1 { font-size: 1.35rem; }
  .page-actions .btn-label { display: none; }
  .mapframe { flex-direction: column; }
  .mapframe .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 55%;
    border-right: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0;
    box-shadow: var(--shadow-pop); padding-top: 8px; transition: max-height .2s;
  }
  .mapframe .panel.collapsed { max-height: 64px; overflow: hidden; }
  .sheet-handle {
    display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong);
    margin: 4px auto 12px; border: 0; padding: 0; cursor: pointer;
  }
}

/* ------------------------------------------------------- motion / print */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------- app pages (no inline styles: CSP) */
.flash-area { padding-bottom: 0; margin-bottom: -14px; }
.title-arrow { font-weight: 500; }
.legend-start { background: #fff; border-color: #1D9E5A; border-width: 3px; }
.legend-end { background: #2A2B33; }
.map-note { margin-left: auto; }
