/* Layout: one phone-width column; departure-board times on the left, Hong Kong taxi roof-light colours mark car type */
:root {
  --bg: #EEF1EE;
  --surface: #FFFFFF;
  --sunk: #F5F7F5;
  --ink: #141917;
  --muted: #66706B;
  --line: #DCE1DD;
  --red: #CE2027;
  --red-ink: #FFFFFF;
  --green: #22874A;
  --green-ink: #FFFFFF;
  --ride: #2F3D5C;
  --ride-ink: #FFFFFF;
  --amber: #F2B705;
  --overlay: rgba(14, 18, 16, .45);
  --shadow: 0 1px 2px rgba(20, 25, 23, .06), 0 6px 20px rgba(20, 25, 23, .06);
  --font-display: "DIN Condensed", "DIN Alternate", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101413; --surface: #1A1F1D; --sunk: #151918; --ink: #E9EEEB; --muted: #98A39D; --line: #2B3330;
    --red: #EE4A50; --red-ink: #1A0506; --green: #43B86E; --green-ink: #04150A; --ride: #8FA3D6; --ride-ink: #0B1222;
    --amber: #F5C534; --overlay: rgba(0, 0, 0, .6); --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101413; --surface: #1A1F1D; --sunk: #151918; --ink: #E9EEEB; --muted: #98A39D; --line: #2B3330;
  --red: #EE4A50; --red-ink: #1A0506; --green: #43B86E; --green-ink: #04150A; --ride: #8FA3D6; --ride-ink: #0B1222;
  --amber: #F5C534; --overlay: rgba(0, 0, 0, .6); --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}
html:lang(zh-Hant) { --font-body: -apple-system, BlinkMacSystemFont, "PingFang TC", "PingFang HK", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.app { max-width: 480px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 34px; height: 34px; border-radius: 9px; flex: none; display: block; }
.brand h1 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: .02em; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langs { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px; flex: none; }
.langs button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.demo { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-block: 4px 12px; }
.demo i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); display: inline-block; }

