/* 道標 — 滲テーマ (25h brand: Sumi + Ruri + Washi)
   vessel の変数系を継承。依存ゼロ、単一ファイル。 */

:root {
  --washi: #f6f4f0;
  --sumi: #1e1e24;
  --ruri: #4a5e8a;
  --washi-panel: #eceae4;
  --hairline: #d9d5cd;
  --muted: #6b6b73;
  --surface: #ffffff;
  --alert: #8a4a4a;
  --shadow: 0 1px 2px rgba(30, 30, 36, 0.04), 0 4px 16px rgba(30, 30, 36, 0.06);
  --font: "Zen Kaku Gothic New", system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  --measure: 42rem;
  --radius: 16px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --washi: #17171b;
    --sumi: #e8e4dc;
    --ruri: #8fa3cf;
    --washi-panel: #202026;
    --hairline: #34343d;
    --muted: #9a9aa4;
    --surface: #1d1d23;
    --alert: #c98b8b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- header ---------- */

.head {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.head h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.tagline {
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ---------- セットアップ (タップだけで進む) ---------- */

.setup-inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.setup-lead {
  margin: 0 0 2.75rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.86rem;
  line-height: 2;
  color: var(--muted);
}

.step-q {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.7;
}

.step-hint {
  margin: 0 0 1.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
}

.step-q + .choices { margin-top: 1.6rem; }

.step-note {
  margin: 1.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.choices.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.95rem 1.15rem;
  background: var(--surface);
  color: var(--sumi);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.choices.grid .choice {
  text-align: center;
  align-items: center;
  padding: 0.85rem 0.5rem;
}

.choice:hover { border-color: var(--ruri); }
.choice:active { transform: scale(0.99); }

.choice[aria-pressed="true"] {
  background: var(--ruri);
  border-color: var(--ruri);
  color: #fff;
}

.choice-label {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.choice-note {
  font-size: 0.74rem;
  color: var(--muted);
}

.choice[aria-pressed="true"] .choice-note { color: rgba(255, 255, 255, 0.75); }

.setup-foot {
  margin-top: 2rem;
  text-align: center;
}

.back {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back:hover { color: var(--sumi); }

/* 確認 */

.confirm-head {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.confirm-list {
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* 一行そのものが「その項目を変える」ボタン */
.sum-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0 1.2rem;
  width: 100%;
  padding: 0.7rem 0.2rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.sum-row:hover { background: var(--washi-panel); }

.sum-q {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sum-v {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--sumi);
}

.sum-edit {
  font-size: 0.72rem;
  color: var(--ruri);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

#confirm .back { display: block; margin: 1rem auto 0; }

.go {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem;
  background: var(--sumi);
  color: var(--washi);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.go:disabled {
  opacity: 0.28;
  cursor: default;
}

/* ---------- 道 ---------- */

.road {
  max-width: var(--measure);
  margin: 0 auto;
}

.road-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--hairline);
}

.where {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.where strong {
  color: var(--sumi);
  font-weight: 500;
}

.relink {
  flex: none;
  background: none;
  border: none;
  color: var(--ruri);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 収録できていない段階 */

.empty {
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.empty-head {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 500;
}

.empty-body {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.95;
}

.empty-body:last-child { margin-bottom: 0; }

/* これから歩く道 — 縦に流れる。急かさず、位置だけを見せる */

.map { margin-bottom: 3.5rem; }

.map h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.map-why {
  margin: 0.4rem 0 1.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.map-list {
  margin: 0;
  padding: 0 0 0 1.4rem;
  list-style: none;
  border-left: 1px solid var(--hairline);
}

.node {
  position: relative;
  padding-bottom: 1.7rem;
}

.node:last-child { padding-bottom: 0; }

/* 道の上の点 */
.node::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 0.42em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--washi);
  border: 1px solid var(--hairline);
}

.node.past::before { background: var(--hairline); border-color: var(--hairline); }
.node.here::before {
  background: var(--ruri);
  border-color: var(--ruri);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ruri) 18%, transparent);
}
.node.next::before { border-color: var(--ruri); }

.node-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.node-title {
  font-size: 0.94rem;
  letter-spacing: 0.02em;
}

.node.past .node-title { color: var(--muted); }
.node.here .node-title { color: var(--ruri); }

.node-when {
  font-size: 0.74rem;
  color: var(--muted);
}

.node-tag {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ruri);
}

.node-lead {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.9;
}

.node-todo {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  opacity: 0.75;
}

/* 取り返せないもの */

/* 節そのものは飾らない — 赤の信号はカード側 (.ccard.irr) の一本だけに集約する
   (外枠+カードの二重色枠は Noēs 2026-07-22 指摘で撤去) */
.urgent {
  margin-bottom: 3.5rem;
}

.urgent h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--alert);
}

.urgent-why {
  margin: 0.4rem 0 1.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* 時系列 */

.stage {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

.stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.stage-head::-webkit-details-marker { display: none; }

.stage-title::before {
  content: "＋";
  color: var(--muted);
  font-weight: 400;
  margin-right: 0.6em;
  font-size: 0.85em;
}

.stage[open] .stage-title::before { content: "−"; }

.stage-count {
  flex: none;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.stage-when {
  margin: -0.3rem 0 1.4rem;
  padding-left: 1.55em;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stage > .item { padding-left: 1.55em; }
.stage > .item:last-child { padding-bottom: 1.6rem; }

/* 項目 */

.item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline);
}

.item:last-child { border-bottom: none; }

.item-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.check {
  flex: none;
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 0.32rem;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.check[aria-pressed="true"] {
  background: var(--ruri);
  border-color: var(--ruri);
}

.check[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.item-body { flex: 1; min-width: 0; }

.item-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

.item.done .item-title {
  opacity: 0.4;
  text-decoration: line-through;
  text-decoration-color: var(--hairline);
}

.item.done .item-meta,
.item.done .item-risk { opacity: 0.4; }

.item-meta {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.item-meta .due {
  color: var(--sumi);
  font-weight: 500;
}

.item-meta .due.soon { color: var(--alert); }

.item-meta .sep { opacity: 0.4; margin: 0 0.5em; }

.item-risk {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--alert);
  line-height: 1.7;
}

.item-value {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--ruri);
  line-height: 1.7;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.badge {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  color: var(--muted);
}

.badge.gap { border-color: var(--alert); color: var(--alert); }
.badge.blocking { border-color: var(--ruri); color: var(--ruri); }
.badge.unverified { opacity: 0.7; }

/* 控え (この端末の中だけ) */

.keep { margin-top: 0.7rem; }

.kept-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.kept-at {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ruri);
  letter-spacing: 0.04em;
}

/* 戻せることが見えている、が肝。控えめだが埋もれない位置に置く */
.undo {
  padding: 0.15rem 0.55rem;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.undo:hover { border-color: var(--ruri); color: var(--ruri); }

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ask {
  padding: 0.4rem 0.8rem;
  background: none;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.ask:hover { border-color: var(--ruri); color: var(--ruri); }

.ask.copied {
  border-style: solid;
  border-color: var(--ruri);
  color: var(--ruri);
}

.keep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.chip {
  display: flex;
  align-items: stretch;
  background: var(--washi-panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 100%;
}

.chip-view {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--sumi);
  cursor: pointer;
  text-align: left;
}

.chip-view:hover { background: rgba(74, 94, 138, 0.06); }

.chip-thumb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chip-thumb.doc {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chip-name { display: flex; flex-direction: column; min-width: 0; }

.chip-file {
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-date { font-size: 0.68rem; color: var(--muted); }

/* × はフォントのサブセットに無く別の記号に化けるため、線で描く */
.chip-del {
  flex: none;
  position: relative;
  width: 2.3rem;
  background: none;
  border: none;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
  cursor: pointer;
}

.chip-del::before,
.chip-del::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  background: currentColor;
}

.chip-del::before { transform: translate(-50%, -50%) rotate(45deg); }
.chip-del::after { transform: translate(-50%, -50%) rotate(-45deg); }

.chip-del:hover { color: var(--alert); }

.keep-add {
  padding: 0.4rem 0.8rem;
  background: none;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.keep-add:hover { border-color: var(--ruri); color: var(--ruri); }

.item.done .keep { opacity: 1; }

/* やること (手順と一次情報) */

details.todo {
  margin-top: 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--washi-panel);
}

details.todo > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  color: var(--ruri);
  cursor: pointer;
  list-style: none;
}

details.todo > summary::-webkit-details-marker { display: none; }

.todo-label { flex: none; }

.todo-count {
  flex: none;
  padding: 0 0.45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

/* 進み具合。細い帯にとどめる — 割合で急かさない */
.todo-bar {
  flex: 1;
  max-width: 8rem;
  height: 2px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}

.todo-fill {
  display: block;
  height: 100%;
  background: var(--ruri);
  transition: width 0.25s;
}

details.todo.all-done > summary { color: var(--ruri); }
details.todo.all-done .todo-count { opacity: 1; }

.todo-scope {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.76rem;
  color: var(--muted);
}

/* 住所への静かな案内 (1 情報 1 箇所 — 重複の代わりに置く一行) */
.cross-note {
  margin: 1.2rem 0 2rem;
  font-size: 0.76rem;
  color: var(--muted);
  opacity: 0.85;
}

/* 手順は一つずつ。細かいほど、始めやすく、途中で止めやすい */
.todo-steps { list-style: none; padding-left: 0; }

/* しおり — 戻ってきた時に、どこで止めたかが静かに残っている */
.step-mark {
  display: inline-block;
  margin-left: 0.45rem;
  vertical-align: 0.08em;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--ruri);
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--ruri);
  white-space: nowrap;
}

.step.next .step-text { color: var(--sumi); }

.step {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.step-check {
  flex: none;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: 0.42em;
  padding: 0;
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.step-check[aria-pressed="true"] {
  background: var(--ruri);
  border-color: var(--ruri);
}

.step-check[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.step-main { flex: 1; min-width: 0; }

.step.done .step-text { color: var(--muted); }

.step-date {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.55;
  margin-top: 0.1rem;
}

.step-finish {
  margin-top: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: none;
  border: 1px solid var(--ruri);
  border-radius: var(--radius-sm);
  color: var(--ruri);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.todo-body {
  padding: 0 0.9rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.95;
}

.todo-steps {
  margin: 0.2rem 0 0;
  /* padding-left は上の定義 (0) に任せる — 1.3rem の字下げ復活が本文幅を奪っていた */
}

.todo-steps li { margin-bottom: 0.5rem; }

.todo-head {
  margin: 1rem 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.todo-docs,
.todo-links {
  margin: 0;
  padding-left: 1.1rem;
}

.todo-docs li,
.todo-links li { margin-bottom: 0.35rem; }

.todo-links a {
  color: var(--ruri);
  text-underline-offset: 3px;
}

.link-note {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.7;
}

.todo-caveat {
  margin: 0.7rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  opacity: 0.85;
}

/* 詳細の折りたたみ */

details.more { margin-top: 0.6rem; }

details.more > summary {
  font-size: 0.76rem;
  color: var(--ruri);
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.04em;
}

details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }

.more-body {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--washi-panel);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.85;
}

.more-body p { margin: 0 0 0.7rem; }
.more-body p:last-child { margin-bottom: 0; }
.more-body ul { margin: 0.3rem 0 0.7rem; padding-left: 1.1rem; }
.more-body li { margin-bottom: 0.45rem; }
.more-body dt { font-weight: 500; margin-top: 0.6rem; }
.more-body dd { margin: 0.1rem 0 0; color: var(--muted); }
.more-body .label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.15rem;
}
.more-body .uncertain {
  color: var(--muted);
  font-size: 0.78rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--hairline);
}

/* 決めること */

.opt-row {
  padding: 0.6rem 0;
  border-bottom: 1px dotted var(--hairline);
}
.opt-row:last-child { border-bottom: none; }
.opt-label { font-weight: 500; }
.opt-eff { color: var(--ruri); }
.opt-side { color: var(--muted); }

/* 閉じ */

.closing {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.progress-note {
  margin: 0 0 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.unrec summary {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.unrec ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.unrec li { margin-bottom: 0.4rem; }

.unrec-note {
  margin: 1rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 480px) {
  body { padding: 0 1rem 4rem; }
  .head { padding: 2.5rem 0 2rem; }
}

/* ================= アプリ骨格 (下タブ4枚、2026-07-22 本移植) ================= */

/* 下タブが足元に居座る分、本文の底を空ける */
.road { padding-bottom: 5.5rem; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--washi);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar::before {
  content: "";
  display: block;
}

.tabbar-inner,
.tabbar {
  display: block;
}

.tabbar {
  display: flex;
  justify-content: center;
}

.tabbar > .tab {
  flex: 1;
  max-width: 8rem;
  background: none;
  border: none;
  padding: 0.5rem 0 0.65rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.tab.on { color: var(--ruri); }

.pane-lead {
  margin: 0.2rem 0 1.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.9;
}

/* ---------- 道標: 三分割の見出し ---------- */

.cat { margin: 2.2rem 0 0.2rem; }
.cat:first-child { margin-top: 0.4rem; }

.cat-h {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.cat-tag {
  font-size: 0.66rem;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0 0.45rem;
}

.cat-note {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.sub-h {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 1.6rem 0 0.5rem;
}

/* ---------- 軽いカード (一覧用) ---------- */

.ccard {
  width: 100%;
  text-align: left;
  display: block;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}

.ccard:hover { border-color: var(--ruri); }
.ccard.irr { border-left: 3px solid var(--alert); }
.ccard.done .ccard-t { color: var(--muted); }

.ccard-t { font-size: 0.92rem; color: var(--sumi); line-height: 1.6; }

.ccard-due { font-size: 0.72rem; color: var(--muted); margin-top: 0.22rem; }
.ccard-due.soon { color: var(--alert); }
.ccard-due.ok { color: var(--ruri); }

.ccard-prog {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: var(--ruri);
  margin-top: 0.32rem;
}

.cbar {
  width: 3.2rem;
  height: 2px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}

.cbar > span { display: block; height: 100%; background: var(--ruri); }

.ccard-flag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.64rem;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0 0.45rem;
  opacity: 0.85;
}

/* stage (折りたたみ) の中のカードに少し呼吸を */
.stage > .ccard { margin-left: 0.2rem; margin-right: 0.2rem; }
.stage > .ccard:last-child { margin-bottom: 1.2rem; }

/* ---------- 詳細 (潜り込み) ---------- */

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--washi);
  display: none;
  flex-direction: column;
}

.detail-view.on { display: flex; }

.d-back {
  flex: none;
  background: none;
  border: none;
  color: var(--ruri);
  font-family: inherit;
  font-size: 0.84rem;
  text-align: left;
  padding: 1.1rem 1.2rem 0.5rem;
  cursor: pointer;
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
}

.d-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.4rem 1.2rem 3rem;
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
}

/* 詳細の中では item の左チェック列をそのまま使う */
.d-body .item { border-bottom: none; }

/* ---------- 地図: 分岐 ---------- */

.node.dim { opacity: 0.45; }

.fork {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.fork b { color: var(--sumi); font-weight: 500; }
.fork b.off { font-weight: 400; opacity: 0.55; }

.branch-note {
  margin: 0.4rem 0 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
}

.fork-d {
  margin-top: 0.5rem;
  padding: 0.35rem 0.7rem;
  background: none;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ruri);
  font-family: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  text-align: left;
}

/* ---------- 手引き ---------- */

.trap-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.9;
}

.trap-list li { margin-bottom: 0.45rem; }

/* ---------- 設定 ---------- */

.set-block { margin-top: 2rem; }
.set-block:first-of-type { margin-top: 0.6rem; }

.set-block h2 {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.set-block p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.3rem 0;
  line-height: 1.9;
}

.set-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 1.1rem;
  align-items: baseline;
  width: 100%;
  padding: 0.65rem 0.1rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.set-row:hover { background: var(--washi-panel); }

.set-q { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.set-v { font-size: 0.92rem; font-weight: 500; color: var(--sumi); }
.set-e { font-size: 0.7rem; color: var(--ruri); white-space: nowrap; }

.keep-owner {
  margin: 0.9rem 0 0.3rem;
  font-size: 0.76rem;
  color: var(--sumi);
}

.wipe {
  margin-top: 0.6rem;
  padding: 0.5rem 0.9rem;
  background: none;
  border: 1px solid var(--alert);
  color: var(--alert);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
