@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Serif+Display&display=swap');

:root {
  --paper: #f7f5ef;
  --paper-2: #efede5;
  --white: #fffefa;
  --ink: #272b27;
  --muted: #777a70;
  --line: #deddd4;
  --green: #375b4a;
  --green-light: #e3ece3;
  --orange: #c45c3e;
  --gold: #d1a84f;
  --blue: #54788a;
  --shadow: 0 12px 36px rgba(51, 53, 45, .07);
  --mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
  --serif: 'DM Serif Display', Georgia, 'Noto Serif SC', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.shell { width: min(1190px, calc(100% - 52px)); margin: 0 auto; }
.masthead { min-height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { font: 32px/1 var(--serif); letter-spacing: -2px; color: var(--green); }
.brand-mark span { color: var(--orange); font: 500 11px/1 var(--mono); vertical-align: top; margin-left: 3px; letter-spacing: 0; }
.brand-name, .trip-dates, .eyebrow, .section-kicker, .time, .mini-label, .day-date, .badge, .flight-code { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.brand-name { color: var(--muted); font-size: 10px; }
.trip-dates { font-size: 10px; color: var(--muted); }
.trip-dates span { color: var(--orange); }
.trip-dates i { padding: 0 6px; color: #c6c2b5; font-style: normal; }
.main-nav { height: 64px; display: flex; gap: 32px; border-bottom: 1px solid var(--line); }
.nav-button { position: relative; appearance: none; border: 0; background: none; padding: 0 4px; display: inline-flex; align-items: center; gap: 9px; color: #85867d; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.nav-button::after { content: ''; position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; background: transparent; }
.nav-button.active { color: var(--green); }
.nav-button.active::after { background: var(--green); }
.nav-dot { display: inline-block; width: 6px; height: 6px; border-radius: 100%; background: #b7b7a9; }
.nav-button.active .nav-dot { background: var(--orange); }
#app { min-height: 69vh; padding: 34px 0 74px; }
.eyebrow, .section-kicker { font-size: 10px; color: var(--orange); }
.eyebrow .rule { display: inline-block; width: 28px; border-top: 1px solid currentColor; margin: 0 8px 3px 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(265px, .65fr); gap: 42px; align-items: end; padding: 25px 0 30px; }
.hero h1 { font: clamp(45px, 7.4vw, 84px)/.99 var(--serif); font-weight: 400; letter-spacing: -.045em; margin: 14px 0 16px; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-desc { color: var(--muted); max-width: 590px; margin: 0; font-size: 14px; }
.hero-side { border-left: 1px solid var(--line); padding: 3px 0 3px 26px; margin-bottom: 5px; }
.hero-side .big-count { font: 43px/.95 var(--serif); color: var(--green); }
.hero-side .big-count span { color: var(--orange); font-size: 21px; }
.hero-side p { margin: 9px 0 0; max-width: 210px; color: var(--muted); font-size: 12px; }
.trip-alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1px solid #e8d8bb; background: #f6f0e3; border-radius: 8px; font-size: 12px; margin: 0 0 22px; color: #5e5746; }
.trip-alert .alert-icon { color: var(--orange); font: 16px var(--serif); }
.trip-alert strong { color: var(--ink); font-weight: 600; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin: 32px 0 15px; }
.section-heading h2 { font: 28px/1.1 var(--serif); font-weight: 400; margin: 4px 0 0; letter-spacing: -.02em; }
.section-heading .hint { color: var(--muted); font-size: 11px; text-align: right; }
.grid { display: grid; gap: 16px; }
.today-grid { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); }
.card { border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: var(--shadow); }
.weather-card { padding: 20px 22px; overflow: hidden; position: relative; }
.weather-card::after { content: 'TOKYO'; position: absolute; right: 17px; top: -1px; font: 54px/1 var(--serif); opacity: .05; letter-spacing: -.05em; }
.weather-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.weather-place { color: var(--muted); font-size: 12px; }
.weather-live { border: 1px solid #c8d6c9; border-radius: 20px; color: var(--green); padding: 3px 8px; font: 9px var(--mono); letter-spacing: .08em; }
.weather-main { display: flex; align-items: center; gap: 18px; margin: 21px 0 17px; }
.weather-icon { font-size: 41px; line-height: 1; width: 48px; text-align: center; }
.weather-temp { font: 51px/.95 var(--serif); letter-spacing: -.045em; }
.weather-temp span { font: 16px var(--sans); vertical-align: top; margin-left: 2px; }
.weather-summary { color: var(--muted); font-size: 12px; margin-top: 5px; }
.weather-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-top: 13px; gap: 7px; }
.stat-label { color: #99998f; font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.stat-value { margin-top: 3px; font-size: 12px; }
.weather-updated { color: #97988e; font-size: 10px; margin-top: 12px; }
.hour-strip { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); margin-top: 15px; padding-top: 12px; gap: 5px; }
.hour { text-align: center; color: var(--muted); font-size: 10px; }
.hour .h-icon { font-size: 15px; display: block; margin: 3px 0; }
.hour b { font-size: 10px; font-weight: 500; color: var(--ink); }
.plan-card { padding: 19px 20px; }
.plan-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.day-date { color: var(--orange); font-size: 10px; }
.plan-card h3 { font: 23px/1.2 var(--serif); font-weight: 400; margin: 5px 0 0; }
.badge { font-size: 8px; color: var(--green); border: 1px solid #cbd8ca; padding: 4px 7px; border-radius: 3px; white-space: nowrap; }
.agenda { padding-top: 6px; }
.agenda-row { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eeede7; }
.agenda-row:last-child { border-bottom: 0; }
.time { color: var(--orange); font-size: 9px; padding-top: 3px; letter-spacing: .03em; }
.agenda-title { font-size: 12px; font-weight: 600; }
.agenda-note { color: var(--muted); font-size: 10px; margin-top: 2px; }
.hotel-strip { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--green); color: white; border-radius: 9px; padding: 14px 17px; margin-top: 16px; }
.hotel-strip .mini-label { color: #b8cbbd; font-size: 8px; }
.hotel-strip strong { display: block; font-size: 12px; font-weight: 500; margin-top: 2px; }
.hotel-strip .hotel-meta { text-align: right; color: #d5e0d6; font-size: 10px; }
.hotel-strip a { border-bottom: 1px solid #b7c9b9; }
.quick-routes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.route-chip { padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.35); }
.route-chip .mini-label { font-size: 8px; color: var(--muted); }
.route-chip strong { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; }
.route-chip span { color: var(--muted); font-size: 10px; }
.flight-card { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.flight { background: var(--white); padding: 16px 18px; }
.flight-head { display: flex; justify-content: space-between; align-items: center; }
.flight-code { color: var(--orange); font-size: 10px; }
.flight-dir { color: var(--muted); font-size: 10px; }
.flight-route { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 9px; }
.flight-airport { font: 23px/1 var(--serif); }
.flight-airport small { display: block; color: var(--muted); font: 9px var(--mono); margin-top: 5px; }
.flight-arrow { flex: 1; margin: 0 10px; border-top: 1px solid #c8c7be; position: relative; }
.flight-arrow::after { content: '›'; position: absolute; right: 0; top: -12px; color: var(--orange); font-size: 18px; }
.flight-time { font: 12px var(--mono); }
.flight-date { color: var(--muted); font-size: 10px; margin-top: 5px; }
.weather-loading { color: var(--muted); font-size: 12px; }
.weather-error { color: #96533e; font-size: 11px; }

.day-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.day-card { text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 17px 18px; cursor: pointer; transition: .18s ease; box-shadow: 0 6px 22px rgba(51,53,45,.04); }
.day-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #bfc9ba; }
.day-card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.day-num { font: 32px/.95 var(--serif); color: var(--green); }
.day-num small { color: var(--orange); font: 9px var(--mono); margin-left: 7px; letter-spacing: .05em; }
.day-title { font: 20px/1.2 var(--serif); font-weight: 400; margin: 8px 0 5px; }
.day-route { color: var(--muted); font-size: 11px; }
.day-weather { display: flex; flex-direction: column; align-items: end; color: var(--muted); font-size: 10px; gap: 2px; min-width: 62px; }
.day-weather .forecast-icon { font-size: 20px; }
.day-weather strong { font: 14px var(--serif); color: var(--ink); }
.day-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.day-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.small-tag { padding: 2px 6px; background: var(--paper-2); border-radius: 3px; color: #6b6d64; font-size: 9px; }
.arrow-link { color: var(--green); font-size: 12px; white-space: nowrap; }
.optional-panel { margin-top: 20px; padding: 17px 19px; border: 1px dashed #c5c2b6; border-radius: 10px; background: rgba(255,255,255,.32); }
.optional-panel h3 { margin: 0 0 9px; font: 20px var(--serif); font-weight: 400; }
.optional-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.optional-item { padding: 11px; border-radius: 7px; background: var(--white); }
.optional-item strong { font-size: 12px; }
.optional-item p { margin: 4px 0 6px; color: var(--muted); font-size: 10px; }
.optional-item a { color: var(--green); font-size: 10px; border-bottom: 1px solid #9eb19f; }
.callout { border-left: 2px solid var(--orange); padding: 10px 13px; color: #68695f; background: #f4f0e7; font-size: 11px; margin-top: 14px; }

.view-title { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin: 10px 0 21px; }
.view-title h1 { font: clamp(38px, 5vw, 58px)/1 var(--serif); font-weight: 400; letter-spacing: -.03em; margin: 7px 0 0; }
.view-title p { max-width: 420px; color: var(--muted); font-size: 12px; margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.filter-button { border: 1px solid var(--line); background: transparent; border-radius: 25px; color: var(--muted); font-size: 10px; padding: 6px 11px; cursor: pointer; }
.filter-button.active { color: white; background: var(--green); border-color: var(--green); }
.filter-button.optional-toggle.active { background: var(--orange); border-color: var(--orange); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(310px, .64fr); gap: 14px; align-items: stretch; }
.map-card { position: relative; min-height: 555px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #e9e8df; box-shadow: var(--shadow); }
.map-canvas { width: 100%; height: 555px; z-index: 1; }
.map-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); background: #e9e8df; }
.map-loading.hidden { display: none; }
.map-legend { position: absolute; z-index: 500; left: 13px; bottom: 21px; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(255,254,250,.94); box-shadow: 0 2px 10px #0002; font-size: 9px; color: #5a5c54; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: var(--orange); }
.legend-dot.optional { background: var(--gold); }
.legend-dot.hotel { background: var(--green); }
.places-panel { min-height: 555px; max-height: 555px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.places-panel-head { padding: 15px 16px 11px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 2; }
.places-panel-head strong { font: 19px var(--serif); font-weight: 400; }
.places-panel-head span { float: right; font: 10px var(--mono); color: var(--muted); margin-top: 6px; }
.place-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; padding: 11px 13px; border-bottom: 1px solid #eeede7; align-items: start; cursor: pointer; }
.place-row:hover, .place-row.selected { background: #f4f4ed; }
.place-number { font: 10px var(--mono); color: #a4a398; padding-top: 2px; }
.place-row-main { min-width: 0; }
.place-name { font-size: 11px; font-weight: 600; line-height: 1.35; }
.place-address { color: var(--muted); font-size: 9px; margin-top: 3px; line-height: 1.4; }
.place-actions { display: flex; flex-direction: column; align-items: end; gap: 5px; }
.place-actions a { font: 9px var(--mono); color: var(--green); white-space: nowrap; }
.place-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.place-badge { color: #676961; background: var(--paper-2); padding: 1px 5px; border-radius: 2px; font-size: 8px; }
.place-badge.booked { background: #f4e5de; color: #a24c32; }
.map-readme { margin-top: 11px; color: var(--muted); font-size: 10px; }
.leaflet-popup-content-wrapper { border-radius: 7px !important; }
.leaflet-popup-content { font-family: var(--sans); font-size: 11px; margin: 10px 12px !important; line-height: 1.5; }
.leaflet-popup-content a { color: var(--green); font-weight: 600; }
.pin { width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fffefa; box-shadow: 0 2px 6px #0004; background: var(--orange); }
.pin span { transform: rotate(45deg); color: white; font: 9px var(--mono); }
.pin.optional { background: var(--gold); }.pin.hotel { background: var(--green); }.pin.transport { background: var(--blue); }

.day-detail-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 15px; border-bottom: 1px solid var(--line); padding: 6px 0 20px; margin-bottom: 18px; }
.back-link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--green); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.day-detail-head h1 { font: clamp(38px, 5.5vw, 61px)/1 var(--serif); font-weight: 400; letter-spacing: -.04em; margin: 8px 0 4px; }
.day-detail-head p { color: var(--muted); font-size: 12px; margin: 0; }
.day-detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: end; }
.button-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 11px; font-size: 10px; color: var(--green); background: var(--white); }
.button-link.primary { background: var(--green); color: white; border-color: var(--green); }
.detail-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 14px; align-items: start; }
.timeline-card { padding: 18px 19px; }
.timeline-card h2, .daily-map-card h2 { font: 23px var(--serif); font-weight: 400; margin: 0 0 5px; }
.timeline-sub { color: var(--muted); font-size: 10px; margin: 0 0 12px; }
.timeline { position: relative; margin: 11px 0 0 1px; }
.timeline::before { position: absolute; content: ''; left: 6px; top: 5px; bottom: 10px; border-left: 1px solid #d8d7cc; }
.timeline-item { position: relative; padding: 0 0 17px 25px; display: grid; grid-template-columns: 75px 1fr; gap: 8px; }
.timeline-item:last-child { padding-bottom: 3px; }
.timeline-item::before { content: ''; position: absolute; left: 2px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid var(--white); outline: 1px solid var(--orange); z-index: 1; }
.timeline-item.hotel-item::before { background: var(--green); outline-color: var(--green); }
.timeline-time { color: var(--orange); font: 9px var(--mono); padding-top: 2px; }
.timeline-item h3 { font-size: 12px; margin: 0; font-weight: 600; }
.timeline-item p { color: var(--muted); font-size: 10px; margin: 3px 0 0; }
.timeline-item .inline-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.inline-links a { font-size: 9px; color: var(--green); border-bottom: 1px solid #c0cdbf; }
.daily-map-card { padding: 17px; }
.daily-map-canvas { height: 360px; border-radius: 7px; overflow: hidden; background: #e9e8df; margin-top: 11px; }
.day-map-note { color: var(--muted); font-size: 10px; margin: 8px 0 0; }
.stop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.stop-card { background: #f7f6f0; border-radius: 7px; padding: 10px 11px; }
.stop-card h4 { font-size: 11px; margin: 0; }
.stop-card p { font-size: 9px; margin: 4px 0 7px; color: var(--muted); }
.stop-links { display: flex; gap: 10px; font: 9px var(--mono); color: var(--green); }
.source-notes { color: var(--muted); font-size: 9px; margin: 18px 2px 0; }
.source-notes a { border-bottom: 1px solid #aaa; }

.site-footer { display: flex; justify-content: space-between; gap: 12px; color: #8d8d83; border-top: 1px solid var(--line); padding: 16px 0 24px; font: 9px var(--mono); letter-spacing: .02em; }
.toast { position: fixed; bottom: 23px; left: 50%; transform: translate(-50%, 20px); z-index: 1500; opacity: 0; pointer-events: none; padding: 9px 13px; background: var(--ink); border-radius: 6px; color: white; font-size: 11px; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { color: var(--muted); font-size: 12px; padding: 20px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 32px, 700px); }
  .hero { grid-template-columns: 1fr 180px; gap: 20px; }
  .today-grid, .detail-grid { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-card, .places-panel { min-height: 390px; max-height: none; }
  .map-canvas { height: 390px; }
  .places-panel { max-height: 475px; }
  .daily-map-canvas { height: 320px; }
  .quick-routes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .masthead { min-height: 68px; }
  .brand-mark { font-size: 28px; }
  .brand-name { font-size: 8px; }
  .trip-dates { font-size: 8px; }
  .main-nav { height: 54px; gap: 23px; }
  #app { padding: 24px 0 40px; }
  .hero { grid-template-columns: 1fr; gap: 17px; padding: 15px 0 20px; }
  .hero h1 { font-size: clamp(47px, 16vw, 67px); }
  .hero-side { display: flex; gap: 13px; align-items: center; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .hero-side p { margin: 0; max-width: 210px; }
  .hero-side .big-count { font-size: 36px; min-width: 95px; }
  .section-heading { align-items: start; margin-top: 26px; }
  .section-heading h2 { font-size: 24px; }
  .section-heading .hint { max-width: 140px; font-size: 9px; }
  .weather-card, .plan-card { padding: 16px; }
  .weather-stats { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .quick-routes { grid-template-columns: 1fr; }
  .flight-card { grid-template-columns: 1fr; }
  .day-list { grid-template-columns: 1fr; }
  .optional-grid { grid-template-columns: 1fr; }
  .view-title { display: block; }
  .view-title p { margin-top: 10px; }
  .map-card { min-height: 330px; }
  .map-canvas { height: 330px; }
  .places-panel { max-height: 480px; }
  .day-detail-head { grid-template-columns: 1fr; align-items: start; }
  .day-detail-actions { justify-content: start; }
  .timeline-card, .daily-map-card { padding: 14px; }
  .timeline-item { grid-template-columns: 62px 1fr; }
  .stop-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 4px; font-size: 8px; }
}
