/* 行迹 · travel journal
   palette: chart-paper green, ink, sea accent, buoy red */

:root {
  --paper: #e9ede7;
  --paper-top: #eef1ec;
  --paper-deep: #dfe5de;
  --surface: #fbfaf5;
  --surface-2: #f2f1ea;
  --ink: #14211c;
  --ink-soft: #5b6862;
  --ink-faint: #8a958f;
  --line: #d3dbd3;
  --line-strong: #b9c4bc;
  --sea: #1e5b4f;
  --sea-soft: #dce8e3;
  --buoy: #d2452f;
  --buoy-soft: #f8e3de;
  --gold: #9a742a;
  --tint: rgba(30, 91, 79, .07);
  --focus: rgba(30, 91, 79, .14);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --font-display: "Avenir Next", "Futura", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;

  --tabbar-h: 58px;
  --shadow-card: 0 1px 0 rgba(20, 33, 28, .04), 0 10px 28px -20px rgba(20, 33, 28, .45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, var(--tint), transparent 60%),
    linear-gradient(180deg, var(--paper-top) 0%, var(--paper) 42%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.sprite { display: none; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
}

#view {
  padding: max(18px, env(safe-area-inset-top)) 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

/* ---------- typography ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 6px;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 16px; }

.page-head { margin-bottom: 20px; }
.page-head .sub { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.page-head .head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head-tools { display: flex; gap: 8px; flex: 0 0 auto; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fdfcf8;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); opacity: .9; }
.btn .ic { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-danger { background: transparent; color: var(--buoy); border-color: rgba(210, 69, 47, .4); }
.btn-sm { width: auto; min-height: 40px; padding: 0 14px; font-size: 14px; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  flex: 0 0 auto;
}
.icon-btn:active { background: var(--surface-2); }

:focus-visible { outline: 2.5px solid var(--sea); outline-offset: 2px; }

/* ---------- page ---------- */

.page { animation: pageIn .26s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- trip ticket cards ---------- */

.trip-list { display: flex; flex-direction: column; gap: 14px; }

.trip-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(20, 33, 28, .08);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 18px 20px 16px;
  color: var(--ink);
  overflow: hidden;
}
.trip-card::before,
.trip-card::after {
  content: "";
  position: absolute;
  top: 62%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid rgba(20, 33, 28, .08);
}
.trip-card::before { left: -10px; }
.trip-card::after { right: -10px; }
.trip-card:active { transform: scale(.995); }

.trip-card .tk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.trip-card .tk-no { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-faint); }
.trip-card h3 { font-size: 21px; margin: 8px 0 0; }
.trip-card .tk-dates { margin: 6px 0 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }
.trip-card .tk-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--ink-soft);
}
.trip-card .tk-days { display: inline-flex; align-items: center; gap: 6px; }
.trip-card .tk-days .num { font-family: var(--font-mono); font-size: 17px; color: var(--ink); }
.trip-card .tk-status { display: inline-flex; align-items: center; gap: 6px; }
.trip-card .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sea); }

/* ---------- empty ---------- */

.empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 44px 22px 38px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: rgba(251, 250, 245, .55);
}
.empty .empty-ico {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px dashed var(--line-strong);
  color: var(--sea); margin-bottom: 18px;
}
.empty .empty-ico .ic { width: 30px; height: 30px; }
.empty h2 { font-size: 19px; }
.empty p { margin: 8px 0 20px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); max-width: 30ch; }
.empty .btn { width: auto; min-width: 168px; }

/* ---------- detail header ---------- */

.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.detail-head .grow { flex: 1; min-width: 0; }
.detail-head h2 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-head .meta { margin: 3px 0 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); }

/* ---------- day rail ---------- */

