/* ============================================================================
   KYUSHU PLAN — Premium trip-planner design system
   Build-free static site. Mobile-app feel, Google/Gemini-grade polish.
   ========================================================================== */

/* ---------- Design tokens ------------------------------------------------- */
:root {
  /* Brand gradients (Gemini-like indigo -> cyan, sakura accent) */
  --brand-1: #6366f1;     /* indigo light */
  --brand-2: #4f46e5;     /* primary accent (single, refined indigo) */
  --brand-3: #4338ca;     /* indigo deep */
  --sakura: #e0496b;      /* muted rose — reserved for "live/now" only */
  --sakura-2: #ec7891;
  --gold: #c7951b;        /* muted ochre */

  --grad-brand: linear-gradient(145deg, #5b54e8, #4338ca);   /* single-hue, premium */
  --grad-sakura: linear-gradient(145deg, #e0496b, #c83a5c);  /* single-hue */
  --grad-gold: linear-gradient(145deg, #d4a017, #b8860b);
  --grad-aurora: radial-gradient(820px 420px at 50% -16%, rgba(79,70,229,.045), transparent 62%);
  --hero-bg: linear-gradient(155deg, #2b2e39 0%, #191b22 100%);  /* refined ink masthead */
  --hero-accent: #aeb6ee;

  /* Light theme surfaces — clean, neutral */
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e9ebef;
  --line: #ebedf1;
  --line-strong: #dcdfe6;

  --text: #15171c;
  --text-2: #565d6b;
  --text-3: #8a909c;
  --text-on-brand: #ffffff;

  --shadow-1: 0 1px 2px rgba(18,20,28,.05);
  --shadow-2: 0 4px 14px rgba(18,20,28,.07);
  --shadow-3: 0 10px 30px rgba(18,20,28,.10);
  --shadow-pop: 0 18px 44px rgba(18,20,28,.18);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --tab-h: 64px;
  --appbar-h: 60px;
  --maxw: 720px;

  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-in: cubic-bezier(.4,0,1,1);
  --spring: cubic-bezier(.34,1.56,.4,1);
  --font: "Google Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Noto Sans TC", "Noto Sans JP", "PingFang TC", "Microsoft JhengHei", Roboto, sans-serif;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-elev: #13151c;
  --surface: #161922;
  --surface-2: #1c2029;
  --surface-3: #262b36;
  --line: #242833;
  --line-strong: #353b48;

  --text: #ecedf2;
  --text-2: #a6acba;
  --text-3: #767c8a;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 6px 18px rgba(0,0,0,.4);
  --shadow-3: 0 16px 38px rgba(0,0,0,.5);
  --shadow-pop: 0 22px 56px rgba(0,0,0,.6);
  --grad-aurora: radial-gradient(820px 420px at 50% -16%, rgba(99,102,241,.09), transparent 62%);
  --hero-bg: linear-gradient(155deg, #1c1e26 0%, #0f1117 100%);
  --hero-accent: #a5b4fc;
}

/* ---------- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  letter-spacing: .01em;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .25s var(--ease);
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(99,102,241,.25); }

/* sprite icon default size — overridden by any `.context svg` rule (higher specificity) */
.ic { width: 1.1em; height: 1.1em; flex: none; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- App layout ---------------------------------------------------- */
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(16,21,31,.06);
}

/* Aurora background layer */
.aurora {
  position: fixed; inset: 0; z-index: -1;
  background: var(--grad-aurora);
  pointer-events: none;
}

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--appbar-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex; align-items: center; gap: 12px;
  padding-left: 16px; padding-right: 12px;
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.appbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.appbar__logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.3);
  flex: none;
}
.appbar__logo svg { width: 20px; height: 20px; }
.appbar__title { font-weight: 600; font-size: 16px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__sub { font-size: 11px; color: var(--text-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__spacer { flex: 0 0 0; }
.iconbtn {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--text-2);
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn--live { position: relative; }
.iconbtn--live::after {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--sakura);
  box-shadow: 0 0 0 3px var(--bg-elev); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Page container */
main {
  padding: 16px 16px calc(var(--tab-h) + var(--safe-b) + 24px);
  min-height: calc(100vh - var(--appbar-h));
}
.page { animation: fadeUp .42s var(--ease) both; }
.page[hidden] { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ---------- Bottom tab bar ----------------------------------------------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--maxw); z-index: 50;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3); position: relative; font-size: 10.5px; font-weight: 600;
  transition: color .2s var(--ease);
}
.tab svg { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.tab__icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--r-pill); transition: background .25s var(--ease); }
.tab.is-active { color: var(--brand-2); }
[data-theme="dark"] .tab.is-active { color: #8ab4ff; }
.tab.is-active .tab__icon { background: color-mix(in srgb, var(--brand-2) 13%, transparent); transform: translateY(-1px); }
.tab:active svg { transform: scale(.86); }
/* sliding active indicator */
.tabind { position: absolute; top: 0; left: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand-2); width: 24px;
  transform: translateX(-100px); transition: transform .42s var(--spring), width .42s var(--spring); will-change: transform, width; }
[data-theme="dark"] .tabind { background: #8ab4ff; }

/* ---------- Typography helpers ------------------------------------------- */
.h-display { font-size: 24px; font-weight: 700; letter-spacing: -.022em; line-height: 1.18; }
.h-section { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.h-card { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }

/* ---------- Cards --------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card--pad { padding: 16px; }
.card--tap { transition: transform .18s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease); }
.card--tap:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card--tap:active { transform: translateY(0) scale(.995); }

/* Hero card */
.hero {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  color: #fff; padding: 22px; box-shadow: var(--shadow-2);
  background: var(--hero-bg);
}
.hero::before {
  content:""; position:absolute; inset:0;
  background: radial-gradient(520px 240px at 100% -16%, rgba(255,255,255,.07), transparent 60%);
}
.hero > * { position: relative; }
.hero__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--hero-accent); }
.hero__title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; line-height: 1.14; }
.hero__meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; font-weight: 500; }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.72); }
.hero__meta svg { width: 15px; height: 15px; opacity: .8; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line);
  white-space: nowrap; transition: all .18s var(--ease);
}
.chip svg { width: 14px; height: 14px; }
.chip--brand { background: color-mix(in srgb, var(--brand-2) 12%, transparent); color: var(--brand-2); border-color: transparent; }
.chip--sakura { background: color-mix(in srgb, var(--sakura) 14%, transparent); color: var(--sakura); border-color: transparent; }
.chip--gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #a36c00; border-color: transparent; }
[data-theme="dark"] .chip--gold { color: var(--gold); }
.chip--tap { cursor: pointer; }
.chip--tap:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.chip.is-on { background: var(--grad-brand); color:#fff; border-color: transparent; }

.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-pill); font-weight: 650; font-size: 14px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { box-shadow: var(--shadow-1); }
.btn:active { transform: scale(.96); }
.btn--brand { background: var(--brand-2); color:#fff; border-color: transparent; box-shadow: var(--shadow-1); }
.btn--brand:hover { background: var(--brand-3); box-shadow: var(--shadow-2); }
.btn--sakura { background: var(--sakura); color:#fff; border-color: transparent; box-shadow: var(--shadow-1); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: 13px; }

/* Map link button */
.gmap-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 650; color: var(--text);
  transition: all .18s var(--ease);
}
.gmap-btn:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-1px); }
.gmap-btn svg { width: 15px; height: 15px; }

