/* src/styles/components.css — shared components (the DOM comes from src/app/ui/components.js, sheet.js, views/place.js).
   Tokens only; no raw colours. Visual authority: docs/research/2026-09-29-visual-language.txt. */

/* ── Text bits ─────────────────────────────────────────────────────────────── */
.ja { font-family: var(--font-jp); line-height: 1.6; line-break: strict; word-break: normal; }
.ja-mincho { font-family: var(--font-mincho); }
.missing {
  display: inline-block; min-width: 32px; color: var(--text-3); font-size: var(--fs-caption);
  border-bottom: 1px dashed var(--line-strong); line-height: 1.2;
}
.hinomaru {
  display: inline-block; width: var(--size, 10px); height: var(--size, 10px); border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--text); }

/* ── Region chip (表札 name-plate) ─────────────────────────────────────────── */
.region-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px;
  border-radius: var(--r-1); background: var(--tone); color: var(--on-tone);
  font: 600 var(--fs-micro)/22px var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}
.region-chip .icon { stroke: currentColor; }
.region-chip-lg { height: 28px; line-height: 28px; font-size: 13px; padding: 0 10px 0 8px; gap: 6px; }
.region-chip-outline { background: transparent; color: var(--tone-ink); box-shadow: inset 0 0 0 1px var(--tone-ink); }
.region-chip-dashed { box-shadow: none; border: 1px dashed var(--tone-ink); line-height: 20px; }
.region-chip-lg.region-chip-dashed { line-height: 26px; }

/* ── Tags & pills ──────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 7px;
  border-radius: var(--r-1); border: 1px solid var(--line-strong); color: var(--text-2);
  font: 500 var(--fs-micro)/var(--lh-micro) var(--font-sans); letter-spacing: .02em; white-space: nowrap;
  text-decoration: none;
}
.tag .icon { flex-shrink: 0; }
.tag-accent { background: var(--accent-wash); border-color: transparent; color: var(--accent-text); font-weight: 600; }
.tag-dashed { border-style: dashed; color: var(--text-3); }
.tag-solid { background: var(--text); border-color: var(--text); color: var(--surface); }
.tag-warn { border-color: transparent; background: var(--accent-wash); color: var(--accent-text); font-weight: 600; }
.tag-link { color: var(--text); }
.tag-link:hover { border-color: var(--text-3); background: var(--surface-pressed); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 7px;
  border-radius: var(--r-pill); background: var(--surface-inset); color: var(--text-2);
  font: 500 var(--fs-caption)/1 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pill-dashed { background: transparent; border: 1px dashed var(--line-strong); }

/* ── Filter chips & count badge ────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: 500 var(--fs-small)/1 var(--font-sans); white-space: nowrap; cursor: pointer;
  position: relative; transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.chip::after { content: ''; position: absolute; inset: -6px 0; } /* 44px hit area */
.chip:hover { background: var(--surface-pressed); }
.chip.is-selected { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip-count { font-size: var(--fs-caption); color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip.is-selected .chip-count { color: inherit; opacity: .75; }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--text); color: var(--surface);
  font: 600 var(--fs-micro)/1 var(--font-sans); font-variant-numeric: tabular-nums;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: var(--r-2); border: 1px solid transparent; background: transparent; color: var(--text);
  font: 600 var(--fs-body)/1 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out), opacity var(--dur-1);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); color: var(--surface); }
.btn-primary:hover { opacity: .92; }
.btn-secondary { border-color: var(--text-3); background: var(--surface); }
.btn-secondary:hover { background: var(--surface-pressed); }
.btn-text { padding: 0 8px; min-height: 44px; color: var(--text-2); font-weight: 500; }
.btn-text:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-small); position: relative; }
.btn-sm::after { content: ''; position: absolute; inset: -4px 0; }
.btn-icon {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: var(--text-2); position: relative;
}
.btn-icon::before {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); z-index: -1; transition: background var(--dur-1);
}
.btn-icon { isolation: isolate; }
.btn-icon:hover::before, .btn-icon:active::before { background: var(--surface-pressed); }
.btn-icon:hover { color: var(--text); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: default; pointer-events: none; }
.btn-ext { color: var(--text-3); }
.btn-map { flex-shrink: 0; }
.btn-copy { flex-shrink: 0; }

