/* Layout: one phone-width column (max 720px). The day view is a transit line:
   stops are stations on a vertical rail, legs are the track between them.
   Palette: white and orange; orange fills, a deeper orange for orange text so it stays readable. */
:root {
  --bg: #fff8f2;
  --surface: #ffffff;
  --surface-2: #fdeee2;
  --ink: #2a1d14;
  --muted: #76614f;
  --faint: #ad9784;
  --line: #f0dfd1;
  --accent: #f26b1d;
  --accent-text: #b94d0b;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7d6;
  --warn: #c8322b;
  --warn-soft: #fde8e6;
  --info: #2f63c9;
  --info-soft: #e6eefc;
  --ok: #1d7f47;
  --ok-soft: #dff2e6;
  --c-sight: #2f6bd6;
  --c-food: #d99a06;
  --c-transit: #7d8792;
  --c-stay: #8452c4;
  --c-shop: #cf3f78;
  --shadow: 0 1px 2px rgba(120, 60, 20, .06), 0 4px 14px rgba(120, 60, 20, .07);
  --scrim: rgba(40, 20, 8, .38);
  --font-display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 14px;
  /* depth: a top highlight plus a tight contact shadow and a soft long shadow */
  --hl: inset 0 1px 0 rgba(255, 255, 255, .9);
  --elev-1: 0 1px 1px rgba(120, 55, 15, .06), 0 2px 6px -1px rgba(120, 55, 15, .10), 0 10px 22px -12px rgba(120, 55, 15, .22);
  --elev-2: 0 1px 2px rgba(120, 55, 15, .08), 0 6px 14px -4px rgba(120, 55, 15, .16), 0 22px 40px -18px rgba(120, 55, 15, .32);
  --sunken: inset 0 2px 5px rgba(120, 55, 15, .12), inset 0 -1px 0 rgba(255, 255, 255, .7);
  --card-grad: linear-gradient(180deg, #ffffff 0%, #fffaf6 100%);
  --btn-grad: linear-gradient(180deg, #ff8c45 0%, #f26b1d 55%, #e05a0f 100%);
  --btn-glow: 0 8px 18px -8px rgba(226, 92, 15, .75);
  --page-grad: radial-gradient(120% 60% at 100% -10%, #ffe2cc 0%, rgba(255, 226, 204, 0) 60%), radial-gradient(90% 50% at -10% 0%, #fff1e4 0%, rgba(255, 241, 228, 0) 55%), #fff8f2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110d; --surface: #221a14; --surface-2: #2d231b; --ink: #f6ece4; --muted: #c4ae9c; --faint: #8c7766;
    --line: #3b2e24; --accent: #ff8a3d; --accent-text: #ffa465; --accent-ink: #1e0f04; --accent-soft: #3e2614;
    --warn: #ff736b; --warn-soft: #3e1d1a; --info: #8db4f6; --info-soft: #1b2a44; --ok: #72d39d; --ok-soft: #15301f;
    --c-sight: #7aa5f5; --c-food: #f2c14e; --c-transit: #a3adb8; --c-stay: #b993ec; --c-shop: #f07fac;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --scrim: rgba(0, 0, 0, .6);
    --hl: inset 0 1px 0 rgba(255, 255, 255, .06);
    --elev-1: 0 1px 1px rgba(0, 0, 0, .4), 0 4px 10px -2px rgba(0, 0, 0, .45), 0 14px 26px -14px rgba(0, 0, 0, .7);
    --elev-2: 0 2px 3px rgba(0, 0, 0, .45), 0 10px 20px -6px rgba(0, 0, 0, .55), 0 28px 48px -20px rgba(0, 0, 0, .8);
    --sunken: inset 0 2px 6px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .04);
    --card-grad: linear-gradient(180deg, #2a2019 0%, #211913 100%);
    --btn-grad: linear-gradient(180deg, #ffa262 0%, #ff8a3d 55%, #f0711f 100%);
    --btn-glow: 0 8px 20px -8px rgba(255, 138, 61, .55);
    --page-grad: radial-gradient(120% 60% at 100% -10%, #3a2414 0%, rgba(58, 36, 20, 0) 60%), #17110d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17110d; --surface: #221a14; --surface-2: #2d231b; --ink: #f6ece4; --muted: #c4ae9c; --faint: #8c7766;
  --line: #3b2e24; --accent: #ff8a3d; --accent-text: #ffa465; --accent-ink: #1e0f04; --accent-soft: #3e2614;
  --warn: #ff736b; --warn-soft: #3e1d1a; --info: #8db4f6; --info-soft: #1b2a44; --ok: #72d39d; --ok-soft: #15301f;
  --c-sight: #7aa5f5; --c-food: #f2c14e; --c-transit: #a3adb8; --c-stay: #b993ec; --c-shop: #f07fac;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --scrim: rgba(0, 0, 0, .6);
    --hl: inset 0 1px 0 rgba(255, 255, 255, .06);
    --elev-1: 0 1px 1px rgba(0, 0, 0, .4), 0 4px 10px -2px rgba(0, 0, 0, .45), 0 14px 26px -14px rgba(0, 0, 0, .7);
    --elev-2: 0 2px 3px rgba(0, 0, 0, .45), 0 10px 20px -6px rgba(0, 0, 0, .55), 0 28px 48px -20px rgba(0, 0, 0, .8);
    --sunken: inset 0 2px 6px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .04);
    --card-grad: linear-gradient(180deg, #2a2019 0%, #211913 100%);
    --btn-grad: linear-gradient(180deg, #ffa262 0%, #ff8a3d 55%, #f0711f 100%);
    --btn-glow: 0 8px 20px -8px rgba(255, 138, 61, .55);
    --page-grad: radial-gradient(120% 60% at 100% -10%, #3a2414 0%, rgba(58, 36, 20, 0) 60%), #17110d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iPhone zooms the whole page into any text field under 16px and does not zoom back, which forces sideways scrolling. */
input, select, textarea { font-size: max(16px, 1rem) !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { touch-action: manipulation; overflow-x: hidden; }
.shell { overflow-x: clip; }
button { cursor: pointer; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 12px 120px; min-height: 100%; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; }
.topbar .spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 2px; padding: 6px 8px 6px 2px; border: 0; background: none; color: var(--accent-text); font-weight: 500; }
.back::before { content: ""; width: 9px; height: 9px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 6px 0 6px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin: 0; text-wrap: balance; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; color: var(--muted); font-weight: 500; }

.banner { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; background: var(--info-soft); color: var(--info); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.banner b { font-weight: 700; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ai { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: none; border-color: transparent; color: var(--accent-text); }
.btn.danger { color: var(--warn); border-color: var(--warn); background: none; }
.btn.danger.armed { background: var(--warn); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }

/* ---------- trips list ---------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.trip-grid { display: grid; gap: 12px; }
.trip-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; text-align: left; width: 100%; }
.trip-card .swatch { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: end start; padding: 7px; color: #fff; font-family: var(--font-mono); font-size: .72rem; }
.trip-card .t-name { font-weight: 700; font-size: 1.02rem; display: block; }
.trip-card .t-meta { color: var(--muted); font-size: .85rem; display: block; }
.trip-card .t-when { display: inline-block; margin-top: 4px; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.trip-card .t-when.now { background: var(--ok-soft); color: var(--ok); }
.trip-card .t-when.soon { background: var(--accent-soft); color: var(--accent-text); }

.empty { text-align: center; padding: 40px 12px 24px; }
.empty svg { width: 100%; max-width: 280px; height: auto; margin: 0 auto 16px; display: block; color: var(--faint); }
.empty p { color: var(--muted); max-width: 32ch; margin: 8px auto 20px; }
.empty .btn-row { justify-content: center; max-width: 380px; margin: 0 auto; }

/* ---------- cover ---------- */
.cover { border-radius: 16px; padding: 18px 18px 16px; color: #fff; position: relative; overflow: hidden; margin-bottom: 14px; }
.cover h1 { color: #fff; }
.cover .c-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; opacity: .92; margin-top: 6px; }
.cover .c-tag { position: absolute; top: 14px; right: 14px; font-size: .72rem; font-weight: 700; background: rgba(255,255,255,.2); padding: 2px 9px; border-radius: 999px; }
.cover .c-dest { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; opacity: .85; text-transform: uppercase; }

/* ---------- day cards on trip page ---------- */
.days { display: grid; gap: 10px; }
.day-card { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; width: 100%; text-align: left; }
.day-card .d-num { text-align: center; line-height: 1.15; }
.day-card .d-num b { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent-text); }
.day-card .d-num span { font-size: .72rem; color: var(--muted); }
.day-card .d-title { font-weight: 700; display: block; min-width: 0; overflow-wrap: anywhere; }
.day-card .d-meta { font-size: .82rem; color: var(--muted); display: block; }
.day-card .d-line { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.day-card .d-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-sight); display: block; }
.day-card.empty-day { box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.day-card > div { min-width: 0; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.plain { background: var(--surface-2); color: var(--muted); }

.cat-sight { --cat: var(--c-sight); } .cat-food { --cat: var(--c-food); } .cat-transit { --cat: var(--c-transit); }
.cat-stay { --cat: var(--c-stay); } .cat-shop { --cat: var(--c-shop); }

/* ---------- day view ---------- */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px 6px; padding-inline: 16px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: 0 0 auto; min-width: 52px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); line-height: 1.2; }
.strip button b { display: block; font-family: var(--font-mono); font-size: .85rem; }
.strip button span { font-size: .7rem; color: var(--muted); }
.strip button[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.strip button[aria-current="true"] span { color: inherit; opacity: .85; }
.strip button.has-warn { box-shadow: inset 0 -3px 0 var(--warn); }

.day-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.day-head > div { flex: 1; min-width: 0; }
.day-head .d-sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: .85rem; margin-bottom: 18px; box-shadow: var(--shadow); }
.summary .mono { font-weight: 500; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl > li { display: grid; grid-template-columns: 58px 26px minmax(0, 1fr); column-gap: 8px; position: relative; }
.tl-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .8rem; text-align: right; line-height: 1.2; padding-top: 12px; }
.tl-time .arr { display: block; font-weight: 500; }
.tl-time .dep { display: block; color: var(--faint); margin-top: 2px; font-size: .74rem; }
.tl-rail { position: relative; display: flex; justify-content: center; }

/* station node */
.tl-stop .tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: var(--rail, var(--line)); left: calc(50% - 2px); }
.tl-stop .node { position: relative; margin-top: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--cat, var(--c-sight)); z-index: 1; }
.tl-stop.visited .node { background: var(--cat); }
.tl-stop.is-warn .node { border-color: var(--warn); }
.tl-card { position: relative; margin: 4px 0; background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.tl-card .hit { display: block; width: 100%; min-height: var(--h, 64px); padding: 10px 46px 12px 12px; text-align: left; background: none; border: 0; border-radius: inherit; }
.tl-stop.is-warn .tl-card { border-color: var(--warn); background: var(--warn-soft); }
.tl-stop.visited .tl-card { opacity: .72; }
.tl-card .s-name { font-weight: 700; display: block; overflow-wrap: anywhere; padding-right: 4px; }
.tl-card .s-meta { font-size: .8rem; color: var(--muted); display: block; margin-top: 2px; }
.tl-card .s-cat { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--cat); letter-spacing: .06em; margin-right: 6px; }
.tl-card .s-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tl-card .s-note { font-size: .8rem; color: var(--muted); margin-top: 6px; display: block; }
.check { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; z-index: 2; }
.check svg { width: 14px; height: 14px; stroke: var(--accent-ink); stroke-width: 3; fill: none; opacity: 0; }
.visited .check { background: var(--ok); border-color: var(--ok); }
.visited .check svg { opacity: 1; stroke: #fff; }
.grip { position: absolute; bottom: 6px; right: 6px; width: 34px; height: 30px; border: 0; background: none; display: grid; place-items: center; touch-action: none; cursor: grab; color: var(--faint); z-index: 2; }
.grip svg { width: 16px; height: 16px; fill: currentColor; }
.tl-stop.dragging { z-index: 5; }
.tl-stop.dragging .tl-card { box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.drop-line { position: absolute; left: 92px; right: 0; height: 3px; background: var(--accent); border-radius: 2px; pointer-events: none; z-index: 6; }

/* track between stations */
.tl-leg { min-height: var(--h, 40px); }
.tl-leg .tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 2px); width: 4px; background: var(--c-transit); border-radius: 2px; }
.tl-leg.m-walk .tl-rail::before { background: none; border-left: 4px dotted var(--c-transit); width: 0; }
.tl-leg.m-taxi .tl-rail::before, .tl-leg.m-drive .tl-rail::before { background: repeating-linear-gradient(var(--c-transit) 0 8px, transparent 8px 13px); }
.tl-leg.is-late .tl-rail::before { background: var(--warn); border-color: var(--warn); }
.leg-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8rem; color: var(--muted); padding: 8px 0; align-self: center; }
.leg-body .l-mode { font-weight: 500; color: var(--ink); background: none; border: 0; padding: 4px 0; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.leg-body .l-stale { font-style: italic; color: var(--warn); }
.leg-body .l-nav { font-weight: 700; text-decoration: none; padding: 4px 0; }
.leg-body .l-wait { color: var(--info); font-weight: 500; }
.tl-leg.is-late .leg-body .l-mode { color: var(--warn); }

.tl-start .tl-rail::before, .tl-end .tl-rail::before { content: ""; position: absolute; left: calc(50% - 2px); width: 4px; background: var(--c-transit); }
.tl-start .tl-rail::before { top: 22px; bottom: 0; }
.tl-end .tl-rail::before { top: 0; height: 14px; }
.tl-start .node, .tl-end .node { position: relative; margin-top: 12px; width: 14px; height: 14px; border-radius: 3px; background: var(--ink); z-index: 1; }
.tl-end .node { margin-top: 12px; }
.tl-start .tl-time, .tl-end .tl-time { padding-top: 9px; }
.tl-start .edge, .tl-end .edge { font-size: .85rem; color: var(--muted); padding: 8px 0; background: none; border: 0; text-align: left; }
.tl-start .edge b, .tl-end .edge b { color: var(--ink); }

.day-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px 16px; text-align: center; color: var(--muted); }
.day-empty p { margin: 0 0 14px; }

/* sticky action bar */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.actionbar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; }
.actionbar .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > span, .field > legend { font-size: .82rem; font-weight: 500; color: var(--muted); padding: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.field input[type=time], .field input[type=date] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
.field textarea { min-height: 76px; resize: vertical; }
.field .hint { font-size: .76rem; color: var(--faint); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chips span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; }
.chips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips.small span { padding: 4px 10px; font-size: .8rem; }
.form-error { color: var(--warn); font-size: .85rem; min-height: 1em; }
.ai-note { font-size: .8rem; color: var(--muted); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 92%; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 40px rgba(0,0,0,.2); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; }
.sheet .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet .nav-links .btn { flex: 1 1 140px; }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (min-width: 760px) { .scrim { align-items: center; } .sheet { border-radius: 18px; max-height: 86%; } }

/* AI progress */
.ai-wait { text-align: center; padding: 18px 0 8px; }
.ai-wait .dots { display: inline-flex; gap: 6px; margin-bottom: 12px; }
.ai-wait .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
.ai-wait .dots i:nth-child(2) { animation-delay: .15s; } .ai-wait .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ai-wait .dots i { animation: none; opacity: .7; } }
.ai-wait .big { font-size: 1.05rem; font-weight: 700; }
.ai-wait .small { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.preview { display: grid; gap: 8px; margin: 6px 0 16px; }
.preview .p-day { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border-radius: 10px; padding: 10px; }
.preview .p-day b { font-family: var(--font-mono); color: var(--accent-text); }
.preview .p-day small { display: block; color: var(--muted); }
.preview .p-day > div { min-width: 0; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); pointer-events: none; }
#toast .t { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 10px; gap: 8px; }
.foot { margin-top: 28px; font-size: .78rem; color: var(--faint); text-align: center; }
@media (max-width: 380px) { .row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } h1 { font-size: 1.5rem; } }

/* ---------- trip tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-weight: 500; color: var(--muted); font-size: .9rem; }
.tabs button[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cover.has-img { background-size: cover !important; background-position: center !important; min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; }
.trip-card .swatch.has-img { background-size: cover !important; background-position: center !important; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tool-row .btn { flex: 1 1 150px; }

/* ---------- route view (line map) ---------- */
.route-day { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 0 10px; margin-bottom: 12px; }
.route-day header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 14px 4px; flex-wrap: wrap; }
.route-day header b { font-family: var(--font-mono); color: var(--accent-text); margin-right: 6px; }
.route-day header small { color: var(--muted); }
.line-map { overflow-x: auto; padding: 8px 14px 6px; }
.line-map ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; width: max-content; }
.line-map li.st { width: 92px; display: grid; justify-items: center; text-align: center; gap: 4px; }
.line-map li.st .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--cat, var(--c-sight)); }
.line-map li.st.warn .dot { border-color: var(--warn); }
.line-map li.st .nm { font-size: .78rem; font-weight: 500; line-height: 1.25; max-width: 88px; overflow-wrap: anywhere; }
.line-map li.st .tm { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
.line-map li.lg { width: 70px; display: grid; justify-items: center; padding-top: 3px; gap: 3px; }
.line-map li.lg .bar { width: 100%; height: 4px; background: var(--c-transit); border-radius: 2px; margin-top: 4px; }
.line-map li.lg.m-walk .bar { background: none; border-top: 4px dotted var(--c-transit); height: 0; }
.line-map li.lg.m-taxi .bar, .line-map li.lg.m-drive .bar { background: repeating-linear-gradient(90deg, var(--c-transit) 0 8px, transparent 8px 13px); }
.line-map li.lg a { font-size: .7rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.route-day .route-actions { padding: 4px 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.route-day .route-actions .btn { min-height: 38px; font-size: .88rem; }

/* ---------- money ---------- */
.money-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.money-top div { background: var(--surface); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.money-top small { display: block; color: var(--muted); font-size: .75rem; }
.money-top b { font-family: var(--font-mono); font-size: 1rem; font-weight: 500; overflow-wrap: anywhere; }
.meter { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.over i { background: var(--warn); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
.card h3 { font-size: .95rem; margin: 0 0 8px; }
.rates { display: grid; gap: 8px; }
.rates label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-size: .88rem; }
.rates input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: 100%; }
.transfer { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.transfer:last-child { border-bottom: 0; }
.transfer .arrow { color: var(--faint); }
.transfer .amt { margin-left: auto; font-family: var(--font-mono); font-weight: 500; }
.exp-list { list-style: none; margin: 0; padding: 0; }
.exp-day { font-size: .78rem; color: var(--muted); margin: 14px 0 6px; font-weight: 500; letter-spacing: .04em; }
.exp-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 10px 12px; background: var(--surface); border: 0; border-radius: 10px; margin-bottom: 6px; box-shadow: var(--shadow); }
.exp-row .t { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.exp-row .a { font-family: var(--font-mono); font-weight: 500; text-align: right; }
.exp-row .m { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }

/* ---------- checklist ---------- */
.check-group { margin-bottom: 14px; }
.check-group h3 { font-size: .8rem; color: var(--muted); font-weight: 500; letter-spacing: .06em; margin: 0 0 6px; }
.check-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 10px; padding: 4px 4px 4px 12px; margin-bottom: 6px; box-shadow: var(--shadow); }
.check-item label { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; min-width: 0; }
.check-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.check-item.done span { text-decoration: line-through; color: var(--faint); }
.check-item span { overflow-wrap: anywhere; }
.check-item .x { width: 36px; height: 36px; border: 0; background: none; color: var(--faint); font-size: 1.1rem; border-radius: 8px; }
.add-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-bottom: 14px; }
.add-row input, .add-row select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
@media (max-width: 420px) { .add-row { grid-template-columns: 1fr auto; } .add-row input { grid-column: 1 / -1; } }

/* ---------- chat ---------- */
.chat { display: grid; gap: 10px; padding-bottom: 20px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.6; }
.bubble.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.assistant { justify-self: start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.bubble.pending { color: var(--muted); }
.chat-empty { color: var(--muted); font-size: .9rem; }
.chat-empty .chips { margin-top: 10px; }
.chat-empty .chips button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); resize: none; min-width: 0; }
.composer .btn { flex: 0 0 auto; }

/* ---------- stop detail ---------- */
.detail-meta { color: var(--muted); font-size: .88rem; margin: -6px 0 12px; }
.detail-meta .s-cat { color: var(--cat); font-weight: 700; margin-right: 6px; }
.dsec { border-top: 1px solid var(--line); padding: 12px 0; }
.dsec h3 { font-size: .82rem; color: var(--muted); font-weight: 500; letter-spacing: .06em; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dsec p { margin: 0 0 8px; }
.dsec ul { margin: 0 0 8px; padding-left: 1.2em; }
.dsec li { margin-bottom: 3px; }
.issue-note { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: .88rem; margin-bottom: 8px; }
.issue-note.info { background: var(--info-soft); color: var(--info); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.stale-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; margin: -8px 0 14px; font-size: .86rem; }
.stale-bar .btn { margin-left: auto; }
.l-suggest { border: 0; background: none; color: var(--info); font-weight: 700; padding: 4px 0; font-size: .8rem; }

/* compare lists in AI previews */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.compare > div { background: var(--surface); border-radius: 10px; padding: 10px; min-width: 0; }
.compare h4 { margin: 0 0 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.compare ol { margin: 0; padding-left: 1.2em; font-size: .85rem; }
.compare li { overflow-wrap: anywhere; }
.compare li.new { color: var(--ok); font-weight: 500; }
.compare li.gone { color: var(--faint); text-decoration: line-through; }
.sug { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.sug b { overflow-wrap: anywhere; }
.sug small { grid-column: 1 / -1; color: var(--muted); }
.imp { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; }
.imp small { display: block; color: var(--muted); }
.imp.skip { opacity: .6; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); }

/* ---------- date range calendar ---------- */
.dr-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dr-btn { display: grid; gap: 2px; text-align: left; padding: 8px 12px; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dr-btn small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.dr-btn b { font-weight: 700; font-size: 1rem; }
.dr-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.dr-sum { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.cal { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font-size: 1rem; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.cal-week span { font-size: .74rem; color: var(--muted); padding: 4px 0; }
.cal-grid { row-gap: 4px; }
.cal-day { aspect-ratio: 1; max-height: 46px; width: 100%; border: 0; background: none; border-radius: 10px; font-family: var(--font-mono); font-size: .95rem; padding: 0; }
.cal-day.in-range { background: var(--accent-soft); border-radius: 0; }
.cal-day.is-start, .cal-day.is-end { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-day.is-today:not(.is-start):not(.is-end) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day:disabled { color: var(--faint); opacity: .4; cursor: default; }
.cal-hint { margin: 8px 0 0; font-size: .82rem; color: var(--accent-text); font-weight: 500; text-align: center; }

/* ---------- attachments ---------- */
.chatbar { flex-direction: column; gap: 6px; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; font-weight: 500; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.att-chip button { width: 26px; height: 26px; border: 0; background: none; color: inherit; border-radius: 50%; font-size: 1rem; line-height: 1; }
.composer .attach { flex: 0 0 auto; width: 44px; height: 44px; cursor: pointer; }
.bubble .att-line { display: block; font-size: .78rem; opacity: .85; margin-top: 4px; }
.chat-import { justify-self: start; }

/* ---------- conflict fix, theme picker, toast action ---------- */
.fix-btn { border-color: var(--warn); color: var(--warn); background: var(--surface); }
.theme-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.theme-pick span { margin-right: 4px; }
.theme-pick button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; }
.theme-pick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
#toast .t { display: flex; align-items: center; gap: 12px; }
#toast .t button { pointer-events: auto; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 8px; padding: 6px 12px; }
.file-pick .clip { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= depth pass: raised cards, sunken wells, glossy buttons ================= */
html, body { background: var(--page-grad); background-attachment: fixed; }
.trip-card, .day-card, .tl-card, .summary, .card, .route-day, .exp-row, .check-item, .money-top div, .preview .p-day, .sug, .imp, .compare > div, .dr-btn, .cal, .bubble.assistant {
  background: var(--card-grad);
  border: 1px solid var(--line);
  box-shadow: var(--hl), var(--elev-1);
}
.trip-card, .day-card, .tl-card, .exp-row, .route-day { transition: transform .18s ease, box-shadow .18s ease; }
@media (hover: hover) {
  .trip-card:hover, .day-card:hover, .tl-card:hover, .exp-row:hover { transform: translateY(-2px); box-shadow: var(--hl), var(--elev-2); }
}
.trip-card:active, .day-card:active, .exp-row:active { transform: translateY(1px) scale(.995); }
.day-card.empty-day { background: transparent; box-shadow: var(--sunken); border-style: dashed; }
.tl-stop.is-warn .tl-card { background: linear-gradient(180deg, var(--warn-soft), var(--surface)); border-color: var(--warn); box-shadow: var(--hl), 0 0 0 1px var(--warn), var(--elev-1); }

/* cover: glossy panel with a soft highlight and long shadow */
.cover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -40px 60px -30px rgba(0, 0, 0, .25), var(--elev-2); }
.cover::before { content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 70%); pointer-events: none; }
.cover::after { content: ""; position: absolute; left: -40px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%); pointer-events: none; }
.cover > * { position: relative; z-index: 1; }
.cover h1 { text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.trip-card .swatch { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 14px -6px rgba(0, 0, 0, .35); }

/* buttons: raised, pressed on tap */
.btn { box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .06), 0 4px 10px -6px rgba(0, 0, 0, .25); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .18); }
.btn.primary { background: var(--btn-grad); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); text-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
.btn.ai { background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 82%, #fff) 0%, var(--ink) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -8px rgba(0, 0, 0, .55); }
.btn.ghost { box-shadow: none; }
.btn.danger.armed { background: linear-gradient(180deg, #ef5a52, var(--warn)); }
.icon-btn { background: var(--card-grad); box-shadow: var(--hl), var(--elev-1); border-color: var(--line); }
.icon-btn:active { transform: translateY(1px); box-shadow: var(--sunken); }

/* tabs and date strip: sunken track, raised selection */
.tabs { box-shadow: var(--sunken); background: var(--surface-2); }
.tabs button[aria-current="true"] { background: var(--card-grad); box-shadow: var(--hl), var(--elev-1); color: var(--accent-text); font-weight: 700; }
.strip button { background: var(--card-grad); box-shadow: var(--hl), var(--elev-1); }
.strip button[aria-current="true"] { background: var(--btn-grad); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); }
.theme-pick { background: var(--surface-2); box-shadow: var(--sunken); padding: 6px 8px; border-radius: 999px; width: fit-content; max-width: 100%; }
.theme-pick button { box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .08); }
.theme-pick button[aria-pressed="true"] { background: var(--btn-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); }

/* form wells */
.field input, .field select, .field textarea, .add-row input, .add-row select, .composer textarea, .rates input {
  background: var(--surface); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08);
}
.field input:focus, .field select:focus, .field textarea:focus, .composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .06), 0 0 0 3px var(--accent-soft); }
.chips span { box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .07); }
.chips input:checked + span { background: var(--btn-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); }

/* timeline: shaded rail, glowing stations */
.tl-stop .tl-rail::before { background: linear-gradient(90deg, rgba(0, 0, 0, .05), var(--line) 40%, rgba(255, 255, 255, .4)); }
.tl-leg .tl-rail::before { box-shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .12); }
.tl-stop .node { box-shadow: 0 0 0 4px var(--bg), 0 3px 8px -1px color-mix(in srgb, var(--cat, var(--c-sight)) 55%, transparent); }
.tl-stop.is-warn .node { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px color-mix(in srgb, var(--warn) 25%, transparent); }
.tl-start .node, .tl-end .node { box-shadow: 0 0 0 4px var(--bg), 0 3px 6px rgba(0, 0, 0, .25); }
.tl-time .arr { text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 70%, transparent); }
.check { box-shadow: var(--hl), 0 2px 5px rgba(0, 0, 0, .12); }
.visited .check { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px var(--ok); }

