/* FXカルテ base styles */
:root {
  --bg: #0b0f16;
  --surface: #141a23;
  --surface-2: #0f141c;
  --border: #1e2733;
  --text: #e8edf4;
  --muted: #8a96a6;
  --accent: #34d399;
  --accent-grad: linear-gradient(95deg, #10b981, #0ea5b7);
  --accent-glow: rgba(16, 185, 129, .28);
  --green: #34d399;
  --red: #fb6f6f;
  --blue: #60a5fa;
  --gold: #f0c040;
  --radius-card: 20px;
  --radius-btn: 16px;
  --radius-row: 14px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, .35);
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }

/* App layout */
main#app {
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  max-width: 800px;
  margin: 0 auto;
}

h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; color: var(--text); letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 16px 0 8px; }
h3 { font-size: .95rem; font-weight: 600; margin: 14px 0 6px; color: var(--muted); }

/* Brand wordmark + month chip (home header) */
.home-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand b {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chip {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px;
}

/* 口座 / コンテストの絞り込み（ホームのヒーロー上・振り返り一覧の上） */
.account-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.account-filter .lab { font-size: 10px; color: var(--muted); letter-spacing: .05em; flex: none; }
.account-filter select {
  width: auto; flex: 1; min-height: 36px;
  padding: 6px 12px; font-size: 12px; border-radius: 999px;
}
/* 口座バッジ（振り返り閲覧のメタ行） */
.account-chip {
  display: inline-block; font-size: 10px; font-weight: 700;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px; margin-right: 6px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

/* Hero summary (home) */
.hero-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}
.hero-card .col { flex: 1; }
.hero-card .vline { width: 1px; background: var(--border); }
.hero-card .lab { font-size: 10px; color: var(--muted); letter-spacing: .05em; margin-bottom: 5px; }
.hero-card .big { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-card .big small { font-size: 14px; font-weight: 700; opacity: .8; }
.hero-card .wld { font-size: 11px; color: var(--muted); margin-top: 7px; }
.hero-card .wld .w { color: var(--green); font-weight: 700; }
.hero-card .wld .l { color: var(--red); font-weight: 700; }
.win-bar { height: 6px; border-radius: 999px; background: var(--surface-2); margin-top: 9px; overflow: hidden; }
.win-bar span { display: block; height: 100%; background: var(--accent-grad); }

/* 今日の復習カード（過去エントリの再浮上・想起のきっかけ） */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.review-date { font-size: 11px; color: var(--muted); }
.review-q { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.review-img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-row); margin-top: 4px;
}
.review-q { white-space: pre-wrap; }
.review-hint { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* 連続記録ライン＋サンプル数の控えめ注記 */
.streak-line { font-size: 12px; font-weight: 600; color: var(--accent); margin: 0 0 14px; }
.samp { color: var(--muted); font-weight: 400; font-size: 10px; }

/* 敗因タグ内訳「あなたのリーク」（ホーム） */
.leak-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin: 0 0 14px;
  box-shadow: var(--shadow-card);
}
.leak-head { font-size: 12px; font-weight: 700; color: var(--red); margin-bottom: 10px; }
.leak-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.leak-tag { font-size: 12px; color: var(--text); width: 88px; flex: none; }
.leak-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.leak-bar span { display: block; height: 100%; background: var(--red); opacity: .85; }
.leak-n { font-size: 12px; font-weight: 700; color: var(--muted); width: 20px; text-align: right; flex: none; }
.leak-foot { font-size: 10px; color: var(--muted); margin-top: 8px; }

/* 1記録にまとめた本数（2本以上のときだけ出る）。pipsの合算の隣に置いて
   「1回で終わらなかった」を数字の裏に隠さない。 */
.shots {
  display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--red); background: rgba(251, 111, 111, .12);
  border: 1px solid rgba(251, 111, 111, .35);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}