.link-ext {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text);
  font: 500 var(--fs-small)/1 var(--font-sans); text-decoration: none;
}
.link-ext > span { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link-ext:hover > span { text-decoration-color: var(--text); }
.link-ext .icon:first-child { color: var(--text-2); }
.link-ext-glyph { color: var(--text-3); }

/* Action row: equal 48px actions, 20px glyph over an 11px label */
.action-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--s-2); }
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px;
  padding: 8px 4px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); text-decoration: none; cursor: pointer; font: inherit;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1);
}
.action:hover { background: var(--surface-pressed); }
.action:active { transform: scale(.97); }
.action .icon { color: var(--text-2); }
.action-label { font: 500 var(--fs-micro)/var(--lh-micro) var(--font-sans); letter-spacing: .01em; text-align: center; }
.action-primary { background: var(--text); border-color: var(--text); color: var(--surface); }
.action-primary .icon { color: var(--surface); }
.action-primary:hover { background: var(--text); opacity: .92; }
.action.is-pressed { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-text); }
.action.is-pressed .icon { color: var(--accent-text); }

/* ── Time column ───────────────────────────────────────────────────────────── */
.time {
  display: inline-flex; align-items: baseline; gap: 2px; font: 600 var(--fs-time)/var(--lh-time) var(--font-sans);
  font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap;
}
.time-hard .time-val { text-decoration: underline 2px var(--accent); text-underline-offset: 4px; }
.time-soft { color: var(--text-2); }
.time-tilde { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--text-3); margin-right: 1px; }
.time-bound { flex-direction: column; gap: 0; line-height: 1.05; }
.time-prefix { font: 500 var(--fs-micro)/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.time-part { font: 400 italic var(--fs-small)/var(--lh-time) var(--font-serif); color: var(--text-3); }
.time-none { min-height: 1px; }

/* ── Transport line ────────────────────────────────────────────────────────── */
.leg-line { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font: 500 var(--fs-small)/var(--lh-small) var(--font-sans); color: var(--text); }
.leg-line > .icon { color: var(--text-2); }
.leg-route { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.leg-code { font-weight: 600; letter-spacing: .02em; }
.leg-time { color: var(--text-2); }
.leg-arrow { color: var(--text-3); }
.leg-plus { font-size: 10px; font-weight: 600; color: var(--text-2); margin-left: -2px; }
.leg-meta { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── Hanko stamps (角印 square = staying, 丸印 round = moving) ───────────────── */
.stamp {
  --stamp-size: 40px;
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: var(--stamp-size); height: var(--stamp-size); flex-shrink: 0;
  transform: rotate(var(--rot, 0deg)); color: var(--text-2); line-height: 1;
}
.stamp-compact { --stamp-size: 28px; }
.stamp-mini { --stamp-size: 16px; }
.stamp-ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stamp-ink rect, .stamp-ink circle { fill: transparent; stroke: var(--text-3); stroke-width: 1.5; }
.stamp-wd { position: relative; font: 800 10px/1 var(--font-mincho); margin-bottom: 1px; }
.stamp-num { position: relative; font: 600 19px/1 var(--font-serif); font-variant-numeric: lining-nums; font-variation-settings: 'opsz' 24; }
.stamp-compact .stamp-num { font-size: 14px; }
.stamp.is-today { color: var(--accent-text); }
.stamp.is-today .stamp-ink rect, .stamp.is-today .stamp-ink circle { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 2; }
.stamp.is-today::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}
.stamp.is-past { color: var(--on-accent); }
.stamp.is-past .stamp-ink rect, .stamp.is-past .stamp-ink circle { fill: var(--accent); stroke: var(--accent); }
.stamp-kanji { position: relative; font: 800 13px/1 var(--font-mincho); }
.stamp-rail .stamp-kanji { font-size: 18px; }
.stamp-check { position: relative; stroke: currentColor; }
.stamp.is-pressing { animation: hanko-press 320ms var(--ease-out) both; }
@keyframes hanko-press {
  0% { transform: rotate(var(--rot, 0deg)) scale(1.25); opacity: 0; }
  60% { transform: rotate(var(--rot, 0deg)) scale(.96); opacity: 1; }
  100% { transform: rotate(var(--rot, 0deg)) scale(1); }
}

/* ── Notes, empty states, TBD ──────────────────────────────────────────────── */
.note {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-2);
  background: var(--surface-inset); color: var(--text-2); font: 400 var(--fs-small)/var(--lh-small) var(--font-sans);
}
.note-icon { margin-top: 2px; color: var(--text-3); }
.note-text { min-width: 0; }
.note-title { font-weight: 600; color: var(--text); }
.note-warn { background: var(--accent-wash); color: var(--accent-text); }
.note-warn .note-icon, .note-warn .note-title { color: var(--accent-text); }
.note-caveat { background: var(--note-bg); color: var(--note-text); }
.note-caveat .note-icon, .note-caveat .note-title { color: var(--note-text); }

.empty-state { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-8) var(--s-4); text-align: center; }
.empty-icon { color: var(--text-3); }
.empty-title { margin: 0; font: 400 italic var(--fs-title-3)/var(--lh-title-3) var(--font-serif); color: var(--text-2); }
.empty-body { margin: 0; max-width: 34ch; color: var(--text-3); font-size: var(--fs-small); line-height: var(--lh-small); }