/* direction + filters */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 10px 8px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg small { display: block; font-weight: 400; font-size: 11px; opacity: .75; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sel { appearance: none; -webkit-appearance: none; width: 100%; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2366706B'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 30px 9px 12px; font-size: 14px; min-width: 0; }

/* groups + ride cards */
.group { margin-top: 20px; }
.group h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; display: flex; justify-content: space-between; }
.list { display: flex; flex-direction: column; gap: 8px; }
.ride { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.ride.is-full { opacity: .55; box-shadow: none; }
.ride.is-mine { border-color: var(--ink); }
.clock { font: 600 28px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.rel { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.rel.soon { color: var(--red); font-weight: 600; }
.route { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.route .arr { color: var(--muted); font-weight: 400; margin: 0 4px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.roof { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px 5px 2px 2px; letter-spacing: .04em; }
.roof-red { background: var(--red); color: var(--red-ink); }
.roof-green { background: var(--green); color: var(--green-ink); }
.roof-ride { background: var(--ride); color: var(--ride-ink); }
.side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dots { display: flex; gap: 3px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); }
.dots span.on { background: var(--ink); }
.need { font-size: 12px; font-weight: 700; color: var(--red); white-space: nowrap; }
.need.ok { color: var(--muted); font-weight: 600; }
.fare { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 24px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700; background: var(--red); color: var(--red-ink); width: 100%; }
.btn.ghost { background: var(--sunk); color: var(--ink); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.fab { position: fixed; z-index: 20; right: max(16px, calc(50% - 224px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: auto; border-radius: 999px; padding: 14px 20px; box-shadow: 0 8px 24px rgba(206, 32, 39, .35); }

/* tab bar */
.tabbar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar div { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; }
.tabbar button { border: 0; background: none; padding: 10px 0 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }

/* sheet */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h3 { margin: 0; font-size: 22px; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.x { border: 0; background: var(--surface); border-radius: 50%; width: 32px; height: 32px; flex: none; font-size: 18px; line-height: 1; color: var(--muted); }
.board { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 14px; flex-wrap: wrap; }
.board .clock { font-size: 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.row > span:first-child { color: var(--muted); flex: none; }
.row > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.note { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.member { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.member b { display: block; font-size: 14px; }
.member small { color: var(--muted); font-size: 12px; }
.wx { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.wx.hidden { filter: blur(4px); user-select: none; }
.sharebox { background: var(--surface); border: 1.5px dashed var(--green); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.sharebox p { margin: 0 0 10px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sharebox h4 { margin: 0 0 6px; font-size: 13px; color: var(--green); }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* form */
.field { margin-bottom: 14px; }
.field > label, .field > .lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.roof-pick[aria-pressed="true"].c-red { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.chip.roof-pick[aria-pressed="true"].c-green { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.chip.roof-pick[aria-pressed="true"].c-ride { background: var(--ride); border-color: var(--ride); color: var(--ride-ink); }
.chip:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.inp { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stepper button { border: 0; background: none; width: 40px; height: 38px; font-size: 18px; }
.stepper output { min-width: 32px; text-align: center; font: 600 20px var(--font-display); }

/* me */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.profile { display: flex; gap: 12px; align-items: center; }
.profile .avatar { width: 48px; height: 48px; font-size: 18px; }
.badge { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--green); font-weight: 600; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toggle:last-of-type { border-bottom: 0; }
.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }

/* login */
.login { padding-block: 48px 24px; }
.login .mark { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 20px; }
.login h2 { font-size: 26px; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 24px; }
.err { color: var(--red); font-size: 13px; margin-top: 6px; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; margin-top: 16px; font-size: 14px; }

.wxguide { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .78); color: #fff; padding: calc(16px + env(safe-area-inset-top, 0px)) 24px 24px; text-align: right; }
.wxguide svg { width: 90px; height: 110px; margin-right: 6px; }
.wxguide b { display: block; font-size: 22px; line-height: 1.4; white-space: pre-line; margin-top: 8px; }
.wxguide p { margin: 10px 0 24px; font-size: 14px; opacity: .8; }
.wxguide button { border: 1.5px solid #fff; background: none; color: #fff; border-radius: 999px; padding: 8px 22px; }
.confirm { background: var(--surface); border: 1.5px solid var(--red); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.confirm h4 { margin: 0; font-size: 16px; }
.confirm .warn { margin: 0; font-size: 13px; color: var(--red); font-weight: 600; }
.btn.danger { background: var(--surface); color: var(--red); border: 1.5px solid var(--red); }
.suggest { background: var(--surface); border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.suggest b { font-size: 15px; }
.suggest p { margin: 0; font-size: 13px; color: var(--muted); }
.suggest .btn { align-self: flex-start; }
.sched { font-size: 12px; color: var(--muted); }
.tag-big { border: 1px solid currentColor; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px; color: var(--ink); }
.tag-alert { background: var(--amber); color: #141917; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.banner { margin-top: 12px; background: var(--surface); border: 1px solid var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.banner i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.toggle .del { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; width: 30px; height: 30px; flex: none; }
.toggle-r { display: flex; align-items: center; gap: 4px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }
.tag-demo { background: var(--sunk); color: var(--muted); border: 1px dashed var(--line); font-size: 11px; padding: 0 5px; border-radius: 4px; }
.tag-cancel { background: var(--sunk); color: var(--muted); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.ride.is-cancelled { opacity: .5; box-shadow: none; }
.cancelbar { background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.badge-dot { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: var(--red-ink); font-size: 10px; line-height: 16px; font-weight: 700; text-align: center; margin-left: 2px; vertical-align: top; }
.tabbar button { position: relative; }
.tabbar .badge-dot { position: absolute; top: 4px; left: calc(50% + 6px); }
.msg { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: 0; }
.msg b { display: block; font-size: 14px; font-weight: 600; }
.msg.unread b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: middle; }
.msg small { color: var(--muted); font-size: 12px; }
.devcode { background: var(--sunk); border: 1px dashed var(--amber); border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* chat */
.sheet.chat { display: flex; flex-direction: column; height: 88%; overflow: hidden; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.chat-head .back { border: 0; background: var(--surface); border-radius: 50%; width: 32px; height: 32px; flex: none; font-size: 18px; }
.chat-head h3 { margin: 0; font-size: 16px; line-height: 1.25; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.chat-head small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.chatlist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; }
.chatlist .hint { margin: auto; text-align: center; max-width: 280px; }
.bubble { max-width: 82%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-color: var(--ink); border-radius: 14px 14px 4px 14px; }
.bubble small { display: block; font-size: 11px; opacity: .65; margin-bottom: 1px; }
.bubble time { display: block; font-size: 10px; opacity: .55; text-align: right; margin-top: 2px; }
.sysmsg { align-self: center; font-size: 12px; color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 2px 10px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; white-space: nowrap; font-size: 13px; padding: 6px 12px; }
.chatform { display: flex; gap: 8px; align-items: center; padding-top: 6px; }
.chatform .inp { flex: 1; min-width: 0; border-radius: 999px; padding: 10px 14px; }
.chatform .btn { width: auto; padding: 10px 18px; border-radius: 999px; }
.chatclosed { text-align: center; font-size: 13px; color: var(--muted); padding: 8px; }
.chatrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-weight: 700; text-align: left; }
.chatrow span { display: flex; align-items: center; gap: 8px; }
.chatrow svg { width: 20px; height: 20px; }
.tag-chat { background: var(--red); color: var(--red-ink); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }

/* voice */
.iconbtn { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; padding: 0; color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; }
.holdbtn { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 11px 12px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.holdbtn.rec { background: var(--red); color: var(--red-ink); border-color: var(--red); }
.holdbtn.cancel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bubble.voice { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; }
.bubble.voice.me { color: var(--bg); }
.vrow { display: flex; align-items: center; gap: 8px; }
.vrow svg { width: 18px; height: 18px; flex: none; }
.bars { display: flex; align-items: center; gap: 3px; flex: 1; height: 20px; }
.bars i { width: 3px; border-radius: 2px; background: currentColor; opacity: .55; }
.vrow b { font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.bubble.playing .bars i { animation: wave .9s ease-in-out infinite; opacity: .9; }
.bubble.playing .bars i:nth-child(2n) { animation-delay: .2s; }
.bubble.playing .bars i:nth-child(3n) { animation-delay: .4s; }
@keyframes wave { 50% { transform: scaleY(.45); } }
@media (prefers-reduced-motion: reduce) { .bubble.playing .bars i { animation: none; } }
.chathint { font-size: 11px; color: var(--muted); padding: 6px 2px 0; line-height: 1.4; }
