/*
 * Musubi — R2 "Ai-iro Atlas"。藍（ai-iro）の地、朱（shu）のアクセント、金茶の注記、見出しは明朝。
 * **完成度は目的ではない。**ここは token ベースの本体。上書きファイルは作らない。
 *
 * デザイントークン（:root）:
 *   色・角丸・余白・書体はすべて `:root` の変数に集約する。直書きの色を増やさない。
 *   既存の変数名（--paper / --ink / --sub / --line / --accent / --bad / --badbg / --ok）は
 *   新トークンへの別名として残す（既存ルールがそのまま暗地で読めるように）。
 *   ダークが既定（light は用意しない。color-scheme: dark）。
 *
 * 書体（外部 CDN なし・同梱 woff2。OFL 1.1 = app/fonts/OFL-*.txt）:
 *   --mono  … Azeret Mono（可変）: ブランド名・英大文字ラベル・ID・距離・数値・チップ
 *   --serif … BIZ UDPMincho（Bold・ラテン＋「結」をサブセット）: カードタイトル・h4・verb・.sit・遥拝の見出し・「結」
 *             収録外の和文見出し（例: 三寶寺）はフォールバックの和文明朝へ落ちる
 *   --sans  … システム和文（本文）。BIZ UDPGothic を同梱しない（1書体1ウェイト約4.5MBと重いため）
 *
 * 語数制約に関わる規約:
 *   - text-overflow: ellipsis / -webkit-line-clamp / overflow: hidden を
 *     テキストに使わない。**CSS で黙って切り詰めない。**
 *     枠を超えた文字列は JS が例外にするので、CSS が隠す必要はないし、
 *     隠すと制約が効いていないことが見えなくなる。
 *     （overflow: hidden は枠のクリップのためだけに #phone / .card / .mapbox でのみ使う）
 *   - 375×812（スマホ縦）と全画面（safe-area）で成立すること。
 */

@font-face {
  font-family: "Azeret Mono";
  src: url("../fonts/AzeretMono-VF.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* ラテン＋「結」だけのサブセット。収録外（和文見出し）は --serif のフォールバック明朝へ */
@font-face {
  font-family: "BIZ UDPMincho";
  src: url("../fonts/BIZUDPMincho-Bold-latin.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0020-007E, U+00A0-017F, U+2010-2027, U+2030-203A, U+2190-2193, U+2212, U+7D50;
}

:root {
  /* 地と面 */
  --night: #0B1230;          /* 地 */
  --night-2: #121A3D;        /* パネル地（不透明換算） */
  --glass: rgba(18, 26, 61, .86);
  --glass-2: rgba(247, 242, 234, .05);
  --chip: rgba(8, 12, 20, .62);
  --hair: rgba(196, 160, 120, .30);
  --hair-2: rgba(255, 240, 225, .14);
  /* 文字 */
  --text: #F7F2EA;
  --text-2: #CFC6B8;         /* 補助文（AA 以上） */
  --text-3: #A69B8B;         /* 最小の注記（AA 以上） */
  /* 朱・金茶・警告 */
  --accent: #F08A5D;         /* 朱（明るめ。暗地で AA） */
  --accent-ink: #5A1E12;     /* 淡色ピル上の濃色文字 */
  --ok-c: #E7C27D;           /* 金茶 */
  --warn-c: #F5C35B;
  --bad-c: #FF7A72;
  /* 角丸 */
  --r-xl: 24px; --r-lg: 18px; --r-md: 12px; --r-sm: 8px; --r-pill: 999px;
  /* 余白 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  /* 書体 */
  --mono: "Azeret Mono", ui-monospace, Menlo, monospace;
  --serif: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --blur: blur(16px);
  /* 動き: 色 .12s / opacity・transform .18s。減らす設定では止める */
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* 既存トークンの別名（旧ルールがそのまま暗地で読めるように） */
  --bg: #050A1E; --paper: var(--night); --ink: var(--text); --sub: var(--text-2); --line: var(--hair);
  --accent-legacy: var(--accent);
  --bad: var(--bad-c); --badbg: rgba(255, 122, 114, .12); --ok: var(--ok-c);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  font: 14px/1.45 var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* 375×812 の枠。ウィンドウが小さければ枠を捨てて全面になる。 */
#phone {
  width: 375px; height: 812px;
  margin: 16px auto;
  display: flex; flex-direction: column;
  overflow: hidden;              /* 枠のクリップのみ（テキストの切り詰めではない） */
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 24px 64px rgba(0,0,0,.55);
  position: relative;            /* 自動 Arrival Sheet（.arrsheet）の絶対配置の基準 */
  /* 暖色のグロー＋ドットグリッド（画像は使わない・CSS グラデーションだけ） */
  background:
    radial-gradient(110% 55% at 85% -10%, rgba(240,138,93,.16), transparent 60%),
    radial-gradient(90% 50% at -10% 35%, rgba(231,194,125,.08), transparent 60%),
    radial-gradient(rgba(247,242,234,.08) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--night);
}
/*
 * スマホ（とインストール後の standalone 表示）では枠を捨てて全面に。D40（PWA）。
 *   - 高さは 100dvh（アドレスバーの伸縮に追従）。dvh 非対応ブラウザ向けに 100vh を先に置く
 *   - ノッチ・ホームインジケータは env(safe-area-inset-*)。viewport-fit=cover が前提（index.html）
 *   - デスクトップの 375×812 枠には env() は 0 なので影響しない
 */
@media (max-width: 420px), (max-height: 860px), (display-mode: standalone) {
  #phone {
    width: 100vw; height: 100vh; height: 100dvh;
    margin: 0; border-radius: 0; box-shadow: none;
  }
  #top {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-left: calc(18px + env(safe-area-inset-left, 0px));
    padding-right: calc(18px + env(safe-area-inset-right, 0px));
  }
  #scroll {
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
  }
  #tabs { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* ----------------------------------------------------------------- header */
#top {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px 8px;
  background: transparent; border-bottom: 0;
}
#brand {
  font-family: var(--mono); font-weight: 600; font-size: 19px; letter-spacing: .02em; text-transform: lowercase;
  display: inline-flex; align-items: center; gap: 8px; color: var(--text);
}
/* 朱の角丸「結」バッジ（ロゴの装飾。UI 文言ではない） */
#brand::before {
  content: "結"; font-family: var(--serif); font-weight: 700;
  width: 28px; height: 28px; border-radius: var(--r-sm); display: inline-grid; place-items: center;
  background: #B4442A; color: var(--text); font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