.tbd { padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-2); }
.tbd-title { margin: 0; font: 400 italic var(--fs-body)/var(--lh-body) var(--font-serif); color: var(--text-3); }
.tbd-body { margin: 2px 0 0; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-3); }

/* ── Section heads, details list, cards ────────────────────────────────────── */
.section-head { position: relative; display: flex; align-items: center; gap: var(--s-2); margin: var(--section-gap) 0 var(--s-3); }
.section-title {
  margin: 0; font: 600 var(--fs-label)/var(--lh-label) var(--font-sans); letter-spacing: var(--track-section);
  text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px;
}
h3.section-title { letter-spacing: var(--track-label); }
.section-count { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.section-count::before { content: '· '; }
.section-action { margin-left: auto; }
.section-kanji { display: none; }
@media (min-width: 1024px) {
  .section-kanji {
    display: block; position: absolute; left: -40px; top: 0; font: 600 13px/1 var(--font-mincho);
    letter-spacing: .25em; color: var(--text-3);
  }
}

.dl-grid { display: grid; grid-template-columns: minmax(88px, 104px) 1fr; gap: 8px 12px; margin: 0; font-size: var(--fs-small); line-height: var(--lh-small); }
.dl-grid dt { color: var(--text-3); }
.dl-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--card-pad);
}
.card-flush { padding: 0; }
.card-toned { border-left: 4px solid var(--tone); }
.card-accent { border: 1.5px solid var(--accent); }

