:root {
  --paper: #f4efe5;
  --surface: #fffdf8;
  --surface-2: #f9f5ed;
  --ink: #20302b;
  --muted: #64706c;
  --line: #ded5c7;
  --blue: #246c8b;
  --blue-soft: #e1f0f6;
  --green: #34765b;
  --green-soft: #e2f0e8;
  --orange: #cf6336;
  --orange-soft: #fae6db;
  --gold: #9a7124;
  --gold-soft: #fff1cf;
  --shadow: 0 12px 32px rgba(44, 50, 45, .09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}
body, button, select { font: inherit; }
a { color: inherit; }
button, a, select, summary, label { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(36px, 10vw, 62px); line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: 9px; font-size: clamp(25px, 6vw, 34px); line-height: 1.22; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 24px; line-height: 1.3; }
h4 { margin: 8px 0 10px; font-size: 23px; line-height: 1.35; }

.skip-link { position: fixed; left: -9999px; top: 8px; z-index: 100; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: white; }
.skip-link:focus { left: 12px; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(222, 213, 199, .85);
  background: rgba(244, 239, 229, .95);
  backdrop-filter: blur(14px);
}
.app-brand { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.app-brand > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: white; font-weight: 950; }
.app-brand strong { font-size: 17px; }
.app-topbar > small { color: var(--muted); font-weight: 850; }

.app-main { width: min(920px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 calc(96px + env(safe-area-inset-bottom)); }
.app-page { animation: page-in .22s ease both; }
.home-page, .daily-page, .prep-page { max-width: 720px; margin: 0 auto; }
.home-block, .task-stage, .why-detail, .prep-progress {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.home-block { margin-bottom: 14px; padding: 20px; }
.eyebrow, .detail-kicker { color: var(--green); font-size: 13px; font-weight: 950; letter-spacing: .08em; }
.hero-card { min-height: 270px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: linear-gradient(145deg, #fffdf8 0%, #e5f1ea 100%); }
.hero-card h1 { margin-top: 10px; }
.hero-card p { margin-bottom: 0; color: var(--muted); font-size: 19px; font-weight: 800; }
.block-title { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; margin-bottom: 16px; }
.block-title > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 20px; font-weight: 950; }
.block-title small, .block-title h2 { display: block; margin: 0; }
.block-title small { color: var(--muted); font-weight: 850; }
.block-title h2 { font-size: 25px; }
.route-card { background: linear-gradient(145deg, #fffdf8, #f3f8fa); }
.route-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 18px; line-height: 1.7; }
.route-summary span { color: var(--blue); font-weight: 950; }
.route-summary strong { padding: 4px 8px; border-radius: 10px; background: white; }
.sight-line { margin-top: 14px; padding-top: 12px; border-top: 1px solid #d7e5eb; color: var(--blue); font-size: 15px; font-weight: 900; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-grid > div { min-height: 112px; padding: 14px; border-radius: 17px; background: var(--surface-2); }
.status-grid span, .status-grid strong { display: block; }
.status-grid span { color: var(--muted); font-size: 14px; font-weight: 850; }
.status-grid strong { margin-top: 7px; line-height: 1.45; }
.done-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.done-row span { padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: #285d48; font-size: 13px; font-weight: 900; }
.next-action-card { border-color: #bcd9c8; background: var(--green-soft); }
.moment-context { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.moment-context > span { padding: 5px 10px; border-radius: 999px; background: var(--green); color: white; font-size: 13px; font-weight: 950; }
.moment-context > span[data-trip-state="travelling"] { background: var(--blue); }
.moment-context > span[data-trip-state="ended"] { background: var(--muted); }
.moment-context > small { color: #4e665c; font-size: 13px; font-weight: 900; }
.next-action-card small { color: var(--green); font-weight: 950; }
.next-action-card h2 { margin: 5px 0 6px; }
.next-action-card p { color: #4e665c; }
.home-weather { margin-top: 17px; padding-top: 17px; border-top: 1px solid #bad5c5; }
.home-weather-head { display: grid; grid-template-columns: 43px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.home-weather-head > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: white; font-size: 24px; }
.home-weather-head small, .home-weather-head h3 { display: block; margin: 0; }
.home-weather-head h3 { font-size: 21px; }
.home-weather-list { overflow: hidden; border: 1px solid #c7dbcf; border-radius: 17px; background: rgba(255,255,255,.82); }
.home-weather-row { min-height: 82px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 9px; align-items: center; padding: 11px; border-bottom: 1px solid #d9e8df; text-decoration: none; }
.home-weather-row:last-child { border-bottom: 0; }
.home-weather-icon { font-size: 25px; text-align: center; }
.home-weather-main { min-width: 0; }
.home-weather-main small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.home-weather-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.home-weather-title strong { font-size: 17px; }
.home-weather-title span { flex: 0 0 auto; color: var(--blue); font-weight: 950; }
.home-weather-main p { overflow: hidden; margin: 1px 0 0; color: #435f52; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.home-weather-arrow { color: var(--green); font-size: 27px; }
.weather-source { min-height: 22px; margin-top: 7px; color: #557065; font-size: 13px; text-align: right; }
.weather-source a { min-height: 34px; display: inline-flex; align-items: center; }
.weather-loading { min-height: 95px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; padding: 16px; color: var(--muted); }
.weather-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: weather-pulse 1s ease-in-out infinite alternate; }
.weather-loading span:nth-child(2) { animation-delay: .2s; }
.weather-loading span:nth-child(3) { animation-delay: .4s; }
.weather-loading em { width: 100%; font-style: normal; font-weight: 850; text-align: center; }
.weather-empty { margin: 0; padding: 16px; color: var(--muted); text-align: center; }
.weather-empty strong, .weather-empty p { display: block; margin: 0; }
.weather-retry { min-height: 48px; margin-top: 10px; padding: 8px 15px; border: 1px solid var(--green); border-radius: 14px; background: white; color: var(--green); font-weight: 950; cursor: pointer; }
.quick-card h2 { font-size: 23px; }
.quick-actions { display: grid; gap: 10px; }

.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--blue);
  border-radius: 16px;
  background: white;
  color: var(--blue);
  font-weight: 950;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--blue); color: white; }
.button-quiet { border-color: var(--line); background: white; color: var(--ink); }
.button-full { width: 100%; }
.button:focus-visible, .task-tab:focus-visible, .bottom-nav a:focus-visible, summary:focus-visible, select:focus-visible, .prep-item input:focus-visible ~ .prep-copy { outline: 3px solid #075b85; outline-offset: 3px; }

.page-heading { padding: 14px 6px 8px; }
.page-heading h1 { margin: 7px 0 8px; }
.page-heading p { margin-bottom: 8px; color: var(--muted); font-size: 18px; }
.day-switcher {
  position: sticky;
  top: 66px;
  z-index: 20;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  gap: 7px;
  margin: 8px 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 7px 20px rgba(44, 50, 45, .08);
  backdrop-filter: blur(12px);
}
.day-switcher label { min-width: 0; }
.day-switcher label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.day-switcher select, .switch-button { width: 100%; min-height: 52px; border: 0; border-radius: 13px; background: var(--surface-2); color: var(--ink); font-weight: 900; }
.day-switcher select { padding: 8px 30px 8px 10px; }
.switch-button { padding: 7px; font-size: 14px; cursor: pointer; }
.switch-button:disabled { opacity: .4; cursor: default; }
.viewing-time-context { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; margin: 0 0 10px; padding: 11px 13px; border: 1px solid #cbded5; border-radius: 16px; background: #eef6f1; }
.viewing-time-context > span { grid-row: 1 / 3; padding: 6px 9px; border-radius: 10px; background: var(--green); color: white; font-size: 13px; font-weight: 950; }
.viewing-time-context > strong { font-size: 15px; line-height: 1.35; }
.viewing-time-context > small { color: var(--muted); font-size: 12px; font-weight: 850; }
.day-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px; border-radius: 22px 22px 0 0; background: var(--blue); color: white; }
.day-hero.transfer { background: var(--orange); }
.day-hero.dali { background: var(--green); }
.day-hero span { font-size: 14px; font-weight: 900; opacity: .9; }
.day-hero h2 { margin: 4px 0 0; font-size: 29px; }
.day-hero > strong { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 13px; }
.task-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.task-tab { min-width: 0; min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; }
.task-tab span { font-size: 21px; line-height: 1; }
.task-tab small { font-size: 12px; font-weight: 900; }
.task-tab.active { border-bottom-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.task-stage { min-height: 420px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
.task-panel { min-height: 420px; padding: 20px; animation: task-in .2s ease both; }
.task-heading { display: grid; grid-template-columns: 48px 1fr; gap: 11px; align-items: center; margin-bottom: 18px; }
.task-heading > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--blue-soft); font-size: 25px; }
.task-heading small, .task-heading h3 { display: block; margin: 0; }
.task-heading small { color: var(--muted); font-weight: 850; }
.route-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 16px; border-radius: 18px; background: var(--surface-2); font-size: 19px; }
.route-line span { color: var(--blue); font-weight: 950; }
.metric-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.metric-row span { padding: 7px 10px; border-radius: 10px; background: var(--blue-soft); color: #20566e; font-size: 14px; font-weight: 900; }
.task-summary { color: var(--muted); font-size: 18px; }
.day-weather-card { margin: 16px 0; padding: 15px; border: 1px solid #bdd7e2; border-radius: 19px; background: linear-gradient(145deg, #f1f9fc, #f8fcfa); }
.day-weather-card.is-loading { min-height: 116px; }
.day-weather-card.is-error { border-color: var(--line); background: var(--surface-2); }
.weather-card-head { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 11px; align-items: center; }
.weather-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: white; font-size: 27px; box-shadow: 0 5px 16px rgba(36,108,139,.1); }
.weather-card-head small, .weather-card-head strong, .weather-card-head em { display: block; }
.weather-card-head small { color: var(--blue); font-size: 13px; font-weight: 950; }
.weather-card-head strong { margin-top: 1px; font-size: 18px; line-height: 1.35; }
.weather-card-head em { color: var(--muted); font-size: 13px; font-style: normal; font-weight: 800; }
.day-weather-card > p { margin: 10px 0 0; color: var(--muted); }
.weather-advice-list { display: grid; gap: 8px; margin-top: 13px; }
.weather-advice-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: start; }
.weather-advice-row span { padding: 3px 6px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 950; text-align: center; }
.weather-advice-row strong { line-height: 1.45; }
.weather-parent-tip { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #cfdee4; }
.weather-parent-tip span { color: var(--green); font-size: 13px; font-weight: 950; }
.weather-parent-tip strong { color: #3e5b50; line-height: 1.45; }
.weather-unavailable { padding: 11px; border-radius: 12px; background: white; font-size: 14px; font-weight: 800; }
.stop-list { display: grid; gap: 12px; }
.stop-card { display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: start; padding: 14px; border: 1px solid #c8dee7; border-radius: 17px; background: #f4fafc; }
.stop-order { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--blue); color: white; font-weight: 950; }
.stop-card strong { display: block; margin: 5px 0 9px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.action-row .button { min-height: 50px; padding: 9px 11px; font-size: 15px; }
.helper-text { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.status-pill { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: var(--gold-soft); color: #6c4e11; font-size: 14px; font-weight: 950; }
.task-ticket h4, .task-food h4 { font-size: 25px; }
.no-action { margin-top: 14px; padding: 14px; border-radius: 15px; background: var(--green-soft); color: #285d48; font-weight: 950; text-align: center; }
.tonight-note { margin-top: 15px; padding: 15px; border-radius: 16px; background: var(--ink); color: white; }
.tonight-note strong, .tonight-note span { display: block; }
.tonight-note span { margin: 3px 0 6px; color: #d9e3df; }
.tonight-note a { min-height: 44px; display: inline-flex; align-items: center; color: #aadaef; font-weight: 950; }
.reason-line { padding: 13px; border-radius: 15px; background: var(--green-soft); color: #285d48; }
.backup-box { margin-top: 16px; padding: 15px; border-radius: 16px; background: var(--surface-2); }
.backup-box small, .backup-box strong { display: block; }
.backup-box small { color: var(--muted); font-weight: 850; }
.backup-box strong { margin-top: 4px; }
.tip-list { margin: 0; padding: 0; list-style: none; }
.tip-list li { position: relative; margin-bottom: 11px; padding: 14px 14px 14px 42px; border-radius: 16px; background: var(--orange-soft); font-weight: 850; }
.tip-list li::before { content: "!"; position: absolute; left: 13px; top: 13px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: white; font-size: 13px; }
.soft-disclosure { margin-top: 15px; border-top: 1px solid var(--line); }
.soft-disclosure summary { min-height: 50px; display: flex; align-items: center; color: var(--muted); font-weight: 900; cursor: pointer; }
.soft-disclosure p { margin-bottom: 0; color: var(--muted); }

.prep-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; padding: 16px; background: var(--green-soft); }
.prep-progress strong, .prep-progress span { display: block; }
.prep-progress strong { color: #285d48; font-size: 19px; }
.prep-progress span { color: #4f6a5e; font-size: 13px; }
.prep-list { display: grid; gap: 12px; margin-bottom: 14px; }
.prep-item { position: relative; min-height: 92px; display: grid; grid-template-columns: 46px 1fr 30px; gap: 11px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.prep-item input { position: absolute; opacity: 0; }
.prep-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--surface-2); font-size: 24px; }
.prep-copy small, .prep-copy strong, .prep-copy em { display: block; }
.prep-copy small { color: var(--green); font-size: 13px; font-weight: 950; }
.prep-copy strong { margin: 2px 0; line-height: 1.4; }
.prep-copy em { color: var(--muted); font-size: 14px; font-style: normal; }
.check-mark { width: 28px; height: 28px; border: 2px solid #9d978c; border-radius: 9px; background: white; }
.prep-item:has(input:checked) { border-color: #a9cfb8; background: var(--green-soft); }
.prep-item input:checked ~ .check-mark { display: grid; place-items: center; border-color: var(--green); background: var(--green); color: white; }
.prep-item input:checked ~ .check-mark::after { content: "✓"; font-weight: 950; }

.why-page { max-width: 900px; }
.why-detail { margin-bottom: 13px; overflow: clip; }
.why-detail > summary { min-height: 84px; display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 16px; cursor: pointer; list-style: none; }
.why-detail > summary::-webkit-details-marker { display: none; }
.why-detail > summary > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--surface-2); font-size: 25px; }
.why-detail > summary strong, .why-detail > summary small { display: block; }
.why-detail > summary strong { font-size: 19px; }
.why-detail > summary small { margin-top: 2px; color: var(--muted); }
.why-detail > summary::after { content: "+"; grid-column: 3; font-size: 28px; font-weight: 700; }
.why-detail[open] > summary::after { content: "−"; }
.why-body { padding: 4px 16px 18px; border-top: 1px solid var(--line); }
.why-body hr { height: 1px; margin: 24px 0; border: 0; background: var(--line); }
.strategy-grid { display: grid; gap: 12px; margin-top: 16px; }
.strategy-card { padding: 17px; border-radius: 18px; background: var(--surface-2); }
.strategy-card.kunming { border-top: 6px solid var(--blue); }
.strategy-card.dali { border-top: 6px solid var(--gold); }
.strategy-card small, .strategy-card strong { display: block; }
.strategy-card small { color: var(--muted); font-weight: 850; }
.strategy-card h3 { margin: 4px 0; font-size: 21px; }
.strategy-card > strong { color: var(--green); }
.strategy-card > p { color: var(--muted); }
.selection-flow { display: grid; gap: 10px; margin: 16px 0; }
.selection-step { display: grid; grid-template-columns: 44px 1fr; gap: 11px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); opacity: .32; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease, border-color .35s ease; }
.selection-step.revealed { opacity: 1; transform: none; border-color: #acd0ba; }
.selection-step > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-weight: 950; }
.selection-step h4 { margin: 0 0 2px; font-size: 18px; }
.selection-step p { margin: 0; color: var(--muted); font-size: 14px; }
.tradeoff-layout { display: grid; gap: 18px; }
.tradeoff-layout h3 { margin: 5px 0 8px; }
.tradeoff-layout p { color: var(--muted); }
.takeaway { padding: 14px; border-radius: 15px; background: var(--green-soft); color: #285d48; font-weight: 950; }
.trade-chart { position: relative; height: 270px; margin: 12px 8px 40px 48px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); background-image: linear-gradient(to right, rgba(222,213,199,.65) 1px, transparent 1px), linear-gradient(to top, rgba(222,213,199,.65) 1px, transparent 1px); background-size: 25% 100%, 100% 25%; }
.trade-point { position: absolute; left: var(--x); bottom: var(--y); width: 13px; height: 13px; transform: translate(-50%, 50%); border-radius: 50%; background: #9da7a2; box-shadow: 0 0 0 3px rgba(255,253,248,.9); }
.trade-point.balanced { width: 21px; height: 21px; background: var(--green); box-shadow: 0 0 0 5px rgba(52,118,91,.2); }
.balanced-label { position: absolute; left: 54%; bottom: 55%; padding: 5px 8px; border-radius: 9px; background: var(--green-soft); color: #285d48; font-size: 12px; font-weight: 950; }
.trade-axis { position: absolute; color: var(--muted); font-size: 12px; font-weight: 850; }
.trade-axis-x { left: 50%; bottom: -34px; transform: translateX(-50%); }
.trade-axis-y { left: -42px; top: 50%; transform: rotate(-90deg) translateX(-50%); transform-origin: left top; }
.route-explorer { margin-top: 16px; }
.route-explorer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.route-explorer-head h3 { margin: 4px 0 12px; }
.view-toggle { display: flex; flex: 0 0 auto; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.view-toggle button, .route-controls button { min-height: 48px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 900; cursor: pointer; }
.view-toggle button.active { background: white; color: var(--blue); box-shadow: 0 2px 8px rgba(44,50,45,.08); }
.route-visual-grid { display: grid; gap: 12px; }
.route-canvas-wrap { position: relative; overflow: hidden; border: 1px solid #cfddd6; border-radius: 18px; background: linear-gradient(145deg, #fffdf8, #edf4ee); }
#routeCanvas { display: block; width: 100%; height: 350px; }
.map-base-note { position: absolute; left: 10px; right: 10px; bottom: 9px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.map-base-note span { padding: 5px 8px; border: 1px solid #c4daca; border-radius: 999px; background: rgba(255,253,248,.92); color: var(--green); font-size: 11px; font-weight: 900; }
.route-scene { padding: 16px; border-radius: 18px; background: var(--surface-2); }
.route-scene-day { color: var(--blue); font-size: 14px; font-weight: 950; }
.route-scene h4 { margin: 4px 0 5px; }
.route-scene > p { color: var(--muted); }
.route-scene-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0; }
.route-scene-stats div { padding: 9px; border-radius: 12px; background: white; }
.route-scene-stats span, .route-scene-stats strong { display: block; }
.route-scene-stats span { color: var(--muted); font-size: 12px; }
.route-scene-stats strong { font-size: 14px; }
.route-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.route-controls button { border: 1px solid var(--line); background: white; }
.route-controls button.primary { border-color: var(--ink); background: var(--ink); color: white; }
.research-detail { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.research-detail > summary { min-height: 56px; display: flex; align-items: center; padding: 10px 14px; font-weight: 950; cursor: pointer; }
.research-detail > div { padding: 0 12px 12px; }
.research-row { display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 11px 4px; border-top: 1px solid var(--line); }
.research-row > span { color: var(--blue); font-weight: 950; }
.research-row strong, .research-row em { display: block; grid-column: 2; }
.research-row em { color: var(--muted); font-size: 13px; font-style: normal; }
.app-footer { padding: 28px 8px 8px; color: var(--muted); font-size: 14px; text-align: center; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(470px, calc(100% - 20px));
  min-height: 68px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  border: 1px solid rgba(222, 213, 199, .9);
  border-radius: 22px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 15px 35px rgba(31, 45, 40, .18);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}
.bottom-nav a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 16px; color: var(--muted); text-decoration: none; }
.bottom-nav a > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; font-weight: 950; }
.bottom-nav a small { font-size: 12px; font-weight: 900; }
.bottom-nav a.active { background: var(--green-soft); color: var(--green); }
.copy-toast { position: fixed; left: 50%; bottom: 92px; z-index: 80; max-width: calc(100% - 28px); padding: 12px 17px; border-radius: 14px; background: var(--ink); color: white; box-shadow: var(--shadow); font-weight: 900; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .2s ease; }
.copy-toast.visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes task-in { from { opacity: 0; transform: translateX(5px); } to { opacity: 1; transform: none; } }
@keyframes weather-pulse { from { opacity: .3; transform: translateY(2px); } to { opacity: 1; transform: translateY(-2px); } }

@media (min-width: 720px) {
  .app-main { padding-top: 28px; }
  .hero-card { min-height: 330px; padding: 30px; }
  .home-block { padding: 24px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .strategy-grid { grid-template-columns: 1fr 1fr; }
  .selection-flow { grid-template-columns: repeat(4, 1fr); }
  .selection-step { grid-template-columns: 1fr; align-content: start; }
  .tradeoff-layout { grid-template-columns: 1fr 1fr; align-items: center; }
  .route-visual-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .75fr); align-items: stretch; }
  #routeCanvas { height: 420px; }
  .route-scene { display: flex; flex-direction: column; justify-content: center; }
  .prep-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .app-main { width: min(100% - 18px, 720px); padding-top: 12px; }
  .home-block { padding: 17px; border-radius: 21px; }
  .hero-card { min-height: 245px; }
  .status-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .status-grid > div { padding: 11px; }
  .day-switcher { grid-template-columns: 74px minmax(0, 1fr) 74px; gap: 5px; padding: 6px; }
  .switch-button { font-size: 12px; }
  .day-switcher select { font-size: 14px; }
  .day-hero { padding: 17px; }
  .day-hero h2 { font-size: 25px; }
  .task-tab { min-height: 62px; }
  .task-tab span { font-size: 19px; }
  .task-tab small { font-size: 11px; }
  .task-panel { min-height: 400px; padding: 17px; }
  .home-weather-row { min-height: 78px; padding: 10px 9px; }
  .home-weather-main p { font-size: 12px; }
  .day-weather-card { padding: 13px; }
  .action-row { grid-template-columns: 1fr; }
  .prep-progress { display: block; }
  .prep-progress span { margin-top: 2px; }
  .why-body { padding-right: 12px; padding-left: 12px; }
  .route-explorer-head { display: block; }
  .view-toggle { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
  .route-scene-stats { grid-template-columns: 1fr; }
  .route-controls { grid-template-columns: 1fr; }
  .trade-chart { height: 240px; margin-left: 42px; }
}

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

@media print {
  .app-topbar, .bottom-nav, .day-switcher { display: none; }
  .app-main { width: 100%; padding: 0; }
  .app-page, .day-page, .task-panel { display: block !important; }
  .home-block, .task-stage, .why-detail { box-shadow: none; break-inside: avoid; }
}
