:root {
  --place-art: url("assets/place-art.jpg");
  --osaka-cover: url("assets/osaka-castle.jpg");
  color-scheme: light;
  --page: #f7f5f5;
  --white: #fff;
  --ink: #2c2531;
  --muted: #685965;
  --line: #e8e1e5;
  --accent: #983c46;
  --accent-dark: #772a35;
  --pale: #faedf0;
  --orange: #a2593c;
  font-family: "DM Sans", "Noto Sans Thai", system-ui, sans-serif;
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; display: block; flex: none; }
i[data-icon] { display: inline-flex; align-items: center; justify-content: center; font-style: normal; flex: none; }
:focus-visible { outline: 3px solid #aa603d; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 1.25rem; font-weight: 800; letter-spacing: -.055em; white-space: nowrap; }
.brand-japan { color: #883d48; }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--accent); color: white; }
.brand-icon svg { width: 23px; height: 23px; }
nav { display: flex; align-items: center; gap: 6px; }
nav a { display: flex; gap: 7px; align-items: center; padding: 9px 15px; border-radius: 8px; font-size: .94rem; font-weight: 600; color: var(--muted); }
nav a:hover, nav a[aria-current] { background: var(--pale); color: var(--accent); }
nav svg, .button svg { width: 17px; height: 17px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; min-height: 42px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: .9rem; line-height: 1.4; }
.outline { background: var(--white); border-color: var(--line); color: var(--accent); }
.outline:hover, .icon-button:hover { background: var(--pale); }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.hero {
  position: relative; isolation: isolate; display: flex; align-items: center; min-height: 177px; margin: 20px 0 20px; padding: 19px 30px;
  overflow: hidden; border-radius: 15px; color: white; background: #252843;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 46%;
  background: linear-gradient(90deg, #252843, #25284300 45%), var(--osaka-cover) center 49% / cover;
}
.eyebrow { display: flex; align-items: center; gap: 8px; color: #ffe6df; font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
.flag { position: relative; display: inline-block; width: 20px; height: 14px; border-radius: 3px; background: #fff; }
.flag::after { content: ""; position: absolute; inset: 4px 7px; border-radius: 50%; background: #b93942; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.2; margin: 3px 0 4px; }
.hero-subtitle { color: #fff3ed; font-size: .97rem; margin-bottom: 10px; }
.hero-button { background: #fff; color: var(--accent); min-height: 37px; padding: 6px 10px; }
.hero-button:hover { background: var(--pale); }
.hero-location { position: absolute; bottom: 12px; right: 13px; display: flex; align-items: center; gap: 5px; background: #191a2bdc; border: 1px solid #ffffff45; color: #fff; padding: 4px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.hero-location svg { width: 13px; height: 13px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 23px; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 15px #20372c06; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 21px 22px 16px; }
.heading-group { display: flex; gap: 12px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.heading-group h2, .dialog-head h2 { font-size: 1.2rem; line-height: 1.4; font-weight: 800; letter-spacing: -.03em; }
.heading-group p { font-size: .875rem; color: var(--muted); margin-top: 2px; }
.tile { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--pale); flex: none; }
.tile.warm { background: #fff0e7; color: var(--orange); }
.days-wrap { display: flex; gap: 8px; align-items: center; padding: 0 22px 15px; border-bottom: 1px solid var(--line); }
.days { display: flex; gap: 7px; align-items: center; overflow-x: auto; padding: 4px; margin: -4px; flex: 0 1 auto; min-width: 0; }
.day { border: 1px solid var(--line); background: #fcf8f8; border-radius: 9px; padding: 8px 13px; flex: none; font-size: .875rem; font-weight: 700; min-height: 40px; }
.day[aria-pressed="true"] { background: var(--pale); border-color: #e4bcc6; color: var(--accent); }
.day:hover { border-color: #a1b4a5; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--accent); flex: none; }
.icon-button svg { width: 17px; height: 17px; }
.day-add { border-style: dashed; }
.plan-body { padding: 17px 22px 19px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.day-head h3 { font-size: 1.05rem; font-weight: 800; }
.day-head span, .panel-foot { color: var(--muted); font-size: .875rem; }
.timeline-entry { display: grid; grid-template-columns: 48px 18px minmax(0,1fr); align-items: start; }
.timeline-time { padding-top: 14px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--accent); }
.timeline-track { display: flex; align-self: stretch; justify-content: center; position: relative; padding-top: 20px; }
.timeline-track::after { content: ""; width: 2px; top: 22px; bottom: -21px; position: absolute; background: #ebd9df; }
.timeline-entry:last-child .timeline-track::after { display: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: #52836e; box-shadow: 0 0 0 3px var(--pale); z-index: 1; }
.place-card { min-width: 0; margin: 0 0 9px 7px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; min-height: 71px; }
.timeline-entry:last-child .place-card { margin-bottom: 0; }
.place-copy { min-width: 0; overflow-wrap: anywhere; }
.place-copy h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.place-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; color: var(--muted); font-size: .875rem; align-items: center; }
.tag { background: #f8edf0; color: #7c3e49; padding: 1px 7px; border-radius: 5px; font-size: .79rem; font-weight: 700; white-space: nowrap; }
.tag.food { background: #fff1e7; color: #8b4c36; }
.place-note { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.place-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.place-actions .icon-button { border-color: transparent; width: 34px; height: 34px; }
.empty { padding: 28px 16px; background: #f6f9f5; border-radius: 10px; color: var(--muted); text-align: center; }
.empty button { margin-top: 12px; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 22px; display: flex; align-items: center; gap: 7px; }
.panel-foot svg { height: 15px; width: 15px; }
.travel-tools { display: grid; gap: 16px; min-width: 0; }
.rail { padding: 21px 22px 19px; }
.rail-fields { position: relative; display: grid; gap: 7px; margin: 16px 0 10px; }
.rail-field { border: 1px solid var(--line); border-radius: 9px; padding: 6px 43px 6px 10px; min-height: 55px; display: flex; gap: 9px; align-items: center; color: var(--accent); background: #fcf8f8; }
.rail-field > span { flex: 1; min-width: 0; }
.field-label { display: block; font-size: .875rem; line-height: 1.3; font-weight: 700; }
.rail-field input { border: 0; width: 100%; background: transparent; color: var(--ink); padding: 0; line-height: 1.35; min-height: 23px; }
input::placeholder, textarea::placeholder { color: #697871; }
.swap { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); box-shadow: 0 2px 6px #1d35251a; width: 36px; height: 36px; }
.rail-submit { width: 100%; }
#rail-result { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 13px; font-size: .91rem; overflow-wrap: anywhere; }
#rail-result p { margin-bottom: 8px; }
.route-legs { padding: 0; margin: 8px 0; list-style: none; display: grid; gap: 6px; }
.route-legs li { display: grid; gap: 3px; border-left: 4px solid var(--route-color, var(--accent)); padding: 6px 9px; background: #f6f8f6; }
.route-legs span { color: var(--muted); }
.result-note { color: var(--muted); }
.map-panel { overflow: hidden; }
.map-link { font-size: .82rem; min-height: 36px; white-space: nowrap; }
.site-footer { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding-block: 23px; color: var(--muted); font-size: .84rem; }
.site-footer > span:first-child { font-weight: 800; color: var(--accent); }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
dialog { width: min(470px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 19px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 60px #14242152; }
dialog::backdrop { background: #132a23a1; }
dialog form { display: grid; gap: 13px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-actions .primary { margin-left: auto; }
dialog label { display: grid; gap: 4px; font-size: .91rem; font-weight: 700; min-width: 0; }
dialog input, dialog textarea, dialog select { border: 1px solid #bdcbc0; border-radius: 7px; padding: 8px 10px; width: 100%; min-width: 0; background: white; font-weight: 400; font-size: 1rem; }
dialog select { appearance: none; padding-right: 30px; background: linear-gradient(45deg, transparent 48%, var(--accent) 49% 62%, transparent 63%) calc(100% - 14px) 52% / 7px 7px no-repeat, linear-gradient(135deg, transparent 48%, var(--accent) 49% 62%, transparent 63%) calc(100% - 9px) 52% / 7px 7px no-repeat; }
dialog textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: .7fr 1.3fr; gap: 10px; }
.danger { color: #962c25; background: #fbeeed; }
.toast { position: fixed; z-index: 8; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 26px); padding: 10px 16px; background: var(--accent-dark); color: #fff; border-radius: 10px; box-shadow: 0 6px 25px #1424213d; }
@media (max-width: 1050px) { .shell { width: calc(100% - 46px); } .workspace { gap: 15px; } .place-card { padding-inline: 9px; } }
@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hero { padding-inline: 20px; }
}
@media (max-width: 570px) {
  :root { scroll-padding-top: 122px; }
  .shell { width: calc(100% - 26px); }
  .header-inner { flex-wrap: wrap; min-height: auto; padding-block: 8px; gap: 7px; }
  .day-detail { display: none; }
  .settings { min-height: 39px; padding-inline: 10px; }
  nav { order: 3; width: 100%; }
  nav a { justify-content: center; flex: 1; padding: 7px 6px; white-space: nowrap; }
  .hero { min-height: 150px; margin: 11px 0 13px; border-radius: 12px; padding: 12px 13px; }
  .hero::before { inset: 0 0 0 38%; background-position: center, 58% 51%; }
  .hero h1 { font-size: clamp(1.85rem, 7.7vw, 2.35rem); }
  .hero-subtitle { font-size: .88rem; margin-bottom: 8px; }
  .hero-location { bottom: 6px; right: 6px; font-size: .7rem; padding: 2px 5px; }
  .panel-head { padding: 15px 12px 13px; }
  .heading-group { gap: 8px; }
  .heading-group h2 { font-size: 1.11rem; }
  .heading-group p { font-size: .875rem; }
  .tile { width: 36px; height: 36px; border-radius: 9px; }
  .days-wrap, .plan-body, .panel-foot { padding-inline: 12px; }
  .rail { padding: 15px 12px; }
  .timeline-entry { grid-template-columns: 43px 13px minmax(0, 1fr); }
  .place-card { flex-wrap: wrap; gap: 1px; margin-left: 5px; }
  .place-copy { flex: 1 1 100%; }
  .place-actions { justify-content: flex-start; }
  .place-actions .icon-button { width: 42px; height: 42px; }
  .site-footer { flex-wrap: wrap; padding-block: 15px; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
.timeline-entry.saved-entry { grid-template-columns: minmax(0, 1fr); }
.saved-entry .place-card { margin-left: 0; }
.saved-search { display: flex; align-items: center; gap: 8px; padding: 6px 9px; min-height: 42px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); }
.saved-search input { border: 0; width: 100%; min-width: 0; }
.leg-row { padding: 0 0 9px 7px; }
.leg-link { border: 0; border-radius: 20px; background: #faedf0; color: var(--accent); padding: 4px 9px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 700; }
.leg-link:hover { background: #efdbe1; }
.leg-link svg { width: 15px; height: 15px; }
.timeline-dot { width: 17px; height: 17px; display: grid; place-items: center; font-size: .70rem; font-weight: 800; background: var(--accent); color: white; margin-top: -4px; }
.map-stops { display: flex; align-items: start; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; }
.map-stop { display: flex; align-items: center; gap: 5px; background: var(--pale); color: var(--accent); padding: 4px 7px; border: 0; border-radius: 7px; min-height: 33px; text-align: left; font-size: .84rem; overflow-wrap: anywhere; }
.map-stop:hover, .map-stop[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #c897a5; }
.map-stop b { flex: none; background: var(--accent); border-radius: 50%; display: grid; place-items: center; color: white; width: 17px; height: 17px; font-size: .72rem; }
@media (max-width: 570px) {
  .leg-link, .map-stop { min-height: 40px; }
}
.saved-tab { display: inline-flex; align-items: center; gap: 6px; }
.saved-tab svg { width: 16px; height: 16px; }
.timeline-entry.visited .timeline-dot { background: #687d71; }
.visit-button[aria-pressed="true"] { background: #f3d8df; color: var(--accent-dark); }
.undo { border: 0; background: white; color: var(--accent); border-radius: 6px; padding: 3px 8px; margin-left: 5px; }
#clear-examples input { width: auto; accent-color: var(--accent); }
#clear-examples input + span { vertical-align: middle; }

.rail-examples, .rail-sources { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.rail-examples { margin-top: 12px; }
.rail-examples button { padding: 5px 8px; min-height: 35px; border-radius: 7px; border: 1px solid var(--line); background: white; color: var(--accent); font-size: .875rem; }
.rail-examples button:hover { background: var(--pale); }
.route-legs .walk-leg { border-left-color: #928496; }
@media (max-width: 570px) { .rail-examples button { min-height: 42px; } }

.map-toolbar { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 9px; padding: 0 22px 12px; }
.map-toolbar > div { display: grid; min-width: 0; gap: 4px; }
.map-toolbar label { font-size: .875rem; font-weight: 700; }
.map-toolbar select, .rail-catalog select { min-width: 0; width: 100%; padding: 7px 23px 7px 8px; border: 1px solid var(--line); border-radius: 8px; background-color: #fcf8f8; font: inherit; min-height: 42px; }
.map-stage { position: relative; height: clamp(300px, 46vw, 410px); background: #e9eee7; border-block: 1px solid var(--line); }
.day-map, .map-fallback { width: 100%; height: 100%; }
.day-map .maplibregl-canvas { outline-offset: -4px; }
.map-caption { display: grid; gap: 9px; padding: 11px 22px 13px; }
#map-status { color: var(--muted); font-size: .9rem; }
#map-reset, .map-external { justify-self: start; font-size: .875rem; }
.map-external { text-decoration: underline; text-underline-offset: 3px; color: var(--accent); }
.map-stops { margin: 0; max-height: 142px; overflow-y: auto; align-content: start; padding: 2px; }
.map-credits { display: flex; flex-wrap: wrap; gap: 3px 9px; font-size: .77rem; color: var(--muted); }
.map-credits a { text-decoration: underline; text-underline-offset: 2px; }
.map-pin {
  display: grid; place-items: center; min-width: 32px; height: 32px; border: 2px solid #fff; border-radius: 50%;
  background: #8f354f; color: white; font-weight: 800; box-shadow: 0 2px 8px #2d1a2770; padding: 0 4px;
}
.map-pin[aria-pressed="true"] { background: #252843; z-index: 2; outline: 2px solid #a84f68; }
.map-fallback { background-color: #f4f0f2; background-image: linear-gradient(#dfd6db66 1px, transparent 1px), linear-gradient(90deg, #dfd6db66 1px, transparent 1px); background-size: 24px 24px; }
.map-fallback canvas, .fallback-pins { inset: 0; position: absolute; width: 100%; height: 100%; }
.fallback-pins .map-pin { position: absolute; transform: translate(-50%, -50%); }
.map-fallback p { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 10px; background: #fffc; color: var(--muted); font-size: .82rem; }
.rail-catalog { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.rail-catalog summary, .rail-stop-details summary, .place-extra summary { cursor: pointer; color: var(--accent); font-weight: 700; min-height: 32px; }
.rail-catalog label { display: grid; gap: 4px; font-size: .875rem; margin: 8px 0; }
.rail-line { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; padding: 7px 8px; }
.rail-line summary { font-size: .9rem; line-height: 1.5; min-height: 26px; }
.rail-code { border-radius: 5px; background: var(--route-color); color: white; display: inline-block; min-width: 25px; text-align: center; font-size: .79rem; padding: 1px 4px; }
.station-list { list-style: none; padding: 0 4px; margin: 6px 0 2px; display: grid; gap: 0; max-height: 264px; overflow: auto; }
.route-legs .station-list li, .station-list li { display: block; position: relative; border: 0; border-left: 2px solid var(--route-color, #8e7885); padding: 4px 0 4px 12px; margin-left: 5px; background: transparent; font-size: .875rem; overflow-wrap: anywhere; }
.station-list li::before { content: ""; width: 8px; height: 8px; display: block; position: absolute; top: .74em; left: -5px; border-radius: 50%; background: var(--white); border: 2px solid var(--route-color, #8e7885); }
.station-list li:first-child, .station-list li:last-child { font-weight: 700; }
#place-dialog { width: min(590px, calc(100% - 24px)); }
#place-dialog .dialog-actions {
  position: sticky;
  bottom: -19px;
  z-index: 2;
  margin: 0 -19px -19px;
  padding: 8px 19px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.place-locator {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f6f7ee;
  border: 1px solid #e0e5d6;
  border-radius: 10px;
  min-width: 0;
}
.place-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.place-methods button, .place-discovery button, .place-map-shortcuts button {
  border: 1px solid #cdd9cc;
  color: var(--accent-dark);
  background: var(--paper);
  border-radius: 8px;
  min-height: 42px;
  padding: 4px 7px;
  font-size: .875rem;
  font-weight: 650;
}
.place-methods button { display: flex; align-items: center; justify-content: center; gap: 5px; }
.place-methods svg { width: 16px; height: 16px; flex-shrink: 0; }
.place-methods button[aria-pressed="true"] { background: #205c4d; border-color: #205c4d; color: #fffdf5; }
.place-picker-panel { display: grid; gap: 6px; min-width: 0; }
.place-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 6px; }
#place-lookup, #place-import { padding-inline: 9px; }
#place-use-maps-helper { justify-self: start; }
.maps-helper {
  display: grid;
  gap: 12px;
  max-width: 36rem;
  margin: 0 auto;
  padding: 24px;
}
.maps-helper h1, .maps-helper p { margin: 0; }
.maps-helper h1 { font-size: 1.4rem; }
#maps-helper-result { display: grid; gap: 10px; }
#maps-helper-url { padding: 8px; min-width: 0; font: inherit; }
#maps-helper-copy { justify-self: start; }
.place-map-shortcuts, .place-discovery { display: flex; flex-wrap: wrap; gap: 5px; }
.place-discovery button, .place-map-shortcuts button { min-height: 38px; border-radius: 20px; }
.place-discovery button:hover, .place-map-shortcuts button:hover { background: #e5efe4; }
.place-picker-map {
  position: relative;
  height: clamp(190px, 33dvh, 280px);
  border: 1px solid #d6e1d3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.place-picker-map .maplibregl-canvas-container { cursor: crosshair; }
.place-map-instructions, .place-picked { display: flex; align-items: center; gap: 7px; }
.place-map-instructions { justify-content: space-between; flex-wrap: wrap; }
#place-map-center { min-height: 38px; font-size: .8rem; }
.place-picked { padding: 7px 8px; color: var(--accent-dark); border-radius: 8px; background: #e8f0e4; overflow-wrap: anywhere; }
.place-picked > div { flex: 1; min-width: 0; }
.place-picked > i svg { width: 19px; height: 19px; }
.place-plan-fields { grid-template-columns: 1.3fr .7fr; }
.place-stations {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #d9e3d5;
  border-radius: 9px;
  background: #f2f6ed;
}
.place-stations h3 { font-size: .94rem; }
.nearby-stations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.nearby-stations button {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 48px;
  text-align: start;
  padding: 5px 7px;
  border: 1px solid #cfded1;
  border-radius: 7px;
  background: var(--paper);
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}
.nearby-stations button[aria-pressed="true"] { border-color: #387b65; background: #dceae0; }
.nearby-stations strong { font-size: .84rem; }
.nearby-stations small, .station-data-source { font-size: .75rem; color: var(--muted); }
.station-data-source { justify-self: start; text-decoration: underline; text-underline-offset: 2px; }
.place-extra summary { font-size: .875rem; }
.place-extra label { margin-top: 8px; }
.field-help { font-size: .875rem; color: var(--muted); }
.field-help:empty, .place-results:empty { display: none; }
.place-results { display: grid; grid-auto-rows: max-content; gap: 4px; max-height: min(240px, 31dvh); overflow: auto; }
.place-results button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  text-align: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 44px;
  padding: 5px 7px;
  overflow-wrap: anywhere;
}
.place-results small { display: block; color: var(--muted); line-height: 1.35; }
.place-result-pin { display: flex; color: var(--accent-dark); }
.place-result-pin svg { width: 17px; height: 17px; }
.place-results button:hover { border-color: var(--accent); }
.tabi-map-popup .maplibregl-popup-content, .map-place-fallback {
  padding: 9px;
  background: var(--paper);
  border-radius: 9px;
  border: 1px solid #d9dfd2;
  box-shadow: 0 3px 13px #17322638;
}
.map-place-fallback {
  position: absolute;
  z-index: 1;
  inset: 54px auto auto 12px;
  width: min(260px, calc(100% - 24px));
}
.place-popup-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.35;
}
.place-popup-card .place-symbol { inline-size: 32px; block-size: 32px; }
.place-popup-copy { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.place-popup-copy small { color: var(--muted); }
.place-popup-actions { display: flex; flex-wrap: wrap; column-gap: 8px; }
.place-popup-actions button, .place-popup-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.place-popup-card .place-popup-close { width: 28px; height: 28px; min-width: 28px; }
#place-detail-dialog {
  width: min(498px, calc(100% - 26px));
  position: fixed;
  display: none;
  padding: 0;
  border-radius: 18px;
  background: #fffef9;
}
#place-detail-dialog[open] { display: grid; }
#place-detail-dialog.with-photo { width: min(710px, calc(100% - 26px)); grid-template-columns: minmax(170px, 32%) minmax(0, 1fr); }
#place-detail-dialog::backdrop { background: #132a2338; }
.place-detail-close { position: absolute; top: 12px; right: 12px; z-index: 1; background: #fffef9; }
.place-detail-photo {
  position: relative;
  min-height: 170px;
  background: center / cover no-repeat;
}
.place-detail-photo[data-photo="castle"] { background-image: var(--osaka-cover); }
.place-detail-photo[data-photo="dotonbori"] { background-image: url("assets/dotonbori.jpg"); }
.place-detail-photo span {
  position: absolute;
  inset: auto auto 10px 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #142421d9;
  color: #fffdf5;
  font-size: .8rem;
}
.place-detail-body { display: grid; gap: 13px; min-width: 0; padding: 19px; }
.place-detail-header { display: grid; gap: 4px; padding-inline-end: 42px; }
.place-detail-header h2 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.65rem); overflow-wrap: anywhere; }
.place-detail-header p { margin: 0; }
.place-detail-tabs {
  display: flex;
  justify-self: start;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: #e9eee3;
}
.place-detail-tabs button {
  min-height: 40px;
  padding: 4px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #3b554b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.place-detail-tabs button[aria-selected="true"] { color: #174737; background: #fffef9; box-shadow: 0 1px 3px #1b352b21; }
.place-detail-panel { display: grid; align-content: start; gap: 9px; min-height: 110px; overflow-wrap: anywhere; }
.place-detail-panel p { margin: 0; }
.place-detail-panel a { justify-self: start; color: var(--accent-dark); }
.place-detail-day, .place-detail-address, .place-detail-hours { display: flex; align-items: start; gap: 7px; }
.place-detail-panel svg { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.place-detail-day { background: #e7efe2; color: #214f3e; padding: 8px 9px; border-radius: 8px; font-weight: 700; }
.place-detail-address svg, .place-detail-hours svg { color: #9c432d; }
.place-detail-hours { font-weight: 700; }
.place-detail-info { display: grid; gap: 4px; margin: 0; }
.place-detail-info div { display: grid; gap: 2px; padding: 5px 0; border-top: 1px solid var(--line); }
.place-detail-info dt, .place-detail-meta { color: var(--muted); font-size: .875rem; }
.place-detail-info dd { margin: 0; overflow-wrap: anywhere; }
#place-detail-dialog .dialog-actions { flex-wrap: wrap; }
@media (min-width: 1100px) {
  #place-detail-dialog { inset: auto clamp(24px, 4vw, 76px) 84px auto; margin: 0; max-height: calc(100dvh - 132px); }
}
@media (max-width: 620px) {
  #place-detail-dialog {
    inset: auto 0 calc(76px + env(safe-area-inset-bottom)) 0;
    margin: 0 auto;
    max-height: calc(100dvh - 98px - env(safe-area-inset-bottom));
  }
  #place-detail-dialog.with-photo { grid-template-columns: minmax(0, 1fr); }
  .place-detail-photo { min-height: 0; height: clamp(115px, 20dvh, 168px); }
  .place-detail-body { padding: 14px; gap: 10px; }
  .place-detail-tabs button { padding-inline: 8px; }
  #place-detail-dialog .dialog-actions {
    position: sticky;
    bottom: 0;
    margin: 0 -14px -14px;
    padding: 8px 14px 11px;
    border-top: 1px solid var(--line);
    background: #fffef9;
  }
}
#route-dialog .dialog-actions { flex-wrap: wrap; justify-content: flex-start; }
#route-dialog .dialog-actions .primary { margin-left: 0; }
#route-hint { color: var(--ink); font-weight: 750; }
.route-steps { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.route-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 7px 10px;
  border-inline-start: 3px solid var(--route-color, #247466);
  border-radius: 5px;
  background: var(--pale);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.route-steps strong, .route-steps small, .route-step-stations, .route-step-time { display: block; }
.route-step-stations, .route-steps small { color: var(--muted); }
.route-step-time { font-weight: 650; }
.route-step-icon { display: flex; align-items: center; color: var(--route-color, #247466); }
.route-step-icon svg { width: 18px; height: 18px; }
@media (max-width: 570px) {
  .map-toolbar, .map-caption { padding-inline: 12px; }
  .map-stage { height: 333px; }
  .map-link svg { display: none; }
}

.library-hero { min-height: 198px; }
.library-body { padding: 5px 0 12px; }
.library-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.library-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.library-search { width: min(305px, 100%); margin-bottom: 0; background: var(--white); }
.trip-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.trip-list > .empty { grid-column: 1 / -1; border: 1px solid var(--line); background: var(--white); }
.trip-card { position: relative; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.trip-card:focus-within, .trip-card:hover { border-color: #c796a0; }
.trip-card-cover { height: 108px; position: relative; padding: 13px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; background: linear-gradient(155deg, #292a46 0%, #403048 50%, #743e56 100%); color: white; }
.trip-card-cover.kansai-cover { background: linear-gradient(90deg, #2829419c, #392d4990), var(--osaka-cover) center 54% / cover; }
.trip-card-location { display: inline-flex; align-items: center; gap: 5px; align-self: flex-end; text-align: right; overflow-wrap: anywhere; font-size: .88rem; font-weight: 700; }
.trip-card-location svg, .trip-card-stats svg { width: 15px; height: 15px; }
.trip-status { display: inline-flex; align-items: center; border-radius: 20px; padding: 5px 10px; font-size: .83rem; white-space: nowrap; font-weight: 700; width: fit-content; }
.trip-status.planning { background: #f7e8ec; color: #803649; }
.trip-status.completed { background: #e6f3ea; color: #305942; }
.trip-card-body { padding: 13px 15px 16px; overflow-wrap: anywhere; }
.trip-card-body h2 { font-size: 1.13rem; }
.trip-card-body h2 button { border: 0; padding: 0; background: transparent; text-align: left; font: inherit; }
.trip-card-body h2 button::after { content: ""; position: absolute; inset: 0; }
.trip-card-body p { margin-top: 3px; font-size: .875rem; color: var(--muted); }
.trip-card-stats { display: flex; gap: 6px 13px; flex-wrap: wrap; margin-top: 16px; color: var(--accent); font-size: .83rem; }
.trip-card-stats span { display: flex; align-items: center; gap: 4px; }
.library-backup { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 0; color: var(--muted); font-size: .875rem; }
.trip-masthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 19px 23px; margin-top: 20px; border-radius: 14px; background: #252843; color: white; }
.trip-masthead > div { min-width: 0; overflow-wrap: anywhere; }
.trip-masthead h1 { margin: 5px 0 3px; font-size: clamp(1.55rem, 3.6vw, 2.32rem); line-height: 1.32; }
.trip-masthead p { color: #f0dee6; font-size: .94rem; }
.trip-masthead p:empty { display: none; }
.library-back { color: #f0dee6; font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; }
.trip-overview { display: grid; gap: 16px; }
.overview-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: start; gap: 16px; }
.trip-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.summary-cell { display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: white; min-width: 0; overflow-wrap: anywhere; }
a.summary-cell:hover { border-color: #c796a0; background: #fffafb; }
.summary-cell svg { color: var(--accent); width: 17px; height: 17px; }
.summary-cell span { font-size: .875rem; color: var(--muted); }
.summary-cell strong, .summary-cell small { grid-column: 1 / -1; }
.summary-cell strong { font-size: clamp(1rem, 2vw, 1.32rem); color: var(--accent-dark); }
.summary-cell small { font-size: .82rem; color: var(--muted); }
.journal-section { padding: 17px 19px; min-width: 0; }
.journal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.journal-head h2 { font-size: 1.18rem; }
.journal-head p { color: var(--muted); font-size: .88rem; }
.journal-head .button { flex: none; }
.journal-list { display: grid; gap: 8px; }
.journal-row { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: 9px 10px; }
.journal-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.journal-copy h3 { font-size: 1rem; }
.journal-copy p { color: var(--muted); font-size: .875rem; }
.journal-copy .entry-note, .trip-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-row > input { flex: none; width: 19px; height: 19px; accent-color: var(--accent); }
.journal-done h3 { text-decoration: line-through; }
.expense-summary { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 14px; }
.expense-summary .summary-cell { background: #fcf8f8; }
.expense-amount { color: var(--accent-dark); white-space: nowrap; font-size: .88rem; }
.standalone-workspace { grid-template-columns: minmax(0,1fr); }
.standalone-tool .rail { max-width: 660px; width: 100%; }
.standalone-tool .map-stage { height: clamp(335px, 55vw, 550px); }
.trip-form-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 850px) {
  .trip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 570px) {
  .library-hero { min-height: 158px; }
  .library-hero .hero-subtitle { max-width: 195px; }
  .library-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .library-search { width: 100%; }
  .trip-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .trip-card-cover { height: 82px; }
  .trip-masthead { padding: 12px; margin-top: 11px; margin-bottom: 13px; border-radius: 11px; }
  .trip-masthead .trip-status { font-size: .76rem; white-space: normal; text-align: center; }
  .trip-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-cell { padding: 10px; }
  .journal-section { padding: 12px; }
  .journal-head p { font-size: .84rem; }
  .journal-row { padding: 7px; gap: 4px; }
}

/* Trip navigation and trip-reading layout */
:root {
  --page: #f4f6fa;
  --ink: #233147;
  --muted: #59687d;
  --line: #dce3ee;
  --accent: #365996;
  --accent-dark: #284579;
  --pale: #edf2fc;
  --route: #355697;
  --elevated: #fcfdff;
}
.site-header { background: #fff; }
.brand-icon { background: #303e64; }
.brand-japan { color: var(--accent); }
.header-inner { min-height: 64px; }
.header-inner > nav { gap: 4px; }
.header-inner > nav a[aria-current] { background: var(--pale); color: var(--accent-dark); }
.library-hero { min-height: 188px; background: #242d48; }
.library-hero::before { background-image: linear-gradient(90deg, #242d48, #242d4800 55%), var(--osaka-cover); }
.trip-card-cover { background: linear-gradient(155deg, #354465 0%, #3a4e72 62%, #54698d 100%); }
.trip-card:focus-within, .trip-card:hover { border-color: #a0b4d7; }
.trip-status.planning { background: #e2ebfb; color: #304f84; }
.trip-status.completed { background: #e2f3ed; color: #2b6356; }
.trip-masthead {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 130px; padding: 15px 22px; margin: 18px 0 15px; border-radius: 12px;
  background: #273451; color: white; align-items: center;
}
.trip-masthead.trip-photo::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 38%;
  background: linear-gradient(90deg, #273451, #27345112 82%), var(--osaka-cover) center 54% / cover;
}
.trip-masthead h1 { font-size: clamp(1.45rem, 3.15vw, 2.1rem); margin: 6px 0 3px; }
.trip-masthead p, .library-back { color: #e1e9f7; }
.trip-masthead .trip-status { align-self: flex-start; flex: none; }
.trip-layout { display: grid; grid-template-columns: 174px minmax(0, 1fr); align-items: start; gap: 17px; }
.trip-content { min-width: 0; }
.trip-overview { gap: 13px; }
.trip-summary { gap: 9px; }
.summary-cell { padding: 13px 12px; gap: 4px 7px; }
.summary-cell svg, .tile {
  color: var(--accent-dark); background: var(--pale);
}
.summary-cell svg { width: 25px; height: 25px; padding: 4px; border-radius: 6px; }
.summary-cell strong { font-variant-numeric: tabular-nums; }
a.summary-cell:hover { border-color: #a7b8d7; background: #f7faff; }
.overview-grid { gap: 13px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.panel { border-radius: 13px; }

.workspace { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 13px; }
.workspace.standalone-workspace { grid-template-columns: minmax(0, 1fr); }
.workspace:not(.standalone-workspace) .travel-tools { position: sticky; top: 79px; }
.day-mobile-switch { display: none; }
.panel-head { padding: 15px 15px 13px; }
.days-wrap, .plan-body, .panel-foot { padding-inline: 15px; }
.days { gap: 6px; }
.day, .category-filters button { background: #f8fafd; }
.day[aria-pressed="true"], .category-filters button[aria-pressed="true"] {
  background: var(--pale); border-color: #a6b9da; color: #294779;
}
.day-card { min-width: 62px; min-height: 49px; display: grid; place-content: center; text-align: center; gap: 1px; padding: 4px 8px; }
.day-card strong { line-height: 1.3; }
.day-card span { font-weight: 500; color: var(--muted); font-size: .76rem; }
.day-card span { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-add { border-color: #b7c6df; }
.day-head { margin-bottom: 11px; }
.day-head > span { flex: none; }
.timeline-entry { grid-template-columns: 43px 18px minmax(0,1fr); }
.timeline-time { color: var(--accent-dark); }
.timeline-track::after { background: #d2def1; }
.timeline-dot { background: var(--route); box-shadow: 0 0 0 3px #eff3fb; }
.place-card { border-color: #dce4ef; background: #fff; gap: 5px; padding: 9px 10px; min-height: 65px; }
.place-actions { flex: none; }
.place-actions .icon-button { background: #f5f7fc; }
.place-actions .icon-button:hover, .visit-button[aria-pressed="true"] { background: #e1ebfb; }
.place-meta .tag { background: #eaf0fb; color: #3b5684; }
.place-meta .tag.food { background: #fff1df; color: #74482b; }
.leg-link { background: #edf2fc; color: var(--accent-dark); }
.leg-link:hover { background: #e0eafa; }
.map-toolbar, .map-caption { padding-inline: 15px; }
.map-stage { height: clamp(350px, 52vh, 525px); }
.map-pin { background: #395a99; box-shadow: 0 2px 8px #22365d64; }
.map-pin[aria-pressed="true"] { background: #183363; outline-color: #89a4d3; }
.map-stop { background: #edf2fc; color: var(--accent-dark); }
.map-stop:hover, .map-stop[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #91a8ce; }
.map-stop b { background: var(--route); }
#map-status { padding: 7px 9px; background: #edf2fc; color: #2d4a7c; border-radius: 7px; font-weight: 700; }
.map-toolbar select, .rail-catalog select, .rail-field { background-color: #f8fafd; }

.category-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 13px;
}
.category-filters button, .scheduled-day, .day-mobile-switch button {
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; min-height: 38px;
  font-weight: 650; font-size: .875rem; color: var(--ink); white-space: nowrap;
}
.category-filters button:hover, .scheduled-day:hover { border-color: #98aed0; background: var(--pale); }
.category-filters button span { color: var(--muted); font-size: .78rem; margin-left: 2px; }
.saved-section + .saved-section { margin-top: 18px; }
.saved-section > h4 { display: flex; align-items: center; gap: 7px; font-size: 1rem; margin: 0 0 8px; }
.saved-section > h4 span { color: var(--accent-dark); background: var(--pale); padding: 0 7px; border-radius: 6px; font-size: .78rem; }
.saved-place-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 7px; }
.place-symbol, .entry-symbol {
  flex: none; display: grid; place-items: center; border-radius: 8px;
  width: 32px; height: 32px; background: var(--pale); color: var(--accent-dark);
}
.place-symbol svg, .entry-symbol svg { height: 17px; width: 17px; }
.scheduled-day { font-size: .8rem; background: var(--white); color: var(--accent-dark); }
.journal-section { padding: 16px; }
.journal-row { border-color: #dce4ef; }
.journal-empty-link { display: block; color: var(--accent-dark); }
.journal-empty-link:hover { background: var(--pale); }
.journal-copy .tag { display: inline-block; margin: 3px 0 1px; }
.expense-summary .summary-cell { background: var(--pale); }
.expense-group { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.expense-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; min-height: 41px; background: #f1f5fc; cursor: pointer; color: var(--accent-dark); font-weight: 700; }
.expense-group-label::before { content: "▸"; margin-inline-end: 5px; }
.expense-group[open] .expense-group-label::before { content: "▾"; }
.expense-group summary small { font-size: .78rem; font-weight: 500; color: var(--muted); padding-left: 3px; }
.expense-group-label { flex: 1 1 auto; min-width: 0; }
.expense-group-totals { display: grid; gap: 1px; flex: 0 1 auto; min-width: 0; text-align: end; overflow-wrap: anywhere; }
.expense-group-totals small:empty { display: none; }
.expense-group-baht { font-variant-numeric: tabular-nums; }
.expense-group > .journal-list { padding: 8px; }
.empty { background: #f4f6fa; }

@media (max-width: 1060px) and (min-width: 901px) {
  .trip-layout { gap: 11px; grid-template-columns: 146px minmax(0,1fr); }
  .workspace { grid-template-columns: minmax(0,1fr) minmax(0,.85fr); gap: 8px; }
  .place-card .place-actions { flex-basis: 100%; justify-content: flex-start; }
  .place-card { flex-wrap: wrap; gap: 1px; }
  .saved-place-card { grid-template-columns: 29px minmax(0,1fr); }
  .saved-place-card .place-actions { grid-column: 2; }
}
@media (max-width: 900px) {
  .trip-layout { display: block; }
  .workspace, .workspace.standalone-workspace { grid-template-columns: minmax(0,1fr); }
  .workspace:not(.standalone-workspace) .travel-tools { position: static; }
  .day-mobile-switch { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; padding: 4px; background: white; border: 1px solid var(--line); border-radius: 9px; }
  .day-mobile-switch button { display: flex; justify-content: center; align-items: center; gap: 6px; background: transparent; border-color: transparent; }
  .day-mobile-switch button[aria-pressed="true"] { background: var(--pale); color: var(--accent-dark); }
  .day-mobile-switch svg { width: 17px; height: 17px; }
  .workspace:not(.standalone-workspace)[data-day-view="list"] .travel-tools,
  .workspace:not(.standalone-workspace)[data-day-view="map"] .itinerary { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .header-inner { min-height: auto; }
  .trip-masthead { margin: 11px 0 10px; padding: 11px 13px; min-height: 98px; }
  .trip-masthead.trip-photo::before { inset-inline-start: 29%; background-image: linear-gradient(90deg, #273451, #273451a0 90%), var(--osaka-cover); }
  .trip-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { gap: 10px; }
  .panel-head, .journal-section { padding: 11px; }
  .days-wrap, .plan-body, .panel-foot, .map-toolbar, .map-caption { padding-inline: 11px; }
  .map-stage { height: clamp(335px, 54vh, 460px); }
  .timeline-entry { grid-template-columns: 42px 14px minmax(0,1fr); }
  .place-card { gap: 5px; }
  .place-card .place-actions { flex: 1 1 100%; gap: 5px; }
  .place-card .place-actions .icon-button { width: 37px; height: 37px; }
  .saved-place-card { grid-template-columns: 30px minmax(0,1fr); }
  .saved-place-card .place-actions { grid-column: 2; justify-content: start; }
  .category-filters button { min-height: 41px; }
  .summary-cell { padding: 10px; }
  .entry-symbol { display: none; }
}

/* The visual treatment follows a travel journal: panoramic cover, photo
   illustrations for place types, and a map canvas next to the daily record. */
:root {
  --page: #f5f4ee;
  --ink: #202e28;
  --muted: #53615a;
  --line: #dddfd4;
  --accent: #1b6757;
  --accent-dark: #114b40;
  --pale: #e9f1e8;
  --route: #a64836;
  --paper: #fffef9;
  --rust: #a54b36;
}
.site-header { background: #fffefb; box-shadow: 0 1px 0 #1c382613; }
.brand-icon { border-radius: 13px 13px 13px 5px; background: #135a4c; }
.brand-japan { color: #226d5c; }
.header-inner { min-height: 66px; }
.header-inner > nav a[aria-current] { background: #ebf2e6; }
.outline { background: var(--paper); }
.primary { background: #1b6757; color: #fffef9; }
.primary:hover { background: #124c40; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline-color: #a74a29; }
.library-hero, .trip-masthead {
  position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid #102b1d31; border-radius: 21px; color: #fffef4;
  background: #1d493b; box-shadow: 0 13px 31px #333e261a;
}
.library-hero {
  display: flex; align-items: flex-end; min-height: clamp(230px, 27vw, 333px);
  padding: 28px clamp(17px, 3.6vw, 43px); margin-top: 20px; margin-bottom: 21px;
}
.library-hero::before, .trip-masthead.trip-photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(88deg, #102e26eb 0%, #102e26ad 37%, #122b2430 72%, #162d1e22 100%),
    linear-gradient(0deg, #102e26bb, transparent 64%), var(--osaka-cover) center 48% / cover no-repeat;
}
.library-hero h1 {
  font-size: clamp(2.05rem, 5.3vw, 4.1rem); line-height: 1.12; margin: 0 0 9px;
  text-wrap: balance;
}
.library-hero .hero-subtitle { color: #fff5dc; font-size: clamp(.96rem, 1.85vw, 1.13rem); margin-bottom: 13px; }
.hero-button { background: #fff9e9; color: #164b3e; min-height: 42px; padding-inline: 13px; }
.library-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.import-trip-button { background: #173f33; border: 1px solid #fff9e9a6; color: #fff9e9; }
.import-trip-button:hover { background: #245c49; color: #fff9e9; }
.hero-location { background: #23362bd4; padding: 5px 8px; bottom: 14px; right: 14px; }
.trip-masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  min-height: clamp(190px, 23vw, 292px); padding: 20px clamp(14px, 3vw, 34px);
  margin: 16px 0 14px;
}
.trip-masthead:not(.trip-photo) {
  background:
    radial-gradient(ellipse at 81% 100%, #95855a70, transparent 46%),
    repeating-linear-gradient(165deg, #215848 0 30px, #205444 30px 31px, #225846 31px 47px);
}
.trip-masthead .library-back {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  font-size: .875rem; line-height: 1.1; color: #fff5dc; text-decoration: none;
}
.library-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.library-back svg { width: 15px; height: 15px; }
.trip-masthead h1 {
  font-size: clamp(1.73rem, 3.65vw, 3.1rem); font-weight: 850;
  margin: 10px 0 4px; letter-spacing: -.028em; line-height: 1.16;
}
.trip-masthead p { color: #fff0dc; margin-top: 8px; }
.trip-masthead .trip-status { flex: none; box-shadow: 0 2px 10px #14251a38; }
.trip-status.planning { background: #f9eed2; color: #634929; }
.trip-status.completed { background: #e2f0d9; color: #284f3b; }
.compact-header .trip-masthead { min-height: 89px; padding-block: 11px; border-radius: 15px; }
.compact-header .trip-masthead h1 { font-size: clamp(1.22rem, 2.17vw, 1.8rem); margin-top: 4px; }
.compact-header .trip-masthead p { margin-top: 2px; font-size: .85rem; }

.library-body { padding-top: 0; }
.library-tools { padding: 11px 12px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.library-search { background: #f7f8f1; }
.trip-card { border-radius: 15px; background: var(--paper); box-shadow: 0 5px 16px #2734260c; }
.trip-card:focus-within, .trip-card:hover { border-color: #89a997; }
.trip-card-cover { height: clamp(104px, 13vw, 155px); background: linear-gradient(145deg, #b7aa74, #53654c 49%, #284a3e); }
.trip-card-cover.kansai-cover { background: linear-gradient(180deg, #131e1225, #1c352440), var(--osaka-cover) center 50% / cover; }
.trip-card-location { background: #193e2fcd; padding: 3px 7px; border-radius: 6px; }
.trip-card-body { padding: 13px 15px 15px; }
.trip-card-body h2 { font-size: 1.19rem; }

.trip-layout { display: block; }
.trip-overview { gap: 14px; }
.trip-summary { gap: 10px; }
.summary-cell {
  grid-template-columns: 1fr auto; background: var(--paper); border-color: #dfe0d1;
  border-radius: 15px; padding: 13px 14px; min-height: 94px;
  row-gap: 1px;
}
.summary-cell svg {
  order: 2; width: 29px; height: 29px; padding: 5px; grid-row: 1; grid-column: 2;
  border-radius: 40%; background: #ebf1e4; color: #305e47;
}
.summary-cell > span { grid-column: 1; grid-row: 1; color: #53605a; font-weight: 650; }
.summary-cell strong { color: #254d3c; line-height: 1.15; font-size: clamp(1.15rem, 2.9vw, 1.8rem); }
.summary-cell small { color: var(--muted); }
.summary-places svg, .summary-spend svg { background: #f5e8d4; color: #874c34; }
.summary-tasks svg { background: #ede6ee; color: #694971; }
a.summary-cell:hover { background: #fcfaed; border-color: #a5b39c; }
.panel { background: var(--paper); border-color: #dfe0d4; border-radius: 16px; box-shadow: 0 4px 14px #2a3c2410; }
.journal-row, .place-card { background: var(--paper); border-color: #e0e1d4; }
.journal-head h2, .heading-group h2 { color: #234439; }
.overview-grid { gap: 15px; }
.overview-notes { background: #fff9eb; }
.overview-notes .trip-notes { padding: 2px 0 4px 9px; border-left: 2px solid #dfb982; }
.empty, .journal-empty-link { background: #f2f3e9; color: #52604f; }

.workspace { grid-template-columns: minmax(348px, .84fr) minmax(0, 1.22fr); gap: 14px; }
.workspace.standalone-workspace { grid-template-columns: minmax(0, 1fr); }
.workspace:not(.standalone-workspace) .travel-tools { top: 136px; }
.panel-head { padding: 14px; }
.days-wrap, .plan-body, .panel-foot { padding-inline: 14px; }
.tile { color: #285947; background: #e8efe3; }
.tile.warm { background: #f8ecd8; color: #885339; }
.day-card { min-height: 53px; min-width: 72px; padding: 6px 9px; background: #f6f7ee; border-color: #e1e3d7; border-radius: 11px; }
.day-card span { font-size: .79rem; color: #536051; }
.day-card[aria-pressed="true"] { color: #fffdf5; background: #205c4d; border-color: transparent; }
.day-card[aria-pressed="true"] span { color: #f0ead1; }
.day-add { border-color: #a9bdaf; }
.timeline-entry { grid-template-columns: 42px 21px minmax(0,1fr); }
.timeline-time { color: #315848; }
.timeline-track::after { background: #e5d0ae; width: 2px; }
.timeline-dot { width: 21px; height: 21px; color: #fffdf6; background: #a64b37; box-shadow: 0 0 0 2px #faebd8; margin-top: -5px; }
.timeline-entry.visited .timeline-dot { background: #426d58; }
.place-card { min-height: 71px; border-radius: 11px; padding: 8px 9px; gap: 7px; }
.place-copy h4 { line-height: 1.3; }
.place-meta .tag, .journal-copy .tag { background: #eaf0df; color: #4b6042; }
.place-meta .tag.food { background: #f9ebd7; color: #78462e; }
.place-actions .icon-button, .journal-row .icon-button { background: #f3f5eb; }
.place-actions .icon-button:hover, .visit-button[aria-pressed="true"] { background: #e0ecd9; }
.item-stamp {
  width: 41px; height: 41px; border-radius: 9px; background-color: #e8eddf; color: #315c49;
  display: grid; place-items: center; flex: none;
}
.item-stamp svg { width: 18px; height: 18px; }
.item-stamp.art-rail {
  background-image: var(--place-art); background-size: 200% 200%; background-repeat: no-repeat;
  border: 1px solid #271b1010;
}
.item-stamp.art-rail { background-position: right bottom; }
.item-stamp.art-rail svg { visibility: hidden; }
.item-stamp.place-symbol { background: #f5ead7; color: #a34931; }
.item-stamp.place-symbol svg { width: 22px; height: 22px; }
.saved-place-card { grid-template-columns: 41px minmax(0,1fr) auto; }
.saved-section > h4 span { background: #f1ebd9; color: #765237; }
.leg-link { background: #f6ecd7; color: #754832; border-radius: 8px; }
.leg-link:hover { background: #f0e0c0; }
.day[aria-pressed="true"]:not(.day-card), .category-filters button[aria-pressed="true"], .day-mobile-switch button[aria-pressed="true"] {
  background: #e8efe3; color: #255a45; border-color: #a9c3ae;
}
.day:not(.day-card), .category-filters button, .saved-search, .rail-field, .map-toolbar select { background: #f8f8ef; }
.map-stage { height: clamp(365px, 57vh, 610px); }
.map-stage, .map-caption { border-color: #e3e5d6; }
#map-status { background: #eaf1e5; color: #2e5841; border-radius: 9px; }
.map-stop { background: #eef2e7; color: #285445; }
.map-stop b { background: var(--route); }
.map-stop:hover, .map-stop[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #8aad95; }
.map-pin { background: #ab4c32; box-shadow: 0 2px 9px #42291f6e; }
.map-pin[aria-pressed="true"] { background: #1d644f; outline-color: #96b7a6; }
.expense-summary .summary-cell, .expense-group > summary { background: #ecf2e5; }
.expense-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.expense-summary .expense-equivalent { background: #f9edd6; border-color: #e1d0af; }
.expense-equivalent small:empty { display: none; }
.expense-rate-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.expense-amount-stack { display: grid; justify-items: end; flex: none; text-align: end; }
.expense-exchange { display: grid; color: var(--muted); font-size: .72rem; }
.expense-exchange strong { color: var(--accent-dark); font-size: .8rem; }
.exchange-panel {
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #d6dfd6;
  border-radius: 10px;
  background: #fbfaf5;
}
.exchange-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.exchange-head h3 { font-size: .95rem; }
#exchange-quote { color: var(--accent-dark); font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
#exchange-quote:empty { display: none; }
#exchange-refresh { white-space: nowrap; }
.exchange-source { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.exchange-source, .exchange-result span { font-size: .8rem; color: var(--muted); }
.exchange-source a { text-decoration: underline; text-underline-offset: 2px; }
.exchange-calculator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); gap: 8px; margin-top: 9px; align-items: stretch; }
.exchange-calculator label { min-width: 0; display: grid; align-content: start; gap: 3px; font-size: .84rem; color: var(--ink); }
.exchange-calculator input, .exchange-calculator select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid #bdcbc0;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.exchange-result {
  display: grid;
  align-content: center;
  padding: 6px 9px;
  border-radius: 7px;
  background: #ecf2e5;
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .expense-summary, .exchange-calculator { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-equivalent, .exchange-result { grid-column: 1 / -1; min-height: 0; }
}

@media (max-width: 1030px) and (min-width: 901px) {
  .workspace { grid-template-columns: minmax(310px, .89fr) minmax(0, 1fr); }
  .place-card .place-actions { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .workspace, .workspace.standalone-workspace { grid-template-columns: minmax(0,1fr); }
  .workspace:not(.standalone-workspace) .travel-tools { position: static; }
  .map-stage { height: clamp(340px, 54vh, 500px); }
  .day-mobile-switch { background: var(--paper); border-radius: 11px; }
}
@media (max-width: 600px) {
  .header-inner { min-height: auto; }
  .library-hero { min-height: 206px; padding: 14px 12px 36px; margin: 11px 0; border-radius: 15px; }
  .library-hero::before, .trip-masthead.trip-photo::before {
    background-image: linear-gradient(93deg, #163528e0, #1736275c 83%), linear-gradient(0deg, #18372799, transparent 55%), var(--osaka-cover);
  }
  .hero-location { bottom: 5px; right: 6px; }
  .trip-masthead { min-height: 189px; padding: 13px; margin-top: 10px; border-radius: 15px; gap: 7px; }
  .trip-masthead h1 { font-size: clamp(1.48rem, 7vw, 1.92rem); }
  .trip-masthead .trip-status { font-size: .71rem; padding: 3px 6px; }
  .compact-header .trip-masthead { min-height: 80px; }
  .compact-header .trip-masthead p { font-size: .82rem; }
  .overview-grid { gap: 11px; }
  .summary-cell { min-height: 86px; padding: 9px; }
  .place-card { gap: 5px; }
  .timeline-entry { grid-template-columns: 39px 18px minmax(0,1fr); }
  .timeline-dot { width: 18px; height: 18px; }
  .item-stamp { width: 33px; height: 33px; }
  .saved-place-card { grid-template-columns: 33px minmax(0,1fr); }
  .journal-row .entry-symbol { display: grid; }
}

@media (max-width: 600px) {
  .timeline-entry { grid-template-columns: 43px 18px minmax(0,1fr); }
  .timeline-detail .place-card { display: grid; grid-template-columns: 33px minmax(0,1fr); align-items: start; column-gap: 8px; }
  .timeline-detail .place-actions { grid-column: 2; }
}

.trip-taskbar {
  --bar-padding: 5px;
  --taskbar-cols: 6;
  --active-tab: 0;
  position: fixed;
  z-index: 6;
  inset-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 52rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(var(--taskbar-cols), minmax(0, 1fr));
  padding: var(--bar-padding);
  border: 1px solid #d6ded5;
  border-radius: 38px;
  background: #fffefa;
  box-shadow: 0 8px 30px #172b2233, 0 2px 5px #172b2210;
  isolation: isolate;
}
.trip-taskbar::before {
  content: "";
  position: absolute;
  inset-block: var(--bar-padding);
  inset-inline-start: var(--bar-padding);
  width: calc((100% - 2 * var(--bar-padding)) / var(--taskbar-cols));
  border-radius: 29px;
  background: linear-gradient(150deg, #256f60, #15594d);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transform: translateX(calc(var(--active-tab) * 100%));
  transition: transform 215ms ease, opacity 150ms ease;
}
.trip-taskbar[data-active]::before { opacity: 1; }
.trip-taskbar a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 51px;
  min-width: 0;
  padding: 4px;
  border-radius: 29px;
  font-size: .88rem;
  color: #3f554b;
  white-space: nowrap;
}
.trip-taskbar a:hover { background: #edf3e8; color: #205946; }
.trip-taskbar a[aria-current] { background: transparent; color: #fffdf1; }
.trip-taskbar a:focus-visible { outline-offset: -3px; }
.nav-medallion {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #edf1e7;
  color: #245c4c;
}
.nav-medallion svg { width: 19px; height: 19px; }
.trip-taskbar a:is([href="#saved"], [href="#expenses"]) .nav-medallion { background: #f7ead6; color: #79452e; }
.trip-taskbar a:is([href="#bookings"], [href="#plan"]) .nav-medallion { background: #ece9f3; color: #5c497d; }
.trip-taskbar a[aria-current] .nav-medallion { background: #fff4dc; color: #1a5849; }

body.has-trip-taskbar {
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}
html:has(body.has-trip-taskbar) {
  scroll-padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}
body.has-trip-taskbar .toast {
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 650px) {
  .trip-taskbar {
    --bar-padding: 3px;
    inset-inline: max(6px, env(safe-area-inset-left, 0px)) max(6px, env(safe-area-inset-right, 0px));
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
  }
  .trip-taskbar::before { border-radius: 15px; }
  .trip-taskbar a {
    flex-direction: column;
    gap: 3px;
    border-radius: 15px;
    min-height: 50px;
    padding: 2px 0;
    font-size: .69rem;
    line-height: 1.2;
  }
  .nav-medallion { width: 26px; height: 26px; }
  .nav-medallion svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .trip-taskbar::before { transition: none; }
}

@media (max-width: 650px) {
  body.has-mobile-timeline { padding-bottom: 0; }
  body.has-mobile-timeline .site-footer,
  body.has-mobile-timeline .trip-masthead { display: none; }
  html:has(body.has-mobile-timeline) { overflow: hidden; overscroll-behavior: none; }

  #day-workspace.mobile-timeline {
    display: block;
    position: fixed;
    z-index: 2;
    inset: var(--sheet-header, 100px) 0 0;
    overflow: hidden;
    isolation: isolate;
    background: #edece3;
  }
  #day-workspace.mobile-timeline .travel-tools {
    display: block;
    position: absolute;
    inset: 0;
  }
  .mobile-timeline .map-panel {
    position: absolute;
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .mobile-timeline .map-stage {
    position: absolute;
    inset: 0;
    height: auto;
    border: 0;
  }
  .mobile-timeline .map-panel > .panel-head {
    position: absolute;
    z-index: 2;
    inset: 9px 9px auto auto;
    padding: 0;
  }
  .mobile-timeline .map-panel > .panel-head .heading-group {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .mobile-timeline .map-link {
    min-height: 41px;
    padding: 6px 10px;
    background: var(--paper);
    box-shadow: 0 2px 6px #23362d24;
  }
  .mobile-timeline .map-toolbar {
    position: absolute;
    z-index: 2;
    inset: 9px 95px auto 9px;
    padding: 0;
    gap: 5px;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
  .mobile-timeline .map-toolbar label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .mobile-timeline .map-toolbar select {
    min-height: 41px;
    font-size: .875rem;
    background-color: var(--paper);
    box-shadow: 0 2px 6px #23362d24;
  }
  .mobile-timeline .maplibregl-ctrl-top-right { top: 51px; }
  .mobile-timeline .maplibregl-ctrl-bottom-right { top: 53px; left: 0; right: 50px; bottom: auto; }
  .mobile-timeline .maplibregl-ctrl-bottom-right .maplibregl-ctrl {
    float: left;
    max-width: calc(100% - 7px);
    margin: 4px 0 0 7px;
  }
  .mobile-timeline .map-fallback p {
    top: 53px;
    bottom: auto;
    right: auto;
    max-width: 75%;
    border-radius: 0 5px 5px 0;
  }

  #day-workspace.mobile-timeline .itinerary {
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 3;
    bottom: var(--sheet-bottom, 69px);
    inset-inline: 0;
    height: var(--sheet-height, 48%);
    overflow: hidden;
    border: 1px solid #d5ddd2;
    border-radius: 21px 21px 12px 12px;
    box-shadow: 0 -5px 24px #163a2d26;
    transition: height 225ms cubic-bezier(.22, .75, .28, 1);
  }
  #day-workspace.mobile-timeline .itinerary[data-dragging] { transition: none; }
  .timeline-grip {
    display: grid;
    place-items: center;
    width: 100%;
    flex: 0 0 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .timeline-grip:focus-visible { outline-offset: -4px; }
  .timeline-grip span {
    width: 44px;
    height: 5px;
    border-radius: 10px;
    background: #84978b;
    pointer-events: none;
  }
  .mobile-timeline .itinerary > .panel-head { flex: none; padding: 1px 12px 8px; }
  .mobile-timeline .timeline-sheet-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .mobile-timeline .timeline-sheet-content .days-wrap {
    position: sticky;
    z-index: 2;
    top: 0;
    padding-block: 5px 9px;
    background: var(--paper);
  }
  .mobile-timeline .timeline-sheet-content .plan-body { padding-block: 11px 6px; }
  .mobile-timeline .timeline-sheet-content .map-caption { padding-block: 6px 12px; }

  @media (prefers-reduced-motion: reduce) {
    #day-workspace.mobile-timeline .itinerary { transition: none; }
  }
}

.place-card[data-place-card] { cursor: pointer; }
.place-name-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  overflow-wrap: anywhere;
}
.place-name-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.place-card.place-selected {
  border-color: #479783;
  background: #edf6eb;
  box-shadow: inset 3px 0 #2a806d;
}
.timeline-entry:has(.place-selected) .timeline-dot {
  background: #1d644f;
  box-shadow: 0 0 0 3px #ddecda;
}

#timeline-default {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted);
  font-size: .8125rem;
}
.day-schedule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  padding: 6px 9px;
  border: 1px solid #d9e2d7;
  border-radius: 8px;
  background: #eef5e9;
}
.day-schedule label { color: var(--accent-dark); font-size: .875rem; font-weight: 750; }
.day-schedule label span { margin-inline-start: 4px; color: var(--muted); font-size: .75rem; font-weight: 500; }
.day-schedule input {
  min-height: 38px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #bdcbc0;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.schedule-status { margin: -3px 0 9px; }
.arrival-marker {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.timeline-arrival[data-estimated-walk] time { text-decoration: underline dotted; text-underline-offset: 3px; }
.stay-button {
  min-height: 32px;
  margin-top: 3px;
  padding: 3px 7px;
  border: 1px solid #d6e4d4;
  border-radius: 6px;
  background: #eef5e9;
  color: #315848;
  font-size: .8rem;
  font-weight: 700;
}
.stay-button:hover { background: #e3efdf; }
#timeline-mode {
  flex: none;
  max-width: 7.25rem;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid #d5ddd2;
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent-dark);
  font-size: .875rem;
  font-weight: 650;
}
.leg-link {
  min-height: 38px;
  text-align: start;
  font-variant-numeric: tabular-nums;
}
.leg-icon { display: inline-flex; flex: none; }
.leg-edit { display: inline-flex; flex: none; margin-inline-start: 2px; }
.leg-link[data-mode="rail"] { background: #f0e8f8; color: #653687; }
.leg-link[data-mode="car"] { background: #e9f0fb; color: #285b98; }
.leg-link[data-leg-loading], .leg-link[data-missing-points]:not([data-mode="rail"]) {
  background: #f1f0e8;
  color: #526157;
}
@media (max-width: 650px) {
  .leg-link { min-height: 44px; }
}
