:root {
  color-scheme: light; font-family: var(--font-sans); color: var(--ink); background: var(--bg);
  /* 与主页共用薰衣草纸底、小熊棕、小兔粉和鼠尾草绿。 */
  --bg:light-dark(#f8f5fc,#19161f); --bg-elevated:light-dark(#fffcff,#25212d); --bg-sunken:light-dark(#f2ecf8,#30283d);
  --ink:light-dark(#3e344d,#eee6f6); --ink-soft:light-dark(#62566f,#d2c6df); --muted:light-dark(#746582,#b8a9ca);
  --line:light-dark(#e6ddef,#43394f); --line-soft:light-dark(#f2ecf8,#30283d);
  --accent:light-dark(#7d6397,#b297d0); --accent-hover:light-dark(#674d81,#d9c2f3); --accent-soft:light-dark(#eee5f7,#3a2d4b); --accent-ink:light-dark(#674d81,#d9c2f3);
  --on-accent:light-dark(#ffffff,#251a32); --surface-raised:light-dark(#ffffff,#2c2736); --focus:light-dark(#b9a0d5,#bda1df);
  --bear:light-dark(#a57d60,#c7a084); --bear-soft:light-dark(#f4ebe5,#3b2e2a); --bunny:light-dark(#d88c9e,#dca0b3); --bunny-soft:light-dark(#f9e9ef,#432c3d);
  --danger:light-dark(#b25066,#f0a3b6); --danger-soft:light-dark(#f9e9ef,#432c3d); --warn:light-dark(#8a612f,#d6b187); --ok:light-dark(#526e51,#bfd4b8);
  --backdrop:light-dark(#33283e80,#0c0813ba); --toast-bg:light-dark(#3e344d,#2c2736); --toast-ink:light-dark(#ffffff,#eee6f6);
  --r-xs:6px; --r-sm:8px; --r-md:10px; --r-lg:14px; --r-xl:18px; --r-full:999px;
  --shadow-sm:0 1px 2px light-dark(#65507e0a,#00000025),0 1px 1px light-dark(#65507e08,#00000018);
  --shadow-md:0 2px 4px light-dark(#65507e0a,#00000025),0 8px 16px -4px light-dark(#65507e0f,#00000038);
  --shadow-lg:0 4px 8px light-dark(#65507e0a,#00000025),0 16px 32px -8px light-dark(#65507e14,#00000055);
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px; --sp-7:48px; --sp-8:64px;
  --font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI Variable Text","Segoe UI",system-ui,"PingFang SC","Hiragino Sans GB","Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  --font-mono:ui-monospace,"SF Mono","Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { max-width:100%; }
body { margin:0; min-width:0; min-height:100vh; background:var(--bg); color:var(--ink); font-family:var(--font-sans); font-size:15px; line-height:1.6; }
button, input, select, textarea { font:inherit; }
button { cursor:pointer; }
h1, h2, p { overflow-wrap:anywhere; }
h1 { margin:0; font-size:clamp(24px,3.2vw,30px); font-weight:650; line-height:1.25; letter-spacing:-.02em; }
h2 { margin:0; font-size:18px; font-weight:600; line-height:1.35; }

.topbar { height:56px; display:flex; align-items:center; padding:0 max(var(--sp-4),calc((100vw - 1080px)/2)); background:var(--bg-elevated); border-bottom:1px solid var(--line); }
.brand { display:inline-flex; align-items:center; gap:var(--sp-2); color:var(--ink); font-size:16px; font-weight:600; text-decoration:none; }
.brand-mark, .login-card__mark { display:grid; place-items:center; color:var(--on-accent); background:var(--accent); border-radius:var(--r-xs); }
.brand-mark { width:36px; height:36px; font-size:15px; }
.app-view { width:min(1080px,calc(100% - 2 * var(--sp-4))); margin:0 auto; padding:var(--sp-6) 0 var(--sp-8); }
.loading { color:var(--muted); text-align:center; padding:var(--sp-8) 0; }
.page-heading { display:flex; justify-content:space-between; align-items:end; gap:var(--sp-5); margin-bottom:var(--sp-5); }
.page-heading__actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:var(--sp-2); }
.eyebrow { margin:0 0 var(--sp-2); color:var(--accent-ink); font-size:12px; font-weight:600; letter-spacing:.08em; }

.button { min-height:36px; padding:0 var(--sp-4); border:1px solid transparent; border-radius:var(--r-md); background:transparent; color:var(--ink); font-size:14px; font-weight:500; line-height:1.2; transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,color .16s ease,transform .16s ease; }
.button:hover { border-color:var(--line); }
.button:active { transform:translateY(1px); }
.button:disabled { opacity:.45; cursor:not-allowed; }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.button--primary { color:var(--on-accent); background:var(--accent); }
.button--primary:hover { border-color:var(--accent-hover); background:var(--accent-hover); }
.button--quiet { border-color:var(--line); background:var(--bg-elevated); color:var(--ink); }
.button--quiet:hover { background:var(--bg-sunken); }
.button--danger { color:var(--danger); background:transparent; }
.button--danger:hover { border-color:transparent; background:var(--danger-soft); }
.button--block { width:100%; }

.trip-card { display:flex; align-items:center; justify-content:space-between; gap:var(--sp-6); margin-bottom:var(--sp-4); padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); transition:box-shadow .16s ease,border-color .16s ease,transform .16s ease; }
.trip-card:hover { border-color:var(--accent); box-shadow:var(--shadow-md); transform:translateY(-1px); }
.trip-card__main { min-width:0; }
.trip-card__type { margin:0 0 var(--sp-1); color:var(--accent-ink); font-size:12px; font-weight:600; letter-spacing:.08em; }
.trip-card h2 { font-size:18px; line-height:1.35; }
.trip-card__destination { margin:var(--sp-1) 0 var(--sp-3); color:var(--muted); }
.trip-card__meta { display:flex; flex-wrap:wrap; gap:var(--sp-2) var(--sp-4); color:var(--muted); font-size:13px; line-height:1.5; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.trip-card__actions { display:flex; flex:0 0 auto; flex-wrap:wrap; justify-content:flex-end; gap:var(--sp-1); }
.empty-state { padding:var(--sp-8) var(--sp-5); text-align:center; background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.empty-state__icon { margin-bottom:var(--sp-4); color:var(--muted); font-size:24px; }
.empty-state p { margin:var(--sp-2) auto var(--sp-5); color:var(--muted); }

.trip-form, .login-card, .quick-form, .share-panel, .share-error { background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-md); }
.trip-form { display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-5); padding:var(--sp-6); }
.field { display:grid; gap:var(--sp-2); min-width:0; color:var(--ink-soft); font-size:13px; font-weight:500; line-height:1.5; }
.field b { color:var(--danger); }
.field--wide { grid-column:1/-1; }
.field input, .field textarea, .field select, .quick-form input, .quick-form select, .expense-form select, .itinerary-item-form select { width:100%; min-width:0; min-height:36px; padding:var(--sp-2) var(--sp-3); border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink); background:var(--bg-elevated); font-family:var(--font-sans); font-size:15px; font-weight:400; }
.field textarea { min-height:96px; resize:vertical; }
input::placeholder, textarea::placeholder { color:var(--muted); opacity:1; }
input:focus, select:focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.form-actions { display:flex; justify-content:flex-end; gap:var(--sp-2); padding-top:var(--sp-1); }

.login-gate { min-height:calc(100vh - 192px); display:grid; place-items:center; }
.login-card { width:min(420px,100%); padding:var(--sp-6); }
.login-card__mark { width:50px; height:50px; margin-bottom:var(--sp-5); }
.login-card > p:not(.eyebrow) { margin:var(--sp-2) 0 var(--sp-5); color:var(--muted); }
.login-card form { display:grid; gap:var(--sp-4); }
.quick-page { width:min(540px,100%); margin:0 auto; }
.quick-heading { display:flex; align-items:center; gap:var(--sp-4); margin-bottom:var(--sp-5); }
.quick-heading .eyebrow { margin-bottom:var(--sp-1); }
.quick-summary, .itinerary-totals, .timeline-totals { border:1px solid var(--line); border-radius:var(--r-lg); background:var(--accent-soft); color:var(--accent-ink); font-size:13px; line-height:1.5; }
.quick-summary { margin:0 0 var(--sp-4); padding:var(--sp-3) var(--sp-4); }
.quick-form { display:grid; gap:var(--sp-4); min-width:0; padding:var(--sp-5); }
.quick-submit { width:100%; }
.toast { position:fixed; z-index:10; left:50%; bottom:var(--sp-5); max-width:calc(100% - 2 * var(--sp-4)); padding:var(--sp-3) var(--sp-4); color:var(--toast-ink); background:var(--toast-bg); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--shadow-lg); opacity:0; transform:translate(-50%,12px); pointer-events:none; transition:opacity .16s ease,transform .16s ease; }
.toast--visible { opacity:1; transform:translate(-50%,0); }

.itinerary-heading__dates, .timeline-heading__dates { margin:var(--sp-2) 0 0; color:var(--muted); }
.itinerary-heading__side { display:flex; align-items:center; gap:var(--sp-3); }
.share-panel { display:grid; gap:var(--sp-4); margin:0 0 var(--sp-5); padding:var(--sp-5); }
.share-panel__copy, .share-panel__settings { display:flex; align-items:center; justify-content:space-between; gap:var(--sp-4); }
.share-panel__copy > div { min-width:0; }
.share-panel__label { margin:0 0 var(--sp-1); color:var(--muted); font-size:12px; font-weight:600; }
.share-panel__url { margin:0; overflow-wrap:anywhere; color:var(--accent-ink); font-size:13px; }
.share-panel__toggle { display:inline-flex; align-items:center; gap:var(--sp-2); color:var(--ink-soft); font-weight:500; }
.share-panel__toggle input { width:18px; height:18px; accent-color:var(--accent); }
.share-error { width:min(520px,100%); margin:var(--sp-8) auto 0; padding:var(--sp-7) var(--sp-6); text-align:center; }
.share-error__mark { width:50px; height:50px; margin:0 auto var(--sp-5); }
.share-error > p:last-child { margin:var(--sp-3) 0 0; color:var(--muted); }
.itinerary-totals { display:flex; gap:var(--sp-2); padding:var(--sp-2) var(--sp-3); font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.itinerary-totals span, .itinerary-totals strong { white-space:nowrap; }

.itinerary-day { margin-bottom:var(--sp-5); padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.itinerary-day__heading { display:flex; align-items:baseline; justify-content:space-between; gap:var(--sp-4); margin-bottom:var(--sp-4); }
.itinerary-day__heading h2 { font-size:18px; }
.itinerary-day__heading > div { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:var(--sp-2) var(--sp-3); text-align:right; }
.itinerary-day__heading span, .itinerary-day__heading strong { flex:0 0 auto; font-size:13px; }
.itinerary-day__heading span { color:var(--muted); }
.itinerary-day__heading strong { color:var(--accent-ink); }
.itinerary-day__items { display:grid; gap:var(--sp-3); }
.itinerary-day__add, .expense-add { width:100%; border:1px solid var(--line); color:var(--accent-ink); background:var(--bg-elevated); }
.itinerary-day__add { margin-top:var(--sp-3); }
.itinerary-item { display:grid; grid-template-columns:minmax(150px,.8fr) minmax(280px,1.6fr) auto; gap:var(--sp-4); align-items:center; padding:var(--sp-4); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.itinerary-item__summary { display:grid; justify-items:start; gap:var(--sp-1); min-width:0; }
.itinerary-item__time { font-size:15px; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.itinerary-item__place { color:var(--muted); }
.category-badge { display:inline-flex; padding:2px var(--sp-2); border-radius:var(--r-xs); color:var(--accent-ink); background:var(--accent-soft); font-size:12px; font-weight:600; line-height:1.5; }
.itinerary-item__details { display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-2) var(--sp-4); margin:0; min-width:0; }
.itinerary-item__details div { min-width:0; }
.itinerary-item__details dt { color:var(--muted); font-size:12px; }
.itinerary-item__details dd { margin:var(--sp-1) 0 0; overflow-wrap:anywhere; }
.transport-line { min-width:0; padding:var(--sp-2) var(--sp-3); overflow-wrap:anywhere; color:var(--ink-soft); background:var(--bg-sunken); border-radius:var(--r-sm); font-size:13px; line-height:1.5; }
.transport-line__no { color:var(--accent-ink); font-family:var(--font-mono); }
.transport-line__seat { color:var(--muted); }
.itinerary-item__details .transport-line { grid-column:1/-1; }
.itinerary-item__actions { display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-1); }
.itinerary-item__actions .button { min-height:36px; padding:0 var(--sp-2); font-size:13px; }
.itinerary-item__actions .button:disabled { cursor:not-allowed; opacity:.45; }

.expense-block { grid-column:1/-1; min-width:0; border-top:1px solid var(--line); padding-top:var(--sp-3); }
.expense-list { display:grid; gap:var(--sp-2); min-width:0; }
.expense-row { display:grid; grid-template-columns:minmax(100px,1fr) auto auto auto auto; align-items:center; gap:var(--sp-2); min-width:0; padding:var(--sp-2); border-radius:var(--r-sm); background:var(--bg-sunken); font-size:13px; }
.expense-row__label { min-width:0; overflow-wrap:anywhere; }
.expense-row__amount { white-space:nowrap; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.expense-row__category { color:var(--muted); }
.expense-row__actions { display:flex; }
.expense-row__actions .button { min-height:30px; padding:0 var(--sp-2); font-size:12px; }
.expense-kind { display:inline-flex; padding:2px var(--sp-2); border-radius:var(--r-full); font-size:12px; font-weight:600; }
.expense-kind--budget { color:var(--muted); background:var(--bg-sunken); }
.expense-kind--actual { color:var(--accent-ink); background:var(--accent-soft); }
.expense-add { min-height:34px; margin-top:var(--sp-2); padding:0 var(--sp-3); font-size:13px; }
.expense-form { display:grid; grid-template-columns:2fr 1fr 1fr 1fr auto; align-items:end; gap:var(--sp-2); padding:var(--sp-3); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-sunken); }
.expense-form .form-actions { padding:0; white-space:nowrap; }
.itinerary-item-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--sp-3); padding:var(--sp-4); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-sunken); }
.item-form__transport { grid-column:1/-1; min-width:0; margin:0; padding:var(--sp-3); border:1px solid var(--line); border-radius:var(--r-sm); }
.item-form__transport legend { padding:0 var(--sp-2); color:var(--accent-ink); font-size:13px; font-weight:500; }
.item-form__transport-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-3); min-width:0; }

.timeline-heading__motto { max-width:620px; margin:var(--sp-3) 0 0; color:var(--ink-soft); font-style:italic; }
.timeline-heading__actions { display:flex; align-items:center; gap:var(--sp-3); }
.timeline-totals { display:flex; gap:var(--sp-2); padding:var(--sp-2) var(--sp-3); font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.timeline-day { margin-bottom:var(--sp-6); }
.timeline-day__heading { display:flex; align-items:baseline; justify-content:space-between; gap:var(--sp-4); margin-bottom:var(--sp-3); padding-bottom:var(--sp-2); border-bottom:1px solid var(--line); }
.timeline-day__heading h2 { font-size:18px; }
.timeline-day__heading strong { color:var(--accent-ink); font-size:13px; }
.timeline-day__track { position:relative; display:grid; gap:var(--sp-3); padding-left:var(--sp-6); }
.timeline-day__track::before { position:absolute; top:0; bottom:0; left:10px; width:1px; background:var(--line); content:""; }
.timeline-node { position:relative; }
.timeline-node__marker { position:absolute; top:20px; left:-28px; width:12px; height:12px; border:3px solid var(--bg); border-radius:50%; background:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.timeline-node__card { padding:var(--sp-4) var(--sp-5); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); box-shadow:var(--shadow-sm); }
.timeline-node__summary { display:flex; align-items:center; flex-wrap:wrap; gap:var(--sp-2) var(--sp-3); }
.timeline-node__summary time { min-width:58px; color:var(--accent-ink); font-weight:600; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.timeline-node__summary strong { margin-right:auto; font-size:16px; }
.timeline-node__details { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--sp-2) var(--sp-4); margin:var(--sp-4) 0 0; }
.timeline-node__details div { min-width:0; }
.timeline-node__details dt { color:var(--muted); font-size:12px; }
.timeline-node__details dd { margin:var(--sp-1) 0 0; overflow-wrap:anywhere; }
.timeline-node__note { grid-column:1/-1; }
.timeline-expenses { display:grid; gap:var(--sp-2); margin:var(--sp-3) 0 0; padding:var(--sp-3) 0 0; border-top:1px solid var(--line); list-style:none; }
.timeline-expense { display:flex; align-items:center; gap:var(--sp-2); font-size:13px; }
.timeline-expense > span:first-child { min-width:0; margin-right:auto; overflow-wrap:anywhere; }
.timeline-expense__value { white-space:nowrap; font-weight:600; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.timeline-other { margin-left:var(--sp-6); padding:var(--sp-5); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); box-shadow:var(--shadow-sm); }

.stats-totals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--sp-3); margin-bottom:var(--sp-5); }
.stats-total-card { display:grid; gap:var(--sp-2); padding:var(--sp-5); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); box-shadow:var(--shadow-sm); }
.stats-total-card span { color:var(--muted); font-size:13px; font-weight:500; }
.stats-total-card strong { color:var(--accent-ink); font-size:24px; font-weight:650; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.stats-total-card.over-budget strong { color:var(--danger); }
.stats-charts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-5); }
.stats-chart-card { min-width:0; padding:var(--sp-5); border:1px solid var(--line); border-radius:var(--r-xl); background:var(--bg-elevated); box-shadow:var(--shadow-lg); }
.stats-chart-card h2 { margin-bottom:var(--sp-4); font-size:18px; }
.stats-chart-canvas { position:relative; height:320px; max-height:320px; }
.stats-empty { margin-top:var(--sp-2); }

.map-heading { align-items:center; }
.map-layout { display:grid; grid-template-columns:minmax(0,2fr) minmax(250px,1fr); gap:var(--sp-5); min-width:0; }
.trip-map { min-width:0; min-height:440px; overflow:hidden; border:1px solid var(--line); border-radius:var(--r-xl); background:var(--bg-sunken); box-shadow:var(--shadow-lg); }
.map-sidebar { min-width:0; padding:var(--sp-5); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); box-shadow:var(--shadow-md); }
.map-sidebar h2 { margin-bottom:var(--sp-4); font-size:18px; }
.map-sidebar p { margin:var(--sp-2) 0 0; color:var(--muted); }
.map-pending-list { display:grid; gap:var(--sp-3); margin:0; padding:0; list-style:none; }
.map-pending-item { display:grid; gap:var(--sp-2); min-width:0; padding:var(--sp-3); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); box-shadow:var(--shadow-sm); }
.map-pending-item > div:first-child { display:grid; gap:var(--sp-1); min-width:0; }
.map-pending-item time { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.map-pending-item strong { overflow-wrap:anywhere; }
.map-pending-item__actions { display:flex; flex-wrap:wrap; gap:var(--sp-2); }
.map-pending-item__actions .button { flex:1 1 105px; min-height:36px; padding:0 var(--sp-2); font-size:12px; }
.leaflet-control-attribution, .leaflet-popup-content-wrapper { color:var(--ink); background:var(--bg-elevated); border-radius:var(--r-sm); }
.leaflet-control-attribution a, .leaflet-popup-content a { color:var(--accent-ink); }
.leaflet-popup-tip { background:var(--bg-elevated); }

.packing-summary, .packing-templates { margin-bottom:var(--sp-5); }
.packing-summary p { margin:0 0 var(--sp-2); color:var(--muted); font-size:13px; }
.packing-progress { height:8px; overflow:hidden; border-radius:var(--r-full); background:var(--bg-sunken); }
.packing-progress__bar { height:100%; border-radius:var(--r-full); background:var(--accent); transition:width .24s ease; }
.packing-templates h2 { margin-bottom:var(--sp-3); font-size:13px; color:var(--muted); }
.packing-template-actions { display:flex; flex-wrap:wrap; gap:var(--sp-2); }
.packing-form { display:grid; grid-template-columns:minmax(0,2fr) minmax(120px,1fr) minmax(90px,.5fr) auto; align-items:end; gap:var(--sp-3); margin-bottom:var(--sp-5); padding:var(--sp-4); border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.packing-groups { display:grid; gap:var(--sp-5); }
.packing-group__title { margin-bottom:var(--sp-2); color:var(--muted); font-size:13px; }
.packing-list { display:grid; gap:var(--sp-2); margin:0; padding:0; list-style:none; }
.packing-row { display:flex; align-items:center; gap:var(--sp-3); min-width:0; padding:var(--sp-3); border:1px solid var(--line); border-radius:var(--r-md); background:var(--bg-elevated); }
.packing-row__check { display:flex; align-items:center; gap:var(--sp-3); min-width:0; margin-right:auto; }
.packing-row__check input { flex:0 0 auto; width:18px; height:18px; accent-color:var(--accent); }
.packing-row__name { min-width:0; overflow-wrap:anywhere; }
.packing-row__qty { flex:0 0 auto; color:var(--muted); font-size:13px; }
.packing-row .button { flex:0 0 auto; min-height:32px; padding:0 var(--sp-3); }
.packing-row--packed .packing-row__name { color:var(--muted); text-decoration:line-through; }
.packing-empty { box-shadow:none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme:dark; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition:none !important; }
  .packing-progress__bar { transition:none; }
}

@media (max-width: 768px) {
  .page-heading .button { flex:0 0 auto; }
  .trip-card { align-items:stretch; flex-direction:column; gap:var(--sp-4); }
  .trip-card__actions { border-top:1px solid var(--line); padding-top:var(--sp-3); }
  .trip-card__actions .button { flex:1 1 120px; }
  .trip-form, .itinerary-item, .itinerary-item-form, .item-form__transport-fields, .expense-form, .timeline-node__details, .stats-totals, .stats-charts, .map-layout { grid-template-columns:minmax(0,1fr); }
  .packing-form { grid-template-columns:minmax(0,1fr); }
  .field--wide, .timeline-node__note, .expense-form .form-actions { grid-column:auto; }
  .itinerary-item__details { grid-template-columns:1fr 1fr; }
  .itinerary-item__actions { display:flex; flex-wrap:wrap; }
  .itinerary-item__actions .button { flex:1 1 72px; }
  .timeline-heading, .stats-heading { align-items:stretch; flex-direction:column; }
  .timeline-heading__actions { align-items:stretch; flex-direction:column; width:100%; }
  .timeline-totals { justify-content:space-between; }
  .timeline-day__heading { align-items:flex-start; flex-direction:column; gap:var(--sp-1); }
  .share-view { padding-top:var(--sp-5); }
  .share-panel__copy, .share-panel__settings { align-items:stretch; flex-direction:column; }
  .share-panel__copy .button, .share-panel__settings .button, .stats-heading .button { width:100%; }
  .stats-chart-canvas { height:280px; }
  .trip-map { min-height:380px; }
}

@media (max-width: 390px) {
  .topbar { padding:0 var(--sp-4); }
  .app-view { width:calc(100% - 2 * var(--sp-4)); padding:var(--sp-4) 0; }
  .page-heading, .quick-heading, .map-heading { align-items:stretch; flex-direction:column; }
  .page-heading__actions, .itinerary-heading__side { width:100%; }
  .page-heading__actions .button { flex:1 1 140px; }
  .form-actions { flex-direction:column-reverse; }
  .form-actions .button, .quick-heading .button, .map-heading .button { width:100%; }
  .quick-form, .trip-form, .login-card, .share-panel, .share-error, .itinerary-day, .map-sidebar { padding:var(--sp-4); }
  .itinerary-day__heading { align-items:flex-start; flex-direction:column; gap:var(--sp-1); }
  .itinerary-day__heading > div { justify-content:flex-start; text-align:left; }
  .itinerary-item__details, .itinerary-item-form { grid-template-columns:minmax(0,1fr); }
  .itinerary-item-form .field--wide { grid-column:auto; }
  .item-form__transport { grid-column:auto; width:100%; max-width:100%; }
  .itinerary-heading__side { align-items:stretch; flex-direction:column; }
  .itinerary-totals { flex-wrap:wrap; justify-content:space-between; width:100%; }
  .expense-row { grid-template-columns:minmax(0,1fr) auto auto; }
  .expense-row__category { grid-column:1; }
  .expense-row__actions { grid-column:2/-1; grid-row:2; justify-content:flex-end; }
  .expense-form { grid-template-columns:minmax(0,1fr); }
  .expense-form .form-actions { grid-column:auto; }
  .timeline-other { margin-left:0; }
  .map-page, .map-layout, .map-sidebar, .trip-map { max-width:100%; min-width:0; }
  .trip-map { min-height:320px; }
  .share-panel__url, .transport-line, .timeline-heading__motto { white-space:normal; overflow-wrap:anywhere; }
  .packing-page, .packing-form, .packing-groups, .packing-group, .packing-list, .packing-row { max-width:100%; min-width:0; }
  .packing-row { flex-wrap:wrap; }
  .packing-row__check { flex:1 1 calc(100% - 96px); }
}

/* Photos stay within the existing travel context; images never replace readable records. */
.photos-heading { display:flex; flex-wrap:wrap; align-items:start; justify-content:space-between; gap:16px; margin-bottom:20px; }
.photos-heading h2 { margin:0 0 6px; }
.photos-heading p, .photo-upload-status { color:var(--muted); font-size:14px; }
.photos-dropzone { display:grid; justify-items:center; gap:10px; padding:28px 20px; border:1px dashed var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); text-align:center; margin-bottom:20px; }
.photos-dropzone.is-dragging, .photos-dropzone.is-dragover, .photos-dropzone[data-dragging="true"] { border-color:var(--accent); background:var(--accent-soft); }
.photos-dropzone p { margin:0; max-width:580px; color:var(--muted); font-size:13px; }
.photos-dropzone input[type="file"] { max-width:100%; min-height:42px; color:var(--ink-soft); }
.photo-pending-list { display:grid; gap:14px; margin-bottom:20px; }
.photo-pending-card { display:grid; grid-template-columns:140px minmax(0,1fr); gap:20px; padding:18px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.photo-pending-card > img, .photo-pending-card .photo-pending-preview { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:var(--r-sm); }
.photo-pending-card form, .photo-pending-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
.photo-pending-card .field:first-child, .photo-pending-card .photo-upload-status, .photo-pending-card .form-actions { grid-column:1/-1; }
.photo-pending-card > div { min-width:0; }
.photo-pending-card > div > strong { display:block; overflow-wrap:anywhere; font-size:14px; }
.photo-pending-card .field { margin:10px 0; }
.photo-pending-placeholder { display:grid; place-items:center; min-height:90px; background:var(--bg-sunken); color:var(--muted); border-radius:var(--r-sm); }
.photo-upload-status { margin:8px 0; overflow-wrap:anywhere; }
.photo-upload-status.is-error { color:var(--danger); }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)); gap:20px; margin:20px 0; align-items:start; }
.photo-card { min-width:0; margin:0; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.photo-card__image { display:block; width:100%; padding:0; border:0; border-radius:var(--r-lg) var(--r-lg) 0 0; background:var(--bg-sunken); cursor:zoom-in; }
.photo-card__image img, img.photo-card__image { display:block; width:100%; aspect-ratio:4/3; height:auto; object-fit:cover; }
.photo-card__image:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.photo-image-failure { padding:14px; color:var(--muted); font-size:13px; }
.photo-card__image.has-error img { display:none; }
.photo-card__image.has-error { min-height:140px; cursor:pointer; }
.photo-card__meta { padding:16px 16px 6px; overflow-wrap:anywhere; }
.photo-card__meta p { margin:6px 0; white-space:pre-wrap; }
.photo-card__meta time, .photo-card__meta small { color:var(--muted); font-size:12px; }
.photo-cover-badge { display:inline-block; margin-left:8px; font-size:12px; color:var(--accent-ink); }
.photo-card__actions { display:flex; flex-wrap:wrap; gap:4px; align-items:center; padding:8px 12px 14px; }
.photo-card__actions .button { padding:8px; font-size:13px; }
.photo-card__actions .is-cover { color:var(--accent-ink); background:var(--accent-soft); }
.photo-editor { display:grid; gap:12px; margin:0 12px 16px; padding:16px; border-radius:var(--r-md); background:var(--bg-sunken); }
.photo-editor form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; }
.photo-editor .form-actions, .photo-editor [role="status"] { grid-column:1/-1; }
.photo-dialog { width:min(1060px,calc(100% - 32px)); max-height:calc(100dvh - 32px); padding:18px; border:1px solid var(--line); border-radius:var(--r-lg); color:var(--ink); background:var(--bg-elevated); }
.photo-dialog::backdrop { background:var(--backdrop); }
.photo-dialog img { display:block; max-width:100%; max-height:calc(100dvh - 164px); margin:0 auto; object-fit:contain; }
.photo-dialog p { white-space:pre-wrap; overflow-wrap:anywhere; margin:12px 0 0; }
.photo-dialog__header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.photo-dialog__header .button { margin-left:auto; }
.photo-dialog__close { display:block; margin:0 0 12px auto; border-color:var(--line); }
.photos-page > .form-hint { max-width:850px; margin-bottom:20px; font-size:12px; }
.photos-feedback.is-error { color:var(--danger); }
.journey-photo-cover { display:block; width:100%; max-height:260px; aspect-ratio:16/9; object-fit:cover; border-radius:var(--r-lg); margin:0 0 20px; }
.memory-cover--photo { padding:0; background:var(--bg-elevated); border:1px solid var(--line); overflow:hidden; }
.memory-cover__photo { display:block; width:100%; height:auto; max-height:360px; aspect-ratio:21/9; object-fit:cover; }
.memory-cover__text { padding:24px; }
.memory-cover--photo h1, .memory-cover--photo h2, .memory-cover--photo p { max-width:100%; padding-right:0; }
.notes-photos-toolbar { display:flex; justify-content:flex-end; margin-bottom:16px; }
.note-photo-gallery { margin-top:16px; }
.note-photo-gallery .photo-grid { grid-template-columns:repeat(auto-fill,minmax(160px,220px)); margin-top:0; }
.memory-photo-group { margin:24px 0; }
.memory-photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)); gap:18px; }
.memory-photo-grid figure { min-width:0; margin:0; }
.memory-photo-grid img { display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; border-radius:var(--r-md); }
.memory-photo-grid figcaption { margin-top:8px; color:var(--muted); font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:768px) {
  .photos-heading { gap:10px; }
  .photos-dropzone { padding:22px 16px; }
  .photo-pending-card { grid-template-columns:90px minmax(0,1fr); gap:14px; padding:14px; }
  .photo-pending-card form, .photo-pending-fields { grid-template-columns:minmax(0,1fr); }
  .photo-grid, .memory-photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .photo-card__meta { padding:12px 12px 4px; }
  .photo-card__actions { padding:6px 8px 10px; }
  .photo-card__actions .button { min-height:42px; padding:6px; font-size:12px; }
  .photo-editor { margin:0 8px 12px; padding:10px; }
  .photo-editor form { grid-template-columns:minmax(0,1fr); }
  .photo-dialog { padding:12px; }
  .journey-photo-cover { max-height:220px; }
  .memory-cover__photo { aspect-ratio:16/9; }
  .memory-cover__text { padding:20px; }
}
@media print {
  :root { color-scheme:light; color:#000000; background:#ffffff; }
  body { color:#000000; background:#ffffff; }
  .topbar, .button { display:none !important; }
  .app-view { width:100%; margin:0; padding:0; }
  .timeline-heading { margin-bottom:var(--sp-5); }
  .timeline-heading__dates, .timeline-heading__motto { color:#000000; }
  .timeline-totals, .timeline-node__card, .timeline-other { color:#000000; border-color:#000000; background:#ffffff; box-shadow:none; }
  .timeline-day, .timeline-node { break-inside:avoid; }
  .timeline-day__heading { border-color:#000000; }
  .timeline-day__heading strong, .timeline-node__summary time { color:#000000; }
  .timeline-day__track::before { background:#000000; }
  .timeline-node__marker { border-color:#ffffff; background:#000000; box-shadow:0 0 0 1px #000000; }
  .category-badge, .expense-kind { color:#000000; border:1px solid #000000; background:#ffffff; }
}

.overview-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--sp-4); margin-bottom:var(--sp-5); }
.overview-card { display:grid; gap:var(--sp-2); min-width:0; padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.overview-card span { color:var(--muted); font-size:13px; }
.overview-card strong { font-size:24px; font-weight:650; line-height:1.25; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.overview-highlights, .overview-section { margin-bottom:var(--sp-5); padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.overview-highlights h2, .overview-section h2 { margin-bottom:var(--sp-4); }
.overview-highlight-list { display:flex; flex-wrap:wrap; gap:var(--sp-3) var(--sp-6); }
.overview-highlight-list p { margin:0; color:var(--ink-soft); }
.overview-destinations { display:flex; flex-wrap:wrap; gap:var(--sp-2); }
.destination-chip { display:inline-flex; align-items:center; padding:var(--sp-1) var(--sp-3); border-radius:var(--r-full); background:var(--accent-soft); color:var(--accent-ink); font-size:13px; }
.footprint-map { min-width:0; min-height:360px; margin-top:var(--sp-4); overflow:hidden; border:1px solid var(--line); border-radius:var(--r-xl); box-shadow:var(--shadow-lg); }
.footprint-empty { margin-top:var(--sp-4); }
.overview-details { display:grid; grid-template-columns:minmax(0,2fr) minmax(240px,1fr); gap:var(--sp-5); }
.overview-details .overview-section { min-width:0; margin-bottom:0; }
.overview-chart-canvas { height:300px; max-height:300px; }
.overview-category-list { display:grid; }
.overview-category-row { display:flex; align-items:center; justify-content:space-between; gap:var(--sp-4); padding:var(--sp-3) 0; border-bottom:1px solid var(--line-soft); }
.overview-category-row:last-child { border-bottom:0; }
.overview-category-row strong { font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; }
.overview-empty { margin:0; color:var(--muted); }

@media (max-width: 768px) {
  .overview-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-details { grid-template-columns:minmax(0,1fr); }
  .footprint-map { min-height:280px; }
}

@media (max-width: 390px) {
  .overview-page, .overview-cards, .overview-card, .overview-details, .overview-section, .overview-chart-canvas, .footprint-map { max-width:100%; min-width:0; }
  .overview-cards { grid-template-columns:minmax(0,1fr); }
  .overview-highlights, .overview-section, .overview-card { padding:var(--sp-4); }
}

.notes-list { display:grid; gap:var(--sp-4); }
.note-card { padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }
.note-card__header { display:flex; align-items:center; gap:var(--sp-2); margin-bottom:var(--sp-3); }
.note-card__date { color:var(--accent-ink); font-size:12px; font-weight:600; }
.note-card__mood { display:inline-flex; padding:2px var(--sp-2); color:var(--accent-ink); background:var(--accent-soft); border-radius:var(--r-xs); font-size:12px; font-weight:600; line-height:1.5; }
.note-card__title { margin:0 0 var(--sp-2); }
.note-card__body { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--ink-soft); line-height:1.7; }
.note-card__actions { display:flex; justify-content:flex-end; gap:var(--sp-2); margin-top:var(--sp-4); }
.note-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr); gap:var(--sp-4); padding:var(--sp-5); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow-sm); }

@media (max-width: 768px) {
  .note-form { grid-template-columns:minmax(0,1fr); }
  .note-form .field--wide { grid-column:auto; }
}

/* 一趟旅行的公共布局；宽表格只在自己的容器内滚动。 */
:root[data-theme="dark"] { color-scheme:dark; }
:root[data-theme="light"] { color-scheme:light; }
.topbar { height:auto; min-height:64px; gap:16px; padding:12px max(20px,calc((100vw - 1240px)/2)); }
.topbar-actions { display:flex; gap:8px; margin-left:auto; }
.home-link { flex-shrink:0; white-space:nowrap; }
.share-page .home-link { margin-left:auto; }
.save-status { color:var(--muted); font-size:12px; margin-left:auto; }
.topbar-actions + .save-status { margin-left:0; }
.network-status { padding:10px 20px; background:var(--accent-soft); color:var(--accent-ink); font-size:13px; }
.app-view { width:min(1240px,calc(100% - 48px)); padding:32px 0 64px; }
.page-subtitle, .muted { color:var(--muted); }
.page-subtitle { margin:8px 0 0; }
.button, .field input, .field select { min-height:42px; }
button, summary, a { -webkit-tap-highlight-color:transparent; }
summary { cursor:pointer; }
summary:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.trip-filters, .journey-nav, .journey-tabs { display:flex; gap:6px; flex-wrap:wrap; padding:0 0 22px; }
.filter-button { min-height:40px; padding:8px 15px; border:1px solid transparent; border-radius:var(--r-full); color:var(--muted); background:transparent; }
.filter-button.is-selected, .journey-nav [aria-selected="true"], .journey-tabs [aria-selected="true"], .journey-nav .is-active { background:var(--accent-soft); color:var(--accent-ink); border-color:var(--accent-soft); }
.trip-group { margin:8px 0 32px; }
.trip-group > h2 { display:flex; align-items:center; gap:12px; margin:0 0 14px; }
.group-count { color:var(--muted); font-size:13px; font-weight:400; }
.trip-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr)); gap:20px; align-items:start; }
.trip-card { display:flex; flex-direction:column; align-items:stretch; gap:0; margin:0; padding:0; overflow:visible; box-shadow:none; }
.trip-card:hover { transform:none; box-shadow:var(--shadow-sm); border-color:var(--line); }
.trip-card__cover { display:block; width:100%; height:auto; aspect-ratio:16/9; object-fit:cover; border-radius:var(--r-lg) var(--r-lg) 0 0; background:var(--bg-sunken); }
.trip-card__cover[hidden] { display:none; }
.trip-card__main { padding:20px 20px 16px; flex:1; }
.trip-card__type { letter-spacing:0; margin-bottom:10px; }
.trip-card h2 { font-size:20px; margin-bottom:10px; }
.trip-card__photo-status { margin:8px 0; color:var(--muted); font-size:12px; }
.status-label { padding:3px 8px; border-radius:var(--r-xs); background:var(--accent-soft); color:var(--accent-ink); font-size:12px; }
.status-cancelled { background:var(--bg-sunken); color:var(--muted); }
.trip-card__actions { padding:0 20px 20px; border:0; align-items:center; justify-content:space-between; flex:0; }
.trip-card__actions > .button { flex:0 1 auto; }
.trip-card__actions .trip-card__photos { margin-left:auto; padding:8px; color:var(--muted); }
.trip-more { position:relative; flex:0 0 auto; }
.trip-more > summary { list-style:none; min-height:42px; padding:9px 12px; color:var(--muted); font-size:14px; }
.trip-more > summary::-webkit-details-marker { display:none; }
.trip-more__menu { position:absolute; right:0; top:44px; z-index:5; display:grid; gap:6px; width:155px; padding:8px; background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--shadow-md); }
.trip-more__menu .button { white-space:nowrap; }
.journey-page, .journey-content, .journey-content > *, .journey-itinerary, .journey-day-content, .journey-map-panel { min-width:0; max-width:100%; }
.journey-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding-bottom:24px; }
.journey-header h1 { margin:6px 0 10px; }
.journey-header p { margin:6px 0; color:var(--muted); }
.journey-header__actions, .journey-actions, .journey-toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.journey-nav, .journey-tabs { border-bottom:1px solid var(--line); margin-bottom:24px; padding-bottom:12px; }
.journey-nav .button, .journey-tabs .button { background:transparent; border-color:transparent; }
.journey-nav .is-active, .journey-tabs .is-active { background:var(--accent-soft); color:var(--accent-ink); }
.journey-itinerary-layout, .journey-layout { display:grid; grid-template-columns:150px minmax(0,1fr); gap:24px; align-items:start; }
.journey-itinerary-layout:has(.journey-map-panel:not([hidden])) { grid-template-columns:150px minmax(0,1fr) 350px; }
.journey-day-nav { display:grid; gap:8px; position:sticky; top:18px; }
.journey-day-nav .button { text-align:left; }
.journey-day-nav .is-active { color:var(--accent-ink); background:var(--accent-soft); }
.journey-item { margin-bottom:14px; padding:20px; background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg); }
.journey-item h3 { margin:0; font-size:17px; overflow-wrap:anywhere; }
.journey-item p { margin:8px 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.journey-item time { color:var(--accent-ink); font-weight:600; font-variant-numeric:tabular-nums; }
.journey-item header { display:flex; gap:14px; align-items:baseline; flex-wrap:wrap; }
.journey-item details { padding:8px 0; color:var(--ink-soft); }
.journey-item__actions, .journey-item-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.journey-item .button { min-height:36px; padding:7px 10px; font-size:13px; }
.journey-map-panel { position:sticky; top:18px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); padding:12px; }
.journey-map-panel .trip-map, .journey-map { width:100%; height:420px; min-height:300px; }
.journey-map-panel .map-layout { display:block; }
.journey-map-panel .map-sidebar { margin-top:12px; padding:12px; }
.journey-header__meta { display:flex; gap:14px; flex-wrap:wrap; align-items:center; color:var(--muted); font-size:14px; }
.trip-status, .visited-badge { display:inline-flex; padding:2px 8px; background:var(--accent-soft); color:var(--accent-ink); border-radius:var(--r-xs); font-size:12px; }
.journey-more { position:relative; }
.journey-more summary { padding:10px 12px; font-size:14px; color:var(--muted); }
.journey-more > div { position:absolute; right:0; width:180px; display:grid; gap:6px; padding:8px; background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--shadow-md); z-index:8; }
.journey-section-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; margin-bottom:18px; }
.journey-section-heading p { margin:6px 0 0; color:var(--muted); }
.journey-mode { display:flex; flex-wrap:wrap; gap:8px; }
.journey-nav [aria-current="page"], .journey-day-nav [aria-current="date"], .segmented-control [aria-pressed="true"] { color:var(--accent-ink); background:var(--accent-soft); border-color:var(--accent-soft); }
.journey-day-nav button span { display:block; font-size:12px; color:var(--muted); }
.journey-day-heading, .journey-item__head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.journey-day-heading { justify-content:space-between; margin-bottom:12px; color:var(--muted); }
.journey-day-heading h3 { margin:0; font-size:17px; color:var(--ink); }
.journey-item__head { margin-bottom:8px; }
.journey-item__details dl { margin:12px 0; }
.journey-item__details dt { color:var(--muted); font-size:12px; }
.journey-item__details dd { margin:2px 0 12px; white-space:pre-wrap; overflow-wrap:anywhere; }
.journey-item.is-selected { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.journey-item.is-completed > h3 { color:var(--muted); }
.journey-item__more summary { padding:8px 10px; font-size:13px; color:var(--muted); }
.journey-item__more > div { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.journey-editor { margin-bottom:24px; padding:24px; background:var(--bg-elevated); border:1px solid var(--accent); border-radius:var(--r-lg); }
.journey-editor > h2 { margin-bottom:20px; }
.journey-editor .expense-form, .journey-editor .note-form, .journey-editor .itinerary-item-form { padding:0; border:0; box-shadow:none; }
.form-hint, .inline-notice, .journey-feedback { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.journey-feedback:empty { display:none; }
.journey-feedback.is-error, .over-budget strong { color:var(--danger); }
.preserve-lines, .expense-note { white-space:pre-wrap; overflow-wrap:anywhere; }
.journey-intro { padding:24px; border:1px solid var(--line); background:var(--bg-elevated); border-radius:var(--r-lg); }
.journey-intro .button { margin-top:10px; }
.journey-overview__facts { display:grid; gap:18px; align-content:center; padding:24px; }
.journey-overview__facts span, .journey-overview__facts strong { display:block; }
.journey-overview__facts span { color:var(--muted); font-size:13px; }
.journey-overview__facts strong { margin-top:2px; font-size:20px; font-variant-numeric:tabular-nums; }
.journey-overview > .journey-section-heading, .journey-overview > .journey-shortcuts, .journey-overview > .expense-summary { grid-column:1/-1; }
.journey-overview > .journey-section-heading { margin:0; }
.journey-shortcuts { display:flex; gap:8px; flex-wrap:wrap; }
.expense-summary small { display:block; margin-top:4px; color:var(--muted); font-size:12px; }
.segmented-control { display:flex; gap:6px; margin-bottom:16px; }
.journey-expense-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:18px; align-items:center; padding:18px; margin-bottom:10px; border:1px solid var(--line); background:var(--bg-elevated); border-radius:var(--r-md); }
.journey-expense-row p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.journey-expense-row > strong { font-variant-numeric:tabular-nums; white-space:nowrap; }
.journey-expense-row > div:last-child { display:flex; gap:6px; }
.journey-analysis { margin-top:24px; padding:18px 0; }
.journey-analysis > summary { padding:6px 0; }
.journey-analysis__tables { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:12px 0; }
.journey-analysis ul { list-style:none; padding:0; }
.journey-analysis li { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:12px 0; font-size:13px; }
.journey-table { border-collapse:collapse; min-width:1050px; width:100%; }
.journey-table th { text-align:left; font-size:13px; font-weight:500; color:var(--muted); padding:10px; }
.journey-table td { vertical-align:top; padding:8px; border-top:1px solid var(--line); }
.journey-table input, .journey-table textarea { width:150px; min-height:42px; padding:8px; border:1px solid var(--line); background:var(--bg-elevated); color:var(--ink); border-radius:var(--r-sm); }
.journey-table td:last-child .button { margin-bottom:6px; }
.memory-cover { padding:0; border-radius:var(--r-lg); background:var(--accent-soft); }
.memory-cover--photo { background:var(--bg-elevated); }
.memory-cover h1, .memory-cover h2, .memory-cover > p { max-width:100%; }
.memory-cover h1, .memory-cover h2 { font-size:28px; }
.memory-overview { padding:0 4px; }
.memory-places ol { padding-left:24px; }
.memory-places li { margin:14px 0; }
.memory-places time { display:block; color:var(--muted); font-size:13px; }
.memory-places strong { font-size:17px; }
.memory-plan > summary { padding:10px 0; }
.memory-actions { display:flex; flex-wrap:wrap; gap:8px; }
.share-settings { display:grid; gap:12px; margin:20px 0; }
.share-settings input { width:18px; height:18px; vertical-align:middle; accent-color:var(--accent); }
.share-link-input { min-width:0; width:100%; padding:10px; border:1px solid var(--line); border-radius:var(--r-sm); color:var(--ink); background:var(--bg-sunken); font-size:13px; }
.share-preview { margin-top:20px; padding:18px; background:var(--bg-sunken); border-radius:var(--r-lg); }
.journey-table-scroll, .itinerary-table-wrap, .table-scroll { width:100%; max-width:100%; overflow-x:auto; }
.journey-overview { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:24px; }
.journey-panel, .journey-overview > section, .today-next, .today-lodging, .settings-section, .restore-preview, .journey-share { padding:24px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); margin-bottom:20px; }
.journey-panel h2, .settings-section h2 { margin-bottom:12px; }
.journey-today { width:min(740px,100%); margin:0 auto; padding-bottom:100px; }
.journey-today > h2 { margin-bottom:16px; }
.today-next { border-left:3px solid var(--accent); }
.today-next h3 { font-size:20px; margin:8px 0; }
.today-dock { position:fixed; z-index:7; bottom:0; left:50%; transform:translateX(-50%); display:flex; gap:12px; width:min(740px,100%); padding:12px 20px calc(12px + env(safe-area-inset-bottom)); background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--r-lg) var(--r-lg) 0 0; }
.today-dock .button { flex:1; }
body:has(input:focus, textarea:focus, select:focus) .today-dock { position:static; transform:none; }
.journey-page:has(.journey-editor-host:not(:empty)) .today-dock { display:none; }
.expense-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.expense-summary > div, .expense-summary > article { padding:22px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.expense-summary strong { display:block; font-size:24px; margin-top:6px; font-variant-numeric:tabular-nums; }
.expense-summary span { color:var(--muted); }
.journey-expenses .expense-form { margin-bottom:24px; }
.journey-memory { width:min(880px,100%); margin:0 auto; }
.journey-memory-cover { width:100%; max-height:200px; object-fit:cover; border-radius:var(--r-lg); }
.journey-memory section { margin:24px 0; }
.journey-memory p, .journey-memory .note-card__body { white-space:pre-wrap; overflow-wrap:anywhere; }
.settings-page { width:min(850px,100%); margin:auto; }
.settings-section > p { margin:12px 0; }
.settings-section > .button { margin:4px 8px 4px 0; }
.settings-section form { display:grid; gap:16px; margin:20px 0; }
.settings-section form .button { justify-self:start; }
@media(max-width:1199px) { .journey-itinerary-layout:has(.journey-map-panel:not([hidden])) { grid-template-columns:130px minmax(0,1fr); } .journey-map-panel { grid-column:1/-1; position:static; } }
@media(max-width:767px) {
  .topbar { padding:10px 16px; gap:8px; min-height:60px; flex-wrap:wrap; }
  .topbar .button { min-height:36px; padding:7px 10px; }
  .save-status { flex-basis:100%; order:3; margin:0; }
  .topbar-actions { align-items:center; flex-shrink:0; gap:6px; }
  .topbar-actions .save-status { flex-basis:auto; order:0; font-size:11px; white-space:nowrap; }
  .topbar-actions .button { flex-shrink:0; white-space:nowrap; }
  .save-status:empty { display:none; }
  .app-view { width:calc(100% - 32px); padding:22px 0 40px; }
  .page-heading { align-items:stretch; flex-direction:column; gap:16px; }
  .page-heading__actions { justify-content:flex-start; }
  .page-heading__actions .button { flex:0 1 auto; }
  .trip-grid { grid-template-columns:minmax(0,1fr); }
  .trip-card__cover { height:auto; }
  .trip-filters { gap:4px; }
  .filter-button { padding:8px 12px; }
  .journey-header { flex-direction:column; gap:12px; padding-bottom:20px; }
  .journey-nav, .journey-tabs { gap:4px; }
  .journey-nav .button, .journey-tabs .button { padding:7px 12px; }
  .journey-itinerary-layout, .journey-layout, .journey-itinerary-layout:has(.journey-map-panel:not([hidden])) { grid-template-columns:minmax(0,1fr); gap:16px; }
  .journey-day-nav { display:flex; gap:6px; flex-wrap:wrap; position:static; }
  .journey-day-nav .button { padding:7px 10px; font-size:13px; }
  .journey-overview { grid-template-columns:minmax(0,1fr); gap:0; }
  .journey-overview__facts { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:20px 0; }
  .journey-overview > .journey-section-heading, .journey-shortcuts { margin-bottom:16px; }
  .journey-analysis__tables { grid-template-columns:minmax(0,1fr); }
  .journey-expense-row { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
  .journey-expense-row > div:last-child { grid-column:1/-1; justify-content:flex-end; }
  .journey-editor { padding:16px; }
  .journey-header__actions > .button { flex:0 1 auto; }
  .memory-cover h1, .memory-cover h2, .memory-cover > p { max-width:100%; }
  .memory-cover h1, .memory-cover h2 { font-size:24px; }
  .note-photo-gallery .photo-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .share-preview { padding:12px; }
  .journey-item, .journey-panel, .journey-overview > section, .today-next, .today-lodging, .settings-section, .journey-share { padding:18px; }
  .expense-summary { grid-template-columns:minmax(0,1fr); gap:10px; }
  .expense-summary > div, .expense-summary > article { display:flex; align-items:center; justify-content:space-between; gap:8px 16px; padding:16px; flex-wrap:wrap; }
  .expense-summary small { flex-basis:100%; margin:0; }
  .expense-summary strong { margin:0; font-size:22px; }
  .journey-map-panel { grid-column:auto; }
  .toast { bottom:calc(90px + env(safe-area-inset-bottom)); }
}
@media print {
  .journey-nav, .journey-tabs, .journey-header__actions, .today-dock, .network-status, .journey-toolbar, .trip-more { display:none !important; }
  .journey-memory { width:100%; }
  .journey-memory section, .note-card { break-inside:avoid; }
  :root[data-theme="dark"] { --bg:#fff; --bg-elevated:#fff; --ink:#111; --ink-soft:#222; --muted:#444; --line:#aaa; }
}

@media (max-width: 390px) {
  .notes-page, .notes-heading, .notes-list, .note-card, .note-form { max-width:100%; min-width:0; }
  .note-card, .note-form { padding:var(--sp-4); }
  .notes-heading { align-items:stretch; flex-direction:column; }
  .notes-heading .page-heading__actions { width:100%; }
}

.trip-card__map { margin-left:auto; }
.places-page, .places-page > *, .places-layout > * { min-width:0; }
.places-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.places-heading h2 { font-size:22px; }
.places-heading p { margin:6px 0 0; color:var(--muted); }
.places-heading > div:last-child { display:flex; flex-wrap:wrap; gap:8px; }
.places-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:16px 0; margin-bottom:20px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.places-summary > div { display:flex; align-items:baseline; gap:10px; padding:0 16px; border-right:1px solid var(--line); }
.places-summary > div:first-child { padding-left:0; }
.places-summary > div:last-child { border-right:0; }
.places-summary strong { font-size:22px; font-weight:650; line-height:1.35; font-variant-numeric:tabular-nums; }
.places-summary span { font-size:13px; color:var(--muted); }
.places-toolbar { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.places-filters { display:flex; gap:4px; padding:4px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--bg-elevated); }
.places-filters .button { border:0; background:transparent; min-height:34px; padding:7px 12px; }
.places-filters .button[aria-pressed="true"] { color:var(--accent-ink); background:var(--accent-soft); }
.places-search, .places-city { display:grid; gap:4px; flex:1 1 170px; font-size:12px; color:var(--muted); }
.places-search input, .places-city input { width:100%; min-width:0; min-height:42px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--bg-elevated); padding:8px 10px; color:var(--ink); font-size:14px; }
.places-batch-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.places-batch-actions [role="status"] { font-size:12px; color:var(--muted); }
.places-feedback:empty, .places-map-feedback:empty { display:none; }
.places-feedback { margin:8px 0 16px; padding:10px 12px; background:var(--accent-soft); border-radius:var(--r-sm); color:var(--accent-ink); }
.places-feedback.is-error, .place-error { color:var(--danger); }
.places-layout { display:grid; grid-template-columns:300px minmax(0,1fr); grid-template-areas:"list map"; gap:20px; align-items:start; }
.places-map-area { grid-area:map; }
.places-map { height:560px; height:min(560px,65dvh); min-height:380px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-sunken); isolation:isolate; }
.places-map-feedback { margin-top:10px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--r-sm); font-size:13px; overflow-wrap:anywhere; }
.places-map-area .form-hint { margin:8px 0; font-size:12px; }
.places-sidebar { grid-area:list; }
.places-list { max-height:min(620px,72dvh); overflow-y:auto; overscroll-behavior:contain; padding:0 4px 4px 0; }
.place-card { padding:16px; margin-bottom:12px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--bg-elevated); }
.place-card.is-selected { border-color:var(--accent); outline:2px solid var(--accent-soft); outline-offset:1px; }
.place-card__head { display:flex; gap:10px; align-items:flex-start; }
.place-card__head > div { min-width:0; }
.place-number { display:grid; place-items:center; width:28px; height:28px; flex:0 0 28px; border-radius:50%; background:var(--accent-soft); color:var(--accent-ink); font-size:12px; font-weight:650; }
.place-card.is-visited .place-number { color:var(--ok); background:var(--bg-sunken); }
.place-card__title { padding:0; border:0; background:transparent; color:var(--ink); text-align:left; font-size:16px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.place-card__title:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.place-card__head p, .place-card__status { margin:4px 0 0; font-size:12px; color:var(--muted); }
.place-card__status { margin-top:10px; }
.place-card__note { white-space:pre-wrap; overflow-wrap:anywhere; margin:10px 0; font-size:13px; }
.place-card__manage { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:14px; }
.place-card__manage .button { min-height:36px; padding:7px 12px; font-size:13px; }
.place-card__manage .button--danger { margin-left:auto; }
.place-card__manage [data-places-action="delete"] { color:var(--danger); border-color:transparent; background:transparent; }
.place-card__manage [data-places-action="delete"]:hover { background:var(--danger-soft); }
.place-card__actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.place-card__actions .button { min-height:32px; font-size:12px; padding:6px 8px; }
.place-error { font-size:12px; margin:8px 0; overflow-wrap:anywhere; }
.places-empty { padding:24px 18px; border:1px dashed var(--line); border-radius:var(--r-md); }
.places-empty p { font-size:14px; color:var(--muted); }
.place-marker-wrap { background:transparent; border:0; }
.place-marker { display:grid; place-items:center; width:32px; height:32px; border:2px solid var(--surface-raised); border-radius:50% 50% 50% 4px; background:var(--accent-hover); color:var(--on-accent); box-shadow:var(--shadow-md); font-size:13px; font-weight:650; }
.place-marker.is-visited { background:var(--ok); }
.places-import, .places-preview, .place-editor, .place-candidate-group, .place-pick-preview { padding:20px; margin:0 0 20px; border:1px solid var(--line); border-radius:var(--r-lg); background:var(--bg-elevated); }
.places-import h3, .places-preview h3, .place-editor h3, .place-candidate-group h3, .place-pick-preview h3 { margin:0 0 12px; }
.places-import form, .place-editor form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.places-import .form-hint, .places-import .form-actions, .place-editor .form-hint, .place-editor .form-actions { grid-column:1/-1; }
.places-file-info { grid-column:1/-1; margin:0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.places-coordinate-source { color:var(--accent-ink); font-size:13px; }
.places-import .field:has([type="file"]), .place-editor .field:has(textarea) { grid-column:1/-1; }
.places-import [type="file"] { max-width:100%; font-size:13px; }
.places-preview-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:var(--r-sm); margin:16px 0; }
.places-preview-table { border-collapse:collapse; font-size:13px; width:100%; min-width:640px; }
.places-preview-table th, .places-preview-table td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); white-space:pre-wrap; overflow-wrap:anywhere; max-width:280px; }
.places-preview-table th { background:var(--bg-sunken); font-weight:600; }
.places-preview .form-actions { margin-top:16px; flex-wrap:wrap; }
.places-source { max-height:220px; overflow:auto; padding:12px; white-space:pre-wrap; overflow-wrap:anywhere; background:var(--bg-sunken); border-radius:var(--r-sm); font-size:13px; }
.place-candidate { display:flex; align-items:flex-start; gap:10px; margin:8px 0; padding:12px; border:1px solid var(--line); border-radius:var(--r-sm); cursor:pointer; }
.place-candidate:has(input:checked) { border-color:var(--accent); background:var(--accent-soft); }
.place-candidate input { width:18px; height:18px; flex:0 0 18px; margin:3px 0 0; }
.place-candidate span { min-width:0; overflow-wrap:anywhere; }
.place-candidate small { display:block; margin-top:4px; color:var(--muted); }
.place-pick-preview .button { margin:8px 8px 0 0; }
@media(max-width:900px) {
  .places-layout { grid-template-columns:260px minmax(0,1fr); gap:16px; }
  .places-summary > div { flex-direction:column; gap:2px; }
}
@media(max-width:767px) {
  .places-page { display:flex; flex-direction:column; }
  .journey-nav .button { padding-inline:10px; font-size:13px; }
  .places-heading { order:0; flex-direction:column; gap:12px; margin-bottom:12px; }
  .places-heading > div:first-child { display:none; }
  .places-heading h2 { font-size:20px; }
  .places-heading > div:last-child { width:100%; }
  .places-heading > div:last-child .button { min-height:42px; flex:1; }
  .places-summary { order:1; margin-bottom:12px; padding:12px 0; }
  .places-summary > div { padding:0 8px; }
  .places-summary strong { font-size:18px; }
  .places-summary span { font-size:12px; }
  .places-toolbar { order:4; gap:10px; margin:16px 0; }
  .places-feedback, .places-geocode-credit, .places-page > [data-places-import], .places-candidates, .places-page > [data-places-editor] { order:2; }
  .places-geocode-credit { margin:0 0 12px; font-size:12px; }
  .places-filters { width:100%; }
  .places-filters .button { flex:1; min-height:40px; }
  .places-search, .places-city { flex-basis:calc(50% - 5px); }
  .places-batch-actions { width:100%; }
  .places-batch-actions .button { min-height:42px; }
  .places-layout { display:contents; }
  .places-map-area { order:3; }
  .places-sidebar { order:5; }
  .places-map { min-height:300px; height:45dvh; max-height:420px; }
  .places-list { max-height:none; overflow:visible; padding:0; }
  .place-card__actions .button { min-height:40px; padding:8px 10px; }
  .place-card__manage .button { min-height:40px; }
  .places-import, .places-preview, .place-editor, .place-candidate-group, .place-pick-preview { padding:16px; }
  .places-import form, .place-editor form { grid-template-columns:minmax(0,1fr); }
  .places-import .form-actions, .place-editor .form-actions { flex-direction:column-reverse; }
  .place-candidate { font-size:14px; }
}
@media print {
  .places-toolbar, .places-heading > div:last-child, .place-card__actions, .places-import { display:none; }
  .places-layout { display:block; }
  .places-list { max-height:none; overflow:visible; }
  .place-card { break-inside:avoid; }
}

.site-footer { width:min(1240px,calc(100% - 48px)); margin:0 auto; padding:0 0 24px; display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:12px; }
.site-footer a { color:inherit; text-decoration:none; }
.site-footer a:hover { color:var(--accent-ink); text-decoration:underline; }
@media(max-width:767px) { .site-footer { width:calc(100% - 32px); flex-wrap:wrap; padding-bottom:calc(96px + env(safe-area-inset-bottom)); font-size:11px; } }
@media print { .site-footer { display:none; } }
