/* 旅行小本本: the day strip, the living map with its time bar, and the day's rows. */

[hidden] { display: none !important; }

:root {
  --sea: #D3E9F3;
  --land: #FFF7EC;
  --park: #DAEFD4;
  --water: #BFE0EE;
  --sky: #6FA8E8;
  --sky-soft: #E4F0FB;
  --lav-ink: #8D74CF;
  --k-sight: #8D74CF;
  --k-food: #F08A73;
  --k-hotel: #5DBB92;
  --k-move: #6FA8E8;
  --k-fun: #E7728F;
  --m-walk: #E7728F;
  --m-subway: #A88BE3;
  --m-train: #5DBB92;
  --m-shinkansen: #6FA8E8;
  --m-tozan: #E9605F;
  --m-cable: #EB89AB;
  --m-ropeway: #8C7881;
  --m-boat: #4FAFCB;
  --m-bus: #F2B04A;
  --m-taxi: #F59A7A;
  --m-plane: #A88BE3;
  --m-romance: #E7728F;
  --m-torokko: #E2A93E;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 460px at 50% -180px, #E6F1FB 0%, rgba(230, 241, 251, 0) 70%),
    var(--cream);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- header (same family as 开车小本本) ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px 4px;
}
.home {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--paper);
  color: #F2C14E;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease-spring);
}
.home:active { transform: scale(.92); }
.home svg { width: 22px; height: 22px; }
.top-title { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-family: var(--font); font-size: 24px; font-weight: 600; letter-spacing: .02em; line-height: 1.2; }
.sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 13px; }
.buddy { flex: none; width: 58px; height: 70px; margin: -6px 0 -10px; padding: 0; border: 0; background: none; cursor: pointer; }
.buddy.is-jump { animation: buddy-jump .6s var(--ease-spring); }
@keyframes buddy-jump { 40% { transform: translateY(-14px) rotate(-6deg); } }
.buddy-say { position: relative; z-index: 40; max-width: 1180px; height: 0; margin: 0 auto; padding: 0 16px; text-align: right; }
.buddy-say span {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 14px 4px 14px 14px;
  background: var(--paper);
  color: var(--rose-deep);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: say-in .35s var(--ease-spring);
}
@keyframes say-in { from { opacity: 0; transform: translateY(-6px) scale(.9); } }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.tabs button {
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 15px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tabs button[aria-selected="true"] { background: var(--rose); color: #fff; }
.view { max-width: 1180px; margin: 0 auto; }

/* ---------- day strip ---------- */
.strip {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 16px 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.dpill {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 62px;
  padding: 7px 4px 6px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  cursor: pointer;
  scroll-snap-align: center;
  transition: background .2s, border-color .2s, transform .25s var(--ease-spring), color .2s, box-shadow .2s;
}
.dpill:active { transform: scale(.95); }
.dpill .e { font-size: 19px; line-height: 1.2; }
.dpill .d { font-size: 15px; font-weight: 600; line-height: 1.2; }
.dpill .w { color: var(--ink-soft); font-size: 11px; line-height: 1.3; white-space: nowrap; }
.dpill[aria-selected="true"] { border-color: var(--rose); background: var(--rose); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(231, 114, 143, .3); }
.dpill[aria-selected="true"] .w { color: rgba(255, 255, 255, .85); }
.dpill.is-past:not([aria-selected="true"]) { opacity: .6; }
.dpill .today {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 7px;
  border-radius: 999px;
  background: #FFD978;
  color: #6B4B12;
  font-size: 11px;
  line-height: 17px;
  white-space: nowrap;
}

/* ---------- layout ---------- */
.day-grid { display: grid; grid-template-columns: 1fr; }
.stage {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 6px 12px 4px;
  background: var(--cream);
  box-shadow: 0 10px 12px -12px rgba(120, 60, 80, .25);
}
@media (min-width: 900px) {
  .day-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px; padding: 0 16px; }
  .stage { top: 12px; align-self: start; display: flex; flex-direction: column; height: calc(100vh - 24px); max-height: 800px; padding: 0; background: none; }
  .stage .map-card { flex: 1; height: auto; }
  /* on a wide screen the time bar sits on top, so it's in view straight away */
  .stage .scrub-row { order: -1; margin: 0 0 8px; padding: 6px 10px 2px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
  .stage .scrub-hint { order: -1; padding: 0 0 6px 64px; }
}

/* ---------- map card ---------- */
.map-card {
  position: relative;
  height: clamp(220px, 36vh, 330px);
  border-radius: 22px;
  background: var(--sea);
  box-shadow: 0 6px 18px rgba(80, 110, 150, .14);
  overflow: hidden;
  overflow: clip;
  transition: height .35s ease, opacity .3s;
}
.map-card.is-folded { height: 0; opacity: 0; box-shadow: none; }
@media (min-width: 900px) { .map-card.is-folded { height: auto; opacity: 1; } }
.map { position: absolute; inset: 0; }
.map-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
  box-shadow: 0 2px 10px rgba(60, 40, 80, .14);
  pointer-events: none;
}
.map-chip:empty { display: none; }
.map-chip b { flex: none; color: var(--rose-deep); font-family: var(--font); font-weight: 600; }
.map-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-btns { position: absolute; right: 10px; bottom: 10px; z-index: 6; display: flex; gap: 6px; }
.map-btns button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(80, 110, 150, .18);
  cursor: pointer;
}
.map-btns button:active { transform: scale(.94); }
.map-credit {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 5;
  margin: 0;
  color: rgba(75, 58, 66, .42);
  font-family: var(--font);
  font-size: 9.5px;
  pointer-events: none;
}

/* ---------- the time bar ---------- */
.scrub-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.scrub { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.sc-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #F28BA5, #E7728F);
  color: #fff;
  box-shadow: 0 6px 14px rgba(231, 114, 143, .35);
  cursor: pointer;
  transition: transform .2s var(--ease-spring);
}
.sc-play:active { transform: scale(.92); }
.sc-play svg { width: 20px; height: 20px; fill: currentColor; }
.sc-play .i-pause, .scrub.is-playing .sc-play .i-play { display: none; }
.scrub.is-playing .sc-play .i-pause { display: inline; }
.sc-track {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 60px;
  margin: 0 16px 0 18px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.sc-track:focus-visible { outline-offset: 2px; }
.scrub.is-drag .sc-track { cursor: grabbing; }
.sc-rail {
  --dusk: 200%;
  position: absolute;
  left: 0;
  right: 0;
  top: 19px;
  height: 26px;
  border-radius: 13px;
  background: linear-gradient(90deg, #FFF3E1 0%, #FFE6D8 calc(var(--dusk) - 6%), #DCD2F4 calc(var(--dusk) + 3%), #CEC3EF 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 80, 100, .06);
}
.sc-segs { position: absolute; left: 0; right: 0; top: 19px; height: 26px; z-index: 0; isolation: isolate; }
.sc-segs > i { position: absolute; top: 0; height: 26px; font-style: normal; }
.sc-stay {
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  transition: transform .25s var(--ease-spring);
}
.sc-stay::before {
  content: '';
  position: absolute;
  inset: 3px 1.5px;
  z-index: -1;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1.5px var(--k, var(--k-sight));
}
.sc-stay.k-food { --k: var(--k-food); }
.sc-stay.k-hotel { --k: var(--k-hotel); }
.sc-stay.k-move { --k: var(--k-move); }
.sc-stay.k-fun { --k: var(--k-fun); }
.sc-stay.is-on { transform: scale(1.12); }
.sc-stay.is-on::before { background: #fff; box-shadow: inset 0 0 0 2px var(--k, var(--k-sight)), 0 2px 6px rgba(60, 40, 80, .15); }
.sc-leg { --m: var(--m-walk); }
.sc-leg::before {
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  top: 11px;
  height: 4px;
  border-radius: 2px;
  background: var(--m);
}
.sc-leg.m-walk::before { background: radial-gradient(circle, var(--m-walk) 1.5px, transparent 1.9px) 0 50% / 6px 4px repeat-x; }
.sc-leg.m-subway { --m: var(--m-subway); }
.sc-leg.m-train { --m: var(--m-train); }
.sc-leg.m-shinkansen { --m: var(--m-shinkansen); }
.sc-leg.m-tozan { --m: var(--m-tozan); }
.sc-leg.m-cable { --m: var(--m-cable); }
.sc-leg.m-ropeway { --m: var(--m-ropeway); }
.sc-leg.m-boat { --m: var(--m-boat); }
.sc-leg.m-bus { --m: var(--m-bus); }
.sc-leg.m-taxi { --m: var(--m-taxi); }
.sc-leg.m-plane { --m: var(--m-plane); }
.sc-leg.m-romance { --m: var(--m-romance); }
.sc-leg.m-torokko { --m: var(--m-torokko); }
.sc-leg.is-on::before { top: 10px; height: 6px; border-radius: 3px; }
.sc-marks { position: absolute; inset: 0; pointer-events: none; }
.sc-marks > span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sc-hour { bottom: 0; color: var(--ink-faint); font-family: var(--font); font-size: 10px; line-height: 12px; }
.sc-sun { bottom: -1px; font-size: 10px; line-height: 12px; }
.sc-now { top: 15px; height: 34px; width: 0; border-left: 2px solid #E35D6A; color: transparent; font-size: 0; }
.sc-now::after { content: '现在'; position: absolute; left: -12px; top: -12px; color: #E35D6A; font-size: 9.5px; line-height: 11px; }
.sc-knob {
  position: absolute;
  top: 32px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--rose);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(201, 80, 111, .3);
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s;
  pointer-events: none;
}
.scrub.is-drag .sc-knob { width: 42px; height: 42px; }
.sc-face { position: absolute; inset: 0; display: grid; place-items: center; }
.sc-face svg { width: 82%; height: 82%; overflow: visible; }
.sc-time {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  padding: 0 6px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  transform: translateX(-50%);
}
.map-fold {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-soft);
  box-shadow: 0 1px 4px rgba(120, 60, 80, .12);
  cursor: pointer;
}
.map-fold svg { width: 18px; height: 18px; transition: transform .3s; }
.map-fold[aria-expanded="false"] svg { transform: rotate(180deg); }
@media (min-width: 900px) { .map-fold { display: none; } }
.scrub-hint {
  margin: 0;
  padding: 0 0 2px 54px;
  color: var(--rose-deep);
  font-size: 12px;
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { opacity: .55; transform: translateX(0); } 50% { opacity: 1; transform: translateX(6px); } }

/* ---------- the map itself ---------- */
.tmap { position: absolute; inset: 0; overflow: hidden; background: var(--sea); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.tmap:active { cursor: grabbing; }
.tm-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tm-land { fill: var(--land); }
.tm-park { fill: var(--park); }
.tm-lake { fill: var(--water); }
.tm-river { fill: none; stroke: var(--water); stroke-linecap: round; stroke-linejoin: round; }
.tm-river-big { stroke-width: 1.4; }
.tm-river-mid { stroke-width: 1.2; }
.tm-river-small { stroke-width: .9; }
[data-zoom="mid"] .tm-river-big { stroke-width: 2.6; }
[data-zoom="mid"] .tm-river-mid { stroke-width: 2; }
[data-zoom="near"] .tm-river-big { stroke-width: 6; }
[data-zoom="near"] .tm-river-mid { stroke-width: 4.5; }
[data-zoom="near"] .tm-river-small { stroke-width: 3; }
[data-zoom="far"] .tm-river, [data-zoom="wide"] .tm-river-small { display: none; }
.tm-rail { fill: none; stroke: #DCCFEB; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tm-rail-shinkansen { stroke: #BDD5EE; stroke-width: 2.4; }
.tm-rail-rope { stroke: #CBBFC4; stroke-width: 1.2; stroke-dasharray: 1 4; }
[data-zoom="far"] .tm-rail, [data-zoom="wide"] .tm-rail-local, [data-zoom="wide"] .tm-rail-loop, [data-zoom="wide"] .tm-rail-rope { display: none; }

.tm-leg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tm-leg { opacity: .5; transition: opacity .4s; }
.tm-leg.is-done, .tm-leg.is-now { opacity: 1; }
.tm-leg-case { stroke: #fff; stroke-width: 7; opacity: .85; }
.tm-leg-line { stroke: var(--m-walk); stroke-width: 3.6; }
.tm-leg.is-now .tm-leg-case { stroke-width: 9; }
.tm-leg-walk .tm-leg-line { stroke-width: 3.4; stroke-dasharray: .1 7; }
.tm-leg-walk .tm-leg-case { stroke-width: 6; stroke-dasharray: .1 7; }
.tm-leg-subway .tm-leg-line { stroke: var(--m-subway); }
.tm-leg-train .tm-leg-line { stroke: var(--m-train); }
.tm-leg-shinkansen .tm-leg-line { stroke: var(--m-shinkansen); stroke-width: 4.6; }
.tm-leg-tozan .tm-leg-line { stroke: var(--m-tozan); }
.tm-leg-cable .tm-leg-line { stroke: var(--m-cable); }
.tm-leg-torokko .tm-leg-line { stroke: var(--m-torokko); }
.tm-leg-romance .tm-leg-line { stroke: var(--m-romance); }
.tm-leg-bus .tm-leg-line { stroke: var(--m-bus); }
.tm-leg-taxi .tm-leg-line { stroke: var(--m-taxi); stroke-dasharray: 9 6; }
.tm-leg-boat .tm-leg-line { stroke: var(--m-boat); stroke-dasharray: 2 7; }
.tm-leg-ropeway .tm-leg-line { stroke: var(--m-ropeway); stroke-width: 2; }
.tm-leg-ropeway .tm-leg-case { stroke-width: 5; }
.tm-leg-plane .tm-leg-line { stroke: var(--m-plane); stroke-width: 2.6; stroke-dasharray: 7 8; }
.tm-leg-plane .tm-leg-case { stroke-width: 5.5; }

.tm-night {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(62, 50, 132, .36), rgba(110, 80, 150, .24));
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.tm-layer { position: absolute; inset: 0; pointer-events: none; }
.tm-layer > * { position: absolute; left: 0; top: 0; will-change: transform; }
.tm-layer .is-off { display: none; }
.tm-deco { opacity: .95; }
.tm-deco svg { display: block; width: 100%; height: auto; overflow: visible; }
.tm-deco-onsen .steam { animation: steam 2.4s ease-in-out infinite; }
.tm-deco-onsen .steam:nth-child(2) { animation-delay: .5s; }
.tm-deco-onsen .steam:nth-child(3) { animation-delay: 1s; }
@keyframes steam { 0%, 100% { opacity: .5; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1.5px); } }
.tm-deco-ship svg { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px) rotate(-2deg); } }
.tm-label {
  color: rgba(75, 58, 66, .72);
  font-family: var(--font);
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 0 3px var(--land), 0 0 3px var(--land), 0 0 3px var(--land);
}
.tm-label-city { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.tm-label-country { color: rgba(75, 58, 66, .45); font-size: 18px; letter-spacing: .4em; }
.tm-label-sea { color: #6E9DB6; font-size: 12.5px; letter-spacing: .3em; text-shadow: none; }
.tm-label-park { color: #5E9D70; font-size: 11px; }
.tm-label-town { color: var(--ink-soft); font-size: 11.5px; }

.tm-pins { position: absolute; inset: 0; }
.tm-pin { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; will-change: transform; }
.tm-pin-dot {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -32px 0 0 -13px;
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--k-sight);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(60, 40, 80, .22);
  transition: transform .25s var(--ease-spring), opacity .25s;
}
.tm-pin-dot i { display: block; font-style: normal; transform: rotate(45deg); }
.tm-pin-food .tm-pin-dot { background: var(--k-food); }
.tm-pin-hotel .tm-pin-dot { background: var(--k-hotel); }
.tm-pin-move .tm-pin-dot { background: var(--k-move); }
.tm-pin-fun .tm-pin-dot { background: var(--k-fun); }
.tm-pin.is-done .tm-pin-dot { opacity: .7; }
.tm-pin.is-here .tm-pin-dot { opacity: .5; transform: rotate(-45deg) scale(.8); }
.tm-pin.is-small .tm-pin-dot { width: 12px; height: 12px; margin: -16px 0 0 -6px; border-width: 2px; font-size: 0; }
.tm-pin-name {
  position: absolute;
  left: 15px;
  top: -30px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(60, 40, 80, .12);
}

.tm-who { padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; transition: opacity .2s; }
.tm-who svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 100%; }
.tm-nb { width: 40px; z-index: 3; }
.tm-ham { width: 26px; z-index: 4; }
.tm-ride { width: 82px; z-index: 4; pointer-events: none; }
.tm-ride[data-mode="ropeway"] { width: 54px; }
.tm-ride[data-mode="plane"] { width: 96px; }
.tm-ride[data-mode="boat"] { width: 74px; }
.tm-ride[data-mode="taxi"], .tm-ride[data-mode="bus"] { width: 72px; }
.tm-flip { display: block; transition: transform .25s ease; }
.tm-flip.is-left { transform: scaleX(-1); }
.tm-who.is-walk svg { animation: waddle .42s ease-in-out infinite; }
.tm-ham.is-walk svg { animation: hamhop .32s ease-in-out infinite; }
.tm-who.is-hop svg { animation: mush-hop .55s var(--ease-spring); }
@keyframes waddle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) translateY(-2px); } }
@keyframes hamhop { 0%, 100% { transform: translateY(0) scale(1.04, .96); } 50% { transform: translateY(-4px) scale(.97, 1.03); } }
.tm-ride .veh { animation: ride-bob .5s ease-in-out infinite; }
.tm-ride[data-mode="plane"] .veh { animation: fly-bob 1.6s ease-in-out infinite; }
.tm-ride[data-mode="ropeway"] .veh { animation: swing 1.8s ease-in-out infinite; transform-origin: 50% 0; }
.tm-ride[data-mode="boat"] .veh { animation: bob 1.4s ease-in-out infinite; }
.tm-ride.is-still .veh, .tm-ride.is-still .rh { animation-play-state: paused; }
.veh .rh { animation: head-bob .9s ease-in-out infinite; }
.veh .rh-ham { animation-delay: .2s; }
@keyframes ride-bob { 50% { transform: translateY(-1.2px); } }
@keyframes fly-bob { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes head-bob { 50% { transform: translateY(-.8px); } }
.tm-say { z-index: 8; pointer-events: none; }
.tm-say span {
  position: relative;
  display: block;
  max-width: 190px;
  padding: 6px 11px;
  border-radius: 14px;
  background: #fff;
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(60, 40, 80, .16);
  animation: say-in .3s var(--ease-spring);
}
.tm-say span::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 0 0 3px 0;
  background: #fff;
  transform: rotate(45deg);
}
.tm-step { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #E7728F; animation: step-fade 1.5s ease-out forwards; }
@keyframes step-fade { from { opacity: .55; } to { opacity: 0; } }
.tm-pop { z-index: 9; font-size: 22px; animation: pop-up 1.6s ease-out forwards; }
@keyframes pop-up { 0% { opacity: 0; margin-top: 6px; } 20% { opacity: 1; } 100% { opacity: 0; margin-top: -30px; } }

/* ---------- the day ---------- */
.day-panel { min-width: 0; padding: 4px 16px 8px; }
.day-head { padding: 8px 2px 4px; }
.day-date { margin: 0; color: var(--ink-soft); font-family: var(--font); font-size: 13px; }
.day-title { margin: 2px 0 8px; font-family: var(--font); font-size: 24px; font-weight: 600; line-height: 1.25; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(120, 60, 80, .06);
}
.dchip.hotel { background: var(--mint); color: #2F6E54; }
.dchip.warn { background: #FFF1D6; color: #8A5A10; }
.day-intro { margin: 10px 0 0; color: #5F4B55; font-size: 14.5px; line-height: 1.6; cursor: pointer; }
.day-intro.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.now {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFF3CF, #FFE7D6);
  color: #6B4B12;
  font-size: 14px;
}
.now b { color: var(--ink); font-family: var(--font); }
.now .nav { margin-left: auto; }

/* plans */
.plans-wrap { margin: 14px -16px 0; }
.plans { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 16px 6px; }
.plans::-webkit-scrollbar { display: none; }
.plan {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  width: min(250px, 72vw);
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  scroll-snap-align: start;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease-spring), box-shadow .2s;
}
.plan:active { transform: scale(.97); }
.plan[aria-checked="true"] { border-color: var(--rose); background: var(--blush-2); box-shadow: 0 6px 16px rgba(231, 114, 143, .18); }
.plan-e { grid-row: 1 / 4; align-self: center; font-size: 28px; line-height: 1; }
.plan-k { color: var(--ink-soft); font-family: var(--font); font-size: 12px; }
.plan-k i { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #FFD978; color: #6B4B12; font-style: normal; font-size: 11px; }
.plan[aria-checked="true"] .plan-k { color: var(--rose-deep); }
.plan-n { font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1.3; }
.plan-p { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }

/* itinerary: one row per stop, a coloured line per leg */
.iti { position: relative; margin: 14px 0 0; padding: 0; list-style: none; }
.row { position: relative; }
.row::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #EEDFE4;
}
.stop:first-child::before { top: 27px; }
.stop:last-child::before { bottom: auto; height: 27px; }
.leg { --m: var(--m-walk); }
.leg::before { background: var(--m); }
.leg.m-walk::before { background: radial-gradient(circle, var(--m-walk) 1.6px, transparent 2px) 50% 0 / 3px 7px repeat-y; }
.leg.m-subway { --m: var(--m-subway); }
.leg.m-train { --m: var(--m-train); }
.leg.m-shinkansen { --m: var(--m-shinkansen); }
.leg.m-tozan { --m: var(--m-tozan); }
.leg.m-cable { --m: var(--m-cable); }
.leg.m-ropeway { --m: var(--m-ropeway); }
.leg.m-boat { --m: var(--m-boat); }
.leg.m-bus { --m: var(--m-bus); }
.leg.m-taxi { --m: var(--m-taxi); }
.leg.m-plane { --m: var(--m-plane); }
.leg.m-romance { --m: var(--m-romance); }
.leg.m-torokko { --m: var(--m-torokko); }
.row-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.stop .row-head { min-height: 54px; padding: 6px 8px 6px 0; border-radius: 16px; transition: background .25s; }
.stop.is-on .row-head { background: rgba(252, 230, 236, .72); }
.row-time { flex: none; width: 44px; color: var(--ink-soft); font-family: var(--font); font-size: 13px; font-weight: 600; text-align: right; }
.stop.is-on .row-time { color: var(--rose-deep); }
.row-dot {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  background: var(--k-sight);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(60, 40, 80, .16);
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.k-food .row-dot { background: var(--k-food); }
.k-hotel .row-dot { background: var(--k-hotel); }
.k-move .row-dot { background: var(--k-move); }
.k-fun .row-dot { background: var(--k-fun); }
.stop.is-on .row-dot { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(231, 114, 143, .25), 0 2px 6px rgba(60, 40, 80, .16); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-family: var(--font); font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.stop.is-on .row-name { color: var(--rose-deep); }
.row-sub { overflow: hidden; color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.stop.is-open .row-sub { display: none; }
.row-stay { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--blush-2); color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; }
.stop.is-next .row-time::after { content: '下一站'; display: block; color: #B07A12; font-size: 10px; font-weight: 500; }
.stop.is-next .row-dot { box-shadow: 0 0 0 3px #FFD978; }

.leg-line { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 4px 2px 96px; }
.leg .row-head { flex: 1; min-width: 0; gap: 6px; padding: 6px 0; font-size: 13px; }
.leg-ico { flex: none; font-size: 15px; }
.leg-what { min-width: 0; overflow: hidden; color: #5F4B55; text-overflow: ellipsis; white-space: nowrap; }
.leg-chip { flex: none; padding: 0 6px; border-radius: 999px; background: var(--paper); color: var(--ink-soft); font-size: 11.5px; line-height: 20px; box-shadow: 0 1px 2px rgba(120, 60, 80, .08); }
.leg.is-on .leg-what { color: var(--rose-deep); font-weight: 600; }
.leg.is-on::before { width: 5px; margin-left: -2.5px; }
.nav {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: #2F5E96;
  font-size: 12.5px;
  text-decoration: none;
}
.nav:active { transform: scale(.95); }
.leg .nav { justify-content: center; width: 32px; height: 32px; padding: 0; font-size: 0; }
.leg .nav::before { content: ''; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--go) center / contain no-repeat; mask: var(--go) center / contain no-repeat; }
.leg .nav { --go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3 3 10.5l7.2 2.3L12.5 20z'/%3E%3C/svg%3E"); }

.row-more { padding: 2px 6px 12px 96px; color: #5F4B55; font-size: 14px; line-height: 1.6; animation: more-in .25s ease; }
.leg .row-more { padding-top: 0; font-size: 13.5px; }
@keyframes more-in { from { opacity: 0; transform: translateY(-4px); } }
.row-more p { margin: 2px 0 0; }
.row-jp { color: var(--ink-faint); font-size: 12.5px; }
.row-more ul { margin: 6px 0 0; padding-left: 18px; }
.row-more li { margin: 2px 0; }
.row-more li::marker { color: var(--rose); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lnk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(120, 60, 80, .1);
}

/* blocks under the itinerary */
.block { margin-top: 22px; }
.block h3 { margin: 0 0 10px; font-family: var(--font); font-size: 17px; font-weight: 600; }
.rail { display: flex; gap: 10px; margin: 0 -16px; padding: 2px 16px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.ftile {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 148px;
  padding: 12px 12px 11px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform .2s var(--ease-spring);
}
.ftile:active { transform: scale(.96); }
.ft-e { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 14px; background: var(--peach); font-size: 24px; }
.ft-heart { position: absolute; top: 10px; right: 12px; color: var(--rose); font-size: 14px; }
.ft-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1.35; }
.ft-meta { color: var(--ink-soft); font-size: 12px; }
.ft-warn { margin-top: 3px; padding: 0 7px; border-radius: 999px; background: #FFF1D6; color: #8A5A10; font-size: 11px; line-height: 19px; }
.ft-ate { position: absolute; top: 46px; left: 46px; display: none; place-items: center; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; background: var(--good); color: #fff; font-size: 11px; }
.ftile.is-ate .ft-ate { display: grid; }

.pb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pbchip {
  min-height: 36px;
  padding: 4px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.pbchip[aria-expanded="true"] { border-color: var(--lav-ink); background: var(--lav); color: #4E3E7E; }
.pb-text { margin: 10px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--lav); color: #4E3E7E; font-size: 14px; line-height: 1.6; animation: more-in .25s ease; }

.todo-box { border-radius: 18px; background: var(--paper); box-shadow: 0 1px 3px rgba(120, 60, 80, .06); }
.todo-box summary { display: flex; align-items: center; gap: 8px; padding: 13px 16px; font-family: var(--font); font-size: 16px; font-weight: 600; list-style: none; cursor: pointer; }
.todo-box summary::-webkit-details-marker { display: none; }
.todo-box summary::after { content: '›'; margin-left: 4px; color: var(--ink-faint); font-size: 20px; transition: transform .2s; }
.todo-box[open] summary::after { transform: rotate(90deg); }
.todo-n { margin-left: auto; color: var(--ink-soft); font-size: 13px; font-weight: 400; }
.todo { margin: 0; padding: 0 10px 10px; list-style: none; display: grid; gap: 4px; }
.todo label { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 12px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.todo label:hover { background: var(--blush-2); }
.todo input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rose); }
.todo input:checked + span { color: var(--ink-faint); text-decoration: line-through; }

.day-nav { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 6px; }
.day-nav button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.day-nav button:disabled { opacity: .35; cursor: default; }

/* ---------- food cards (sheet + 好吃的) ---------- */
.food {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.sheet .food { padding: 0; background: none; box-shadow: none; }
.food-top-row { display: flex; align-items: center; gap: 10px; }
.sheet .food-top-row { padding-right: 40px; }
.food-e { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--peach); font-size: 25px; }
.food-title { flex: 1; min-width: 0; }
.food-name { margin: 0; font-family: var(--font); font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.food-jp { display: block; color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
.food-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { padding: 0 8px; border-radius: 999px; background: var(--blush-2); color: var(--ink-soft); font-size: 12px; line-height: 21px; }
.tag.saved { background: #FFE9F0; color: var(--rose-deep); }
.tag.pick { background: var(--lav); color: #6A54A8; }
.tag.warn { background: #FFF1D6; color: #8A5A10; }
.tag.day { background: var(--sky-soft); color: #2F5E96; }
.food-order { margin: 6px 0 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.food-note { margin: 0; color: #6E5A64; font-size: 13.5px; line-height: 1.55; }
.food-hours { margin: 0; color: var(--ink-soft); font-size: 12.5px; }
.ate {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
}
.ate[aria-pressed="true"] { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.food.is-ate { opacity: .78; }

/* ---------- bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-back { position: absolute; inset: 0; background: rgba(44, 28, 38, .34); opacity: 0; transition: opacity .25s; }
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 84vh;
  padding: 26px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--cream);
  box-shadow: 0 -10px 40px rgba(60, 30, 50, .2);
  overflow-y: auto;
  transform: translateY(102%);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1);
}
.sheet-panel:focus { outline: none; }
.sheet.is-open .sheet-back { opacity: 1; }
.sheet.is-open .sheet-panel { transform: translateY(0); }
.sheet-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #E8D8DE; }
.sheet-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink-soft); font-size: 15px; box-shadow: 0 1px 4px rgba(120, 60, 80, .12); cursor: pointer; }
@media (min-width: 700px) {
  .sheet-panel { left: 50%; right: auto; bottom: 50%; width: 520px; max-height: 80vh; border-radius: 26px; opacity: 0; transform: translate(-50%, 56%) scale(.96); transition: transform .25s ease, opacity .25s; }
  .sheet.is-open .sheet-panel { opacity: 1; transform: translate(-50%, 50%); }
  .sheet-grip { display: none; }
}

/* ---------- food view ---------- */
.food-top { padding: 12px 16px 4px; }
.food-hint { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}
.chip .n { color: var(--ink-faint); font-size: 12px; }
.chip[aria-selected="true"] { border-color: var(--rose); background: var(--rose); color: #fff; }
.chip[aria-selected="true"] .n { color: rgba(255, 255, 255, .8); }
.food-groups { padding: 6px 16px 0; }
.fgroup { margin-top: 16px; }
.fgroup h3 { margin: 0 0 10px; font-family: var(--font); font-size: 17px; font-weight: 600; }
.fgroup h3 small { margin-left: 6px; color: var(--ink-faint); font-family: var(--font-body); font-size: 12.5px; font-weight: 400; }
.fgrid { display: grid; gap: 10px; }
@media (min-width: 640px) { .fgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .fgrid { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- tips view ---------- */
.tips { display: grid; gap: 14px; padding: 14px 16px 0; }
@media (min-width: 760px) { .tips { grid-template-columns: 1fr 1fr; align-items: start; } }
.tip-card { padding: 14px 16px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.tip-card h3 { margin: 0 0 6px; font-family: var(--font); font-size: 17px; font-weight: 600; }
.tip-card p { margin: 6px 0 0; color: #5F4B55; font-size: 14.5px; }
.tip-card ul { margin: 6px 0 0; padding-left: 18px; color: #5F4B55; font-size: 14.5px; }
.tip-card ul.todo { padding: 0; }
.tip-card li { margin: 4px 0; }
.tip-card li::marker { color: var(--rose); }
.phr { display: grid; gap: 6px; margin-top: 6px; }
.phr div { display: flex; flex-direction: column; padding: 7px 11px; border-radius: 12px; background: var(--blush-2); }
.phr b { font-family: var(--font-body); font-size: 15px; font-weight: 600; }
.phr span { color: var(--ink-soft); font-size: 13px; }

.foot { padding: 26px 16px calc(28px + env(safe-area-inset-bottom)); text-align: center; }
.love { margin: 0; color: var(--ink-soft); font-family: var(--font); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .tm-who.is-walk svg, .tm-ham.is-walk svg, .tm-ride .veh, .veh .rh, .tm-deco-onsen .steam, .tm-deco-ship svg, .scrub-hint { animation: none; }
}