/* ---------- Today / Now banner ------------------------------------------- */
.nowcard { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.nowcard__bg { display: none; }
.nowcard__body { position: relative; padding: 18px; color: var(--text); }
.nowcard__label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sakura); display:flex; align-items:center; gap:8px; }
.nowcard__title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin-top: 8px; line-height: 1.2; }
.nowcard__time { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 5px; display:flex; align-items:center; gap:6px; }
.nowcard__next { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.nowcard__next b { font-weight: 700; color: var(--text); }

/* Live dot */
.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--sakura); box-shadow: 0 0 0 0 rgba(224,73,107,.6); animation: ring 1.8s infinite; display:inline-block; }
@keyframes ring { 0%{box-shadow:0 0 0 0 rgba(224,73,107,.5)} 70%{box-shadow:0 0 0 7px rgba(224,73,107,0)} 100%{box-shadow:0 0 0 0 rgba(224,73,107,0)} }

/* ---------- Timeline (itinerary) ----------------------------------------- */
.daypick { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.daypick::-webkit-scrollbar { display: none; }
.daypill {
  flex: none; min-width: 58px; padding: 9px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); text-align: center;
  transition: all .18s var(--ease);
}
.daypill__dow { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; }
.daypill__num { font-size: 18px; font-weight: 750; margin-top: 2px; }
.daypill__city { font-size: 10px; color: var(--text-3); margin-top: 1px; white-space: nowrap; }
.daypill.is-active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-2); }
.daypill.is-active .daypill__dow, .daypill.is-active .daypill__city { color: rgba(255,255,255,.9); }
.daypill.is-today::after { content:"今"; position:absolute; }

