/* 高雄跨年自駕 — styles */
:root {
  --bg: #f3f0ea;
  --bg-elev: #fbfaf7;
  --card: #ffffff;
  --card-2: #f7f5f1;
  --text: #1d1b19;
  --text-2: #6d6862;
  --text-3: #a39d95;
  --sep: rgba(40, 30, 20, 0.09);
  --sep-strong: rgba(40, 30, 20, 0.16);
  --accent: #e2553b;
  --accent-ink: #ffffff;
  --good: #1f9d6b;
  --good-bg: rgba(31, 157, 107, 0.12);
  --warn: #c7861a;
  --warn-bg: rgba(214, 150, 30, 0.14);
  --bad: #d4453a;
  --bad-bg: rgba(212, 69, 58, 0.12);
  --shadow-1: 0 1px 2px rgba(40, 30, 20, 0.06), 0 2px 8px rgba(40, 30, 20, 0.05);
  --shadow-2: 0 6px 24px rgba(40, 30, 20, 0.12), 0 2px 6px rgba(40, 30, 20, 0.06);
  --shadow-sheet: 0 -10px 40px rgba(20, 14, 8, 0.18);
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --tabbar-h: 58px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.32, 1.25, 0.5, 1);
  --c1: #e2553b;
  --c2: #f2a541;
  --day-ink: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e0d;
    --bg-elev: #161513;
    --card: #1c1b19;
    --card-2: #252321;
    --text: #f3f0eb;
    --text-2: #a8a29a;
    --text-3: #6f6a63;
    --sep: rgba(255, 245, 230, 0.08);
    --sep-strong: rgba(255, 245, 230, 0.16);
    --good: #3cc68f;
    --good-bg: rgba(60, 198, 143, 0.14);
    --warn: #e6a640;
    --warn-bg: rgba(230, 166, 64, 0.15);
    --bad: #f0675c;
    --bad-bg: rgba(240, 103, 92, 0.15);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; font-family: ui-rounded, "SF Pro Rounded", -apple-system, "PingFang TC", sans-serif; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