/* ── Motif pattern layers (lattice · ridges · waves · pearls · asanoha · tide · tasuki · steam) ─ */
.motif-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.motif-fade-right { -webkit-mask-image: linear-gradient(90deg, transparent 20%, var(--mask-ink) 75%); mask-image: linear-gradient(90deg, transparent 20%, var(--mask-ink) 75%); }
.motif {
  position: absolute; inset: 0; background: var(--tone-ink); opacity: var(--motif-opacity);
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
}
.motif-lattice { -webkit-mask-image: var(--motif-lattice); mask-image: var(--motif-lattice); -webkit-mask-size: 30px 10px; mask-size: 30px 10px; }
.motif-waves { -webkit-mask-image: var(--motif-waves); mask-image: var(--motif-waves); -webkit-mask-size: 40px 40px; mask-size: 40px 40px; }
.motif-pearls { -webkit-mask-image: var(--motif-pearls); mask-image: var(--motif-pearls); -webkit-mask-size: 24px 24px; mask-size: 24px 24px; }
.motif-asanoha { -webkit-mask-image: var(--motif-asanoha); mask-image: var(--motif-asanoha); -webkit-mask-size: 16px 27.713px; mask-size: 16px 27.713px; }
.motif-tide { -webkit-mask-image: var(--motif-tide); mask-image: var(--motif-tide); -webkit-mask-size: 32px 14px; mask-size: 32px 14px; }
.motif-tasuki { -webkit-mask-image: var(--motif-tasuki); mask-image: var(--motif-tasuki); -webkit-mask-size: 44px 44px; mask-size: 44px 44px; }
.motif-steam { -webkit-mask-image: var(--motif-steam); mask-image: var(--motif-steam); -webkit-mask-size: 32px 56px; mask-size: 32px 56px; }
.motif-ridges {
  -webkit-mask-image: var(--motif-ridges); mask-image: var(--motif-ridges);
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x; -webkit-mask-position: bottom; mask-position: bottom;
  -webkit-mask-size: 400px 100%; mask-size: 400px 100%; opacity: calc(var(--motif-opacity) * 1.6);
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast-region {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-total) + var(--s-3)); z-index: var(--z-toast);
  display: flex; justify-content: center; padding: 0 var(--gutter); pointer-events: none;
}
@media (min-width: 1024px) { .toast-region { bottom: var(--s-6); left: var(--sidenav-w); } }
.toast {
  display: flex; align-items: center; gap: var(--s-3); min-height: 48px; max-width: 480px; padding: 0 var(--s-2) 0 var(--s-4);
  border-radius: var(--r-2); background: var(--text); color: var(--surface); font: 500 var(--fs-small)/1.3 var(--font-sans);
  pointer-events: auto; opacity: 0; transform: translateY(8px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-text { padding: 12px 0; }
.toast:not(:has(.toast-action)) { padding-right: var(--s-4); }
.toast-action {
  min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--surface);
  font: 600 var(--fs-small)/1 var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ── Japanese address block ────────────────────────────────────────────────── */
.jp-address {
  display: flex; align-items: flex-start; gap: var(--s-2); padding: var(--s-3); border-radius: var(--r-2);
  background: var(--surface-inset);
}
.jp-address-text { flex: 1; min-width: 0; }
.jp-address-name { margin: 0 0 4px; font: 600 var(--fs-jp-body)/1.5 var(--font-jp); color: var(--text); }
.jp-address-ja { margin: 0; font: 400 16px/1.6 var(--font-jp); color: var(--text); }
.jp-address-line { display: block; }
.jp-address-latin { margin: 6px 0 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.jp-address .btn-copy { margin: -6px -6px -6px 0; }
.jp-address .btn-copy::before { background: transparent; border-color: transparent; }
.jp-address .btn-copy:hover::before { background: var(--surface-pressed); }

/* ── Place row ─────────────────────────────────────────────────────────────── */
.place-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: var(--s-3); align-items: center; width: 100%;
  min-height: 64px; padding: var(--s-3) 0; border: 0; border-top: 1px solid var(--line); background: transparent;
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
}
.place-row:first-child { border-top: 0; }
.place-row:hover { background: color-mix(in srgb, var(--surface-pressed) 50%, transparent); }
.place-row:active { background: var(--surface-pressed); }
.place-row-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-2);
  background: var(--surface-inset); color: var(--text-2);
}
.place-row-text { display: grid; gap: 1px; min-width: 0; }
.place-row-name { font: 500 var(--fs-title-3)/var(--lh-title-3) var(--font-serif); overflow-wrap: anywhere; }
.place-row-meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.place-row-note { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.place-row-ja { font-size: var(--fs-caption); line-height: 1.5; color: var(--text-3); }
.place-row-mark { display: grid; place-items: center; min-width: 28px; color: var(--text-2); }
.place-row .star { color: var(--text); }
.place-row.is-highlight .place-row-icon { background: var(--text); color: var(--surface); }
.place-row.is-placeholder .place-row-name { font-style: italic; color: var(--text-2); }
.place-row.is-placeholder .place-row-icon { background: transparent; border: 1px dashed var(--line-strong); }
.place-row.is-visited .place-row-name { color: var(--text-2); }

/* ── Segmented control (44 px segments: every user, Settings included) ─────── */
.segmented {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; gap: 2px;
  border-radius: var(--r-2); background: var(--surface-inset); min-height: 48px;
}
.segment {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap-min); padding: 0 14px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2);
  font: 500 var(--fs-small)/1 var(--font-sans); cursor: pointer; white-space: nowrap;
}
.segment.is-selected { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; }
.segment:disabled { opacity: .45; cursor: default; }

/* ── Search ────────────────────────────────────────────────────────────────── */
.search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search-input {
  width: 100%; height: 44px; padding: 0 44px 0 40px; border: 1px solid var(--text-3); border-radius: var(--r-2);
  background: var(--surface); color: var(--text); font: 400 16px/1 var(--font-sans); -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 0; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
}
.search-clear[hidden] { display: none; }

/* ── Checkbox ──────────────────────────────────────────────────────────────── */
.checkbox { position: relative; display: flex; align-items: flex-start; gap: var(--s-3); min-height: 44px; padding: 10px 0; cursor: pointer; }
.checkbox-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox-box {
  display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: var(--r-1);
  border: 1.5px solid var(--text-3); background: var(--surface); color: transparent;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2);
}
.checkbox-input:checked + .checkbox-box { background: var(--text); border-color: var(--text); color: var(--surface); }
.checkbox-input:focus-visible + .checkbox-box { box-shadow: var(--focus-ring); }
.checkbox-text { display: grid; gap: 2px; padding-top: 1px; min-width: 0; }
.checkbox-label { font-size: var(--fs-body); line-height: 22px; }
.checkbox-sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-3); }
.checkbox.is-checked .checkbox-label { color: var(--text-3); }
.checkbox:has(.checkbox-input:checked) .checkbox-label { color: var(--text-3); }