.timeline { position: relative; margin-top: 8px; padding-left: 4px; }
.tl-item { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding-bottom: 6px; }
.tl-time { text-align: right; padding-top: 14px; }
.tl-time b { font-size: 14px; font-weight: 750; display: block; }
.tl-time span { font-size: 11px; color: var(--text-3); }
.tl-rail { position: absolute; left: 60px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-body { position: relative; padding-bottom: 14px; }
.tl-dot {
  position: absolute; left: -22px; top: 18px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand-2); z-index: 1;
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-item--move .tl-dot { border-color: var(--sakura); }
.tl-item--now .tl-dot { background: var(--sakura); border-color: var(--sakura); animation: pulse 1.6s infinite; }
.tl-item--done .tl-dot { background: var(--brand-2); }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 14px; box-shadow: var(--shadow-1); transition: all .18s var(--ease); }
.tl-card.is-tap { cursor: pointer; }
.tl-card.is-tap:hover { transform: translateX(2px); box-shadow: var(--shadow-2); }
.tl-item--now .tl-card { border-color: var(--sakura); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sakura) 30%, transparent); }
.tl-card__title { font-weight: 650; font-size: 15px; }
.tl-card__desc { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.tl-card__foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.tl-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); }

/* Train route block */
.route {
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sakura) 6%, var(--surface)), var(--surface));
  padding: 12px 14px;
}
.route__head { display:flex; align-items:center; gap:8px; font-weight:700; font-size:13px; color: var(--sakura); }
.route__legs { margin-top: 8px; }
.leg { display: grid; grid-template-columns: 64px 1fr; gap: 10px; font-size: 13px; position: relative; padding: 6px 0; }
.leg__time { font-weight: 750; font-variant-numeric: tabular-nums; }
.leg__line { font-weight: 650; }
.leg__line small { color: var(--text-3); font-weight: 600; }
.leg__sub { color: var(--text-3); font-size: 12px; }
.leg--transfer { color: var(--text-3); font-style: italic; font-size: 12px; }

