:root {
  --paper: #f7f2ea;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #23201c;
  --ink-2: #5d564d;
  --ink-3: #8f877b;
  --line: #e3d9ca;
  --accent: #c2452d;      /* 紅葉 */
  --accent-2: #e07a3c;
  --gold: #b98a2f;
  --teal: #2f6f73;        /* 湯・水 */
  --navy: #1f3550;
  --ok: #2f7a4f;
  --warn: #b7791f;
  --bad: #b83232;
  --chip: #f1e9dd;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .08);
  --radius: 16px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16130f; --paper-2: #1e1a15; --card: #221d18; --ink: #f1ebe2; --ink-2: #c4bbae; --ink-3: #8e8577;
    --line: #3a322a; --accent: #ec6a4f; --accent-2: #f0965a; --gold: #d9ac52; --teal: #5fb0b4; --navy: #9fb8d6;
    --ok: #5cbf86; --warn: #e3a948; --bad: #ef6b6b; --chip: #2c261f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16130f; --paper-2: #1e1a15; --card: #221d18; --ink: #f1ebe2; --ink-2: #c4bbae; --ink-3: #8e8577;
  --line: #3a322a; --accent: #ec6a4f; --accent-2: #f0965a; --gold: #d9ac52; --teal: #5fb0b4; --navy: #9fb8d6;
  --ok: #5cbf86; --warn: #e3a948; --bad: #ef6b6b; --chip: #2c261f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6; letter-spacing: .01em;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  overflow-x: hidden;
}
a { color: var(--teal); }
button { font: inherit; color: inherit; }
.serif { font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 340px; overflow: hidden; color: #fff; background: #3b2a20; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(20,14,10,.55) 0%, rgba(20,14,10,.08) 38%, rgba(20,14,10,.15) 60%, rgba(20,14,10,.78) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 22px 16px 22px; min-height: 340px; display: flex; flex-direction: column; }
.hero .kicker { font-size: 12px; letter-spacing: .28em; opacity: .9; }
.hero h1 { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: clamp(28px, 8vw, 42px); line-height: 1.25; margin: 6px 0 0; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.hero .date { margin-top: auto; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hero .date b { font-size: 26px; font-family: "Shippori Mincho", serif; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero .chips span { background: rgba(255,255,255,.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25); padding: 2px 10px; border-radius: 99px; font-size: 12px; }
.theme-btn { position: absolute; right: 12px; top: 12px; z-index: 2; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 99px; width: 36px; height: 36px; cursor: pointer; }

/* ---------- now bar ---------- */
.nowbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nowbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.nowbar .clockbox { min-width: 64px; line-height: 1.15; }
.nowbar .clock { font-size: 22px; font-weight: 700; }
.nowbar .next { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.nowbar .next .lbl { color: var(--ink-3); font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowbar .next .txt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.nowbar .cd { font-size: 11px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.nowbar .late { border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ---------- sections ---------- */
.view { display: none; padding-top: 18px; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h2.sec { font-family: "Shippori Mincho", serif; font-size: 22px; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
h2.sec::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: linear-gradient(var(--accent), var(--gold)); }
h3 { font-size: 16px; margin: 0 0 6px; }
.lead { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--chip); color: var(--ink-2); vertical-align: middle; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.badge.acc { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.verify { color: var(--warn); font-size: 11px; font-weight: 700; }

/* summary strip */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary .card { padding: 10px 12px; }
.summary .k { font-size: 11px; color: var(--ink-3); }
.summary .v { font-size: 18px; font-weight: 700; }
.summary .s { font-size: 11px; color: var(--ink-2); }

/* ---------- timeline ---------- */
.tl { position: relative; margin: 8px 0 0; padding: 0; list-style: none; }
.tl::before { content: ""; position: absolute; left: 52px; top: 8px; bottom: 8px; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 10px); }
.tl-item { position: relative; display: grid; grid-template-columns: 44px 18px 1fr; gap: 0 8px; margin-bottom: 10px; }
.tl-time { text-align: right; font-weight: 700; font-size: 14px; padding-top: 10px; line-height: 1.2; }
.tl-time small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.tl-dot { position: relative; }
.tl-dot::before { content: ""; position: absolute; left: 3px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink-3); }
.tl-item.stay .tl-dot::before { border-color: var(--accent); background: var(--accent); }
.tl-item.ride .tl-dot::before { border-color: var(--teal); }
.tl-item.walk .tl-dot::before { width: 8px; height: 8px; left: 5px; top: 15px; border-width: 2px; }
.tl-item.now .tl-dot::after { content: ""; position: absolute; left: -3px; top: 7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.tl-item.past { opacity: .55; }
.tl-body { min-width: 0; }
.tl-item.walk .tl-body { padding: 8px 0 2px; color: var(--ink-2); font-size: 13px; }
.ride-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 12px; padding: 10px 12px; }
.ride-card .line { font-weight: 700; }
.ride-card .meta { font-size: 12px; color: var(--ink-2); }
.ride-card .alts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.stay-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.stay-card .pic { display: block; width: 100%; aspect-ratio: 16/7; object-fit: cover; background: var(--paper-2); }
.stay-card .in { padding: 12px 14px 14px; }
.stay-card h3 { font-family: "Shippori Mincho", serif; font-size: 19px; margin: 0; }
.stay-card .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; margin: 10px 0 0; }
.facts dt { color: var(--ink-3); white-space: nowrap; }
.facts dd { margin: 0; }
.tips { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font-size: 13px; }
.tips ul { margin: 0; padding-left: 1.1em; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 38px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ghost { background: transparent; }
.btn:active { transform: translateY(1px); }
.checkin { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.checkin .btn { padding: 6px 10px; min-height: 32px; font-size: 12px; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--teal); font-size: 13px; font-weight: 700; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "＋ "; }
details.more[open] summary::before { content: "－ "; }

/* ---------- timetable ---------- */
.tt-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.tt-filter::-webkit-scrollbar { display: none; }
.tt-filter button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.tt-filter button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tt { margin-bottom: 12px; }
.tt header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tt h3 { margin: 0; }
.tt .route { font-size: 12px; color: var(--ink-2); }
.deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; margin-top: 10px; }
.dep { border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 13px; line-height: 1.25; background: var(--paper); }
.dep b { font-size: 16px; display: block; }
.dep .a { font-size: 11px; color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep.past { opacity: .38; }
.dep.next { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.dep.plan { position: relative; }
.dep.plan::after { content: "予定"; position: absolute; right: 4px; top: 3px; font-size: 9px; font-weight: 700; color: #fff; background: var(--teal); border-radius: 4px; padding: 0 4px; }
.dep.last { border-style: dashed; border-color: var(--bad); }
.tt .foot { margin-top: 10px; font-size: 12px; color: var(--ink-2); }

/* ---------- recovery ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
select, input[type="time"] { font: inherit; font-size: 16px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); width: 100%; min-height: 44px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--paper); padding: 10px 4px; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--paper); font-weight: 700; }
.verdict { margin-top: 14px; border-radius: var(--radius); padding: 14px; color: #fff; background: var(--ok); }
.verdict.warn { background: var(--warn); }
.verdict.bad { background: var(--bad); }
.verdict h3 { font-size: 18px; margin: 0 0 4px; }
.verdict p { margin: 0; font-size: 13px; opacity: .95; }
.actions { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.actions li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.actions li .ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--ink-3); }
.actions li.cut .ic { background: var(--warn); }
.actions li.skip .ic { background: var(--bad); }
.actions li.keep .ic { background: var(--ok); }
.rt { list-style: none; padding: 0; margin: 12px 0 0; }
.rt li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.rt li .t { font-weight: 700; }
.rt li.skipped { color: var(--ink-3); text-decoration: line-through; }
.rt li.stay .n { font-weight: 700; }
.rt li .d { font-size: 12px; color: var(--ink-2); }
table.cut { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cut th, table.cut td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.cut th { font-size: 11px; color: var(--ink-3); font-weight: 700; }
table.cut td.t { font-weight: 700; white-space: nowrap; font-size: 15px; }
.scen { margin-bottom: 10px; }
.scen h3 { display: flex; gap: 8px; align-items: center; }
.scen ol, .scen ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 14px; }

/* ---------- info ---------- */
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.check label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--paper); cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.check input:checked + span { text-decoration: line-through; color: var(--ink-3); }
.budget { width: 100%; border-collapse: collapse; font-size: 14px; }
.budget td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.budget td:last-child { text-align: right; white-space: nowrap; }
.budget tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); font-size: 16px; }
.contacts a { font-weight: 700; }
.grid2 { display: grid; gap: 10px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; justify-content: center; }
.nav .in { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 760px; }
.nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); cursor: pointer; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--accent); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 99px; font-size: 13px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
footer.src { font-size: 11px; color: var(--ink-3); margin: 24px 0 0; }
@media (min-width: 640px) {
  .hero, .hero-inner { min-height: 420px; }
  .summary .v { font-size: 22px; }
}
