:root {
  --bg: #f6f7f9; --card: #fff; --text: #16191d; --muted: #667085; --line: #e4e7ec;
  --accent: #0e7c66; --accent-soft: #e3f3ef; --warn: #b54708; --warn-soft: #fef0e1;
  --bad: #b42318; --good: #067647; --radius: 14px; --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1214; --card: #181c1f; --text: #eef0f2; --muted: #98a2b3; --line: #2a3035;
          --accent: #3cc4a3; --accent-soft: #143029; --warn: #f5a35c; --warn-soft: #3a2614;
          --bad: #f97066; --good: #47cd89; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + 24px); }
header.top { position: sticky; top: 0; z-index: 500; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 700; letter-spacing: -.2px; }
header.top .brand b { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input[type=checkbox] { width: auto; }
textarea { min-height: 70px; }
button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 14px;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
button.small, .btn.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--bad); margin-top: 8px; min-height: 1em; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.grey { background: var(--line); color: var(--muted); }

nav.bottom { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); z-index: 600;
  display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.bottom button { flex: 1; background: none; color: var(--muted); border-radius: 0; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
nav.bottom button .ic { font-size: 20px; line-height: 1; }
nav.bottom button.on { color: var(--accent); }

/* date strip */
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.day { flex: 0 0 74px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 6px; text-align: center; cursor: pointer; color: var(--text); font-weight: 400; }
.day .dw { font-size: 12px; color: var(--muted); }
.day .dn { font-size: 18px; font-weight: 700; }
.day .dc { font-size: 11px; color: var(--muted); }
.day.off { opacity: .45; }
.day.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.map { height: 260px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 12px; z-index: 1; }

/* timeline */
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 0 30px; }
.tl li::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl .dot { position: absolute; left: 0; top: 12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.tl .dot.home { background: var(--muted); }
.tl .drive { color: var(--muted); font-size: 13px; padding: 6px 0; }
.tl .drive.tight { color: var(--warn); font-weight: 600; }
.tl .stop { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 4px 0; }
.tl .stop.cancelled { opacity: .5; text-decoration: line-through; }

/* slot options */
.opt { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--card); }
.opt.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.opt .when { font-weight: 700; }
.opt .cost { font-weight: 700; white-space: nowrap; }
.cost.g { color: var(--good); } .cost.a { color: var(--warn); } .cost.r { color: var(--bad); }
.times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.times button { background: var(--accent-soft); color: var(--accent); padding: 6px 10px; font-size: 14px; }
.times button.sel { background: var(--accent); color: #fff; }

.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; flex: 0 0 36px; }

.hours-row { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.hours-row input[type=time] { padding: 7px 8px; }
.hint { background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .dlg { padding: 16px; max-height: 85vh; overflow: auto; }

.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.leaflet-container { font: inherit; }
.num-marker { background: var(--accent); color: #fff; border-radius: 50%; width: 26px; height: 26px;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.num-marker.home { background: #475467; }
.num-marker.new { background: #d92d20; }