/* ---------- Weather ------------------------------------------------------- */
.wx-hero { border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-3); color: #fff; position: relative; }
.wx-hero__bg { position:absolute; inset:0; transition: background .6s var(--ease); }
.wx-hero__body { position: relative; padding: 20px; }
.wx-temp { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.wx-now { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wx-emoji { font-size: 52px; line-height: 1; }
.wx-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 13px; font-weight: 600; opacity: .95; flex-wrap: wrap; }
.wx-hours { display: flex; gap: 6px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-hour { flex: none; text-align: center; min-width: 52px; padding: 10px 6px; border-radius: var(--r-md); background: rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.wx-hour b { font-size: 13px; }
.wx-hour .e { font-size: 20px; margin: 4px 0; }
.wx-hour small { font-size: 11px; opacity: .85; }
.wx-day { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.wx-day:last-child { border-bottom: 0; }
.wx-day.is-visit { background: color-mix(in srgb, var(--brand-2) 7%, transparent); border-radius: 10px; padding: 11px 10px; border-bottom-color: transparent; }
.wx-day.is-visit .wx-day__name { color: var(--brand-2); font-weight: 700; }
.wx-day__name { width: 64px; font-weight: 650; font-size: 13px; }
.wx-day__e { font-size: 22px; width: 30px; text-align:center; }
.wx-day__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); position: relative; overflow: hidden; }
.wx-day__fill { position:absolute; height: 100%; border-radius:999px; background: linear-gradient(90deg, #38bdf8, #fbbf24, #fb7185); }
.wx-day__t { width: 86px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; font-weight:600; }
.wx-rain { font-size: 11px; color: var(--brand-3); font-weight: 700; }

/* ---------- Souvenirs ----------------------------------------------------- */
.gift {
  display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 13px;
  border-bottom: 1px solid var(--line);
}
.gift:last-child { border-bottom: 0; }
.gift__ico { width: 46px; height: 46px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 24px; background: var(--surface-2); }
.gift__name { font-weight: 650; font-size: 15px; }
.gift__jp { font-size: 12px; color: var(--text-3); }
.gift__desc { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.gift__where { font-size: 12px; color: var(--brand-2); font-weight: 600; margin-top: 5px; display:flex; align-items:center; gap:5px; }
[data-theme="dark"] .gift__where { color: #8ab4ff; }

/* ---------- Map page ------------------------------------------------------ */
#leafmap { height: 56vh; min-height: 360px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); z-index: 0; }
#dayMiniMap { height: 190px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); z-index: 0; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--shadow-3); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); }
.map-legend { display:flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.map-legend span { display:inline-flex; align-items:center; gap:6px; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; }

/* ---------- Gemini chat / agent ------------------------------------------ */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--appbar-h) - var(--tab-h) - var(--safe-b) - 8px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 2px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 86%; padding: 12px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; animation: fadeUp .3s var(--ease) both; white-space: pre-wrap; word-wrap: break-word; }
.msg--user { align-self: flex-end; background: var(--grad-brand); color: #fff; border-bottom-right-radius: 6px; }
.msg--ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-1); }
.msg--ai strong { font-weight: 700; }
.msg--ai code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.msg-action {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--brand-2) 35%, transparent);
  padding: 8px 12px; border-radius: var(--r-md); animation: fadeUp .3s var(--ease) both;
}
.msg-action svg { width: 15px; height: 15px; }
[data-theme="dark"] .msg-action { color: #8ab4ff; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: bounce 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: .15s } .typing span:nth-child(3){ animation-delay: .3s }
@keyframes bounce { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button {
  flex: none; padding: 9px 13px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  transition: all .18s var(--ease);
}
.suggest button:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-1px); }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 2px calc(8px + var(--safe-b)); }
.composer__field { flex: 1; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 8px 8px 8px 14px; box-shadow: var(--shadow-1); transition: border-color .2s; }
.composer__field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.composer textarea { flex: 1; border: 0; background: none; resize: none; max-height: 120px; font-size: 14.5px; line-height: 1.4; padding: 4px 0; }
.composer textarea:focus { outline: none; }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-2); transition: transform .15s var(--ease); }
.send-btn:active { transform: scale(.9); }
.send-btn:disabled { opacity: .4; }
.mic-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; flex: none; transition: all .18s var(--ease); }
.mic-btn.is-rec { background: var(--grad-sakura); color: #fff; animation: pulse 1.2s infinite; }
.send-btn svg, .mic-btn svg { width: 20px; height: 20px; }

.agent-toggle { display:flex; align-items:center; gap: 8px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .25s var(--ease); flex:none; }
.switch::after { content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow: var(--shadow-1); transition: transform .25s var(--ease); }
.switch.is-on { background: var(--grad-brand); }
.switch.is-on::after { transform: translateX(18px); }

/* ---------- Sheets / modals ---------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(8,10,18,.55); backdrop-filter: blur(3px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: 100%; max-width: var(--maxw); max-height: 88vh; z-index: 61;
  background: var(--bg-elev); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-pop); transition: transform .38s var(--ease);
  display: flex; flex-direction: column; padding-bottom: var(--safe-b);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__grab { width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 10px auto 4px; flex: none; }
.sheet__head { display:flex; align-items:center; justify-content:space-between; padding: 8px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet__title { font-size: 18px; font-weight: 700; }
.sheet__body { overflow-y: auto; padding: 16px 18px 24px; }

/* ---------- Misc ---------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-3); z-index: 80; opacity: 0; pointer-events: none; transition: all .3s var(--ease); white-space: nowrap; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty__emoji { font-size: 44px; margin-bottom: 12px; }

.badge-rain { background: color-mix(in srgb, var(--brand-3) 16%, transparent); color: var(--brand-3); }
.badge-move { background: color-mix(in srgb, var(--sakura) 16%, transparent); color: var(--sakura); }
.badge-eat { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #a36c00; }
[data-theme="dark"] .badge-eat { color: var(--gold); }
.badge-see { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand-2); }

.flag-pill { display:inline-flex; align-items:center; gap:6px; font-weight:700; }

/* Pull-to-detail enter animation for list children */
.stagger > * { animation: fadeUp .4s var(--ease) both; }
.stagger > *:nth-child(2){animation-delay:.04s} .stagger > *:nth-child(3){animation-delay:.08s}
.stagger > *:nth-child(4){animation-delay:.12s} .stagger > *:nth-child(5){animation-delay:.16s}
.stagger > *:nth-child(6){animation-delay:.2s} .stagger > *:nth-child(7){animation-delay:.24s}

/* ========================================================================
   MOTION SYSTEM — splash, ripple, transitions, micro-interactions
   ====================================================================== */
#splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: var(--grad-brand);
  transition: opacity .55s var(--ease), visibility .55s var(--ease);
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; color: #fff; }
.splash-logo {
  width: 84px; height: 84px; border-radius: 24px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 18px 50px rgba(0,0,0,.25);
  animation: splashPop .7s var(--ease) both;
}
.splash-logo svg { width: 48px; height: 48px; }
.splash-title { font-size: 19px; font-weight: 800; letter-spacing: .04em; animation: fadeUp .6s .15s var(--ease) both; }
.splash-sub { font-size: 12.5px; font-weight: 600; opacity: .85; animation: fadeUp .6s .25s var(--ease) both; margin-top: -8px; }
.splash-bar { width: 120px; height: 3px; border-radius: 999px; background: rgba(255,255,255,.3); overflow: hidden; margin-top: 6px; }
.splash-bar::after { content:""; display: block; height: 100%; width: 40%; border-radius: 999px; background: #fff; animation: splashBar 1s var(--ease) infinite; }
@keyframes splashPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes splashBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* Ripple */
.rippling { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .16; pointer-events: none; animation: rippleOut .6s var(--ease) forwards; }
@keyframes rippleOut { to { transform: scale(2.4); opacity: 0; } }

/* Tab bounce + active indicator dot */
@keyframes tabPop { 0% { transform: scale(.78); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.tab.is-active svg { animation: tabPop .42s var(--ease); }

/* Page enter handled via WAAPI in JS; keep will-change hint */
.page { will-change: opacity, transform; }

/* Count-up / shimmer-in for numbers */
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ========================================================================
   COMMAND CENTER (Today) — progress ring + next-step
   ====================================================================== */
.cmd { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; }
@property --pct { syntax: '<number>'; inherits: false; initial-value: 0; }
.ring__fill { position: absolute; inset: 0; border-radius: 50%; --pct: 0;
  background: conic-gradient(var(--brand-2) calc(var(--pct) * 1deg), var(--surface-3) 0);
  transition: --pct .95s var(--ease); }
.ring__hole { position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.ring__pct { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ring__lbl { font-size: 9.5px; font-weight: 700; color: var(--text-3); letter-spacing: .08em; }
.cmd__next-lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.cmd__next-title { font-size: 18px; font-weight: 750; margin-top: 3px; line-height: 1.2; }
.cmd__count { font-size: 13px; font-weight: 650; color: var(--sakura); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.dayprog { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 14px; }
.dayprog__fill { height: 100%; border-radius: 999px; background: var(--grad-brand); transition: width .8s var(--ease); }

/* ========================================================================
   TOOLKIT (錦囊) — tool grid + sub-views
   ====================================================================== */
.tk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  text-align: left; transition: transform .18s var(--ease), box-shadow .25s var(--ease);
}
.tk-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tk-tile:active { transform: scale(.97); }
.tk-tile__ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.tk-tile__t { font-weight: 700; font-size: 14.5px; }
.tk-tile__d { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.tk-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--brand-2); padding: 6px 0; }
.tk-back svg { width: 18px; height: 18px; transform: rotate(180deg); }

/* Phrasebook */
.ph-cat { font-size: 13px; font-weight: 800; letter-spacing: .04em; margin: 18px 2px 8px; display: flex; align-items: center; gap: 8px; }
.ph-item { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; transition: all .18s var(--ease); }
.ph-item:hover { border-color: var(--brand-2); }
.ph-zh { font-size: 13px; color: var(--text-3); }
.ph-jp { font-size: 16px; font-weight: 650; margin-top: 2px; }
.ph-ro { font-size: 12px; color: var(--brand-2); margin-top: 2px; }
[data-theme="dark"] .ph-ro { color: #8ab4ff; }
.ph-speak { float: right; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.ph-speak svg { width: 16px; height: 16px; }

/* Currency converter */
.cc-row { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.cc-flag { font-size: 26px; }
.cc-cur { font-size: 12px; font-weight: 700; color: var(--text-3); }
.cc-input { flex: 1; border: 0; background: none; font-size: 24px; font-weight: 700; text-align: right; width: 100%; min-width: 0; }
.cc-input:focus { outline: none; }
.cc-rate { font-size: 12px; color: var(--text-3); text-align: center; }
.cc-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Checklist */
.ck-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ck-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; transition: all .2s var(--ease); }
.ck-box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.ck-item.done .ck-box { background: var(--brand-2); border-color: var(--brand-2); }
.ck-item.done .ck-box svg { opacity: 1; transform: none; }
.ck-item.done .ck-label { color: var(--text-3); text-decoration: line-through; }
.ck-label { font-size: 14.5px; }

/* Emergency card */
.emg { border-radius: var(--r-lg); padding: 16px; color: #fff; background: var(--grad-sakura); box-shadow: var(--shadow-2); margin-bottom: 14px; }
.emg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.22); }
.emg-row:last-child { border-bottom: 0; }
.emg-call { background: rgba(255,255,255,.22); padding: 7px 14px; border-radius: var(--r-pill); font-weight: 800; font-size: 15px; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; }

/* Bookings form */
.bk-field { margin-bottom: 12px; }
.bk-field label { font-size: 12px; font-weight: 600; color: var(--text-3); display: block; margin-bottom: 4px; }
.bk-field input, .bk-field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; }

/* Global search results */
.sr-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s var(--ease); border-radius: 10px; }
.sr-item:hover { background: var(--surface-2); }
.sr-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.sr-label { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Favorite star */
.fav-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); transition: all .2s var(--ease); flex: none; }
.fav-btn svg { width: 19px; height: 19px; }
.fav-btn.is-fav { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.fav-btn.is-fav svg { fill: var(--gold); animation: tabPop .4s var(--ease); }

/* ---------- Today weather + outfit card ---------------------------------- */
.wx-today { position: relative; border-radius: var(--r-xl); overflow: hidden; color: #fff; box-shadow: var(--shadow-3); }
.wx-today__bg { position: absolute; inset: 0; transition: background .6s var(--ease); }
.wx-today__bg::after { content:""; position:absolute; inset:0; background: radial-gradient(420px 200px at 92% -10%, rgba(255,255,255,.28), transparent 60%); }
.wx-today__body { position: relative; padding: 18px; }
.wx-today__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .92; display:flex; align-items:center; gap:8px; }
.wx-today__where { font-size: 21px; font-weight: 800; margin-top: 5px; display: flex; align-items: center; gap: 8px; }
.wx-today__now { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.wx-today__temp { font-size: 46px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.wx-today__emoji { font-size: 42px; line-height: 1; }
.wx-today__meta { font-size: 12.5px; font-weight: 600; opacity: .95; margin-top: 3px; }
.wx-today__wear { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.22); }
.wx-today__wear-h { font-size: 12px; font-weight: 700; letter-spacing: .06em; opacity: .92; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; }
.wear-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wear-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; }
.wx-today__tip { font-size: 12px; opacity: .9; margin-top: 10px; line-height: 1.5; }

/* ========================================================================
   SCREENS: Home (login) + Plans (list)
   ====================================================================== */
.screen { animation: fadeUp .35s var(--ease) both; }
.home { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 22px calc(40px + var(--safe-b)); }
.home__logo { width: 76px; height: 76px; border-radius: 22px; background: var(--grad-brand); display: grid; place-items: center; box-shadow: var(--shadow-3); margin-bottom: 20px; }
.home__logo svg { width: 42px; height: 42px; }
.home__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--brand-2); }
.home__title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.home__sub { font-size: 15px; color: var(--text-2); margin-top: 10px; line-height: 1.6; }
.home__features { margin: 24px 0; display: flex; flex-direction: column; gap: 14px; }
.home-feat { display: flex; gap: 12px; align-items: flex-start; }
.home-feat__ic { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.home-feat__t { font-weight: 650; font-size: 14.5px; }
.home-feat__d { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }

.plans-main { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-b)); }
.plan-card { display: flex; align-items: center; gap: 14px; padding: 15px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); margin-bottom: 12px; transition: transform .18s var(--ease), box-shadow .25s var(--ease); cursor: pointer; }
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.plan-card:active { transform: scale(.99); }
.plan-card__ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; flex: none; background: var(--surface-2); }
.plan-card__body { flex: 1; min-width: 0; }
.plan-card__title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card__meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-card__actions { display: flex; gap: 2px; flex: none; }
.plan-card--tpl { border-style: dashed; border-color: var(--line-strong); background: transparent; box-shadow: none; }
.plan-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand-2); }
.plan-badge--tpl { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #a36c00; }
[data-theme="dark"] .plan-badge--tpl { color: var(--gold); }

/* AI create-trip box (Plans page) */
.ai-create { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 14px; margin-bottom: 18px; }
.ai-create__head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.ai-create__spark { width: 28px; height: 28px; border-radius: 8px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; }
.ai-create__spark svg { width: 16px; height: 16px; }
.ai-create__field { display: flex; align-items: flex-end; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 8px 8px 8px 12px; transition: border-color .2s, box-shadow .2s; }
.ai-create__field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 16%, transparent); }
.ai-create__field textarea { flex: 1; border: 0; background: none; resize: none; max-height: 100px; font-size: 14.5px; line-height: 1.4; padding: 4px 0; }
.ai-create__field textarea:focus { outline: none; }
.ai-create__chips { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.ai-create__chips::-webkit-scrollbar { display: none; }
.ai-create__chips button { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); transition: all .18s var(--ease); }
.ai-create__chips button:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* Polished login */
#screen-home { background: radial-gradient(900px 520px at 50% -12%, color-mix(in srgb, var(--brand-2) 13%, transparent), transparent 62%); }
.home__logo { width: 84px; height: 84px; border-radius: 24px; }
.home__logo svg { width: 46px; height: 46px; }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; box-shadow: var(--shadow-1); }
.btn-google:hover { box-shadow: var(--shadow-2); background: #fff; }
[data-theme="dark"] .btn-google { background: #fff; color: #1f1f1f; border-color: #fff; }
.btn-google .gicon { width: 18px; height: 18px; flex: none; }

/* Install (Add to Home Screen) guide */
.ig-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.ig-num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-2); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 2px; }
.ig-mock { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.ig-mock__ic { color: var(--brand-2); display: grid; place-items: center; }
.ig-mock__ic svg { width: 18px; height: 18px; }
.ig-cap { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }

@media (min-width: 600px) {
  body { font-size: 15.5px; }
  #leafmap { height: 60vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .01ms !important; }
}

/* ---- Export sheet rows ---- */
.exp-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); transition: background .15s var(--ease), transform .12s var(--ease); }
.exp-row:hover { background: var(--surface-2); }
.exp-row:active { transform: scale(.99); }
.exp-row__ic { font-size: 22px; flex: none; line-height: 1; }
.exp-row__tx { min-width: 0; flex: 1; }
.exp-row__tx b { display: block; font-size: 14.5px; }
.exp-row__go { color: var(--text-3); display: grid; place-items: center; flex: none; }
.exp-row__go svg { width: 18px; height: 18px; }

