/* Barlow Condensed (SIL OFL 1.1, fonts/OFL-barlow.txt), kept on the site */
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --vv-bottom: 0px;
  --map-key-bottom: calc(max(.15rem, env(safe-area-inset-bottom)) + .9rem + var(--vv-bottom, 0px));
  color-scheme: dark;
  --bg: #04060c;
  --fg: #f6fbff;
  --muted: #b5c2d6;
  --glass: rgb(8 12 22 / 0.8);
  --glass-strong: rgb(6 9 18 / 0.93);
  --edge: rgb(140 230 255 / 0.22);
  --cyan: #3df2ff;
  --magenta: #ff5ad1;
  --violet: #9d7bff;
  --amber: #ffd25a;
  --lime: #7cff6b;
  --hold: #ff8a6b;
  --holo: linear-gradient(115deg, var(--cyan), var(--violet) 45%, var(--magenta) 75%, var(--amber));
  --tap: 3.25rem;
  --radius: 1.25rem;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", var(--font-ui);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
#boot { position: fixed; inset: 0; background: #0c1c34; display: flex; flex-direction: column; pointer-events: none; }
#boot .boot-search { margin: 12px 12px 0; height: 52px; border-radius: 16px; background: rgb(6 9 18 / .93); border: 1px solid rgb(140 230 255 / .22); }
#boot .boot-legend { margin: auto 0 20px 12px; height: 28px; width: 220px; border-radius: 999px; background: rgb(6 9 18 / .8); border: 1px solid rgb(140 230 255 / .18); }
body {
  font: 500 16px/1.45 var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
a { color: var(--cyan); }
.ico { width: 1.25em; height: 1.25em; flex: none; }

.map { position: fixed; inset: 0; }
.map-fail { margin: 40vh 1rem 0; }

.glass {
  background: var(--glass);
  border: 1px solid var(--edge);
  box-shadow: 0 10px 40px rgb(0 0 0 / .55), inset 0 1px 0 rgb(255 255 255 / .06);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}

.results {
  list-style: none; margin: 0; padding: 0;
  &:not(:empty) { margin-top: .55rem; max-height: min(46vh, 22rem); overflow-y: auto; }
  & a {
    display: flex; align-items: center; gap: .75rem; min-height: var(--tap); padding: .55rem .6rem;
    border-radius: .9rem; color: inherit; text-decoration: none;
    &:hover, &:focus-visible { background: rgb(61 242 255 / .1); outline: none; }
  }
  & .r-main { display: grid; min-width: 0; flex: 1;
    & strong { font: 700 1.02rem/1.2 var(--font-display); }
    & span { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  }
  & .more { padding: .5rem .7rem; color: var(--muted); font-size: .88rem; }
}
.r-kind {
  width: .85rem; height: .85rem; border-radius: 50%; flex: none; background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  &[data-kind="disposal"] { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }
  &[data-ref="1"] { border-radius: 2px; transform: rotate(45deg) scale(.85); background: transparent; border: 2px solid var(--amber); box-shadow: none; }
}
.mini-source, .source {
  flex: none; font: 700 .72rem/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase;
  padding: .38rem .55rem; border-radius: 999px; color: #05060a; background: var(--cyan);
  &[data-source="route"] { background: var(--lime); }
  &[data-source="journey"] { background: var(--cyan); }
  &[data-source="written"] { background: var(--amber); }
  &[data-source="planned"] { background: var(--violet); color: #fff; }
  &[data-source="other"] { background: #d7e3f5; }
  &.none { background: transparent; color: var(--hold); border: 1px solid var(--hold); }
}

/* Map key: lower on the map, a little smaller, clear of the (i) button. */
.legend {
  position: fixed; z-index: 4; left: .5rem;
  bottom: var(--map-key-bottom);
  display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; max-width: calc(100vw - 3.8rem);
  transition: opacity .25s;
  & span { display: flex; align-items: center; gap: .22rem; }
}
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; flex: none;
  &.pad { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
  &.disposal { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }
  &.maponly { border-radius: 1px; transform: rotate(45deg) scale(.8); border: 1.5px solid var(--amber); }
}
body:has(.sheet:not([data-state="closed"])) :is(.legend, .road-review-key),
body:has(.results:not(:empty)) :is(.legend, .road-review-key),
body.navigating .road-review-key { visibility: hidden; }
body:has(.sheet:not([data-state="closed"])) .results { display: none; }

#road-review {
  position: relative; min-height: 32px; padding: .18rem .45rem; border: 1px solid var(--edge); border-radius: 999px;
  background: var(--panel); color: inherit; font: inherit; white-space: nowrap; cursor: pointer; flex: none;
  &::before { content: ""; position: absolute; inset: -6px; }
}
#road-review[aria-pressed="true"] { border-color: #9c8cf0; background: #473789; color: #fff; }
.road-review-key {
  position: fixed; z-index: 4; left: .5rem;
  bottom: calc(var(--map-key-bottom) + 3.05rem);
  display: grid; gap: .42rem; max-width: calc(100vw - 1.4rem); padding: .65rem .8rem;
  border: 1px solid var(--edge); border-radius: .75rem; background: var(--panel);
  color: var(--fg); font-size: .82rem; font-weight: 700;
  & span { display: flex; gap: .45rem; align-items: center; }
  & p { margin: .2rem 0 0; font-weight: 500; }
  &[hidden] { display: none; }
}
.review-swatch { width: 1.25rem; height: .24rem; border-radius: 2px; flex: none; }
.review-swatch.highway { background: #9c8cf0; }
.review-swatch.pad-road { background: #31baba; }
.review-swatch.held-road { background: repeating-linear-gradient(90deg, #eb8b42 0 6px, transparent 6px 9px); }

/* Bottom sheet card */
.sheet {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  max-width: 40rem; margin-inline: auto;
  height: 88dvh; border-radius: 1.6rem 1.6rem 0 0;
  background: var(--glass-strong);
  display: flex; flex-direction: column;
  container-type: inline-size; container-name: sheet;
  transform: translateY(calc(var(--y, 100%) + var(--drag, 0px)));
  transition: transform .42s var(--ease);
  view-transition-name: sheet;

  &[data-state="closed"] { --y: 105%; }
  &[data-state="peek"] { --y: 0%; height: 48dvh; }
  &[data-state="full"] { --y: 0%; }
}
.sheet-bar { display: flex; align-items: center; justify-content: center; position: relative; min-height: 3rem; }
.handle {
  width: 100%; height: 3rem; border: 0; background: transparent; cursor: grab; touch-action: none;
  & span { display: block; width: 3.2rem; height: .38rem; margin: auto; border-radius: 9px; background: var(--holo); opacity: .9; }
}
.icon-btn {
  width: var(--tap); height: var(--tap); border: 0; border-radius: 1rem; background: transparent; display: grid; place-items: center; cursor: pointer;
  & .ico { width: 1.4rem; height: 1.4rem; }
}
.sheet-bar .icon-btn { position: absolute; right: .35rem; top: 0; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; padding: 0 1.1rem calc(2rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.card-head {
  & .kind { margin: 0; display: flex; align-items: center; gap: .4rem; font: 700 .8rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan);
    &[data-kind="disposal"] { color: var(--magenta); } }
  & h2 { margin: .35rem 0 .2rem; font: 700 clamp(1.9rem, 8cqi, 2.6rem)/1.02 var(--font-display); letter-spacing: -.01em; }
  & .company { margin: 0; font-weight: 700; font-size: 1.05rem; }
  & .place { margin: .1rem 0 0; color: var(--muted); }
}

.block {
  margin-top: 1rem; padding: .9rem; border-radius: 1.1rem;
  background: rgb(255 255 255 / .045); border: 1px solid rgb(255 255 255 / .08);
  & h3 { margin: 0 0 .6rem; display: flex; align-items: center; gap: .45rem; font: 700 .85rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
    & .ico { color: var(--cyan); } }
}
.block-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; & h3 { margin: 0; } }
.source-line { margin: .5rem 0 .2rem; color: var(--muted); font-size: .85rem; & b { color: var(--fg); } }
.speed { margin: .2rem 0 .4rem; font-size: .88rem; color: var(--amber); font-weight: 600; }
.sub-h { margin: .9rem 0 .3rem; font: 700 .8rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.steps {
  list-style: none; margin: .5rem 0 0; padding: 0; position: relative;
  & .step { display: grid; grid-template-columns: 2.2rem 1fr; gap: .7rem; padding: .55rem 0; position: relative; }
  & .step:not(:last-child)::after {
    content: ""; position: absolute; left: 1.05rem; top: 2.7rem; bottom: -.2rem; width: 2px;
    background: linear-gradient(var(--cyan), transparent); opacity: .5;
  }
  & .step-n {
    width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
    font: 700 1rem/1 var(--font-display); color: #04060c; background: var(--cyan); box-shadow: 0 0 14px rgb(61 242 255 / .55);
  }
  & .step[data-kind="access"] .step-n { background: var(--lime); box-shadow: 0 0 14px rgb(124 255 107 / .5); }
  & .step-road { display: block; font: 700 1.08rem/1.25 var(--font-display); }
  & .step-alias { display: block; color: var(--muted); font-size: .84rem; }
  & .step-text { margin: .2rem 0 0; font-size: 1rem; line-height: 1.45; }
  & .step-tag { display: inline-block; margin-bottom: .2rem; font: 700 .7rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }
}

.hold, .ok {
  display: flex; gap: .6rem; align-items: flex-start; margin: .5rem 0 0; padding: .75rem .85rem; border-radius: .9rem; font-weight: 600;
}
.hold { background: rgb(255 138 107 / .12); border: 1px solid rgb(255 138 107 / .45); color: #ffd9cf; & .ico { color: var(--hold); } }
.ok { background: rgb(124 255 107 / .09); border: 1px solid rgb(124 255 107 / .35); & .ico { color: var(--lime); } }
.notes { margin: 0; padding-left: 1.1rem; & li { margin: .3rem 0; } }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem;
  & li { padding: .45rem .65rem; border-radius: .7rem; background: rgb(255 255 255 / .07); font-weight: 600; font-size: .92rem; }
  &.mono li { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
}
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.muted { color: var(--muted); }
.pin p { margin: .2rem 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--tap); margin-top: .6rem; padding: 0 1.1rem;
  border-radius: 1rem; font-weight: 700; text-decoration: none; color: #04060c; background: var(--holo);
  &.ghost { background: transparent; color: var(--cyan); border: 1px solid var(--cyan); }
}
.fine { margin: 1rem 0 0; color: #8d9bb3; font-size: .78rem; }

.skeleton { display: grid; gap: .7rem; padding-top: .5rem;
  & span { height: 1.4rem; border-radius: .6rem; background: linear-gradient(90deg, rgb(255 255 255 / .06), rgb(61 242 255 / .18), rgb(255 255 255 / .06)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
  & span:first-child { height: 2.4rem; width: 70%; }
}
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed; z-index: 9; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 6rem); transform: translateX(-50%);
  margin: 0; padding: .8rem 1rem; border-radius: 1rem; font-weight: 700; max-width: 92vw; text-align: center;
}

/* Directions (outbound maps apps) */
.dir-buttons { display: grid; gap: .55rem; }
.dir-buttons .btn { display: flex; align-items: center; gap: .7rem; min-height: 3.6rem; padding: .6rem 1rem; text-align: left; justify-content: flex-start;
  & .dir-text { display: grid; flex: 1; line-height: 1.15; }
  & b { font-size: 1.08rem; }
  & small { font-size: .8rem; font-weight: 700; opacity: .85; }
  &.ghost { background: rgb(255 255 255 / .04); color: var(--text, #eef6ff); border: 1px solid var(--cyan); }
}


/* In-app route: the first thing on the card */
.block.drive { padding-top: .75rem; padding-bottom: .75rem; }
.drive-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem;
  & .route-btn { margin-top: 0; min-height: 4rem; } }
.drive-note { margin: .5rem 0 0; color: #a9b4c8; font-size: .82rem; font-weight: 700; }

/* In-app route */
.route-btn { display: flex; width: 100%; align-items: center; gap: .7rem; min-height: 3.8rem; padding: .6rem 1rem; justify-content: flex-start; text-align: left; border: 0; cursor: pointer; font: inherit;
  background: linear-gradient(120deg, #b18cff, #3df2ff); color: #04060c;
  & .dir-text { display: grid; line-height: 1.15; } & b { font-size: 1.12rem; } & small { font-size: .8rem; font-weight: 700; }
  &:disabled { opacity: .6; }
}
#route-panel:not(:empty) { margin: .7rem 0 .4rem; }
.route-sum { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  & b { font-size: 1.6rem; } & span { font-size: 1.15rem; font-weight: 700; color: #e9ddff; } & small { color: #8d9bb3; font-weight: 700; } }
.turns { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .1rem;
  & li { display: grid; grid-template-columns: 2rem 1fr; gap: .1rem .6rem; padding: .55rem 0; border-top: 1px solid rgb(255 255 255 / .08); }
  & .n { grid-row: span 2; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
    background: rgb(177 140 255 / .18); color: #e9ddff; border: 1px solid rgb(177 140 255 / .5); & .ico { width: 1rem; height: 1rem; } }
  & .t { font-weight: 700; } & .d { color: #8d9bb3; font-size: .85rem; font-weight: 700; }
  & li.arrive .n { background: rgb(124 255 107 / .18); border-color: #7cff6b; color: #7cff6b; }
}
.route-wait { animation: pulse-text 1.2s ease-in-out infinite alternate; }
@keyframes pulse-text { from { opacity: .5; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .route-wait { animation: none; } }

/* Start mode: slim turn bar on top, a compact strip at the bottom */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav { position: fixed; z-index: 30; top: max(.5rem, env(safe-area-inset-top)); left: .5rem; right: .5rem; padding: .55rem .75rem .55rem .55rem;
  display: grid; grid-template-columns: 3.4rem 1fr; gap: .1rem .7rem; align-items: center; border-radius: 1.1rem;
  background: linear-gradient(140deg, rgb(10 14 26 / .95), rgb(20 12 40 / .95)); border: 1px solid rgb(177 140 255 / .55);
  box-shadow: 0 10px 30px rgb(0 0 0 / .5), 0 0 22px rgb(177 140 255 / .22);
  @media (min-width: 900px) { left: 50%; right: auto; width: 30rem; transform: translateX(-50%); }
}
.nav-turn { width: 3.4rem; height: 3.4rem; border-radius: .85rem; display: grid; place-items: center; background: linear-gradient(135deg, #b18cff, #3df2ff); color: #04060c;
  & .ico { width: 2.2rem; height: 2.2rem; stroke-width: 2.8; }
  &.hold-ico { background: #ff8a6b; } &.arrive-ico { background: #7cff6b; } }
.nav-main { display: grid; align-content: center; gap: .15rem; min-width: 0; }
.nav-line { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.nav-dist { font-size: 1.65rem; line-height: 1; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.nav-road { font-size: 1.05rem; font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-text { font-size: .98rem; font-weight: 700; line-height: 1.2; }
.nav-then { color: #a9b4c8; font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-strip { position: fixed; z-index: 30; left: .5rem; right: .5rem; bottom: max(.5rem, env(safe-area-inset-bottom)); padding: .45rem .5rem .45rem .9rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-radius: 1.1rem; color: #e6ecf7;
  background: rgb(10 14 26 / .94); border: 1px solid rgb(255 255 255 / .14); box-shadow: 0 -6px 26px rgb(0 0 0 / .45);
  @media (min-width: 900px) { left: 50%; right: auto; width: 30rem; transform: translateX(-50%); }
}
.nav-left { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; & b { font-size: 1.15rem; } }
.nav-ctl { display: flex; gap: .4rem; flex: none; }
.nav-btn { min-height: var(--tap, 3rem); min-width: var(--tap, 3rem); border-radius: .85rem; border: 1px solid rgb(255 255 255 / .2); background: rgb(255 255 255 / .06);
  color: inherit; font: inherit; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .7rem; cursor: pointer;
  &.end { border-color: #ff8a6b; color: #ffd9cf; background: rgb(255 138 107 / .14); } }

/* Missed-turn actions: big, easy to tap while driving */
.nav:has(.nav-action) { align-items: start; }
.nav-action { grid-column: 1 / -1; margin-top: .35rem; }
.nav-action-btn {
  width: 100%; min-height: 3.6rem; padding: .45rem .8rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  border-radius: .7rem; border: 2px solid #3df2ff; background: rgb(61 242 255 / .12); color: inherit;
  font: inherit; font-weight: 800; font-size: 1.05rem; line-height: 1.1; text-align: center;
  & small { font-size: .78rem; font-weight: 700; opacity: .88; }
  &.take-loop { border-color: #7cff6b; background: rgb(124 255 107 / .16); }
}
.nav-recenter { position: fixed; z-index: 30; right: .8rem; bottom: calc(max(.5rem, env(safe-area-inset-bottom)) + 4.6rem); min-height: 3rem; padding: 0 1rem;
  border-radius: 999px; border: 1px solid rgb(124 255 107 / .6); background: rgb(10 14 26 / .94); color: #d9ffd2; font: inherit; font-weight: 800;
  display: inline-flex; align-items: center; gap: .45rem; box-shadow: 0 8px 22px rgb(0 0 0 / .5); cursor: pointer;
  &[hidden] { display: none; } }
.truck-arrow { width: 48px; height: 48px; filter: drop-shadow(0 4px 10px rgb(0 0 0 / .6)); pointer-events: none; }
body.navigating .search-card, body.navigating .legend { display: none; }
body.navigating .sheet[data-state="peek"] { bottom: calc(max(.5rem, env(safe-area-inset-bottom)) + 4.3rem); }
.route-btn.start { background: linear-gradient(120deg, #7cff6b, #3df2ff); }

/* Card map */
.mini-slot { height: 13.5rem; border-radius: .9rem; overflow: hidden; background: #05070d; border: 1px solid rgb(255 255 255 / .1); }
.mini-map { width: 100%; height: 100%; }
@container sheet (min-width: 34rem) { .mini-slot { height: 17rem; } }
.map-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .55rem; font-size: .82rem; font-weight: 700;
  & span { display: inline-flex; align-items: center; gap: .35rem; } }
.sw { display: inline-block; width: 1.3rem; height: .3rem; border-radius: 3px;
  &.in { background: #3df2ff; box-shadow: 0 0 8px #3df2ff; }
  &.in-held { background: repeating-linear-gradient(90deg, #eb8b42 0 6px, transparent 6px 9px); }
  &.lease { background: #7cff6b; }
  &.out { background: repeating-linear-gradient(90deg, #ff5ad1 0 6px, transparent 6px 10px); }
  &.outline { height: .7rem; width: .9rem; border: 1.5px solid #ffd25a; background: rgb(255 210 90 / .15); }
  &.entrance { width: .8rem; height: .8rem; border-radius: 50%; border: 3px solid #fff; background: #04060c; }
}
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; & .btn { flex: 1 1 10rem; } }
.small { font-size: .82rem; margin: .45rem 0 0; }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
button.btn.ghost { border: 1px solid var(--cyan); }

/* Wider screens: card becomes a side panel */
@media (min-width: 900px) {
  .sheet {
    left: auto; right: 1rem; top: 1rem; bottom: 1rem; width: 27rem; height: auto; margin: 0; border-radius: 1.4rem;
    &[data-state="closed"] { --y: 0%; transform: translateX(110%); }
    &[data-state="peek"], &[data-state="full"] { --y: 0%; height: auto; }
  }
  .handle { visibility: hidden; }
}

@container sheet (min-width: 34rem) {
  .steps .step-text { font-size: 1.05rem; }
}

/* MapLibre controls in our colors */
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgb(8 12 22 / .8) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

::view-transition-old(sheet), ::view-transition-new(sheet) { animation-duration: .28s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  :root { --glass: rgb(0 0 0 / .95); --muted: #e2e8f2; }
}

@media (max-width: 375px) {
  .nav-strip { padding-left: .55rem; }
  .nav-ctl { gap: .25rem; }
  .nav-btn { padding-inline: .45rem; }
  .nav-left { white-space: normal; }
}

.img-credit {
  position: fixed; z-index: 3; left: .4rem;
  bottom: calc(max(.08rem, env(safe-area-inset-bottom)) + var(--vv-bottom, 0px));
  margin: 0; max-width: calc(100% - 3.8rem);
  padding: .04rem .22rem; border-radius: .2rem; font-size: .5rem; font-weight: 500;
  color: rgb(233 238 247 / .48); background: rgb(0 0 0 / .28);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; display: none;
}
body:is([data-map="aerial"], [data-map="custom"]) .img-credit:not(:empty) { display: block; }
.img-credit.unavailable { z-index: 4; display: block; background: var(--panel); color: #fff; font-size: .72rem; font-weight: 600; }
body.navigating .img-credit { bottom: calc(max(.5rem, env(safe-area-inset-bottom)) + 8.8rem + var(--vv-bottom, 0px)); }

/* Start mode: posted limit sign and live truck speed, above the strip, not over the turn banner */
.nav-speed { position: fixed; z-index: 30; left: .5rem; bottom: calc(max(.5rem, env(safe-area-inset-bottom)) + 4.6rem);
  display: flex; align-items: flex-end; gap: .45rem; pointer-events: none;
  &[hidden] { display: none; }
  @media (min-width: 900px) { left: calc(50% - 15rem + .5rem); }
}
.speed-sign { width: 3.25rem; background: #fff; color: #111; border: .22rem solid #111; border-radius: .22rem;
  text-align: center; box-shadow: 0 4px 12px rgb(0 0 0 / .5); font-family: var(--font-display); line-height: 1;
  padding: .12rem 0 .1rem; }
.speed-sign-lbl { display: block; font-size: .48rem; font-weight: 800; letter-spacing: .04em; line-height: 1.05; }
.speed-sign-n { display: block; font-size: 1.85rem; font-weight: 800; line-height: .9; padding: .02rem 0 .06rem; }
.truck-speed { min-width: 3.5rem; padding: .2rem .4rem .15rem; text-align: center; background: var(--panel, #0c1c34);
  background-image: var(--plate, none); border: 2px solid var(--edge, #1a2a44); border-radius: .45rem;
  box-shadow: 0 4px 12px rgb(0 0 0 / .5); color: #fff; }
.truck-speed-n { display: block; font: 800 1.85rem/.9 var(--font-display, inherit); color: #fff; }
.truck-speed.over .truck-speed-n { color: #d0142c; }
.truck-speed-u { display: block; font: 800 .62rem/1 var(--font-display, inherit); letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #a9b4c8); }


/* Pad card for drivers: header, big actions, then Overview / Wells / Roads tabs */
.sheet-bar { padding: .45rem .7rem .2rem; min-height: 3.4rem; }
.sheet-bar .handle { position: absolute; inset: 0; width: auto; margin-inline: 6.5rem; }
.sheet-btn {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .3rem; min-height: 2.75rem; padding: 0 .9rem;
  border: 1px solid rgb(255 255 255 / .14); border-radius: 999px; background: rgb(255 255 255 / .06); color: var(--fg);
  font: 700 .95rem/1 var(--font-display); cursor: pointer;
  & .ico { width: 1.2rem; height: 1.2rem; }
}
#sheet-back { margin-right: auto; }
#close { margin-left: auto; }
#sheet-back[hidden] + .handle + #close, .sheet-bar #close:only-of-type { margin-left: auto; }
.sheet-bar:has(#sheet-back[hidden]) { justify-content: flex-end; }
.card-head {
  & .head-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
  & h2 { margin-top: .15rem; }
}
.fav {
  width: var(--tap); height: var(--tap); display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .05); color: var(--muted);
  & .ico { width: 1.45rem; height: 1.45rem; }
  &[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); & .ico { fill: currentColor; } }
}
.block.drive { margin-top: .8rem; }
.drive-note { margin: .55rem 0 0; font-size: .85rem; color: var(--muted); & b { color: var(--fg); } }
.block.directions { padding: .7rem .8rem; }
.dir-buttons { grid-template-columns: 1fr 1fr;
  & .btn { margin-top: 0; min-height: 3.3rem; padding: .5rem .8rem; justify-content: space-between; }
  & .dir-text small { font-size: .78rem; } }
.directions .small { margin: .5rem 0 0; font-size: .8rem; }

.tabs {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem;
  margin: 1rem -.2rem 0; padding: .3rem; border-radius: 1.1rem;
  background: var(--glass-strong); border: 1px solid rgb(255 255 255 / .1); backdrop-filter: blur(14px);
  & [role="tab"] {
    min-height: 3rem; border: 0; border-radius: .8rem; background: transparent; color: var(--muted); cursor: pointer;
    font: 700 1rem/1 var(--font-display); letter-spacing: .02em;
    & small { display: inline-block; min-width: 1.4rem; margin-left: .25rem; padding: .15rem .35rem; border-radius: 999px; background: rgb(255 255 255 / .1); font-size: .75rem; color: var(--fg); }
  }
  & [aria-selected="true"] { background: var(--fg); color: #04060c; & small { background: rgb(4 6 12 / .14); color: #04060c; } }
  & [role="tab"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
}
.tab-panel { animation: panel-in .22s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .tab-panel { animation: none; } }

.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
  & .fact { display: grid; gap: .2rem; min-width: 0; &.wide { grid-column: 1 / -1; } }
  & .fact[hidden] { display: none; }
  & span { font: 700 .72rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  & b { font-size: 1rem; overflow-wrap: anywhere; }
  & small { color: var(--muted); font-size: .78rem; }
  & #ov-route b { font: 700 1.25rem/1.1 var(--font-display); color: var(--lime); }
}

/* Wells: a rounded bordered table, small muted header, bold names, divided rows */
.well-table {
  --cols: minmax(0, 1fr) max-content;
  border: 1px solid rgb(255 255 255 / .16); border-radius: .9rem; overflow: hidden;
  &.three { --cols: minmax(0, 1fr) max-content max-content; }
  &.well-records { --cols: minmax(0, 1fr) minmax(0, 53%); }
  & .wt-row { display: grid; grid-template-columns: var(--cols); gap: .4rem .65rem; align-items: center; min-height: 3.1rem; padding: .6rem .75rem;
    border-top: 1px solid rgb(255 255 255 / .09); }
  & .wt-record { align-items: start; overflow-wrap: anywhere; }
  & .wt-row:nth-child(odd):not(.wt-head) { background: rgb(255 255 255 / .035); }
  & .wt-head { min-height: 2.3rem; border-top: 0; background: rgb(255 255 255 / .07);
    & span { font: 700 .72rem/1.1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } }
  & b { font-size: .95rem; line-height: 1.25; overflow-wrap: anywhere; }
  & .mono { font-size: .88rem; color: var(--fg); white-space: nowrap; }
  &.three .mono { font-size: .74rem; letter-spacing: -.02em; }
  &.well-records .mono, &.wt-unpaired .mono { white-space: normal; }
  & .wt-detail { display: block; margin-top: .15rem; font-size: .78rem; color: var(--muted); }
  & .wt-status { display: block; margin-top: .15rem; font-size: .7rem; color: var(--muted); }
  & .wt-list { padding: .6rem .75rem; overflow-wrap: anywhere;
    & + .wt-list { border-top: 1px solid var(--edge); }
    & h3 { margin: 0 0 .25rem; font: 700 .85rem/1.15 var(--font-display); color: var(--muted); }
    & ul { margin: 0; padding-inline-start: 1rem; }
    & li + li { margin-top: .18rem; }
  }
}
.wells-panel { margin-top: 1rem; }
.wt-note { margin: .55rem .2rem 0; font-size: .8rem; color: var(--muted); }
.empty { margin: 0; }


/* ==== Truck layout in BrineSearch driver colors ==== */
:root {
  /* BrineSearch driver colors: the logo's navy and white, with hi-vis lime for action and signal amber for Start */
  --panel: #0c1c34; --panel-2: #13284a; --panel-3: #1c3762; --edge: #34507f;
  --fg: #ffffff; --muted: #c3cfe0;
  --accent: #3b82f6; --on-accent: #ffffff;
  --start: #ffb000; --on-start: #0c1c34;
  --warn: #ffb000; --hold-red: #d0142c;
  --pin-pad: #3b82f6; --pin-disposal: #f59e0b; --pin-map: #9fb0c8;
  --tab-on: #f4f7fb; --on-tab: #0c1c34;
  --plate: repeating-linear-gradient(0deg, rgb(255 255 255 / .03) 0 1px, transparent 1px 4px);
  --hazard: linear-gradient(var(--accent), var(--accent));
}
:root {
  --bg: #081426; --glass: var(--panel); --glass-strong: var(--panel);
  --cyan: var(--pin-pad); --magenta: var(--pin-disposal); --amber: var(--warn); --lime: var(--accent); --violet: var(--panel-3); --hold: var(--warn);
  --holo: var(--accent); --radius: .5rem; --tap: 3.4rem;
}
a { color: var(--fg); }

/* panels: solid, no blur or glow */
.glass { background: var(--panel); background-image: var(--plate); border: 2px solid var(--edge); box-shadow: 0 6px 18px rgb(0 0 0 / .55); backdrop-filter: none; -webkit-backdrop-filter: none; }
.r-kind, .dot.pad, .dot.disposal { box-shadow: none; }
.r-kind { background: var(--pin-pad); border: 2px solid #0d0d0d; &[data-kind="disposal"] { background: var(--pin-disposal); box-shadow: none; } &[data-ref="1"] { border-color: var(--pin-map); } }
.dot { width: .85rem; height: .85rem; border: 2px solid #0d0d0d; &.pad { background: var(--pin-pad); } &.disposal { background: var(--pin-disposal); } &.maponly { border-color: var(--pin-map); } }

/* card */
.sheet { border-radius: .8rem .8rem 0 0; border-top: 4px solid transparent; border-image: var(--hazard) 1; border-image-width: 4px 0 0 0; }
.handle span { background: var(--muted); opacity: 1; width: 3.4rem; height: .45rem; border-radius: 3px; }
.sheet-btn { border-radius: .45rem; border: 2px solid var(--edge); background: var(--panel-2); font: 800 1.05rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .05em; min-height: 3rem; }
.card-head {
  & .kind { font: 800 1rem/1 var(--font-display); letter-spacing: .1em; color: var(--pin-pad); &[data-kind="disposal"] { color: var(--pin-disposal); } }
  & h2 { font: 800 clamp(2.4rem, 11cqi, 3.2rem)/.95 var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
  & .company { font: 700 1.25rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
  & .company:has(.operator-logos), & .operator-logos { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
  & .operator-logos img { display: block; box-sizing: border-box; padding: .15rem; border-radius: .2rem; object-fit: contain; background: #fff; }
  & .operator-logos .logo-on-dark { background: var(--panel-2); }
}
.fav { border-radius: .45rem; border: 2px solid var(--edge); &[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); } }
.block { border-radius: .5rem; background: var(--panel-2); border: 2px solid var(--edge);
  & h3 { font: 800 1rem/1 var(--font-display); letter-spacing: .1em; & .ico { color: var(--accent); } } }
.btn.route-btn { border-radius: .5rem; min-height: 4.6rem; border: 2px solid rgb(0 0 0 / .5); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .25);
  background: #2563eb; color: var(--on-accent);
  & .ico { width: 2rem; height: 2rem; stroke-width: 2.6; } & b { font: 800 1.7rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
  & small { font-size: .82rem; font-weight: 800; } }
.route-btn.start { background: var(--start); color: var(--on-start); }
.btn { border-radius: .45rem; background: var(--accent); color: var(--on-accent); font-weight: 800;
  &.ghost { background: var(--panel-3); color: var(--fg); border: 2px solid var(--edge); } }
button.btn.ghost { border: 2px solid var(--edge); }
.dir-buttons .btn { background: var(--panel-3); color: var(--fg); border: 2px solid var(--edge); & b { font: 800 1.2rem/1 var(--font-display); text-transform: uppercase; } &.ghost { border-color: var(--edge); } }
.hold { background: color-mix(in srgb, var(--hold-red) 30%, transparent); border: 2px solid var(--hold-red); color: #fff; & .ico { color: #ff6b6b; } }
.tabs { border-radius: .5rem; background: var(--panel); border: 2px solid var(--edge); backdrop-filter: none;
  & [role="tab"] { border-radius: .35rem; font: 800 1.2rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .05em; min-height: 3.2rem; }
  & [aria-selected="true"] { background: var(--tab-on); color: var(--on-tab); & small { background: rgb(0 0 0 / .18); color: var(--on-tab); } } }
.facts-grid span, .wt-head span, .sub-h { font-family: var(--font-display); font-weight: 800; font-size: .85rem; letter-spacing: .1em; }
.facts-grid #ov-route b { color: var(--accent); font-size: 1.6rem; }
.well-table { border: 2px solid var(--edge); border-radius: .5rem;
  & .wt-head { background: var(--panel-3); } & .wt-row { border-top-color: var(--edge); }
  & b { font: 700 1.12rem/1.15 var(--font-display); letter-spacing: .01em; } }
.steps {
  & .step:not(:last-child)::after { background: var(--edge); opacity: 1; width: 3px; }
  & .step-n { border-radius: .35rem; background: var(--accent); color: var(--on-accent); box-shadow: none; font: 800 1.2rem/1 var(--font-display); }
  & .step[data-kind="access"] .step-n { background: var(--start); color: var(--on-start); box-shadow: none; }
  & .step-road { font: 800 1.3rem/1.15 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
  & .step-tag { color: var(--warn); font-size: .85rem; }
}
.speed { color: var(--warn); }
.source, .mini-source { border-radius: .3rem; background: var(--panel-3) !important; color: var(--fg) !important; border: 2px solid var(--edge); font-size: .8rem; }
.route-sum { & b { font: 800 2.2rem/1 var(--font-display); color: var(--accent); } & span { color: var(--fg); font: 800 1.4rem/1 var(--font-display); } }
.turns { & li { border-top-color: var(--edge); } & .n { border-radius: .35rem; background: var(--panel-3); color: var(--fg); border: 2px solid var(--edge); }
  & li.arrive .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } & .t { font-size: 1.05rem; } }
.sw { &.in { background: var(--route-in, var(--fg)); box-shadow: none; } &.lease { background: #7fbf3f; } &.out { background: repeating-linear-gradient(90deg, var(--warn) 0 6px, transparent 6px 10px); }
  &.entrance { border: 3px solid var(--pin-pad); background: #0d0d0d; } }
.mini-slot { border-radius: .45rem; border: 2px solid var(--edge); }
.skeleton span { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; }

/* Start mode: big turn plate, huge distance */
.nav { background: var(--panel); background-image: var(--plate); border: 3px solid var(--accent); border-radius: .6rem; box-shadow: 0 8px 22px rgb(0 0 0 / .6);
  grid-template-columns: 5rem 1fr; padding: .6rem .8rem .6rem .6rem; }
.nav-turn { width: 5rem; height: 5rem; border-radius: .45rem; background: var(--accent); color: #0d0d0d; border: 3px solid #0d0d0d;
  & .ico { width: 3.4rem; height: 3.4rem; stroke-width: 3.2; } &.hold-ico { background: var(--hold-red); color: #fff; } &.arrive-ico { background: var(--start); color: var(--on-start); } }
.nav-dist { font: 800 2.9rem/.9 var(--font-display); color: var(--accent); }
.nav-road { font: 800 1.45rem/1.05 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.nav-text { font: 700 1.15rem/1.15 var(--font-display); }
.nav-then { font: 700 1rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.nav-strip { background: var(--panel); background-image: var(--plate); border: 2px solid var(--edge); border-radius: .6rem; }
.nav-left { font-family: var(--font-display); text-transform: uppercase; & b { font-size: 1.6rem; color: var(--accent); } }
.nav-btn { border-radius: .45rem; border: 2px solid var(--edge); background: var(--panel-3); min-height: 3.4rem; min-width: 3.4rem;
  &.end { background: var(--hold-red); border-color: var(--hold-red); color: #fff; font: 800 1.2rem/1 var(--font-display); text-transform: uppercase; } }
.nav-recenter { border-radius: .45rem; border: 2px solid var(--accent); background: var(--panel); color: var(--fg); font-family: var(--font-display); text-transform: uppercase; }
.nav-action-btn {
  border-radius: .45rem; border: 3px solid var(--accent); background: var(--panel-3);
  font: 800 1.2rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .03em;
  & small { font: 700 .8rem/1.1 var(--font-ui); text-transform: none; letter-spacing: 0; color: var(--muted); }
  &.take-loop { border-color: var(--start, #7cff6b); background: rgb(124 255 107 / .18); }
}

@media (max-width: 350px) {
  .drive-buttons { grid-template-columns: minmax(0, 1fr); }
  .nav-line { display: grid; gap: .25rem; }
  .nav-road { display: block; overflow: visible; overflow-wrap: anywhere; }
}

/* held saved steps: the notice sits above the list */
.held-steps { margin-bottom: .6rem; }

/* ==== BrineSearch search card and Settings (BrineSearch driver --field-* colours: day, and night when chosen) ==== */
:root {
  --field-primary: #075ddd; --field-accent-text: #084aa9; --field-accent-wash: #edf4ff;
  --field-bg: #f6f8fb; --field-surface-solid: #fff; --field-surface-soft: #f1f4f8;
  --field-border: #dce3ed; --field-border-strong: #96a6bb; --field-text: #13263b; --field-muted: #586a7d;
  --field-warn: #b45309; --field-scheme: light;
  --field-shadow-raised: 0 14px 44px #102b4b25;
}
:root[data-appearance="night"] {
  --field-bg: #081725; --field-surface-solid: #10283b; --field-surface-soft: #173349; --field-border: #304b61; --field-border-strong: #7591a9;
  --field-text: #f5f8ff; --field-muted: #afc0d0; --field-accent-text: #a6ceff; --field-accent-wash: #173b62; --field-primary: #126bed;
  --field-warn: #fbbf24; --field-scheme: dark; --field-shadow-raised: 0 14px 44px #00000066;
}
@media (prefers-color-scheme: dark) {
  :root[data-appearance="system"] {
    --field-bg: #081725; --field-surface-solid: #10283b; --field-surface-soft: #173349; --field-border: #304b61; --field-border-strong: #7591a9;
    --field-text: #f5f8ff; --field-muted: #afc0d0; --field-accent-text: #a6ceff; --field-accent-wash: #173b62; --field-primary: #126bed;
    --field-warn: #fbbf24; --field-scheme: dark; --field-shadow-raised: 0 14px 44px #00000066;
  }
}

/* search card: one slim row (search field + square buttons), filters and results inside the same card.
   Compact on purpose (owner): 42px field and buttons, 3px card padding, so it covers little of the map. */
.search-card {
  position: fixed; z-index: 5;
  top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  max-width: 34rem; margin-inline: auto; padding: 3px; border-radius: 14px;
  background: var(--field-surface-solid); color: var(--field-text); border: 1px solid var(--field-border); box-shadow: 0 4px 16px #102b4b26;
  font-family: var(--font-ui); letter-spacing: -.015em; color-scheme: var(--field-scheme);
  & :focus-visible { outline: 3px solid var(--field-accent-text); outline-offset: 2px; }
}
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 42px); gap: 3px; }
.search-box {
  display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 42px; padding: 0 2px 0 10px;
  border: 1px solid var(--field-border); border-radius: 11px; background: var(--field-surface-soft); cursor: text;
  &:focus-within { border-color: var(--field-primary); }
  & > .ico { width: 18px; height: 18px; color: var(--field-muted); }
  & input {
    flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: transparent; outline: none !important;
    font-size: 16px; font-weight: 500; color: var(--field-text);
    &::placeholder { color: var(--field-muted); opacity: 1; }
    &::-webkit-search-cancel-button { display: none; }
  }
}
.search-clear {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--field-muted); cursor: pointer;
  & .ico { width: 18px; height: 18px; }
}
.square-btn {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; margin: 0;
  border: 1px solid var(--field-border); border-radius: 11px; background: var(--field-surface-soft); color: var(--field-text); cursor: pointer;
  & .ico { width: 20px; height: 20px; }
  &[aria-expanded="true"], &[data-active="true"], &.on { background: var(--field-accent-wash); border-color: var(--field-border-strong); color: var(--field-accent-text); }
  &[data-active="true"]::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--field-primary); }
}
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  & button {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 40px; padding: 0 4px;
    border: 1px solid var(--field-border); border-radius: 10px; background: var(--field-surface-soft); color: var(--field-text);
    font: 650 14px/1.1 var(--font-ui); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  & button[aria-pressed="true"] { background: var(--field-primary); border-color: var(--field-primary); color: #fff; }
}
.filter-panel { display: grid; gap: 3px; margin-top: 3px; }
.filter-panel .status { margin: 4px 8px 2px; font-size: 13px; font-weight: 600; color: var(--field-muted); }
.offline-line { display: none; }
:root[data-offline] .offline-line {
  display: flex; align-items: center; gap: 6px; margin: 6px 8px 2px; font-size: 13px; font-weight: 650; color: var(--field-warn);
  & .ico { width: 16px; height: 16px; }
}
.search-card .results {
  &:not(:empty) { margin-top: 4px; max-height: min(52dvh, 24rem); overflow-y: auto; overscroll-behavior: contain; }
  & li + li { border-top: 1px solid var(--field-border); }
  & a { min-height: 56px; padding: 7px 9px; border-radius: 10px; color: var(--field-text);
    &:hover, &:focus-visible { background: var(--field-surface-soft); outline: none; } }
  & .r-main strong { font: 650 16px/1.25 var(--font-ui); letter-spacing: -.015em; }
  & .r-main span { color: var(--field-muted); font-size: 13px; }
  & .more { padding: 10px; color: var(--field-muted); font-size: 13px; font-weight: 600; }
  & .more:has(button) { padding: 3px; }
  & .more button { width: 100%; min-height: 44px; border: 1px solid var(--field-border);
    border-radius: 10px; background: var(--field-surface-soft); color: var(--field-accent-text);
    font: inherit; cursor: pointer; }
}
@media (min-width: 900px) {
  .search-card { left: 1rem; right: auto; width: 26rem; margin: 0; }
}

/* map key: a small navy plate */
.legend {
  background: var(--panel); border: 1.5px solid var(--edge); color: var(--fg); box-shadow: 0 3px 10px rgb(0 0 0 / .3);
  padding: .25rem .5rem; gap: .5rem; font: 800 .75rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em;
}

/* map look swatches */
.look { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgb(0 0 0 / .25); flex: none;
  &.light { background: linear-gradient(135deg, #f2efe6 40%, #f7d58b 41% 47%, #f2efe6 48% 62%, #a9d3f5 63%); }
  &.custom { background: linear-gradient(135deg, #9ab37a 38%, #dcd19e 39% 60%, #8ebac8 61%); }
  &.aerial { background: linear-gradient(135deg, #47603a 30%, #7c8a5c 31% 55%, #c9b98e 56% 70%, #3e5a2f 71%); }
}

/* Settings: a clickable section list, then one section at a time */
.settings-scrim { position: fixed; inset: 0; z-index: 19; background: rgb(6 14 28 / .5); }
.settings {
  position: fixed; z-index: 20;
  top: max(16px, env(safe-area-inset-top)); bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  max-width: 440px; margin-inline: auto; padding: 0 12px 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--field-border-strong); border-radius: 20px; background: var(--field-bg); color: var(--field-text);
  box-shadow: 0 12px 40px #0d1a2b40; font-family: var(--font-ui); letter-spacing: -.015em; color-scheme: var(--field-scheme);
  & :focus-visible { outline: 3px solid var(--field-accent-text); outline-offset: 2px; }
}
.settings-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  margin: 0 -12px; padding: 12px; background: var(--field-bg); border-bottom: 1px solid var(--field-border);
  & h2 { margin: 0; flex: 1; min-width: 0; font-size: 24px; font-weight: 750; letter-spacing: -.04em; outline: none; overflow-wrap: anywhere; }
  & .square-btn { width: 44px; height: 44px; flex: none; background: var(--field-surface-solid); }
}
.settings:not([data-section]) #settings-back,
.settings[data-section=""] #settings-back { visibility: hidden; pointer-events: none; }
.set-home { display: grid; gap: 8px; margin-top: 16px; }
.set-link {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box;
  min-height: 64px; padding: 12px 12px 12px 14px;
  border: 1px solid var(--field-border); border-radius: 16px;
  background: var(--field-surface-solid); color: var(--field-text);
  font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
}
.set-link-ico {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--field-accent-wash); color: var(--field-accent-text);
  & .ico { width: 20px; height: 20px; }
}
.set-link .set-text { flex: 1; min-width: 0; }
.set-chevron { flex: none; display: grid; color: var(--field-muted);
  & .ico { width: 20px; height: 20px; } }
.set-panel .set-group:first-child { margin-top: 16px; }
.set-group { margin-top: 20px; }
.set-group h3 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px 6px;
  font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--field-muted);
  & .ico { width: 14px; height: 14px; }
}
.set-card { border: 1px solid var(--field-border); border-radius: 16px; background: var(--field-surface-solid); overflow: hidden;
  & > .seg { padding: 12px 12px 0; & button { min-height: 44px; } } }
.set-sub { margin: 0; padding: 8px 14px 12px; font-size: 13px; line-height: 1.4; color: var(--field-muted); }
.set-note { margin: 8px 6px 0; font-size: 12px; line-height: 1.45; color: var(--field-muted); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 14px;
  & + .set-row { border-top: 1px solid var(--field-border); }
}
.set-text { display: grid; gap: 2px; min-width: 0;
  & strong { font-size: 16px; font-weight: 650; }
  & small { font-size: 12.5px; line-height: 1.4; color: var(--field-muted); overflow-wrap: anywhere; } }
.switch {
  position: relative; flex: none; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: var(--field-border-strong); cursor: pointer; transition: background .2s;
  &::before { content: ""; position: absolute; inset: -8px; }
  & span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s var(--ease); }
  &[aria-checked="true"] { background: var(--field-primary); & span { transform: translateX(20px); } }
}
.set-btn {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--field-primary); color: #fff;
  font: 700 15px/1 var(--font-ui); cursor: pointer;
  &:disabled { opacity: .55; cursor: default; }
}
.set-row-stack { flex-direction: column; align-items: stretch; }
.set-btn-wide { width: 100%; }
.set-btn-quiet { background: var(--field-border-strong); color: var(--field-text); }
#offline-progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; appearance: none; background: var(--field-border);
  &::-webkit-progress-bar { background: var(--field-border); border-radius: 999px; }
  &::-webkit-progress-value { background: var(--field-primary); border-radius: 999px; }
  &::-moz-progress-bar { background: var(--field-primary); border-radius: 999px; } }
.install-steps { margin: 0; padding: 0 14px 14px 34px; font-size: 13.5px; line-height: 1.6; color: var(--field-text); }
.about { margin: 0; padding: 2px 14px;
  & div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--field-border); }
  & dt { color: var(--field-muted); font-size: 14px; }
  & dd { margin: 0; font-size: 13px; font-weight: 600; text-align: right; overflow-wrap: anywhere; } }
.credits { padding: 4px 14px 8px; font-size: 12.5px; line-height: 1.45; color: var(--field-muted);
  & p { margin: 6px 0; } & b { color: var(--field-text); font-weight: 650; } }
.key { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px 14px; border-top: 1px solid var(--field-border); font-size: 13px; font-weight: 650;
  & span { display: flex; align-items: center; gap: 6px; } }

/* A small note after a discarded page comes back into an in-progress trip */
.trip-note {
  position: fixed; z-index: 31; left: 50%; transform: translateX(-50%);
  top: calc(max(.5rem, env(safe-area-inset-top)) + 6.8rem);
  margin: 0; max-width: min(22rem, calc(100% - 1.2rem));
  padding: .4rem .7rem; border-radius: .45rem;
  background: var(--panel, #0c1c34); color: #fff;
  border: 2px solid var(--accent, #d4ff00);
  font: 700 .9rem/1.25 var(--font-display, inherit);
  text-align: center; box-shadow: 0 6px 16px rgb(0 0 0 / .45);
  &[hidden] { display: none; }
  @media (min-width: 900px) { max-width: 22rem; }
}