/* リバモアの戒め（振り返り閲覧の敗因直下 / ホームは直近が負けの時だけ compact 版）。
   成績=緑・リーク=赤 と混ざらないよう金色。明朝＋引用符で「本から引いた言葉」に見せる
   ＝アプリが言っているのではなく、先に同じ失敗をした人間が言っている、という距離感を作る。 */
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow-card);
}
.quote-head { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.quote-ja {
  font-family: 'Hiragino Mincho ProN', 'YuMincho', serif;
  font-size: 15px; line-height: 1.85; color: var(--text);
  position: relative; padding-left: 18px;
}
.quote-ja::before {
  content: '“';
  position: absolute; left: -2px; top: -6px;
  font-size: 30px; line-height: 1; color: var(--gold); opacity: .5;
}
.quote-en {
  font-size: 11px; line-height: 1.6; color: var(--muted);
  margin-top: 10px; padding-left: 18px; font-style: italic;
}
.quote-src { font-size: 10px; color: var(--muted); margin-top: 10px; text-align: right; }
.quote-note {
  font-size: 12px; line-height: 1.6; color: var(--text);
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
}
.quote-card.compact { padding: 12px 14px; margin: 0 0 14px; }
.quote-card.compact .quote-ja { font-size: 14px; line-height: 1.75; }
.quote-link { display: inline-block; font-size: 11px; color: var(--gold); margin-top: 10px; text-decoration: none; }

/* 入る前チェック（ゲート）。成績=緑 / リーク=赤 のどちらとも違う"止まれ"の色として琥珀を使う。
   ホーム最上部のボタンは他の導線より一段強く見せる＝熱いうちに探させない。 */
.gate-btn {
  display: block;
  background: linear-gradient(180deg, rgba(240, 192, 64, .12), rgba(240, 192, 64, .04));
  border: 1px solid rgba(240, 192, 64, .45);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--text);
  text-decoration: none;
}
.gate-btn:active { opacity: .7; }
.gate-btn b { display: block; font-size: 16px; font-weight: 800; color: var(--gold); }
.gate-btn span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 判定カード。入力のたびに ok / stop が入れ替わる（判定ボタンは無い）。 */
.gate-verdict {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 16px;
  margin: 12px 0 16px;
}
.gate-verdict.stop { border-color: rgba(251, 111, 111, .5); background: rgba(251, 111, 111, .07); }
.gate-verdict.ok { border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .07); }
.gate-head { font-size: 17px; font-weight: 800; }
.gate-verdict.stop .gate-head { color: var(--red); }
.gate-verdict.ok .gate-head { color: var(--green); }
.gate-body { font-size: 12px; color: var(--muted); margin-top: 6px; }
.gate-miss { margin: 10px 0 0 18px; font-size: 13px; line-height: 1.9; }

/* RR表示。止めはしないので判定カードとは別の見た目にする（数字を見せるだけ）。 */
.gate-rr {
  font-size: 13px; font-weight: 700; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-row); padding: 10px 12px; margin: 4px 0 8px;
}
.gate-rr.bad { color: var(--red); border-color: rgba(251, 111, 111, .5); }

/* 反証点がヒゲの帯の時だけ出る。RRの下限まで下げたら損切りをどこまで置けるか。
   2026-09-21：反証点を6.6pips割られて刈られ、その直後に目標手前まで伸びた回から。 */
.gate-deep {
  font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-row); padding: 10px 12px; margin: 0 0 8px;
}
.gate-deep b { display: block; color: var(--gold); font-size: 12px; margin-bottom: 4px; }
.gate-deep-why { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 今日すでに打った本数。2本目以降は取り返し／イキりが乗りやすいので赤に振る。 */
.gate-shots {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 10px 0 0;
}
.gate-shots.warn { color: var(--red); }

/* 昨日までの流れ（持ち越しの燃料）。今日の本数だけでは取り返しを捕まえられない。 */
.gate-carry { font-size: 12px; font-weight: 600; color: var(--muted); margin: 4px 0 0; }
.gate-carry.warn { color: var(--red); }

/* ロットを上げた時だけ出る。直近が負けなら赤く強める（＝取り返しの形）。 */
.gate-lot {
  font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-row); padding: 10px 12px; margin: 6px 0 8px;
}
.gate-lot b { display: block; color: var(--gold); font-size: 12px; margin-bottom: 4px; }
.gate-lot.hot { border-color: var(--red); border-left-color: var(--red); }
.gate-lot.hot b { color: var(--red); }
.gate-lot-hot { color: var(--red); font-weight: 700; margin-top: 4px; }

