/* twisty.au (from the NAS trips app, seed/site/app.css). Phone first: big type and targets for gloves and sunlight;
   dark mode follows the device. Riding blue and break orange are a validated pair (light: #2a78d6/#eb6834 on
   #fcfcfb, dark: #3987e5/#d95926 on #1a1a19), used only for the timeline's marks; text stays in ink. */
:root {
  color-scheme: light;
  --bg: #eef1f4; --surface: #fcfcfb; --surface-2: #f3f5f7; --ink: #0f1419; --ink-2: #3f4650; --muted: #5d6876;
  --line: #dde2e8; --accent: #1f6fd1; --accent-ink: #fff; --accent-soft: #e5effc;
  --head: #16324f; --head-ink: #fff;
  --ride: #2a78d6; --brk: #eb6834;
  --ok: #1e7d32; --warn: #9a5700; --bad: #c62828;
  --ok-soft: #e7f4e8; --warn-soft: #fff1dc; --bad-soft: #fde8e8; --info-soft: #e5effc;
  --today: #fff6d6; --hot: #fff1e6; --hot-line: #eb6834;
  --radius: 16px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --tabs-h: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1013; --surface: #1a1a19; --surface-2: #232427; --ink: #f0efec; --ink-2: #d2d1c9; --muted: #a2abb6;
    --line: #2f3338; --accent: #5b9cf0; --accent-ink: #0b1220; --accent-soft: #1b2b40;
    --head: #12243a; --ride: #3987e5; --brk: #d95926;
    --ok: #63c46f; --warn: #e5a54a; --bad: #ff7272;
    --ok-soft: #17301b; --warn-soft: #34260f; --bad-soft: #3a1a1a; --info-soft: #172739;
    --today: #33300f; --hot: #3a2416; --hot-line: #d95926;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.45;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
a { color: var(--accent); }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 8px; letter-spacing: -.01em; }
h1 a { color: inherit; text-decoration: none; }
h2 { font-size: 19px; margin: 24px 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
p { margin: 8px 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.eyebrow a { color: inherit; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.ic.ok { color: var(--ok); } .ic.warn { color: var(--warn); }

/* ---------------------------------------------------------------- header, tabs */
#top { position: sticky; top: 0; z-index: 20; background: var(--head); color: var(--head-ink);
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px; display: flex; align-items: center; gap: 4px; min-height: 52px; }
#top a { color: inherit; text-decoration: none; }
#top .back { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -6px; }
#top .back .ic { width: 26px; height: 26px; }
#top .title { flex: 1; font-weight: 650; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
#top .sync { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .14);
  border-radius: 99px; padding: 5px 10px; white-space: nowrap; }
#top .sync .ic { width: 16px; height: 16px; }
#top .sync[hidden], #top .back[hidden] { display: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: var(--tabs-h);
  justify-content: center; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 650; }