.day-rail {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.day-rail::-webkit-scrollbar { display: none; }
.day-chip {
  position: relative;
  flex: 0 0 60px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: rgba(251, 250, 245, .6);
  border-radius: var(--r-md);
  padding: 8px 0 7px;
  text-align: center;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.day-chip .dow { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.day-chip .num { display: block; font-family: var(--font-mono); font-size: 20px; line-height: 1.25; color: var(--ink); }
.day-chip.active { background: var(--ink); border-color: var(--ink); color: rgba(255, 255, 255, .72); }
.day-chip.active .num { color: #fff; }
.day-chip.today::after {
  content: ""; position: absolute; top: 6px; right: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--buoy);
}
.day-chip.active.today::after { background: #ff8a72; }

/* ---------- panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid rgba(20, 33, 28, .08);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.panel + .panel { margin-top: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head .eyebrow { margin: 0; }
.panel-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.note-input {
  width: 100%;
  min-height: 132px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 16px;
  line-height: 1.75;
  resize: vertical;
}
.note-input:focus { outline: none; }
.panel:focus-within { box-shadow: 0 0 0 3px var(--focus), var(--shadow-card); }

.note-input::placeholder { color: var(--ink-faint); }

/* ---------- photos ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .del {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(20, 33, 28, .62);
  color: #fff;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.photo .del .ic { width: 14px; height: 14px; }
.photo-add {
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px;
}
.photo-add .ic { width: 22px; height: 22px; }

/* ---------- timeline ---------- */

.timeline { position: relative; padding-left: 62px; margin-top: 4px; }
.timeline::before {
  content: ""; position: absolute; left: 45px; top: 9px; bottom: 9px;
  width: 1px; background: var(--line-strong);
}
.tl-item {
  position: relative; display: block; width: 100%;
  border: 0; background: none; padding: 0 0 12px;
  text-align: left; color: var(--ink);
}
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before {
  content: ""; position: absolute; left: -20.5px; top: 17px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--sea);
}
.tl-time {
  position: absolute; left: -62px; top: 13px; width: 36px;
  text-align: right; font-family: var(--font-mono);
  font-size: 11.5px; color: var(--ink-soft);
}
.tl-card {
  display: block; padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.tl-item:active .tl-card { background: var(--sea-soft); border-color: var(--sea-soft); }
.tl-empty { margin: 2px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.link-add {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; color: var(--sea);
  font-size: 12.5px; font-weight: 700; padding: 4px;
}
.link-add .ic { width: 15px; height: 15px; }

/* ---------- sheets ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(16, 26, 22, .38);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease both;
}
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.2, .8, .2, 1) both;
}
.sheet .grab { width: 38px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 2px auto 16px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { font-size: 20px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 16px;
  width: 100%;
  appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--focus); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea {
  width: 100%; min-height: 96px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 16px; line-height: 1.6;
  resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--focus); }
.hint { font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }
.field .hint { font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }
.field .err { font-size: 12px; color: var(--buoy); }

/* ---------- theme picker ---------- */

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.theme-option {
  display: flex; align-items: center; gap: 9px;
  min-height: 48px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 600; text-align: left;
}
.theme-option.active { border-color: var(--sea); box-shadow: 0 0 0 3px var(--focus); }
.theme-dots { display: inline-flex; flex: 0 0 auto; }
.theme-dots i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(20, 33, 28, .12);
  margin-left: -5px;
}
.theme-dots i:first-child { margin-left: 0; }
.theme-custom { padding-top: 14px; border-top: 1px dashed var(--line); }
.theme-custom label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.theme-custom input[type="color"] {
  width: 46px; height: 46px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); overflow: hidden;
}
.theme-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.theme-custom input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.theme-custom .hint { margin: 8px 0 0; }

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #f4f2ea;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  max-width: calc(100vw - 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 1000;
  box-shadow: 0 12px 30px -12px rgba(20, 33, 28, .5);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tabbar ---------- */

#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 800;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(251, 250, 245, .9);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid rgba(20, 33, 28, .1);
}
.tab {
  height: var(--tabbar-h);
  border: 0;
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  position: relative;
}
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--ink); }
.tab.active .ic { color: var(--sea); }
.tab.active::before {
  content: "";
  position: absolute; top: 0;
  width: 18px; height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--sea);
}

/* ---------- exchange ---------- */

.fx-panel { padding: 20px 18px 14px; }
.fx-side { display: flex; flex-direction: column; gap: 4px; }
.fx-label { margin: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.fx-line { display: flex; align-items: center; gap: 12px; }
.fx-input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; padding: 0;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 34px; line-height: 1.35; letter-spacing: -.03em;
}
.fx-input:focus { outline: none; }
.fx-out { color: var(--sea); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-cur {
  flex: 0 0 auto;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 30px 0 13px;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.fx-cur:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px var(--focus); }
.fx-mid { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.fx-hair { flex: 1; height: 0; border-top: 1px dashed var(--line); }
.fx-swap { width: 36px; height: 36px; background: var(--surface-2); }
.fx-swap .ic { width: 18px; height: 18px; }
.fx-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-soft);
}
.fx-link { border: 0; background: none; color: var(--sea); font-size: 12px; font-weight: 600; padding: 4px; }
.fx-chips { display: flex; gap: 8px; margin: 12px 0; }
.fx-chip {
  flex: 1; height: 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(251, 250, 245, .65);
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft);
}
.fx-chip:active { background: var(--surface-2); }
.fx-explain { margin: 6px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }

/* ---------- ledger ---------- */

.pos { color: var(--sea); }
.neg { color: var(--buoy); }