/* フォームの控えめヒント（エントリー時チャート等） */
.hint { font-size: 11px; color: var(--muted); margin: 0 0 4px; }

/* Stats grid (used on other pages if any) */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px;
}
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.blue { color: var(--text); } /* neutral count → white, not accent */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  margin-bottom: 8px;
}
.btn:active { opacity: .7; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary {
  background: var(--accent-grad);
  border: none;
  color: #04130d;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }

/* Action row (two buttons side by side, e.g. home) */
.actions { display: flex; gap: 10px; margin-bottom: 18px; }
.actions .btn { margin-bottom: 0; }

/* Forms */
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  margin: 0;
}
.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] { width: auto; min-height: 0; flex: none; }
/* 方向は3択のラジオ。丸の中で文字が折り返さないように1行で固定する。 */
.dir-group label { white-space: nowrap; }
.checkbox-group label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(52, 211, 153, .12);
  color: var(--text);
}

/* Lists */
.entry-list { list-style: none; }
.entry-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px;
  margin-bottom: 8px;
}
.entry-list a { color: var(--text); text-decoration: none; display: block; }
.entry-list .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Entry row (compact horizontal row: date / pair / badge / pips) */
.entry-row { display: flex; align-items: center; gap: 10px; }
.entry-row .d { font-size: 12px; color: var(--muted); width: 42px; flex: none; }
.entry-row .pair { font-size: 13px; font-weight: 700; flex: 1; }
.entry-row .p { font-size: 13px; font-weight: 700; width: 52px; text-align: right; flex: none; }

/* Result badges */
.badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex: none; }
.badge.w { color: var(--green); background: rgba(52, 211, 153, .12); }
.badge.l { color: var(--red); background: rgba(251, 111, 111, .12); }
.badge.d { color: var(--muted); background: rgba(138, 150, 166, .12); }

.result-win { color: var(--green); font-weight: 700; }
.result-loss { color: var(--red); font-weight: 700; }
.result-draw { color: var(--muted); font-weight: 700; }

.pips-pos { color: var(--green); }
.pips-neg { color: var(--red); }

/* Section label */
.sec { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 2px 8px; }

/* Bottom nav */
nav#bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 10;
}
nav#bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  gap: 4px;
}
nav#bottom-nav a.active { color: var(--accent); }
nav#bottom-nav svg { width: 22px; height: 22px; }
nav#bottom-nav .icon { font-size: 20px; } /* legacy emoji fallback */

/* Toast / status */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 16px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
  z-index: 100;
}
.toast.error { border-color: var(--red); color: var(--red); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}