#app { max-width: 560px; margin: 0 auto; position: relative; min-height: 100dvh; }
.view { padding: calc(var(--safe-t) + 10px) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); animation: viewIn 0.32s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 8px 2px 14px; }
.topbar .eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.topbar h1 { margin: 2px 0 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow-1); font-size: 19px; color: var(--text);
  transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn:active { transform: scale(0.9); background: var(--card-2); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.soft { background: var(--card); color: var(--text-2); box-shadow: var(--shadow-1); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.live { background: var(--c1); color: #fff; }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px 12px calc(var(--safe-b) + 6px);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px);
  border-top: 0.5px solid var(--sep);
}
.tabbar-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; height: calc(var(--tabbar-h) - 12px); justify-content: center; color: var(--text-3); font-size: 11px; font-weight: 600; transition: color 0.2s; }
.tab svg.i { font-size: 24px; transition: transform 0.25s var(--ease-spring); }
.tab.active { color: var(--accent); }
.tab.active svg.i { transform: translateY(-1px) scale(1.06); }
.tab:active svg.i { transform: scale(0.86); }

/* ---------- Day switcher ---------- */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.day-chip {
  position: relative; border-radius: 16px; padding: 9px 6px 8px; text-align: center; background: var(--card);
  box-shadow: var(--shadow-1); transition: transform 0.18s var(--ease), box-shadow 0.25s; overflow: hidden;
}
.day-chip:active { transform: scale(0.95); }
.day-chip .d { font-size: 17px; font-weight: 800; line-height: 1.15; }
.day-chip .w { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.day-chip .l { font-size: 11.5px; font-weight: 700; margin-top: 2px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-chip.active { background: linear-gradient(150deg, var(--dc1), var(--dcm, color-mix(in srgb, var(--dc1) 50%, var(--dc2))) 55%, var(--dc2)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--dc1) 40%, transparent); }
.day-chip.active .w, .day-chip.active .l { color: rgba(255, 255, 255, 0.88); }
.day-chip .today-dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.day-chip.active .today-dot { background: #fff; }

/* ---------- Day hero ---------- */
.hero {
  position: relative; border-radius: var(--r-l); padding: 18px 18px 16px; color: #fff; overflow: hidden;
  background: linear-gradient(140deg, var(--c1) 0%, var(--cm, color-mix(in srgb, var(--c1) 50%, var(--c2))) 52%, var(--c2) 100%);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--c1) 30%, transparent);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,0.28), transparent 55%), radial-gradient(80% 60% at 0% 110%, rgba(0,0,0,0.18), transparent 60%);
}
.hero-art { position: absolute; right: -10px; top: -14px; width: 132px; height: 132px; opacity: 0.2; pointer-events: none; -webkit-mask-image: linear-gradient(200deg, #000 35%, transparent 75%); mask-image: linear-gradient(200deg, #000 35%, transparent 75%); }
.hero .k { position: relative; z-index: 1; font-size: 13px; font-weight: 700; opacity: 0.9; letter-spacing: 0.04em; }
.hero h2 { position: relative; z-index: 1; margin: 4px 0 14px; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -0.005em; max-width: 92%; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px 2px 2px; border-top: 1px solid rgba(255,255,255,0.22); }
.hero-stats .s { min-width: 0; }
.hero-stats .v { font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.hero-stats .t { font-size: 11.5px; opacity: 0.85; font-weight: 600; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 14px; }
.hero-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 12px;
  background: rgba(255,255,255,0.2); color: #fff; font-weight: 700; font-size: 14.5px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform 0.15s var(--ease), background 0.2s;
}
.hero-btn.solid { background: #fff; color: var(--c1); }
.hero-btn:not(.solid) { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32); }
.hero-btn:active { transform: scale(0.96); }
.hero-btn svg.i { font-size: 17px; }

/* ---------- Map ---------- */
.map-wrap { margin-top: 12px; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--shadow-1); background: var(--card); position: relative; isolation: isolate; z-index: 0; }
.map .leaflet-tile { filter: saturate(0.72) contrast(0.96) brightness(1.02); }
@media (prefers-color-scheme: dark) { .map .leaflet-tile { filter: invert(1) hue-rotate(180deg) saturate(0.55) brightness(0.92) contrast(0.9); } }
.map { height: 210px; width: 100%; background: var(--card-2); transition: height 0.35s var(--ease); }
.map-wrap.tall .map { height: 380px; }
.map-toggle { position: absolute; z-index: 500; right: 10px; bottom: 10px; height: 30px; padding: 0 11px; border-radius: 15px; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--shadow-1); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.map-offline { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: 13px; }
.mk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 800; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); font-family: ui-rounded, -apple-system, sans-serif; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 9px !important; background: color-mix(in srgb, var(--card) 70%, transparent) !important; color: var(--text-3) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }

/* ---------- Section header ---------- */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 4px 10px; }
.sec-h h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.005em; }
.sec-h .aside { font-size: 13px; color: var(--text-2); font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.start-note { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px 0; padding: 0 0 0 64px; color: var(--text-2); font-size: 13.5px; font-weight: 600; min-height: 36px; position: relative; }
.stop { display: grid; grid-template-columns: 52px 1fr; gap: 12px; position: relative; }
.stop .when { text-align: right; padding-top: 14px; }
.stop .when .a { font-size: 16px; font-weight: 800; line-height: 1.1; }
.stop .when .b { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }
.stop-card {
  position: relative; display: block; width: 100%; text-align: left; background: var(--card); border-radius: var(--r-m);
  padding: 13px 14px 12px; box-shadow: var(--shadow-1); transition: transform 0.18s var(--ease), box-shadow 0.25s;
  border: 1px solid transparent;
}
.stop-card:active { transform: scale(0.982); }
.stop-card .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--cat, var(--text-2)); }
.cat svg.i { font-size: 14px; }
.stop-card .name { font-size: 17px; font-weight: 750; font-weight: 700; line-height: 1.3; letter-spacing: -0.003em; }
.stop-card .desc { font-size: 13.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.stop-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.stop-card .chev { position: absolute; right: 12px; top: 14px; color: var(--text-3); font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 650; font-weight: 600; background: var(--card-2); color: var(--text-2); white-space: nowrap; }
.chip svg.i { font-size: 13px; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.day { background: color-mix(in srgb, var(--c1) 13%, transparent); color: var(--c1); }
.stop.past .stop-card { opacity: 0.62; }
.stop.now .stop-card { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 18%, transparent), var(--shadow-1); }
.stop.next .stop-card { border-color: color-mix(in srgb, var(--c1) 45%, transparent); }

.leg { display: grid; grid-template-columns: 52px 1fr; gap: 12px; min-height: 46px; }
.leg .rail { position: relative; }
.leg .body { display: flex; align-items: center; gap: 8px; padding: 6px 0 6px 10px; position: relative; }
.leg .body::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; border-left: 2px dashed color-mix(in srgb, var(--c1) 40%, transparent); }
.leg .info { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; font-weight: 600; color: var(--text-2); }
.leg .info svg.i { font-size: 16px; color: var(--c1); }
.leg .info b { color: var(--text); font-weight: 750; font-weight: 700; }
.leg .go { flex: none; white-space: nowrap; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px; border-radius: 14px; background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); font-size: 12.5px; font-weight: 750; font-weight: 700; transition: transform 0.15s var(--ease); }
.leg .go:active { transform: scale(0.92); }
.leg .go svg.i { font-size: 13px; }
.leg .warnline { font-size: 12px; color: var(--warn); font-weight: 600; }