/* pills and chips with a little relief */
.pill { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .08); }
.pill.warn { background: linear-gradient(180deg, color-mix(in srgb, var(--warn-soft) 55%, var(--surface)), var(--warn-soft)); }
.att-chip { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .08); }

/* sheets and bars float above the page */
.sheet { background: var(--bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 -12px 40px rgba(0, 0, 0, .25); }
.actionbar { box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .25); }
.bubble.user { background: var(--btn-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), var(--btn-glow); }
.meter { box-shadow: var(--sunken); }
.meter i { background: var(--btn-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.cal-day.is-start, .cal-day.is-end { background: var(--btn-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); }
#toast .t { box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .5); }
.line-map li.st .dot { box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--cat, var(--c-sight)) 60%, transparent); }
.empty svg { filter: drop-shadow(0 6px 10px rgba(120, 55, 15, .18)); }
@media (prefers-reduced-motion: reduce) { .trip-card, .day-card, .tl-card, .exp-row, .route-day, .btn { transition: none; } }

/* ---------- spaces ---------- */
.sp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, hsl(var(--sp) 90% 72%), hsl(var(--sp) 80% 44%)); box-shadow: 0 0 0 2px var(--surface), 0 0 6px hsl(var(--sp) 80% 50% / .55); }
.space-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .9rem; font-weight: 700;
  box-shadow: var(--hl), var(--elev-1); }