/* ---- Printable PDF plan (#printRoot only renders in print) ---- */
#printRoot { display: none; }
@media print {
  body.printing > *:not(#printRoot) { display: none !important; }
  body.printing #printRoot { display: block !important; }
  body.printing { background: #fff !important; }
  @page { margin: 14mm 12mm; }
}
.pdoc { font-family: 'Noto Sans TC', 'Inter', system-ui, sans-serif; color: #111; font-size: 11.5px; line-height: 1.5; -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff; }
.pd-cover { border-bottom: 3px solid #2563eb; padding-bottom: 10px; margin-bottom: 14px; }
.pd-brand { font-weight: 800; letter-spacing: .16em; color: #2563eb; font-size: 11px; }
.pd-title { font-size: 24px; font-weight: 800; margin: 5px 0 3px; color: #0f172a; }
.pd-meta { color: #555; font-size: 12px; }
.pd-block { margin: 0 0 14px; }
.pd-block > h2 { font-size: 14px; font-weight: 800; color: #1d4ed8; border-left: 4px solid #2563eb; padding-left: 8px; margin: 16px 0 8px; }
.pd-day { break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px; }
.pd-dh { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid #d4d4d8; padding-bottom: 3px; margin-bottom: 4px; }
.pd-dn { font-weight: 800; color: #2563eb; }
.pd-dd { color: #444; font-size: 11px; }
.pd-dt { font-weight: 700; margin-left: auto; color: #0f172a; }
.pd-sum { color: #555; font-size: 10.5px; margin: 0 0 5px; }
.pd-tab { width: 100%; border-collapse: collapse; }
.pd-tab td { padding: 3px 6px; vertical-align: top; border-bottom: 1px solid #eee; }
.pd-t { white-space: nowrap; font-weight: 700; color: #2563eb; width: 42px; }
.pd-ty { white-space: nowrap; color: #777; width: 40px; font-size: 10px; }
.pd-c { white-space: nowrap; text-align: right; color: #333; width: 70px; }
.pd-d { color: #666; font-size: 10px; margin-top: 1px; }
.pd-ul { margin: 4px 0; padding-left: 18px; }
.pd-ul li { margin: 2.5px 0; }
.pd-cols { columns: 2; column-gap: 24px; margin: 4px 0; padding-left: 18px; list-style: none; }
.pd-cols li { margin: 2.5px 0; break-inside: avoid; }
.pd-card { border: 1px solid #d4d4d8; border-radius: 8px; padding: 8px 10px; break-inside: avoid; }
.pd-budget td { border-bottom: 1px solid #eee; }
.pd-tot td { border-top: 2px solid #2563eb; border-bottom: none; padding-top: 5px; }
.pd-muted { color: #888; }
.pd-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid #d4d4d8; color: #888; font-size: 10px; text-align: center; }

/* ---- AI generation progress overlay ---- */
.gen-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--bg) 68%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.gen-overlay.is-on { display: flex; animation: genFade .25s var(--ease); }
@keyframes genFade { from { opacity: 0; } to { opacity: 1; } }
.gen-card { width: 100%; max-width: 380px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow-2); text-align: center; }
.gen-spark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--grad-brand); display: grid; place-items: center; box-shadow: var(--shadow-1); animation: genPulse 1.6s var(--ease) infinite; }
.gen-spark svg { width: 28px; height: 28px; color: #fff; }
@keyframes genPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.gen-title { font-size: 17px; font-weight: 750; }
.gen-steps { margin-top: 16px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.gen-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); transition: color .3s var(--ease); }
.gen-step .gen-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; transition: all .3s var(--ease); position: relative; }
.gen-step.is-now { color: var(--text); font-weight: 650; }
.gen-step.is-now .gen-dot { border-color: var(--brand-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.gen-step.is-done { color: var(--text-2); }
.gen-step.is-done .gen-dot { background: var(--brand-2); border-color: var(--brand-2); }
.gen-step.is-done .gen-dot::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