.day-foot { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow-1); font-size: 13.5px; color: var(--text-2); }
.day-foot b { color: var(--text); }
.day-foot ul { margin: 6px 0 0; padding-left: 18px; }
.day-foot li { margin: 3px 0; }

/* ---------- Generic cards / lists ---------- */
.card { background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-1); overflow: hidden; }
.list { background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-1); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 50px; position: relative; width: 100%; text-align: left; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; border-top: 0.5px solid var(--sep); }
.li.plain + .li.plain::before, .li.noicon + .li::before, .li + .li.noicon::before { left: 14px; }
.li .ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; font-size: 19px; color: var(--c1); }
.li .main { flex: 1; min-width: 0; }
.li .ttl { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.li .sub { font-size: 13px; color: var(--text-2); margin-top: 1px; line-height: 1.45; white-space: pre-line; }
.li .end { flex: none; color: var(--text-2); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.li .end svg.i { color: var(--text-3); }
button.li:active, a.li:active { background: var(--card-2); }

/* ---------- Bottom sheet ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(15, 10, 5, 0.38); opacity: 0; transition: opacity 0.3s var(--ease); pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: calc(100dvh - var(--safe-t) - 18px);
  background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-sheet); pointer-events: auto;
  transform: translateY(105%); transition: transform 0.42s var(--ease); display: flex; flex-direction: column;
  will-change: transform;
}
.sheet.open { transform: translateY(0); }
.sheet-root.open .backdrop { opacity: 1; }
.sheet-grab { flex: none; padding: 8px 0 2px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--sep-strong); }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 16px 10px; touch-action: none; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-head .icon-btn { width: 32px; height: 32px; font-size: 16px; box-shadow: none; background: var(--card-2); color: var(--text-2); }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px calc(var(--safe-b) + 22px); }
.sheet-foot { flex: none; padding: 10px 16px calc(var(--safe-b) + 12px); border-top: 0.5px solid var(--sep); background: var(--bg); display: flex; gap: 10px; }

/* stop detail */
.sd-top { padding: 2px 2px 14px; }
.sd-top .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); font-weight: 600; }
.sd-top h2 { margin: 6px 0 4px; font-size: 25px; line-height: 1.22; font-weight: 800; letter-spacing: -0.01em; }
.sd-top p { margin: 4px 0 0; color: var(--text-2); font-size: 14.5px; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 16px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 9px; border-radius: 14px; background: var(--card);
  box-shadow: var(--shadow-1); font-size: 12.5px; font-weight: 700; color: var(--c1); transition: transform 0.15s var(--ease);
}
.act svg.i { font-size: 22px; }
.act:active { transform: scale(0.93); }
.act.primary { background: var(--c1); color: #fff; }
.act.disabled { opacity: 0.35; pointer-events: none; }
.group-t { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 18px 6px 7px; letter-spacing: 0.02em; display: flex; justify-content: space-between; align-items: center; }
.group-t .r { color: var(--text-3); font-weight: 600; }
.must { display: flex; align-items: center; gap: 12px; padding: 11px 14px; width: 100%; text-align: left; position: relative; }
.must + .must::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; border-top: 0.5px solid var(--sep); }
.must .box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--sep-strong); flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; transition: all 0.2s var(--ease-spring); }
.must.on .box { background: var(--c1); border-color: var(--c1); transform: scale(1.05); }
.must .box svg.i { opacity: 0; stroke-width: 3; }
.must.on .box svg.i { opacity: 1; }
.must .t { flex: 1; min-width: 0; }
.must .t .n { font-size: 15px; font-weight: 600; }
.must.on .t .n { color: var(--text-2); }
.must .t .x { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.must .p { font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.tips { margin: 0; padding: 12px 14px 12px 32px; font-size: 14px; color: var(--text); background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.tips li { margin: 3px 0; line-height: 1.5; }
.tips li::marker { color: var(--c1); }
.src { font-size: 11.5px; color: var(--text-3); margin: 10px 6px 0; line-height: 1.5; word-break: break-all; }
.src a { text-decoration: underline; text-decoration-color: var(--sep-strong); }

.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; width: 100%; text-align: left; position: relative; }
.pay-row + .pay-row::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: 0.5px solid var(--sep); }
.pay-row:active { background: var(--card-2); }
.pay-row .t { flex: 1; min-width: 0; }
.pay-row .t .n { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-row .t .x { font-size: 12.5px; color: var(--text-2); }
.pay-row .amt { font-size: 16px; font-weight: 800; }
.empty { padding: 18px 14px; text-align: center; color: var(--text-3); font-size: 14px; }

.av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; background: var(--avc, #999); }
.av.lg { width: 40px; height: 40px; font-size: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 50px; padding: 0 18px; border-radius: 15px;
  font-weight: 750; font-weight: 700; font-size: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow-1);
  transition: transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--c1); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c1) 35%, transparent); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.flex1 { flex: 1; }