.space-chip .sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.space-list { display: grid; gap: 10px; margin-bottom: 14px; }
.space-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--hl), var(--elev-1); }
.space-row.current { outline: 2px solid var(--accent); outline-offset: -2px; }
.space-row .sp-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; color: inherit; text-align: left; font: inherit; }
.space-row .sp-text { flex: 1; min-width: 0; display: grid; }
.space-row .sp-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-row .sp-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-row .pill { background: var(--accent-soft, rgba(242, 107, 29, .14)); color: var(--accent-text); }
.cover .c-space { position: relative; display: inline-flex; margin-bottom: 10px; align-items: center; gap: 6px; max-width: 60%; font-size: .72rem; font-weight: 700;
  background: rgba(255, 255, 255, .2); padding: 2px 10px 2px 8px; border-radius: 999px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cover .c-space .sp-dot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.list-head > div:first-child { min-width: 0; max-width: 100%; }
.space-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; max-width: 100%; }
.space-bar .sb-label { font-size: .8rem; color: var(--muted); font-weight: 700; margin-right: 2px; }
.space-bar .sb-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; max-width: 100%; min-width: 0; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .08); }
.space-bar .sb-pill .sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 11em; }
.space-bar .sb-pill[aria-pressed="true"] { background: var(--btn-grad); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), var(--btn-glow); }
.space-bar .sb-edit, .space-bar .sb-add { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--accent); background: transparent; color: var(--accent-text); font: inherit; font-size: .88rem; font-weight: 700; }
.space-bar .sb-edit { border-style: solid; border-color: var(--line); color: var(--muted); }
p.hint { font-size: .8rem; color: var(--faint); }
.nav-hint { margin: 6px 0 0 14px; font-size: .78rem; }