/* ── Route strip (metro line) ──────────────────────────────────────────────── */
.route-strip { --ring: var(--bg); position: relative; }
.route-track { display: flex; align-items: flex-start; gap: 2px; }
.route-seg {
  flex: 1 1 0; min-width: 0; display: grid; gap: 6px; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left;
}
button.route-seg { cursor: pointer; }
.route-seg.is-travel { flex: 0 0 24px; }
.route-bar { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--tone); margin-top: 3px; }
.route-seg.is-travel .route-bar {
  background: repeating-linear-gradient(90deg, var(--tone-ink) 0 4px, transparent 4px 7px); height: 2px; margin-top: 5px;
}
.route-seg.is-open .route-bar { background: repeating-linear-gradient(90deg, var(--tone-ink) 0 6px, transparent 6px 10px); opacity: .7; }
.route-station {
  position: absolute; left: -2px; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translateY(-50%);
  background: var(--tone); box-shadow: 0 0 0 2px var(--ring);
}
.route-label {
  /* One visible line; pieces that don't fit wrap onto a clipped second line (see routeStrip) */
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; row-gap: 0; min-width: 0;
  height: var(--lh-micro); overflow: hidden; color: var(--text-2);
  font: 500 var(--fs-micro)/var(--lh-micro) var(--font-sans);
}
.route-label .icon { color: var(--tone-ink); flex-shrink: 0; }
.route-label-text, .route-label-nights { white-space: nowrap; }
.route-today { position: absolute; top: 50%; transform: translate(-50%, -50%); line-height: 0; }
.route-today .hinomaru { box-shadow: 0 0 0 2px var(--ring); }
.route-strip.is-inverted { --ring: var(--hero-bg); }
.route-strip.is-inverted .route-label { color: var(--hero-text-2); }

