:root {
  --ink: #111119;
  --paper: #e8e3d7;
  --muted: #a5a095;
  --acid: #d8ff4f;
  --coral: #ff6659;
  --line: rgba(232, 227, 215, 0.2);
}

* { box-sizing: border-box; }
html { background: var(--ink); color: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  color: var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
}
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.hidden { display: none !important; }
.grain {
  position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.site-header {
  height: 92px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 clamp(24px, 5vw, 72px); position: relative; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 0; cursor: pointer; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; background: var(--acid);
  color: var(--ink); font: 800 15px/1 "Yu Mincho", serif;
}
.brand-name { font: 500 22px/1.2 "Yu Mincho", serif; letter-spacing: .12em; }
.brand-name small { display: block; margin-top: 4px; color: var(--muted); font: 9px/1 Arial, sans-serif; letter-spacing: .28em; }
.header-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 10px/1 Arial, sans-serif; letter-spacing: .13em; }
.header-note span { color: var(--acid); }
.header-note i { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 10px var(--coral); }
.header-actions { display: flex; align-items: center; gap: 22px; }
.record-button, .history-button {
  border: 1px solid var(--acid); background: transparent; color: var(--acid);
  padding: 9px 12px; font-size: 10px; font-weight: 700; letter-spacing: .08em; cursor: pointer;
}
.record-button:hover, .history-button:hover { background: var(--acid); color: var(--ink); }
.history-button { border-color: var(--line); color: var(--paper); }
.history-button b {
  display: inline-grid; min-width: 18px; height: 18px; margin-left: 5px; place-items: center;
  border-radius: 9px; background: var(--coral); color: var(--ink); font-size: 9px;
}
.screen { display: none; }
.screen.active { display: block; animation: screen-in .45s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; position: relative; }
.intro-layout {
  min-height: calc(100vh - 92px); display: grid; grid-template-columns: 1.1fr .9fr;
  align-items: center; gap: clamp(48px, 8vw, 120px); padding: 70px 0 110px;
}
.eyebrow, .reading-block > span, .action-card span, .followup > span {
  color: var(--acid); font: 10px/1.5 Arial, sans-serif; letter-spacing: .22em;
}
.intro-copy h1 {
  margin: 24px 0 32px; font: 500 clamp(44px, 6.2vw, 88px)/1.22 "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: -.07em;
}
.intro-copy h1 em { color: var(--acid); font-style: normal; position: relative; }
.intro-copy h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--acid); }
.lead { color: #c5c0b5; font: 17px/2 "Yu Mincho", serif; }
.oracle-panel {
  background: var(--paper); color: var(--ink); padding: clamp(28px, 4vw, 48px);
  position: relative; box-shadow: 20px 20px 0 rgba(216,255,79,.12);
}
.oracle-panel::before {
  content: "問"; position: absolute; right: 22px; top: -30px; color: var(--coral);
  font: 700 80px/1 "Yu Mincho", serif;
}
.oracle-panel label, .oracle-panel legend { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.oracle-panel textarea {
  width: 100%; resize: none; border: 0; border-bottom: 2px solid var(--ink);
  background: transparent; color: var(--ink); padding: 18px 0; margin-top: 8px;
  font: 17px/1.8 "Yu Mincho", serif;
}
.oracle-panel textarea::placeholder { color: #88847b; }
.counter { margin: 6px 0 26px; text-align: right; color: #716d64; font: 9px/1 Arial, sans-serif; }
.oracle-panel fieldset { border: 0; padding: 0; margin: 0 0 32px; }
.category-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.category-list button { border: 1px solid #aaa59a; background: transparent; color: var(--ink); padding: 8px 12px; font-size: 11px; cursor: pointer; }
.category-list button.selected { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.primary-button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 0; background: var(--coral); color: var(--ink); padding: 18px 20px;
  font-weight: 800; cursor: pointer;
}
.primary-button:disabled { opacity: .3; cursor: not-allowed; }
.primary-button b { font-size: 24px; }
.privacy-note { margin: 14px 0 -12px; color: #716d64; text-align: center; font-size: 10px; }
.saved-reading { border: 1px solid var(--ink); margin-bottom: 32px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-reading span { color: #716d64; font: 10px/1.4 Arial, sans-serif; }
.saved-reading strong { display: block; margin-top: 4px; font: 600 13px/1.5 "Yu Mincho", serif; }
.saved-reading p { max-width: 260px; margin: 6px 0 0; color: #5f5b53; font: 12px/1.55 "Yu Mincho", serif; }
.saved-reading button {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 9px 11px; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.saved-reading button:hover { background: transparent; color: var(--ink); }
.intro-index { position: absolute; left: -1vw; bottom: 28px; display: flex; align-items: flex-end; gap: 10px; color: rgba(232,227,215,.1); }
.intro-index b { font: 120px/.7 Arial, sans-serif; letter-spacing: -.1em; }
.intro-index span { font: 8px/1 Arial, sans-serif; letter-spacing: .18em; }
.cast-layout {
  min-height: calc(100vh - 92px); padding: 45px 0 90px;
  display: flex; flex-direction: column; align-items: center;
}
.cast-progress { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; font-family: "Yu Mincho", serif; }
.cast-progress strong { color: var(--acid); font: 20px/1 Arial, sans-serif; }
.hexagram-stage {
  width: min(310px, 78vw); height: 300px; margin: 15px auto 25px; padding: 45px;
  border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center;
  gap: 20px; position: relative;
}
.hexagram-stage::before, .hexagram-stage::after { content: ""; position: absolute; width: 18px; height: 18px; }
.hexagram-stage::before { left: -1px; top: -1px; border-left: 2px solid var(--acid); border-top: 2px solid var(--acid); }
.hexagram-stage::after { right: -1px; bottom: -1px; border-right: 2px solid var(--acid); border-bottom: 2px solid var(--acid); }
.hex-line { display: flex; gap: 16px; }
.hex-line i { height: 9px; background: var(--paper); flex: 1; transition: .35s ease; }
.hex-line.solid { gap: 0; animation: line-in .45s ease both; }
.hex-line.broken { animation: line-in .45s ease both; }
.hex-line.empty i { background: rgba(232,227,215,.08); }
@keyframes line-in { from { transform: scaleX(0); opacity: 0; } }
.choice-copy { text-align: center; margin: 38px 0 0; }
.choice-copy span {
  display: block; color: var(--paper);
  font: 600 clamp(18px, 2.3vw, 27px)/1.5 "Yu Mincho", serif;
  letter-spacing: .04em;
}
.choice-copy h2 { margin: 7px 0 0; color: var(--acid); font: 500 clamp(22px, 4vw, 35px)/1.5 "Yu Mincho", serif; }
.binary-choice { display: grid; grid-template-columns: repeat(2, minmax(140px, 230px)); gap: 10px; }
.binary-choice button {
  border: 1px solid var(--paper); background: transparent; padding: 18px;
  font: 500 18px/1.4 "Yu Mincho", serif; cursor: pointer; transition: .2s ease;
}
.binary-choice button:hover { border-color: var(--acid); background: var(--acid); color: var(--ink); }
.binary-choice small { display: block; margin-bottom: 5px; color: var(--muted); font: 9px/1 Arial, sans-serif; letter-spacing: .2em; }
.binary-choice button:hover small { color: var(--ink); }
.result-layout { padding: 70px 0 110px; }
.transition-note {
  margin: 0 0 30px; padding: 14px 18px;
  border-left: 4px solid var(--coral); background: rgba(255,112,92,.1);
  color: var(--paper); font: 600 13px/1.7 "Yu Mincho", serif;
}
.revisit-note {
  margin: 0 0 30px; padding: 12px 18px;
  border-left: 4px solid var(--muted); background: rgba(165,160,149,.09);
  color: var(--muted); font: 13px/1.7 "Yu Mincho", serif;
}
.result-heading {
  display: grid; grid-template-columns: 110px 180px 1fr; gap: 40px; align-items: end;
  border-bottom: 1px solid var(--line); padding-bottom: 45px;
}
.scene-number { color: var(--muted); font: 8px/1.5 Arial, sans-serif; letter-spacing: .2em; }
.scene-number strong { display: block; margin: 8px 0; color: var(--paper); font-size: 74px; line-height: .9; letter-spacing: -.08em; }
.scene-number span { font-size: 7px; }
.result-hexagram { display: flex; gap: 22px; align-items: center; }
.kanji { color: var(--acid); font: 100px/1 "Yu Mincho", serif; }
#result-lines { width: 64px; display: flex; flex-direction: column; gap: 7px; }
.result-line { width: 100%; display: flex; gap: 9px; }
.result-line i { display: block; flex: 1; height: 3px; background: var(--paper); }
.result-line.solid { gap: 0; }
.scene-title p { color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.scene-title h1 { margin: 12px 0 16px; font: 500 clamp(38px, 5vw, 72px)/1.2 "Yu Mincho", serif; letter-spacing: -.06em; }
.scene-title > span { color: #b8b2a7; font: 15px/1.8 "Yu Mincho", serif; }
.result-context {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px;
  border-left: 1px solid rgba(232,227,215,.28); border-bottom: 1px solid rgba(232,227,215,.28);
  background: rgba(232,227,215,.09);
  box-shadow: inset 4px 0 0 var(--acid);
}
.result-context > div { padding: 22px 28px; border-right: 1px solid rgba(232,227,215,.28); }
.result-context span { color: var(--acid); font: 700 9px/1.4 Arial, sans-serif; letter-spacing: .12em; }
.result-context p { margin: 8px 0 0; color: #fffdf6; font: 600 15px/1.7 "Yu Mincho", serif; }
.reading-grid { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); }
.reading-block, .action-card { min-height: 220px; padding: clamp(28px, 4vw, 52px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reading-block p { margin: 26px 0 0; font: 500 clamp(16px, 2vw, 20px)/2 "Yu Mincho", serif; }
.reading-block.relief { background: rgba(232,227,215,.04); }
.action-card {
  grid-column: 1/-1; min-height: 0; background: var(--acid); color: var(--ink);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px;
}
.action-card span { color: var(--ink); }
.action-card h2 { max-width: 760px; margin: 20px 0 0; font: 600 clamp(24px, 3.4vw, 42px)/1.55 "Yu Mincho", serif; letter-spacing: -.04em; }
.action-card button {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 16px 20px; cursor: pointer; white-space: nowrap; font-weight: 700;
}
.action-card button:hover { background: transparent; color: var(--ink); }
.action-card.attention { animation: action-attention 1.2s ease; }
@keyframes action-attention {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: inset 0 0 0 5px var(--coral); }
}
.committed { border: 1px solid var(--ink); padding: 14px 18px; font-size: 11px; white-space: nowrap; }
.followup { width: min(760px, 100%); margin: 70px auto 40px; padding: 50px; border: 1px solid var(--coral); text-align: center; position: relative; }
.followup::before { content: "遷"; position: absolute; left: -26px; top: -40px; color: var(--coral); font: 80px/1 "Yu Mincho", serif; }
.followup h2 { margin: 14px 0 26px; font: 500 30px/1.5 "Yu Mincho", serif; }
.followup > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.followup button { border: 1px solid var(--paper); background: transparent; padding: 13px 18px; cursor: pointer; }
.followup button:hover { border-color: var(--coral); background: var(--coral); color: var(--ink); }
.followup p { margin: 22px 0 0; color: var(--muted); font-size: 10px; }
.history-layout { min-height: calc(100vh - 92px); padding: 70px 0 110px; }
.history-heading {
  display: flex; align-items: end; justify-content: space-between; gap: 40px;
  padding-bottom: 42px; border-bottom: 1px solid var(--line);
}
.history-heading h1 { margin: 15px 0 12px; font: 500 clamp(42px, 6vw, 76px)/1.2 "Yu Mincho", serif; letter-spacing: -.06em; }
.history-heading > div > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font: 14px/1.9 "Yu Mincho", serif; }
.history-heading > strong { color: var(--acid); text-align: right; font: 78px/.8 Arial, sans-serif; }
.history-heading > strong span { display: block; margin-top: 13px; color: var(--muted); font: 8px/1 Arial, sans-serif; letter-spacing: .2em; }
.history-list { border-left: 1px solid var(--line); }
.history-entry {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 220px;
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
}
.history-entry > div { padding: 28px; border-right: 1px solid var(--line); }
.history-entry > div:last-child { border-right: 0; }
.history-meta time { display: block; color: var(--paper); font: 600 12px/1.5 Arial, sans-serif; }
.history-meta span, .history-question span, .history-action span, .history-move > span {
  display: block; margin-bottom: 8px; color: var(--acid); font: 700 8px/1.4 Arial, sans-serif; letter-spacing: .14em;
}
.history-meta p, .history-question p, .history-action p { margin: 0; color: var(--muted); font: 12px/1.7 "Yu Mincho", serif; }
.history-meta p {
  display: inline-block; margin-top: 12px; padding: 5px 8px;
  background: var(--coral); color: var(--ink); font-weight: 800;
}
.history-body { display: grid; gap: 22px; }
.history-scene { display: flex; align-items: center; gap: 15px; }
.history-scene b { color: var(--acid); font: 32px/1 Arial, sans-serif; }
.history-scene i { color: var(--coral); font: normal 34px/1 "Yu Mincho", serif; }
.history-scene strong { font: 600 18px/1.5 "Yu Mincho", serif; }
.history-question {
  padding: 15px 17px; border-left: 3px solid var(--acid);
  background: rgba(216,255,79,.11);
}
.history-question span { color: var(--acid); }
.history-question p { color: #fffdf6; font-size: 14px; font-weight: 700; line-height: 1.8; }
.history-action p { color: var(--paper); font-size: 14px; }
.history-move { display: flex; flex-direction: column; justify-content: center; background: rgba(232,227,215,.04); }
.history-outcome { margin-bottom: 18px; color: var(--ink); background: var(--paper); padding: 7px 9px; align-self: flex-start; font-size: 10px; font-weight: 800; }
.history-outcome.done { background: var(--acid); }
.history-outcome.stalled { background: var(--coral); }
.history-destination { margin: 0; font: 600 14px/1.7 "Yu Mincho", serif; }
.history-destination b { color: var(--acid); font: 18px/1 Arial, sans-serif; }
.history-empty { margin: 50px 0; padding: 48px; border: 1px solid var(--line); text-align: center; }
.history-empty span { color: var(--paper); font: 600 20px/1.6 "Yu Mincho", serif; }
.history-empty p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.text-button { display: block; margin: 40px auto 0; padding: 6px 0; border: 0; border-bottom: 1px solid var(--paper); background: none; color: var(--muted); cursor: pointer; }
.error-screen.active { min-height: calc(100vh - 92px); display: grid; place-items: center; padding: 40px; text-align: center; }
.error-screen h1 { font: 500 42px/1.4 "Yu Mincho", serif; }
.error-screen > div > p:last-child { color: var(--muted); }
footer { border-top: 1px solid var(--line); padding: 28px clamp(24px, 5vw, 72px); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 9px; letter-spacing: .06em; }
footer p { margin: 0; text-align: right; }

@media (max-width: 760px) {
  .site-header { height: 76px; }
  .brand-name { display: none; }
  .header-note span, .header-note i { display: none; }
  .header-note { display: none; }
  .header-actions { gap: 7px; }
  .record-button, .history-button { padding: 8px 9px; font-size: 9px; }
  .record-button, .history-button { white-space: nowrap; }
  .page-shell { width: min(100% - 32px, 580px); }
  .intro-layout { grid-template-columns: 1fr; gap: 42px; padding: 50px 0 100px; }
  .intro-copy h1 { font-size: clamp(42px, 13vw, 64px); }
  .oracle-panel { padding: 28px 22px; box-shadow: 10px 10px 0 rgba(216,255,79,.12); }
  .oracle-panel::before { top: -22px; font-size: 62px; }
  .saved-reading { flex-direction: column; align-items: stretch; }
  .saved-reading p { max-width: none; }
  .saved-reading button { width: 100%; }
  .intro-index b { font-size: 80px; }
  .binary-choice { width: 100%; grid-template-columns: 1fr 1fr; }
  .result-layout { padding-top: 45px; }
  .result-heading { grid-template-columns: 72px 1fr; gap: 24px; }
  .scene-number strong { font-size: 54px; }
  .result-hexagram { justify-self: end; }
  .kanji { font-size: 68px; }
  #result-lines { width: 55px; }
  .scene-title { grid-column: 1/-1; }
  .scene-title h1 { font-size: 43px; }
  .result-context { grid-template-columns: 1fr; }
  .result-context > div { padding: 18px 20px; }
  .reading-grid { grid-template-columns: 1fr; }
  .reading-block, .action-card { grid-column: auto; min-height: 0; padding: 32px 24px; }
  .action-card { grid-template-columns: 1fr; align-items: start; }
  .action-card button, .committed { width: 100%; text-align: center; }
  .followup { padding: 42px 20px 30px; }
  .history-layout { padding-top: 45px; }
  .history-heading { align-items: start; }
  .history-heading > strong { font-size: 50px; }
  .history-entry { grid-template-columns: 1fr; }
  .history-entry > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px; }
  .history-entry > div:last-child { border-bottom: 0; }
  footer { display: block; line-height: 1.7; }
  footer p { margin-top: 8px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}

/* 48時間の経過。締切ではないので、急かす色（coral）は使わない */
.elapsed { margin: 10px 0 0; color: var(--muted); font: 11px/1.7 "Yu Mincho", serif; }
.action-card .elapsed { margin-top: 8px; color: rgba(17,17,25,.6); }
.followup .elapsed { margin: 10px 0 0; }

/* v2時代の履歴。journeysへ変換せず「以前の記録」として並べる（HANDOFF 第1段階） */
.history-legacy {
  display: block; width: fit-content; margin-top: 8px; padding: 4px 7px;
  background: var(--muted); color: var(--ink);
  font: 700 8px/1.4 Arial, sans-serif; font-style: normal; letter-spacing: .12em;
}

.upstairs { padding: 0 clamp(24px, 5vw, 72px) 34px; }
.upstairs a { color: var(--muted); text-decoration: none; font-size: 10px; letter-spacing: .18em; transition: color .25s; }
.upstairs a:hover { color: var(--acid); }

/* ============================================================
   第4段階 8×8の軌跡

   背景は assets/board.webp（架空の東洋古地図）。
   盤の位置は BOARD.md の実測値。等分割でよい。
   色は暗い盤面用の acid/coral ではなく、紙に合う墨・朱・鉱物緑を使う。
   ============================================================ */
:root {
  --sumi: #2f2f38;      /* 墨。街道 */
  --shu: #a8412c;       /* 朱。訪問した景の印 */
  --shusa: #b8573a;     /* 朱砂。引き直した水路 */
  --kou: #5f6d2c;       /* 鉱物顔料の鈍い緑。現在地だけに使う */
}
.map-section { margin: 0 0 56px; }
.map-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.map-switch button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 7px 11px; font-size: 10px; letter-spacing: .06em; cursor: pointer;
  max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-switch button.selected { border-color: var(--acid); color: var(--acid); }

.journey-map { position: relative; width: 100%; max-width: 760px; margin: 0 auto; }
.map-paper { display: block; width: 100%; height: auto; }
/* BOARD.md: x 5.762% / y 5.859% / size 88.281% */
.map-lines, .map-grid {
  position: absolute; left: 5.762%; top: 5.859%; width: 88.281%; height: 88.281%;
}
.map-lines { pointer-events: none; overflow: visible; }
.map-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
}
.map-cell {
  position: relative; border: 0; background: transparent; padding: 0; cursor: pointer;
  display: grid; place-items: center;
  font: 700 clamp(8px, 1.1vw, 11px)/1 Arial, sans-serif;
  color: rgba(17, 17, 25, .3);
}
.map-cell:focus-visible { outline: 2px solid var(--kou); outline-offset: -2px; }
/* 印の下に敷く紙色のハロー。墨の濃いマスでも朱印が読めるようにする（BOARD.md） */
.map-cell .halo {
  position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(238,232,216,.92) 45%, rgba(238,232,216,0) 72%);
}
.map-cell .seal {
  position: absolute; width: 44%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--shu); opacity: 0;
}
.map-cell b { position: relative; }
.map-cell.visited { color: #3a2118; }
.map-cell.visited .seal { opacity: .85; }
.map-cell.visited.deep .seal { border-width: 3px; opacity: 1; }
/* 同じ景に留まった回数。外周へ輪を重ねる */
.map-cell .stay {
  position: absolute; border-radius: 50%; border: 1px solid rgba(47,47,56,.5);
}
.map-cell .times {
  position: absolute; right: 6%; top: 4%; color: var(--shu);
  font: 700 clamp(7px, .9vw, 9px)/1 Arial, sans-serif;
}
.map-cell.here { color: #23300c; }
.map-cell.here .seal { border-color: var(--kou); background: rgba(95,109,44,.16); opacity: 1; }
.map-cell.here .halo { background: radial-gradient(circle, rgba(238,232,216,.95) 45%, rgba(238,232,216,0) 72%); }
.map-cell.here::after {
  content: ""; position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--kou); animation: here-pulse 2.8s ease-out infinite;
}
@keyframes here-pulse {
  0% { transform: scale(.72); opacity: .75; }
  70% { transform: scale(1.16); opacity: 0; }
  100% { opacity: 0; }
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center;
  margin: 18px 0 0; color: var(--muted); font-size: 10px; letter-spacing: .06em;
}
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend i { width: 22px; height: 0; border-top: 2px solid var(--sumi); }
.map-legend .lg-water { border-top: 2px dashed var(--shusa); }
.map-legend .lg-stay { width: 11px; height: 11px; border: 1px solid var(--muted); border-radius: 50%; }
.map-legend .lg-here { width: 11px; height: 11px; border: 2px solid var(--kou); border-radius: 50%; background: rgba(95,109,44,.25); }

.map-detail {
  max-width: 760px; margin: 16px auto 0; padding: 16px 18px;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.9;
}
.map-detail b { color: var(--paper); font: 600 15px/1.6 "Yu Mincho", serif; }
.map-detail i { color: var(--acid); font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  .map-cell.here::after { animation: none; opacity: .5; }
}

/* 第5段階 問いを閉じる */
.journey-close { max-width: 760px; margin: 14px auto 0; text-align: center; }
.journey-close > span {
  display: block; color: var(--acid); font: 10px/1.6 Arial, sans-serif; letter-spacing: .18em;
}
.journey-close.asking { border: 1px solid var(--line); padding: 18px; text-align: left; }
.journey-close textarea {
  width: 100%; resize: none; margin: 10px 0 12px; padding: 10px 12px;
  border: 1px solid var(--line); background: transparent; color: var(--paper);
  font: 14px/1.8 "Yu Mincho", serif;
}
.journey-close textarea::placeholder { color: rgba(165,160,149,.6); }
.close-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.close-actions button {
  border: 1px solid var(--acid); background: var(--acid); color: var(--ink);
  padding: 10px 14px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.close-actions button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.close-actions button:hover { opacity: .85; }
.journey-close.closed { border: 1px solid var(--line); padding: 20px 22px; text-align: left; }
.journey-close.closed dl {
  display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 6px 16px; margin: 14px 0 0;
}
.journey-close.closed dt { color: var(--muted); font: 10px/1.9 Arial, sans-serif; letter-spacing: .12em; }
.journey-close.closed dd { margin: 0; color: var(--paper); font: 13px/1.9 "Yu Mincho", serif; }
.journey-close .closing-note {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  color: #c5c0b5; font: 14px/2 "Yu Mincho", serif;
}
.switch-ask { border: 1px solid var(--ink); padding: 14px; margin: 0 0 16px; }
.switch-ask p { margin: 0 0 10px; color: var(--ink); font: 12px/1.7 "Yu Mincho", serif; }
.switch-ask .close-actions button {
  border-color: var(--ink); background: var(--ink); color: var(--paper);
}
.switch-ask .close-actions button.ghost { background: transparent; color: var(--ink); }
@media (max-width: 760px) {
  .journey-close.closed dl { grid-template-columns: 1fr; gap: 2px; }
  .journey-close.closed dd { margin-bottom: 8px; }
}

/* 第6段階 軌跡の一枚絵 */
.card-take { max-width: 760px; margin: 20px auto 0; text-align: center; }
.card-out:not(:empty) { margin-top: 18px; }
.card-out img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto 8px; }
.card-out p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .1em; }

/* 旅と旧記録の掃除 */
.journey-remove { max-width: 760px; margin: 10px auto 0; text-align: center; }
.journey-remove.asking, .legacy-remove.asking {
  border: 1px solid rgba(255,102,89,.35); padding: 16px 18px; text-align: left;
}
.journey-remove.asking p, .legacy-remove.asking p {
  margin: 0 0 12px; color: var(--coral); font: 12px/1.7 "Yu Mincho", serif;
}
.close-actions button.danger {
  border-color: var(--coral); background: transparent; color: var(--coral);
}
.close-actions button.danger:hover { background: var(--coral); color: var(--ink); }
.journey-close.stalled > span { color: var(--muted); }
.legacy-remove { margin: 26px auto 0; max-width: 760px; text-align: center; }

/* 振り返りへ降りる導線。景名のすぐ下に置く */
.to-followup {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--acid);
  font-size: 11px; letter-spacing: .1em;
  transition: border-color .25s, background .25s;
}
.to-followup:hover { border-color: var(--acid); background: rgba(216,255,79,.08); }
.to-followup i {
  width: 7px; height: 7px; border-right: 1px solid var(--acid);
  border-bottom: 1px solid var(--acid); transform: rotate(45deg) translate(-2px, -2px);
  animation: to-followup-nudge 2.4s ease-in-out infinite;
}
@keyframes to-followup-nudge {
  0%, 100% { transform: rotate(45deg) translate(-2px, -2px); }
  50% { transform: rotate(45deg) translate(1px, 1px); }
}
@media (prefers-reduced-motion: reduce) { .to-followup i { animation: none; } }