.sum-panel { padding: 18px 18px 16px; }
.sum-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sum-big { margin: 4px 0 0; font-family: var(--font-mono); font-size: 34px; line-height: 1.2; letter-spacing: -.03em; }
.bar {
  height: 7px; border-radius: 999px; margin-top: 16px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid rgba(20, 33, 28, .05);
}
.bar span { display: block; height: 100%; background: var(--sea); border-radius: 999px; transition: width .4s ease; }
.bar.over span { background: var(--buoy); }
.sum-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.sum-foot .neg, .sum-foot .pos { font-weight: 700; font-family: var(--font-mono); }
.sum-empty { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }

.day-panel { margin-top: 12px; }
.day-spent { margin: 2px 0 8px; font-family: var(--font-mono); font-size: 30px; line-height: 1.2; letter-spacing: -.03em; }
.day-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.pill {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono);
}
.pill.pos { background: var(--sea-soft); color: var(--sea); }
.pill.over { background: var(--buoy-soft); color: var(--buoy); }
.day-note { margin: 12px 0 0; padding-top: 11px; border-top: 1px dashed var(--line); font-size: 12px; line-height: 1.55; color: var(--ink-soft); }
.day-note.is-over { color: var(--buoy); }

.day-list { display: flex; flex-direction: column; }
.day-budget-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(20, 33, 28, .06);
}
.day-budget-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dbr-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dbr-date { font-family: var(--font-mono); font-size: 12.5px; }
.dbr-spent { font-size: 11.5px; color: var(--ink-soft); }
.dbr-tag { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; white-space: nowrap; }

.exp-group { padding: 12px 0; border-bottom: 1px solid rgba(20, 33, 28, .07); }
.exp-group:last-child { border-bottom: 0; padding-bottom: 0; }
.exp-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11px; letter-spacing: .06em; color: var(--ink-faint);
  margin-bottom: 4px;
}
.exp-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.exp-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-meta { font-size: 11px; color: var(--ink-faint); }
.exp-amt { font-family: var(--font-mono); font-size: 13.5px; white-space: nowrap; }
.exp-del, .chk-del {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-faint);
  display: grid; place-items: center; flex: 0 0 auto;
}
.exp-del:active, .chk-del:active { background: var(--surface-2); color: var(--buoy); }
.exp-del .ic, .chk-del .ic { width: 15px; height: 15px; }
.empty-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 2px; font-size: 13px; color: var(--ink-soft); }

.fx-preview {
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--sea-soft);
  color: var(--sea);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 4px;
}

/* ---------- checklist ---------- */

