:root {
  --bg: #faf7f2; --card: #fff; --ink: #1d2433; --muted: #5f6878; --line: #ebe5da;
  --brand: #1d4e89; --sky: #3b8fd9; --sun: #f08a5d; --accent: #2a9d8f; --warn: #d9822b; --idea: #8b7fd1; --danger: #b42318;
  --hero: linear-gradient(170deg, #cfe8ff 0%, #e9f4ff 45%, #fff1e6 100%);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10161f; --card: #19212c; --ink: #e8ebf0; --muted: #9aa3b2; --line: #28313d; --brand: #8fc1f2; --sky: #5aa9ec; --accent: #4cc3b2;
    --hero: linear-gradient(170deg, #142a45 0%, #1a2a3d 50%, #3a2a2a 100%); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 20px; color: var(--brand); text-decoration: none; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 7px; }
.brand svg { width: 26px; height: 26px; }
.net { font-size: 13px; background: #fff3cd; color: #7a5a00; padding: 2px 8px; border-radius: 10px; }
#menuBtn { margin-left: auto; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 22px; margin: 4px 0 4px; }
h2 { font-size: 15px; margin: 22px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
a { color: var(--brand); }
button, .btn { font: inherit; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
button.small { padding: 6px 10px; font-size: 14px; }
button:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
a.card { display: block; color: inherit; text-decoration: none; }
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 28px; }
/* landing */
.sky { margin: -16px -16px 0; padding: 28px 20px 26px; background: var(--hero); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.sky .kicker { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--sun); }
.sky h1 { font-size: 34px; line-height: 1.12; margin: 6px 0 10px; color: var(--brand); }
.sky p.lead { font-size: 17px; color: var(--ink); opacity: .85; max-width: 30em; margin: 0 0 18px; }
.sky .route { display: block; width: 100%; height: 86px; margin: 4px 0 6px; }
.btn.big { padding: 13px 22px; font-size: 17px; border-radius: 12px; box-shadow: 0 6px 16px rgba(29,78,137,.25); }
.pass { display: flex; background: var(--card); border-radius: 16px; box-shadow: 0 10px 30px rgba(29,78,137,.14); margin: 22px 0 6px; overflow: hidden; border: 1px solid var(--line); }
.pass .main { flex: 1; padding: 14px 16px; min-width: 0; }
.pass .stub { width: 96px; flex: none; border-left: 2px dashed var(--line); padding: 14px 10px; text-align: center; position: relative; background: linear-gradient(180deg, rgba(240,138,93,.08), rgba(59,143,217,.08)); }
.pass .stub::before, .pass .stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.pass .stub::before { top: -9px; } .pass .stub::after { bottom: -9px; }
.pass .stub b { display: block; font-size: 26px; line-height: 1.1; color: var(--brand); }
.pass .stub small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pass .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.pass h3 { margin: 2px 0 2px; font-size: 18px; }
.check { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; }
.check li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.check i { width: 18px; height: 18px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-style: normal; font-size: 11px; color: #fff; background: var(--accent); }
.check li.open i { background: transparent; border: 2px solid var(--warn); }
.check li.open { color: var(--muted); }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.feat .e { font-size: 24px; } .feat b { display: block; margin: 4px 0 2px; } .feat span { font-size: 14px; color: var(--muted); }
@media (max-width: 560px) { .feats { grid-template-columns: 1fr; } .sky h1 { font-size: 30px; } }
/* trip cards as boarding passes */
a.pass { color: inherit; text-decoration: none; margin: 12px 0; box-shadow: 0 4px 14px rgba(29,78,137,.08); }
a.pass:active { transform: scale(.995); }
.pass .route-line { display: flex; align-items: center; gap: 6px; color: var(--sky); font-size: 13px; margin-top: 2px; }
.pass .route-line::before, .pass .route-line::after { content: ""; flex: 1; border-top: 2px dotted currentColor; opacity: .5; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
textarea { min-height: 90px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 6px 0; }
.bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 2px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), var(--accent)); border-radius: 6px; }
.days { position: relative; padding-left: 22px; }
.days::before { content: ""; position: absolute; left: 6px; top: 26px; bottom: 10px; border-left: 2px dashed var(--line); }
.day { margin-top: 18px; position: relative; }
.day::before { content: ""; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 3px solid var(--sky); }
.day h3 { font-size: 15px; margin: 0 0 6px; display: flex; gap: 8px; align-items: baseline; color: var(--brand); }
.day h3 small { color: var(--muted); font-weight: 400; }
.item { min-width: 0; box-shadow: 0 2px 8px rgba(29,78,137,.05); display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 12px; margin: 6px 0; cursor: pointer; }
.item.pending { border-left-color: var(--warn); }
.item.idea { border-left-color: var(--idea); border-style: dashed; border-left-style: solid; }
.item .t { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .ic { font-size: 20px; }
.item b { display: block; }
.item .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.conf { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg); color: var(--muted); margin-left: 4px; }
.fab { background: var(--sun); position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); border-radius: 28px; padding: 14px 20px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form { padding: 16px; }
dialog h2 { margin-top: 0; color: var(--ink); text-transform: none; font-size: 18px; letter-spacing: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.actions .left { margin-right: auto; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.tbl table { border-collapse: collapse; font-size: 13px; width: max-content; min-width: 100%; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; max-width: 220px; }
.tbl select { padding: 4px; font-size: 13px; min-width: 110px; }
.code { font-size: 28px; letter-spacing: 8px; text-align: center; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