.tabs a .ic { width: 25px; height: 25px; }
.tabs a.on { color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 12px 14px 32px; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.queue { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.big { flex: 1 1 160px; min-height: 54px; font-size: 18px; }
.btn.wide { display: flex; width: 100%; margin-top: 8px; }
.btn.small { min-height: 38px; padding: 4px 12px; font-size: 15px; }
.btn.icon-only { padding: 8px 12px; flex: 0 0 auto !important; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; }
.btn.start { font-size: 20px; min-height: 60px; }
.btn.leave { width: 100%; margin: 4px 0 8px; }
.btns, .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.actions .btn { flex: 1 1 auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:disabled { opacity: .3; }
.linkish { background: none; border: 0; color: var(--accent); font: inherit; padding: 6px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; }
.chip .ic { width: 18px; height: 18px; color: var(--ink-2); }
.chip.hot { background: var(--hot); border-color: var(--hot-line); }
.chip.own { border-style: dashed; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.static { cursor: default; font-weight: 500; font-size: 14px; min-height: 34px; padding: 4px 12px; background: var(--surface-2); }
.badge { display: inline-block; font-size: 13px; font-weight: 650; padding: 1px 9px; border-radius: 99px;
  border: 1px solid currentColor; white-space: nowrap; vertical-align: 1px; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.badge.info { color: var(--accent); } .badge.muted { color: var(--muted); }
.field, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin: 4px 0 10px; }
.field.big { font-size: 24px; }
textarea { min-height: 110px; resize: vertical; }
label.check { display: flex; gap: 12px; align-items: center; margin: 8px 0; min-height: 44px; }
label.check input { width: 24px; height: 24px; flex: none; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; gap: 6px; }
summary::marker { content: ""; }
summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 20px; line-height: 1; color: var(--muted); }
details[open] > summary::before { transform: rotate(90deg); }

/* ---------------------------------------------------------------- cards, banners, lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card h2:first-child { margin-top: 2px; }
a.card { display: block; color: inherit; text-decoration: none; }
.card.user { background: var(--today); }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 15px; text-decoration: none; color: var(--ink); }
.banner .ic { margin-top: 2px; }
.banner.warn { background: var(--warn-soft); } .banner.warn .ic { color: var(--warn); }
.banner.bad { background: var(--bad-soft); font-weight: 650; } .banner.bad .ic { color: var(--bad); }
.banner.info { background: var(--info-soft); } .banner.info .ic { color: var(--accent); }
.list { list-style: none; padding: 0; margin: 6px 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li .ic { margin-top: 2px; color: var(--ink-2); }
.list .km { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 64px; color: var(--ink-2); font-size: 15px; }
.list.plain li { align-items: center; }
.statrow { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 10px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 22px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.wide b { font-size: 17px; }
.skeleton div { height: 22px; border-radius: 8px; margin: 14px 0; background: linear-gradient(90deg, var(--line), var(--surface-2), var(--line));
  background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton div:first-child { width: 40%; } .skeleton div:nth-child(2) { height: 34px; width: 80%; } .skeleton div:nth-child(3) { height: 180px; }
@keyframes shimmer { to { background-position: -200% 0; } }
img.map { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--line); margin: 10px 0; cursor: zoom-in; }

/* ---------------------------------------------------------------- Today, trips */
.hero { display: block; background: var(--surface); border-radius: var(--radius); padding: 16px; margin: 10px 0 16px;
  border: 1px solid var(--line); border-top: 4px solid var(--accent); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.hero h1 { font-size: 28px; }
.big-count { font-size: 34px; font-weight: 700; margin: 4px 0; }
.nowcard { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--ink); text-decoration: none; font-weight: 600; }
.nowcard .grow { display: flex; flex-direction: column; gap: 2px; }
.tripcard, .dayrow { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; margin: 10px 0; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.dayrow.today { background: var(--today); }
.thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--line); flex: none; }
.thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.dayrow strong { display: block; line-height: 1.25; }
.dayrow .chev { color: var(--muted); }
.mapthumb { position: relative; display: block; }
.mapthumb span { position: absolute; right: 10px; bottom: 18px; background: var(--surface); color: var(--ink); border-radius: 99px;
  padding: 6px 12px; font-weight: 650; font-size: 14px; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- start box and timeline */
.startbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; }
.startbox .btn.start { flex: 1 1 100%; }
.startbox.started { background: var(--ok-soft); border-radius: 12px; padding: 8px 8px 8px 12px; flex-wrap: nowrap; }
.startbox.started > div { flex: 1; }
.startbox.started .ic.ok { width: 24px; height: 24px; }
.startbox.quiet { margin: 6px 0; }
.tl { margin: 16px 0 6px; }
.tl-bar { position: relative; display: flex; gap: 2px; height: 28px; }
.tl-seg { border: 0; padding: 0 0 0 7px; min-width: 6px; border-radius: 4px; background: var(--ride); color: #fff;
  font: 650 13px/28px system-ui, sans-serif; text-align: left; cursor: pointer; position: relative; }
.tl-seg.brk { background: var(--brk); padding: 0; }
.tl-seg.on::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: -7px; height: 3px; border-radius: 2px; background: var(--ink); }
.tl-seg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tl-now { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.tl-now[hidden] { display: none; }
.tl-axis { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl-legend { color: var(--muted); font-size: 13px; }
.tl-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.sw.ride { background: var(--ride); } .sw.brk { background: var(--brk); }

/* ---------------------------------------------------------------- the day */
.dayhead { padding-bottom: 4px; }
.cardnav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 2px; }
.dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dot.on { background: var(--accent); width: 26px; border-radius: 6px; }
.dot.end { width: auto; height: auto; background: none; color: var(--muted); display: inline-flex; padding: 2px; }
.dot.end .ic { width: 18px; height: 18px; }
.dot.end.on { color: var(--accent); }
.cards { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 6px 14px 10px;
  margin: 0 -14px; scrollbar-width: none; align-items: flex-start; transition: height .25s ease; overscroll-behavior-x: contain; }
.cards::-webkit-scrollbar { display: none; }
.lcard { flex: 0 0 calc(100% - 24px); scroll-snap-align: center; scroll-snap-stop: always; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: var(--shadow); min-width: 0; }
.lc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-no { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: inline-flex; gap: 4px; align-items: center; }
.lc-when { font-weight: 650; font-variant-numeric: tabular-nums; display: inline-flex; gap: 4px; align-items: center; }
.lc-when .ic { width: 17px; height: 17px; color: var(--muted); }
.lc-title { font-size: 23px; margin: 6px 0 4px; line-height: 1.2; }
.lc-title .arrow { color: var(--muted); font-weight: 400; }
.lc-figs { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; color: var(--ink-2); }
.lc-figs b { font-size: 19px; color: var(--ink); }
.lc-here { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-weight: 600; font-size: 15px;
  display: flex; gap: 8px; align-items: center; }
.lc-here[hidden] { display: none; }
.lc-sec { margin: 14px 0 0; }
.lc-sec.ask { border-top: 1px solid var(--line); padding-top: 12px; }
.wz { display: flex; flex-direction: column; gap: 6px; }
.wz-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 12px; background: var(--surface-2);
  color: var(--ink); text-decoration: none; font-weight: 600; border: 1px solid var(--line); }
.wz-btn .n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  align-items: center; justify-content: center; font-size: 14px; flex: none; }
.wz-btn.via .n { background: var(--muted); }
.wz-btn .ext { margin-left: auto; color: var(--muted); width: 17px; height: 17px; }
details.turns ol { list-style: none; padding: 0; margin: 4px 0; font-size: 15px; }
details.turns li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
details.turns .km { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 44px; text-align: right; }
.lc-brk { margin: 16px -16px -16px; padding: 14px 16px 12px; border-top: 4px solid var(--brk); background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius); }
.lc-brk .brk-head { display: flex; gap: 12px; align-items: center; }
.lc-brk .brk-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--hot); display: flex; align-items: center; justify-content: center; flex: none; }
.lc-brk .brk-ic .ic { width: 24px; height: 24px; }
.lc-brk .brk-title { font-weight: 700; font-size: 18px; }
.lc-brk .offers li { font-size: 15px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 15px; }
.fact { display: contents; }
.fact dt { font-weight: 650; color: var(--ink-2); }
.fact dd { margin: 0; }
.fact.unknown dd { color: var(--warn); font-weight: 600; }
.lcard.end { border-top: 4px solid var(--ok); }
.daynav { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0; }
.more h2 { font-size: 17px; }
.more-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 8px 0; }