.chk-panel { padding: 8px 14px 4px; }
.chk-head, .chk-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 38px 76px 24px;
  gap: 8px;
  align-items: center;
}
.chk-head {
  padding: 10px 0 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.chk-row { padding: 11px 0; border-bottom: 1px solid rgba(20, 33, 28, .06); }
.chk-row:last-child { border-bottom: 0; }
.chk-box {
  width: 24px; height: 24px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: #fff;
  display: grid; place-items: center;
  padding: 0;
}
.chk-box .ic { width: 14px; height: 14px; opacity: 0; stroke-width: 2.6; }
.chk-row.done .chk-box { background: var(--sea); border-color: var(--sea); }
.chk-row.done .chk-box .ic { opacity: 1; }
.chk-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chk-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chk-place { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chk-qty { font-size: 11.5px; color: var(--ink-soft); text-align: center; }
.chk-price { font-size: 12px; text-align: right; white-space: nowrap; }
.chk-row.done .chk-name, .chk-row.done .chk-place, .chk-row.done .chk-price { color: var(--ink-faint); text-decoration: line-through; }
.chk-del { width: 24px; height: 24px; }

.total-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.total-num { margin: 4px 0 0; font-family: var(--font-mono); font-size: 26px; letter-spacing: -.02em; }
.total-side { text-align: right; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.total-side p { margin: 0; }

/* ---------- map ---------- */

.map-search-panel { padding: 12px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.search-box:focus-within { border-color: var(--sea); box-shadow: 0 0 0 3px var(--focus); }
.search-box > .ic { width: 18px; height: 18px; color: var(--ink-faint); flex: 0 0 auto; }
.search-box input {
  flex: 1; min-width: 0;
  height: 100%;
  border: 0; background: transparent; outline: none;
  font-size: 16px;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box button {
  width: 24px; height: 24px;
  border: 0; background: transparent; color: var(--ink-faint);
  display: grid; place-items: center; padding: 0;
}
.search-box button .ic { width: 15px; height: 15px; }
.search-hint { margin: 8px 2px 0; font-size: 11px; color: var(--ink-faint); }
.search-results { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.search-results[hidden] { display: none; }
.search-status { margin: 0; padding: 10px 4px; font-size: 12.5px; color: var(--ink-soft); }
.search-result {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  border-top: 1px solid rgba(20, 33, 28, .07);
  background: transparent;
  text-align: left;
}
.search-result:first-of-type { border-top: 0; }
.sr-dot {
  width: 28px; height: 28px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--sea);
  display: grid; place-items: center;
}
.sr-dot .ic { width: 15px; height: 15px; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sr-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-type {
  flex: 0 0 auto;
  font-size: 9.5px; color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}
.sr-near { font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; color: var(--ink-faint); margin-left: 5px; }

.map-wrap {
  position: relative;
  z-index: 0;
  height: min(46vh, 380px);
  min-height: 280px;
  margin-top: 12px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid rgba(20, 33, 28, .12);
  background: var(--paper-deep);
  box-shadow: var(--shadow-card);
}
.map-wrap.fallback { display: grid; place-items: center; padding: 24px; }
.map-fallback-text { font-size: 13px; line-height: 1.6; color: var(--ink-soft); text-align: center; max-width: 26ch; }
.leaflet-container { font-family: var(--font-body); font-size: 12px; }
.leaflet-control-attribution { font-size: 9px !important; background: rgba(251, 250, 245, .85) !important; }
.leaflet-popup-content { margin: 10px 14px; line-height: 1.5; }
.stop-marker {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--surface);
  box-shadow: 0 3px 10px rgba(20, 33, 28, .35);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.map-meta {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(251, 250, 245, .75);
  border: 1px solid rgba(20, 33, 28, .08);
  border-radius: var(--r-md);
}
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}
.seg button.active { background: var(--ink); color: #fff; }
.map-total { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }

.stop-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(20, 33, 28, .06);
}
.stop-row:last-child { border-bottom: 0; }
.stop-no {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stop-name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-addr { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-leg { font-size: 10.5px; color: var(--sea); margin-top: 3px; }
.stop-actions { display: flex; gap: 1px; flex: 0 0 auto; }
.stop-actions button {
  width: 27px; height: 27px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  display: grid; place-items: center;
  padding: 0;
}
.stop-actions button:active { background: var(--surface-2); }
.stop-actions button:disabled { opacity: .25; }
.stop-actions button[data-remove] { color: var(--ink-faint); }
.stop-actions .ic { width: 15px; height: 15px; }

/* ---------- backup ---------- */

.backup-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
label.btn { cursor: pointer; }
label.btn input { display: none; }

/* ---------- placeholder view ---------- */

.placeholder-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: rgba(251, 250, 245, .5);
}

/* ---------- collaboration ---------- */

.account-btn { position: relative; }
.account-btn .sync-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 2px var(--surface);
  opacity: 0;
  transition: opacity .2s;
}
.account-btn.signed .sync-dot { opacity: 1; }
.sync-dot.idle { background: var(--sea); }
.sync-dot.syncing { background: var(--gold); animation: sync-pulse 1.1s ease-in-out infinite; }
.sync-dot.pending { background: var(--gold); }
.sync-dot.error { background: var(--buoy); }
.sync-dot.offline { background: var(--ink-faint); }
.sync-dot.off { opacity: 0; }
@keyframes sync-pulse { 50% { opacity: .35; } }

.tk-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
  vertical-align: 1px;
}

.settings-meta {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

.account-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper-top);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.account-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-id strong { font-size: 16px; }
.account-id span { font-size: 12px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }

.sync-panel { padding-top: 13px; padding-bottom: 13px; }
.sync-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.sync-line .sync-dot {
  position: static;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  opacity: 1;
  box-shadow: none;
}
.row-actions { display: flex; gap: 8px; }
.row-actions .btn { flex: 1; width: auto; }

.local-trip-list { display: flex; flex-direction: column; }
.local-trip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(20, 33, 28, .06);
  font-size: 14px;
}
.local-trip-row:last-child { border-bottom: 0; }
.local-trip-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.invite-box {
  padding: 16px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: center;
}
.invite-box .eyebrow { margin: 0; }
.invite-code {
  margin: 8px 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .26em;
  text-indent: .26em;
  color: var(--sea);
}
.invite-box .row-actions { margin-top: 12px; }

.member-box { margin-top: 16px; }
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(20, 33, 28, .06);
}
.member-row:last-child { border-bottom: 0; }
.member-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role { flex: 0 0 auto; font-size: 11px; color: var(--ink-faint); }

.privacy-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 2px solid var(--sea);
  border-radius: 0 8px 8px 0;
  background: var(--tint);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