.btn svg.i { font-size: 19px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.small { height: 40px; font-size: 14.5px; border-radius: 12px; }

/* booking toggle */
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--sep-strong); transition: background 0.25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.28s var(--ease-spring); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }

/* form */
.field { background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-1); overflow: hidden; }
.field + .field { margin-top: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 700; padding: 10px 14px 0; }
.field input, .field textarea, .field select { width: 100%; border: 0; outline: 0; background: transparent; padding: 4px 14px 11px; font-size: 16.5px; resize: none; }
.field textarea { min-height: 70px; line-height: 1.45; }
.amount-box { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 18px 12px 14px; cursor: text; }
.amount-box .cur { font-size: 20px; font-weight: 800; color: var(--text-3); }
.amount-box input { width: 2.2ch; min-width: 1.2ch; max-width: 78%; text-align: left; font-size: 46px; font-weight: 800; border: 0; outline: 0; background: transparent; padding: 0; letter-spacing: -0.02em; font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-variant-numeric: tabular-nums; }
.amount-box input::placeholder { color: var(--text-3); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.qchip { height: 30px; padding: 0 11px; border-radius: 15px; background: var(--card-2); color: var(--text-2); font-size: 13px; font-weight: 650; font-weight: 600; transition: transform 0.15s var(--ease), background 0.2s, color 0.2s; }
.qchip:active { transform: scale(0.93); }
.qchip.on { background: var(--c1); color: #fff; }
.who { display: flex; gap: 10px; padding: 8px 12px 12px; overflow-x: auto; scrollbar-width: none; }
.who::-webkit-scrollbar { display: none; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; font-size: 12px; font-weight: 650; font-weight: 600; color: var(--text-2); transition: transform 0.15s var(--ease); }
.who-btn .av { width: 40px; height: 40px; font-size: 16px; opacity: 0.35; transition: opacity 0.2s, transform 0.25s var(--ease-spring), box-shadow 0.2s; }
.who-btn.on .av { opacity: 1; transform: scale(1.06); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--avc); }
.who-btn.on { color: var(--text); }
.who-btn:active { transform: scale(0.92); }
.split-note { font-size: 12.5px; color: var(--text-2); padding: 0 14px 12px; font-weight: 600; }

/* ---------- Ledger ---------- */
.ledger-hero { border-radius: var(--r-l); padding: 18px; color: #fff; background: linear-gradient(140deg, #26384f, #3f6f8f); box-shadow: 0 10px 30px rgba(38, 56, 79, 0.28); position: relative; overflow: hidden; }
.ledger-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(100% 80% at 100% 0%, rgba(255,255,255,0.18), transparent 60%); pointer-events: none; }
.ledger-hero .k { font-size: 13px; font-weight: 700; opacity: 0.85; }
.ledger-hero .big { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 12px; }
.ledger-hero .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.2); }
.ledger-hero .v { font-size: 16.5px; font-weight: 800; }
.ledger-hero .t { font-size: 11.5px; opacity: 0.8; font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.2); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: #fff; border-radius: 4px; transition: width 0.6s var(--ease); }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--card-2); }
.stack > i { display: block; height: 100%; transition: width 0.6s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 2px 0; font-size: 13px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; }
.member-row + .member-row::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; border-top: 0.5px solid var(--sep); }
.member-row .main { flex: 1; min-width: 0; }
.member-row .n { font-weight: 700; font-size: 15.5px; }
.member-row .x { font-size: 12.5px; color: var(--text-2); }
.member-row .net { font-weight: 800; font-size: 16px; text-align: right; }
.member-row .net small { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.settle-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; position: relative; }
.settle-row + .settle-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.settle-row .arrow { color: var(--text-3); font-size: 16px; }
.settle-row .n { font-weight: 700; font-size: 15px; }
.settle-row .amt { margin-left: auto; font-weight: 800; font-size: 16px; }
.daybar { display: grid; grid-template-columns: 58px 1fr 84px; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; }
.daybar .lab { font-weight: 700; }
.daybar .track { height: 10px; border-radius: 5px; background: var(--card-2); overflow: hidden; }
.daybar .track i { display: block; height: 100%; border-radius: 5px; transition: width 0.6s var(--ease); }
.daybar .v { text-align: right; font-weight: 750; font-weight: 700; }
.fab {
  position: fixed; z-index: 45; right: max(18px, calc(50vw - 280px + 18px)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform 0.2s var(--ease-spring);
}
.fab:active { transform: scale(0.88); }
.fab svg.i { stroke-width: 2.4; }

/* ---------- Prep ---------- */
.progress-ring { display: flex; align-items: center; gap: 14px; padding: 16px; }
.progress-ring svg { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 7; }
.progress-ring .bg { stroke: var(--card-2); }
.progress-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.6s var(--ease); }
.progress-ring .big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; position: relative; width: 100%; text-align: left; }
.check-row + .check-row::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; border-top: 0.5px solid var(--sep); }
.check-row .box { margin-top: 1px; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--sep-strong); flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; transition: all 0.22s var(--ease-spring); }
.check-row.on .box { background: var(--good); border-color: var(--good); }
.check-row .box svg.i { opacity: 0; stroke-width: 3; }
.check-row.on .box svg.i { opacity: 1; }
.check-row .t { flex: 1; min-width: 0; }
.check-row .t .n { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.check-row.on .t .n { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-3); }
.check-row .t .x { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.check-row .side { flex: none; display: flex; gap: 6px; }
.mini-btn { height: 30px; padding: 0 10px; border-radius: 15px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12.5px; font-weight: 750; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.mini-btn svg.i { font-size: 14px; }
.due { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-right: 6px; }
.due.soon { background: var(--bad-bg); color: var(--bad); }
.due.later { background: var(--warn-bg); color: var(--warn); }
.due.done { background: var(--good-bg); color: var(--good); }
.due.now { background: var(--accent); color: #fff; }

/* ---------- Settings ---------- */
.member-edit { display: flex; align-items: center; gap: 12px; padding: 8px 14px; position: relative; }
.member-edit + .member-edit::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; border-top: 0.5px solid var(--sep); }
.member-edit input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16.5px; font-weight: 600; padding: 8px 0; min-width: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 300; transform: translate(-50%, -140%);
  background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); padding: 10px 16px; border-radius: 22px; font-size: 14.5px; font-weight: 650; font-weight: 600;
  box-shadow: var(--shadow-2); transition: transform 0.4s var(--ease-spring); display: flex; align-items: center; gap: 8px; max-width: 88vw;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.show { transform: translate(-50%, 0); }
.toast svg.i { font-size: 17px; color: var(--good); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (min-width: 600px) {
  .view { padding-left: 20px; padding-right: 20px; }
}

/* alternatives (方案 A / B) */
.alt-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 800; background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); }
.alt-or { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; margin: 8px 0 0; }
.alt-or span { grid-column: 2; display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; color: var(--text-3); letter-spacing: 0.2em; }
.alt-or span::before, .alt-or span::after { content: ""; flex: 1; border-top: 1px solid var(--sep-strong); }
.stop.dim .stop-card { opacity: 0.5; }