/* ---------------------------------------------------------------- composer, planner */
.about { margin: 0 0 4px; color: var(--ink-2); font-weight: 600; }
.cmp-box { border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px 8px; background: var(--surface); }
.cmp-box textarea { border: 0; margin: 0; padding: 8px 4px; min-height: 120px; font-size: 17px; background: transparent; }
.cmp-box textarea:focus { outline: none; }
.cmp-box:focus-within { border-color: var(--accent); }
.cmp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.mic { min-height: 46px; border-radius: 99px; }
.btn.mic.live, #jobMic.live { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(198, 40, 40, .15); } }
.chip.loc .loc-text { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-voice { padding: 4px; font-style: italic; }
.cmp-voice .lvl { display: inline-block; width: 48px; height: 6px; margin-right: 8px; vertical-align: middle;
  border-radius: 3px; background: var(--line); overflow: hidden; }
.cmp-voice .lvl i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .1s linear; }
.btn.mic:disabled, #jobMic:disabled { opacity: .7; }
.cmp-extra { display: flex; flex-direction: column; gap: 2px; }
.cmp-prompt { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); padding: 10px; border-radius: 10px; margin: 6px 0; }
.queued { border-left: 4px solid var(--warn); }
.job-title { font-size: 21px; flex: 1; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tool { font-size: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; margin: 3px 0; overflow-wrap: anywhere; display: flex; gap: 6px; flex-wrap: wrap; }
.tool .ic { width: 16px; height: 16px; }
.tool.failed { color: var(--bad); }
.note { color: var(--warn); margin: 6px 0; }
.turn-foot { margin: 10px 0 16px; }
.working::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------------------------------------------------------------- overlays */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 15px; z-index: 70;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: calc(100% - 24px); width: max-content; }
.toast a { color: inherit; font-weight: 700; margin-left: 8px; }
.toast[hidden] { display: none; }
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%);
  transition: transform .22s ease; max-width: 760px; margin: 0 auto; overscroll-behavior: contain; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 18px 0 6px; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 20px; }