#blocklabel {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 3px 9px; background: var(--glass-2);
}
/* OSM 帰属（D34）。ヘッダー内の全幅1行として常に表示。隠さない・縮めない・省略しない */
#attrib {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-3); letter-spacing: .02em;
  width: 100%; order: 3; margin: 0;
}

#scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 104px; }

/* ------------------------------------------------------- floating tab bar */
#tabs {
  position: absolute; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hair); border-radius: var(--r-pill);
  background: rgba(11, 18, 48, .78); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 32px rgba(0,0,0,.35), inset 0 0 0 1px rgba(240,138,93,.06);
  padding: 6px; gap: 4px; z-index: 30;
}
.tab {
  appearance: none; border: 0; background: none; cursor: pointer; font-family: inherit;
  border-radius: var(--r-pill); padding: 7px 0 6px; font-size: 10.5px; color: var(--text-2); letter-spacing: .02em;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: background .12s, color .12s;
}
.tab .ti { font-size: 16px; line-height: 1; }
.tab.on { background: var(--text); color: var(--accent-ink); font-weight: 700; }

/* ---------------------------------------------------------------- 共通 */
.panel {
  background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r-xl);
  padding: var(--s4); margin-bottom: var(--s3);
  display: flex; flex-direction: column; gap: var(--s2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 32px rgba(0,0,0,.18);
}
.panel h3 { margin: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.panel h4 { margin: 8px 0 2px; font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--text); }
.wc { font-size: 11px; color: var(--text-3); }
.wc.strong { color: var(--accent); font-weight: 600; }
.note { font-size: 12px; color: var(--text-2); line-height: 1.55; margin: 4px 0; }
.note.bad { color: var(--bad-c); }
.big { font-family: var(--mono); font-size: 44px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.row .k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
select, input[type=text], input.coord {
  font: inherit; font-size: 13px; padding: 7px 12px;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-pill);
}
select option { color: #111; }
input[type=range] { width: 100%; }
button.ghost {
  appearance: none; font: inherit; font-size: 12.5px; cursor: pointer;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-pill);
  padding: 8px 14px; align-self: flex-start; transition: background .12s, border-color .12s;
}
button.ghost:hover, button.ghost.on { border-color: var(--accent); color: var(--text); background: rgba(240,138,93,.12); }

