:root {
  --page: #f5f2eb;
  --paper: #ffffff;
  --paper-warm: #fffaf5;
  --ink: #2c221e;
  --muted: #8c7a6b;
  --muted-dark: #6e5c50;
  --line: #eadfd4;
  --line-strong: #dccabb;
  --rust: #8b3a22;
  --rust-bright: #e34822;
  --rust-soft: #f7e6dc;
  --pine: #526844;
  --gold: #d4932f;
  --amber: #fde68a;
  --amber-ink: #92400e;
  --shadow: 0 10px 25px -5px rgba(80, 50, 20, 0.08);
  --shadow-deep: 0 18px 48px rgba(80, 50, 20, 0.12);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--page); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(222, 142, 66, 0.12), transparent 26rem),
    radial-gradient(circle at 96% 40%, rgba(81, 107, 61, 0.08), transparent 24rem),
    var(--page);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell {
  width: min(1660px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.hero-banner {
  position: relative;
  min-height: 204px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  border-radius: 26px;
  color: #fffdf8;
  background-image:
    linear-gradient(90deg, rgba(44, 22, 16, 0.78) 0%, rgba(44, 22, 16, 0.42) 43%, rgba(0, 0, 0, 0.12) 70%, transparent 100%),
    url("./%E5%BD%A9%E6%9E%97.jpg");
  background-size: cover;
  background-position: center 54%;
  box-shadow: var(--shadow-deep);
}

.hero-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(135deg, rgba(31, 17, 11, 0.16), transparent 45%, rgba(35, 18, 13, 0.2));
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 2; padding: 28px 36px 30px; }
.hero-kicker { margin: 0 0 8px; color: rgba(255, 247, 230, 0.78); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }
.hero-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(35px, 5vw, 66px); font-weight: 800; line-height: 0.98; letter-spacing: 0.04em; text-shadow: 0 3px 18px rgba(28, 15, 10, 0.3); }
.hero-copy h1 span { margin: 0 0.12em; color: #f6c879; font-family: var(--sans); font-weight: 400; }
.hero-date { position: relative; z-index: 2; align-self: flex-end; margin: 0 28px 25px 0; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; background: rgba(64, 31, 18, 0.28); backdrop-filter: blur(8px); color: #fffdf8; font-size: 12px; letter-spacing: 0.05em; }
.hero-contour { position: absolute; z-index: 1; right: -5%; bottom: -18%; width: 43%; height: 120%; opacity: 0.42; background: repeating-radial-gradient(ellipse at 64% 66%, transparent 0 16px, rgba(255, 241, 218, 0.4) 17px 19px, transparent 20px 38px); transform: rotate(-13deg); mask-image: linear-gradient(90deg, transparent, #000 24%, #000 100%); pointer-events: none; }

.view-tabs { display: flex; gap: 10px; padding: 16px 0 18px; }
.tab-button { border: 0; border-radius: 999px; padding: 11px 24px; background: #efeae1; color: var(--muted); font-weight: 800; transition: background 160ms ease, color 160ms ease, transform 160ms ease; }
.tab-button:hover { transform: translateY(-1px); background: #f4e2d7; color: var(--rust); }
.tab-button.is-active { background: var(--rust); color: #fff; box-shadow: 0 7px 18px rgba(139, 58, 34, 0.2); }
.tab-button.is-active:hover { background: var(--rust); color: #fff; }
.view-panel { display: none; }
.view-panel.is-active { display: block; }

.workspace { display: grid; grid-template-columns: 176px minmax(400px, 0.72fr) minmax(620px, 1.68fr); align-items: stretch; gap: 20px; }
.day-rail, .day-panel, .map-card, .budget-content { border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.day-rail { align-self: start; position: sticky; top: 16px; padding: 26px 12px 16px; }
.rail-heading { padding: 0 14px 20px; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: 0.14em; line-height: 1.55; }
.day-list { display: grid; gap: 4px; }
.day-button { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 4px; padding: 11px 10px; border: 0; border-radius: 20px; background: transparent; color: var(--muted-dark); text-align: left; transition: background 140ms ease, color 140ms ease, transform 140ms ease; }
.day-button:hover { background: #f7eee8; color: var(--ink); }
.day-button.is-active, .day-button.is-active:hover { background: var(--rust); color: #fff; box-shadow: 0 8px 18px rgba(139, 58, 34, 0.2); }
.day-number { font-size: 14px; font-variant-numeric: tabular-nums; }
.day-title { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 800; line-height: 1.32; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.day-panel { min-width: 0; min-height: 760px; overflow: hidden; }
.day-content { padding: 30px 30px 26px; }
.day-header { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.day-date { margin: 0 0 8px; color: var(--rust-bright); font-size: 16px; font-weight: 900; letter-spacing: 0.08em; }
.day-title-main { margin: 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 48px); line-height: 1.06; letter-spacing: 0.02em; }
.day-theme { margin: 11px 0 0; color: var(--muted); font-size: 16px; }
.status-pill { display: inline-flex; align-items: center; margin-left: 8px; padding: 7px 13px; border-radius: 999px; background: var(--rust-soft); color: var(--rust); font-size: 13px; font-weight: 900; vertical-align: 4px; }
.alert-box { margin: 20px 0 24px; padding: 15px 17px; border-left: 4px solid var(--amber-ink); border-radius: 0 17px 17px 0; background: var(--amber); color: var(--amber-ink); font-size: 16px; }
.subsection { margin-top: 23px; }
.subsection-heading { margin: 0 0 11px; color: var(--muted); font-size: 16px; font-weight: 900; letter-spacing: 0.04em; }
.timeline { display: grid; gap: 8px; margin-bottom: 24px; }
.timeline-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eee1d5; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-time { color: var(--rust); font-variant-numeric: tabular-nums; font-weight: 900; }
.timeline-title { font-weight: 800; }
.timeline-detail { margin-top: 2px; color: var(--muted); font-size: 14px; }

.route-list, .poi-list, .rail-option-list { display: grid; gap: 11px; }
.route-card, .poi-card, .rail-card, .flight-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.route-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px 16px; text-align: left; cursor: pointer; }
.route-card:hover, .rail-card:hover, .flight-card:hover { border-color: #ce9d87; box-shadow: 0 9px 22px rgba(112, 63, 39, 0.1); transform: translateY(-1px); }
.route-card.is-selected, .rail-card.is-selected { border-color: var(--rust-bright); background: #fff0e8; box-shadow: 0 0 0 2px rgba(227, 72, 34, 0.12), 0 14px 28px rgba(173, 62, 27, 0.14); }
.route-index { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #f7e8de; color: var(--rust); font-weight: 900; }
.is-selected .route-index { background: var(--rust-bright); color: #fff; }
.route-main { min-width: 0; }
.route-title { overflow-wrap: anywhere; font-size: 16px; font-weight: 900; }
.route-note { margin-top: 5px; color: var(--muted); font-size: 14px; }
.route-metric { min-width: 90px; color: var(--rust); font-size: 16px; font-weight: 900; line-height: 1.55; text-align: right; white-space: nowrap; }
.route-metric small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.poi-card { padding: 16px; cursor: pointer; }
.poi-card:hover { border-color: #ce9d87; box-shadow: 0 9px 22px rgba(112, 63, 39, 0.1); }
.poi-status { color: var(--rust); font-size: 12px; font-weight: 900; }
.poi-title { margin: 6px 0 0; font-family: var(--serif); font-size: 20px; font-weight: 900; }
.poi-meta { margin-top: 5px; color: var(--muted); font-size: 14px; }
.poi-action { float: right; color: var(--rust); font-size: 12px; font-weight: 800; }
.route-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 7px 14px; margin: 20px 0; padding: 13px 16px; border-left: 4px solid var(--rust); border-radius: 0 16px 16px 0; background: #fff0e8; color: var(--ink); }
.route-summary strong { color: var(--rust); font-size: 15px; }
.route-summary-metrics { display: flex; flex-wrap: wrap; gap: 8px; color: var(--rust); font-weight: 900; }
.route-summary-metrics span + span::before { content: '·'; margin-right: 8px; color: var(--muted); }

.rail-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.rail-filter { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 11px; background: #fffaf5; color: var(--muted); font-size: 13px; font-weight: 800; }
.rail-filter:hover { color: var(--rust); border-color: #c98d76; }
.rail-filter.is-active { border-color: var(--rust); background: var(--rust); color: #fff; }
.rail-summary { margin: 0 0 11px; color: var(--muted); font-size: 13px; }
.rail-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px; cursor: pointer; }
.rail-label { color: var(--rust); font-size: 12px; font-weight: 900; letter-spacing: 0.06em; }
.rail-train { margin-top: 5px; font-size: 18px; font-weight: 900; overflow-wrap: anywhere; }
.rail-time { color: var(--ink); font-size: 20px; white-space: nowrap; }
.rail-detail { margin-top: 5px; color: var(--muted); font-size: 14px; }
.rail-price { margin-top: 8px; color: var(--rust); font-size: 14px; font-weight: 900; }
.rail-option-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.rail-tag { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: var(--rust-soft); color: var(--rust); font-weight: 800; }
.full-options { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.full-options summary { cursor: pointer; color: var(--rust); font-size: 14px; font-weight: 900; }
.full-options .rail-option-list { margin-top: 12px; }
.rail-card.compact { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
.rail-card.compact .rail-train { font-size: 15px; }
.rail-card.compact .rail-time { font-size: 16px; }

.flight-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px; padding: 16px; }
.flight-mode { color: var(--rust); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; }
.flight-title { margin-top: 5px; font-size: 17px; font-weight: 900; }
.flight-time { font-size: 20px; white-space: nowrap; }
.flight-note { margin-top: 5px; color: var(--muted); font-size: 14px; }
.guide-note { margin-top: 20px; padding: 14px 16px; border-left: 4px solid var(--rust); border-radius: 0 16px 16px 0; background: #fff0db; color: #87501d; }
.empty-state { padding: 18px; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); }
.loading-block { display: grid; place-items: center; min-height: 300px; color: var(--muted); }
.error-block { padding: 18px; border: 1px solid #e6ae98; border-radius: 16px; background: #fff0e9; color: #9b3f20; }

.map-card { display: grid; grid-template-rows: auto minmax(660px, 1fr) auto; min-width: 0; min-height: 760px; overflow: hidden; }
.map-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 14px; }
.map-heading-tools { display: flex; align-items: center; gap: 12px; }
.section-kicker { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.16em; }
.map-heading h2 { margin: 0; font-family: var(--serif); font-size: 26px; }
.map-mode-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }
.map-style-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #f6f0e9; }
.map-style-toggle button { border: 0; border-radius: 999px; padding: 5px 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.04em; }
.map-style-toggle button:hover { color: var(--rust); }
.map-style-toggle button.is-active { background: var(--rust); color: #fff; box-shadow: 0 3px 8px rgba(139, 58, 34, 0.18); }
.map-frame { position: relative; min-height: 660px; margin: 0 14px; overflow: hidden; border-radius: 17px; background: #eef0ed; }
.map-message { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 16px; border: 1px solid rgba(173, 118, 83, 0.25); border-radius: 13px; background: rgba(255, 250, 245, 0.92); color: var(--muted-dark); box-shadow: var(--shadow); font-size: 14px; }
.map-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 13px 24px 18px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 9px 17px; color: var(--muted); font-size: 12px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { display: inline-block; width: 24px; height: 4px; border-radius: 5px; }
.legend-swatch.driving { background: var(--rust); }
.legend-swatch.railway { height: 5px; background: repeating-linear-gradient(90deg, #24201d 0 7px, #fff 7px 13px); border: 1px solid #27221f; }
.legend-swatch.flight { height: 0; border-top: 3px dashed var(--rust-bright); }
.legend-swatch.point { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.map-hint { color: var(--muted); font-size: 12px; }

.map-marker { position: relative; display: flex; align-items: center; gap: 7px; transform: translate(-7px, -7px); white-space: nowrap; pointer-events: auto; }
.map-marker.is-label-left { flex-direction: row-reverse; transform: translate(7px, -7px); }
.map-marker.is-label-down { transform: translate(-7px, 7px); }
.map-marker.is-label-left.is-label-down { transform: translate(7px, 7px); }
.map-marker.is-label-up { transform: translate(-7px, -21px); }
.map-marker.is-label-left.is-label-up { transform: translate(7px, -21px); }
.map-marker .marker-dot { width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: var(--rust); box-shadow: 0 2px 8px rgba(71, 36, 25, 0.35); }
.map-marker.is-station .marker-dot { background: #25211e; }
.map-marker.is-airport .marker-dot { background: var(--gold); }
.map-marker .marker-label { max-width: 190px; overflow: hidden; padding: 4px 9px; border: 1px solid rgba(190, 125, 95, 0.34); border-radius: 999px; background: rgba(255, 251, 247, 0.94); color: var(--ink); box-shadow: 0 6px 16px rgba(80, 50, 20, 0.14); font-size: 12px; font-weight: 800; text-overflow: ellipsis; }
.map-marker.is-quiet .marker-label { display: none; }
.map-marker:hover .marker-label { display: inline-block; }

.map-popup { width: min(360px, calc(100vw - 64px)); overflow: hidden; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow-deep); }
.map-popup-image { display: block; width: 100%; height: 145px; object-fit: cover; background: #f2ece4; }
.map-popup-body { padding: 15px 17px 17px; }
.map-popup-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.map-popup-title { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.popup-close { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #f6ebe3; color: var(--rust); font-size: 21px; line-height: 1; }
.popup-close:hover { background: var(--rust); color: #fff; }
.map-popup-kicker { margin: 0 0 6px; color: var(--rust); font-size: 12px; font-weight: 900; }
.map-popup-meta { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.map-popup-guide { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); white-space: pre-wrap; }
.popup-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.popup-gallery img { width: 100%; height: 62px; object-fit: cover; border-radius: 8px; }
.popup-edit { margin-top: 14px; }
.popup-edit summary { cursor: pointer; color: var(--rust); font-size: 13px; font-weight: 900; }
.edit-form { display: grid; gap: 9px; margin-top: 10px; }
.edit-form label { color: var(--muted); font-size: 12px; font-weight: 800; }
.edit-form textarea, .edit-form input[type="text"] { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 10px; background: #fffaf5; color: var(--ink); }
.edit-form textarea { min-height: 86px; resize: vertical; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.edit-save { border: 0; border-radius: 999px; padding: 8px 13px; background: var(--rust); color: #fff; font-size: 13px; font-weight: 800; }
.edit-cancel { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; background: #fff; color: var(--muted-dark); font-size: 13px; }
.edit-help { color: var(--muted); font-size: 11px; }

.budget-content { padding: 28px; }
.budget-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.budget-title { margin: 0; font-family: var(--serif); font-size: 37px; }
.budget-subtitle { margin: 7px 0 0; color: var(--muted); }
.budget-total { color: var(--rust); font-size: clamp(27px, 4vw, 44px); font-weight: 900; white-space: nowrap; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 24px; }
.summary-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-warm); }
.summary-label { color: var(--muted); font-size: 13px; font-weight: 800; }
.summary-value { margin-top: 5px; color: var(--rust); font-size: 24px; font-weight: 900; }
.budget-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.budget-group { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fffdfb; }
.budget-group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.budget-group-heading h3 { margin: 0; color: var(--muted-dark); font-size: 16px; }
.budget-group-total { color: var(--rust); font-size: 18px; font-weight: 900; }
.budget-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-top: 1px solid #f0e6dc; }
.budget-row-label { font-weight: 800; overflow-wrap: anywhere; }
.budget-row-source { margin-top: 3px; color: var(--muted); font-size: 12px; }
.budget-row-amount { color: var(--rust); font-size: 16px; font-weight: 900; white-space: nowrap; }
.budget-status { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--rust-soft); color: var(--rust); font-size: 11px; font-weight: 800; vertical-align: 2px; }
.budget-status.estimate { background: #f3eee7; color: var(--muted); }
.budget-assumptions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--pine); border-radius: 0 15px 15px 0; background: #edf1e8; color: #53624c; font-size: 13px; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(360px, calc(100vw - 48px)); padding: 11px 15px; border-radius: 12px; background: #2c221e; color: #fff; box-shadow: var(--shadow-deep); opacity: 0; pointer-events: none; transform: translateY(9px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1320px) {
  .workspace { grid-template-columns: 160px minmax(380px, 0.76fr) minmax(540px, 1.5fr); gap: 14px; }
  .day-content { padding: 25px 22px 22px; }
  .map-heading { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 154px minmax(0, 1fr); }
  .map-card { grid-column: 1 / -1; min-height: 660px; }
  .map-frame { min-height: 560px; }
  .map-card { grid-template-rows: auto minmax(560px, 1fr) auto; }
}

@media (max-width: 720px) {
  .page-shell { width: min(100% - 18px, 620px); padding-top: 9px; }
  .hero-banner { min-height: 190px; border-radius: 19px; }
  .hero-copy { padding: 24px 21px; }
  .hero-copy h1 { font-size: 39px; }
  .hero-date { margin: 0 15px 18px 0; padding: 6px 9px; font-size: 10px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; }
  .day-rail { position: static; padding: 16px 12px 12px; overflow-x: auto; }
  .rail-heading { padding: 0 10px 10px; }
  .day-list { grid-template-columns: repeat(10, minmax(86px, 1fr)); gap: 5px; min-width: 900px; }
  .day-button { grid-template-columns: 1fr; gap: 1px; padding: 8px 9px; border-radius: 14px; }
  .day-title { -webkit-line-clamp: 1; font-size: 13px; }
  .day-panel { min-height: auto; }
  .day-content { padding: 22px 17px; }
  .day-title-main { font-size: 34px; }
  .route-card { grid-template-columns: 34px minmax(0, 1fr); }
  .route-metric { grid-column: 2; text-align: left; }
  .timeline-row { grid-template-columns: 94px minmax(0, 1fr); gap: 8px; }
  .map-card { min-height: 500px; grid-template-rows: auto minmax(450px, 1fr) auto; }
  .map-frame { min-height: 450px; margin: 0 9px; }
  .map-heading { padding: 18px 16px 11px; }
  .map-heading h2 { font-size: 22px; }
  .map-heading-tools { gap: 7px; }
  .map-mode-label { display: none; }
  .map-footer { padding: 11px 15px 15px; }
  .map-hint { width: 100%; }
  .budget-content { padding: 21px 17px; }
  .budget-header { display: block; }
  .budget-total { margin-top: 10px; }
  .budget-summary, .budget-groups { grid-template-columns: 1fr; }
}

/* Full-height desktop workspace */
@media (min-width: 1081px) {
  html, body { height: 100%; }
  body { overflow: hidden; }
  .page-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 14px 0 16px;
  }
  .hero-banner {
    flex: 0 0 204px;
    transition: flex-basis 240ms ease, min-height 240ms ease, opacity 180ms ease, box-shadow 240ms ease;
  }
  .page-shell.is-banner-collapsed .hero-banner {
    flex-basis: 0;
    min-height: 0;
    opacity: 0;
    box-shadow: none;
    pointer-events: none;
  }
  .view-tabs { flex: 0 0 auto; padding: 13px 0 14px; }
  .view-panel.is-active { min-height: 0; }
  #itinerary-view { flex: 1 1 auto; }
  .workspace {
    height: 100%;
    min-height: 0;
    grid-template-columns: 190px minmax(390px, .78fr) minmax(0, 1.72fr);
    gap: 16px;
  }
  .day-rail, .day-panel, .map-card { height: 100%; min-height: 0; }
  .day-rail {
    position: relative;
    top: auto;
    align-self: stretch;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .day-panel { overflow: hidden; }
  .day-content { height: 100%; overflow-y: auto; scrollbar-width: thin; }
  .map-card { grid-template-rows: auto minmax(0, 1fr) auto; }
  .map-frame { height: 100%; min-height: 0; }
  #budget-view { flex: 1 1 auto; overflow-y: auto; }
}

/* Compact itinerary labels */
.day-rail { padding-left: 10px; padding-right: 10px; }
.rail-heading { padding-left: 12px; padding-right: 12px; }
.day-button { grid-template-columns: 47px minmax(0, 1fr); gap: 4px; padding: 10px 9px; }
.day-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.35;
}
.day-button.is-active:hover { transform: none; }

/* Notebook timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0 0 26px 8px;
  padding-left: 31px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 12px;
  width: 1px;
  background: #e8ddd3;
}
.timeline-row {
  position: relative;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0 16px;
  border-bottom: 1px solid rgba(234, 223, 212, .58);
}
.timeline-row:last-child { border-bottom: 0; }
.timeline-icon {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: -31px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(80, 50, 20, .12);
  font-size: 12px;
  line-height: 1;
}
.timeline-row.kind-drive .timeline-icon { background: #fff0c9; color: #9a5a11; }
.timeline-row.kind-rail .timeline-icon { background: #e7f1fa; color: #376c96; }
.timeline-row.kind-flight .timeline-icon { background: #e8f3f5; color: #2f7780; }
.timeline-row.kind-stay .timeline-icon { background: #f7e5df; color: var(--rust); }
.timeline-row.kind-poi .timeline-icon { background: #eaf1e3; color: var(--pine); }
.timeline-detail { line-height: 1.55; }

/* iOS-style segmented controls */
.plan-switcher,
.map-style-toggle {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eee9e2;
  box-shadow: inset 0 1px 2px rgba(80, 50, 20, .06);
}
.plan-switcher { width: 100%; margin-bottom: 18px; }
.plan-switcher button,
.map-style-toggle button {
  position: relative;
  z-index: 1;
  min-height: 31px;
  border: 0;
  border-radius: 9px;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.plan-switcher button.is-active,
.map-style-toggle button.is-active {
  background: #fff;
  color: var(--rust);
  box-shadow: 0 2px 7px rgba(80, 50, 20, .13);
}

/* Rail cards: one map route, alternatives stay compact and readable */
.rail-card { display: block; padding: 17px 18px; cursor: default; }
.rail-card.primary { cursor: pointer; border-color: #dbb39f; background: #fffaf6; }
.rail-card.primary:hover { border-color: var(--rust); }
.rail-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rail-train { margin: 0; font-size: 17px; }
.rail-route-timeline {
  display: grid;
  grid-template-columns: minmax(68px, auto) minmax(80px, 1fr) minmax(68px, auto);
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}
.rail-endpoint { display: grid; gap: 2px; }
.rail-endpoint:last-child { text-align: right; }
.rail-endpoint strong { color: var(--ink); font-family: var(--serif); font-size: 22px; line-height: 1; }
.rail-endpoint span { color: var(--muted); font-size: 12px; }
.rail-middle { display: grid; justify-items: center; color: var(--muted); font-size: 11px; }
.rail-middle i { position: relative; width: 100%; height: 1px; margin: 5px 0; background: #cfc2b7; }
.rail-middle i::after { content: ""; position: absolute; right: 0; top: -3px; border-width: 3px 0 3px 5px; border-style: solid; border-color: transparent transparent transparent #aa998c; }
.rail-card-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #eee3da; color: var(--rust); font-size: 12px; font-weight: 800; }
.rail-card-foot em { color: var(--muted); font-style: normal; font-weight: 700; }
.rail-alternatives { margin-top: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.rail-alternatives summary { padding: 11px 14px; cursor: pointer; color: var(--ink); font-weight: 800; list-style-position: inside; }
.rail-alternatives summary span { float: right; color: var(--muted); font-size: 12px; font-weight: 700; }
.rail-alternatives .rail-option-list { padding: 0 10px 10px; }
.rail-card.alternative { padding: 12px 13px; background: #fffdfb; }
.rail-card.alternative .rail-route-timeline { margin-top: 10px; }
.rail-card.alternative .rail-endpoint strong { font-size: 18px; }

.route-card.is-selected {
  border-color: #ef4a22;
  background: #fff2eb;
  box-shadow: 0 0 0 1px #ef4a22, 0 10px 22px rgba(177, 55, 25, .15);
}
.marching-ant-layer { pointer-events: none; }

@media (max-width: 1320px) and (min-width: 1081px) {
  .workspace { grid-template-columns: 178px minmax(360px, .8fr) minmax(0, 1.55fr); }
  .day-content { padding: 23px 20px 21px; }
  .timeline-row { grid-template-columns: 92px minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .page-shell { height: auto; }
  .workspace, .day-rail, .day-panel, .map-card { height: auto; }
  .day-content { height: auto; overflow: visible; }
}

@media (max-width: 720px) {
  .day-title { font-size: 13px; }
  .day-rail { width: 100%; min-width: 0; max-width: 100%; }
  .day-list {
    width: max-content;
    min-width: 0;
    grid-template-columns: repeat(10, 86px);
  }
  .timeline { margin-left: 2px; padding-left: 27px; }
  .timeline-row { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; }
  .timeline-icon { left: -27px; }
  .map-heading { align-items: center; }
  .map-style-toggle button { padding-inline: 8px; font-size: 9px; }
  .rail-alternatives summary span { float: none; display: block; margin: 2px 0 0 20px; }
}

.mobile-app, .mobile-sheet-overlay, .mobile-sheet { display: none; }
.icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.16em; }

@media (max-width: 767px) {
  html, body { min-width: 320px; height: 100%; overflow: hidden; }
  body { background: var(--page); }
  body.has-mobile-sheet { overflow: hidden; }
  .page-shell { display: none; }
  .mobile-app { position: relative; display: flex; flex-direction: column; width: 100%; height: 100dvh; min-height: 100svh; overflow: hidden; background: var(--page); }
  .mobile-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mobile-scroll::-webkit-scrollbar { display: none; }
  .mobile-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; color: #fffaf5; background: transparent; transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease; }
  .mobile-app.is-scrolled .mobile-topbar, .mobile-app.tab-map .mobile-topbar, .mobile-app.tab-budget .mobile-topbar { color: var(--ink); background: rgba(245, 242, 235, 0.82); box-shadow: 0 1px 0 rgba(113, 75, 49, 0.08); backdrop-filter: blur(18px) saturate(150%); }
  .mobile-topbar-title { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 900; opacity: 0; transform: translateY(-3px); transition: opacity 180ms ease, transform 180ms ease; }
  .mobile-app.is-scrolled .mobile-topbar-title, .mobile-app.tab-map .mobile-topbar-title, .mobile-app.tab-budget .mobile-topbar-title { opacity: 1; transform: translateY(0); }
  .mobile-icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; color: inherit; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
  .mobile-app.is-scrolled .mobile-icon-button, .mobile-app.tab-map .mobile-icon-button, .mobile-app.tab-budget .mobile-icon-button { background: rgba(255, 255, 255, 0.72); }
  .mobile-hero { position: relative; height: 270px; margin-top: calc(-56px - env(safe-area-inset-top)); padding: calc(64px + env(safe-area-inset-top)) 23px 25px; overflow: hidden; border-radius: 0 0 26px 26px; color: #fffdf8; background-image: url('./%E5%BD%A9%E6%9E%97.jpg'); background-size: cover; background-position: center 54%; }
  .mobile-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(44, 22, 16, 0.78), rgba(44, 22, 16, 0.22) 65%, transparent); }
  .mobile-hero-copy { position: relative; z-index: 1; }
  .mobile-hero-copy p { margin: 0 0 8px; color: rgba(255, 247, 230, 0.78); font-size: 9px; font-weight: 900; letter-spacing: 0.15em; }
  .mobile-hero-copy h1 { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 900; line-height: 1.02; letter-spacing: 0.04em; text-shadow: 0 3px 18px rgba(28, 15, 10, 0.3); }
  .mobile-hero-copy h1 .mobile-hero-title-line { display: inline; margin: 0; color: inherit; font-family: var(--serif); font-weight: 900; }
  .mobile-hero-copy h1 .mobile-hero-divider { margin: 0 0.1em; color: #f6c879; font-family: var(--sans); font-weight: 400; }
  .mobile-hero-copy > span { display: inline-flex; margin-top: 18px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 999px; background: rgba(64, 31, 18, 0.28); font-size: 11px; }
  .mobile-hero.is-hidden { display: none; }
  .mobile-date-strip { position: sticky; top: 0; z-index: 25; padding: 9px 0 10px; border-bottom: 1px solid rgba(220, 202, 187, 0.72); background: rgba(245, 242, 235, 0.82); backdrop-filter: blur(16px) saturate(145%); }
  .mobile-date-strip.is-hidden { display: none; }
  .mobile-date-list { display: flex; gap: 7px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
  .mobile-date-list::-webkit-scrollbar { display: none; }
  .mobile-date-button { flex: 0 0 auto; display: grid; gap: 2px; min-width: 88px; padding: 8px 8px 9px; border: 0; border-radius: 16px; color: var(--muted); background: transparent; text-align: center; transition: color 160ms ease, background 160ms ease, transform 160ms ease; }
  .mobile-date-button span { font-size: 11px; font-variant-numeric: tabular-nums; }
  .mobile-date-button strong { overflow: visible; text-overflow: clip; white-space: nowrap; font-size: 12px; }
  .mobile-date-button:not(.is-active):hover, .mobile-date-button:not(.is-active):active { background: rgba(239, 234, 225, 0.78); }
  .mobile-date-button.is-active { color: #fff; background: var(--rust); box-shadow: 0 8px 18px rgba(139, 58, 34, 0.18); }
  .mobile-date-button.is-active:hover, .mobile-date-button.is-active:active { color: #fff; background: var(--rust); }
  .mobile-main-content { padding: 0 15px; }
  .mobile-panel { display: none; }
  .mobile-panel.is-active { display: block; }
  .mobile-day-content { padding: 22px 1px 20px; }
  .mobile-day-header { padding: 3px 2px 16px; border-bottom: 1px solid var(--line); }
  .mobile-day-date { margin: 0; color: var(--rust); font-size: 13px; font-weight: 900; letter-spacing: 0.08em; }
  .mobile-day-header h1 { margin: 8px 0 3px; font-family: var(--serif); font-size: clamp(29px, 8.5vw, 42px); line-height: 1.08; letter-spacing: 0.01em; overflow-wrap: anywhere; }
  .mobile-day-theme { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
  .mobile-day-content .subsection { margin-top: 22px; }
  .mobile-day-content .subsection-heading { margin-bottom: 10px; font-size: 15px; }
  .mobile-day-content .timeline { margin-left: 0; padding-left: 27px; }
  .mobile-day-content .timeline::before { left: 143.5px; }
  .mobile-day-content .timeline-row { grid-template-columns: 96px 28px minmax(0, 1fr); gap: 7px; align-items: center; padding: 14px 0 18px; border-bottom: 1px solid rgba(234, 223, 212, 0.52); }
  .mobile-day-content .timeline-icon { position: static; grid-column: 2; grid-row: 1; display: grid; place-items: center; width: 27px; height: 27px; margin: 0; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 3px 9px rgba(80, 50, 20, 0.12); }
  .mobile-day-content .timeline-icon .icon { width: 15px; height: 15px; }
  .mobile-day-content .timeline-time { grid-column: 1; grid-row: 1; font-size: 12.5px; line-height: 1.25; white-space: nowrap; }
  .mobile-day-content .timeline-row > div:last-child { grid-column: 3; grid-row: 1; min-width: 0; }
  .mobile-day-content .timeline-title { font-size: 14px; }
  .mobile-day-content .timeline-detail { font-size: 12px; line-height: 1.45; }
  .mobile-day-content .route-card { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; align-items: start; padding: 13px 12px; border-radius: 17px; }
  .mobile-day-content .route-index { width: 30px; height: 30px; font-size: 13px; }
  .mobile-day-content .route-title { font-size: 15px; line-height: 1.35; }
  .mobile-day-content .route-note { margin-top: 4px; font-size: 12px; line-height: 1.4; }
  .mobile-day-content .route-metric { grid-column: 2; grid-row: 2; display: flex; align-items: baseline; gap: 8px; min-width: 0; margin-top: 6px; font-size: 15px; line-height: 1.2; text-align: left; }
  .mobile-day-content .route-metric small { display: inline; font-size: 12px; }
  .mobile-day-content .rail-card, .mobile-day-content .flight-card { padding: 13px; border-radius: 17px; }
  .mobile-day-content .rail-train, .mobile-day-content .flight-title { font-size: 15px; }
  .mobile-day-content .rail-time, .mobile-day-content .flight-time { font-size: 16px; }
  .mobile-day-content .rail-detail, .mobile-day-content .flight-note { font-size: 12px; }
  .mobile-day-content .poi-list { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
  .mobile-day-content .poi-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 3px 10px; padding: 13px 14px; border: 0; border-bottom: 1px solid rgba(234, 223, 212, 0.74); border-radius: 0; background: transparent; }
  .mobile-day-content .poi-card > .poi-title, .mobile-day-content .poi-card > .poi-meta { grid-column: 1; min-width: 0; }
  .mobile-day-content .poi-card > .poi-title { grid-row: 1; }
  .mobile-day-content .poi-card > .poi-meta { grid-row: 2; }
  .mobile-day-content .poi-card:last-child { border-bottom: 0; }
  .mobile-day-content .poi-card::after { grid-column: 2; grid-row: 1 / span 2; align-self: center; content: '›'; color: var(--muted); font-size: 22px; line-height: 1; }
  .mobile-day-content .poi-card:hover { border-color: transparent; box-shadow: none; transform: none; background: #fffaf5; }
  .mobile-day-content .poi-title { margin: 0; font-size: 17px; }
  .mobile-day-content .poi-meta { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .mobile-day-content .alert-box { margin: 16px 0 20px; padding: 12px 14px; background: rgba(253, 230, 138, 0.74); font-size: 14px; }
  .mobile-day-content .route-summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; margin: 16px 0; padding: 12px 14px; font-size: 13px; }
  .mobile-day-content .route-summary-metrics { display: flex; flex-wrap: wrap; gap: 7px; color: var(--rust); font-weight: 900; }
  .mobile-day-content .route-summary-metrics span + span::before { content: '·'; margin-right: 7px; color: var(--muted); }
  .mobile-map-panel { position: relative; min-height: calc(100dvh - 118px); margin: 0 -15px; padding: 0; overflow: hidden; background: #e9eeeb; }
  .mobile-map-toolbar { position: absolute; top: 12px; left: 15px; right: 15px; z-index: 8; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
  .mobile-map-toolbar > * { pointer-events: auto; }
  .mobile-map-title { padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, 0.84); color: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 900; box-shadow: 0 7px 18px rgba(80, 50, 20, 0.12); backdrop-filter: blur(12px); }
  .mobile-toolbar-button { display: inline-flex; align-items: center; gap: 5px; min-height: 35px; padding: 7px 11px; border: 0; border-radius: 999px; color: var(--rust); background: rgba(255, 255, 255, 0.88); box-shadow: 0 7px 18px rgba(80, 50, 20, 0.12); font-size: 12px; font-weight: 900; backdrop-filter: blur(12px); }
  .mobile-map-host { height: calc(100dvh - 118px); min-height: 430px; }
  .mobile-map-host .map-card { display: grid; grid-template-rows: 1fr; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; }
  .mobile-map-host .map-heading, .mobile-map-host .map-footer { display: none; }
  .mobile-map-host .map-frame { height: 100%; min-height: 0; margin: 0; border-radius: 0; }
  .mobile-map-actions { position: absolute; right: 14px; bottom: 18px; left: 14px; z-index: 8; display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
  .mobile-map-actions > * { pointer-events: auto; }
  .mobile-floating-button, .mobile-floating-segmented { border: 1px solid rgba(220, 202, 187, 0.85); border-radius: 12px; background: rgba(255, 255, 255, 0.88); color: var(--rust); box-shadow: 0 8px 20px rgba(80, 50, 20, 0.14); backdrop-filter: blur(13px); }
  .mobile-floating-button { display: inline-flex; align-items: center; gap: 5px; min-height: 37px; padding: 8px 12px; font-size: 11px; font-weight: 900; }
  .mobile-floating-segmented { display: inline-flex; padding: 3px; border-color: rgba(220, 202, 187, 0.76); background: rgba(118, 118, 128, 0.13); box-shadow: inset 0 0 0 0.5px rgba(80, 50, 20, 0.05), 0 8px 20px rgba(80, 50, 20, 0.12); }
  .mobile-floating-segmented button { min-width: 67px; min-height: 30px; padding: 5px 8px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 900; letter-spacing: 0.05em; }
  .mobile-floating-segmented button.is-active { color: var(--rust); background: #fff; box-shadow: 0 2px 5px rgba(80, 50, 20, 0.12); }
  .mobile-budget-content { padding: 22px 0 18px; }
  .mobile-budget-header { position: relative; padding: 3px 2px 18px; border-bottom: 1px solid var(--line); }
  .mobile-budget-header p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; }
  .mobile-budget-header h1 { margin: 7px 0 0; font-family: var(--serif); font-size: 34px; }
  .mobile-budget-header > strong { position: absolute; right: 0; bottom: 21px; color: var(--rust); font-size: 21px; }
  .mobile-budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 15px 0 19px; }
  .mobile-budget-summary > div { display: grid; gap: 3px; padding: 11px 9px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
  .mobile-budget-summary small { color: var(--muted); font-size: 10px; }
  .mobile-budget-summary b { color: var(--rust); font-size: 14px; white-space: nowrap; }
  .mobile-budget-groups { display: grid; gap: 9px; }
  .mobile-budget-group { border: 1px solid var(--line); border-radius: 17px; background: var(--paper); overflow: hidden; }
  .mobile-budget-group summary { display: flex; align-items: center; justify-content: space-between; padding: 14px; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 900; list-style: none; }
  .mobile-budget-group summary::-webkit-details-marker { display: none; }
  .mobile-budget-group summary::after { content: '+'; color: var(--muted); font-size: 17px; }
  .mobile-budget-group[open] summary::after { content: '−'; }
  .mobile-budget-group summary strong { margin-left: auto; margin-right: 12px; color: var(--rust); font-size: 14px; }
  .mobile-budget-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid rgba(234, 223, 212, 0.76); }
  .mobile-budget-row strong, .mobile-budget-row small { display: block; }
  .mobile-budget-row strong { font-size: 13px; }
  .mobile-budget-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
  .mobile-budget-row b { color: var(--rust); font-size: 13px; white-space: nowrap; }
  .mobile-budget-assumptions { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 16px; color: var(--muted); font-size: 11px; }

  .mobile-tab-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(220, 202, 187, 0.76); background: rgba(255, 255, 255, 0.84); backdrop-filter: blur(20px) saturate(150%); }
  .mobile-tab-item { display: grid; justify-items: center; gap: 2px; padding: 5px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 900; }
  .mobile-tab-item .icon { width: 19px; height: 19px; }
  .mobile-tab-item.is-active { color: var(--rust); }

  .mobile-sheet-overlay { position: fixed; inset: 0; z-index: 60; display: block; background: rgba(44, 34, 30, 0.28); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .mobile-sheet-overlay.is-open { opacity: 1; pointer-events: auto; }
  .mobile-sheet { position: fixed; right: 0; bottom: 0; left: 0; z-index: 70; display: block; max-height: 58vh; overflow: hidden; border: 1px solid rgba(220, 202, 187, 0.8); border-bottom: 0; border-radius: 26px 26px 0 0; background: rgba(255, 255, 255, 0.97); box-shadow: 0 -18px 45px rgba(80, 50, 20, 0.18); transform: translateY(105%); transition: transform 230ms cubic-bezier(.22,.8,.32,1), max-height 220ms ease; }
  .mobile-sheet.is-open { transform: translateY(0); }
  .mobile-sheet.is-expanded { max-height: 88vh; }
  .mobile-sheet.is-dragging { transition: none; }
  .mobile-sheet-handle { width: 42px; height: 5px; margin: 9px auto 3px; border-radius: 999px; background: #d8c8bc; touch-action: none; }
  .mobile-sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 8px 17px 12px; }
  .mobile-sheet-heading { min-width: 0; }
  .mobile-sheet-heading p { margin: 0 0 2px; color: var(--rust); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
  .mobile-sheet-heading h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 24px; line-height: 1.18; }
  .mobile-sheet-close { flex: 0 0 auto; color: var(--muted); background: #f6eee8; }
  .mobile-sheet-body { max-height: calc(58vh - 88px); overflow-y: auto; padding: 0 17px 20px; overscroll-behavior: contain; }
  .mobile-sheet.is-expanded .mobile-sheet-body { max-height: calc(88vh - 88px); }
  .mobile-sheet-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 3px 0 14px; }
  .mobile-sheet-stats > div { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fffaf5; }
  .mobile-sheet-stats small, .mobile-sheet-stats span { color: var(--muted); font-size: 11px; }
  .mobile-sheet-stats strong { color: var(--ink); font-size: 18px; }
  .mobile-sheet-copy { color: var(--muted-dark); font-size: 14px; line-height: 1.6; }
  .mobile-sheet-copy p { margin: 0 0 8px; }
  .mobile-sheet-copy b { color: var(--ink); }
  .mobile-sheet-actions { position: sticky; bottom: -20px; display: grid; gap: 8px; margin: 16px -17px -20px; padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); }
  .mobile-sheet-action, .mobile-save-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 45px; border: 0; border-radius: 14px; color: #fff; background: var(--rust); font-size: 14px; font-weight: 900; }
  .mobile-sheet-action:active, .mobile-save-button:active { transform: scale(.99); }
  .mobile-sheet-menu-row { display: flex; justify-content: flex-end; margin-top: 14px; }
  .mobile-sheet-menu-row .mobile-sheet-action { width: auto; min-height: 36px; padding: 7px 12px; color: var(--rust); background: #f7e8de; font-size: 12px; }
  .mobile-sheet-menu-list { display: grid; gap: 8px; padding-top: 4px; }
  .mobile-sheet-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; font-size: 15px; font-weight: 800; }
  .mobile-sheet-menu-item .icon { color: var(--rust); }
  .mobile-sheet-footnote { margin: 13px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
  .mobile-sheet-gallery { display: flex; gap: 10px; margin: 2px -17px 15px; padding: 0 17px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .mobile-sheet-gallery::-webkit-scrollbar { display: none; }
  .mobile-sheet-gallery figure { flex: 0 0 calc(100vw - 46px); margin: 0; scroll-snap-align: start; }
  .mobile-sheet-gallery img { display: block; width: 100%; height: 205px; object-fit: cover; border-radius: 18px; background: #f2eee9; }
  .mobile-sheet-gallery figcaption { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
  .mobile-empty-media { display: grid; place-items: center; height: 110px; margin: 2px 0 14px; border-radius: 17px; color: var(--muted); background: #f7f1ec; font-size: 13px; }
  .mobile-place-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; }
  .mobile-place-meta span:first-child { color: var(--rust); font-weight: 900; }
  .mobile-place-window { margin: 12px 0 0; color: var(--rust); font-size: 13px; font-weight: 800; }
  .mobile-place-guide { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
  .mobile-place-guide h3 { margin: 0 0 7px; color: var(--muted); font-size: 14px; }
  .mobile-place-guide p { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
  .mobile-route-picker-list h3 { margin: 15px 0 6px; color: var(--muted); font-size: 12px; }
  .mobile-route-picker-list h3:first-child { margin-top: 2px; }
  .mobile-route-picker-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
  .mobile-route-picker-item > .icon:first-child { flex: 0 0 auto; width: 20px; height: 20px; color: var(--rust); }
  .mobile-route-picker-item > .icon:last-child { flex: 0 0 auto; width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
  .mobile-route-picker-item span { min-width: 0; }
  .mobile-route-picker-item strong, .mobile-route-picker-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-route-picker-item strong { font-size: 14px; }
  .mobile-route-picker-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
  .mobile-legend-list { display: grid; gap: 11px; padding: 3px 0 8px; }
  .mobile-legend-list > div { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 800; }
  .mobile-legend-list .legend-swatch { flex: 0 0 auto; }
  .mobile-info-list { display: grid; gap: 0; }
  .mobile-info-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .mobile-info-list span { color: var(--muted); font-size: 13px; }
  .mobile-info-list strong { color: var(--ink); font-size: 13px; text-align: right; }
  .mobile-edit-form { display: grid; gap: 12px; }
  .mobile-edit-form label { display: grid; gap: 6px; color: var(--muted-dark); font-size: 12px; font-weight: 800; }
  .mobile-edit-form input[type=text], .mobile-edit-form input[type=file], .mobile-edit-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 11px; color: var(--ink); background: #fffaf5; font-size: 14px; }
  .mobile-edit-form textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
  .mobile-checkbox { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; }
  .mobile-checkbox input { width: 16px; height: 16px; accent-color: var(--rust); }
  .mobile-save-button:disabled { color: var(--muted); background: #e8e0d9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