.grip { position: absolute; left: 50%; top: 7px; width: 42px; height: 5px; border-radius: 3px; background: var(--line); transform: translateX(-50%); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; opacity: 0; transition: opacity .15s; }
.lightbox.open { opacity: 1; }
.lb-scroll { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; }
.lb-scroll img { max-width: 100%; max-height: 100%; display: block; }
.lb-scroll.zoomed { display: block; }
.lb-scroll.zoomed img { max-width: none; max-height: none; width: 260%; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 2; background: rgba(0, 0, 0, .6);
  color: #fff; border: 0; border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.lb-hint { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff;
  background: rgba(0, 0, 0, .6); padding: 6px 14px; border-radius: 99px; font-size: 14px; white-space: nowrap; }

/* ---------------------------------------------------------------- map */
body.full main { max-width: none; padding: 0; }
.mapview { height: calc(100dvh - 52px - var(--tabs-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.mapfallback { padding: 0 14px; }

/* ---------------------------------------------------------------- rendered markdown */
.md { overflow-wrap: anywhere; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; border-top: 1px solid var(--line); padding-top: 14px; } .md h3 { font-size: 16px; color: var(--ink); }
.md img { max-width: 100%; height: auto; border-radius: 10px; cursor: zoom-in; }
.md .table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.md pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; }
.md pre code { background: none; padding: 0; }
.md li { margin: 3px 0; }
.md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 4px solid var(--line); color: var(--muted); }
.md.reply { background: var(--surface); border-radius: 12px; padding: 4px 14px; border: 1px solid var(--line); }
a.ext::after { content: " ↗"; font-size: .85em; }

@media (min-width: 700px) {
  .lcard { flex-basis: calc(100% - 120px); }
  .cards { padding: 6px 60px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }


/* ------------------------------------------------------------------ Twisty: sign-in, account, people */
.wrap { max-width: 600px; margin: 0 auto; padding: 16px 14px; }
body.signedout main { max-width: 600px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
body.signedout { padding-bottom: 0; }
label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 6px; }
input[type="email"], input[type="text"], input[inputmode="numeric"] { width: 100%; font: inherit; font-size: 18px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
select { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); min-height: 48px; }
#inv-role { width: 100%; }
.pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 15px; }
.pick select { min-height: 40px; padding: 6px 10px; font-size: 15px; }
select:focus-visible, input:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input.code { letter-spacing: .3em; font-variant-numeric: tabular-nums; font-size: 24px; text-align: center; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin-top: 14px; }
.check input { width: 22px; height: 22px; }

.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.actions.tight { margin-top: 10px; }

.msg { border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 15px; }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.info { background: var(--accent-soft); color: var(--ink); }

.people { list-style: none; margin: 0; padding: 0; }
.people li { border-top: 1px solid var(--line); padding: 14px 0; }
.people li:first-child { border-top: 0; padding-top: 0; }
.people .who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.people .name { font-weight: 650; }
.people .email { color: var(--muted); font-size: 15px; word-break: break-all; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.role { background: transparent; }
.chip.role.admin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status { font-size: 15px; color: var(--ink-2); margin-top: 4px; }

.keys { list-style: none; margin: 0; padding: 0; }
.keys li { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line);
  padding: 10px 0; }
.keys li:first-child { border-top: 0; }
h1[tabindex="-1"]:focus { outline: none; }

/* ------------------------------------------------------------------ route sketches and the map (ADR S7-03) */
.sketch { display: block; width: 100%; height: 100%; }
.sketch polyline { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.sketch circle { stroke: var(--surface); stroke-width: 1.5; }
.sketch circle.from { fill: #0066cc; }
.sketch circle.to { fill: #22aa22; }
.thumb .sketch { padding: 4px; }
.sketchbox { aspect-ratio: 16 / 10; background: var(--surface-2); border: 1px solid var(--line); padding: 8px; cursor: pointer; }
.sketchbig { max-width: 420px; margin: 12px auto; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.mapview { position: relative; }
.mapnote { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom)); z-index: 5;
  background: var(--surface); color: var(--ink); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); }
.maplibregl-popup-content { font: 15px system-ui, sans-serif; color: #111; }
@media (prefers-color-scheme: dark) { .mapview .maplibregl-canvas { filter: brightness(0.82) contrast(1.05); } }