/* View pages */
.view-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.view-header h1 { flex: 1 1 100%; margin: 0 0 4px 0; }
.view-summary { padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.view-summary .meta { color: var(--muted); font-size: 0.9em; }
.view-text { white-space: pre-wrap; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.view-table { width: 100%; border-collapse: collapse; }
.view-table th { text-align: left; padding: 6px 8px; color: var(--muted); width: 60px; vertical-align: top; }
.view-table td { padding: 6px 8px; }

/* Canvas wrap */
.canvas-wrap {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.canvas-wrap canvas { display: block; max-width: 100%; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.toolbar button {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}
.toolbar button.active { background: var(--accent); color: #04130d; border-color: var(--accent); }

.swatch {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2px solid var(--border);
  cursor: pointer;
}
.swatch.active { border-color: var(--text); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.thumb img { width: 100%; height: auto; border-radius: var(--radius-row); display: block; }
/* 横長チャート（6分割など）は全幅表示にして一覧でも読みやすく。縦長は2カラムのまま。 */
.thumb.wide { grid-column: 1 / -1; }

/* 問題集の周回。今の周ですでに解いた問題は沈め、次に解く1問だけを立たせる。 */
.thumb { position: relative; }
.thumb.done img { opacity: .32; }
.thumb.now img { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb-tick {
  position: absolute; top: 4px; right: 4px;
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--surface); border-radius: 999px; padding: 1px 6px;
}
.thumb-now {
  position: absolute; top: 4px; left: 4px;
  font-size: 10px; font-weight: 700; color: var(--bg);
  background: var(--accent); border-radius: 999px; padding: 2px 7px;
}
.thumb .meta { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Combined day view */
.day-section {
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  font-size: 17px;
}
/* ペア見出し。直下の 🌅朝/☀️昼/🌆夕（.sec）と同じ見た目だと、チャートが縦に長い日に
   スクロールすると境目が消えて「前のペアの続き」に見える。一段強くして区切る。 */
.day-pair {
  margin: 22px 0 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-row);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.day-journal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-row);
  padding: 12px;
  margin-bottom: 12px;
}

/* 合図（環境認識の朝/昼/夕）＝入る前に置いておく印。
   出たらゲートを開く／出なければ何もしない。方向とセットで持つ。 */
.signal-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 10px 12px;
  margin: 8px 0 4px;
}
.signal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.signal-label { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
.side-btn {
  flex: none; width: auto; min-height: 32px; padding: 5px 16px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.side-btn:active { opacity: .7; }
.side-btn.on-buy { background: var(--green); border-color: var(--green); color: #04130d; }
.side-btn.on-sell { background: var(--red); border-color: var(--red); color: #fff; }
.signal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.signal-chips .chip { cursor: pointer; }
.signal-chips .chip:active { opacity: .6; }
.signal-box input { min-height: 40px; }

/* 閲覧側 */
.signal-view {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 14px;
}
.signal-view .sv-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; margin-right: 8px;
}
.signal-view .sv-buy { color: var(--green); font-weight: 700; }
.signal-view .sv-sell { color: var(--red); font-weight: 700; }

/* ── 待ち（何を待つ/前提/行き先）─ 合図の下に置く。合図は入口の印、待ちは盤の資格と取り分 */
.wait-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 10px 12px;
  margin: 4px 0 8px;
}
.wait-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wait-label { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
.wait-sub {
  display: block; font-size: 10px; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; margin: 6px 0 2px;
}
.wait-box input { min-height: 40px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #04130d; }

.wait-view {
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 14px;
}
.wait-view .wv-label {
  display: block; font-size: 10px; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; margin-bottom: 4px;
}
.wait-view .wv-line { display: flex; gap: 8px; align-items: baseline; margin: 2px 0; }
.wait-view .wv-k { font-size: 10px; font-weight: 700; color: var(--muted); flex: none; min-width: 3.4em; white-space: nowrap; }
.wait-view .wv-type { font-weight: 700; }


/* 経済指標（ゲート＝この後の指標／ホーム＝今週の指標）。
   ランクは色で出す＝色つき絵文字は使わない。 */
.ind-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ind-box.danger { border-left-color: var(--red); }
.ind-head {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; margin-bottom: 6px;
}
.ind-box.danger .ind-head { color: var(--red); }
.ind-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 13px; }
.ind-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; min-width: 44px; }
.ind-rank {
  flex: none; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 999px; border: 1px solid currentColor;
}
.ind-rank.r-ss { color: var(--red); }
.ind-rank.r-s { color: var(--gold); }
.ind-rank.r-aa { color: var(--muted); }
.ind-title { color: var(--text); }
.ind-note { font-size: 11px; color: var(--red); margin-top: 6px; }

/* ホームの今週ぶん（畳んでおく） */
.ind-week {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-row);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ind-week summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none;
}
.ind-week summary::-webkit-details-marker { display: none; }
.ind-week-title { font-size: 13px; font-weight: 700; flex: 1; }
.ind-week-count { font-size: 11px; color: var(--muted); }
.ind-day { margin-top: 10px; padding-left: 8px; border-left: 2px solid var(--border); }
.ind-day.danger { border-left-color: var(--red); }
.ind-day-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.ind-day.danger .ind-day-head { color: var(--red); }

/* サムネの削除ボタン。2段階の2回目（本当に消す？）は赤くして、押す前に気づけるようにする。 */
.thumb-del { font-size: 12px; min-height: 36px; padding: 6px 10px; margin-top: 4px; }
.thumb-del.danger { background: var(--red); border-color: var(--red); color: #fff; }

/* 型ごとの成立条件（いまは白銀のみ）。選んだ型だけ出る＝通常フローの項目数は増やさない。 */
.type-cond {
  border: 1px solid var(--line, var(--border));
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: var(--radius-row);
  padding: 12px 14px;
  margin: 10px 0 4px;
}
.type-cond-head {
  font-size: 12px; font-weight: 700; color: var(--gold);
  letter-spacing: .04em; margin-bottom: 4px;
}
.type-cond label { margin-top: 10px; }

/* 別口座で打った同じ玉の印。口座の成績には残るが、手の回数には数えない。 */
.shots.dup { color: var(--gold); border-color: var(--gold); }
.inline-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text); margin: 10px 0 2px;
}
.inline-check input { width: auto; min-height: 0; margin: 0; flex: none; }
.inline-check b { font-weight: 700; }

/* 問題集：答え合わせの時だけ出す「今回／前に書いた答え」。
   問題を見ている間は出さない＝2周目以降もブラインドで解けるようにするため。 */
.ans-head {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; margin: 16px 0 6px;
}
.ans-now {
  white-space: pre-wrap; background: var(--surface-2);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  padding: 10px 12px; font-size: 14px;
}
.ans-past {
  white-space: pre-wrap; background: var(--surface-2);
  border-left: 3px solid var(--border); border-radius: 0 8px 8px 0;
  padding: 10px 12px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px;
}
.ans-when {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10.5px; color: var(--faint); margin-bottom: 3px;
}

/* まとめ（#/summary）：直近Nヶ月の勝率を全体・月別・型ごとに */
.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.sum-head h1 { font-size: 20px; margin: 0; }
.sum-head .seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.sum-head .seg button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.sum-head .seg button.on { background: var(--accent); color: #062017; font-weight: 700; }
.sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; margin-bottom: 14px; }
.sum-card h2 { font-size: 15px; margin: 0 0 8px; }
.sum-card h2 small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.sum-wrap { overflow-x: auto; }
.sum-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sum-table th, .sum-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; font-size: 13px; }
.sum-table thead th { font-size: 11px; color: var(--muted); font-weight: 500; }
.sum-table tbody th { text-align: left; font-weight: 500; }
.sum-table .rate { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sum-bar { width: 70px; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sum-bar span { display: block; height: 100%; background: var(--accent); }
.sum-table tr.total th, .sum-table tr.total td { font-weight: 700; border-bottom: 2px solid var(--muted); }
.sum-table tr.muted th, .sum-table tr.muted td { color: var(--muted); }
.sum-table tr.tap { cursor: pointer; }
.sum-table tr.tap th::before { content: '▶ '; font-size: 9px; color: var(--muted); }
.sum-table tr.tap.open th::before { content: '▼ '; }
.sum-table tr.open th, .sum-table tr.open td { background: var(--surface-2); }
.sum-detail-row td { padding: 4px 0 10px; text-align: left; white-space: normal; }
.sum-detail li { padding: 8px 10px; }
.sum-detail .entry-row .d { margin-right: 4px; }
.sum-memo { color: var(--muted); font-size: 12px; margin-top: 3px; }
.sum-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0 0; }
.sum-table .sep { border-left: 1px solid var(--border); }
.sum-table td.rr { font-weight: 700; }
.sum-table td.muted { color: var(--muted); }
.sum-rr { font-size: 11px; color: var(--muted); margin-left: auto; }
.sum-table tr.sub th { font-weight: 400; font-size: 12px; color: var(--muted); padding-left: 18px; }
.sum-table tr.sub th::before { content: '' !important; }

/* 週の振り返り */
.wk-nav { color: var(--muted); font-size: 12px; padding: 5px 12px; border-radius: 999px; text-decoration: none; }
.wk-nav:hover { color: var(--text); }
.wk-promise { border-color: var(--accent); }
.wk-promise-text { font-size: 15px; font-weight: 700; margin: 4px 0 12px; white-space: pre-wrap; }
.wk-kept { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-kept button { border: 1px solid transparent; font: inherit; font-size: 13px; padding: 7px 14px; cursor: pointer; opacity: .45; }
.wk-kept button.on { opacity: 1; border-color: currentColor; font-weight: 700; }
.wk-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.wk-nums .lab { font-size: 10px; color: var(--muted); letter-spacing: .05em; }
.wk-nums .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .wk-nums { grid-template-columns: repeat(3, 1fr); } }
.wk-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.wk-tags .lab { font-size: 10px; color: var(--muted); margin-right: 4px; }
.wk-tag { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.wk-promise-input { border-color: var(--accent); }