/* ------------------------------------------------------------- Today */
/* セグメント型のモード切替（提案するだけ・確定操作でだけ切り替える。黙って切り替えない） */
.modebar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  padding: 4px; margin-bottom: var(--s4);
  border: 1px solid var(--hair); border-radius: 22px; background: var(--glass-2);
}
.mode {
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  background: transparent; border: 0; border-radius: 18px; padding: 8px 10px;
  display: flex; flex-direction: column; color: var(--text); transition: background .12s;
}
.mode.on { background: var(--text); }
.mode-k { font-size: 13.5px; font-weight: 700; }
.mode.on .mode-k { color: var(--accent-ink); }
.mode-s { font-family: var(--mono); font-size: 9px; color: var(--text-2); letter-spacing: .02em; }
.mode.on .mode-s { color: #7A4A3A; }

.inv { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.inv strong { font-family: var(--mono); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.inv span { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }

.legendchip {
  display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
  background: var(--chip); border: 1px solid var(--hair-2); border-radius: var(--r-pill);
  padding: 4px 10px; font-size: 11.5px; color: var(--text-2); backdrop-filter: blur(4px);
}

.warn {
  background: var(--badbg); border: 1px solid var(--bad-c); border-radius: var(--r-sm);
  padding: 9px 10px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.warn strong { color: var(--bad-c); font-size: 12.5px; }
.warn span { font-size: 10.5px; color: #FFC9C4; }

.stack { display: flex; flex-direction: column; gap: var(--s4); }

/* --------------------------------------------------------------- カード */
.card {
  background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r-xl);
  overflow: hidden;              /* card-art の角のクリップのみ（テキストの切り詰めではない） */
  position: relative;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 32px rgba(0,0,0,.28), inset 0 0 0 1px rgba(240,138,93,.06);
  transition: transform .18s var(--ease), opacity .18s;
}
.card.done { opacity: .38; }

.card-art {
  position: relative; height: 188px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--hair);
  /* 朱のグロー＋水平の筋＋藍のグラデ。D09: 神は描かない。グリフのプレースホルダのみ */
  background:
    radial-gradient(60% 70% at 50% 55%, rgba(240,138,93,.22), transparent 70%),
    repeating-linear-gradient(0deg, rgba(247,242,234,.05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #1B2556, #0E1535);
}
/* プレースホルダのグリフ（⛩ ⌂ ▲ ✚ ◻）は円形の朱グロー内に置く */
.card-art .glyph {
  font-size: 54px; color: var(--text); width: 104px; height: 104px; display: grid; place-items: center; line-height: 1;
  border-radius: 50%; border: 1px solid rgba(240,138,93,.5); background: rgba(11,18,48,.55);
  box-shadow: 0 0 0 10px rgba(240,138,93,.07), 0 0 40px rgba(240,138,93,.22);
  font-variant-emoji: text;
}
.card-art .art-note { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); margin-top: 6px; letter-spacing: .04em; }
/* 登録された画像（app/assets/manifest.json）。**切り抜かない（contain）**: 縦構図の浮世絵（D28）を
   横長の枠で cover にすると、儀軌の要素（手の持物・頭部など）が切れて絵がミッションと矛盾しうる */
.card-art.has-img { height: 240px; background: var(--night-2); }
.card-art .art-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-art .credit {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 3px 8px;
  font-family: var(--mono); font-size: 9.5px; color: #fff; background: rgba(11,18,48,.72);
}
.more .guide { margin: 6px 0; }
.more .guide-img { width: 100%; height: auto; display: block; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--night-2); }
.assetstatus .wc.bad { color: var(--bad-c); }

/* 🟢🟡🔴 と ◇ は記号のみ。語数に計上しない（decisions.md）。
   ◇（access）は card-art の右上に収め、隣のカードの角に重ならない位置に置く */
.access {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text);
  background: var(--chip); border: 1px solid var(--hair-2); backdrop-filter: blur(4px);
}
.access.a-unverified { color: var(--text-2); }

.card-body { padding: var(--s4); display: flex; flex-direction: column; gap: 10px; }
.card-title { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
.card-title.ja { font-size: 21px; }
.card-title.untitled { color: var(--text-2); font-weight: 700; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--chip); color: var(--text); border: 1px solid var(--hair-2);
}
.tag + .tag { color: var(--accent); }     /* 2つ目のタグは朱 */
.geo { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.mission { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.45; color: var(--text); }

.tri { display: flex; gap: 6px; flex-wrap: wrap; }
.tri-btn {
  appearance: none; font: inherit; font-size: 12px; cursor: pointer;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 7px 12px;
  transition: background .12s, color .12s;
}
.tri-btn.on { background: var(--accent); border-color: var(--accent); color: #2A0E06; font-weight: 700; }

/* 注意行（D29）。独立枠。25語に計上しない。 */
.notice {
  margin: 0; font-size: 11.5px; padding: 6px 8px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(245,195,91,.10); border-left: 3px solid var(--warn-c); color: #FBE3B0;
}
.notice.bad { background: var(--badbg); border-left-color: var(--bad-c); color: #FFC9C4; }

.meter { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 3px; border-top: 1px dotted var(--hair); }
.m-total { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ok-c); }
.m-part { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

.more { font-size: 11px; }
.more summary { cursor: pointer; font-family: var(--mono); color: var(--accent); font-size: 11px; letter-spacing: .04em; }
.more dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 0; }
.more dt { font-family: var(--mono); color: var(--text-3); font-size: 10px; }
.more dd { margin: 0; color: var(--text-2); font-size: 10.5px; word-break: break-word; }

.swipe {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2);
  background: transparent; border-top: 1px dashed rgba(196,160,120,.35);
  padding: var(--s3) var(--s4) var(--s4);
}
.sw {
  appearance: none; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 11px 0;
  transition: background .12s, color .12s;
}
.sw.like { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.sw.like.on { background: var(--accent); color: #2A0E06; border-color: var(--accent); }

/* 超過カード。**本文を出さない。**赤くて読めるカードにすると制約が事実上無効になる。 */
.card.violation { border-color: var(--bad-c); background: rgba(255,122,114,.10); }
.v-tape {
  background: var(--bad-c); color: #2A0E06; font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  padding: 4px 10px; font-weight: 700;
}
.v-msg { margin: 0; color: var(--bad-c); font-weight: 700; font-size: 13px; }
.v-tbl { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.v-tbl td { padding: 2px 4px; border-bottom: 1px solid rgba(255,122,114,.25); vertical-align: top; color: var(--text); }
.v-tbl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.v-tbl td.txt { color: #FFC9C4; }
.v-tbl tr.sum td { font-weight: 700; border-bottom: 0; }
.v-hint { margin: 0; font-size: 10.5px; color: #FFC9C4; }

.deckend {
  border: 1px dashed rgba(196,160,120,.35); border-radius: var(--r-xl); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--glass); color: var(--text);
}
.deckend p { margin: 0; font-size: 14px; font-weight: 600; }

/* ----------------------------------------------------------------- Map */
.zoomctl { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zoomctl input[type=range] { flex: 1; }
.zval { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 22px; color: var(--text-2); }
.mapbox {
  height: 400px; border: 1px solid var(--hair); border-radius: var(--r-xl);
  overflow: hidden;              /* 地図のクリップのみ（テキストの切り詰めではない） */
  background: #0A1238;
}
.mapsvg { display: block; touch-action: none; cursor: grab; }
.map-bg { fill: #0A1238; }
.block { fill: rgba(240,138,93,.08); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.mesh { stroke: rgba(255,255,255,.05); }
.mesh-1 { fill: rgba(240,138,93,.08); }
.mesh-2 { fill: rgba(240,138,93,.16); }
.mesh-3 { fill: rgba(240,138,93,.26); }
.mesh-4 { fill: rgba(240,138,93,.38); }
.mesh-5 { fill: rgba(240,138,93,.52); }
/* 異常は別チャネル（輪郭リング）。濃淡と同じチャネルに載せない。金茶で */
.mesh-anom { fill: none; stroke: var(--ok-c); stroke-width: 2.5; }
.chip { font-family: var(--mono); font-size: 9px; fill: var(--text); text-anchor: middle; paint-order: stroke; stroke: #070C1E; stroke-width: 3px; }
.clusternum { font-family: var(--mono); font-size: 11px; font-weight: 700; fill: var(--text); text-anchor: middle; paint-order: stroke; stroke: #070C1E; stroke-width: 3px; }
.pin { cursor: pointer; }
.pin .glyph { font-size: 15px; text-anchor: middle; fill: var(--text); }
/* 無名は点ではなく半径15mの円。寄っても精度が上がったように見せない。 */
.uncertain { fill: rgba(240,138,93,.10); stroke: rgba(240,138,93,.45); stroke-dasharray: 3 2; }
/* 地図ラベルは暗い地に読める縁取りで */
.plabel { font-size: 9.5px; fill: var(--text); paint-order: stroke; stroke: #070C1E; stroke-width: 3px; }
.plabel.ja { fill: var(--text-2); }
.star { font-size: 11px; fill: var(--ok-c); }
.tappable { cursor: pointer; }
/* 訪問印（After の「訪れた記録だけ」）。塗りの点＋型グリフ。サムネイルは出さない（D09） */
.pin.visited .visited-dot { fill: rgba(231,194,125,.18); stroke: var(--ok-c); stroke-width: 1.5; }
.pin.visited .glyph { fill: var(--ok-c); }
/* 現在地（During・メモリ上の最新 fix だけ。保存しない） */
.me-dot { fill: var(--accent); stroke: #070C1E; stroke-width: 2; }
.me-ring { fill: none; stroke: rgba(240,138,93,.4); stroke-width: 2; }
.zoomnote { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.maplabel { font-size: 12.5px; font-weight: 600; color: var(--text); }
/* Wishlist ドロワー（徒歩距離順＝直線距離で代替）。地図の下に開閉できる一覧 */
.wishdrawer { margin-top: 10px; border: 1px solid var(--hair); border-radius: var(--r-xl); background: var(--glass); }
.wishdrawer > summary { cursor: pointer; padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.wl-n { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.wishlist { display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
.wrow { appearance: none; font: inherit; text-align: left; cursor: pointer; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--hair); padding: 9px 12px; display: flex; align-items: center; gap: 10px; }
.wrow:last-child { border-bottom: 0; }
.wglyph { font-size: 18px; width: 22px; text-align: center; }
.wmid { flex: 1; min-width: 0; }
.wname { display: block; font-size: 13px; }
.wdist { font-family: var(--mono); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ Practice */
/* セグメント（Answers / Look）。Codex と同じ Layer 2 本文を Look から覗く */
.seg { display: flex; gap: 4px; margin-bottom: 10px; background: var(--glass-2); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 4px; }
.seg-btn {
  appearance: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex: 1;
  background: transparent; border: 0; border-radius: var(--r-pill); padding: 8px 10px; color: var(--text);
}
.seg-btn.on { background: var(--text); color: var(--accent-ink); box-shadow: none; }

/* 原稿の本文（Daily Card 全文・Layer 2 本文）。黙って切り詰めない（省略記号を使わない） */
.prose { margin: 6px 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }

/* Arrival Sheet: 見出し1行＋3ステップ。Daily Card 全文は使わない（現地は10秒・スクロールなし） */
.l0arr { margin: 6px 0 10px; padding-bottom: var(--s3); border-bottom: 1px dashed rgba(196,160,120,.35); }
.l0arr:last-child { border-bottom: 0; }
.l0arrhead { display: flex; gap: 8px; align-items: baseline; }
.l0arrhead .n { font-family: var(--mono); color: var(--accent); font-size: 11px; font-weight: 600; min-width: 20px; }
.l0arrhead .ti { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.l0arrhead .id { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.arrival { margin: 2px 0 0; }
.arrival .a-head { margin: 2px 0 4px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.arrival .a-steps { margin: 0; padding-left: 20px; }
.arrival .a-steps li { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 2px 0; }
.arrival .a-steps li::marker { font-family: var(--mono); color: var(--accent); }

.l0rowbtn { appearance: none; font: inherit; width: 100%; cursor: pointer; background: transparent; color: var(--text); text-align: left; }
.l0rowbtn:hover { background: rgba(240,138,93,.08); }

/* 起点行（Start from ＋ My location ＋ Refresh）。位置の注記はこの下に出す */
.originpick { margin-bottom: 10px; }
.originpick .row { flex-wrap: wrap; margin-bottom: 4px; }
.originpick .row select { flex: 1; }
.injectrow { margin: 6px 0; padding: 6px; border: 1px dashed var(--hair); border-radius: var(--r-sm); }
.injectrow .coord { flex: 1; font: inherit; padding: 7px 12px; }

/*
 * 自動 Arrival Sheet（M5）。カードに重なるボトムシート。
 * **背景を覆うバックドロップは置かない** — スワイプや操作をブロックしないため（要件）。
 * 浮いたタブバーをよけて置く。中身が長ければシート内だけスクロールする。
 */
.arrsheet {
  position: absolute; left: 0; right: 0;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));   /* 浮いたタブバーの上 */
  max-height: 58%;
  display: flex; flex-direction: column;
  background: rgba(11,18,48,.96);
  border-top: 1px solid var(--accent);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  z-index: 20;
}
.arrsheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.arrsheet-head .arrsheet-k { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); }
.arrsheet-head .arrsheet-n { font-size: 12px; color: var(--text-2); flex: 1; }
.arrsheet-close { appearance: none; font: inherit; font-size: 12px; cursor: pointer; border: 1px solid var(--hair); background: var(--glass-2); color: var(--text); border-radius: var(--r-pill); padding: 4px 10px; }
.arrsheet-close:hover { border-color: var(--accent); color: var(--text); }
.arrsheet-body { overflow-y: auto; padding: 8px 12px 12px; }

/* Passport（GPS 到達が確認された場所の一覧・新しい順） */
.passport { margin: 6px 0; }
.prow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(196,160,120,.22); }
.prow .pglyph { font-size: 20px; min-width: 24px; text-align: center; }
.prow .pmid { flex: 1; display: flex; flex-direction: column; }
.prow .pname { font-size: 13px; font-weight: 600; color: var(--text); }
.prow .ptype { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.prow .pdate { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* Layer 2（Codex / Look） */
.l2cluster { margin: 8px 0; }
.l2cluster h4 { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.l2book { border-bottom: 1px solid rgba(196,160,120,.22); padding: 9px 0; }
.l2book summary { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.l2book summary .id { font-family: var(--mono); font-size: 11px; color: var(--accent); min-width: 42px; }
.l2book summary .ti { font-size: 13.5px; color: var(--text); flex: 1; }
.l2book summary .n { font-family: var(--mono); font-size: 10px; color: var(--text-2); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 1px 7px; }
.l2book[open] { background: rgba(247,242,234,.03); border-radius: var(--r-md); padding: 9px 10px; }
.l2book .mission { margin: 6px 0 2px; }

.sitgrid { display: grid; gap: var(--s2); margin-bottom: 8px; }
.sit {
  position: relative; appearance: none; font: inherit; font-family: var(--serif); font-size: 16px; font-weight: 700; cursor: pointer; text-align: left;
  background: var(--glass); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 16px 44px 16px 16px; letter-spacing: .01em; backdrop-filter: var(--blur);
  transition: border-color .12s, background .12s;
}
.sit::after { content: "→"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); font-family: var(--mono); }
.sit:hover { border-color: var(--accent); }
.cangrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-bottom: 10px; }
.can {
  appearance: none; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text);
  background: var(--chip); border: 1px solid var(--hair-2); border-radius: var(--r-pill); padding: 10px 8px;
}
.can:hover { border-color: var(--accent); }
.l0out { background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: var(--s4); margin-bottom: 10px; }
.l0out:empty { display: none; }   /* 中身が空なら非表示 */
.l0out h4 { margin: 0 0 var(--s2); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.l0row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid rgba(196,160,120,.22); }
.l0row .n { font-family: var(--mono); font-size: 10px; color: var(--text-3); min-width: 20px; }
.l0row .ti { font-size: 12.5px; color: var(--text); flex: 1; }
.l0row .id { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.l0title { margin: 2px 0; color: var(--text); font-size: 14px; font-weight: 600; }

/* ----------------------------------------------------------------- You */
.typelist { margin-top: 6px; }
.trow { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid rgba(196,160,120,.22); font-size: 12px; color: var(--text); }
.trow.met { font-weight: 700; color: var(--accent); }
.trow .n { font-family: var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; }

.selftest .ttbl { width: 100%; border-collapse: collapse; font-size: 10.5px; margin-top: 6px; }
.selftest .ttbl td { padding: 3px 4px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--text); }
.selftest .ttbl tr.ok td:first-child { color: var(--ok-c); font-weight: 700; }
.selftest .ttbl tr.ng td:first-child { color: var(--bad-c); font-weight: 700; }
.selftest .ttbl td.num { text-align: right; white-space: nowrap; color: var(--text-3); font-family: var(--mono); }

/* --------------------------------------------------------------- 遥拝 */
/* 画像を一切置かない（D09 への最も強い答え）。水平線バンドと数値だけ。 */
.yohai .y-head { font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .02em; line-height: 1.4; color: var(--text); }
.band {
  position: relative; height: 64px; margin: var(--s4) 0 var(--s2); border-radius: 2px;
  border-top: 1px solid rgba(240,138,93,.6); border-bottom: 1px dashed rgba(196,160,120,.35);
  background: linear-gradient(180deg, rgba(240,138,93,.10), transparent);   /* 朱の地平線 */
}
.band-center { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); font-size: 13px; color: var(--text); }
.band-mark { position: absolute; top: 30px; transform: translateX(-50%); font-size: 18px; color: var(--accent); text-shadow: 0 0 12px rgba(240,138,93,.8); }
.verb { margin: 4px 0 0; font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--text); }
.verb.bad { color: var(--bad-c); }
.ycontrols { margin-top: 8px; }
.yhold { touch-action: none; user-select: none; }
.y-done { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hair); display: flex; flex-direction: column; gap: 4px; }
/* step3: 画面がほぼ黒に暗転。長押し中もボタンは効くよう残す（display:none にしない） */
.yohai.dark { background: #02040C; color: #8C96AE; border-color: #02040C; }
.yohai.dark .band, .yohai.dark .verb, .yohai.dark h3, .yohai.dark .note { opacity: .12; }
.yohai.dark .y-head { opacity: .25; }
.yohaimark { margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* --------------------------------------------------- モード提案の帯 / ハンドオフ */
.suggestband {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 7px 10px; border: 1px solid rgba(240,138,93,.35); border-radius: var(--r-lg);
  background: rgba(240,138,93,.10); color: var(--text); font-size: 12px;
}
.suggestband .sb-txt { flex: 1; }
.suggestband .sb-x { border: none; background: none; font-size: 16px; line-height: 1; color: var(--text-2); cursor: pointer; padding: 0 2px; }
.handoff .ho-line { margin: 2px 0; font-size: 16px; font-weight: 700; color: var(--text); }
.handoff .ho-line.bad { color: var(--bad-c); }

/* ---- Loop（M8・既定オフの試験機能。?loop=1 / ?debug=1 でだけ出る） */
.loopentry { padding: 9px 12px; border-top: 1px solid var(--hair); }
.loopbtn { appearance: none; font: inherit; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 8px; background: var(--glass-2); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 9px 12px; font-weight: 600; }
.loopbtn:hover { border-color: var(--accent); color: var(--text); }
.loopbtn .loopbtn-k { flex: 1; text-align: left; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.loopbtn .loopbtn-n { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.looppanel .loopstops { margin: 6px 0 10px; padding-left: 22px; }
.looppanel .loopstop { margin: 3px 0; display: flex; align-items: baseline; gap: 8px; color: var(--text); }
.looppanel .loopglyph { font-size: 15px; }
.looppanel .loophandoff { margin: 6px 0 10px; font-size: 15px; font-weight: 700; color: var(--text); }
.looppanel .loophandoff.bad { color: var(--bad-c); }
.loopstart { width: 100%; }
/* 暗転オーバーレイ（本物の画面オフはブラウザで不可＝D40②。黒地で代替・タップで終了） */
.loopoverlay { position: absolute; inset: 0; z-index: 40; background: #000; color: #4a4a4a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; cursor: pointer; padding: 24px; text-align: center; }
.loopoverlay .loopho { font-size: 15px; font-weight: 600; line-height: 1.5; max-width: 18em; }
.loopoverlay .loopcount { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .08em; color: #6a6a6a; }

/* --------------------------------------------------- 動き（安価なものだけ。減らす設定に従う） */
@media (prefers-reduced-motion: no-preference) {
  .card, .panel, .l0out { animation: rise .32s var(--ease) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