/* ── Bottom sheet (mobile) / side panel (desktop) ──────────────────────────── */
.sheet-root { position: fixed; inset: 0; z-index: var(--z-scrim); pointer-events: none; }
.sheet-root.is-open, .sheet-root.is-closing { pointer-events: auto; }
.sheet-scrim {
  position: absolute; inset: 0; background: var(--scrim); opacity: 0;
  transition: opacity var(--dur-sheet) var(--ease-sheet);
}
.sheet-root.is-open .sheet-scrim { opacity: 1; }
.sheet-root.is-closing .sheet-scrim { opacity: 0; transition-duration: var(--dur-sheet-out); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  max-height: calc(92dvh - var(--safe-top)); display: flex; flex-direction: column;
  margin: 0 auto; max-width: var(--sheet-max);
  background: var(--surface); border-radius: var(--r-4) var(--r-4) 0 0; box-shadow: var(--shadow-sheet);
  border-top: 1px solid var(--sheet-edge); outline: none;
  transform: translateY(100%); transition: transform var(--dur-sheet) var(--ease-sheet);
}
.sheet-root.is-open .sheet { transform: none; }
.sheet-root.is-closing .sheet { transform: translateY(100%); transition-duration: var(--dur-sheet-out); }
.sheet.is-dragging { transition: none; }
.sheet-grabber { display: grid; place-items: center; height: 20px; flex-shrink: 0; cursor: grab; touch-action: none; }
.sheet-grabber span { width: 36px; height: 4px; border-radius: 2px; background: var(--text-3); opacity: .4; }
.sheet-close { position: absolute; top: 8px; right: 8px; z-index: 1; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 4px var(--s-5) calc(var(--s-6) + var(--safe-bottom));
}
@media (min-width: 1024px) {
  .sheet {
    left: auto; top: 0; right: 0; bottom: 0; width: var(--panel-w); max-width: none; max-height: none; margin: 0;
    border-radius: 0; border-top: 0; border-left: 1px solid var(--sheet-edge); box-shadow: var(--shadow-panel);
    transform: translateX(100%);
  }
  .sheet-root.is-closing .sheet { transform: translateX(100%); }
  .sheet-grabber { display: none; }
  .sheet-body { padding: var(--s-6) var(--s-6) var(--s-8); }
  .sheet-close { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-scrim { transition: opacity 120ms linear !important; transform: none !important; }
  .sheet-root:not(.is-open) .sheet { opacity: 0; }
}

/* ── Place sheet content ───────────────────────────────────────────────────── */
.place-sheet { display: grid; gap: var(--s-5); padding-top: var(--s-2); }
.ps-head { position: relative; display: grid; gap: 6px; padding-right: 48px; }
.ps-stamp { position: absolute; top: 4px; right: 52px; }
.ps-stamp:empty { display: none; }
.ps-eyebrow {
  display: flex; align-items: center; gap: 6px; margin: 0; color: var(--tone-ink);
  font: 600 var(--fs-label)/var(--lh-label) var(--font-sans); letter-spacing: var(--track-label); text-transform: uppercase;
}
.ps-title { margin: 0; font: 500 var(--fs-title-1)/var(--lh-title-1) var(--font-serif); font-variation-settings: 'opsz' 36; letter-spacing: -.005em; }
.ps-title.is-placeholder { font-style: italic; color: var(--text-2); }
.ps-ja { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 600; color: var(--text-2); font-feature-settings: 'palt'; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ps-notes { display: grid; gap: var(--s-2); }
.ps-body { display: grid; gap: var(--s-2); }
.ps-body > .section-head, .ps-section > .section-head { margin: var(--s-3) 0 var(--s-2); }
.ps-why { margin: 0; font: 400 italic 17px/1.5 var(--font-serif); color: var(--text); max-width: 62ch; }
.ps-section { display: grid; gap: var(--s-2); }
.ps-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ps-plan-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--tone-wash); }
.ps-plan-day { font: 600 var(--fs-small)/var(--lh-small) var(--font-sans); color: var(--text); text-decoration: none; }
.ps-plan-day:hover { text-decoration: underline; text-underline-offset: 3px; }
.ps-plan-note { flex-basis: 100%; margin: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
.ps-tips { margin: 0; font-size: var(--fs-small); line-height: 1.55; color: var(--text-2); max-width: 62ch; }
.ps-distance { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: var(--fs-caption); color: var(--text-2); }
.ps-approx { color: var(--text-3); }
.ps-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin-top: var(--s-2); }

/* ── Taxi / show card (fullscreen, white in both themes) ───────────────────── */
.showcard {
  position: fixed; inset: 0; z-index: var(--z-fullscreen); display: flex; flex-direction: column;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: var(--show-bg); color: var(--show-text); opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.showcard.is-open { opacity: 1; }
.showcard.is-inverted { background: var(--show-text); color: var(--show-bg); }
.showcard-bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); }
.showcard-hint { flex: 1; margin: 0; text-align: center; font: 400 var(--fs-caption)/1.3 var(--font-sans); color: var(--show-text-2); }
.showcard.is-inverted .showcard-hint, .showcard.is-inverted .showcard-latin { color: var(--show-line); }
.showcard-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--show-line); background: transparent; color: inherit; cursor: pointer;
}
.showcard-body { flex: 1; overflow: auto; display: grid; align-content: center; gap: var(--s-6); padding: var(--s-4) var(--s-6); }
.showcard-main, .showcard-side { display: grid; gap: var(--s-3); }
.showcard-lead { margin: 0; font: 400 18px/1.5 var(--font-jp); }
.showcard-name {
  margin: 0; font: 600 clamp(32px, 9vw, 56px)/1.3 var(--font-jp); font-feature-settings: 'palt'; overflow-wrap: anywhere;
}
.showcard-name.is-latin { font-family: var(--font-serif); font-weight: 500; }
.showcard-address { margin: 0; display: grid; font: 400 clamp(22px, 6vw, 36px)/1.5 var(--font-jp); }
.showcard-address.is-latin { font-family: var(--font-sans); }
.showcard-phone {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none;
  font: 600 24px/1 var(--font-sans); font-variant-numeric: tabular-nums;
}
.showcard-latin { margin: 0; padding: var(--s-3) var(--s-6) var(--s-5); font: 400 var(--fs-caption)/1.4 var(--font-sans); color: var(--show-text-3); }
@media (orientation: landscape) and (max-height: 520px) {
  .showcard-body { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .showcard-name { font-size: clamp(28px, 6vh + 12px, 48px); }
}
