
/* ---- 画面の段 (ブレークポイント) ---------------------------------------------------------------
   幅は 5 段、高さは決定ページの 2 段に揃える (docs/design-guide.md §8。計測と根拠は docs/research/2026-10-16-ui-review.md の 3.2)。
   @media の中では CSS の変数を使えないので、区切りの値は直書きし、どの段の区切りかをこの表で引く。新しい区切りの値は足さない。

   段    幅 (CSS px)   代表                                  @media で使う区切り
   S     〜599         iPhone・iPad の Split View             max-width: 600px (600px ちょうども S 側。JS の NARROW (ai_horizon_controller.js) と同じ)
   M     600〜1099     iPad 縦・iPhone 横                     max-width: 1099px / min-width: 1100px (分析のまとめのタイルだけ max-width: 1100px)
   L     1100〜1599    MacBook 13 / 14"・1366 のノート         (L の中で上端のバーだけ max-width: 1366px・1500px で文字を隠す)
   XL    1600〜2199    MacBook 16"・WQHD・フル HD             min-width: 1600px
   XXL   2200〜        4K の 150% / 100%・5K                  min-width: 2200px

   高さ (決定ページ): H-short は 880px 未満 (窓にした MacBook 13 / 14")、H-tall は 880px 以上 (1 画面に収める)。
   決定ページの高さの段はこの 2 つで、1000px は 1 画面の中で「詰める」と「余った高さに足す」の境として残す (docs/decision.md)。部品の中にある 359 / 480 / 640 / 720 / 900 は、その部品の文字が
   収まらなくなる幅で段ではない (触るときに S / M の区切りへ寄せる)。
   区画割り (列の数と並び) は @media で、部品の中身 (2 段に組むか・% を書くか・歩み値を出すか) は @container で切り替える
   (決定ページの live / outlook / why と同じ作法。部品は置かれた幅で中身が決まるので、パネルが 2 列に並んでも崩れない)。 */

/* ---- 配色のトークン ------------------------------------------------------------------------------- */
/* 色はここのトークンだけを使う (docs/design-guide.md §6)。:root がライト、下の 2 つの規則がダーク (中身は同じ。片方を変えたら
   もう片方も変える。test/assets/color_tokens_test.rb が見る)。ダークになるのは、端末がダークで設定の「配色」がライトでないとき
   (@media) と、設定でダークを選んだとき (html の data-theme="dark"。レイアウトの head のスクリプトが描く前に付ける。charts/theme)。
   決定ページは選択に関わらず常にダーク: body.theme-terminal が自分のトークンを持ち (下の「決定ページ」)、html にも :has() でダークを当てる。
   新しい色を足すときはライトとダークの両方に値を書く。チャートの JS が読むトークン (地・文字・罫・分類色・--up / --down など) は
   6 桁の hex にする (JS が不透明度を足して塗りに使うため。charts/theme の withAlpha)。 */
:root {
  color-scheme: light;
  /* 地と文字。raised は浮かぶ札 (吹き出し) の地、rule は濃い罫、input は入力欄の地、neutral は横ばい・中立の灰
     (ライトは文字にも使えるよう --muted と同じ濃さ)。muted はページの地 (--bg) の上でも 4.5:1 を超える濃さ (--bg の上で 5.3:1、白の上で 5.7:1)。 */
  --bg: #f5f6f8;
  --card: #ffffff;
  --raised: #ffffff;
  --border: #e5e7eb;
  --rule: #d1d5db;
  --input: #ffffff;
  --text: #1f2933;
  --muted: #5f6775;
  --neutral: #5f6775;
  /* 色の塗り (選んでいるタブ・チップ、送金の分類などのバッジ、確率のバーの区間、--accent の地のボタン、トースト) の上の文字。
     ダークは塗りが明るい段になるので、地と同じ暗い色にする。 */
  --on-fill: #ffffff;
  /* 影の色 (不透明度は使う側で color-mix する) と、ポップアップの外を暗くする幕。 */
  --shadow: #0f172a;
  --backdrop: rgb(15 23 42 / 0.45);
  /* 意味の色。accent は既定のアクセント (カード・パネル・区画が下の分類色で上書きする)。accent-fill は白い文字を載せるアクセントの塗り
     (決定ページの選択中のタブ)。up / down は向きと良し悪しだけ。hot は「注目」(向きを問わず過熱・急変なので --up / --down とは別の橙)。
     star はピン留めの星。 */
  --accent: #2563eb;
  --accent-fill: #2563eb;
  --up: #16a34a;
  --down: #d64545;
  /* 文字用の段。--up / --down は地・線・チャートの色で、白の上で 3.3:1 / 4.4:1 しかなく小さな文字では AA (4.5:1) に届かないので、
     緑 / 赤の文字 (と、白い文字を載せる小さな緑 / 赤の塗り) は 1 段濃いこちらを使う (--bg の上で 5.0:1 / 5.8:1。8% の色を敷いたチップの上でも 4.6:1 以上)。
     accent-text-mix は分類色の文字用の段 --accent-text (下の「分類色の文字」) で --accent に混ぜる割合 (残りは --text)。
     ライトは 55% (いちばん薄い暗号資産の橙でも --bg の上で 4.7:1)。 */
  --up-text: #147a3a;
  --down-text: #b42c2c;
  --accent-text-mix: 55%;
  --hot: #ea580c;
  /* 注目の橙の文字用の段。--hot は線・地の色で、白の上で 3.6:1 しかないので、橙の文字 (「⚠ 高ボラ」「更新が止まっています」) と
     白い文字を載せる注目のバッジの塗りはこちら (白・--bg の上で 6.0:1 / 5.6:1、12% の橙を敷いたピルの上でも 4.8:1)。
     fill-text-mix は分類の塗り (送金の分類・新規ウォレットのバッジ、急変の確率のバーの区間) に白い文字を載せるとき、塗りの色に混ぜる割合
     (残りは --text)。ライトは 60% で、いちばん薄い「その他」の灰でも白い文字が 4.9:1。 */
  --hot-text: #ad3f0a;
  --fill-text-mix: 60%;
  --star: #f59e0b;
  /* チャートの系列 3 色 (青・金・ティール)。トーン色 (up/down/hot) と違い、系列の「誰か」を示すだけの色。
     dataviz のバリデータで両モード CVD 分離・通常視覚分離・コントラストを確認済み。amber と indigo は、パネルの分類色 (--accent) と
     組にする 2 本目の線 (地合いの流動性・ポジショニングの建玉・CME の Deribit と、ボラティリティのコーンの今の RV)。 */
  --chart-a: #2563eb; --chart-b: #c2860a; --chart-c: #0d9488;
  --chart-amber: #d97706; --chart-indigo: #4f46e5;
  /* 分類色。指標の分類 (Indicator#category の .card--*) とサマリー帯のタイル。ダークは明るく、彩度を落とした段。 */
  --accent-crypto: #f7931a; --accent-bond: #2563eb; --accent-equity: #dc2626; --accent-fx: #7c3aed;
  --accent-commodity: #ca8a04; --accent-volatility: #db2777; --accent-etf-flow: #2e8b57; --accent-derivatives: #0891b2;
  --accent-flow: #0d9488; --accent-onchain: #4f46e5; --accent-fundamentals: #65a30d; --accent-sentiment: #a21caf;
  /* 区画のアクセント: AI ページ (見通し・シナリオ・審議会) の藍、AI 予想の紫、AI パルスとメタ予想の空色、速報 (急変・ニュース) の灰青。 */
  --accent-ai: #4f46e5; --accent-forecast: #7c3aed; --accent-pulse: #0ea5e9; --accent-feed: #475569;
  /* 白抜きの文字を載せるブランドの塗り (LP pages/landing の主の入口・ゲストのバーの登録・料金のカードの入口)。ダークの --accent は淡く白い文字が読めないので、
     ダークでも同じ濃い色のまま (下のダークの 2 つの規則も同じ値)。on-brand はその上の文字。塗りは 1 色で、グラデーションにはしない。 */
  --brand-a: #2563eb; --on-brand: #ffffff;
  /* 送金の分類のバッジ (.whale-item__kind--*) と、新規ウォレットのバッジ。 */
  --kind-inflow: #d64545; --kind-outflow: #16a34a; --kind-exchange: #6b7280; --kind-mint: #0891b2; --kind-burn: #ca8a04;
  --kind-transfer: #7c3aed; --kind-other: #9ca3af; --kind-freeze: #1e3a8a; --kind-unfreeze: #3b82f6; --kind-fresh: #0d9488;
  /* ニュースの媒体の名前 (.news-item__source--*)。 */
  --source-coindesk: #1a6dd9; --source-cointelegraph: #b8860b; --source-decrypt: #0f766e; --source-theblock: #111827;
  --source-bitcoinmagazine: #ea580c; --source-blockworks: #7c3aed; --source-cryptoslate: #be185d;
  /* 急変の見立ての確率のバー: 続く (橙) / もみ合い (灰) / 戻す (青)。 */
  --odds-hot: #ea7a1a; --odds-neutral: #9ca3af; --odds-calm: #3b82f6;
  /* 時間帯 × 曜日のセッションの 4 本の線 (dataviz の分類色の先頭 4 つ。ダークは同じ色相のダークの段)。 */
  --session-asia: #2a78d6; --session-europe: #eb6834; --session-us: #1baf7a; --session-us_late: #eda100;
  /* ヒートマップのマスの地 (相関と時間帯の表は正 = 青 / 負 = 赤、値幅は灰、クジラの時間帯は件数で藍)。濃さはヘルパーと JS が
     マスの style に書く (ApplicationHelper#heat_fill_style・charts/theme の heatFill)。 */
  --heat-positive: #2563eb; --heat-negative: #d64545; --heat-range: #475569; --heat-count: #4f46e5;
  /* マスの濃さ (0〜1) がこれを超えたら、文字を塗りの上の色 (--on-fill) に替える (heat_fill_style・heatFill)。色ごと・配色ごとに、本文の色と
     塗りの上の色のコントラストが入れ替わる濃さ (ライトの青は 0.83 まで本文の色のほうが読める。0.6 で白に替えると 2.5:1 しかなかった)。 */
  --heat-positive-flip: 0.83; --heat-negative-flip: 0.9; --heat-range-flip: 0.73; --heat-count-flip: 0.76;
  /* 成績のヒートマップのマス (.outlook-scorecard__cell) の濃さ --tile (6〜40%) の伸ばし方。ダークは地が暗く薄い色が見えないので 10〜50% にする。 */
  --tile-scale: 1; --tile-floor: 0%;
  /* 等幅には和文の字形が無いので、和文のフォールバック先を明示する (OS 任せで明朝に落ちないように)。 */
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Noto Sans Mono", "Hiragino Sans", "Noto Sans JP", monospace;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
/* ダーク (端末の配色)。設定でライトを選んでいれば当てない。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f141a;
    --card: #161c25;
    --raised: #1d2530;
    --border: #28313d;
    --rule: #34404f;
    --input: #0c1015;
    --text: #e4e9ef;
    --muted: #8d99a8;
    --neutral: #a6b0bd;
    --on-fill: #0f141a;
    --shadow: #000000;
    --backdrop: rgb(0 0 0 / 0.6);
    --accent: #5b9cf6;
    --accent-fill: color-mix(in srgb, var(--accent) 72%, #000);
    --up: #3fb950;
    --down: #f85149;
    /* 文字用の段。緑は --up のままで、8〜16% の色を敷いたチップの上でも 4.6:1 あるので同じ値。赤は --down のままだと敷いた地の上で
       4.5:1 を割る (吹き出しの地に 16% の赤を敷いたチップで 3.9:1) ので 1 段明るく。分類色はダークの段がもう明るく 5.5:1 以上あるので混ぜない (100%)。 */
    --up-text: #3fb950; --down-text: #ff7b72; --accent-text-mix: 100%;
    --hot: #d29922;
    /* 橙の文字用の段は --hot のまま (--card の上で 6.9:1)。分類の塗りはダークの段がもう明るく、暗い --on-fill が 4.6:1 以上あるので混ぜない (100%)。 */
    --hot-text: #d29922; --fill-text-mix: 100%;
    --star: #eca851;
    --chart-a: #4596e8; --chart-b: #b48a1e; --chart-c: #0fa396;
    --chart-amber: #d88e52; --chart-indigo: #8b96fd;
    --accent-crypto: #d88f47; --accent-bond: #6e9fff; --accent-equity: #f1786c; --accent-fx: #a68df6;
    --accent-commodity: #c89850; --accent-volatility: #eb769d; --accent-etf-flow: #6cb486; --accent-derivatives: #4fb0ce;
    --accent-flow: #4ab6a9; --accent-onchain: #8b96fd; --accent-fundamentals: #83b257; --accent-sentiment: #cf7fd6;
    --accent-ai: #8b96fd; --accent-forecast: #a68df6; --accent-pulse: #56abde; --accent-feed: #93a3b9;
    --brand-a: #2563eb; --on-brand: #ffffff;
    --kind-inflow: #ea7d76; --kind-outflow: #63b775; --kind-exchange: #7f8695; --kind-mint: #4fb0ce; --kind-burn: #c89850;
    --kind-transfer: #a68df6; --kind-other: #b4bbc7; --kind-freeze: #647ebc; --kind-unfreeze: #8bb5fa; --kind-fresh: #4ab6a9;
    --source-coindesk: #69a2f6; --source-cointelegraph: #c19b54; --source-decrypt: #5bb3aa; --source-theblock: #cbd1df;
    --source-bitcoinmagazine: #ec7f55; --source-blockworks: #a68df6; --source-cryptoslate: #ec7697;
    --odds-hot: #de8a51; --odds-neutral: #a4abb7; --odds-calm: #6ba1f9;
    --session-asia: #3987e5; --session-europe: #d95926; --session-us: #199e70; --session-us_late: #c98500;
    --heat-positive: #6e9fff; --heat-negative: #ea7d76; --heat-range: #93a3b9; --heat-count: #8b96fd;
    --heat-positive-flip: 0.67; --heat-negative-flip: 0.68; --heat-range-flip: 0.65; --heat-count-flip: 0.67;
    --tile-scale: 1.18; --tile-floor: 3%;
  }
}
/* ダーク (設定でダークを選んだとき・決定ページ)。中身は上と同じ。 */
:root[data-theme="dark"],
:root:has(> body.theme-terminal) {
  color-scheme: dark;
  --bg: #0f141a;
  --card: #161c25;
  --raised: #1d2530;
  --border: #28313d;
  --rule: #34404f;
  --input: #0c1015;
  --text: #e4e9ef;
  --muted: #8d99a8;
  --neutral: #a6b0bd;
  --on-fill: #0f141a;
  --shadow: #000000;
  --backdrop: rgb(0 0 0 / 0.6);
  --accent: #5b9cf6;
  --accent-fill: color-mix(in srgb, var(--accent) 72%, #000);
  --up: #3fb950;
  --down: #f85149;
  --up-text: #3fb950; --down-text: #ff7b72; --accent-text-mix: 100%;
  --hot: #d29922;
  --hot-text: #d29922; --fill-text-mix: 100%;
  --star: #eca851;
  --chart-a: #4596e8; --chart-b: #b48a1e; --chart-c: #0fa396;
  --chart-amber: #d88e52; --chart-indigo: #8b96fd;
  --accent-crypto: #d88f47; --accent-bond: #6e9fff; --accent-equity: #f1786c; --accent-fx: #a68df6;
  --accent-commodity: #c89850; --accent-volatility: #eb769d; --accent-etf-flow: #6cb486; --accent-derivatives: #4fb0ce;
  --accent-flow: #4ab6a9; --accent-onchain: #8b96fd; --accent-fundamentals: #83b257; --accent-sentiment: #cf7fd6;
  --accent-ai: #8b96fd; --accent-forecast: #a68df6; --accent-pulse: #56abde; --accent-feed: #93a3b9;
  --brand-a: #2563eb; --on-brand: #ffffff;
  --kind-inflow: #ea7d76; --kind-outflow: #63b775; --kind-exchange: #7f8695; --kind-mint: #4fb0ce; --kind-burn: #c89850;
  --kind-transfer: #a68df6; --kind-other: #b4bbc7; --kind-freeze: #647ebc; --kind-unfreeze: #8bb5fa; --kind-fresh: #4ab6a9;
  --source-coindesk: #69a2f6; --source-cointelegraph: #c19b54; --source-decrypt: #5bb3aa; --source-theblock: #cbd1df;
  --source-bitcoinmagazine: #ec7f55; --source-blockworks: #a68df6; --source-cryptoslate: #ec7697;
  --odds-hot: #de8a51; --odds-neutral: #a4abb7; --odds-calm: #6ba1f9;
  --session-asia: #3987e5; --session-europe: #d95926; --session-us: #199e70; --session-us_late: #c98500;
  --heat-positive: #6e9fff; --heat-negative: #ea7d76; --heat-range: #93a3b9; --heat-count: #8b96fd;
    --heat-positive-flip: 0.67; --heat-negative-flip: 0.68; --heat-range-flip: 0.65; --heat-count-flip: 0.67;
  --tile-scale: 1.18; --tile-floor: 3%;
}
/* 分類色の文字。分類色 (--accent とそれを上書きする --accent-crypto など) は地・線の色で、ライトの橙・黄・黄緑・水色は文字にすると
   2〜3:1 しかない。文字 (と、白い文字を載せる小さな選択中のボタンの塗り) は --accent に --text を混ぜた --accent-text を使う
   (ライトは濃く、ダークは混ぜずにそのまま。割合は --accent-text-mix)。--accent はカード・区画ごとに上書きされるので、:root に書くと
   :root の --accent で値が決まって受け継がれてしまう。どの要素でもその場の --accent から作るよう、全部の要素に書く。 */
*, ::before, ::after { --accent-text: color-mix(in srgb, var(--accent) var(--accent-text-mix), var(--text)); }

* { box-sizing: border-box; }

/* 横向きにしたときに iOS が勝手に文字を拡大しないようにする。 */
/* Mac の Chrome でチャート (TradingView の lightweight-charts) を横スクロールしたとき、はみ出した分が
   「スワイプで戻る」になって前のページへ戻ってしまうのを止める。 */
html, body { overscroll-behavior-x: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 文字の大きさは画面に合わせて伸ばす: フル HD (1920×1080) までは 16px のまま、それより大きい画面 (WQHD・4K) では幅と高さの小さいほうに
   比例させて 22px まで上げる (2560×1440 で約 19px)。列の最小幅・図の高さ・吹き出しやポップアップの幅は rem で書くので、文字と一緒に大きくなり、
   4K でも列の数と割り付けはフル HD に近いまま 1 枚ずつが大きくなる (docs/design-guide.md §8)。暗い取引画面の決定ページは、
   下の html:has(> body.theme-terminal) が同じ式で上限を 26px にして上書きする (詳細度が高いので順序に関わらず勝つ)。 */
html { font-size: clamp(16px, calc(6px + min(0.52vw, 0.93vh)), 22px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

/* 文字の下限は 0.69rem (16px の地で 11px。docs/design-guide.md §8)。<small> の既定 (smaller = 親の約 0.83 倍) は小さな親の中で 11px を割るので、
   同じ比のまま下限で止める。大きさを決めた small の規則はこれより強いのでそちらが効く (test/assets/font_size_floor_test.rb が下限を見る)。 */
small { font-size: max(0.69rem, 0.83em); }

/* viewport-fit=cover なので、ノッチやホームバーに掛かる分は safe-area で避ける。
   上端の safe-area は .app-bar が、下端の safe-area と、スマホ幅で下端に固定するタブバーの高さ (--tab-bar-height) はフッター (.site-footer) が受け持つ
   (フッターはどのページでも本文の後ろの最後の箱なので、本文の .container には足さない。足すと本文とフッターの間が 2 重に空く)。 */
:root { --tab-bar-height: 0px; }
.container {
  padding:
    20px
    max(16px, env(safe-area-inset-right))
    32px
    max(16px, env(safe-area-inset-left));
}
/* 一覧と表の単独ページ (/news・/whales・/market_moves と 1 件のページ・/positions・/indicators/:key・/timeline) の本体。
   1 行が目で追える長さ (72rem) で止め、広い画面では真ん中に置く (docs/design-guide.md §8)。各 view が content_for :main_class で main に付ける。 */
.list-page { max-width: 72rem; margin-inline: auto; }

/* 横スクロールの手掛かり。横にはみ出して動かせる箱 (表の囲み・管理画面のタブ・絞り込みのチップの列など) には、view で .scroll-cue を付ける。
   はみ出して動かせるときだけ、続きのある側の端を薄く消す: 左端にいる間は右端だけ、送り始めると両端、右端まで送ると左端だけ。
   スクロールの位置で進むアニメーション (animation-timeline: scroll(self x)) なので、はみ出していない箱では何も起きない (付けても害が無い)。
   使えないブラウザでは何もしない。薄れの幅は --scroll-cue-size (既定 24px。大きなチップの列は広げる)。
   流れるサマリー帯 (.summary__window) は自前の薄れを持つので付けない (docs/design-guide.md §8)。 */
@property --scroll-cue-l { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --scroll-cue-r { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes scroll-cue {
  0% { --scroll-cue-l: 0; --scroll-cue-r: 1; }
  10%, 90% { --scroll-cue-l: 1; --scroll-cue-r: 1; }
  100% { --scroll-cue-l: 1; --scroll-cue-r: 0; }
}
@supports (animation-timeline: scroll()) {
  .scroll-cue {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 calc(var(--scroll-cue-l) * var(--scroll-cue-size, 24px)), #000 calc(100% - var(--scroll-cue-r) * var(--scroll-cue-size, 24px)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 calc(var(--scroll-cue-l) * var(--scroll-cue-size, 24px)), #000 calc(100% - var(--scroll-cue-r) * var(--scroll-cue-size, 24px)), transparent);
    animation: scroll-cue linear both;
    animation-timeline: scroll(self x);
  }
}

/* どのページにも付くフッター (shared/_footer)。免責の 1 文と、このサイトについて・データの出どころ・利用規約・プライバシーポリシーへのリンク。
   本文の邪魔をしないよう小さな灰色の文字にする。 */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding:
    16px
    max(16px, env(safe-area-inset-right))
    calc(24px + var(--tab-bar-height) + env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}
.site-footer__disclaimer { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.site-footer__links a { color: inherit; }
.site-footer__links a:hover { color: var(--text); }
/* 決定ページ (container--fit) が 1 画面に収まる大きさ (幅 1100px 以上・高さ 700px 以上、下の「PC: 1 画面に収める」と同じ条件) では、
   画面の下端の 1 行 (高さ 1.75rem。.container--fit の高さがこのぶんを引く) に畳む。入りきらない分は省略記号で切る。
   それより小さい画面ではページがスクロールするので、ほかのページと同じフッターのまま。 */
@media (min-width: 1100px) and (min-height: 700px) {
  .site-footer--compact {
    flex-wrap: nowrap;
    align-items: center;
    height: calc(1.75rem + env(safe-area-inset-bottom));
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
    font-size: 0.7rem;
    white-space: nowrap;
  }
  .site-footer--compact .site-footer__disclaimer { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .site-footer--compact .site-footer__links { flex: none; flex-wrap: nowrap; margin-left: auto; }
}

/* 画面上端に貼り付く表示条件のバー。背景はページいっぱいに敷いて流れていくカードを
   隠し、中身は .container と同じ幅・余白に揃える。i マークの吹き出し (z-index 4)
   よりは手前に出す。 */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.app-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

/* ページの主タブ (指標 / 速報 / タイムライン / 分析 / AI / 決定)。レイアウトがどのページでもバーの左端に描く。大きく太くして「ページの切り替え」だと
   分かるようにする。今のページは黒地 (主タブに無いページではどれも黒地にしない)。 */
.primary-tabs {
  flex: none;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 1rem;
  font-weight: 700;
}
.primary-tabs__link {
  padding: 3px 16px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.primary-tabs__link:hover { color: var(--text); }
.primary-tabs__link[aria-current="page"] { background: var(--text); color: var(--on-fill); }
@media (pointer: coarse) {
  .primary-tabs__link { padding: 6px 18px; }
}
/* プランの札 (「Pro」)。主タブの「決定」(課金が有効で決定ページを開けない Free の会員) と、鍵の掛かった区画 (Billing::LockedComponent) の
   見出しに付ける。向きも良し悪しも持たないので色は着けず、まわりの文字の色 (currentColor) の細い枠の札にする。 */
.plan-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}
/* 鍵の掛かった区画 (Billing::LockedComponent)。Free の会員が Pro の機能のフレーム (AI ページの AI 審議会・AI パルスなど) を読んだときに出す。
   機能の名前・1 行の説明・料金ページへのリンクだけなので、空のときの案内 (.empty) と同じく灰色の 1 行で静かに置く。 */
.locked { gap: 6px; }
.locked__title { margin: 0; font-size: 1.1rem; }
.locked__summary { margin: 0; color: var(--muted); }
.locked__link { align-self: flex-start; color: var(--accent-text); }
/* 見通しの部品の表の、使えない Pro の機能の出どころの行 (Outlooks::DigestComponent)。確率・鮮度・中身の 3 列を 1 つのマスにまとめ、札とリンクだけ。 */
.outlook__locked-cell { color: var(--muted); }
.outlook__locked-cell a { color: var(--accent-text); }
/* 管理画面のタブは数が多いので、縮められるようにして収まらない分は横にスクロールさせる。 */
.admin-tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }

/* ダッシュボードの全体のレンジとカードの密度をまとめる箱。PC では箱が無いのと同じに並べる (スマホ幅は下の 600px 以下の media)。 */
.app-bar__controls { display: contents; }

/* 全体のレンジが無いページでも右端に寄せる。 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.toolbar__label { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

/* 表示タイムゾーン (shared/_timezone_picker)。PC はラベルとセレクトをバーにそのまま並べ、時計のアイコンのボタンは出さない。
   セレクトの箱は popover 属性を持つが (スマホ幅でポップオーバーにするため)、PC では開いていなくても普通の並びとして見せる
   (作者の CSS はブラウザの [popover] の既定 (display: none・position: fixed) より優先される)。 */
.toolbar .timezone__toggle { display: none; }
.timezone__popover {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
}

/* 指標ページの「全体のレンジ」は、ボタン (1D / 1W …) だけで何の切り替えか分かるので、ラベルを見せずにバーを 1 段に収める
   (nav の aria-label が名前として読み上げられる)。カードの密度のラベル「カード」は残す。 */
.app-bar .scale-bar:not(.density-bar) .scale-bar__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* 主タブ + レンジ + 密度 + タイムゾーン + 右端のリンク (設定 / ログイン。管理者は管理が足されて 3 つ) を 1 段に収める。
   幅が足りなくなるにつれ、右端のリンクの文字 (1500px 以下、アイコンと title だけ残す。管理者でも 1440px で 1 段に収まる)、
   タイムゾーンのラベル (1366px 以下) の順に見えなくして 1 段を保つ。それでも収まらない幅 (タブレット) では 2 段に折り返す。
   見えなくした文字は読み上げには残る。 */
@media (max-width: 1366px) {
  .app-bar__inner { column-gap: 12px; }
  .app-bar .toolbar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 1500px) {
  .app-bar__link-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* バーの右端、表示タイムゾーンの隣に置く設定・アカウントへのリンク。 */
.app-bar__links { flex: none; display: flex; gap: 6px; }
.app-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.app-bar__link:hover { color: var(--text); }
/* 線のアイコン (ApplicationHelper#icon)。文字の大きさに合わせ、色は文字の色を継ぐ。 */
.icon { flex: none; width: 1.15em; height: 1.15em; }
.app-bar__link .icon { width: 1.1rem; height: 1.1rem; }
.decision__sound-open .icon { display: block; width: 0.95rem; height: 0.95rem; margin: 1px 0; }
.app-bar__link[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--on-fill); }
/* ゲストの細いバー (ロゴと「ログイン」「無料で登録」だけ)。ロゴを左端、入口を右端に置き、登録は塗りで目立たせる (LP の .lp-button--primary と同じ色)。 */
.app-bar__inner--guest { justify-content: space-between; }
/* スマホ幅の規則 (.app-bar__links の order: -1。会員のバーでアイコンを右に寄せるためのもの) で入口がロゴの左へ回らないよう、ゲストは DOM の順のまま。 */
.app-bar__inner--guest .app-bar__links { order: 0; }
/* 入口は文字のボタンなので、スマホ幅のアイコン用の詰めた余白 (padding: 6px 0) と粗いポインタの規則より詳細度を上げて、横の余白を保つ。 */
.app-bar__inner--guest .app-bar__link { padding: 6px 14px; }
/* 360px 未満では「料金」(課金が有効なときだけの入口) をバーから外す。3 つ並べると 320px でロゴと入口が 2 段に割れる。料金はフッターからも開ける。 */
@media (max-width: 359px) {
  .app-bar__inner--guest .app-bar__link[href="/pricing"] { display: none; }
}
.app-bar__brand { color: var(--text); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.app-bar__link--primary { border-color: transparent; background: var(--brand-a); color: var(--on-brand); font-weight: 700; }
.app-bar__link--primary:hover { color: var(--on-brand); }
@media (pointer: coarse) {
  .app-bar__link { padding: 6px 12px; }
}

.toolbar select {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.8rem;
}

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0; font-size: 1.6rem; }
.page-header p { margin: 0; }

.grid {
  display: grid;
  gap: 16px;
  /* カードの最小幅は文字に比例させる (22.5rem。16px の文字で 360px)。それより狭い画面ではカード 1 枚を画面幅に収める (はみ出して横スクロールさせない)。 */
  grid-template-columns: repeat(auto-fill, minmax(min(22.5rem, 100%), 1fr));
}
.grid--single { grid-template-columns: 1fr; }
.grid--single .card__chart { height: 26rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card--crypto   { --accent: var(--accent-crypto); }
.card--bond     { --accent: var(--accent-bond); }
.card--equity   { --accent: var(--accent-equity); }
.card--fx       { --accent: var(--accent-fx); }
.card--commodity { --accent: var(--accent-commodity); }
.card--volatility { --accent: var(--accent-volatility); }
.card--etf_flow { --accent: var(--accent-etf-flow); }
.card--derivatives { --accent: var(--accent-derivatives); }
.card--flow { --accent: var(--accent-flow); }
.card--onchain { --accent: var(--accent-onchain); }

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card__category {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* 2 行に折れるとき ⓘ だけが次の行に落ちないよう、行の長さをそろえて折る (最後の語に ⓘ が付く)。 */
.card__title { margin: 0; font-size: 1.1rem; text-wrap: balance; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }

/* 見出し横の i マーク。吹き出しは見出し行 (.card__header) の幅に合わせて真下に出し、
   隣のカードに被っても読めるよう手前に出す。上端に貼り付いた .app-bar (z-index 5)
   よりは奥にする。マークから吹き出しへポインタを動かす間に消えないよう、
   閉じるときだけ少し遅らせる。 */
.card__header { position: relative; }
.info { display: inline-block; margin-left: 6px; vertical-align: 0.1em; }
.info__mark {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font: italic 700 11px/1 Georgia, "Times New Roman", serif;
  cursor: help;
}
/* 押せる範囲は下の「押せる範囲を広げる」(::after) で確保し、見た目の丸は小さいままにする。 */
.info:hover .info__mark,
.info.is-open .info__mark,
.info__mark:focus-visible { border-color: var(--accent); color: var(--accent-text); }
.info__mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.info__tip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 4;
  width: min(100%, 30rem);
  max-height: min(60vh, 27.5rem);
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow) 14%, transparent);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s, visibility 0s 0.15s;
}
.info:hover .info__tip,
.info:focus-within .info__tip,
.info.is-open .info__tip { visibility: visible; opacity: 1; transition-delay: 0s; }
.info__about,
.info__crypto { display: block; }
.info__crypto { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.info__crypto strong { display: block; color: var(--accent-text); font-size: 0.75rem; }

/* 注記 (データの出どころ・計算の定義・断り書き) は同じ吹き出しの後半に、箇条書きで足す。用語の説明 (about / crypto) が
   無い吹き出し (単独ページの見出しの説明など) は注記だけになる。長い吹き出しは中でスクロールさせ、
   下に収まらないときは上へ開く (is-up、info_controller が開くたびに測る)。 */
.info__notes { display: block; }
.info__about + .info__crypto + .info__notes { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.info__notes > strong { display: block; color: var(--accent-text); font-size: 0.75rem; }
.info__list { display: block; }
.info__item { display: list-item; margin-left: 1.2em; list-style: disc; }
.info__item + .info__item { margin-top: 3px; }
.info__tip a { color: var(--accent-text); }
.info.is-up .info__tip { top: auto; bottom: calc(100% + 6px); }
/* 吹き出しを合わせる祖先。.card__header は上で position: relative 済み。 */
.page-header { position: relative; }
.page-header__title { display: flex; align-items: center; }
.page-header__title .info { margin-left: 8px; }
.page-header__title .info__mark { width: 18px; height: 18px; font-size: 12px; }
/* 注記を畳んでも、表示中の値の読み方を変える断り (円建てで測っている・読めなかった行がある など) は畳まずに出す。 */
.card__caveat { margin: 0; color: var(--text); font-size: 0.75rem; font-weight: 600; }
.card__latest { text-align: right; white-space: nowrap; }
.card__latest strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
  padding: 0 4px;
  border-radius: 4px;
}
/* 配信で値が変わった瞬間のフラッシュ (chart_controller#flash)。上昇色・下落色で
   文字と背景を染め、元の色へ戻していく。 */
.card__latest strong.is-flash-up { animation: flash-up 1s ease-out; }
.card__latest strong.is-flash-down { animation: flash-down 1s ease-out; }
@keyframes flash-up {
  from { color: var(--up-text); background-color: color-mix(in srgb, var(--up) 18%, transparent); }
}
@keyframes flash-down {
  from { color: var(--down-text); background-color: color-mix(in srgb, var(--down) 18%, transparent); }
}
/* 見出しの値の色は前回の値からの動き (chart_controller#showTrend)。次に動くまで保つ。 */
.card__latest strong.is-trend-up { color: var(--up-text); }
.card__latest strong.is-trend-down { color: var(--down-text); }
.card__unit { color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
/* 円建て価格に添える USD の参考値。主役はあくまで上の JPY なので、単位と同じ
   くすんだ色で 1 段小さく置く。 */
.card__reference { display: block; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.card__time { display: block; color: var(--muted); font-size: 0.75rem; }

.ranges { display: flex; flex-wrap: wrap; gap: 4px; }
.ranges button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.ranges a {
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  text-decoration: none;
}
.ranges button[hidden] { display: none; }
/* 選択中の塗りは分類色の文字用の段 (--accent-text)。分類色のままだと白い文字が暗号資産の橙で 2.3:1 しかない。 */
.ranges button.is-active,
.ranges a.is-active { background: var(--accent-text); border-color: var(--accent-text); color: var(--on-fill); }

/* 時間足の列の右端に置くキーレベルのトグル。見た目は時間足のボタンに揃える。 */
.card__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.levels-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.levels-toggle.is-active { border-color: var(--accent); color: var(--accent-text); }

/* .app-bar に置く一括レンジ切り替え。ボタンの見た目はカード側の列と同じものを使う。 */
.scale-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.scale-bar__label { color: var(--muted); font-size: 0.8rem; }

/* 図の高さの段 (docs/design-guide.md §8)。s はパネルの中の小さな推移の図 (時間帯の累積・CME。地合いとポジショニングの推移はその 3/4・7/8)、
   m はカードとパネルの Lightweight Charts、l は主役の図 (オンチェーンの価格 vs 実現価格)。L・M・XL では 10 / 13.75 / 18.75rem
   (16px の文字で 160 / 220 / 300px)、S (600px 以下) は縦に積むので低くし、XXL (2200px 以上) は余る高さを使って高くする。
   rem なので文字の大きい画面ではさらに伸びる。Lightweight Charts は ChartHost (lightweight_charts_rails) が autoSize: true で作り、
   置き場の大きさを ResizeObserver で追うので、ここで高さを変えれば描き直す (JS から高さを渡さない)。 */
:root { --chart-h-s: 10rem; --chart-h-m: 13.75rem; --chart-h-l: 18.75rem; }
@media (max-width: 600px) {
  :root { --chart-h-s: 9rem; --chart-h-m: 11rem; --chart-h-l: 14rem; }
}
@media (min-width: 2200px) {
  :root { --chart-h-s: 12rem; --chart-h-m: 16rem; --chart-h-l: 22rem; }
}

/* チャートライブラリが中で使う z-index (ペインの区切りは 50) が上端に貼り付いた
   .app-bar より前に出ないよう、重なりをカードの中に閉じ込める。 */
.card__chart { position: relative; height: var(--chart-h-m); isolation: isolate; }

/* ポインタを載せて 1 秒経ち、縦のホイールがページのスクロールからチャートの拡大縮小に切り替わったチャート (charts/wheel.js)。
   指標のカードも決定ページのチャートも同じ枠で囲む。 */
.is-wheel-armed { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* レンジ・足を切り替えてから描き直すまでの間。古い絵と最新値を灰色に沈め、
   チャートの真ん中でスピナーを回す。ボタン列は触れるまま残し、続けて選び直せる。
   沈めるのはチャートの中身だけにして、::after のスピナーまで薄くしない。 */
.card__chart > *,
.card__latest { transition: opacity 0.15s ease, filter 0.15s ease; }
.card.is-loading .card__chart > *,
.card.is-loading .card__latest { opacity: 0.35; filter: grayscale(1); }
.card.is-loading .card__chart { pointer-events: none; }
.card.is-loading .card__chart::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 100;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: card-spin 0.8s linear infinite;
}
@keyframes card-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .card.is-loading .card__chart::after { animation-duration: 2.4s; }
}

/* ---- 読み込み中のスケルトン (Shared::SkeletonComponent) ------------------------------------------------
   ページの外枠を先に返し、区画は Turbo Frame で後から読む (docs/architecture.md の「ページの外枠と区画の遅延読み込み」)。
   中身が届くまで、区画の形に近い灰色の棒をゆっくり明滅させ、「…を読み込み中…」を添える。棒の形 (skeleton--<shape>) は
   届く中身に寄せ、差し替えで高さが大きく跳ねないようにする。動きを減らす設定では明滅を止める。
   読めなかったとき (lazy-frame コントローラ) は skeleton--failed で、文と「再読み込み」のボタンだけにする。 */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.8rem;
}
.skeleton__label { line-height: 1.4; }
.skeleton__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.skeleton__bar {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--border) 75%, transparent);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
.skeleton__bar:nth-child(3n + 2) { width: 84%; animation-delay: 0.15s; }
.skeleton__bar:nth-child(3n) { width: 62%; animation-delay: 0.3s; }
/* パネル: 図の分の高い棒 1 本と数行。 */
.skeleton--panel .skeleton__bar:first-child { height: 140px; }
/* 一覧: 1 行ぶんの高さの棒を並べる。 */
.skeleton--list .skeleton__bar { height: 18px; }
/* 1 枚の図。 */
.skeleton--chart .skeleton__body { flex: 1; }
.skeleton--chart .skeleton__bar { flex: 1; width: auto; min-height: 160px; }
/* 横に並ぶタイル (サマリー帯・材料のタイル) と 1 段の帯 (温度マップのマス)。 */
.skeleton--tiles .skeleton__body,
.skeleton--band .skeleton__body { flex-direction: row; flex-wrap: wrap; }
.skeleton--tiles .skeleton__bar { flex: 1 1 120px; width: auto; height: 56px; }
.skeleton--band .skeleton__bar { flex: 1 1 48px; width: auto; height: 28px; }
.skeleton--failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.skeleton__retry {
  padding: 2px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
@keyframes skeleton-pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton__bar { animation: none; }
}

/* 指標のカードの最初の系列が届くまで (is-pending。chart_controller が最初の読み込みのあとで外す)。チャートの区画と最新値を
   スケルトンと同じ灰色の地にする。カードは画面に近づいてから読むので、下の方のカードはスクロールするまでこの見た目のまま。 */
.card.is-pending .card__chart {
  border-radius: 6px;
  background: color-mix(in srgb, var(--border) 45%, transparent);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
.card.is-pending .card__latest strong {
  display: inline-block;
  min-width: 5em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--border) 75%, transparent);
  color: transparent;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .card.is-pending .card__chart,
  .card.is-pending .card__latest strong { animation: none; }
}

/* 速報ページのイベントカレンダー (dashboard/_event_calendar)。上に横のタイムライン帯 (EventsHelper#event_timeline)、下に日付ごとに畳める一覧。
   発表時刻を過ぎた行と点は薄く (数字のドットプロットは読めるまま)、次の 1 件は太く、相場を大きく動かしやすいもの (major) は帯の点を大きく
   下げ色に、行の左端も下げ色にする。数字は 1 行のドットプロット (○ 前回 – △ 予想 – ● 結果) で、色は付けない (良し悪しは指標による)。
   サマリー帯のタイルから #event-calendar へ飛んだとき、見出しが上端に貼り付いたバーの下に潜らないよう、バーの高さぶん手前で止める。 */
.events {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 16px;
  scroll-margin-top: calc(var(--app-bar-height) + var(--summary-height, 0px) + 12px);
}
.events__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 4px;
}
.events__title { margin: 0; font-size: 1rem; }
.events__horizon { color: var(--muted); font-size: 0.8rem; font-weight: normal; }
.events__next { margin: 0; font-size: 0.85rem; }
.events__countdown { margin-left: 6px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
/* タイムライン帯: 軸・日付の目盛り・いまの線 (アクセントの破線)・発表の点 (major は大きく下げ色)・次の 1 件の名前の札。
   点はその行へのリンク (時刻と名前は吹き出し)。狭い画面では日付の札を 1 つおきにする。 */
.events__timeline { display: block; margin: 0 0 8px; overflow: visible; }
.events__axis { stroke: var(--border); stroke-width: 2; }
.events__tick { stroke: var(--rule); }
.events__tick-label { fill: var(--muted); font-size: 11px; }
.events__now { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
.events__dot { fill: var(--muted); stroke: var(--card); stroke-width: 1.5; }
.events__dot.is-major { fill: var(--down); }
.events__dot.is-past { opacity: 0.35; }
.events__dot-link:hover .events__dot,
.events__dot-link:focus-visible .events__dot { stroke: var(--text); }
.events__next-label { fill: var(--text); font-size: 11px; font-weight: 600; }
@media (max-width: 600px) {
  .events__tick-label.is-odd { display: none; }
}
/* 数字の行のドットプロットの凡例 (○ 前回 · △ 予想 · ● 結果)。帯と一覧のあいだに薄く 1 行 */
.events__legend { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0 0 6px; padding: 0 8px; color: var(--muted); font-size: 0.75rem; }
.events__legend-mark { color: var(--text); }
/* 日付ごとに畳める一覧。見出しは日付と件数で、過ぎた日は閉じて始める (event_calendar_controller が表示タイムゾーンの日付で束ね直す)。 */
.events__days { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.events__date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.events__date::-webkit-details-marker { display: none; }
.events__date::before { content: "▸"; color: var(--muted); font-size: 0.7rem; transition: transform 0.15s ease; }
.events__group[open] > .events__date::before { transform: rotate(90deg); }
.events__date:hover { background: var(--bg); }
.events__day-count { color: var(--muted); font-size: 0.75rem; font-weight: normal; }
.events__list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 2px; }
.events__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 4px 8px;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
  scroll-margin-top: calc(var(--app-bar-height) + 12px);
}
.events__item.is-major { border-left-color: var(--down); }
.events__item.is-next { font-weight: 600; background: var(--bg); }
.events__item.is-past > :not(.events__figures) { opacity: 0.45; }
.events__time { min-width: 3.5em; color: var(--muted); font-variant-numeric: tabular-nums; }
.events__badge {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
}
/* 数字の行は 名前の列 · ドットプロット · 予想比 (か予想の見込みの時刻) · AI の判定。時刻の列の幅と行の gap のぶんだけ字下げする。 */
.events__figures {
  flex-basis: 100%;
  list-style: none;
  margin: 0;
  padding: 0 0 0 calc(3.5em + 10px);
  display: grid;
  gap: 2px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.events__figure { display: grid; grid-template-columns: minmax(4.5em, 8em) minmax(5rem, 12rem) auto auto; justify-content: start; align-items: center; gap: 0 10px; }
.events__figure-label { color: var(--muted); }
.events__plot { display: block; overflow: visible; }
.events__plot--empty { color: var(--muted); }
.events__plot-span { stroke: var(--rule); stroke-width: 2; }
/* 同じ値の印は同じ位置に重なるので、○ と △ は中を抜いて、重なっても両方の形が見えるようにする (● は最後に描く)。 */
.events__mark--previous circle { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.events__mark--estimate polygon { fill: none; stroke: var(--text); stroke-width: 1.5; }
.events__mark--actual circle { fill: var(--text); }
/* 結果が予想より上か下かの向きだけ。良し悪しは指標によるので色は付けない。 */
.events__surprise { font-weight: 600; white-space: nowrap; }
.events__surprise.is-above::after { content: " ▲"; }
.events__surprise.is-below::after { content: " ▼"; }
/* 予想がまだ無い先の発表。予想が入る見込みの時刻を、値ではないとわかるよう薄く出す。 */
.events__estimate.is-pending { color: var(--muted); font-style: italic; white-space: nowrap; }
@media (max-width: 600px) {
  .events__figures { padding-left: 0; }
  .events__figure { grid-template-columns: minmax(4em, 6em) minmax(3.5rem, 1fr) auto auto; gap: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .events__date::before { transition: none; }
}
.events__empty { margin: 0; color: var(--muted); font-size: 0.85rem; }

.empty { color: var(--muted); }

/* マクロ連動 (MacroLink)。読みと要の数字はパネルの頭 (.panel-lead)。分解の表は要因の列が増えるので、狭い画面では表だけを横にスクロールさせる。
   想定値幅の内訳と検証のタイル (畳んだ開け口の中) はボラティリティのタイルと同じ 4 列 (狭い画面で 2 列)。 */
.macro-link { display: flex; flex-direction: column; gap: 10px; }
/* 想定値幅の横帯 (68% / 90%) と R² の目盛り。今の地合いのタイルのミニ図 (digest_visual の gauge) を高さ 48 で、広ければ横に 2 つ。 */
.macro-link__gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 8px 24px; max-width: 56rem; }
.macro-link__gauge { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; }
.macro-link__gauge figcaption { color: var(--muted); font-size: 0.8rem; }
.macro-link__gauge figcaption small { display: block; font-size: 0.72rem; }
.macro-link__scroll { overflow-x: auto; }
.macro-link__table { border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.macro-link__table th,
.macro-link__table td { padding: 4px 8px; text-align: right; border: 1px solid var(--border); }
.macro-link__table th { color: var(--muted); font-weight: 600; background: var(--card); }
.macro-link__table tbody th { text-align: left; }
.macro-link__table td.reading { display: table-cell; border-color: var(--border); }
.macro-link__table .macro-link__text { text-align: left; }
.macro-link__part { color: var(--muted); }
.macro-link__note { margin: 0; color: var(--muted); font-size: 0.75rem; }
/* 畳んだ表 (.panel-more) の中身。表と添え書きの間を空ける。 */
.macro-link__more { display: flex; flex-direction: column; gap: 8px; }
.macro-link__more > .macro-link__subtitle { margin: 0; }
.macro-link__subtitle { margin: 6px 0 0; font-size: 0.9rem; }
.macro-link__subtitle small { color: var(--muted); font-size: 0.72rem; font-weight: normal; margin-left: 4px; }
.macro-link__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.macro-link__tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.macro-link__tile dt { color: var(--muted); font-size: 0.72rem; }
.macro-link__tile dd { margin: 0; }
.macro-link__value { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.macro-link__sub { color: var(--muted); font-size: 0.7rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* 24 時間の累積分解のチャート。凡例の色見本は系列と同じ --chart-a/b (マクロ計・固有分)。 */
.macro-link__chart-block { margin: 0; }
.macro-link__chart-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 6px; font-size: 0.8rem; color: var(--muted); }
.macro-link__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.macro-link__key { color: var(--muted); }
.macro-link__key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; vertical-align: baseline; }
.macro-link__key--macro::before { background: var(--chart-a); }
.macro-link__key--idio::before { background: var(--chart-b); }
@media (max-width: 600px) {
  .macro-link__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 相関マトリクス。セルの背景色はヘルパーが相関係数から付ける (正は青、負は赤)。
   列が多いので、狭い画面では表だけを横にスクロールさせる。 */
.correlation__scroll { overflow-x: auto; }
.correlation__table {
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.correlation__table th,
.correlation__table td { padding: 4px 8px; text-align: center; border: 1px solid var(--border); }
.correlation__table th { color: var(--muted); font-weight: 600; background: var(--card); }
.correlation__table tbody th { text-align: left; }
.correlation__table td.is-diagonal { background: var(--bg); }
/* ローリング相関の推移 (panel_chart_controller)。凡例の鍵の色は JSON の系列の色 (--chart-a/b) と同じ並び。 */
.correlation__history { margin: 12px 0 0; }
.correlation__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 6px; font-size: 0.8rem; color: var(--muted); }
.correlation__key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; vertical-align: baseline; }
.correlation__key--0::before { background: var(--chart-a); }
.correlation__key--1::before { background: var(--chart-b); }
.correlation__short { margin-left: 4px; font-size: 0.7rem; }
.correlation__chart-note { margin-left: auto; }

.page-header__links { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 0.85rem; }

.notify-button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 10px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.notify-button[hidden] { display: none; }

.install { display: contents; }
.install__hint { color: var(--muted); font-size: 0.8rem; }
.install__hint[hidden] { display: none; }

.flash { color: var(--up-text); font-size: 0.9rem; }

/* 設定のカード (アラートと、設定のほかのカードも借りる)。カードの見た目をそのまま借り、フォームと一覧を縦に並べる。 */
.alert-rules { margin-bottom: 16px; overflow-x: auto; }
/* 設定の「アラート」の中の段 (新しいアラート / 登録済み)。 */
.alert-rules__subtitle { margin: 16px 0 8px; font-size: 0.9rem; }
/* 課金が有効なときのアラートの件数と上限 (「2 / 3 件」) と、上限に届いたときの 1 文。数は見出しの添え書きなので灰色。 */
.alert-rules__count { color: var(--muted); font-weight: normal; font-variant-numeric: tabular-nums; }
.alert-rules__limit { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
/* 上限の文の後ろの「プランを見る」は途中で折らない (390px で「プランを見 / る」に割れた)。 */
.alert-rules__limit a { white-space: nowrap; }
.alert-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.alert-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.alert-form select,
.alert-form input {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.9rem;
}
.alert-form input[type=submit],
.alert-table button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-fill);
  border-radius: 6px;
  padding: 4px 12px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.alert-form__errors { width: 100%; margin: 0; padding-left: 1.2em; color: var(--down-text); font-size: 0.85rem; }

/* 設定ページの取引の前提 (settings/show)。アラートのフォームの部品を、1 欄ずつ settings/_trading_profile_field で組む:
   見出し (label) の横の i マークに 1 行の説明 (単位・例) を畳み、吹き出しは欄の真下に欄の幅で出す (欄が位置の基準)。
   見出しの label はアラートのフォームの label (縦に積む flex) を打ち消して 1 行の文字にし、i マークのボタンは label の外に置く。 */
.trading-profile__form { align-items: flex-start; }
.trading-profile__field { position: relative; display: flex; flex-direction: column; gap: 4px; max-width: 15em; font-size: 0.8rem; color: var(--muted); }
.trading-profile__name label { display: inline; }
.trading-profile__name .info { margin-left: 4px; }
.trading-profile__form input[type=number] { width: 9em; }
@media (max-width: 600px) {
  .trading-profile__field { flex: 1 1 calc(50% - 10px); min-width: 0; }
}
/* 設定のカードの i マークの吹き出しは、見出しの真下に出す (位置の基準が無いとページやポップアップの下端の外に出ていた)。
   カードは中身を切らない (吹き出しがカードの下へはみ出しても読めるように。アラートの一覧のカードと共有の .alert-rules の横送りを外す)。 */
:is(.settings, .settings-dialog__body) .alert-rules { overflow: visible; }
:is(.settings, .settings-dialog__body) :is(.card__title, .settings-display__title) { position: relative; }
/* 設定の「表示」(暗号資産の市場・配色)。セレクト 1 つずつの 2 つを 1 枚のカードに入れ、M 以上 (ページもポップアップも) では 2 列に並べる。 */
.settings-display__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin-top: 8px; }
.settings-display__item { min-width: 0; }
.settings-display__title { margin: 0 0 8px; font-size: 0.9rem; }
@media (max-width: 600px) {
  .settings-display__grid { grid-template-columns: minmax(0, 1fr); }
}
/* 設定の自動保存 (autosave・crypto-market)。保存ボタンは置かず、入力欄の横に結果 (保存中… / 保存しました / エラー) を出す。 */
.autosave__control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.autosave__control > :is(input, select) { min-width: 0; }
.autosave__status { font-size: 0.75rem; white-space: nowrap; }
.autosave__status[data-state="pending"] { color: var(--muted); }
.autosave__status[data-state="saved"] { color: var(--up-text); font-weight: 600; }
.autosave__status[data-state="error"] { color: var(--down-text); white-space: normal; }
.alert-form input[aria-invalid="true"],
.alert-form select[aria-invalid="true"] { border-color: var(--down); }
.trading-profile__summary { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }
/* 往復の費用の積み上げ (SettingsHelper#trading_cost_bars)。期間ごとに 1 本を同じ物差し (いちばん高い本が端まで) で並べる。
   区間の色は --chart-a (手数料)・--chart-b (スリッページ)・--chart-c (建玉管理料)。本文の数字は右の合計だけで、内訳は本と凡例の吹き出し。 */
.cost-bars { display: grid; gap: 4px; max-width: 32rem; margin: 8px 0 0; font-size: 0.8rem; }
.cost-bars__legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0 0 2px; color: var(--muted); font-size: 0.75rem; }
.cost-bars__key { display: inline-flex; align-items: center; gap: 4px; }
.cost-bars__key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--cost); }
.cost-bars__row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 4.5em; align-items: center; gap: 8px; }
.cost-bars__horizon { color: var(--muted); white-space: nowrap; }
.cost-bars__track { display: flex; height: 10px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--border) 60%, transparent); }
.cost-bars__part { flex: none; height: 100%; background: var(--cost); }
.cost-bars__total { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.cost-bars__key--fee, .cost-bars__part--fee { --cost: var(--chart-a); }
.cost-bars__key--slippage, .cost-bars__part--slippage { --cost: var(--chart-b); }
.cost-bars__key--holding, .cost-bars__part--holding { --cost: var(--chart-c); }

/* 設定のポップアップ (レイアウトの settings-dialog)。どのページの上にも /settings の中身を開く。中身のカード (.card) はそのまま使い、
   長くなる取引の前提は枠の中でスクロールする。ページの配色 (決定ページの theme-terminal) は body の変数をそのまま受け継ぐ。 */
.settings-dialog {
  width: min(60rem, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--shadow) 25%, transparent);
  overflow: hidden;
}
.settings-dialog[open] { display: flex; flex-direction: column; }
.settings-dialog::backdrop { background: var(--backdrop, rgb(15 23 42 / 0.45)); }
.settings-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.settings-dialog__title { margin: 0; font-size: 1rem; }
.settings-dialog__close {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.settings-dialog__close:hover { color: var(--text); }
.settings-dialog__body { display: flex; flex-direction: column; gap: 16px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.settings-dialog__body > * { flex: none; }
.settings-dialog__body .card { margin: 0; }
.settings { display: block; }
.settings__flash { margin: 0 0 12px; }
.settings-dialog__body .settings__flash { margin: 0; }
.settings__install { margin: 0; }
/* 案内を出さないブラウザでは空の段落になるので、ポップアップの gap を空けないよう畳む。 */
.settings__install:not(:has(> .install > :not([hidden]))) { display: none; }
@media (max-width: 600px) {
  .settings-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
}

/* このサイトについて・利用規約・プライバシーポリシー (pages/*)。読み物なので 1 行の長さを 44rem で止める (design-guide 4 章)。
   広い画面では読み物の列を真ん中に置き、見出し (.page-header) も同じ列に揃える (左に見出し・真ん中に本文、と離れないように)。 */
.static-page { max-width: 44rem; margin-inline: auto; gap: 0; font-size: 0.95rem; line-height: 1.75; }
.page-header:has(~ .static-page) { max-width: 44rem; margin-inline: auto; }
.static-page h2 { margin: 24px 0 8px; font-size: 1.1rem; }
.static-page p,
.static-page ul,
.static-page ol,
.static-page dl { margin: 0 0 8px; }
.static-page ul,
.static-page ol { padding-left: 1.5em; }
.static-page li + li { margin-top: 4px; }
.static-page__lead { font-size: 1rem; }
.static-page__note { color: var(--muted); font-size: 0.85rem; }
.static-page__defs dt { font-weight: 700; }
.static-page__defs dd { margin: 0 0 8px; }
/* フッターの「データの出どころ」で飛んだ見出しが、上端に貼り付いたバーの下に潜らないようにする。 */
.static-page__anchor { scroll-margin-top: calc(var(--app-bar-height) + 12px); }
.static-page__scroll { overflow-x: auto; margin: 0 0 8px; }
.static-page__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; line-height: 1.5; }
.static-page__table th { color: var(--muted); font-weight: normal; font-size: 0.75rem; text-align: left; }
.static-page__table th,
.static-page__table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.static-page__table td:last-child { white-space: nowrap; }
@media (max-width: 600px) {
  .static-page { font-size: 0.9rem; }
  .static-page__table td:last-child { white-space: normal; }
}

/* 登録・ログイン・アカウント (Rodauth の画面と /account)。アラートのフォームと同じ部品を縦 1 列に並べ、読める幅に絞る。
   読み物と同じく列を真ん中に置き、見出しも同じ幅に揃える。 */
.auth { max-width: 26.25rem; margin-inline: auto; }
.page-header:has(~ .auth) { max-width: 26.25rem; margin-inline: auto; }
.auth__note { margin: 0 0 12px; font-size: 0.85rem; color: var(--muted); }
.auth__note--danger { color: var(--down-text); }
.auth__links { margin: 12px 0 0; font-size: 0.85rem; }
/* 運用の都合の注記 (パスワードの再設定ができない環境)。まわりの注記 (.operator-note) と同じ薄い小さな 1 行 */
.auth__fineprint { margin: 12px 0 0; font-size: 0.75rem; color: var(--muted); }
.auth-form .auth__note, .auth-form .auth__fineprint { margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form__field { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.auth-form__field input {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.9rem;
}
.auth-form__field input[aria-invalid="true"] { border-color: var(--down); }
.auth-form__error { color: var(--down-text); }
.auth-form__check { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.auth-form__check input { flex: none; width: 20px; height: 20px; margin: 0; }
.auth-form__check small { color: var(--muted); }
.auth-form input[type=submit],
.auth__actions button {
  align-self: flex-start;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-fill);
  border-radius: 6px;
  padding: 6px 16px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.auth-form input[type=submit].auth-form__danger { border-color: var(--down); background: var(--down); }
/* アカウントのログアウトは主の操作ではないので、塗らずに枠だけにする (塗りのボタンはプランの行の「Pro にする」だけ)。 */
.auth__actions button { border-color: var(--rule); background: var(--card); color: var(--text); }
.auth__actions button:hover { border-color: var(--text); }
.auth__facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 0.9rem; }
.auth__facts dt { color: var(--muted); }
.auth__facts dd { margin: 0; overflow-wrap: anywhere; }
/* 見出しの列 (「メールアドレス」) を取ると値の列が 20rem の箱で 9rem ほどしか残らず、折れない契約の日付 (.plan-date) と
   「お支払いの管理・解約」のボタンが箱の外へ出る (320px)。アカウントの箱 (.account-facts) が狭いときは、見出しを値の上に積む。 */
.account-facts { container: account-facts / inline-size; }
@container account-facts (max-width: 20rem) {
  .auth__facts { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .auth__facts dd { margin-bottom: 8px; }
}
.auth__actions { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.auth__actions form { margin: 0; }
.auth__danger-link { color: var(--down-text); }
/* 狭い画面と指で押す端末 (iPad の横も含む) では、入力欄の文字を 16px にして iOS がフォーカスで画面を拡大しないようにし、
   入力欄とボタンを押しやすい高さにする。 */
@media (max-width: 900px), (pointer: coarse) {
  .auth-form__field input { font-size: 16px; min-height: 36px; }
  .auth-form input[type=submit],
  .auth__actions button { min-height: 36px; font-size: 0.9rem; }
}
/* S では送信のボタン (ログイン・登録・パスワードの変更など) を欄と同じ幅 (100%) にして、44px の高さにする (親指で押す主な操作。§8)。 */
@media (max-width: 600px) {
  .auth-form input[type=submit] { align-self: stretch; min-height: 44px; }
}

/* ---- 料金・プランのカード・特商法の表記・アカウントのプラン・申し込みの完了 ---------------------------------------------
   料金ページ (Pricing::ShowComponent) は読み物より少し広い 56rem で止めて真ん中に置く (カード 2 枚を横に並べ、表の 1 行を目で追える幅)。
   プランのカード (Pricing::PlanCardsComponent) は料金ページと LP の料金の区画が同じものを使う。色はトークンだけで、Pro のカードは
   LP の主の入口と同じブランドの塗り (--brand-a) を枠の色と入口のボタンにだけ使う (ダークでも淡くならない。グラデーションにはしない)。 */
.pricing { display: flex; flex-direction: column; gap: 20px; max-width: 56rem; margin-inline: auto; }
.page-header:has(~ .pricing) { max-width: 56rem; margin-inline: auto; }
.pricing__notice { margin: 0; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 10px; padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--card)); font-weight: 700; }
.pricing__lead { max-width: 46rem; margin: 0; color: var(--muted); line-height: 1.8; text-wrap: pretty; }
.pricing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 16px; }
.pricing-plan { position: relative; display: flex; flex-direction: column; gap: 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 22px 20px; background: var(--card); }
.pricing-plan--pro { border-color: color-mix(in srgb, var(--brand-a) 60%, var(--border)); }
.pricing-plan--current { box-shadow: inset 0 0 0 1px var(--text); }
.pricing-plan__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pricing-plan__name { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
/* 申し込みの戻り先 (/pricing#pricing-plan-pro。Checkout で戻ったとき・登録のあと) の飛び先。上端のバーに隠れないよう、カードの上の縁から見せる。 */
.pricing-plan__name { scroll-margin-top: calc(var(--app-bar-height) + 40px); }
.pricing-plan__current { border-radius: 999px; padding: 2px 10px; background: var(--text); color: var(--on-fill); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.pricing-plan__tagline { margin: -4px 0 0; color: var(--muted); font-size: 0.9rem; }
.pricing-plan__price { margin: 4px 0 2px; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pricing-plan__points { display: grid; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); list-style: none; font-size: 0.92rem; line-height: 1.5; }
.pricing-plan__points li { display: flex; align-items: flex-start; gap: 10px; }
.pricing-plan__points li::before { content: "✓"; flex: none; width: 1.2em; color: var(--accent-text); font-weight: 800; text-align: center; }
/* 入口はカードの下端に揃える (2 枚の できること の行数が違っても、ボタンの高さを揃える)。 */
.pricing-plan__action { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; }
.pricing-plan__action form { margin: 0; }
.pricing-plan__hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
/* 入口のボタン (料金ページのカード・アカウントのプランの行・申し込みの完了)。主の入口は LP と同じブランドの塗りに白抜き、ほかは枠だけ。 */
.pricing-plan__button,
.account-plan__button,
.billing-notice__button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 0.5rem; padding: 8px 20px; background: var(--card); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.pricing-plan__button:hover,
.account-plan__button:hover,
.billing-notice__button:hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.pricing-plan__button--primary,
.account-plan__button--primary { border-color: transparent; background: var(--brand-a); color: var(--on-brand); }
.pricing-plan__button--primary:hover,
.account-plan__button--primary:hover { border-color: transparent; background: color-mix(in srgb, var(--brand-a) 86%, var(--shadow)); }
.pricing-plan__button:focus-visible,
.account-plan__button:focus-visible,
.billing-notice__button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pricing-plan__action .pricing-plan__button { width: 100%; }
@media (pointer: coarse) {
  .pricing-plan__button,
  .account-plan__button,
  .billing-notice__button { min-height: 44px; }
}
/* 機能の表。1 列目 (機能の名前と 1 行の説明) を広く、プランの列は中身なりで真ん中に。 */
.pricing__table-card { gap: 12px; }
.pricing__table-title { margin: 0; font-size: 1.1rem; }
.pricing__scroll { overflow-x: auto; }
.pricing-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.5; }
.pricing-table th,
.pricing-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pricing-table tbody tr:last-child > * { border-bottom: 0; }
.pricing-table thead th { color: var(--muted); font-size: 0.8rem; font-weight: 700; text-align: center; white-space: nowrap; }
.pricing-table tbody th { font-weight: 400; text-align: left; }
.pricing-table td { width: 6.5rem; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pricing-table__name { display: block; font-weight: 700; }
.pricing-table__summary { display: block; color: var(--muted); font-size: 0.8rem; }
.pricing-table__yes { color: var(--accent-text); font-weight: 800; }
.pricing-table__no { color: var(--muted); }
.pricing__fineprint { color: var(--muted); font-size: 0.82rem; line-height: 1.75; }
.pricing__fineprint ul { margin: 0 0 8px; padding-left: 1.2em; }
.pricing__fineprint p { margin: 0 0 4px; }
.pricing__fineprint a { color: var(--accent-text); }
/* 課金が無効なときの 1 枚。 */
.pricing-free { gap: 10px; max-width: 44rem; margin-inline: auto; padding: 24px; text-align: center; }
.page-header:has(~ .pricing > .pricing-free) { max-width: 44rem; }
.pricing-free__title { margin: 0; font-size: 1.25rem; }
.pricing-free__text { margin: 0; color: var(--muted); }
.pricing-free p:last-child { margin: 4px 0 0; }
@media (max-width: 600px) {
  .pricing-plan { padding: 18px 16px 16px; }
  .pricing-table th,
  .pricing-table td { padding: 8px 6px; }
  .pricing-table td { width: auto; }
  /* S では機能の名前だけにする (1 行の説明まで入れると 1 列目が細く、1 行が 3〜4 段に折れる。中身はカードと名前で足りる)。 */
  .pricing-table__summary { display: none; }
}

/* 特定商取引法に基づく表記。見出しの列を狭く固定し、S では見出しを中身の上に積む。 */
.commerce-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.7; }
.commerce-table th,
.commerce-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.commerce-table tr:last-child > * { border-bottom: 0; }
.commerce-table th { width: 11rem; color: var(--muted); font-weight: 700; }
.commerce-table td { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .commerce-table th,
  .commerce-table td { display: block; width: auto; }
  .commerce-table th { padding-bottom: 0; border-bottom: 0; }
}

/* アカウントのプランの行。名前と状態の 1 行の下に入口のボタン。 */
.account-plan { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.account-plan__name { font-weight: 700; }
/* 契約の状態の 1 行 (BillingHelper#plan_status_line。アカウントのプランの行・料金ページの Pro のカード)。支払いを確認できないときは注目の橙の文字
   (向きでも良し悪しでもないので赤にしない)。契約の日付は残りの日数と 1 塊で、途中で折れない (.plan-date。会員への帯も同じ)。 */
.plan-status__warning { color: var(--hot-text); font-weight: 700; }
.plan-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.account-plan form { margin: 0; }
.account-plan .account-plan__button { min-height: 36px; padding: 6px 16px; font-size: 0.85rem; }
/* 主でない入口 (お支払いの履歴・お支払いの管理・解約)。ポータルへは POST なのでボタンのまま、見た目は文字のリンクにする (主のボタンと並べて形を増やさない)。 */
.account-plan__link { padding: 0; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 0.85rem; text-align: left;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.account-plan__link:hover { text-decoration-thickness: 2px; }
.account-plan__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (pointer: coarse) {
  .account-plan__link { min-height: 44px; }
}

/* 会員への帯 (Billing::NoticeComponent。上端のバーのすぐ下、本文と一緒に流れる)。支払いの失敗と Pro の終わりが近いこと。
   向きでも良し悪しでもない注目なので、注目の橙 (--hot) を線と淡い地にだけ使い、文字は --text のまま (§6)。中身は上端のバーと同じ左右の余白で、
   文の後ろにボタンを並べ、入りきらない幅 (S) ではボタンを文の下へ折り返す。日付と残りの日数は .plan-date の 1 塊で折れない。 */
.billing-notice { border-bottom: 1px solid color-mix(in srgb, var(--hot) 45%, var(--border)); background: color-mix(in srgb, var(--hot) 10%, var(--bg)); }
.billing-notice__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.billing-notice__text { margin: 0; min-width: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.5; text-wrap: pretty; }
.billing-notice__hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
.billing-notice form { flex: none; margin: 0; }
/* 高さは共通の 40px (タッチは 44px) のまま、文字と左右だけ詰める。 */
.billing-notice .billing-notice__button { padding: 6px 16px; font-size: 0.85rem; }

/* 日本語の折り返し。料金・申し込みの完了・特商法の表記・鍵の区画・会員への帯 (と LP。.lp の規則) の本文は、語の途中で折れないよう
   文節で折り返す (word-break: auto-phrase。Chromium が <html lang="ja"> の文を文節に切る。対応していないブラウザは今までどおり)。
   見出しは行の長さも揃える (text-wrap: balance)。メールアドレスや URL のような区切りの無い長い語は、今までどおり overflow-wrap で折れる。 */
.pricing :is(p, li, th, td),
.billing-success p,
.commerce-table :is(th, td),
.locked p,
.billing-notice p { word-break: auto-phrase; }
.page-header:has(~ :is(.pricing, .billing-success)) h1,
.page-header:has(~ .static-page .commerce-table) h1,
.pricing :is(h2, h3),
.locked__title,
.lp-pricing :is(h2, h3) { word-break: auto-phrase; text-wrap: balance; }
/* LP の料金の区画の 1 文は、最後の行に「プランで。」だけが残らないようにする (「Pro」と「プランで」の間の空白で折れるため)。 */
.lp-pricing .lp-section__lead { text-wrap: pretty; }

/* 申し込みの完了。アカウントと同じ幅の 1 枚に、プランと金額・反映の注記・入口を縦に。 */
.billing-success { gap: 14px; }
.billing-success__plan { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.05rem; }
.billing-success__mark { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-a); color: var(--on-brand); font-weight: 800; }
.billing-success__note { margin: 0; line-height: 1.75; }
.billing-success__note--pending { border-left: 3px solid var(--hot); padding-left: 10px; }
.billing-success__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

/* 表は幅いっぱいに広げるが、4K で列が間延びしないよう 100rem で止める (管理画面の表も同じ。§8)。 */
.alert-table { width: 100%; max-width: 100rem; border-collapse: collapse; font-size: 0.9rem; }
/* 登録済みの表の囲み。列が入りきらない幅 (タブレット) では表の中だけを横に送る (600px 以下は行ごとのカードに組み替えるので送らない)。 */
.alert-rules__scroll { overflow-x: auto; }
.alert-table th { text-align: left; color: var(--muted); font-weight: normal; font-size: 0.75rem; }
.alert-table th,
.alert-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.alert-table .num { font-variant-numeric: tabular-nums; }
.alert-table tr.is-disabled td { color: var(--muted); }
.alert-table__actions { display: flex; gap: 6px; justify-content: flex-end; }
.alert-table__actions form { margin: 0; }
.alert-table__actions form:last-child button { background: transparent; color: var(--down-text); border-color: var(--down); }

/* 設定の「通知」(Settings::NotificationsComponent)。カードは設定のほかのカード (.alert-rules) を借りる。
   Free の会員の鍵の区画 (Billing::LockedComponent) は、カードの中のカードにせず中身だけを置く。 */
.notify-settings .locked { padding: 0; border: 0; background: none; }
.notify-push { display: contents; }
/* この端末の状態 (push コントローラが 1 つだけ hidden を外す)。display を持つ箱は [hidden] を明示して隠す。 */
.notify-device { display: flex; flex-direction: column; gap: 8px; }
.notify-device__line { margin: 0; color: var(--muted); font-size: 0.85rem; }
.notify-device__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notify-device__actions[hidden],
.notify-device__line[hidden] { display: none; }
.notify-device__on { font-size: 0.9rem; }
.notify-device__status { margin: 0; color: var(--muted); font-size: 0.85rem; }
.notify-device__status:empty { display: none; }
.notify-device .notify-button { padding: 4px 12px; font-size: 0.85rem; }
.notify-device .notify-button--primary { border-color: var(--accent); background: var(--accent); color: var(--on-fill); }
.notify-button:disabled { cursor: progress; opacity: 0.6; }
/* 端末の一覧の「この端末」の札。色は分類色の文字用の段 (読みのピルではないので枠だけ)。 */
.notify-devices__current { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid currentColor; border-radius: 4px;
  color: var(--accent-text); font-size: 0.75rem; white-space: nowrap; }
/* 種類ごとのチェック (行 = 種類、列 = プッシュ / メール)。マスは押せる範囲を広げる label (読み上げの名前はチェックの aria-label)。 */
.notify-kinds { flex-direction: column; align-items: flex-start; }
.notify-kinds__table { border-collapse: collapse; font-size: 0.9rem; }
.notify-kinds__table th { padding: 4px 12px 4px 0; color: var(--muted); font-size: 0.8rem; font-weight: normal; text-align: center; }
.notify-kinds__table th[scope=row] { color: var(--text); font-size: 0.9rem; text-align: left; }
.notify-kinds__table td { padding: 0; text-align: center; }
.alert-form .notify-kinds__cell { display: flex; align-items: center; justify-content: center; min-width: 4rem; min-height: 36px; cursor: pointer; }
.alert-form .notify-kinds__cell input { width: 20px; height: 20px; margin: 0; padding: 0; }
.notify-kinds__cell:has(input:disabled) { cursor: not-allowed; }
.alert-form .notify-kinds__cell input:disabled { opacity: 0.4; }
.notify-kinds__reason { margin: 0; }
@media (pointer: coarse) {
  .alert-form .notify-kinds__cell { min-height: 44px; }
  .notify-device .notify-button { min-height: 44px; }
}
/* 行の推移のスパークライン (alert_spark_controller.js が行が見えたときに描く)。線は控えめな灰、閾値は強調色の破線、最新の値は本文の色の点。
   読み込み中と読めなかったときは枠だけ (薄い地)。止めているアラートの行は薄くする。 */
.alert-spark { display: inline-block; width: 120px; height: 32px; overflow: visible; vertical-align: middle; }
.alert-spark:is(.is-loading, .is-empty) { border-radius: 4px; background: color-mix(in srgb, var(--border) 45%, transparent); }
.alert-spark__line { fill: none; stroke: var(--muted); stroke-width: 1.25; stroke-linejoin: round; }
.alert-spark__threshold { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 2; }
.alert-spark__dot { fill: var(--text); }
.alert-table tr.is-disabled .alert-spark { opacity: 0.5; }

/* ブラウザ通知が使えないときの代わり。画面右下に積み、しばらくで消える。スマホ幅では下端のタブバー (--tab-bar-height) の上に出す。 */
.toasts {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + var(--tab-bar-height) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(22.5rem, calc(100vw - 32px));
  z-index: 10;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--text);
  color: var(--on-fill);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--shadow) 20%, transparent);
}
.toast__close { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 1rem; cursor: pointer; }
.toast__link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* できなかったことの知らせ (flash の alert。ログインが要るページから飛ばされたときなど)。 */
.toast--alert { background: var(--down); }

/* 相場の急変 (MarketMove)。速報ページの一覧・/market_moves・/market_moves/:id で同じ部品を使う。
   急落は赤、急騰は緑の左の線。確率のバーは 続く (橙) / もみ合い (灰) / 戻す (青)。
   一覧の行は左に経路のスパークライン (.move-spark。動きの数字は吹き出し)、右に本文。散布のナビ (.move-scatter) の点から飛んで来たとき、
   行が上端のバーの下に潜らないよう、バーの高さぶん手前で止める。 */
.move-card { --accent: var(--accent-feed); margin-bottom: 16px; }
.move-list { list-style: none; margin: 0; padding: 0; }
.move-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0 12px;
  padding: 10px 0 10px 12px;
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--border);
  scroll-margin-top: calc(var(--app-bar-height) + 12px);
}
.move-list > .move-item:first-child { border-top: 0; }
.move-item--down { border-left-color: var(--down); }
.move-item--up { border-left-color: var(--up); }
.move-item:target { background: var(--bg); }
.move-item__main { min-width: 0; }
.move-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-size: 0.8rem; }
.move-item__tag { padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; }
.move-item__title { margin: 2px 0; font-size: 1.05rem; }
.move-item__title a { text-decoration: none; }
.move-item__title a:hover { text-decoration: underline; }
.move-item__headline { margin: 2px 0; font-weight: 600; }
.move-item__cause, .move-item__status { margin: 2px 0; color: var(--muted); font-size: 0.85rem; }
.move-item__cause strong { color: var(--text); }
/* 分析の回の主因の 1 行は 1 件のページと同じ部品 (market_moves/_cause)。行の中では上下を詰める。 */
.move-item .move-analysis__cause { margin: 2px 0; }
/* 行の左の経路のスパークライン (MarketMovesHelper#move_spark_svg。120 × 32)。線は文字の色、起点と極値の丸は向きの色、検知は破線。 */
.move-spark { display: block; width: clamp(5rem, 22vw, 7.5rem); height: auto; aspect-ratio: 120 / 32; margin-top: 2px; border-radius: 4px; background: var(--bg); }
.move-spark__line { fill: none; stroke: var(--text); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.move-spark__detected { stroke: var(--accent); stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.move-spark__mark { fill: var(--card); stroke: var(--down); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.move-spark--up .move-spark__mark { stroke: var(--up); }
/* 1 期間ぶんの確率のバーと期間の札 (一覧の行と速報のカード)。速報の 1 時間の採点はバーの右に添える。 */
.move-odds-row { display: flex; align-items: center; gap: 8px; max-width: 26.25rem; margin-top: 4px; font-size: 0.75rem; }
.move-odds-row__horizon { flex: none; width: 2em; color: var(--muted); }
.move-odds-row__score { flex: none; color: var(--muted); white-space: nowrap; }
.move-list--compact .move-item__odds { max-width: 20rem; }
/* /market_moves の頭の散布のナビ (MarketMovesHelper#move_scatter)。横 = 検知の時刻、縦 = 変化 % (0 の線の上が急騰)、点の大きさ = σ 倍。
   点はその行へのリンク。下に一覧の最古と最新の時刻を添える。 */
.move-scatter__figure { margin: 0 0 8px; }
.move-scatter { display: block; overflow: visible; }
.move-scatter__guide { stroke: var(--border); stroke-dasharray: 3 3; }
.move-scatter__guide.is-zero { stroke: var(--rule); stroke-dasharray: none; }
.move-scatter__label { fill: var(--muted); font-size: 11px; }
.move-scatter__dot { fill-opacity: 0.7; stroke: var(--card); stroke-width: 1; }
.move-scatter__dot--down { fill: var(--down); }
.move-scatter__dot--up { fill: var(--up); }
.move-scatter__link:hover .move-scatter__dot,
.move-scatter__link:focus-visible .move-scatter__dot { fill-opacity: 1; stroke: var(--text); }
.move-scatter__range { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0 0; color: var(--muted); font-size: 0.75rem; }

.move-badge { padding: 0 8px; border-radius: 999px; color: var(--on-fill); font-size: 0.75rem; font-weight: 700; }
.move-badge--down { background: var(--down-text); }
.move-badge--up { background: var(--up-text); }
.move-change { font-variant-numeric: tabular-nums; font-weight: 700; }
.move-change--down { color: var(--down-text); }
.move-change--up { color: var(--up-text); }

/* 3 分割のバーは幅いっぱいに引き伸ばすと割合が読みにくいので 22rem で止める (見通しの .outlook__bar と同じ。§8)。 */
.move-odds { display: flex; flex: 1; min-width: 0; max-width: 22rem; height: 18px; overflow: hidden; border-radius: 4px; font-size: 0.7rem; line-height: 18px; }
.move-odds__segment { min-width: 2px; overflow: hidden; color: var(--on-fill); text-align: center; white-space: nowrap; }
/* 区間には白い文字 (「続く 45%」) を載せるので、塗りは --text を混ぜた段 (--fill-text-mix。そのままだとライトの橙が 2.9:1)。 */
.move-odds__segment--hot { background: color-mix(in srgb, var(--odds-hot) var(--fill-text-mix), var(--text)); }
.move-odds__segment--neutral { background: color-mix(in srgb, var(--odds-neutral) var(--fill-text-mix), var(--text)); }
.move-odds__segment--calm { background: color-mix(in srgb, var(--odds-calm) var(--fill-text-mix), var(--text)); }

/* 急変の見立ての成績 (管理画面の /admin/market_moves)。表の土台は .market-pulse__history で、数字の列だけ右に寄せる。 */
.move-scorecard__table { width: auto; }
.move-scorecard__table .num { text-align: right; }

.move-detail { display: grid; gap: 16px; }
.move-detail > * { min-width: 0; }
.move-summary__facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); gap: 8px 16px; margin: 10px 0; }
.move-summary__facts dt { color: var(--muted); font-size: 0.75rem; }
.move-summary__facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.move-summary__facts small { display: block; color: var(--muted); }
.move-path { display: block; width: 100%; height: auto; max-height: var(--chart-h-m); background: var(--bg); border-radius: 6px; }
.move-path__line { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.move-path__detected { stroke: var(--accent); stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.move-path__mark { fill: var(--card); stroke: var(--down); stroke-width: 2; vector-effect: non-scaling-stroke; }
.move-path--up .move-path__mark { stroke: var(--up); }
/* 図に描き込む値札 (起点・極値・検知の価格)。線に重なっても読めるよう、地の色の縁取りを付ける。 */
.move-path__label { fill: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
/* スマホの幅では図が 0.57 倍に縮む (座標系の幅 600 に対して 340px) ので、値札の文字を座標系の中で 20 に上げて画面の上で 11px を保つ
   (上げないと 6.3px)。札の寄せは 11 の字幅で決めてあるので、端の札が少しはみ出しても切れないようにする。 */
@media (max-width: 480px) {
  .move-path { overflow: visible; }
  .move-path__label { font-size: 20px; }
}
.move-path__legend { margin: 4px 0 0; color: var(--muted); font-size: 0.75rem; }
.move-summary__more { margin-top: 4px; }
.move-summary__sigma { color: var(--text); font-variant-numeric: tabular-nums; }
/* 図の下の「深掘り」の 1 行 (価格カード · 分析の該当セクション · その時刻の送金 · その時刻のニュース)。並びは速報の行き来のリンク (.feed-links) と同じ。 */
.move-dig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.85rem; }
.move-dig__label { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.move-dig__sep { color: var(--muted); }

.move-analysis__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.move-analysis__head h2 { margin: 0; font-size: 1.1rem; }
.move-analysis__head small { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.move-analysis__headline { margin: 8px 0 2px; font-size: 1.05rem; font-weight: 700; }
.move-analysis__cause { margin: 0; color: var(--muted); font-size: 0.85rem; }
.move-analysis__cause strong { color: var(--text); }
.move-analysis__summary { margin: 8px 0; }
.move-analysis__subtitle { margin: 16px 0 6px; font-size: 0.95rem; }
.move-analysis__subtitle small { color: var(--muted); font-weight: 400; }
.move-analysis__columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr)); gap: 0 24px; }
.move-analysis__meta { margin: 0; color: var(--muted); font-size: 0.75rem; }
.move-sep { margin: 0 4px; color: var(--border); }
.move-analysis__gaps { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }

.move-forecast { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.85rem; }
.move-forecast th, .move-forecast td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
/* 期間の列は「1 時間」が 1 行に収まる幅 (3em では「1 時 / 間」と折れていた)。 */
.move-forecast th:first-child { width: 4.6em; }
.move-forecast th:nth-child(2) { width: 55%; }
.move-forecast th:nth-child(3) { width: 5.5em; }
@media (max-width: 600px) {
  .move-forecast th, .move-forecast td { padding: 4px; font-size: 0.75rem; }
  .move-forecast th:first-child { width: 4em; }
  .move-forecast th:nth-child(2) { width: 45%; }
  .move-forecast th:nth-child(3) { width: 4.2em; }
}
.move-forecast .move-odds { display: flex; }

.move-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.move-scenario { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; }
.move-scenario p { margin: 0 0 4px; }
.move-scenario__name { display: flex; justify-content: space-between; gap: 8px; }
.move-scenario__signals, .move-hypothesis__evidence { display: grid; gap: 2px; margin: 4px 0 0; }
.move-scenario__signals div, .move-hypothesis__evidence div { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px; }
.move-scenario__signals dt, .move-hypothesis__evidence dt { color: var(--muted); }
.move-scenario__signals dd, .move-hypothesis__evidence dd { margin: 0; }

.move-levels, .move-watch { margin: 0; padding-left: 1.2em; font-size: 0.85rem; }
.move-levels { padding-left: 0; list-style: none; }
.move-levels li { padding: 2px 0; }
.move-levels__price { display: inline-block; min-width: 6.5em; font-weight: 700; }
.move-levels__kind { padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 0.75rem; }
.move-levels__kind--support { color: var(--up-text); }
.move-levels__kind--resistance { color: var(--down-text); }

.move-hypotheses { margin: 0; padding: 0; list-style: none; }
.move-hypothesis { padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.85rem; }
.move-hypothesis__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.move-hypothesis__head strong { font-size: 0.95rem; }
.move-hypothesis__category { padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.75rem; }
/* 役割の札。動きを始めた引き金だけをアクセントの枠にし、増幅・下地は分野の札と同じ灰色のまま。 */
.move-role--trigger { border-color: var(--accent); color: var(--accent-text); }
.move-hypothesis__mechanism { margin: 4px 0 0; }
.move-likelihood {
  flex: none;
  min-width: 3.4em;
  padding: 0 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 28%, transparent) calc(var(--p) * 1%), var(--bg) 0);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

/* 速報 → 分析 の時系列。回の札 (.move-phase) で順を示し、カードの間を細い縦線でつなぐ。
   速報は短いカード (候補は 1 行ずつ)、分析は深いカード (速報からの変化 → 見立て → 仮説は畳む)。 */
.move-timeline { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.move-timeline__step { position: relative; min-width: 0; }
.move-timeline__step + .move-timeline__step::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 24px;
  height: 12px;
  border-left: 2px solid var(--border);
}
.move-timeline__pending { margin: 0; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 0.85rem; }
.move-phase {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 2px;
  white-space: nowrap;
}
.move-phase--initial { border: 1px solid var(--accent); color: var(--accent-text); }
.move-phase--followup { background: var(--accent); color: var(--on-fill); }
.move-item__headline .move-phase { margin-right: 2px; font-size: 0.7rem; }
.move-analysis__head h2 small { white-space: nowrap; }
.move-analysis--flash .move-analysis__summary { margin: 6px 0; }
.move-analysis__more { margin-top: 12px; }

.move-candidates { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.move-candidate { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.move-candidate__body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.move-candidate__evidence { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
/* AI の文の中の brief のキーの道筋を日本語の名前に直したところ (MarketMovesHelper#move_ai_text)。元の道筋は吹き出しで読むので、点線の下線で示す。 */
.move-key { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 0.15em; }
@media (min-width: 900px) {
  .move-candidate__evidence { flex-basis: auto; }
}
.move-checks { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: 0.82rem; }
.move-checks li::marker { content: "□ "; }

/* 速報からの変化。確認 / 否定 / 保留 は向きでも良し悪しでもないので緑 / 赤を使わず、形 (塗り・取り消し線・点線) で見分ける (design-guide §6)。 */
.move-review { margin-top: 4px; }
.move-review__summary { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--accent); }
.move-review__items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.move-review__item { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.move-review__body { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.move-review__reason { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.move-review__verdict {
  flex: none;
  min-width: 4.2em;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}
.move-review__verdict--confirmed { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
.move-review__verdict--rejected { border-color: var(--border); color: var(--muted); }
.move-review__verdict--open { border-color: var(--muted); border-style: dashed; color: var(--muted); }
.move-review__item--rejected .move-review__title { color: var(--muted); text-decoration: line-through; }

/* 予想できたか (振り返り)。判定も前触れの向きも良し悪しではないので、速報からの変化と同じく形で見分ける。 */
.move-foresight { margin-top: 12px; }
.move-foresight .move-analysis__subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.move-foresight__verdict--foreseeable { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
.move-foresight__verdict--partly { border-color: var(--muted); border-style: dashed; color: var(--text); }
.move-foresight__verdict--unforeseeable { border-color: var(--border); color: var(--muted); }
.move-foresight__signal .move-hypothesis__category { flex: none; white-space: nowrap; }
.move-foresight__point--against { border-style: dashed; }
.move-foresight__at { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.move-foresight__notes { margin-top: 8px; }

/* ニュース。速報ページの見出し欄と /news の一覧で同じ部品を使う。 */
.news-card { --accent: var(--accent-feed); margin-bottom: 16px; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { padding: 10px 0; border-top: 1px solid var(--border); }
.news-item:first-child { border-top: none; padding-top: 0; }
.news-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.75rem;
}
/* 媒体の名前は文字なので、媒体の色に --text を混ぜた文字用の段 (--accent-text と同じ混ぜ方・割合。媒体の色のままだとライトの
   Cointelegraph の金と Bitcoin Magazine の橙が 3.3:1 / 3.6:1)。 */
.news-item__source {
  font-weight: 600;
  color: color-mix(in srgb, var(--source, var(--text)) var(--accent-text-mix), var(--text));
}
.news-item__source--coindesk { --source: var(--source-coindesk); }
.news-item__source--cointelegraph { --source: var(--source-cointelegraph); }
.news-item__source--decrypt { --source: var(--source-decrypt); }
.news-item__source--theblock { --source: var(--source-theblock); }
.news-item__source--bitcoinmagazine { --source: var(--source-bitcoinmagazine); }
.news-item__source--blockworks { --source: var(--source-blockworks); }
.news-item__source--cryptoslate { --source: var(--source-cryptoslate); }
.news-item__time { font-variant-numeric: tabular-nums; }
.news-item__title { margin: 0; font-size: 1rem; line-height: 1.4; }
.news-item__title a { text-decoration: none; }
.news-item__title a:hover { text-decoration: underline; }
.news-item__summary { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }

/* 速報の見出し欄。列の数は欄の幅 (container) で 1 / 2 / 4 列に決め (8 本が割り切れる。auto-fill だと 3 列で 3 + 3 + 2 の歯抜けになる)、
   新着が差し込まれても本数は増やさない。 */
.news-card--headlines { container-type: inline-size; }
.news-list--compact { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
@container (min-width: 30rem) {
  .news-list--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 60rem) {
  .news-list--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.news-list--compact .news-item { padding: 8px 0; border-top: 1px solid var(--border); }
.news-list--compact .news-item__title { font-size: 0.925rem; }
/* 見出し欄は要約を出さない。Turbo Streams の差し込み・差し替え (CollectNewsJob / LabelSentimentJob) は /news と同じ
   partial を要約つきで流すので、ここで隠して初期表示と揃える。 */
.news-list--compact .news-item__summary { display: none; }

/* 日別の AI の判定の比率の帯 (news/_mood。/news と速報のニュース欄の頭)。今から 24 時間ずつ遡った 7 本の柱を古い順に左から並べ、
   柱の中を 強気 (上げ色) / 中立 (灰) / 弱気 (下げ色) の本数の割合で積む。判定の付いた記事が無い日は破線の枠だけ。凡例は押すと判定で絞る。 */
.news-mood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; color: var(--muted); font-size: 0.8rem; }
.news-mood__chart { display: inline-flex; align-items: stretch; gap: 3px; height: 1.75rem; }
.news-mood__day { display: flex; flex-direction: column; width: 0.9rem; overflow: hidden; border-radius: 2px; background: var(--bg); }
.news-mood__day.is-empty { border: 1px dashed var(--border); }
.news-mood__part { display: block; flex: 1 1 0; min-height: 1px; }
.news-mood__part--bullish { background: var(--up); }
.news-mood__part--neutral { background: var(--neutral); }
.news-mood__part--bearish { background: var(--down); }
.news-mood__keys { display: inline-flex; gap: 10px; }
.news-mood__key { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.news-mood__key::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--key); }
.news-mood__key--bullish { --key: var(--up); }
.news-mood__key--neutral { --key: var(--neutral); }
.news-mood__key--bearish { --key: var(--down); }
.news-mood__key:hover,
.news-mood__key[aria-current="true"] { color: var(--text); text-decoration: underline; }
.news-mood__count strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Jev (TypeSafe AI) が記事・経済指標の結果に付けた BTC / ETH の値動きへの向き (sentiment_badge)。色は読み方のピル
   (.reading--*) と同じ上げ・下げのトークンで、中立は灰。 */
.sentiment {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.sentiment--bullish { color: var(--up-text); background: color-mix(in srgb, var(--up) 8%, transparent); }
.sentiment--bearish { color: var(--down-text); background: color-mix(in srgb, var(--down) 8%, transparent); }
.sentiment--neutral { color: var(--muted); }

/* 一覧の末尾の「もっと見る」(/news, /whales)。 */
.list-more { display: block; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 0.85rem; text-align: center; text-decoration: none; }
.list-more:hover { color: var(--text); background: var(--bg); }

/* 大口送金の行 (notable_transfers/_transfer)。/whales・速報の欄・決定ページの予定・分析ページの監視ウォレットのパネルで同じ部品を使う。
   分類ごとにバッジの色を変え、監視ウォレットが絡む行は左端の色で目立たせる。
   行の下端に額に比例した細い線 (対数。li の style の --size、WhalesHelper#whale_bar_ratio) を引き、行の地は塗らない (地を途中まで塗ると、
   描き損じた背景に見え、文字も読みにくくなる)。線の色は分類のバッジと同じ (--flow。分類の色の無いものは --kind-other)。
   線の読み方は額の吹き出しと、一覧のカードの頭の i マークに書く (WhalesHelper#whale_bar_legend)。
   一覧 (/whales と速報の欄 = .whale-card、分析のパネル = .onchain-transfers__list、タイムラインの行 = .timeline__whale) では、
   本文の数字は US$ の額 1 つで、数量は額の吹き出し (data-tip) に回し、.whale-item__amount は読み上げ用に見た目から隠す。
   送り手・受け手の種類のアイコンも一覧でだけ出す (決定ページの詰めた 1 行は自分の CSS で額と数量を並べ、アイコンは出さない)。 */
.whale-card { --accent: var(--accent-onchain); margin-bottom: 16px; }
.whale-list { list-style: none; margin: 0; padding: 0; }
.whale-item {
  --flow: var(--kind-other);
  padding: 8px 8px 8px 10px;
  border-top: 1px solid var(--border);
  border-left: 3px solid transparent;
  background-image: linear-gradient(var(--flow), var(--flow));
  background-position: left bottom;
  background-size: calc(var(--size, 0) * 100%) var(--flow-bar, 0.1875rem);
  background-repeat: no-repeat;
}
.whale-item--exchange_inflow { --flow: var(--kind-inflow); }
.whale-item--exchange_outflow { --flow: var(--kind-outflow); }
.whale-item--exchange_transfer { --flow: var(--kind-exchange); }
.whale-item--mint { --flow: var(--kind-mint); }
.whale-item--burn { --flow: var(--kind-burn); }
.whale-item--transfer { --flow: var(--kind-transfer); }
.whale-item--freeze { --flow: var(--kind-freeze); }
.whale-item--unfreeze { --flow: var(--kind-unfreeze); }
.whale-item:first-child { border-top: none; }
.whale-item.is-watched { border-left-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.whale-item.is-major { border-left-color: var(--down); }
/* Turbo Streams の購読の要素 (turbo-cable-stream-source) は中身が無いが、カードの flex の子になって gap を空けるので消す。 */
:is(.whale-card, .move-card, .news-card) > turbo-cable-stream-source { display: none; }
.whale-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 2px;
  font-size: 0.75rem;
  color: var(--muted);
}
.whale-item__time { font-variant-numeric: tabular-nums; }
.whale-item__kind,
.whale-item__watch,
.whale-item__flag {
  border-radius: 4px;
  padding: 0 6px;
  font-size: 0.7rem;
  line-height: 1.5;
}
/* 分類の塗りは白い文字を載せるので、分類色に --text を混ぜた段 (--fill-text-mix。分類色のままだとライトの「その他」の灰が 2.5:1)。 */
.whale-item__kind { color: var(--on-fill); background: color-mix(in srgb, var(--kind, var(--muted)) var(--fill-text-mix), var(--text)); }
.whale-item__kind--exchange_inflow { --kind: var(--kind-inflow); }
.whale-item__kind--exchange_outflow { --kind: var(--kind-outflow); }
.whale-item__kind--exchange_transfer { --kind: var(--kind-exchange); }
.whale-item__kind--mint { --kind: var(--kind-mint); }
.whale-item__kind--burn { --kind: var(--kind-burn); }
.whale-item__kind--transfer { --kind: var(--kind-transfer); }
.whale-item__kind--other { --kind: var(--kind-other); }
/* 監視ウォレットの名前のバッジは、押すとそのウォレットの送金に絞った /whales (?wallet=<key>) へ移るリンク。 */
.whale-item__watch { color: var(--accent-text); border: 1px solid var(--accent); font-weight: 600; text-decoration: none; }
.whale-item__watch:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.whale-item__flag { border: 1px solid var(--border); }
/* お釣り不明 (監視ウォレットの行の額がお釣りを含む上限) は点線の枠で、ほかのバッジと見分ける。 */
.whale-item__change-unknown { border-style: dashed; }
.whale-item__body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; font-size: 0.95rem; }
.whale-item__amount { font-variant-numeric: tabular-nums; }
.whale-item__usd { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
:is(.whale-card, .onchain-transfers__list, .timeline__whale) .whale-item__usd { color: var(--text); font-size: 1em; font-weight: 700; }
:is(.whale-card, .onchain-transfers__list, .timeline__whale) .whale-item__paren { display: none; }
:is(.whale-card, .onchain-transfers__list, .timeline__whale) .whale-item__amount { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.whale-item__route { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.whale-item__owner { color: inherit; text-decoration: none; }
a.whale-item__owner:hover { text-decoration: underline; }
.whale-item__owner.is-unknown { color: var(--muted); }
/* 送り手・受け手の種類のアイコン (取引所・監視ウォレット・名前の分かる相手・不明。WhalesHelper#whale_party_icon)。色は文字の色で、
   監視ウォレットだけアクセント、不明は灰。 */
.whale-item__icon { display: none; flex: none; width: 1em; height: 1em; fill: currentColor; color: var(--muted); vertical-align: -0.12em; }
:is(.whale-card, .onchain-transfers__list, .timeline__whale) .whale-item__icon { display: inline-block; }
.whale-item__icon--exchange,
.whale-item__icon--named { color: var(--text); }
.whale-item__icon--watch { color: var(--accent-text); }
.whale-item__link { color: var(--muted); font-size: 0.8rem; }

/* 速報の欄は、欄の幅 (container) で 1 / 2 / 4 列に決める (8 件が割り切れる)。9 件目以降 (Turbo で先頭に差し込まれて溢れたぶん) は隠す。 */
.whale-card--dashboard { container-type: inline-size; }
.whale-list--compact { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
@container (min-width: 40rem) {
  .whale-list--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 90rem) {
  .whale-list--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.whale-list--compact .whale-item { border-top: 1px solid var(--border); }
/* 欄の「まだありません」の文は一覧の後ろに置き、新着が入って一覧が空でなくなったら隠す。 */
.whale-list:not(:empty) ~ .empty { display: none; }
/* 欄の頭の「24 時間の取引所への出入り」(WhalesHelper#whale_flow_bar)。流入 (取引所へ) と流出 (取引所から) の US$ の合計を 1 本に積み、
   数字は両端の 2 つだけ。バーの色は送金の分類のバッジと同じ (流入 = --kind-inflow、流出 = --kind-outflow)、数字は同じ向きの文字用の段
   (流入 = --down-text、流出 = --up-text)。バーは間延びさせず 22rem で止める。 */
.whale-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-size: 0.8rem; }
.whale-flow--empty { display: block; }
.whale-flow__label { flex-basis: 100%; }
.whale-flow__value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.whale-flow__value strong { font-size: 1.05rem; }
.whale-flow__value--inflow strong { color: var(--down-text); }
.whale-flow__value--outflow strong { color: var(--up-text); }
.whale-flow__bar { display: flex; flex: 1 1 8rem; max-width: 22rem; height: 10px; overflow: hidden; border-radius: 5px; background: var(--bg); }
.whale-flow__part { min-width: 2px; }
.whale-flow__part--inflow { background: var(--kind-inflow); }
.whale-flow__part--outflow { background: var(--kind-outflow); }

/* テスト送金の予兆の帯 (transfer_omens/_strip)。速報ページの「大口送金」の一覧の上と、決定ページの見出しの下で共通。
   色は --omen 1 つ: 取引所宛の high は --down (売り圧力の前触れという向きの意味)、それ以外の high と medium は --accent、的中は --muted。
   ピルの文字だけはその文字用の段 (--omen-text: --down-text / --accent-text / --muted)。
   本文はその監視ウォレットの送金の絞り込みへのリンク。文字は本文の色のまま、下線を --omen で引いてリンクと分かるようにする。 */
.omen { --omen: var(--accent); --omen-text: var(--accent-text); display: flex; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; padding: 4px 8px; border-left: 3px solid var(--omen); border-radius: 4px; background: color-mix(in srgb, var(--omen) 6%, transparent); font-size: 0.85rem; }
.omen--high.omen--exchange { --omen: var(--down); --omen-text: var(--down-text); }
.omen--confirmed { --omen: var(--muted); --omen-text: var(--muted); }
.omen__pill { flex: none; padding: 0 6px; border: 1px solid var(--omen); border-radius: 999px; color: var(--omen-text); font-size: 0.7rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.omen__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--omen) 45%, transparent); text-underline-offset: 2px; }
.omen__text:hover { text-decoration-color: var(--omen); }
.omen.is-major .omen__text { font-weight: 600; }
.omen__time { flex: none; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
/* 決定ページの帯は 1 件だけ。配信で差し替わった 3 件ぶんの描画も、2 件目以降は隠す。 */
.agenda__omens .omen:nth-of-type(n+2) { display: none; }

/* /whales の監視ウォレットの一覧。名前を押すとそのウォレットの送金に絞る (選んでいるものは枠を濃く)。 */
.whale-watchlist__list { display: grid; gap: 8px; margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); }
.whale-watchlist__item { padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; }
.whale-watchlist__item.is-major { border-left-color: var(--down); }
.whale-watchlist__item.is-current { box-shadow: inset 0 0 0 1px var(--text); }
.whale-watchlist__item dt { font-weight: 600; }
.whale-watchlist__item dd { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }
.whale-watchlist__labels { display: flex; flex-wrap: wrap; gap: 4px; }
.whale-watchlist__labels code { font-size: 0.7rem; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.whale-watchlist__address { word-break: break-all; }
.whale-watchlist__addresses summary { cursor: pointer; }
.whale-watchlist__addresses .whale-watchlist__labels { margin-top: 4px; }

/* ---- ダッシュボードの区分け ----------------------------------------------------- */

/* 上端のバーの高さ。app-bar コントローラが実測して書き換える。これは JS が動く前の目安。 */
:root { --app-bar-height: 56px; }

/* 折りたためるセクション。見出し (<summary>) の左の山形で開閉が分かるようにし、右へ罫線を伸ばす。
   アンカーで飛んだとき見出しが貼り付いたバーの下に潜らないよう、バーの高さぶん手前で止める。 */
.dash-section { margin: 0 0 24px; scroll-margin-top: calc(var(--app-bar-height) + var(--summary-height, 0px) + 12px); }
.dash-section[hidden] { display: none; }
.dash-section__summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.dash-section__summary::-webkit-details-marker { display: none; }
.dash-section__summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 3px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}
.dash-section:not([open]) > .dash-section__summary::before { transform: rotate(-45deg); }
.dash-section__summary::after { content: ""; flex: 1; border-bottom: 1px solid var(--border); }
.dash-section__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* 並びは折り返す: 添え書きが収まらなければ見出しの下の行へ落ち (狭い画面で見出しが 1 文字ずつ縦に積まれない)、
   見出し自体が行より長ければ見出しの中で折り返す。
   折り返さないと見出しの幅だけでページが横にはみ出す。 */
.dash-section__title { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600; }
.dash-section__note { min-width: 0; color: var(--muted); font-size: 0.8rem; }
.dash-section:not([open]) { margin-bottom: 12px; }
.dash-section:not([open]) > .dash-section__summary { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .dash-section__summary::before { transition: none; }
}

/* 指標ページ (dashboard/index) の中の移動 (dashboard_nav_controller)。サマリー帯・温度マップ・縮めた版のアンカーで飛んだカードは、
   見出しと同じく貼り付いたバーとサマリー帯 (S では縮めた版) の下で止め、少しの間だけ枠を分類色で光らせる (is-target)。 */
.dashboard__main .card { scroll-margin-top: calc(var(--app-bar-height) + var(--summary-height, 0px) + 12px); }
.card.is-target { outline: 2px solid var(--accent); outline-offset: 2px; animation: card-target 1.6s ease-in forwards; }
@keyframes card-target {
  to { outline-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .card.is-target { animation: none; }
}
/* 縮めた版 (S だけ): サマリー帯が画面の上へ流れたら、上端のバーの下にセクションの札の列を出す (分析ページの .digest-dock と同じ出し入れで、
   札は同じ部品 .digest-dock__item)。S ではサマリー帯を貼り付けない (上端のバー・縮めた版・下端のタブバーで画面が狭くなりすぎるため) ので、
   飛び先が潜らないよう --summary-height を縮めた版の高さ (44px。分析ページと同じ) にする。マイ指標の札はマイ指標が隠れている間は隠す。 */
/* 指標ページの後から読む区画 (サマリー帯・温度マップの Turbo Frame)。frame は箱を作らず、中の帯は .dashboard の直下に並ぶ
   (サマリー帯の sticky も .dashboard の中で効く)。読み込み中のスケルトンは帯とおよそ同じ高さにして、届いたときに下が跳ねないようにする。 */
.dashboard__frame { display: contents; }
.skeleton--summary { margin-bottom: 16px; }
.dashboard__frame > .skeleton--band { margin-bottom: 16px; }
@media (max-width: 600px) {
  .skeleton--summary .skeleton__bar { height: 28px; }
}
.dashboard-dock { display: none; }
@media (max-width: 600px) {
  .dashboard { --summary-height: 44px; }
  .dashboard > .summary,
  .dashboard > .dashboard__frame > .summary { position: static; }
  .dashboard-dock {
    --scroll-cue-size: 40px;
    position: fixed;
    top: var(--app-bar-height);
    right: 0;
    left: 0;
    z-index: 4;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--shadow) 6%, transparent);
    scrollbar-width: none;
    transform: translateY(-110%);
    visibility: hidden;
    transition: transform 0.15s ease, visibility 0s linear 0.15s;
  }
  .dashboard-dock::-webkit-scrollbar { display: none; }
  .dashboard[data-dashboard-nav-docked-value="true"] .dashboard-dock { transform: none; visibility: visible; transition: transform 0.15s ease; }
  .dashboard:has(#section-pinned[hidden]) .dashboard-dock__pinned { display: none; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .dashboard-dock,
  .dashboard[data-dashboard-nav-docked-value="true"] .dashboard-dock { transition: none; }
}

/* 指標ページのセクションのグリッド (XL 以上、docs/design-guide.md §8)。セクションを縦に積むだけだと、カードが 2〜4 枚の小さなセクションは
   行の右が空く。XL・XXL では指標の側 (.dashboard__main) を 40rem 以上の列の格子にして、小さなセクションを 2〜4 枚横に並べる
   (中のカードの格子は今のまま auto-fill で、置かれた列の幅で並ぶ)。次のセクションは行を占める:
   マイ指標 (ピン留めは増える)、詳細のカードを含むセクション (チャートに幅が要る。暗号資産と ETF フローの既定)、カードが 7 枚以上のセクション
   (デリバティブ・オンチェーン)、閉じたセクション (見出しの 1 行だけなので、列を占めて隣のセクションの下に空きを作らない)。
   並びは DOM の順のまま (dense にしない。セクションの順は seeds の並びで、読む順でもある)。 */
@media (min-width: 1600px) {
  .dashboard__main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(40rem, 100%), 1fr));
    column-gap: 24px;
    align-items: start;
  }
  .dashboard__main > * { min-width: 0; }
  .dashboard__main > :is(#section-pinned, .empty, .dash-section:not([open])),
  .dashboard__main > .dash-section:has(> .grid > .card[data-density="full"]),
  .dashboard__main > .dash-section:has(> .grid > :nth-child(7)) { grid-column: 1 / -1; }
  /* 「マクロ」(米国債・為替・商品・ボラを束ねたセクション、DashboardSection) は 7 枚を超えても行を占めず 2 列ぶんにして、
     次の株価指数を右の列に並べる (行を占めると株価指数が 1 列だけで行に残り、右が空く)。列が 2 つの幅では 2 列ぶん = 行いっぱい。
     詳細のカードを含むときと閉じたときは上の決まりのまま行を占める。 */
  .dashboard__main > #section-macro[open]:not(:has(> .grid > .card[data-density="full"])) { grid-column: span 2; }
}

/* 速報ページの区画 (feed/show)。L 以下 (1599px まで) は 1 列で、1 行が目で追える 72rem で止めて真ん中に置く。XL (1600px 以上) は 2 列
   (左 = 急変 + カレンダー、右 = 大口送金 + ニュース。docs/design-guide.md §8)。列の中の欄は自分の幅 (container) で列の数を決める。 */
.feed { max-width: 72rem; margin-inline: auto; }
.feed__column { min-width: 0; }
@media (min-width: 1600px) {
  .feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0 24px; max-width: none; }
}
/* 速報ページのブロックの中身 (カレンダー・送金・ニュース) は単体で置いていた頃の下余白を持つので、
   セクションの余白と二重にならないよう外す。 */
.dash-section--feed > .card,
.dash-section--feed > .events { margin-bottom: 0; }
/* 速報のセクションの見出しの行: 添え書き → 罫線 → 右端に「…をすべて見る →」(feed/show。全件へのリンクはカードの頭ではなくここに 1 本)。
   見出しの部品 (dashboard/_section) の添え書きの箱を透かして (display: contents) 中の添え書きとリンクを見出しの行の flex の子にし、
   リンクを罫線 (summary の ::after) の後ろへ回す。リンクは summary の中でも押せば移る (開閉はしない)。i マークの吹き出しは見出しの行に合わせる。 */
.dash-section--feed > .dash-section__summary { position: relative; }
.dash-section--feed .dash-section__note { display: contents; }
.dash-section--feed > .dash-section__summary::after { order: 1; }
.feed-section__note { min-width: 0; }
.feed-section__more { order: 2; color: var(--muted); font-size: 0.85rem; text-decoration: none; white-space: nowrap; }
.feed-section__more:hover { color: var(--text); text-decoration: underline; }
/* 速報から開く単独ページの見出しの上の行き来のリンク (feed/_links)。いま開いているページは文字だけ。 */
.feed-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.feed-links__sep { color: var(--muted); }
.feed-links__current { color: var(--muted); }
/* カレンダーの見出しはセクションの見出しと重なるので、中の方は隠して「次:」の行だけ残す。 */
.dash-section--feed .events__title { display: none; }

/* カードの見出しの右、最新値の手前に置くピン留めの星。ピン留めできるのはダッシュボード
   (pin コントローラの内側) だけなので、指標の単独ページでは出さない。 */
.pin-toggle { display: none; }
[data-controller~="pin"] .pin-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
[data-controller~="pin"] .pin-toggle:hover { background: var(--bg); color: var(--text); }
[data-controller~="pin"] .pin-toggle[aria-pressed="true"] { color: var(--star); }
/* 星が右へ寄るので、最新値は星のすぐ隣に付ける (スマホ向けの margin-left: auto を打ち消す)。 */
.pin-toggle + .card__latest { margin-left: 0; }

/* 分析ページ (/analysis) のパネル。余白は外側の .dash-section が持つ。 */
.analysis__panel { display: block; }

@media (max-width: 600px) {
  .dash-section { margin-bottom: 20px; }
  .dash-section__summary { margin-bottom: 8px; }
}

/* ---- スマホ向け ------------------------------------------------------------- */

/* 指で押す端末では、ボタンやリンクを押しやすい大きさにする。入力欄は 16px 未満だと
   iOS がフォーカス時に画面を拡大してしまうので、文字を 16px に揃える。
   レンジ・時間足の列 (.ranges。上端のバーの全体のレンジと密度、カードの 1m / 5m … と 1日 / 1週 …、決定ページのチャート) は
   期間の切り替えのチップなので 36px (docs/design-guide.md §8)。 */
@media (pointer: coarse) {
  .ranges button,
  .ranges a,
  .levels-toggle,
  .notify-button {
    min-height: 36px;
    padding: 4px 12px;
    font-size: 0.8rem;
  }
  .ranges a { display: inline-flex; align-items: center; }
  .ranges { gap: 6px; }
  /* 絞り込み・期間の切り替えのチップは 36px 以上 (リンクは中身を上下の真ん中に置く。ボタンは元から真ん中)。 */
  .filter-chips__chip,
  .admin-calls__window,
  .ai-council__horizon { display: inline-flex; align-items: center; min-height: 36px; }
  .ai-horizons__tab,
  .outlook-digest__all { min-height: 36px; }

  .toolbar select,
  .alert-form select,
  .alert-form input {
    font-size: 16px;
    min-height: 36px;
  }
  .alert-form input[type=submit],
  .alert-table button { min-height: 36px; font-size: 0.9rem; }
}

@media (max-width: 600px) {
  .container {
    padding-top: 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .app-bar__inner {
    padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }
  /* 下端のタブバー (docs/design-guide.md §8・docs/pages.md の「バーの並び」)。主タブ (shared/_primary_tabs の .primary-tabs--main) を
     画面の下端に固定し、6 つを等分して親指で届くところに置く (ホーム画面に追加した PWA でもネイティブのタブバーと同じ場所)。
     DOM は上端のバーの先頭のまま (読み上げとキーボードの順は変えない) で、position: fixed で下端へ出すだけ。流れの外に出るので、
     app-bar コントローラが測る上端のバーの高さ (--app-bar-height) には入らない。高さは --tab-bar-height (3.5rem) + 下端の safe-area で、
     フッターの下の余白・トーストの位置・フォーカスで送るときの余白 (scroll-padding-bottom) がこの高さを足す。
     色はトークン (--card・--border) だけなので、決定ページ (body.theme-terminal) でも同じ規則で暗くなる (今のページの地は
     .theme-terminal .primary-tabs__link[aria-current] の --accent-fill)。.theme-terminal .primary-tabs (角丸 6px) より詳細度を上げるため nav を添える。 */
  /* ゲストのバーには主タブが無いので、下端のタブバーの高さも足さない (主タブがあるときだけ 3.5rem)。 */
  :root:has(.app-bar nav.primary-tabs--main) { --tab-bar-height: 3.5rem; }
  html { scroll-padding-bottom: calc(var(--tab-bar-height) + env(safe-area-inset-bottom)); }
  .app-bar nav.primary-tabs--main {
    position: fixed;
    inset: auto 0 0 0;
    display: flex;
    gap: 4px;
    height: calc(var(--tab-bar-height) + env(safe-area-inset-bottom));
    /* 上の線 1px と上下の余白 5px / 6px を引いて、タブの高さを 44px にする。 */
    padding: 5px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: var(--card);
  }
  .app-bar nav.primary-tabs--main .primary-tabs__link {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    /* 6 等分の幅 (390px で 1 本 59px) に 3 文字が入るよう、横の余白は詰める (押せる範囲は等分の幅いっぱい)。 */
    padding-inline: 4px;
  }
  /* 6 文字の「タイムライン」は等分の幅に入らないので、短い名前 (Shared::PrimaryTabsComponent の data-short = 「時系列」) で描く。
     元の文字は読み上げ用に残す (font-size: 0 で見えなくし、::before が短い名前を描く)。 */
  .app-bar nav.primary-tabs--main .primary-tabs__link[data-short] { font-size: 0; }
  .app-bar nav.primary-tabs--main .primary-tabs__link[data-short]::before { content: attr(data-short); font-size: 1rem; }
  /* 「決定」の Pro の札は、6 等分の幅 (320px で 1 本 47px) に名前と並べると入らず、右上に重ねると「定」の字に被るので、名前の右上の
     6px の点 (--accent) にする。字は描かない (font-size: 0。要素と aria-label の「決定 (Pro プラン)」は上端のバーと同じ)。
     左の余白 2px と右の負の余白で幅を 0 に打ち消し、名前はタブの真ん中のまま。今のページのタブ (黒地) では字と同じ色の点。 */
  .app-bar nav.primary-tabs--main .plan-badge {
    flex: none;
    width: 6px;
    height: 6px;
    margin: 0 -8px 0 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    font-size: 0;
    line-height: 0;
    transform: translateY(-0.4rem);
  }
  .app-bar nav.primary-tabs--main .primary-tabs__link[aria-current] .plan-badge { background: currentColor; }
  /* 上端のバーには、アイコン (表示タイムゾーン・アラート・設定・アカウント。管理者は管理も) を右に寄せ、ページ固有の列だけを置く:
     指標ページは 1 行目の左にカードの密度、2 行目に全体のレンジを幅いっぱいに。管理画面は 2 行目が管理のタブ (ファイルの末尾の .admin-tabs)。
     表示タイムゾーンは 時計のアイコンのボタンにして、セレクトはバーの下に開くポップオーバーに入れる。
     DOM の順は変えず order だけで組むので、PC の並びには響かない。ラベルは幅を空けるため見えなくするだけで、
     nav の aria-label は残るので名前は読み上げられる。リンクの文字も読み上げ用に残し、title で長押しの説明を付けてある。
     アイコンの見た目は 36px に詰めるが、押せる範囲は下の「押せる範囲を広げる」(::after) で 44px を保つ。 */
  .app-bar .density-bar { order: -3; margin-left: 0; }
  .toolbar { order: -2; flex: none; margin-left: auto; }
  .app-bar__links { order: -1; gap: 4px; }
  .app-bar__inner { gap: 6px 4px; }
  /* 全体のレンジ (1日 / 1週 / 1か月 / 1年 / 全期間) は 2 行目を 1 本で占め、ボタンを伸ばして幅を埋める (指で押しやすい幅になる)。
     レンジと密度をまとめる箱 (.app-bar__controls) は display: contents のままなので、order はどちらも app-bar__inner の中で効く
     (主タブはこの幅では下端のタブバーにあり、レンジが主タブの行に入り込むことは無い)。 */
  .scale-bar { gap: 6px; flex-wrap: nowrap; }
  .scale-bar .ranges { flex-wrap: nowrap; gap: 3px; }
  .app-bar .scale-bar:not(.density-bar) { order: 0; flex: 1 0 100%; }
  .app-bar .scale-bar:not(.density-bar) .ranges { flex: 1 1 auto; }
  .app-bar .scale-bar .ranges button { flex: 1 1 auto; padding-inline: 4px; white-space: nowrap; }
  .scale-bar__label,
  .app-bar__link-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .app-bar__link { padding: 6px 0; min-width: 36px; justify-content: center; }
  .toolbar .timezone__toggle { display: inline-flex; font: inherit; font-size: 0.85rem; cursor: pointer; }
  /* ポップオーバーはバーの直下の右端に開く (開いていない間はブラウザの既定どおり隠れる)。 */
  .timezone__popover:popover-open {
    position: fixed;
    inset: calc(var(--app-bar-height) + 4px) max(12px, env(safe-area-inset-right)) auto auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--shadow) 12%, transparent);
  }
  .timezone__popover:not(:popover-open) { display: none; }
  /* PC 幅の途中 (1366px 以下) で隠したラベルも、ポップオーバーの中では見出しとして見せる。 */
  .app-bar .timezone__popover .toolbar__label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }

  .page-header { margin-bottom: 12px; }
  .page-header h1 { font-size: 1.3rem; }
  .page-header__links { flex-wrap: wrap; gap: 8px 12px; }

  .grid { gap: 12px; }
  .card { padding: 12px; gap: 10px; }
  .card__header { flex-wrap: wrap; gap: 4px 12px; }
  .card__latest { margin-left: auto; }
  .card__latest strong { font-size: 1.25rem; }
  .card__title { font-size: 1rem; }
  .grid--single .card__chart { height: clamp(17.5rem, 60vh, 26rem); }

  .events { padding: 10px 12px; margin-bottom: 12px; }
  .events__item { padding: 4px 6px; gap: 0 8px; }
  .events__time { min-width: 0; flex-basis: 100%; font-size: 0.75rem; }


  /* アラートのフォームは 2 列、追加ボタンは幅いっぱい。 */
  .alert-form { gap: 10px; }
  .alert-form label { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .alert-form select,
  .alert-form input { width: 100%; }
  .alert-form input[type=submit] { flex: 1 1 100%; }

  /* 登録済みの表は行ごとのカードに組み替える (表の class の stack-table。下の「共通部品: 表を行ごとのカードに」)。
     表の囲み (.alert-rules__scroll) の横送りもカードでは要らない。操作のボタン (data-label なし) だけは右寄せの横並びのままにする。 */
  .alert-rules,
  .alert-rules__scroll { overflow-x: visible; }
  .alert-table td.alert-table__actions { display: flex; padding-top: 8px; justify-content: flex-end; }
}

/* クジラの活動パネル (/whale_activity)。時間別の移動額の棒・取引所別の棒・時間帯のヒートマップ・サイズ分布を 1 枚に並べる。
   取引所別の表とサイズ分布 (と新規ウォレットへの流出) は .panel-more に畳む。 */
.whale-activity__summary { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.whale-activity__summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.whale-activity__chart-block { margin: 0 0 16px; min-width: 0; }
.whale-activity__chart-head { margin-bottom: 6px; font-size: 0.8rem; color: var(--muted); }
.whale-activity__grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(min(22.5rem, 100%), 1fr)); }
.whale-activity__block { margin: 0; min-width: 0; }
.whale-activity__block figcaption { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.whale-activity__block figcaption strong { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.whale-activity__empty,
.whale-heatmap { grid-column: 1 / -1; }
/* サイズ分布は開け口の中で 1 つだけになるので、横に伸びすぎないよう表の幅を抑える (取引所別の表の 1 列ぶん程度)。 */
.whale-sizes { max-width: 36rem; }

/* 取引所別の表。流出の棒は左へ、流入の棒は右へ伸び、数字は棒の外側。BTC は取引所に載ると売り圧力なので
   流入を赤・流出を緑に、ステーブルコインは取引所に載ると買い余力なので流入を緑・流出を赤にする。 */
.whale-flows { --inflow: var(--down); --outflow: var(--up); --inflow-text: var(--down-text); --outflow-text: var(--up-text); }
.whale-flows--stablecoin { --inflow: var(--up); --outflow: var(--down); --inflow-text: var(--up-text); --outflow-text: var(--down-text); }
.whale-flows__table,
.whale-sizes__table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
/* 列幅を固定して、棒の列が取引所名や数字に押されて潰れないようにする。長い取引所名は省略する。 */
.whale-flows__table { table-layout: fixed; }
.whale-flows__table tbody th { overflow: hidden; text-overflow: ellipsis; }
.whale-flows__table col.is-owner { width: 26%; }
.whale-flows__table col.is-number { width: 12%; }
.whale-flows__table col.is-bar { width: 19%; }
.whale-flows__table col.is-net { width: 12%; }
.whale-flows__table th,
.whale-sizes__table th { text-align: left; font-weight: 600; color: var(--muted); padding: 2px 6px; white-space: nowrap; }
.whale-flows__table td,
.whale-sizes__table td { padding: 2px 4px; }
.whale-flows__table tr.is-others th { font-weight: 400; font-style: italic; }
.whale-flows__number { text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.whale-flows__number.is-inflow { text-align: left; }
.whale-flows__bar,
.whale-sizes__bar { position: relative; height: 22px; }
.whale-flows__bar { padding: 0; }
.whale-flows__bar span,
.whale-sizes__bar span { position: absolute; top: 5px; bottom: 5px; border-radius: 3px; }
.whale-flows__bar.is-outflow span { right: 0; background: var(--outflow); }
.whale-flows__bar.is-inflow { border-left: 1px solid var(--border); }
.whale-flows__bar.is-inflow span { left: 0; background: var(--inflow); }
.whale-flows__net { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.whale-flows__net.is-positive,
.whale-flows figcaption strong.is-positive { color: var(--inflow-text); }
.whale-flows__net.is-negative,
.whale-flows figcaption strong.is-negative { color: var(--outflow-text); }

.whale-sizes__bar { width: 60%; }
.whale-sizes__bar span { left: 0; background: var(--accent); opacity: 0.7; }
/* 件数は棒の上にも地の上にも載るので、地の色の縁取り (text-shadow) で読ませる (mix-blend-mode: difference はライトでもダークでも薄く沈んだ)。 */
.whale-sizes__bar em { position: absolute; top: 0; left: 4px; line-height: 22px; font-style: normal; font-size: 0.75rem; color: var(--text); font-variant-numeric: tabular-nums; text-shadow: 0 0 2px var(--card), 0 0 2px var(--card); }
.whale-sizes__usd { text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.whale-heatmap__scroll { overflow-x: auto; }
.whale-heatmap__table { border-collapse: collapse; font-size: 0.7rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.whale-heatmap__table th { color: var(--muted); font-weight: 600; padding: 2px 3px; text-align: center; }
.whale-heatmap__table tbody th { text-align: left; padding-right: 6px; }
.whale-heatmap__table td { width: 3.6%; min-width: 22px; height: 22px; text-align: center; border: 1px solid var(--border); color: var(--text); }

/* 送金 1 件の行に添える新規ウォレットとアドレス分類 (受け手の残高は分類のバッジの吹き出し)。 */
.whale-item__address-type { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.whale-item__fresh { color: var(--on-fill); background: color-mix(in srgb, var(--kind-fresh) var(--fill-text-mix), var(--text)); border-radius: 999px; padding: 0 6px; font-size: 0.7rem; font-weight: 600; }
.whale-item__kind--freeze { --kind: var(--kind-freeze); }
.whale-item__kind--unfreeze { --kind: var(--kind-unfreeze); }

/* ---- 最上段のサマリー帯 (dashboard/_summary、summary_controller) ---------------- */

/* 「今の状態」のタイルを、バーの直下に貼り付けて右から左へ途切れなく流し続ける (取引所の電光掲示板)。
   列 (.summary__track) の後ろに ticker_controller がタイルの写しを足して前半と後半を同じ並びにし、
   列を自分の幅の半分だけ左へ送っては頭へ戻す。戻っても見た目が変わらないので、最後のタイルのすぐ後ろに
   先頭のタイルが続く。写しは見た目だけで購読しない (タイルごとに Action Cable を購読するので、元を
   複製すると購読が重なる)。所要時間 (速さが一定になる値) と窓の高さ (--summary-height。見出しへ飛ぶ
   位置がこれを足す) は ticker_controller が書く (JS が動く前の目安が 60s)。
   マウスを載せても止めない。キーボードでタイルへ移ったとき (:focus-visible) だけ止めて、選んだタイルが
   流れ去らないようにする (クリックで付くフォーカスでは止めない。押したあとも流れ続ける)。止めたい人には右端に
   一時停止のボタン (.summary__pause、pause_controller) を置く (WCAG 2.2.2)。流れる列を切り抜くのは窓 (.summary__window) で、
   ボタンは窓の外に置くので端の薄れに掛からない。
   タイルの見た目だけ幅で変える: PC はスパークライン付きの縦長、スマホは 1 行に収めた角丸の長方形。
   色はカードの分類色 (--accent) をタイルにも当てる。 */
.summary {
  position: sticky;
  top: var(--app-bar-height);
  /* i マークの吹き出し (z-index 4) と同じ高さ。バー (5) よりは奥に置く。 */
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 16px;
  padding: 8px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.summary__window {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  /* 端でタイルがぷつっと切れないよう薄れさせる。 */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
/* 一時停止 / 再開。押されている (aria-pressed="true") 間は ▶ (再開) を、普段は ⏸ を描く。 */
.summary__pause {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}
.summary__pause:hover { color: var(--text); }
/* 記号は字形に頼らず (⏸ の字形が無い環境がある) 形で描く: 普段は縦棒 2 本、止めている間は右向きの三角。 */
.summary__pause-icon { display: block; width: 8px; height: 10px; border-inline: 3px solid currentColor; }
.summary__pause[aria-pressed="true"] { border-color: var(--text); color: var(--text); }
.summary__pause[aria-pressed="true"] .summary__pause-icon { width: 9px; margin-left: 2px; border: 0; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.summary.is-paused .summary__track { animation-play-state: paused; }
.summary__track {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  /* 末尾にもタイルの間と同じ余白を置いて、1 組の幅を「タイル + 間」の繰り返しにする。こうすると列の
     半分がちょうど前半の組の幅になり、-50% 送ったところで後半の頭が前半の頭と同じ位置に来る。 */
  padding-right: 8px;
  animation: summary-ticker var(--ticker-duration, 60s) linear infinite;
}
.summary:has(:focus-visible) .summary__track { animation-play-state: paused; }
@keyframes summary-ticker {
  to { transform: translateX(-50%); }
}
/* 押せる範囲を広げる。見た目 (余白・大きさ) は変えず、::after で目に見えない当たり判定を、縦横とも
   最低 32px (指で押す端末では 44px) まで広げる。小さな i マーク・ピン・音のボタン・レンジの列・バーのリンクと、
   閉じるボタン (設定のポップアップ・トーストの ×) が対象。ボタン自身の ::after を使うものは無いので、ここで一括して付ける。 */
.info__mark,
.pin-toggle,
.decision__sound,
.levels-toggle,
.notify-button,
.ranges button,
.ranges a,
.app-bar__link,
.primary-tabs__link,
.whale-item__link,
.settings-dialog__close,
.toast__close,
.heatmap__name,
.card__analysis { position: relative; }
.info__mark::after,
.pin-toggle::after,
.decision__sound::after,
.levels-toggle::after,
.notify-button::after,
.ranges button::after,
.ranges a::after,
.app-bar__link::after,
.primary-tabs__link::after,
.whale-item__link::after,
.settings-dialog__close::after,
.toast__close::after,
.heatmap__name::after,
.card__analysis::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 32px);
  height: max(100%, 32px);
  transform: translate(-50%, -50%);
}
@media (pointer: coarse) {
  .info__mark::after,
  .pin-toggle::after,
  .decision__sound::after,
  .levels-toggle::after,
  .notify-button::after,
  .ranges button::after,
  .ranges a::after,
  .app-bar__link::after,
  .primary-tabs__link::after,
  .settings-dialog__close::after,
  .toast__close::after,
  .heatmap__name::after,
  .card__analysis::after { width: max(100%, 44px); height: max(100%, 44px); }
  /* 送金の行の中の出どころのリンク (.whale-item__link。「Whale Alert」「mempool.space」) は 32px のままにする。行の中で折り返した
     送り手・受け手の名前 (.whale-item__owner。押すと一覧の絞り込み) と 4px しか離れていないので、44px に広げると上下の行の名前に被さって
     そちらが押せなくなる (位置を持つ ::after は手前に描かれる。393px の /whales で 3 か所)。行の高さと行の間で押し分ける (docs/design-guide.md §8)。 */
}

/* 指で押す端末で、文字の高さ (18〜24px) しか無かった押せるものを 44px にする (docs/design-guide.md §8)。
   - フッターのリンクと、単独ページの見出しの戻りリンク (「← 指標」など) は、行の高さを 44px にする (並んだ行どうしの当たりが重ならないよう、行の間は詰める)。
     速報の行き来のリンク (.feed-links)、ゲストのバーのロゴ、「このサイトについて」のページの名前のリンク (1 行に 1 つ) も同じ。
   - 折りたためるセクションの見出し (.dash-section__summary) は、行の高さを 44px にする (閉じたセクションが縦に並ぶスマホの指標・分析で、隣を押し違えない)。
   - 今の地合いのタイルの名前 (.digest-tile__link。押すとパネルへ) は、上下の余白で当たりだけを 44px に広げ、同じだけ引いて見た目の位置は変えない
     (名前は overflow: hidden で切るので、::after の当たりは使えない)。 */
@media (pointer: coarse) {
  .site-footer__links { row-gap: 0; }
  .site-footer__links a,
  .feed-links a,
  .page-header > p:first-child a,
  .page-header__links a,
  .app-bar__brand,
  .static-page__defs dt > a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer--compact .site-footer__links a { min-height: 0; }
  .page-header__links { margin-top: 0; row-gap: 0; }
  .feed-links { align-items: center; row-gap: 0; }
  .dash-section__summary { min-height: 44px; }
  .digest-tile__link { margin-block: -13px; padding-block: 13px; }
  /* セクションの見出しの右の「すべて見る →」、鍵の区画の「プランを見る」、カレンダーの日付の開け口、日報の「続きを読む」も 44px。
     見通しの行の飛び先のチップと、指標のカードの「畳む」は、ほかのチップと同じ 36px。 */
  .feed-section__more,
  .locked__link { display: inline-flex; align-items: center; min-height: 44px; }
  .events__date { padding-block: 12px; }
  .ai-forecast__more summary { padding-block: 12px; }
  .outlook-digest__jump,
  .card__density { display: inline-flex; align-items: center; min-height: 36px; }
}

/* 動きを減らす設定のときは流さず、指やトラックパッドで横へ送る列にする。流れないので一時停止のボタンも出さない。 */
@media (prefers-reduced-motion: reduce) {
  .summary__window { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; }
  .summary__window::-webkit-scrollbar { display: none; }
  .summary__track { animation: none; }
  .summary__pause { display: none; }
}

.summary__tile {
  display: flex;
  flex: 0 0 10.5rem;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.12s ease;
}
.summary__tile[href]:hover { border-color: var(--muted); }
.summary__tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.summary__tile--btc_jpy,
.summary__tile--eth_jpy,
.summary__tile--btc_binance,
.summary__tile--eth_binance,
.summary__tile--btc_coinbase,
.summary__tile--eth_coinbase,
.summary__tile--btc_bitflyer,
.summary__tile--eth_bitflyer,
.summary__tile--btc_usd,
.summary__tile--eth_usd,
.summary__tile--btc_japan_premium { --accent: var(--accent-crypto); }
.summary__tile--btc_funding_weighted,
.summary__tile--btc_oi_total { --accent: var(--accent-derivatives); }
.summary__tile--btc_etf_flow { --accent: var(--accent-etf-flow); }
.summary__tile--btc_exchange_netflow { --accent: var(--accent-onchain); }
.summary__tile--btc_dvol { --accent: var(--accent-derivatives); }
.summary__tile--btc_fear_greed,
.summary__tile--btc_dominance { --accent: var(--accent-sentiment); }
.summary__tile--us10y { --accent: var(--accent-bond); }
/* XXL (2200px 以上) にだけ出すタイル (DVOL・Fear & Greed・ドミナンス・米 10 年。DashboardSummary::EXTRA_TILES)。ほかの幅では帯に並べない
   (ticker_controller は見えているタイルだけで 1 組の幅を測る)。XXL はタイルを 10rem に詰め、2560px で 12 枚が窓に収まるようにする。 */
.summary__tile--extra { display: none; }
@media (min-width: 2200px) {
  .summary__tile { flex-basis: 10rem; }
  .summary__tile--extra { display: flex; }
}
/* 1 組が窓の幅に収まるときは流さない (ticker_controller が is-static を付ける)。写しは作らず、端の薄れと一時停止のボタンも外し
   (動かないので止める必要が無い)、タイルを窓の幅いっぱいに伸ばす (縮めはしないので、窓が狭くなれば 1 組の幅が窓を超えてまた流れる)。 */
.summary.is-static .summary__track { width: auto; padding-right: 0; animation: none; }
.summary.is-static .summary__tile { flex-grow: 1; }
.summary.is-static .summary__window { -webkit-mask-image: none; mask-image: none; }
.summary.is-static .summary__pause { display: none; }
/* 相場を大きく動かしやすいイベント (FOMC・四半期の満期など) はカレンダーと同じく左端を下落色に。 */
.summary__tile--event.is-major { box-shadow: inset 3px 0 0 var(--down); }

.summary__label,
.summary__value,
.summary__delta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.summary__label { color: var(--muted); font-size: 0.72rem; }
/* 幅 10.5rem (16px の文字で 168px) のタイルに 8 桁の円建て価格と単位が収まる大きさ。幅も文字も rem なので、文字が大きい画面でも収まる。 */
.summary__value strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
}
/* 値の色は前回の値からの動き (summary_controller#showTrend。カードの見出しと同じ)。次に動くまで保つ。 */
.summary__value strong.is-trend-up { color: var(--up-text); }
.summary__value strong.is-trend-down { color: var(--down-text); }
/* 配信で値が変わった瞬間のフラッシュ (summary_controller#flash)。カードと同じ keyframes を使う。 */
.summary__value strong.is-flash-up { animation: flash-up 1s ease-out; }
.summary__value strong.is-flash-down { animation: flash-down 1s ease-out; }
.summary__unit { margin-left: 3px; color: var(--muted); font-size: 0.7rem; }
.summary__tile.is-empty .summary__value strong { color: var(--muted); }
.summary__delta { font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.summary__delta-label { margin-right: 4px; color: var(--muted); }
.summary__change.is-up { color: var(--up-text); }
.summary__change.is-down { color: var(--down-text); }
.summary__time { color: var(--muted); }
.summary__event-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
}
.summary__countdown { display: block; color: var(--accent-text); }

.summary__sparkline { display: block; width: 100%; height: 1.75rem; margin-top: auto; padding-top: 4px; overflow: visible; }
.summary__line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.summary__bar { fill: var(--accent); }
.summary__bar.is-negative { fill: var(--down); }
.summary__baseline { stroke: var(--border); vector-effect: non-scaling-stroke; }

/* スマホではグラフを省いた 1 行にする。タイルは角丸の長方形。 */
@media (max-width: 600px) {
  .summary {
    margin: 0 calc(-1 * max(12px, env(safe-area-inset-right))) 12px calc(-1 * max(12px, env(safe-area-inset-left)));
    padding: 6px max(8px, env(safe-area-inset-right)) 6px 0;
  }
  .summary__tile {
    flex: none;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 8px;
  }
  .summary__label,
  .summary__value,
  .summary__delta { overflow: visible; text-overflow: clip; }
  .summary__value strong { font-size: 0.9rem; }
  .summary__delta { display: inline-flex; gap: 4px; align-items: baseline; }
  .summary__delta-label { margin-right: 0; }
  .summary__event-name { display: block; font-size: 0.8rem; white-space: nowrap; }
  .summary__countdown { display: inline; }
  .summary__sparkline { display: none; }
}
/* S のタッチではタイル (指標のカードへのリンク) を 44px の高さにする。帯の上下の余白を 2px に詰め、帯は 4px だけ高くなる。 */
@media (max-width: 600px) and (pointer: coarse) {
  .summary { padding-block: 2px; }
  .summary__tile { padding-block: 9px; }
}

/* ---- 温度マップ (dashboard/_heatmap、DashboardHeatmap・DashboardHelper) ---------------- */

/* ページに並ぶ全指標を 1 マスずつ、カテゴリごとの塊 (小見出し + マス) にして並べる。マスは決まった大きさのタイルで、
   画面が広くても引き伸ばさない (docs/design-guide.md §4)。地の色が向き (緑 = 上げ / 赤 = 下げ) で、濃さ --tile (6〜40%) は
   成績のヒートマップ (.outlook-scorecard__cell) と同じ混ぜ方 (ダークは --tile-scale と --tile-floor で 10〜50% に伸ばす)。文字は色を着けない (§6)。
   並べ方は幅の段で変える:
   - M・L: 塊を横に並べて入りきらなければ折り返し、塊の中のマスも行の幅で折り返す (デリバティブのような大きな塊は 1 行を占めて 2〜3 段になる)。
     どの幅でも塊がはみ出さない。
   - XL 以上: 塊の中のマスを縦に --heatmap-rows 段ずつ詰めて右へ伸ばし (grid-auto-flow: column)、塊を 1 行の帯に並べる (XL は 6 段、
     文字が大きく横に余裕のある XXL は 5 段)。帯が入りきらない幅 (XL の下端で指標が多いとき) は M・L と同じく塊ごと折り返す。
   - S (600px 以下): 塊を縦に積み、マスを 4 列ほどの格子に流して幅いっぱいに伸ばす。 */
/* マスの幅は 4.75rem。下の段 (メンバーのラベル) と矢印を文字の下限 0.7rem (11px) で書き、その分だけ 4.5rem から広げた。 */
.heatmap {
  --heatmap-cell: 4.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
}
.heatmap__group { display: flex; flex: 0 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
/* 小見出しは折り返さず、塊の幅は小見出しとマスの広いほうになる (短い名前なので塊からはみ出さない)。 */
.heatmap__name {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.heatmap__name:hover { color: var(--text); text-decoration: underline; }
.heatmap__name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.heatmap__cells { display: flex; flex-wrap: wrap; gap: 3px; }
.heatmap__cell {
  position: relative;
  display: flex;
  flex: 0 0 var(--heatmap-cell);
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  height: 2.5rem;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border) 35%, transparent);
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.2;
  text-decoration: none;
}
.heatmap__cell:hover { border-color: var(--text); }
.heatmap__cell--up { background: color-mix(in srgb, var(--up) calc(var(--tile-floor) + var(--tile, 6%) * var(--tile-scale)), var(--card)); }
.heatmap__cell--down { background: color-mix(in srgb, var(--down) calc(var(--tile-floor) + var(--tile, 6%) * var(--tile-scale)), var(--card)); }
/* 変化を測らない系列 (累積・期間ごとの合計) は地を薄い灰のまま文字を沈め、基準の無い系列は枠だけ (成績の .is-na と同じ控えめさ)。 */
.heatmap__cell--unmeasured,
.heatmap__cell--pending { color: var(--muted); }
.heatmap__cell--pending { background: transparent; border-style: dashed; border-color: var(--border); }
.heatmap__label,
.heatmap__detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heatmap__label { font-weight: 600; }
/* 下の段 (メンバーのラベル) は、灰にも半透明にもせずマスの文字の色のまま書く (名前との差は太さで付ける)。右下の矢印に重ならないよう右を空ける。
   78% に薄めていたときは、灰の字のマス (変化を測らない系列) で 3.4:1、ダークの濃いマスで 3.9:1 しかなかった。 */
.heatmap__detail { padding-right: 0.6rem; font-size: 0.7rem; }
.heatmap__arrow { position: absolute; right: 4px; bottom: 1px; font-size: 0.7rem; line-height: 1.2; }
@media (min-width: 1600px) {
  .heatmap { --heatmap-rows: 6; }
  .heatmap__cells {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--heatmap-rows), var(--heatmap-row, 2.5rem));
    grid-auto-columns: var(--heatmap-cell);
  }
}
@media (min-width: 2200px) {
  .heatmap { --heatmap-rows: 5; }
}
@media (max-width: 600px) {
  .heatmap { display: grid; gap: 8px; }
  .heatmap__cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); }
}
/* 指で押す端末ではマスの高さを 44px にする (§8)。小見出しは下の「押せる範囲を広げる」で当たり判定だけを広げる。 */
@media (pointer: coarse) {
  .heatmap__cell { height: 2.75rem; }
  .heatmap { --heatmap-row: 2.75rem; }
}

/* ---- カードの見出し: Δ・読み方・注目、と密度 (chart_controller) ---------------- */

/* 密度の違うカードが同じ行に並ぶので、行の高さに引き伸ばさず各自の高さで置く
   (コンパクトのカードの下に空白が残らないように)。 */
.grid { align-items: start; }

/* 24 時間前 (日次系列は 1 つ前の点) からの変化。最新値の下に、上昇・下落の色で。 */
.card__change {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.card__change[hidden] { display: none; }
.card__change.is-up { color: var(--up-text); }
.card__change.is-down { color: var(--down-text); }

/* 見出しの下の 1 行: 注目バッジ、読み方のラベル、展開 / 畳むボタン。 */
.card__signals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 4px 0 0;
}
.card__badge,
.reading {
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: nowrap;
}
.card__badge { display: none; background: var(--hot-text); color: var(--on-fill); font-weight: 700; }
.card.is-attention .card__badge { display: inline-block; }
.reading { display: inline-block; border: 1px solid currentColor; }
.reading[hidden] { display: none; }
.reading--positive { color: var(--up-text); background: color-mix(in srgb, var(--up) 8%, transparent); }
.reading--negative { color: var(--down-text); background: color-mix(in srgb, var(--down) 8%, transparent); }
.reading--neutral { color: var(--muted); }
.reading--hot { color: var(--hot-text); background: color-mix(in srgb, var(--hot) 12%, transparent); font-weight: 700; }

/* 注目のカードは枠を太く橙に。読み方が hot の間と、閾値アラートの発火から 10 分間
   (charts/attention.js が理由ごとに付け外しする)。 */
.card.is-attention {
  border-color: var(--hot);
  box-shadow: 0 0 0 1px var(--hot), 0 4px 16px color-mix(in srgb, var(--hot) 18%, transparent);
}

.card__density {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.6;
  cursor: pointer;
}
.card__density:hover,
.card__density:focus-visible { border-color: var(--accent); color: var(--accent-text); }

/* 見出しの行: カードの名前の右に、同じ数字を描いている分析ページのパネルへの小さな「→ 分析」(IndicatorsHelper#card_analysis_link)。
   グループのカードのメンバーの名前 (card__member) はコンパクトのタイルのときだけ見せる (詳細ではメンバーの切り替えの列が言う)。 */
.card__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.card__analysis { color: var(--muted); font-size: 0.75rem; text-decoration: none; white-space: nowrap; }
.card__analysis:hover { color: var(--text); text-decoration: underline; }
.card__analysis:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.card__member { display: none; }

/* コンパクトのタイル: 値とスパークラインだけの小さなタイル (高さ 7rem・最小幅 16rem)。指標ページのカードの格子は 16rem の列にし、
   タイルは 1 列、詳細のカードは 2 列を占める (S は 2 列の格子で、詳細は幅いっぱい)。セクションの中がすべて詳細のカードなら、
   今までどおり 22.5rem の列に 1 枚ずつ並べる (2 列ぶんの詳細だけを奇数の列に並べると、行の端に穴が空くため)。
   詳細とタイルが混ざって空いた穴は後ろのタイルで埋める (grid-auto-flow: dense。入れ替わるのはセクションの中の並びだけ)。
   タイルの中は 1 行目が名前 (グループはいま見せているメンバーの名前を添える)・i マーク・☆、2 行目が値・単位・Δ、残りの高さがスパークライン。
   読み方・時刻・参考値・メンバーの切り替え・「→ 分析」・「畳む」は詳細に広げたときに出す (注目は橙の枠で分かる)。
   見出し以外のどこを押しても広がるよう、card__expand をタイルの全体に透明に重ね、見出しのリンク・i マーク・☆ だけをその上に出す。
   i マークの吹き出しがタイルの外へ出られるよう、タイルは overflow で切らない (チャートが残りの高さに縮む)。
   軸・グリッドはチャート側 (chart_controller#chartOptions) が消す。高さの変化はチャートの autoSize が拾って描き直す。 */
.dashboard__main .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  grid-auto-flow: row dense;
}
.dashboard__main .grid > .card[data-density="full"] { grid-column: span 2; }
.dashboard__main .grid:not(:has(> .card[data-density="compact"])) { grid-template-columns: repeat(auto-fill, minmax(min(22.5rem, 100%), 1fr)); }
.dashboard__main .grid:not(:has(> .card[data-density="compact"])) > .card { grid-column: auto; }
.card[data-density="compact"] { position: relative; height: 7rem; gap: 2px; padding: 10px 12px 8px; }
.card[data-density="compact"]:has(> .card__expand:hover) { border-color: var(--muted); }
.card[data-density="compact"] .card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "heading pin" "latest latest";
  align-items: center;
  gap: 0 6px;
}
.card[data-density="compact"] .card__heading { grid-area: heading; min-width: 0; }
.card[data-density="compact"] .card__title { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; font-size: 0.85rem; white-space: nowrap; }
.card[data-density="compact"] .card__title a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* メンバーの名前は名前より先に縮める (長いメンバー名「レバレッジド・ファンド」で名前が消えないように)。 */
.card[data-density="compact"] .card__member {
  display: inline;
  flex: 0 4 auto;
  min-width: 2.5em;
  margin-left: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: normal;
  text-overflow: ellipsis;
}
.card[data-density="compact"] :is(.card__category, .card__signals, .card__analysis, .card__reference, .card__time, .members, .card__controls) { display: none; }
.card[data-density="compact"] .pin-toggle { grid-area: pin; width: 24px; height: 24px; }
.card[data-density="compact"] .card__latest {
  display: flex;
  flex-wrap: wrap;
  grid-area: latest;
  align-items: baseline;
  column-gap: 6px;
  min-width: 0;
  margin-left: 0;
  overflow: hidden;
  text-align: left;
}
.card[data-density="compact"] .card__latest strong { padding: 0; font-size: 1.15rem; }
.card[data-density="compact"] .card__unit { margin-left: 0; font-size: 0.75rem; }
.card[data-density="compact"] .card__change { min-width: 0; overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.card[data-density="compact"] .card__chart { flex: 1 1 0; min-height: 0; height: auto; }
/* 見出しのリンク・i マーク・☆ は広げるボタンの上に出す (i マークの吹き出しは z-index 4 なので、もとからボタンより手前)。 */
.card[data-density="compact"] :is(.card__title a, .info__mark, .pin-toggle) { position: relative; z-index: 2; }
.card__expand { display: none; }
.card[data-density="compact"] > .card__expand {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.card[data-density="compact"] > .card__expand:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* スパークラインの上ではスピナーが窮屈なので小さくする。 */
.card[data-density="compact"].is-loading .card__chart::after { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-width: 2px; }

@media (pointer: coarse) {
  .card__density { min-height: 28px; padding: 2px 10px; }
}
@media (max-width: 600px) {
  .dashboard__main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard__main .grid > .card[data-density="full"] { grid-column: 1 / -1; }
  .dashboard__main .grid:not(:has(> .card[data-density="compact"])) { grid-template-columns: minmax(0, 1fr); }
  .card[data-density="compact"] { padding: 8px 10px 6px; }
  .card[data-density="compact"] .card__title { font-size: 0.8rem; }
  .card[data-density="compact"] .card__latest strong { font-size: 1rem; }
}

/* ---- グループのカード: メンバーの切り替え (IndicatorGroup、chart_controller#switchMember) ---- */

/* 取引所別の指標を 1 枚に畳んだカードの、メンバー (合算 / Binance / Bybit / OKX など) の切り替え。
   すぐ下の表示レンジの列 (.ranges、選ぶと分類色で塗る独立したボタン) と見分けがつくよう、
   こちらは 1 本の枠に収めたセグメントにし、選んだものだけを白地に分類色の文字で浮かせる。
   コンパクトでも隠さず、スパークラインの上に 1 行で置く。スマホの幅で 4 つ並ばないとき
   (L/S 比の「Binance 大口 … Bybit ロング%」) は枠の中で折り返す。横送りにすると端の
   メンバーが切れて、選べることに気づかれない。 */
.members {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  max-width: 100%;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.members__button {
  flex: none;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 1px 10px;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
}
.members__button:hover { color: var(--text); }
.members__button.is-active {
  background: var(--card);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow) 12%, transparent);
}

/* メンバーごとに描いておく i マークのうち、選んでいないメンバーのぶん。.info の inline-block が
   hidden 属性に勝ってしまうので明示する。 */
.info[hidden] { display: none; }

/* 指で押す端末では切り替えのチップと同じ 36px にする (docs/design-guide.md §8)。 */
@media (pointer: coarse) {
  .members__button { min-height: 36px; padding: 2px 12px; font-size: 0.78rem; }
}

/* ---- 時間帯 × 曜日の値動き (/sessions、SessionProfile) ---- */

/* 時間帯・曜日の表のセルの背景は SessionsHelper と session_profile_controller が付ける (平均リターンと勝率は
   正が青・負が赤、値幅は向きを持たないので灰の濃淡。色は --heat-* のトークン)。セッションの 4 本の線は分類色の先頭 4 つ
   (--session-* のトークン) で、凡例を兼ねる表に同じ色の印を置く。水色と黄は白地とのコントラストが 3:1 を割るので、
   数字は色に頼らず表で読ませる。 */
.session-profile__summary { margin: 0; color: var(--muted); font-size: 0.85rem; }
/* 畳んだ要約はパネル全体のものなので、図の下に表と図の間と同じだけ空けて置く (共通の .panel-more の margin: 0 より強く)。 */
.session-profile__body > .session-profile__more { margin-top: 16px; }
.session-profile__summary strong,
.session-profile__summary [data-session-profile-target="summary"] { color: var(--text); font-variant-numeric: tabular-nums; }
.session-profile__grid { display: grid; gap: 16px 24px; margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(min(22.5rem, 100%), 1fr)); }
.session-profile__block { margin: 0; min-width: 0; }
.session-profile__block figcaption { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.session-profile__block figcaption strong { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.session-profile__number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.session-profile__number.is-negative { color: var(--down-text); }
.session-profile__number small,
.session-hours__table th small { color: var(--muted); font-size: 0.7rem; font-weight: 400; margin-left: 1px; }
.session-profile__empty { margin: 0; color: var(--muted); font-size: 0.75rem; }

/* 24 列の時間帯の表・曜日の表・畳んだセッションの表。狭い画面では表だけを横にスクロールさせ、ページは流さない (デザインガイド §4)。 */
.session-profile__scroll { overflow-x: auto; }
.session-hours__table,
.session-weekdays__table { border-collapse: collapse; font-size: 0.7rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.session-hours__table th,
.session-weekdays__table th { color: var(--muted); font-weight: 600; padding: 2px 3px; text-align: center; white-space: nowrap; }
.session-hours__table tbody th,
.session-weekdays__table tbody th { text-align: left; padding-right: 6px; }
.session-hours__table td { min-width: 30px; height: 24px; padding: 0 2px; text-align: center; border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.session-weekdays__table { font-size: 0.75rem; }
.session-weekdays__table td { min-width: 40px; height: 24px; padding: 0 4px; text-align: center; border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.session-weekdays__table td.session-weekdays__count { color: var(--muted); }
/* 狭い画面 (S、600px 以下) では時間帯の表を 24 マスの帯 × 3 行にする。25 列の表を横に送ると 10 時間ぶんしか見えないので、
   マスの数字を隠して幅を画面に収め、色の濃さで読む (今の地合いのタイルの 24 マスの帯と同じ読み方)。数はマスを押すと吹き出し (data-tip) で開く。
   時の添字は 0・6・12・18 時だけ残し、行の名前は単位を隠して折り返す。 */
@media (max-width: 600px) {
  .session-hours__table { width: 100%; min-width: 0; table-layout: fixed; }
  .session-hours__table thead th { padding: 0 0 2px; font-size: 0; }
  .session-hours__table thead th:first-child { width: 4.2rem; }
  .session-hours__table thead th:nth-child(6n + 2) { font-size: 0.7rem; text-align: left; overflow: visible; }
  .session-hours__table tbody th { padding-right: 4px; font-size: 0.7rem; line-height: 1.2; white-space: normal; }
  .session-hours__table tbody th small { display: none; }
  .session-hours__table td { min-width: 0; height: 20px; padding: 0; font-size: 0; }
}

/* セッション別の累積。左に縦軸の上端・下端、下に窓の最初と最後の日付。 */
.session-chart {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto auto;
  column-gap: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.session-chart__max { grid-column: 1; grid-row: 1; text-align: right; }
.session-chart__svg { grid-column: 2; grid-row: 1 / 4; display: block; width: 100%; height: var(--chart-h-s); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.session-chart__min { grid-column: 1; grid-row: 3; align-self: end; text-align: right; }
.session-chart__dates { grid-column: 2; grid-row: 4; display: flex; justify-content: space-between; }
.session-chart__baseline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.session-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.session-chart__line--asia { stroke: var(--session-asia); }
.session-chart__line--europe { stroke: var(--session-europe); }
.session-chart__line--us { stroke: var(--session-us); }
.session-chart__line--us_late { stroke: var(--session-us_late); }

/* 線の凡例 (色の印と名前)。数字はその下の畳んだ表で読む。 */
.session-trend__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.75rem; }
.session-trend__table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.session-trend__table th { text-align: left; font-weight: 600; color: var(--muted); padding: 2px 6px; white-space: nowrap; }
.session-trend__table th.session-profile__number { text-align: right; }
.session-trend__table td { padding: 2px 6px; font-variant-numeric: tabular-nums; }
.session-trend__table tbody th { color: var(--text); }
.session-trend__local { display: block; color: var(--muted); font-size: 0.7rem; }
.session-trend__local[hidden] { display: none; }
.session-swatch { display: inline-block; width: 12px; height: 3px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }
.session-swatch--asia { background: var(--session-asia); }
.session-swatch--europe { background: var(--session-europe); }
.session-swatch--us { background: var(--session-us); }
.session-swatch--us_late { background: var(--session-us_late); }
/* ---- 地域プレミアムのパネル (/premiums、Premiums) ---- */

/* Japan / Coinbase / キムチの今の乖離を 1 枚の図 (地域ごとの目盛り) に並べ、推移は 0 基準で重ねた共有チャート 1 枚で読む。
   読みと要の数字はパネルの頭 (.panel-lead)。地域ごとの数は畳んだ表 (.premiums__table) にまとめる。 */
.premiums__chart-block { margin: 0; }
/* 今の乖離: 1 行に 地域の名前 | 目盛り (digest_visual の gauge) | 読み。狭い画面では名前と読みを 1 行目、目盛りを 2 行目に。
   目盛りは横に間延びさせない。更新の止まった地域は印を描かず (枠だけ)、読みの横に注意を出す。 */
.premiums__regions { margin: 0; }
.premiums__regions figcaption { margin-bottom: 4px; color: var(--muted); font-size: 0.8rem; }
.premiums__regions figcaption small { margin-left: 4px; font-size: 0.72rem; }
.premiums__region-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.premiums__region {
  display: grid;
  grid-template-columns: 9em minmax(0, 26rem) auto;
  grid-template-areas: "name gauge reading";
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
}
.premiums__region > .digest-visual { grid-area: gauge; }
.premiums__name { grid-area: name; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.premiums__name small { color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.premiums__reading { grid-area: reading; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 0.75rem; }
.premiums__time { color: var(--muted); font-size: 0.75rem; }
.premiums__stale { color: var(--hot-text); font-size: 0.75rem; font-weight: 600; }
@media (max-width: 600px) {
  .premiums__region { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "name reading" "gauge gauge"; }
}
/* 畳んだ地域ごとの数表。狭い画面では表の中だけを横に流す。 */
.premiums__scroll { overflow-x: auto; }
.premiums__table { border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.premiums__table th,
.premiums__table td { padding: 3px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.premiums__table thead th { color: var(--muted); font-weight: 600; }
.premiums__table tbody th { text-align: left; font-weight: 600; }
.premiums__table td.is-positive { color: var(--up-text); }
.premiums__table td.is-negative { color: var(--down-text); }
.premiums__chart-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 6px; font-size: 0.8rem; color: var(--muted); }
.premiums__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.premiums__key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; vertical-align: baseline; }
.premiums__key--btc_japan_premium::before { background: var(--chart-a); }
.premiums__key--btc_coinbase_premium::before { background: var(--chart-b); }
.premiums__key--btc_kimchi_premium::before { background: var(--chart-c); }
.premiums__empty { margin: 0; color: var(--muted); font-size: 0.75rem; }

/* ---- 地合い (/market_activity、MarketActivity と market_activities/_panel) ---------------- */

/* 活況度の線はカードの分類色 (フローの青緑)、流動性の線は琥珀 (ポジショニングの価格 × 建玉と同じ見分けやすい組)。
   凡例に線の見本と名前を必ず添え、色だけに頼らない。 */
.market-activity { --activity-line: var(--accent); --liquidity-line: var(--chart-amber); }
.market-activity .is-up { color: var(--up-text); }
.market-activity .is-down { color: var(--down-text); }
.market-activity__switch { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.market-activity__detail { margin: 0; color: var(--muted); font-size: 0.85rem; }
/* 2 軸のタイルは名前と 0〜100 の目盛り (digest_visual の gauge) だけ。数はパネルの頭が言う。目盛りは横に間延びさせない。 */
.market-activity__tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(12.5rem, 100%), 1fr)); }
.market-activity__tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.market-activity__tile .digest-visual { max-width: 28rem; }
.market-activity__tile-title { margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.market-activity__tile-title small { margin-left: 4px; font-weight: 400; }
/* フラグはチップだけを横に並べる (説明は吹き出しと、畳んだ「助言と成分ごとの表」の中)。 */
.market-activity__flags { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.market-activity__more { display: flex; flex-direction: column; gap: 8px; }
.market-activity__scroll { overflow-x: auto; }
.market-activity__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.market-activity__table th,
.market-activity__table td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.market-activity__table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.market-activity__table tbody th { text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; }
.market-activity__table .market-activity__axis-row th { padding-top: 8px; color: var(--text); font-size: 0.75rem; }
.market-activity__number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-activity__grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(min(17.5rem, 100%), 1fr)); }
.market-activity__block { margin: 0; min-width: 0; }
.market-activity__block figcaption { margin-bottom: 6px; color: var(--muted); font-size: 0.8rem; }
.market-activity__map { display: block; width: 100%; max-width: 18.75rem; height: auto; background: var(--bg); border-radius: 8px; }
.market-activity__guide { stroke: var(--muted); stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.market-activity__quadrant { fill: var(--muted); font-size: 11px; }
.market-activity__dot { fill: var(--muted); fill-opacity: 0.3; }
.market-activity__dot.is-recent { fill: var(--accent); fill-opacity: 0.8; }
.market-activity__dot.is-latest { fill: var(--accent); fill-opacity: 1; stroke: var(--text); stroke-width: 1.5; }
.market-activity__trend { display: block; width: 100%; height: calc(var(--chart-h-s) * 0.75); }
.market-activity__line { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.market-activity__line--activity { stroke: var(--activity-line); }
.market-activity__line--liquidity { stroke: var(--liquidity-line); }
.market-activity__axis { display: flex; justify-content: space-between; margin: 2px 0 0; color: var(--muted); font-size: 0.7rem; }
.market-activity__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; color: var(--muted); font-size: 0.75rem; }
.market-activity__key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; vertical-align: 0; }
.market-activity__key--older::before { background: color-mix(in srgb, var(--muted) 30%, transparent); }
.market-activity__key--recent::before { background: var(--accent); }
.market-activity__key--latest::before { background: var(--accent); box-shadow: 0 0 0 1.5px var(--text); margin-left: 2px; margin-right: 6px; }
.market-activity__key--activity::before,
.market-activity__key--liquidity::before { width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; }
.market-activity__key--activity::before { background: var(--activity-line); }
.market-activity__key--liquidity::before { background: var(--liquidity-line); }
.market-activity__validation { margin: 0; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.market-activity__validation strong { color: var(--text); }
.market-activity__bucket { margin-left: 8px; white-space: nowrap; }
.market-activity__as-of { margin: 0; color: var(--muted); font-size: 0.72rem; }
.market-activity__empty { margin: 0; color: var(--muted); font-size: 0.8rem; }

/* ---- ポジショニング (/positioning、Positioning と positionings/_panel) ---------------- */

/* 価格の線はカードの分類色 (デリバティブの青緑)、建玉の線は琥珀。色覚の型を問わず見分けられる組
   (dataviz の検証で CVD ΔE 19)。凡例に線の見本と名前を必ず添え、色だけに頼らない。 */
.positioning { --price-line: var(--accent); --oi-line: var(--chart-amber); }
.positioning .is-up { color: var(--up-text); }
.positioning .is-down { color: var(--down-text); }

/* 24h の判定・建玉の 24h の変化・判定の 1 文はパネルの頭 (共通部品の .panel-lead) が持つ。 */

/* 表の見出しの空欄に置く、読み上げ用の語。 */
.positioning__hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 窓ごとの表 (1H / 4H / 24H / 7D)。狭い画面では表だけを横に送る。判定のピルは長いので折り返す。 */
.positioning__scroll { overflow-x: auto; }
.positioning__windows { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.positioning__windows th,
.positioning__windows td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: center; }
.positioning__windows tr:last-child th,
.positioning__windows tr:last-child td { border-bottom: 0; }
.positioning__windows thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.positioning__windows tbody th { text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; }
.positioning__number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.positioning__labels .reading { padding: 1px 8px; border-radius: 8px; line-height: 1.4; white-space: normal; }
.positioning__labels .reading small { display: block; font-size: 0.7rem; }
.positioning__quadrant-name { white-space: nowrap; }

/* 建玉・資金調達率・清算のタイル。名前 (指標ページのカードへのリンク) → ミニ図 (digest_visual。数は図の札と吹き出し) → 読みのピル。 */
.positioning__tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.positioning__tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.positioning__tile-title { margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.positioning__tile-title a { color: var(--text); }
.positioning__tile-title small { margin-left: 4px; font-weight: 400; }
/* ミニ図は横に間延びさせない (目盛りの印と札が離れすぎないように)。 */
.positioning__figure { max-width: 22rem; }
.positioning__reading { margin: 0; font-size: 0.75rem; }
.positioning__reading:empty { display: none; }
/* 折りたたみの中のタイルの統計 (3 つの dl) と L/S 比の 1 行。 */
.positioning__more { display: flex; flex-direction: column; gap: 12px; }
.positioning__stat-block { min-width: 0; }
.positioning__stat-title { margin: 0 0 4px; font-size: 0.8rem; }
.positioning__stat-title small { margin-left: 6px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.positioning__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 2px 0 6px; font-size: 1.25rem; font-weight: 600; }
.positioning__value small { margin-left: 2px; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.positioning__value .reading { align-self: center; font-size: 0.72rem; font-weight: 400; }
.positioning__value .reading--hot { font-weight: 700; }
.positioning__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.positioning__stats dt { color: var(--muted); font-size: 0.72rem; }
.positioning__stats dd { margin: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.positioning__as-of { margin: 6px 0 0; color: var(--muted); font-size: 0.72rem; }
.positioning__empty { margin: 0; color: var(--muted); font-size: 0.8rem; }

/* 散布図・7 日の推移・清算の日次を並べる格子 (クジラの活動パネルと同じ組み方)。 */
.positioning__grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
.positioning__block { margin: 0; min-width: 0; }
.positioning__block figcaption { margin-bottom: 6px; color: var(--muted); font-size: 0.8rem; }
.positioning__block figcaption strong { margin-left: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
/* 30 日の履歴は 8 時間ごとの 90 点に日次の棒を重ねるので、格子の 1 列では棒が細くなりすぎる。1 行ぶん広げる。 */
.positioning__history { grid-column: 1 / -1; }
/* 単独ページ (/positioning、positionings/show の .positioning-page) は、散布図を 1 列 (22rem まで) に置き、7 日の推移をその右の残りの幅
   いっぱいに --chart-h-m の高さで描く (パネルの格子のままだと 2 つの図が左に寄って右半分が空く。docs/design-guide.md §9 の「パネルに足すもの」)。
   S では 1 列に積み、推移は全幅。 */
.positioning-page .positioning__grid { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
.positioning-page .positioning__trend { height: var(--chart-h-m); }
@media (max-width: 600px) {
  .positioning-page .positioning__grid { grid-template-columns: minmax(0, 1fr); }
}

/* 散布図。軸と象限の名前は控えめに、直近 24 時間の点だけを分類色で浮かせ、最新の 1 点は文字色の輪で囲む。 */
.positioning__compass { display: block; width: 100%; height: auto; max-height: var(--chart-h-l); background: var(--bg); border-radius: 8px; }
.positioning__axis { stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 1; }
.positioning__quadrant { fill: var(--muted); font-size: 11px; }
.positioning__scale { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.positioning__dot { fill: var(--muted); fill-opacity: 0.35; }
.positioning__dot.is-recent { fill: var(--accent); fill-opacity: 0.85; }
.positioning__dot.is-latest { fill: var(--accent); fill-opacity: 1; stroke: var(--text); stroke-width: 1.5; }

.positioning__trend { display: block; width: 100%; height: calc(var(--chart-h-s) * 0.875); }
.positioning__baseline { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.positioning__line { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.positioning__line--price { stroke: var(--price-line); }
.positioning__line--open-interest { stroke: var(--oi-line); }

/* 凡例。文字は文字色のまま、前に置く見本 (点か線) だけが系列の色。 */
.positioning__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.positioning__key::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; vertical-align: 0; }
.positioning__key--older::before { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.positioning__key--recent::before { background: var(--accent); }
.positioning__key--latest::before { background: var(--accent); box-shadow: 0 0 0 1.5px var(--text); margin-left: 2px; margin-right: 6px; }
.positioning__key--price::before,
.positioning__key--open-interest::before { width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; }
.positioning__key--price::before { background: var(--price-line); }
.positioning__key--open-interest::before { background: var(--oi-line); }

/* 資金調達率と清算の日次のチャート (panel_chart)。見本の色はチャートの系列色と同じ変数: 資金調達率は線、清算は棒 (ロング = 下落色、ショート = 上昇色)。
   向きは色でなく、凡例の文字と 0 の線からの位置で読む。 */
.positioning__key--funding::before { width: 14px; height: 2px; border-radius: 1px; background: var(--chart-a); vertical-align: 3px; }
.positioning__key--liq-long::before,
.positioning__key--liq-short::before { border-radius: 2px; }
.positioning__key--liq-long::before { background: var(--down); }
.positioning__key--liq-short::before { background: var(--up); }

/* 大口 vs 全体の L/S 比とテイカー比の 1 行。 */
.positioning__smart { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-size: 0.85rem; }
.positioning__smart strong { margin: 0 2px; color: var(--text); font-variant-numeric: tabular-nums; }
.positioning__smart-detail { font-size: 0.8rem; }


@media (max-width: 600px) {
  .positioning__windows th,
  .positioning__windows td { padding: 4px; }
}
/* ---- 今の地合い (analysis/_digest、AnalysisDigest) -----------------------------
   Bento のグリッドに、総括のタイル (2 × 2) と 12 のタイル (テクニカルとポジショニングは 2 列) を群の順に置く。タイルの中は
   名前と観測の新しさ → 読みのピル → 数字 1 つと窓の札 → ミニ図 (高さ 40px) だけで、問いと根拠は吹き出しと「12 の根拠を読む」に回す。
   タイルの左端の細い線は読みの tone、未収集は破線。総括の 1 文・注意のチップ・向きの天秤は analysis-digest コントローラが描く。
   列は PC 6・1100px 以下 4・600px 以下 2 (下の media)。行は 150px を下限に揃え (中身が多い段だけ伸びる)、dense で隙間を詰める。
   PC (1440 × 900) で 3 段に収まり、カードの下端は 880px を超えない。横は 80rem で止める (docs/design-guide.md §4)。
   XXL (2200px〜) だけは止めずに下のパネルの 2 列と幅を揃え、同じ並びを 9 列に広げて総括の右にタイルを 2 段に並べる (下の media)。
   カードの地と枠は外し、タイルを 1 枚ずつのカードにしてページの地に並べる (カードの中にカードを重ねない)。 */
.digest__card { max-width: 80rem; gap: 10px; padding: 0; background: transparent; border: 0; }
.digest-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(150px, auto);
  grid-auto-flow: dense;
  gap: 8px;
}
/* タイルの列 (ol) は箱を作らず、中のタイルをそのままグリッドに置く (読み上げには 12 枚のリストとして残す)。 */
.digest-bento__tiles { display: contents; }
.digest-hero,
.digest-tile {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.digest-hero { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.digest-hero__headline { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
/* 1 文の横の i の吹き出し (.info__tip) を見出しの真下に開く (位置を持つ祖先が無いと、最初の画面の下端に開いて見えない)。 */
.digest-hero__headline { position: relative; }
.digest-hero__progress { margin: 0; color: var(--muted); font-size: 0.78rem; }
.digest-hero__progress:empty { display: none; }
.digest-hero__cautions { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.digest-hero__cautions[hidden] { display: none; }
.digest-hero__caution { font-size: 0.78rem; white-space: nowrap; }
/* 向きの天秤: 0 の線 (中央の縦線) から左へ下げ材料、右へ上げ材料のタイルを 1 枚 1 箱で積み (箱の中に略称。空きの箱は描かない)、
   両端の名前の横に枚数。向きなしは下の 1 本の薄い帯 (幅 = 12 枚のうちの割合、--share) と「向きなし n」・略称の列、データ待ちの数はその後ろ。
   箱は 0 の線に近い側から並べ、片側に入りきらなければ外へ折り返す (左の側は row-reverse)。 */
.digest-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "down-side . up-side" "down-bar zero up-bar" "flat flat flat";
  align-items: center;
  gap: 6px 0;
  /* 1 文と注意の下の余りの真ん中に置く (2 × 2 の総括で、天秤が下端に張り付いて上に大きな空きを残さない)。 */
  margin-block: auto;
}
.digest-balance__side { color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.digest-balance__side--down { grid-area: down-side; }
.digest-balance__side--up { grid-area: up-side; text-align: right; }
.digest-balance__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; min-height: 2rem; }
.digest-balance__bar--down { grid-area: down-bar; flex-direction: row-reverse; padding-right: 6px; }
.digest-balance__bar--up { grid-area: up-bar; padding-left: 6px; }
.digest-balance__block {
  min-width: 0;
  max-width: 100%;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 4px;
  color: var(--on-fill);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 箱の塗りは白い文字 (--on-fill) を載せる小さな塗りなので文字用の段 (.move-badge と同じ。--down / --up のままだと白の略称が
   ライトで 4.4:1 / 3.3:1 しかない。docs/design-guide.md §6)。 */
.digest-balance__bar--down .digest-balance__block { background: var(--down-text); }
.digest-balance__bar--up .digest-balance__block { background: var(--up-text); }
/* 過熱のタイルの箱は下端に橙の線 (略称の ⚠ と同じことを、色だけに頼らず形でも言う)。 */
.digest-balance__block--hot { box-shadow: inset 0 -4px 0 var(--hot); }
.digest-balance__count { color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.digest-balance__zero { grid-area: zero; align-self: stretch; width: 3px; min-height: 2.5rem; background: var(--text); border-radius: 1px; }
.digest-balance__flat { grid-area: flat; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.digest-balance__band { display: block; width: calc(var(--share, 0) * 100%); height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--neutral) 35%, transparent); }
.digest-balance__band[hidden] { display: none; }
.digest-balance__flat-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; text-align: center; }
.digest-balance__flat-count { margin-right: 8px; color: var(--text); font-weight: 600; white-space: nowrap; }
.digest-balance__name { white-space: nowrap; }
.digest-balance__missing { margin-left: 10px; white-space: nowrap; }

.digest-tile {
  --tone: var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--tone);
}
.digest-tile--span2 { grid-column: span 2; }
.digest-tile--positive { --tone: var(--up); }
.digest-tile--negative { --tone: var(--down); }
.digest-tile--hot { --tone: var(--hot); }
.digest-tile--neutral { --tone: var(--muted); }
.digest-tile--missing { border-left-style: dashed; border-left-color: var(--muted); }
.digest-tile__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.digest-tile__link { min-width: 0; overflow: hidden; color: var(--text); font-size: 0.82rem; font-weight: 700; line-height: 1.35; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.digest-tile__link:hover { text-decoration: underline; }
.digest-tile__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
/* 問いと根拠の i: 名前のすぐ右に置き (右の余白を auto にして観測の点を右端へ送る)、見た目は i マーク (.info__mark) と同じ小さな丸。
   札は tip (data-tip)。指で押す端末では押せる範囲を ::after で 44px に広げる (左の名前のリンクに被らないよう、右と上下へだけ広げる)。 */
.digest-tile__about {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-right: auto;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font: italic 700 0.69rem/1 Georgia, "Times New Roman", serif;
}
.digest-tile__about:hover,
.digest-tile__about[aria-describedby] { border-color: var(--accent); color: var(--accent-text); }
@media (pointer: coarse) {
  .digest-tile__about::after { content: ""; position: absolute; top: 50%; left: 0; width: 2.75rem; height: 2.75rem; transform: translateY(-50%); }
}
/* 観測の新しさ: 新しければ灰色の小さな点、古ければ橙の ⚠。時刻は吹き出し (data-tip)。 */
.digest-tile__fresh { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 14px; height: 14px; cursor: help; }
.digest-tile__dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.digest-tile__stale { color: var(--hot-text); font-size: 0.8rem; line-height: 1; }
.digest-tile__reading { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.digest-tile__reading .reading { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digest-tile__missing { border-style: dashed; }
/* 数字は大きく 1 つ。窓の札は市場名まで書くことがある (地合いの「Coincheck (JPY) BTC 15 分」) ので、入りきらなければ数字の下へ回す。
   下へ回してもタイルより長い札 (320〜360px のスマホ・601〜720px の 4 列) は末尾を … で切り、全文は名前の横の i の吹き出しに置く。 */
.digest-tile__figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; font-variant-numeric: tabular-nums; line-height: 1.25; }
.digest-tile__value { font-size: 1.05rem; font-weight: 700; }
.digest-tile__window { max-width: 100%; overflow: hidden; padding: 0 4px; border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
/* 読み込み中の文字は読み上げだけ。読み込めなかったときはコントローラが書き換え、見えるように出す。 */
.digest-tile__status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.digest-tile[data-state="failed"] .digest-tile__status { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; color: var(--hot-text); font-size: 0.78rem; white-space: normal; }
/* ミニ図はタイルの下端に揃える (読みや数字の行数が違っても、横に並んだタイルの図の高さが揃う)。 */
.digest-tile > .digest-visual { margin-top: auto; }

/* ミニ図 (AnalysisDigestHelper#digest_visual)。幅いっぱい・高さ 40px。色はトークンだけ: 判定の帯は --muted を薄く、印と線は --text、
   棒は正負で --up / --down (ラベルと符号でも読める)、マスの濃さは --accent。図の無いタイルは同じ高さの破線の枠。
   文字の大きさは札も目盛りの添字 (__tick: 両端の値・軸の名前・時の添字) も 11px (文字の下限。入りきらない札はヘルパーの呼び出し側が短くする)。 */
.digest-visual { display: block; flex: none; width: 100%; height: 40px; overflow: hidden; }
.digest-visual--empty { border: 1px dashed var(--border); border-radius: 4px; }
/* 空の枠の中の 1 語 (何が無いかを言う)。枠の高さは変えず、薄く真ん中に置く。 */
.digest-visual--empty:has(.digest-visual__empty) { display: flex; align-items: center; justify-content: center; }
.digest-visual__empty { color: var(--muted); font-size: 0.7rem; }
/* 4 象限は横に引き伸ばすと象限に見えないので、幅を 14rem で止めて中央に置く。 */
.digest-visual--quadrant { max-width: 14rem; margin-inline: auto; }
.digest-visual svg { overflow: visible; }
.digest-visual text { font-family: inherit; font-size: 11px; }
.digest-visual__label,
.digest-visual__value { fill: var(--text); }
.digest-visual__value { font-variant-numeric: tabular-nums; }
.digest-visual .digest-visual__tick { fill: var(--muted); }
.digest-visual__track { fill: var(--border); }
.digest-visual__band { fill: var(--muted); fill-opacity: 0.4; }
/* 隣り合う帯は 1 つおきに薄くし、帯の端に細い線を引いて境目 (MVRV の 2.4 など) を見せる。 */
.digest-visual__band--alt { fill-opacity: 0.2; }
.digest-visual__edge { stroke: var(--text); stroke-width: 1; stroke-opacity: 0.55; }
.digest-visual__zero { stroke: var(--muted); stroke-width: 1; }
.digest-visual__marker polygon { fill: var(--text); }
.digest-visual__line { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.digest-visual__base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.digest-visual__dot { fill: var(--text); }
/* 棒の軌道 (0 の線から目盛りの端まで)。棒が動ける幅を薄く敷き、ラベルと値の列には入らない。 */
.digest-visual__lane { fill: var(--border); fill-opacity: 0.6; }
.digest-visual__bar--up { fill: var(--up); }
.digest-visual__bar--down { fill: var(--down); }
.digest-visual__axis { stroke: var(--muted); stroke-width: 1; stroke-opacity: 0.6; }
.digest-visual__zone { fill: var(--muted); fill-opacity: 0.14; }
.digest-visual__cell { fill: var(--accent); }
.digest-visual__now { fill: none; stroke: var(--text); stroke-width: 1.5; }

/* 「12 の根拠を読む」: 読み込んだタイルごとに 名前 — 問い: 読み / 根拠 / 時刻 (コントローラが組む)。開け口は .panel-more。 */
.digest__basis-list { display: flex; flex-direction: column; gap: 4px; max-width: 64rem; margin: 0; padding: 0 0 0 1.6em; font-size: 0.8rem; line-height: 1.5; }
.digest__basis-name { color: var(--text); font-weight: 700; }
.digest__basis-item .reading { vertical-align: 1px; }
.digest__basis-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.digest__basis-empty { color: var(--muted); list-style: none; }

/* 表と長い文の折りたたみ (各パネルの <details class="panel-more"> と、今の地合いの「12 の根拠を読む」)。既定で閉じ、
   開け口は中身を言う小さな灰色の文字に ▸ を添える。ボタンに見せない (docs/design-guide.md §1・§3)。 */
.panel-more { margin: 0; }
.panel-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.panel-more > summary::-webkit-details-marker { display: none; }
.panel-more > summary::before { content: "▸"; display: inline-block; transition: transform 0.15s ease; }
.panel-more[open] > summary::before { transform: rotate(90deg); }
.panel-more > summary:hover { color: var(--text); }
.panel-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.panel-more[open] > summary { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) {
  .panel-more > summary::before { transition: none; }
}
/* 指で押す端末では、開け口の行を上下の余白で 44px にする (文字の大きさと見た目の控えめさはそのまま。分析ページに 30 ほどある)。 */
@media (pointer: coarse) {
  .panel-more > summary { min-height: 44px; padding-block: 8px; }
}
/* 縮めた版: まとめが画面の上へ流れたときだけ、上端のバーの下に 12 の札を出す (AI ページの .ai-horizons と同じ出し入れ)。 */
.digest-dock {
  position: fixed;
  top: var(--app-bar-height);
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--shadow) 6%, transparent);
  scrollbar-width: none;
  transform: translateY(-110%);
  visibility: hidden;
  transition: transform 0.15s ease, visibility 0s linear 0.15s;
}
.digest[data-analysis-digest-docked-value="true"] .digest-dock { transform: none; visibility: visible; transition: transform 0.15s ease; }
.digest-dock__item {
  --tone: var(--border);
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}
.digest-dock__item:hover { border-color: var(--text); }
.digest-dock__item--positive { --tone: var(--up); }
.digest-dock__item--negative { --tone: var(--down); }
.digest-dock__item--hot { --tone: var(--hot); }
.digest-dock__item--neutral { --tone: var(--muted); }
.digest-dock__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.digest-dock__item--missing .digest-dock__dot { background: transparent; border: 1px dashed var(--muted); }
/* 縮めた版の高さ (余白 6px×2 + 札 24px + 下線 1px ≒ 37px、AI ページと同じ 44px で見る)。飛び先の見出しが縮めた版の下に隠れないよう、.dash-section の飛び位置に足す。
   タッチ端末では札の縦を 6px に広げて指で押せる大きさにする (.ai-horizons__tab と同じ)。そのとき縮めた版は 12 + 32 + 1 = 45px で、
   .dash-section の飛び位置が別に持つ 12px の余白に収まるので 44px のままにする。 */
.analysis-page { --summary-height: 44px; }
@media (pointer: coarse) {
  .digest-dock__item { padding-block: 6px; }
}

/* 分析ページの本体の群の小見出し (値動き / 需給 / 環境)。セクションの見出しより小さく、区切りとして置く。 */
.analysis-group { margin: 18px 0 4px; color: var(--muted); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; }
.analysis-group__note { margin-left: 8px; font-weight: normal; letter-spacing: 0; }

/* タブレットは 4 列 (総括 2 × 2 の横にテクニカル 2 列、その下に 1 列のタイルが 2 枚ずつ)。 */
@media (max-width: 1100px) {
  .digest-bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* 狭い画面は 2 列。総括は 2 列 × 中身なりの高さ、2 列ぶんのタイルは 2 列、残りは 1 列。 */
@media (max-width: 600px) {
  .digest-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(136px, auto); gap: 6px; }
  .digest-hero { grid-row: auto; padding: 12px; }
  .digest-hero__headline { font-size: 1.15rem; }
  .digest-tile { padding: 8px 10px; }
}
/* XXL (4K・5K) は 80rem で止めると右に 1,200px ほど空くので、カードを下のパネルの 2 列と同じ幅いっぱいにする。並びは L・XL の 6 列
   (総括 2 × 2 の横と下にタイル) を横に広げた 9 列で、総括 2 × 2 の右にタイルを 7 列ずつ 2 段に置く (タイルの幅は定義どおり、
   テクニカルとポジショニングは 2 列、残りの 10 枚は 1 列。DOM の順のまま 1 段目がテクニカル〜オプション、2 段目が CME〜オンチェーン)。
   2560 で 1 列は約 270px (14rem ほど) あり、名前 (「売買のしやすさ」) と数字の行 (「25Δ スキュー +3.2pt」) が切れず折れない。
   16 列の 1 段にすると 1 列が約 150px (8rem) しかなく、名前が … で切れ、数字が 2〜3 行に折れてタイルが縦に伸びた。 */
@media (min-width: 2200px) {
  .digest__card { max-width: none; }
  .digest-bento { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

/* ---- 決定ページの材料のタイル (regimes/_tile) ---------------- */

/* MarketRegime の 10 の問いのタイル。左端の太い線を判定の色 (追い風 = 上昇色、向かい風 = 下落色、過熱 = 橙、中立 = 灰) に
   染め、未収集は破線にして「判定していない」ことを中立の灰色と区別する。決定ページの詰めた形は .decision__tiles の規則が上書きする。 */
.regime-tile {
  --tone: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: 10px;
}
.regime-tile--positive { --tone: var(--up); }
.regime-tile--negative { --tone: var(--down); }
.regime-tile--hot { --tone: var(--hot); }
.regime-tile--neutral { --tone: var(--muted); }
.regime-tile--missing { --tone: var(--border); border-left-style: dashed; }
.regime-tile__title { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.regime-tile__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 0; }
.regime-tile__value strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.regime-tile--missing .regime-tile__value strong { color: var(--muted); }
.regime-tile__unit { margin-left: -4px; color: var(--muted); font-size: 0.8rem; }
.regime-tile__caption { color: var(--muted); font-size: 0.72rem; }
.regime-tile__reading { margin: 0; }
/* 地域プレミアムの「米国買い / 国内中立 / 韓国買い」のような長い読みはピルの中で折り返す。 */
.regime-tile__reading .reading { white-space: normal; }
.regime-tile__basis { margin: 0; font-size: 0.78rem; line-height: 1.5; overflow-wrap: anywhere; }
/* ---- ボラティリティ・パネル (/volatility_regime、VolatilityRegime) ---- */

/* 銘柄ごとのブロック。広い画面では BTC と ETH を横に並べて見比べ、狭い画面では縦に積む。 */
.vol-regime__assets {
  display: grid;
  gap: 16px 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28.75rem), 1fr));
}
.vol-regime__asset { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vol-regime__asset-header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.vol-regime__asset-title { margin: 0; font-size: 1rem; }
/* 銘柄の読みのピル (今の地合いのタイルと同じ digest_signal_tag)。 */
.vol-regime__readings { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.vol-regime__source { color: var(--muted); font-size: 0.75rem; }
.vol-regime__asset .empty { margin: 0; font-size: 0.85rem; }

/* 位置の目盛り (RV 30 日のパーセンタイル ▼ と IV ランク ▲。以前の要の数字のタイル 2 枚)。今の地合いのタイルのミニ図を高さ 48 で。 */
.vol-regime__position { display: flex; flex-direction: column; gap: 2px; max-width: 28rem; margin: 0; }
.vol-regime__position figcaption { color: var(--muted); font-size: 0.8rem; }
.vol-regime__position figcaption strong { color: var(--text); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.vol-regime__position figcaption small { display: block; font-size: 0.72rem; }

/* コーンと RV / DVOL の推移。銘柄のブロックが 2 枚ぶん広ければ (BTC だけのときなど) 横に並べ、狭ければコーンの下に推移を積む。 */
.vol-regime__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 12px 20px;
  align-items: start;
}
.vol-regime__history { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }

/* 統計のタイル。残りの 6 枚 (--more、.panel-more の中) は 3 列 × 2 段で、狭い画面では 2 列。読み方のラベルは見出しのカードと同じ .reading。
   同じ開け口の中で、タイルの下にコーンの数表 (.vol-regime__scroll) を置く。 */
.vol-regime__tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.vol-regime__tiles--more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vol-regime__tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.vol-regime__tile dt { color: var(--muted); font-size: 0.72rem; }
.vol-regime__tile dd { margin: 0; }
.vol-regime__value { font-size: 1.15rem; font-weight: 600; }
.vol-regime__value small { color: var(--muted); font-size: 0.72rem; font-weight: normal; margin-left: 2px; }
.vol-regime__sub { color: var(--muted); font-size: 0.7rem; overflow-wrap: anywhere; }
.vol-regime__reading { margin-top: 2px; }
@media (max-width: 480px) {
  .vol-regime__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* コーン。分布は分類色 (--accent) の濃淡、今の RV は藍、DVOL はデリバティブの分類色の菱形。
   線と帯はホバーを拾わず、窓ごとの透明な列 (.vol-cone__hit) が吹き出し (data-tip) で数字を出す。 */
.vol-regime__cone { min-width: 0; margin: 0; }
.vol-regime__cone-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.vol-cone__legend { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; padding: 0; list-style: none; font-size: 0.72rem; }
.vol-cone__legend li { display: inline-flex; align-items: center; gap: 4px; }
.vol-cone__key { display: inline-block; position: relative; width: 14px; height: 10px; border-radius: 2px; }
.vol-cone__key--outer { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.vol-cone__key--inner { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.vol-cone__key--median { height: 2px; background: var(--accent); }
.vol-cone__key--current { height: 2px; background: var(--chart-indigo); }
.vol-cone__key--current::after {
  content: "";
  position: absolute;
  left: 4px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chart-indigo);
}
.vol-cone__key--implied { width: 8px; height: 8px; margin: 0 3px; border-radius: 0; background: var(--accent-derivatives); transform: rotate(45deg); }
/* 推移の図の凡例 (鍵の形は .vol-cone__key。線はチャートの系列と同じ色: RV 30 日は今の RV の藍、DVOL はコーンの菱形の色)。 */
.vol-history__key--realized { height: 2px; background: var(--chart-indigo); }
.vol-history__key--short { height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 5px); }
.vol-history__key--implied { height: 2px; background: var(--accent-derivatives); }
.vol-history__key--spread,
.vol-history__key--inverted { width: 6px; }
.vol-history__key--spread { background: var(--up); }
.vol-history__key--inverted { margin-left: -2px; background: var(--down); }

.vol-cone { display: block; width: 100%; max-width: 35rem; height: auto; margin-top: 4px; }
.vol-cone__plot * { pointer-events: none; }
.vol-cone__grid { stroke: var(--border); stroke-width: 1; }
.vol-cone__tick { fill: var(--muted); font-size: 11px; }
.vol-cone__band--outer { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.vol-cone__band--inner { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.vol-cone__extreme { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1; }
.vol-cone__median { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vol-cone__current { fill: none; stroke: var(--chart-indigo); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vol-cone__dot { fill: var(--chart-indigo); stroke: var(--card); stroke-width: 2; }
.vol-cone__implied { fill: var(--accent-derivatives); stroke: var(--card); stroke-width: 2; }
/* 帯や線の上に乗るので、地の色の縁取りで読めるようにする。 */
.vol-cone__label { fill: var(--text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.vol-cone__hit { fill: transparent; pointer-events: all; }
.vol-cone__hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.vol-regime__empty { margin: 0; color: var(--muted); font-size: 0.75rem; }

/* コーンの数値の表 (SVG の代替)。開け口は .panel-more (統計のタイルと同じ)。列が多いので狭い画面では表だけを横にスクロールさせる。 */
.vol-regime__scroll { overflow-x: auto; margin-top: 8px; }
.vol-regime__table { border-collapse: collapse; font-size: 0.75rem; font-variant-numeric: tabular-nums; margin-top: 4px; }
.vol-regime__table th,
.vol-regime__table td { padding: 2px 6px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.vol-regime__table th { color: var(--muted); font-weight: 600; }
.vol-regime__table tbody th { text-align: left; }
/* SVG の文字は viewBox ごと縮むので、スマホの幅では座標系の上で大きくして 10px 前後を保つ。 */
@media (max-width: 480px) {
  .vol-cone__tick,
  .vol-cone__label { font-size: 14px; }
}
/* ---- テクニカル分析 (/technical_outlook、TechnicalOutlook) ---- */

.technical .is-up { color: var(--up-text); }
.technical .is-down { color: var(--down-text); }

/* 時間足の帯。短期・中期・長期の 3 枚が見立ての要約で、そのまま時間足の切り替えを兼ねる。左端の色は局面の色。
   選んでいるものは枠を濃くする (色は変えない)。 */
.technical__frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 52rem;
}
.technical-frame {
  --tone: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: 10px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}
.technical-frame:hover { background: color-mix(in srgb, var(--text) 4%, var(--card)); }
.technical-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.technical-frame.is-active { box-shadow: inset 0 0 0 1px var(--text); }
.technical-frame--positive { --tone: var(--up); }
.technical-frame--negative { --tone: var(--down); }
.technical-frame--hot { --tone: var(--hot); }
.technical-frame--missing { --tone: var(--border); border-left-style: dashed; }
.technical-frame__term { color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.technical-frame__phase { font-size: 0.9rem; font-weight: 700; line-height: 1.35; }
.technical-frame .reading { font-size: 0.72rem; white-space: nowrap; }

/* 今後の欄 (照合のピルと、局面の説明・節目・シナリオの折りたたみ)。局面と票はパネルの頭 (panel-lead) と時間足の帯が言う。 */
.technical__next { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.technical__heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-size: 0.95rem; }
.technical__sub { color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.technical__time { font-variant-numeric: tabular-nums; }
/* 局面の説明とフローとの照合の文 (どちらも今後の欄の折りたたみの頭に置く)。 */
.technical__description,
.technical-verdict__text { margin: 0; font-size: 0.85rem; line-height: 1.55; }

.technical__levels { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.technical__level { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; align-items: baseline; }
.technical__level dt { color: var(--muted); font-size: 0.75rem; }
.technical__level dd { margin: 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.technical__level small { color: var(--muted); font-size: 0.72rem; }
.technical__level-item { display: block; }

/* 図の下の読みの部品: 時間足ごとの票 (横棒)・揃い具合 (積み上げ帯)・ADX (目盛り) の 3 つのミニ図。幅に応じて 1〜3 列。
   ミニ図は digest_visual (今の地合いのタイルと同じ部品)。図は図の幅を 26rem で止め、横に間延びさせない。 */
.technical__gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: 12px 20px;
}
.technical-gauge { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 26rem; margin: 0; }
.technical-gauge figcaption { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.technical-gauge figcaption small { margin-left: 4px; font-weight: normal; }
/* 揃い具合の帯 (左から上向き・中立・下向き)。数は吹き出し (data-tip) と読み上げ。高さはミニ図の目盛りの太さに合わせて細く。 */
.technical-align { display: flex; height: 12px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.technical-align__part { display: block; min-width: 3px; }
.technical-align__part + .technical-align__part { box-shadow: inset 2px 0 0 var(--card); }
.technical-align__part--positive { background: var(--up); }
.technical-align__part--neutral { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.technical-align__part--negative { background: var(--down); }

.technical__scenarios { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.technical-scenario {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-left: 3px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.55;
}
.technical-scenario--main { border-left-color: var(--text); }
.technical-scenario__title { font-size: 0.72rem; color: var(--muted); }
.technical-scenario--main .technical-scenario__title { color: var(--text); }

/* 直近の足と値幅の目安。線と帯はホバーを拾わない。 */
.technical__chart { margin: 0; }
.technical__chart-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--muted); font-size: 0.75rem; }
.technical-chart__legend { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; padding: 0; list-style: none; font-size: 0.72rem; }
.technical-chart__legend li { display: inline-flex; align-items: center; gap: 4px; }
.technical-chart__key { display: inline-block; width: 14px; height: 2px; }
.technical-chart__key--close { background: var(--text); }
.technical-chart__key--ema { background: var(--accent); }
.technical-chart__key--sma { border-top: 2px dashed var(--muted); height: 0; }
.technical-chart__key--band { height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 18%, transparent); }
.technical-chart__key--sar { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(90deg, var(--up) 50%, var(--down) 50%); }
.technical-chart__key--fan { height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--hot) 22%, transparent); }
.technical-chart { display: block; width: 100%; max-width: 45rem; height: auto; margin-top: 4px; }
.technical-chart__plot * { pointer-events: none; }
.technical-chart__grid { stroke: var(--border); stroke-width: 1; }
.technical-chart__now { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.technical-chart__tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.technical-chart__band { fill: color-mix(in srgb, var(--muted) 14%, transparent); }
.technical-chart__fan { fill: color-mix(in srgb, var(--hot) 16%, transparent); stroke: color-mix(in srgb, var(--hot) 55%, transparent); stroke-width: 1; }
.technical-chart__close { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.technical-chart__ema { fill: none; stroke: var(--accent); stroke-width: 1.3; }
.technical-chart__sma { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-dasharray: 4 3; }
.technical-chart__sar--up { fill: var(--up); }
.technical-chart__sar--down { fill: var(--down); }
.technical-chart__dot { fill: var(--text); stroke: var(--card); stroke-width: 2; }
.technical-chart__level { stroke-width: 1; stroke-dasharray: 4 3; }
.technical-chart__level--up { stroke: var(--down); }
.technical-chart__level--down { stroke: var(--up); }
.technical-chart__label { font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.technical-chart__label--up { fill: var(--down-text); }
.technical-chart__label--down { fill: var(--up-text); }

/* 時間足の帯の読み (票とフローの照合) は横に並べ、幅が足りなければ折り返す。 */
.technical-frame__chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* テクニカルとフローの照合のピル。今後の欄の見出しの下に置き、照合の文は折りたたみに回す。 */
.technical-verdict { margin: 0; font-size: 0.85rem; }
.technical-verdict .reading { font-weight: 700; white-space: nowrap; }

/* フローで確かめる。6 枚のタイルを幅に応じて並べる (左端の色は読みの色)。 */
.technical-flow { display: flex; flex-direction: column; gap: 8px; }
.technical-flow__score { margin-left: auto; color: var(--muted); font-size: 0.75rem; font-weight: normal; white-space: nowrap; }
.technical-flow__score strong { color: var(--text); font-variant-numeric: tabular-nums; }
.technical-flow__grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(min(13.125rem, 100%), 1fr));
}
.flow-tile {
  --tone: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: 10px;
  background: var(--card);
}
.flow-tile--positive { --tone: var(--up); }
.flow-tile--negative { --tone: var(--down); }
.flow-tile--hot { --tone: var(--hot); }
.flow-tile--missing { --tone: var(--border); border-left-style: dashed; }
.flow-tile__title { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.flow-tile__value { margin: 0; }
.flow-tile__value strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.flow-tile--missing .flow-tile__value strong { color: var(--muted); }
.flow-tile__reading { margin: 0; }
.flow-tile__reading .reading { white-space: normal; font-size: 0.72rem; }
/* 6 つのフローの根拠の文 (畳んだ中身)。左に枚の名前、右に文。 */
.technical-flow__basis { display: flex; flex-direction: column; gap: 4px; max-width: 52rem; margin: 0; font-size: 0.78rem; line-height: 1.5; }
.technical-flow__basis > div { display: grid; grid-template-columns: 12em minmax(0, 1fr); gap: 2px 10px; }
.technical-flow__basis dt { font-weight: 600; }
.technical-flow__basis dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }

/* 建玉の動きの内訳の帯。新規の建玉は濃く、新しい資金を伴わない解消 (ショートカバー・ロング投げ) は薄く塗る。 */
.flow-mix { display: flex; height: 6px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.flow-mix__part { display: block; min-width: 2px; }
.flow-mix__part--new_longs,
.technical-chart__quadrant--new_longs { background: var(--up); fill: var(--up); }
.flow-mix__part--short_covering,
.technical-chart__quadrant--short_covering { background: color-mix(in srgb, var(--up) 35%, transparent); fill: color-mix(in srgb, var(--up) 35%, transparent); }
.flow-mix__part--new_shorts,
.technical-chart__quadrant--new_shorts { background: var(--down); fill: var(--down); }
.flow-mix__part--long_liquidation,
.technical-chart__quadrant--long_liquidation { background: color-mix(in srgb, var(--down) 35%, transparent); fill: color-mix(in srgb, var(--down) 35%, transparent); }
.technical-chart__quadrant--flat { fill: color-mix(in srgb, var(--muted) 40%, transparent); }

/* チャートの下の段 (出来高・建玉の増減・清算)。 */
.technical-chart__bar--up { fill: color-mix(in srgb, var(--up) 70%, transparent); }
.technical-chart__bar--down { fill: color-mix(in srgb, var(--down) 70%, transparent); }
.technical-chart__bar--flat { fill: color-mix(in srgb, var(--muted) 45%, transparent); }
.technical-chart__zero { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 2; }
.technical-chart__row-label { fill: var(--muted); font-size: 11px; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.technical-chart__cohort { stroke-width: 1.2; stroke-dasharray: 6 3; }
.technical-chart__cohort--long { stroke: var(--up); }
.technical-chart__cohort--short { stroke: var(--down); }
.technical-chart__cohort-label { font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.technical-chart__cohort-label--long { fill: var(--up-text); }
.technical-chart__cohort-label--short { fill: var(--down-text); }
.technical-chart__key--cohort { border-top: 2px dashed var(--muted); height: 0; }
/* スマホの幅では図が 0.6 倍ほどに縮む (座標系の幅 560 に対して 340px)。文字を座標系の中で 18 に上げて、画面の上で 11px を保つ
   (docs/design-guide.md §8)。上げる規則は、もとの大きさを決める規則 (目盛り・節目の札・段の名前・建値の札) より後ろに置く
   (前に置くと同じ強さの後ろの規則に負けて、段の名前が 11 のまま 6.7px で出ていた)。 */
@media (max-width: 480px) {
  .technical-chart__tick,
  .technical-chart__label,
  .technical-chart__row-label,
  .technical-chart__cohort-label { font-size: 18px; }
}

.technical__cautions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 6px 10px 6px 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--hot) 8%, transparent);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* 畳んだ中身 (開け口は共通の .panel-more)。今後の欄の「局面の説明・節目・シナリオと注意を読む」と、最後の指標ごとの読みの表。 */
.technical__more { display: flex; flex-direction: column; gap: 8px; }
.technical__signals { display: flex; flex-direction: column; gap: 6px; max-width: 52rem; margin: 0; padding: 0; list-style: none; }
.technical-signal {
  display: grid;
  grid-template-columns: 12em auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
  font-size: 0.8rem;
}
.technical-signal__name { font-weight: 600; }
.technical-signal .reading { font-size: 0.72rem; justify-self: start; }
.technical-signal__summary { line-height: 1.5; overflow-wrap: anywhere; }
.technical__track { max-width: 52rem; margin: 10px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
/* 最後の折りたたみの中の「フローで確かめる 6 枚の根拠」の小見出し。 */
.technical__evidence-title { margin: 12px 0 6px; font-size: 0.8rem; }

@media (max-width: 600px) {
  .technical-flow__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .flow-tile { padding: 6px 8px; }
  .technical__frames { gap: 6px; }
  .technical-frame { padding: 6px 8px; }
  .technical-frame__phase { font-size: 0.8rem; }
  .technical-signal { grid-template-columns: auto minmax(0, 1fr); }
  .technical-signal__summary { grid-column: 1 / -1; }
  .technical-flow__basis > div { grid-template-columns: minmax(0, 1fr); }
}
/* ---- オンチェーン・ファンダメンタルズ (/fundamentals、Coin Metrics Community と alternative.me) ---- */

/* 分類色。fundamentals は既存の色相 (橙・青・赤・紫・黄・桃・緑・シアン・ティール・藍) と被らない黄緑、
   sentiment は桃 (volatility) より青に寄せた赤紫。 */
.card--fundamentals { --accent: var(--accent-fundamentals); }
.card--sentiment { --accent: var(--accent-sentiment); }

/* 読み・MVRV・実現価格との距離はパネルの頭 (.panel-lead)。その下の MVRV の位置は、今の地合いのタイルのミニ図 (digest_visual の
   gauge) を高さ 48 で (以前の数字のタイル 5 枚の代わり。補足の数は図の吹き出し)。 */
.fundamentals__mvrv { display: flex; flex-direction: column; gap: 2px; max-width: 28rem; margin: 0; }
.fundamentals__mvrv figcaption { color: var(--muted); font-size: 0.8rem; }
.fundamentals__mvrv figcaption small { display: block; font-size: 0.72rem; }

.fundamentals__chart-block { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fundamentals__chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.fundamentals__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 0.75rem; }
.fundamentals__key::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 4px;
  vertical-align: middle;
  background: currentColor;
}
.fundamentals__key--price::before { background: var(--text); }
.fundamentals__key--realized::before { background: var(--accent); }
/* MVRV は色の帯 (割安 → 平常 → 過熱警戒 → 天井圏) を見本にする。 */
.fundamentals__key--mvrv::before {
  height: 8px;
  background: linear-gradient(90deg, var(--up) 25%, var(--muted) 25% 50%, var(--down) 50% 75%, var(--hot) 75%);
}
.fundamentals__chart { height: var(--chart-h-l); }

.fundamentals__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 16px;
}
.fundamentals__block { margin: 0; min-width: 0; }
.fundamentals__block figcaption { color: var(--muted); font-size: 0.8rem; }
.fundamentals__block figcaption strong { color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.fundamentals__block figcaption small { margin-left: 4px; font-size: 0.72rem; }
.fundamentals__sparkline { display: block; width: 100%; height: 3rem; }
.fundamentals__line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.fundamentals__empty { margin: 0; color: var(--muted); font-size: 0.75rem; }

/* Fear & Greed の半円ゲージ。帯の色はカードの読み方ラベルと同じ意味 (極度の恐怖 = 追い風の緑、
   極度の強欲 = 過熱の橙) で、間の 3 つは灰色へ寄せる。 */
.fear-greed__gauge { display: block; width: 100%; max-width: 13.75rem; height: auto; margin: 4px auto 0; }
.fear-greed__band { fill: none; stroke-width: 14; }
.fear-greed__band--0 { stroke: var(--up); }
.fear-greed__band--1 { stroke: color-mix(in srgb, var(--up) 40%, var(--border)); }
.fear-greed__band--2 { stroke: var(--border); }
.fear-greed__band--3 { stroke: color-mix(in srgb, var(--hot) 40%, var(--border)); }
.fear-greed__band--4 { stroke: var(--hot); }
.fear-greed__needle { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
.fear-greed__hub { fill: var(--text); }
.fear-greed__value { fill: var(--text); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fear-greed__scale { fill: var(--muted); font-size: 11px; }
/* ---- オプション (Deribit) パネル (/options、OptionsSnapshot と options_helper の SVG) ---- */

/* コールはシアン、プットは赤。赤と緑の組は 2 色覚で見分けにくい (検証で ΔE 2.2) ので、コールを緑にしない
   (シアンと赤は 2 色覚でも ΔE 17)。指数・マックスペイン・資金調達率の目印は色を使わず、線と形で見分ける。 */
.options-surface { --call: var(--accent-derivatives); --put: var(--down); }
.options-surface__asof { margin: 0; text-align: right; white-space: nowrap; }

.options-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(8.75rem, 100%), 1fr));
  gap: 10px 16px;
  margin: 0;
}
.options-stats > div { min-width: 0; }
.options-stats dt { color: var(--muted); font-size: 0.75rem; }
.options-stats dd { margin: 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.options-stats small { color: var(--muted); font-size: 0.75rem; margin-left: 2px; }
.options-stats .options-stats__sub { margin-top: 2px; color: var(--muted); font-size: 0.75rem; }
/* ATM IV (30 日) と DVOL の目盛り (digest_visual の gauge に 2 つの印)。パネルの頭の下に置き、横に間延びさせない。 */
.options-surface__iv { display: flex; flex-direction: column; gap: 2px; max-width: 32rem; margin: 0; }
.options-surface__iv figcaption { color: var(--muted); font-size: 0.8rem; }
.options-surface__iv figcaption small { margin-left: 4px; font-size: 0.72rem; }

.options-surface__grid { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(min(21.25rem, 100%), 1fr)); }
.options-surface__block { margin: 0; min-width: 0; }
.options-surface__block figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.options-surface__block figcaption strong { color: var(--text); font-variant-numeric: tabular-nums; }
.options-surface__block .ranges { margin-bottom: 6px; }
.options-surface__shape { color: var(--text); font-weight: 600; }
.options-surface__caption,
.options-surface__empty { margin: 4px 0 0; color: var(--muted); font-size: 0.75rem; }
.options-surface__caption { display: flex; flex-wrap: wrap; gap: 2px 8px; }

/* 凡例。図の中の印と同じ形 (線・白抜きの丸・破線・棒・ひし形) を文字の前に描く。 */
.options-legend { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; }
.options-legend__item { display: inline-flex; align-items: center; gap: 4px; }
.options-legend__item::before { content: ""; flex: none; width: 12px; border-top: 2px solid var(--accent); }
.options-legend__item--constant::before { width: 6px; height: 6px; border: 2px solid var(--accent); border-radius: 50%; background: var(--card); }
.options-legend__item--reference::before { border-top: 2px dashed var(--muted); }
.options-legend__item--call::before,
.options-legend__item--put::before { width: 8px; height: 8px; border: 0; border-radius: 2px; background: var(--call); }
.options-legend__item--put::before { background: var(--put); }
.options-legend__item--index::before,
.options-legend__item--pain::before { width: 0; height: 12px; border-top: 0; border-left: 2px solid var(--text); }
.options-legend__item--pain::before { border-left-style: dashed; }
.options-legend__item--funding::before { width: 7px; height: 7px; border: 0; background: var(--text); transform: rotate(45deg); }

/* 図。viewBox の幅 360 に対して文字は 9 (スマホの幅でほぼ等倍、2 列の PC で 1.4 倍前後)。viewBox の図は幅と一緒に文字も大きくなるので、
   40rem で止める (4K で図と目盛りの文字が間延びしない。予測市場の折れ線 .onchain-polymarket__chart も同じ)。 */
.options-chart { display: block; width: 100%; max-width: 40rem; height: auto; overflow: visible; font-variant-numeric: tabular-nums; }
.options-chart__grid { stroke: var(--border); stroke-width: 1; }
.options-chart__zero { stroke: var(--muted); stroke-width: 1; }
.options-chart__tick { fill: var(--muted); font-size: 11px; }
/* スマホの幅では図が 1 倍をわずかに割る (座標系の幅 360 に対して 340px) ので、目盛りの文字を 1 段上げて 11px を保つ。 */
@media (max-width: 480px) {
  .options-chart__tick { font-size: 12px; }
}
.options-chart__tick--x { text-anchor: middle; }
.options-chart__tick--y { text-anchor: end; }
.options-chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.options-chart__dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.options-chart__constant { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.options-chart__reference { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.options-chart__call { fill: var(--call); }
.options-chart__put { fill: var(--put); }
.options-chart__index { stroke: var(--text); stroke-width: 1.5; }
.options-chart__pain { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.options-chart__funding { fill: var(--text); stroke: var(--card); stroke-width: 1.5; }
.options-chart circle:hover,
.options-chart rect:hover,
.options-chart path:hover { opacity: 0.7; }

/* 満期ごとの表の開け口は .panel-more (各パネルで共通の見た目)。 */
.options-surface__scroll { overflow-x: auto; }
.options-surface__table table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.options-surface__table th,
.options-surface__table td { padding: 3px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.options-surface__table thead th { color: var(--muted); font-weight: 600; }
.options-surface__table tbody th { text-align: left; font-weight: 600; }
.options-surface__table tbody th small { color: var(--muted); font-weight: 400; }

/* ---- CME・機関投資家のパネル (/cme、CmeCarry と cme_helper の SVG) ---- */

/* 線の色: ベーシスはカードの分類色 (デリバティブの青緑)、Deribit は琥珀 (ポジショニングの建玉と同じ組)、
   T-Bill は文字色の破線。COT はレバレッジド・ファンドを赤、アセットマネージャーを青にする
   (赤と青は 2 色覚でも見分けられる)。凡例に線の見本と名前を必ず添え、色だけに頼らない。 */
.cme { --cme-deribit: var(--chart-amber); --cme-lev: var(--down); --cme-am: var(--chart-a); }
/* 総括の 1 文はパネルの頭 (.panel-lead__note) が持つ。桁の多い数字 (CmeCarry.format_number で縮めても長いとき) でも
   パネルの幅を越えないよう、どこででも折り返す。 */
.cme .panel-lead__note { overflow-wrap: anywhere; }

/* 今の CME ベーシスと T-Bill の 2 本の横棒 (digest_visual の bars)。横に間延びさせない。限月と時刻は下の 1 行。 */
.cme__carry { display: flex; flex-direction: column; gap: 4px; max-width: 28rem; margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.cme__carry.is-stale { border-style: dashed; }
.cme__carry figcaption { color: var(--muted); font-size: 0.75rem; }
.cme__carry figcaption small { margin-left: 4px; }
.cme__carry .cme__sub { margin: 0; color: var(--muted); font-size: 0.72rem; }

/* 畳んだ数字のタイル (Deribit 3M と COT の 3 本)。オンチェーン・ファンダメンタルズと同じ組み方 (狭い画面は 2 列、広ければ 1 行)。 */
.cme__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9.375rem, calc(50% - 4px)), 1fr));
  gap: 8px;
  margin: 0;
}
.cme__tile { min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.cme__tile.is-stale { border-style: dashed; }
.cme__tile dt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  color: var(--muted);
  font-size: 0.75rem;
}
.cme__tile dd { margin: 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cme__tile dd small { color: var(--muted); font-size: 0.75rem; margin-left: 2px; }
.cme__tile dd.is-positive { color: var(--up-text); }
.cme__tile dd.is-negative { color: var(--down-text); }
.cme__tile .cme__sub { color: var(--muted); font-size: 0.75rem; }
.cme__stale { color: var(--hot-text); font-size: 0.75rem; font-weight: 600; }

.cme__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); }
.cme__block { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cme__block figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.cme__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.75rem; }
.cme__key::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 4px;
  vertical-align: middle;
  border-top: 2px solid currentColor;
}
.cme__key--basis::before { border-top-color: var(--accent); }
.cme__key--deribit::before { border-top-color: var(--cme-deribit); }
.cme__key--tbill::before { border-top: 2px dashed var(--text); }
.cme__key--lev::before { border-top-color: var(--cme-lev); }
.cme__key--am::before { border-top-color: var(--cme-am); }

.cme__chart { position: relative; }
.cme__svg { display: block; width: 100%; height: var(--chart-h-s); }
.cme__baseline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.cme__line { fill: none; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cme__line--basis { stroke: var(--accent); stroke-width: 2; }
.cme__line--deribit { stroke: var(--cme-deribit); }
.cme__line--tbill { stroke: var(--text); stroke-dasharray: 5 3; }
.cme__line--lev { stroke: var(--cme-lev); stroke-width: 2; }
.cme__line--am { stroke: var(--cme-am); stroke-width: 2; }
/* 縦軸の上下端の数字は、地域プレミアムのスパークラインと同じく左端に小さく重ねる。図の幅を越える数字は末尾を … で切る。 */
.cme__scale {
  position: absolute;
  left: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.cme__scale--top { top: 0; }
.cme__scale--bottom { bottom: 0; }
.cme__empty { margin: 0; color: var(--muted); font-size: 0.75rem; }

/* ---- 分析ページ (/analysis) の配線 ---- */

/* XL 以上 (1600px〜。docs/design-guide.md §8) はパネルを 2 列に並べ、4K でも右半分を空けない (画面レビューの 4.4)。
   今の地合い・群の小見出し・オンチェーン・インテリジェンス (中で 5 枚を auto-fit で並べる) は 2 列ぶんを使う。並びは DOM の順のまま
   (群の中で左 → 右、上 → 下) なので、タイルから飛んだ先の前後に同じ群のパネルがある。各セクションは中身の高さのまま上に揃え
   (align-items: start)、<details> を閉じても隣のパネルは伸び縮みせず、その行の高さが縮むだけ。飛び先 (scroll-margin-top) も変わらない。
   パネルの中身は 1 列 (約 48rem) でも収まるよう、中の格子は auto-fit と @container で組んである。 */
/* 2 列でないときは、積んだ 2 枚をほかのセクションと同じ 1 列の並びに戻す (包みの div を無いものとして扱う)。 */
.analysis-page__stack { display: contents; }
@media (min-width: 1600px) {
  .analysis-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  .analysis-page > #section-digest,
  .analysis-page > .analysis-group,
  .analysis-page > #section-onchain-intel { grid-column: 1 / -1; }
  /* 値動きの群はテクニカル分析がほかの 2 枚の和ほど長いので、右の列に売買のしやすさと時間帯 × 曜日を積む (.analysis-page__stack)。
     1 段ずつ並べると、短い売買のしやすさの下にテクニカル分析の高さぶんの空きが残る。 */
  .analysis-page__stack { display: block; min-width: 0; }
}

/* クジラの活動の頭の下の取引所ネットフローの横棒 (digest_visual の bars。今の地合いのタイルと同じミニ図)。横に間延びさせない。
   クジラの活動の区画 (.whale-activity__*) は速報の送金と同じ塊にあるので、パネルの頭まわりで足したものはここに置く。 */
.whale-activity__netflow { display: flex; flex-direction: column; gap: 2px; max-width: 24rem; margin: 0 0 12px; }
.whale-activity__netflow figcaption { color: var(--muted); font-size: 0.8rem; }
.whale-activity__netflow figcaption small { margin-left: 4px; font-size: 0.72rem; }

/* ---- AI 予想 (ai_forecasts/_panel、AiForecast) ---------------------------- */

/* 方向・状態のピルは他のパネルと同じ .reading--*。表 (.ai-forecast__table。管理画面の AI 予想・審議会の履歴) は横に長いので
   幅が足りなければ囲みの中でスクロールし、スマホ幅 (640px 以下) では 1 行を縦積みにして、各セルの前に data-label の見出しを添える。 */
.ai-forecast { --accent: var(--accent-forecast); }
.ai-forecast__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
.ai-forecast__summary { flex: 1 1 20rem; line-height: 1.6; overflow-wrap: anywhere; }
.ai-forecast__summary p { margin: 0; }
.ai-forecast__more summary { cursor: pointer; color: var(--accent-text); font-size: 0.78rem; }
.ai-forecast__more p { margin-top: 4px; }
.ai-forecast__scroll { overflow-x: auto; }
.ai-forecast__table { width: 100%; max-width: 100rem; border-collapse: collapse; font-size: 0.85rem; }
.ai-forecast__table th,
.ai-forecast__table td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.ai-forecast__table thead th { color: var(--muted); font-size: 0.75rem; font-weight: normal; white-space: nowrap; }
.ai-forecast__table tbody th { white-space: nowrap; }
.ai-forecast__table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-forecast__rationale { min-width: 14em; overflow-wrap: anywhere; }
.ai-forecast__cell { min-width: 9em; }
.ai-forecast__score { font-size: 0.78rem; }
.ai-forecast__score--na { color: var(--muted); }
.ai-forecast__heading { margin: 0 0 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.ai-forecast__drivers { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.ai-forecast__drivers li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; overflow-wrap: anywhere; }
.ai-forecast__lists { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(16.25rem, 100%), 1fr)); }
.ai-forecast__list { margin: 0; padding-left: 1.2em; font-size: 0.85rem; overflow-wrap: anywhere; }
.ai-forecast__failed { margin: 0; color: var(--down-text); font-size: 0.85rem; overflow-wrap: anywhere; }
.ai-forecast__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 0.75rem;
}
.ai-forecast__footer a { color: var(--accent-text); text-decoration: none; }
.ai-forecast__footer a:hover { text-decoration: underline; }
/* AI ページの 4 つの見立てのタイル (BTC / ETH × 24 時間 / 7 日)。上に 資産と期間・確信度の 3 本の棒、向きの矢印と語、
   レンジの帯 (審議会の価格の図の .ai-council__map-track と目盛りの部品をそのまま使う。真ん中の線が予想時の価格)、採点の 1 行。
   上端の線の色が向き (審議会の 3 役のカードと同じ)。L 以上 4 列、M と S は 2 列 (S は文字と目盛りを詰める。分析のまとめのタイルと同じ並べ直し)。 */
.ai-forecast__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ai-forecast__tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--muted);
  border-radius: 10px;
}
.ai-forecast__tile.is-direction-up { border-top-color: var(--up); }
.ai-forecast__tile.is-direction-down { border-top-color: var(--down); }
.ai-forecast__tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.ai-forecast__tile-key { font-size: 0.95rem; white-space: nowrap; }
.ai-forecast__tile-call { margin: 0; }
.ai-forecast__tile-call .reading { padding: 1px 10px; font-size: 1rem; font-weight: 700; }
.ai-forecast__tile-score { margin: 0; }
.ai-forecast__band .ai-council__map-axis { margin-left: 0; }
.ai-forecast__band-none { margin: 0; color: var(--muted); font-size: 0.78rem; }
/* 実現した終値の印 (◆)。レンジの中ほどの丸 (.ai-council__map-close) と重なっても見えるよう、文字色の菱形を上に重ねる。 */
.ai-forecast__realized { position: absolute; top: 5px; z-index: 1; width: 11px; height: 11px; margin-left: -5.5px; border: 1.5px solid var(--card); background: var(--text); transform: rotate(45deg); }
.ai-forecast__legend { margin: 6px 0 0; }
.ai-forecast__rationales { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 6px 0 0; font-size: 0.85rem; }
.ai-forecast__rationales div { display: contents; }
.ai-forecast__rationales dt { font-weight: 700; white-space: nowrap; }
.ai-forecast__rationales dd { margin: 0; }
@media (max-width: 1099px) {
  .ai-forecast__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ai-forecast__tiles { gap: 8px; }
  .ai-forecast__tile { padding: 8px; }
  .ai-forecast__tile-key { font-size: 0.85rem; }
  .ai-forecast__tile-call .reading { padding: 0 8px; font-size: 0.9rem; }
  .ai-forecast__band .ai-council__map-tick { font-size: 0.7rem; }
  .ai-forecast__tile-score .ai-forecast__score { font-size: 0.72rem; }
}
@media (max-width: 640px) {
  .ai-forecast__table thead { display: none; }
  .ai-forecast__table,
  .ai-forecast__table tbody,
  .ai-forecast__table tr,
  .ai-forecast__table th,
  .ai-forecast__table td { display: block; }
  /* 1 件を 3 行に: 対象 / 方向・確信度・レンジを 1 行に並べて / 根拠と採点。見出しの書き添えは採点だけに残す。 */
  .ai-forecast__table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .ai-forecast__table th,
  .ai-forecast__table td { padding: 0; border-bottom: 0; }
  .ai-forecast__table tbody th { flex: 1 0 100%; }
  .ai-forecast__table .ai-forecast__rationale { flex: 1 0 100%; }
  .ai-forecast__table td[data-label="採点"]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.72rem; }
  .ai-forecast__rationale,
  .ai-forecast__cell { min-width: 0; }
}

/* ---- AI パルス (market_pulses/_panel、MarketPulse) ---------------------------------------- */

/* 資産の行は 名前と価格 | 7 期間のマス | 直近 24 時間の帯 の 3 列で、600px 以下では 1 列に積む。確率のバー (.market-pulse__bar) は
   下げ | 横ばい | 上げ を幅 = 確率 (インラインの flex-basis) で並べ、高さ 0.5rem の色の帯 (上の枠線) の下に % を書く部品で、
   見通し・審議会・決定ページ・管理画面が使う (AI パルスのパネル自身はマスの帯にしたので使わない)。
   色は既存のトークン (--up / --down / --muted / --border) と .reading--* だけを使い、アクセントだけを
   AI 予想の紫 (--accent-forecast) と区別する空色 (--accent-pulse) にする。 */
.market-pulse { --accent: var(--accent-pulse); }
.market-pulse__meta { margin: 0; color: var(--muted); font-size: 0.75rem; text-align: right; }
.market-pulse__failed { margin: 0; color: var(--down-text); font-size: 0.85rem; overflow-wrap: anywhere; }
/* 資産の行。名前の列の幅を決めておくので、BTC と ETH のマスの列が揃う (ETH の答えない期間は枠だけの空のマス)。
   マスは決まった大きさで並べ、画面の幅に合わせて引き伸ばさない (docs/design-guide.md の 4 章)。余りは 24 時間の帯が取る。 */
.market-pulse__rows { display: grid; }
.market-pulse__row {
  display: grid;
  grid-template-columns: 8rem auto minmax(8rem, 1fr);
  gap: 8px 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.market-pulse__asset { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.market-pulse__price { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.market-pulse__cells { display: grid; grid-template-columns: repeat(7, 3.6rem); gap: 3px; }
/* マス (MarketPulsesHelper#market_pulse_cell)。地は向きの色を --tile の割合で混ぜる (成績のヒートマップのマスと同じ作り。
   ダークは --tile-scale / --tile-floor で濃く)。横ばいと読めないは灰の薄い地。文字は色を着けず (§6)、上に期間の札、下に向きの矢印、
   右上に採点の ✓ / ✗。確信度はヘルパーがマスの不透明度に書く。押す (タップ・フォーカス) と確率の吹き出し (tip)。 */
.market-pulse__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 2.9rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--neutral) calc(var(--tile-floor) + 14% * var(--tile-scale)), var(--card));
  color: var(--text);
  line-height: 1;
}
.market-pulse__cell--positive { background: color-mix(in srgb, var(--up) calc(var(--tile-floor) + var(--tile, 10%) * var(--tile-scale)), var(--card)); }
.market-pulse__cell--negative { background: color-mix(in srgb, var(--down) calc(var(--tile-floor) + var(--tile, 10%) * var(--tile-scale)), var(--card)); }
.market-pulse__cell.is-na { background: transparent; box-shadow: inset 0 0 0 1px var(--border); opacity: 0.55; }
/* 札は色を敷いたマスの上なので、灰にはせず本文の色のまま (小ささと太さで値と分ける)。--muted と --text の間の濃さでは、
   ダークの濃いマス (--tile 40% 前後) の上で 3.5〜4.1:1 しかなかった。 */
.market-pulse__cell-key { color: var(--text); font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.market-pulse__cell-arrow { font-size: 1.15rem; font-weight: 800; }
.market-pulse__cell-mark { position: absolute; top: 3px; right: 4px; font-size: 0.7rem; font-weight: 700; }
/* 凡例の色の見本 (マスと同じ混ぜ方の中くらいの濃さ)。 */
.market-pulse__key { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 4px; border-radius: 3px; }
.market-pulse__key--positive { background: color-mix(in srgb, var(--up) calc(var(--tile-floor) + 28% * var(--tile-scale)), var(--card)); }
.market-pulse__key--negative { background: color-mix(in srgb, var(--down) calc(var(--tile-floor) + 28% * var(--tile-scale)), var(--card)); }
.market-pulse__key--neutral { background: color-mix(in srgb, var(--neutral) calc(var(--tile-floor) + 14% * var(--tile-scale)), var(--card)); }
.market-pulse__legend { margin: 8px 0 0; }
/* 決定ページの見通しの行と予想の成績と学習 (forecast_lab) の読みのピル・確信度。 */
.market-pulse__verdict { padding: 1px 8px; border-radius: 8px; font-size: 1rem; font-weight: 700; }
.market-pulse__bar { display: flex; flex: 1 0 100%; min-width: 0; border-radius: 4px 4px 0 0; overflow: hidden; }
.market-pulse__bar-part {
  flex-grow: 0;
  flex-shrink: 1;
  min-width: 0;
  padding-top: 2px;
  border-top: 0.5rem solid var(--muted);
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.market-pulse__bar-part--down { border-top-color: var(--down); }
.market-pulse__bar-part--up { border-top-color: var(--up); }
.market-pulse__confidence { color: var(--muted); font-size: 0.75rem; }
/* 24 時間の帯を包む要素。吹き出し (回数と向きの内訳) を開く。 */
.market-pulse__strip-cell { min-width: 0; align-self: center; border-radius: 4px; }
.market-pulse__strip { display: block; width: 100%; height: 2rem; }
.market-pulse__chips { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; }
.market-pulse__chip { padding: 1px 8px; border-radius: 8px; font-size: 0.8rem; }
.market-pulse__scorecard { margin-top: 12px; }
/* 数字の表を畳んだ「成績」の開け口 (AI パルス・日報)。成績のパネルの「較正の診断と数表」と同じ見た目。 */
:is(.market-pulse__scorecard, .ai-forecast__scorecard) > summary { color: var(--muted); font-size: 0.78rem; cursor: pointer; }
:is(.market-pulse__scorecard, .ai-forecast__scorecard)[open] > summary { margin-bottom: 6px; }
.market-pulse__score { border-collapse: collapse; font-size: 0.8rem; }
.market-pulse__score caption { margin-bottom: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; }
.market-pulse__score th,
.market-pulse__score td { padding: 3px 14px 3px 0; text-align: left; border-bottom: 1px solid var(--border); }
.market-pulse__score thead th { color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.market-pulse__calibration { margin-top: 14px; }
.market-pulse__calibration thead th[scope="colgroup"] { border-bottom-color: var(--muted); }
.market-pulse__score .num,
.market-pulse__history .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.market-pulse__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.market-pulse__footer a { color: var(--accent-text); text-decoration: none; }
.market-pulse__footer a:hover { text-decoration: underline; }
/* 表の囲み (管理画面の履歴と成績・AI ページの数表)。4K で 11 列の表が画面いっぱいに広がらないよう 100rem で止める (§8)。
   position: relative は、表の中の .visually-hidden (position: absolute。列見出しの「操作」など) の基準を囲みにして、囲みの外 (= ページの右端) へ出てページ全体が横に動くのを防ぐ。 */
.market-pulse__scroll { position: relative; max-width: 100rem; overflow-x: auto; }
.market-pulse__note { margin: 6px 0 0; color: var(--muted); font-size: 0.72rem; }
.market-pulse__history { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.market-pulse__history th,
.market-pulse__history td { padding: 5px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.market-pulse__history thead th { color: var(--muted); font-size: 0.75rem; font-weight: normal; white-space: nowrap; }
.market-pulse__history tbody th { white-space: nowrap; }
@media (max-width: 600px) {
  /* 名前と価格を 1 行に、その下にマスを幅いっぱいに 7 等分 (iPhone で 1 マス 44px 前後)、その下に帯。 */
  .market-pulse__row { grid-template-columns: minmax(0, 1fr); }
  .market-pulse__asset { flex-direction: row; align-items: baseline; gap: 8px; }
  .market-pulse__cells { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .market-pulse__meta { text-align: left; }
}
@media (pointer: coarse) {
  .market-pulse__cell { min-height: 44px; }
  /* 吹き出しを開く小さな印 (日報の確信度の棒・審議会の一致度のメーター) は、見た目を変えずに押せる範囲を上下に広げる。 */
  .ai-forecast__pips, .ai-council__agreement { box-sizing: content-box; padding-block: 12px; margin-block: -12px; }
}

/* ---- 決定ページ (/decision、DecisionBoard・LivePulse・QuickTake) ---------------------------------- */

/* 上から ライブ価格 (左) と見通しの 7 期間の列 (右) → 計画 / 保有 / 根拠 → Jev のライブ・パルス / OpenAI のクイック・テイク / 予定とニュース
   → 材料のタイル 10 枚。
   PC では 1 画面に収め、縦スクロールさせない (下の「1 画面に収める」の media query)。
   見た目は決定ページだけのダークの取引画面 (body.theme-terminal)。トークンは body に置き、ここの規則は決定ページにしか無い
   class (.decision* / .live* / .verdict* / .panel* / .position* / .jev* / .take* / .agenda* / .why*) にはそのまま、分析ページと共有する部品
   (.reading / .app-bar など) と、決定ページの材料のタイル (.regime-tile) には .theme-terminal を付けて当てる (白地のページの見た目を変えないため)。
   方針: 動くのは値 (配信で光る価格・流れるティック・伸びるチャート・進む秒数) で、飾りは動かさない。発光・走査光・方眼・英字の
   区画コードは使わない (以前の版で「厨二病っぽい」と退けられた)。等幅は数値だけ。色の意味は 1 つずつ:
   緑 = 上げ・ロング・通過・目標、赤 = 下げ・ショート・✗・損切り、琥珀 = 注意・待ち、青 = 現在・選択中。 */

/* color-scheme: dark で、select・number 入力のスピナー・スクロールバー・引っ張りすぎた余白もネイティブで暗くなる。
   色は下の --bg と同じ値の直書き (トークンは body にあり、html からは読めない)。 */
html:has(> body.theme-terminal) { color-scheme: dark; background: #0f141a; }
/* 文字の大きさは画面に合わせて伸ばす: フル HD (1920×1080) までは 16px のまま、それより大きい画面 (WQHD・4K) では幅と高さの
   小さいほうに比例させて上げる (2560×1440 で約 19px、3840×2160 で 26px)。区画の余白・文字はほぼ rem なので、画面が大きくなっても
   フル HD と同じ割り付けのまま拡大され、4K で文字が米粒にならない。ほかのページも同じ式で上限 22px (冒頭の html)、暗い取引画面の決定ページだけ 26px まで。 */
html:has(> body.theme-terminal) { font-size: clamp(16px, calc(6px + min(0.52vw, 0.93vh)), 26px); }

body.theme-terminal {
  --bg: #0f141a;
  --card: #161c25;
  --raised: #1d2530;
  --border: #28313d;
  --rule: #34404f;
  --input: #0c1015;
  --text: #e4e9ef;
  --muted: #8d99a8;
  --neutral: #a6b0bd;
  --accent: #5b9cf6;
  /* 白い文字を載せる塗り (選択中のタブ)。--accent のままだと白との比が 2.8:1 で AA に届かないので、黒を混ぜて 5.0:1 にする。 */
  --accent-fill: color-mix(in srgb, var(--accent) 72%, #000);
  --up: #3fb950;
  --down: #f85149;
  --hot: #d29922;
  --chart-a: #4596e8; --chart-b: #b48a1e; --chart-c: #0fa396;
  /* 等幅には和文の字形が無いので、和文のフォールバック先を明示する (OS 任せで明朝に落ちないように)。 */
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Noto Sans Mono", "Hiragino Sans", "Noto Sans JP", monospace;
  color-scheme: dark;
  background: var(--bg);
}
.theme-terminal ::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* 上端のバー。選択中のタブ (ほかのページは文字色の地) とトースト (文字色の地) は、ここで決定ページの見た目に上書きする。 */
.theme-terminal .app-bar { background: var(--bg); border-bottom-color: var(--border); }
.theme-terminal .primary-tabs { border-color: var(--border); border-radius: 6px; }
.theme-terminal .primary-tabs__link { border-radius: 4px; }
.theme-terminal .primary-tabs__link[aria-current="page"],
.theme-terminal .app-bar__link[aria-current="page"] { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.theme-terminal .app-bar__link,
.theme-terminal .toolbar select { border-color: var(--rule); border-radius: 4px; }
.theme-terminal .toast { background: var(--raised); color: var(--text); border: 1px solid var(--rule); box-shadow: none; }
.theme-terminal .info__tip { border-color: var(--rule); border-radius: 4px; background: var(--raised); box-shadow: none; }
.theme-terminal .info__mark { border-color: var(--neutral); color: var(--neutral); }
.theme-terminal .site-footer { border-top-color: var(--border); }

.container--fit { padding-top: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
/* 区画割り (decisions/show)。幅 1100px 以上は 3 列で、左の列が「決定の列」(.decision__left: 見通しと Jev ライブ → 計画 → 保有を縦に積む 1 つの箱)、
   右の 2 列の上がライブ価格、その下に シナリオ | 根拠、さらに クイック・テイク | 予定とニュース。下段に材料のタイル。
   左の列を上から読めば「どの期間に・どう建てるか」まで決まり、右は値動きと「なぜか」。
   高さの段 (冒頭の表): H-tall (880px 以上) は 1 画面に収め (下の「H-tall」)、H-short (880px 未満) は左の列を上端のバーの下に固定して、
   右の 2 列とタイルをページでスクロールさせる (下の「H-short」)。
   1099px 以下は 2 列 (タブレット)、600px 以下は 1 列 (スマホ) に積む (下の media。左の列の箱は display: contents でほどく)。
   Turbo Frame (decision-board。見通しと計画) と AI の包み (.decision__ai) は display: contents にして、中の区画を外の箱に直接置く。
   シナリオと根拠は右の 2 列にあるので frame の外に置き、frame の取り直しの turbo-stream が差し替える (左の列の箱に frame と保有を一緒に入れるため)。 */
.decision {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 34fr) minmax(0, 33fr) minmax(0, 33fr);
  grid-template-areas:
    "left  hero  hero"
    "left  paths why"
    "left  take  agenda"
    "tiles tiles tiles";
  min-width: 0;
  /* 4K・5K で区画が伸びすぎないよう、幅は 150rem で止めて真ん中に寄せる (文字は html の font-size で大きくなるので、割り付けはフル HD と同じ)。 */
  max-width: 150rem;
  margin-inline: auto;
  padding: 0.5rem 0 0.625rem;
  font-variant-numeric: tabular-nums;
}
.decision > .live { grid-area: hero; }
.decision__left { grid-area: left; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; min-height: 0; }
.decision__board { display: contents; }
.decision__ensemble { grid-area: paths; }
.decision__why { grid-area: why; }
.decision__ai { display: contents; }
.decision .panel--take { grid-area: take; }
.decision .panel--agenda { grid-area: agenda; }
.decision__tiles { grid-area: tiles; }
/* 外枠のあとで読む区画の frame (.decision__frame。ライブ価格・保有・クイック・テイク・予定・タイル) も箱を作らず、中の区画を外の grid と
   左の列の箱に直接置く。読み込み中のスケルトン (Shared::SkeletonComponent) は、届く区画と同じ grid-area を持つ (.decision__slot--*)。 */
.decision__frame { display: contents; }
.decision > .decision__frame > .live { grid-area: hero; }
.decision__slot { min-height: 0; overflow: hidden; }
.decision__slot--hero { grid-area: hero; min-height: 16rem; }
.decision__slot--paths { grid-area: paths; }
.decision__slot--why { grid-area: why; }
.decision__slot--take { grid-area: take; }
.decision__slot--agenda { grid-area: agenda; }
.decision__slot--tiles { grid-area: tiles; }
.decision .empty { margin: 0; color: var(--muted); font-size: 0.78rem; }

/* 文字の色 (結論・Jev の読み・構え)。 */
.tone--positive { color: var(--up-text); }
.tone--negative { color: var(--down-text); }
.tone--hot { color: var(--hot-text); }
.tone--neutral { color: var(--neutral); }
.is-up { color: var(--up-text); }
.is-down { color: var(--down-text); }

/* 読みのタグ (決定ページの中だけ)。丸いピルをやめ、地を塗らない角 3px の枠にする (色は文字と枠だけ)。 */
.theme-terminal .decision .reading {
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 3px;
  background: none;
  font-size: 0.7rem;
  line-height: 1.5;
}
.theme-terminal .decision .reading--neutral { color: var(--neutral); }

/* --- ライブ価格 (decisions/_hero、decision-live コントローラ) --- */
.live {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding: 0.5rem 0.75rem 0.375rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  /* 歩み値を出すかは区画の幅で決める (下の @container live)。 */
  container: live / inline-size;
}
/* 見出し: 1 行目に銘柄・配信・時計、その下に 現値 (左) と 変化の 2 段 (右。上が 1m / 24h / 損切り・目標、下が 30 分の想定幅と売買のしやすさ)。 */
.live__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "sym sym" "price main" "price sub";
  gap: 0 0.875rem;
  align-items: baseline;
}
/* i マークの吹き出しは、位置の基準になる祖先が無いと初期包含ブロック (画面) 基準で下へ 600px はみ出し、
   main の overflow: hidden の外でページの高さを伸ばしてしまう (見えないのに下に空白ができてスクロールする)。
   見出しの行を基準にしてチャートの上に下向きに開き、高さは画面に収まる範囲で中をスクロールさせる。 */
.live__head { position: relative; }
.live__symbol { grid-area: sym; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 0; color: var(--muted); font-size: 0.78rem; }
.live__symbol .info { flex: none; margin-left: 0; }
.live__head .info__tip { width: min(100%, 560px); max-height: min(60vh, 480px); overflow-y: auto; }
.live__sym { color: var(--text); font-weight: 700; letter-spacing: 0.02em; text-decoration: none; }
/* 銘柄は指標ページのその価格のカードへのリンク (価格が届いていれば)。 */
a.live__sym:hover, a.live__sym:focus-visible { color: var(--accent-text); text-decoration: underline; }
.live__feed { display: inline-flex; align-items: center; gap: 5px; }
.live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.live__feed.is-live .live__dot { background: var(--up); animation: live-dot 2s ease-in-out infinite; }
/* 配信が届くたびに点を一瞬大きくする (decision-live コントローラの is-blink。終わったら外して脈に戻る)。配信の密度がそのまま点滅の速さ。 */
.live__feed .live__dot.is-blink { animation: live-blink 0.35s ease-out 1; }
.live__feed.is-stale { color: var(--hot-text); }
.live__feed.is-stale .live__dot { background: var(--hot); }
@keyframes live-dot { 50% { opacity: 0.35; } }
@keyframes live-blink { from { transform: scale(1.8); opacity: 1; } }
/* 表示タイムゾーンの時計 (秒まで)。見出しの行の右端。 */
.live__clock { margin-left: auto; color: var(--text); font: 600 0.78rem/1 var(--mono); letter-spacing: 0.02em; white-space: nowrap; }
.live__age { font-family: var(--mono); }
.live__age.is-stale { color: var(--hot-text); }
.live__price { grid-area: price; align-self: center; display: flex; align-items: baseline; gap: 10px; margin: 0; min-width: 0; }
.live__px {
  display: inline-block;
  padding: 0 4px;
  margin-left: -4px;
  border-radius: 4px;
  color: var(--text);
  font: 700 2.4rem/1.15 var(--mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.live__px.is-trend-up { color: var(--up-text); }
.live__px.is-trend-down { color: var(--down-text); }
.live__px.is-flash-up { animation: live-flash-up 0.7s ease-out 1; }
.live__px.is-flash-down { animation: live-flash-down 0.7s ease-out 1; }
@keyframes live-flash-up { from { background-color: color-mix(in srgb, var(--up) 28%, transparent); } }
@keyframes live-flash-down { from { background-color: color-mix(in srgb, var(--down) 28%, transparent); } }
.live__tick { min-width: 4em; color: var(--muted); font: 600 0.9rem/1 var(--mono); }
.live__changes { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font-size: 0.8rem; }
.live__changes--main { grid-area: main; align-self: end; }
.live__changes--sub { grid-area: sub; align-self: start; align-items: center; gap: 0 14px; margin-top: 2px; color: var(--neutral); font-size: 0.72rem; }
.live__changes--sub .live__change-label { font-size: 0.7rem; }
.live__change { display: inline-flex; gap: 5px; align-items: baseline; font-family: var(--mono); white-space: nowrap; }
.live__change-label { color: var(--muted); font-family: inherit; font-size: 0.7rem; }
.live__change--stop { color: var(--text); }
/* 30 分の想定幅 (MacroLink の想定値幅)。値は分析ページのマクロ連動へのリンク (内訳は吹き出し)。固有の動きが目立つときだけ z のバッジを添える。
   同じ帯はチャートの右端のコーン (.live__cone)。 */
.live__expected { color: var(--text); text-decoration: none; }
.live__expected:hover { text-decoration: underline; }
.live__expected small { color: var(--muted); font-size: 0.7rem; }
.live__idio { padding: 0 4px; border-radius: 3px; font-size: 0.7rem; }
/* 「売買のしやすさ」(MarketActivity)。象限の語のピルと、2 つの軸の 4 象限の点 (digest_visual の quadrant、高さ 26px)。
   ずれのシグナルは 30 分の固有 z と同じ小さなピル。2 つの軸の値は語のリンクの吹き出し。 */
.live__activity { display: inline-flex; align-items: baseline; gap: 4px; color: var(--text); text-decoration: none; }
.live__activity:hover { text-decoration: underline; }
.live__activity .reading { padding: 0 6px; font-size: 0.7rem; }
.live__activity small { color: var(--muted); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.live__activity-flag { padding: 0 4px; border-radius: 3px; font-size: 0.7rem; }
.live__quadrant { display: inline-block; flex: none; width: 4.75rem; line-height: 0; }
.live__quadrant .digest-visual { max-width: none; }
/* 高さ 26px の小さな 4 象限には 11px (文字の下限) の軸の名前が入らないので、名前は描かずに読み上げ (aria-label) と吹き出し
   (「点の横が活況度、縦が流動性」) に任せる。 */
.live__quadrant .digest-visual__tick { display: none; }
/* 1m / 24h の変化・損切りと目標までの距離の値 (JS が書く)。光るときに地を塗るので少しの余白と角。 */
.live__changes [data-decision-live-target] { padding: 0 3px; margin: 0 -3px; border-radius: 3px; }
.live__changes .is-flash-up { animation: live-flash-up 0.7s ease-out 1; }
.live__changes .is-flash-down { animation: live-flash-down 0.7s ease-out 1; }
/* 秒単位のティックと板の押し合いの段: 28px の帯を左右半分ずつ (板の無い市場はティックが全幅)。 */
.live__flow { display: flex; flex: none; gap: 12px; height: 1.75rem; margin-top: 2px; border-bottom: 1px solid var(--border); }
/* 秒単位のティック: 線は JS が引く。 */
.live__tape { position: relative; flex: 1 1 0; min-width: 0; }
.live__tape-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.live__tape-label { position: absolute; top: 0; left: 0; color: var(--muted); font-size: 0.7rem; }
/* 2 時間の高値 (緑)・安値 (赤) の点線。値が帯の縦の範囲に入ったときだけ JS が引き、更新した直後は太く濃くする。 */
.live__tape-extreme { stroke-width: 1; stroke-dasharray: 3 3; stroke-opacity: 0.75; vector-effect: non-scaling-stroke; }
.live__tape-extreme--high { stroke: var(--up); }
.live__tape-extreme--low { stroke: var(--down); }
.live__tape-extreme.is-new { stroke-width: 2; stroke-dasharray: none; stroke-opacity: 1; }
/* 板の押し合い: 上の行に買い (左)・見出し・売り (右) の数量と割合、下に左から緑 (買い)・右から赤 (売り) が押し合う棒。
   緑の幅 (買いの割合) は JS が書き、動きは少しなめらかにする。真ん中の細い線が五分五分の目安。届かない間は薄くする (is-stale)。 */
.live__book { display: flex; flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; transition: opacity 0.3s ease; }
.live__book.is-stale { opacity: 0.4; }
.live__book-head { display: flex; justify-content: space-between; gap: 6px; margin: 0; font: 0.7rem/1.2 var(--mono); white-space: nowrap; }
.live__book-side { overflow: hidden; text-overflow: ellipsis; }
.live__book-side--buy { color: var(--up-text); }
.live__book-side--sell { color: var(--down-text); text-align: right; }
.live__book-label { flex: none; color: var(--muted); }
/* 帯の見出しの真ん中の「板」の読み (decisions/_book: 状態のピルと厚い側の割合)。 */
.live__book-reading { display: inline-flex; flex: none; align-items: baseline; gap: 4px; min-width: 0; font-family: inherit; }
.live__book-reading .live__activity .reading { padding: 0 4px; font-size: 0.7rem; line-height: 1.4; }
.live__book-reading .live__activity small { font-size: 0.7rem; }
.live__book-bar { position: relative; display: flex; height: 8px; overflow: hidden; border-radius: 2px; background: var(--down); }
.live__book-bar::after { content: ""; position: absolute; top: -1px; bottom: -1px; left: 50%; width: 1px; background: var(--card); }
.live__book-bid { width: 50%; background: var(--up); transition: width 0.4s ease; }
/* いつもの境目 (BookImbalance の過去 7 日の中央値)。真ん中の線より太く、帯の地に沈まない色で。 */
.live__book-usual { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.75; }
/* チャートと歩み値の段: 残りの高さを全部取る。歩み値は幅 1200px 以上の 1 画面でだけ出す (下の media)。 */
.live__body { display: flex; flex: 1 1 0; gap: 10px; min-height: 7.5rem; }
/* チャート (decision-chart コントローラ、lightweight-charts のローソク足): 上に時間足の列、残りの高さを全部チャートに。 */
.live__chart { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; min-height: 0; }
.live__timeframes { flex: none; gap: 3px; }
.live__timeframes button { padding: 0 8px; border-radius: 4px; font: 0.7rem/1.6 var(--mono); }
.live__timeframes button.is-active { background: var(--accent-fill); border-color: var(--accent-fill); }
/* --accent-fill は白い文字を載せる塗り (上端のバーの選択中のタブと同じ)。.ranges の --on-fill (暗い色) のままだと 3.7:1 しかない。 */
.theme-terminal .live__timeframes button.is-active { color: #fff; }
.live__chart-canvas { position: relative; flex: 1 1 0; min-height: 0; isolation: isolate; }
.live__chart-host { position: absolute; inset: 0; }
/* 右端の 30 分の想定値幅のコーン (decision-chart が描く。68% は少し濃く、90% は薄く)。操作の邪魔をしない。 */
.live__cone { position: absolute; top: 0; left: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.live__cone-band { fill: var(--accent); stroke: none; }
.live__cone-band--outer { fill-opacity: 0.08; }
.live__cone-band--inner { fill-opacity: 0.16; }
/* 縦の範囲の外にある水準の印 (上 = 範囲より高い、下 = 低い)。価格の軸のすぐ左 (right は JS が軸の幅から決める) に近い順に積む。操作の邪魔をしない。 */
.live__edges { position: absolute; right: 70px; z-index: 3; margin: 0; padding: 0; list-style: none; pointer-events: none; text-align: right; font: 0.7rem/1.35 var(--mono); }
.live__edges--above { top: 2px; }
.live__edges--below { bottom: 20px; display: flex; flex-direction: column-reverse; }
.live__edge { padding: 0 3px; border-radius: 2px; background: color-mix(in srgb, var(--card) 80%, transparent); white-space: nowrap; }
/* 時間足を切り替えてから描き直すまでの間 (is-loading)。古い絵を沈め、真ん中でスピナーを回す (指標のカードと同じ)。 */
.live__chart-canvas > * { transition: opacity 0.15s ease, filter 0.15s ease; }
.live__chart.is-loading .live__chart-canvas > * { opacity: 0.35; filter: grayscale(1); }
.live__chart.is-loading .live__chart-canvas { pointer-events: none; }
.live__chart.is-loading .live__chart-canvas::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 100;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: card-spin 0.8s linear infinite;
}
.live__sales { display: none; flex: none; width: 11.5rem; min-height: 0; padding-left: 8px; overflow: hidden; border-left: 1px solid var(--border); font: 0.7rem/1.55 var(--mono); }
.live__sales-head,
.live__sale { display: grid; grid-template-columns: 4.4em minmax(0, 1fr) auto; gap: 0 6px; white-space: nowrap; }
.live__sales-head { margin: 0 0 1px; padding-bottom: 1px; border-bottom: 1px solid var(--border); color: var(--muted); }
.live__sales-head span:nth-child(n+2) { text-align: right; }
.live__sales-rows { margin: 0; padding: 0; list-style: none; }
.live__sale { padding: 0 3px; margin: 0 -3px; border-radius: 2px; color: var(--text); }
.live__sale-time { color: var(--muted); }
.live__sale-price { text-align: right; }
.live__sale-delta { min-width: 3.5em; text-align: right; color: var(--muted); }
.live__sale.is-up .live__sale-price, .live__sale.is-up .live__sale-delta { color: var(--up-text); }
.live__sale.is-down .live__sale-price, .live__sale.is-down .live__sale-delta { color: var(--down-text); }
/* 新しい行 (is-new) は上げ下げの色で一瞬光る。変わらない行 (差 0) は灰。 */
.live__sale.is-new { animation: live-sale-new 0.8s ease-out 1; }
@keyframes live-sale-new { from { background-color: color-mix(in srgb, var(--text) 10%, transparent); } }
.live__sale.is-up.is-new { animation-name: live-flash-up; }
.live__sale.is-down.is-new { animation-name: live-flash-down; }
.live__empty { position: absolute; inset: 0; display: grid; place-items: center; }
/* 歩み値は価格の区画が広いとき (チャートの横に 11.5rem 取っても狭くならないとき) だけ出す。 */
@container live (min-width: 52rem) {
  .live__sales { display: block; }
}
.live__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 0.7rem; }
.live__foot time { font-family: var(--mono); }
.live__sep { margin: 0 2px; color: var(--rule); }
.live__foot .info { display: none; }
.live.is-offline .live__foot::after { content: "heartbeat が届いていません"; color: var(--hot-text); }

/* --- 見通し・計画・根拠 (Turbo Frame decision-board の中、decisions/_outlook・_plan・_evidence) と保有 (decisions/_position) --- */
/* 中身がはみ出すパネル (計画・根拠) は、PC の 1 画面ではパネルの中だけをスクロールさせる。 */
.panel--scroll { overflow-y: auto; scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }
.decision__age.is-stale { color: var(--hot-text); }
.peek-card__track { color: var(--hot-text); white-space: nowrap; }
/* 音と通知 (decisions/_sound_menu)。ライブ価格の時計の右のベルのアイコン (.decision__sound-open) で開くポップオーバー (popover 属性) に、種類ごとの
   1 行 (押すと 鳴らす / 止める。decisions/_sound_toggle) と、まだ訊いていなければ「ブラウザ通知を許可する」。どれかを鳴らすにしていれば ベルのアイコンの枠を青に。
   開く位置は画面の右上 (上端のバーの下。ライブ価格の見出しの近く)。 */
.decision__sound { margin-left: 6px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: inherit; font-size: 0.7rem; line-height: 1.4; cursor: pointer; }
.decision__sound-open.is-on { border-color: var(--accent); }
.decision__sound-menu {
  position: fixed;
  inset: calc(var(--app-bar-height) + 8px) max(16px, env(safe-area-inset-right)) auto auto;
  width: min(22rem, calc(100vw - 32px));
  margin: 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--raised);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow) 45%, transparent);
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: normal;
}
.decision__sound-menu:popover-open { display: block; }
.decision__sound-menu-head { display: block; margin: 0 0 6px; font-weight: 700; }
.decision__sound-menu-head small { color: var(--muted); font-weight: normal; }
.decision__sound-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  width: 100%;
  margin: 0 0 4px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.decision__sound-item:hover { border-color: var(--rule); }
.decision__sound-item[aria-pressed="true"] { border-color: var(--accent); }
.decision__sound-item-label { font-weight: 600; }
.decision__sound-item-state { color: var(--muted); font-family: var(--mono); }
.decision__sound-item[aria-pressed="true"] .decision__sound-item-state { color: var(--accent-text); }
.decision__sound-item-detail { grid-column: 1 / -1; color: var(--muted); font-size: 0.7rem; }
.decision__notify { width: 100%; margin-top: 2px; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 4px; background: none; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; }
.decision__notify[hidden] { display: none; }

/* 色の帯 (--tone)。見通しの列と計画のパネルの上端の 2px の線に使う。 */
.verdict--positive { --tone: var(--up); }
.verdict--negative { --tone: var(--down); }
.verdict--hot { --tone: var(--hot); }
.verdict--neutral { --tone: var(--neutral); }
.verdict--missing { --tone: var(--rule); }

/* 見通しの 7 期間。期間ごとに 1 行の「形で比べる表」: 期間 (候補は ★) / 向きと確率 / 下げ | 横ばい | 上げ の細いバー (% は書かず吹き出し、
   確度は棒の濃さ) / 計画の向き / 期待値の横棒と札、右端に Jev ライブの読み (リンクの外の .verdicts__jev)。左の縦線が計画の向きの色、
   選んだ行は青の枠。根拠の本数と確率の 3 つは行に出さず、吹き出し (.peek-card) で読む。使い方・列の読み方・凡例は見出しの i マーク。
   区画の幅で変えるのは 1 か所だけ (26rem 未満で計画の向きのチップを出さない)。スマホの 390px と 430px で行の中身は同じ。 */
.decision__outlook { container: outlook / inline-size; }
/* 見出しの i マークの吹き出しを見出しの真下に開く (位置の基準を見出しに。パネルの外へはみ出して読めるよう、見通しのパネルは切らない。
   見通しは中身の高さだけ取るので、どの段でも中をスクロールさせることは無い)。 */
.decision .decision__outlook { overflow: visible; }
.decision__outlook .panel__head { position: relative; }
.decision__outlook .panel__title .info { margin-left: 4px; }
/* 見出しの中のリンク (シナリオ → AI ページのシナリオ、ライブ AI → AI パルス)。見た目は見出しの文字のまま、載せると下線。 */
.decision .panel__title-link, .outlook__jev-link { color: inherit; text-decoration: none; }
.decision .panel__title-link:hover, .decision .panel__title-link:focus-visible,
.outlook__jev-link:hover, .outlook__jev-link:focus-visible { color: var(--accent-text); text-decoration: underline; }
.verdicts__best { color: var(--accent-text); text-decoration: none; white-space: nowrap; }
a.verdicts__best:hover { text-decoration: underline; }
.verdicts__best.is-none { color: var(--muted); }
.verdicts__horizons { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(1.75rem, auto); gap: 3px; min-height: 0; margin: 0; padding: 0; list-style: none; }
.verdicts__horizon {
  --tone: var(--muted);
  display: flex;
  min-width: 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tone);
  border-radius: 4px;
}
/* 基準の幅を 0 にして、行の下に開いたとき (flex-wrap) も Jev の読みと ▸ を 1 行目に残す。 */
.verdicts__horizon > .verdicts__horizon-link { flex: 1 1 0; min-width: 0; }
.verdicts__horizon.verdict--missing { border-left-style: dashed; }
.verdicts__horizon.is-current { border-color: var(--accent); border-left-color: var(--tone); box-shadow: inset 0 0 0 1px var(--accent); }
/* 列: 期間 / 向きと確率 (「方向感なし」の 5 字が H-tall の大きい字でも入る幅) / 3 分割のバー / 計画の向き / 期待値の横棒と札。
   バーと期待値の棒は伸びすぎないよう 22rem と 14rem で止める (4K の広い列でも、余りは行の右に残す)。 */
.verdicts__horizon-link {
  display: grid;
  grid-template-columns: 3.7em 6.6em minmax(2.5rem, 22rem) 3.9em minmax(7.4em, 14rem);
  gap: 0 0.5rem;
  align-items: center;
  padding: 0.1rem 0.5rem;
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
}
.verdicts__horizon-link:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.verdicts__horizon-link:hover .verdicts__horizon-key,
.verdicts__horizon-link:focus-visible .verdicts__horizon-key { color: var(--accent-text); }
.verdicts__horizon-head { grid-column: 1; display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.verdicts__horizon-key { font: 700 0.85rem/1.2 var(--mono); white-space: nowrap; }
.verdicts__horizon-best { flex: none; color: var(--accent-text); font-size: 0.72rem; line-height: 1; }
.verdicts__horizon-label { grid-column: 2; overflow: hidden; font-size: 0.92rem; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
/* 3 分割のバー。% は書かず (吹き出し)、確度を棒の濃さにする (高 = 濃い、材料なし = いちばん薄い)。 */
.verdicts__horizon .verdicts__bar { grid-column: 3; }
.theme-terminal .verdicts__bar .market-pulse__bar-part { border-top-width: 0.45rem; }
.verdicts__bar--high { opacity: 1; }
.verdicts__bar--medium { opacity: 0.72; }
.verdicts__bar--low { opacity: 0.45; }
.verdicts__bar--none { opacity: 0.28; }
.verdicts__horizon-side { grid-column: 4; justify-self: start; }
/* 期待値の横棒 (7 行で同じ目盛り。真ん中が 0、右が正) と札。棒は軌道の中、札は右に等幅で。 */
.verdicts__horizon-ev { grid-column: 5; display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.verdicts__ev-track { position: relative; flex: 1 1 auto; min-width: 1.25rem; height: 0.45rem; border-radius: 1px; background: color-mix(in srgb, var(--border) 70%, transparent); }
.verdicts__ev-zero { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--muted); }
.verdicts__ev-bar { position: absolute; top: 0; bottom: 0; }
.verdicts__ev-bar.is-positive { background: var(--up); }
.verdicts__ev-bar.is-negative { background: var(--down); }
/* 目盛りの端を超えた棒は端で止め、止めた側の端に濃い縁を付ける (札は実際の値)。 */
.verdicts__ev-bar.is-clipped.is-positive { box-shadow: inset -2px 0 0 var(--text); }
.verdicts__ev-bar.is-clipped.is-negative { box-shadow: inset 2px 0 0 var(--text); }
.verdicts__ev-label { flex: none; min-width: 3.3em; overflow: hidden; color: var(--text); font: 0.72rem var(--mono); text-align: right; white-space: nowrap; }
/* 行の右端の Jev ライブの読み (decisions/_jev_cell)。見通し (60 秒ごと) と別の速さ (5 秒ごと) で変わるので、細い区切り線で分け、
   等幅の短い読み (「↑62%」) にする。強さは地の塗り (強い) と薄い点線の下線 (弱い)、言葉と内訳は吹き出し。 */
.verdicts__jev { flex: none; display: flex; align-items: center; justify-content: center; width: 3.9rem; border-left: 1px solid var(--border);
  font: 700 0.78rem/1.2 var(--mono); white-space: nowrap; cursor: default; }
.verdicts__jev.is-missing { color: var(--muted); font-weight: normal; }
.verdicts__jev-label { padding: 0 4px; }
.verdicts__jev--strong .verdicts__jev-label { border-radius: 3px; background: color-mix(in srgb, currentColor 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent); }
/* 確信の弱い読みは、細い字と点線の下線で分ける。薄さは 0.85 まで (0.62 では緑が 3.2:1、灰が 3.6:1 で読めなかった)。 */
.verdicts__jev--weak .verdicts__jev-label { font-weight: 500; opacity: 0.85; text-decoration: underline dotted 1px; text-underline-offset: 3px; }
/* 区画が狭いとき (スマホ・タブレットの 2 列・1100〜1340px ほどの PC の左の列) の境は 1 つだけ: 計画の向きのチップを出さない
   (向きは左の縦線の色と吹き出しで読める。スマホの 390px と 430px はどちらもこちらで、行の中身が変わらない)。 */
@container outlook (max-width: 26rem) {
  .verdicts__horizon-link { grid-template-columns: 3.3em 6.3em minmax(1.75rem, 1fr) 6em; gap: 0 0.375rem; padding-inline: 0.375rem; }
  .verdicts__horizon-side { display: none; }
  .verdicts__horizon-ev { grid-column: 4; }
  .verdicts__jev { width: 3.3rem; font-size: 0.72rem; }
  .verdicts__jev-label { padding: 0 2px; }
}
/* 指で押す端末の ▸ (行の右端、peek#expand)。押すと行の吹き出しの中身 (.peek-card) を行の下にそのまま開く。マウスの端末では載せれば出るので隠す。 */
.verdicts__more { display: none; }
.verdicts__horizon.is-expanded { flex-wrap: wrap; }
.verdicts__horizon.is-expanded > :not(.peek-card) { min-height: 2.75rem; }
.verdicts__horizon.is-expanded > .peek-card { flex: 1 0 100%; padding: 6px 10px 8px; border-top: 1px solid var(--border); font-size: 0.76rem; line-height: 1.5; }
.theme-terminal .outlook__bar--compact .market-pulse__bar-part { padding-top: 0; border-top-width: 5px; }
.theme-terminal .decision .outlook__side { font-size: 0.7rem; }

/* 計画 (選んだ期間)。上端の線が向きの色、ノーポジは灰。 */
.decision__plan { border-top: 2px solid var(--tone, var(--rule)); }
.decision__plan.verdict--missing { border-top-style: dashed; }
.decision__plan.verdict--inactive { border-top-color: var(--rule); }
.verdict__headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; min-width: 0; }
.verdicts__bias { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.verdicts__timing { overflow: hidden; font-size: 0.95rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.verdict__sub { margin: 0; overflow: hidden; color: var(--text); font-size: 0.7rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.verdict__decisive { color: var(--hot-text); }
.decision__plan.verdict--inactive .verdict__sub { color: var(--muted); }
.verdict__plan-label { color: var(--muted); }
.verdict__value--stop { color: var(--down-text); font-family: var(--mono); }
.verdict__target { color: var(--up-text); font-family: var(--mono); }
.decision__plan.verdict--inactive .verdict__value--stop,
.decision__plan.verdict--inactive .verdict__target { color: var(--muted); }
/* R ラダー (decision_r_ladder) と、その下の損切り・目標の価格の札 (左端と右端)。% と根拠は札の吹き出し、想定変動幅と時間切れは図の吹き出し。 */
.verdict__ladder { display: grid; gap: 0; min-width: 0; }
.r-ladder__box { min-width: 0; }
/* 高さは svg の height (計画 32px、保有は入値の札のぶん 40px)。 */
.r-ladder { display: block; width: 100%; overflow: visible; }
.r-ladder__zone--loss { fill: var(--down); fill-opacity: 0.22; }
.r-ladder__zone--gain { fill: var(--up); fill-opacity: 0.22; }
.r-ladder__tick { stroke-width: 2; }
.r-ladder__tick--stop { stroke: var(--down); }
.r-ladder__tick--target { stroke: var(--up); }
.r-ladder__tick--origin { stroke: var(--text); stroke-width: 1.5; }
.r-ladder__tick--limit { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 2; }
.r-ladder__sigma-band { fill: var(--text); fill-opacity: 0.07; }
.r-ladder__sigma { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.r-ladder__now polygon { fill: var(--accent); }
.r-ladder__label { fill: var(--muted); font-size: 11px; }
.r-ladder__label--now, .r-ladder__label--limit { fill: var(--accent-text); }
.r-ladder__label--stop { fill: var(--down-text); }
.r-ladder__label--target { fill: var(--up-text); }
.r-ladder__label--origin { fill: var(--text); }
.r-ladder__time-track { fill: var(--border); }
.r-ladder__time { fill: var(--muted); }
.verdict__levels { display: flex; justify-content: space-between; gap: 4px 12px; margin: 0; font-size: 0.76rem; white-space: nowrap; }
/* リスクのゲージ (0 → 口座のリスク上限、計画のリスク % と 1/4 ケリーの印)。左に見出し、右に上限の値。 */
.verdict__risk { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.7rem; white-space: nowrap; }
.verdict__risk > .verdict__plan-label { flex: none; }
.verdict__risk .digest-visual { flex: 1 1 auto; min-width: 0; }
.verdict__risk-cap { flex: none; color: var(--muted); font-family: var(--mono); }
/* 見送り・待つの計画の図は「向きがあれば」の参考なので淡くする。 */
.decision__plan.verdict--inactive .r-ladder,
.decision__plan.verdict--inactive .verdict__risk .digest-visual { opacity: 0.55; }
/* 保有の R ラダー。 */
.position__ladder { margin-top: 2px; }

/* ゲートの行 (6 本を 3 列 × 2 行。計画の区画が 26rem 以上あれば 6 本を 1 行に、列の幅は文字なりで両端に揃える)。各セルは「✓ 鮮度」の文字と
   左の 3px の縦線 (通過 = 緑、✗ = 赤、材料なし・見ない = 罫の色)。理由は吹き出し。 */
.decision__plan { container: plan / inline-size; }
.verdict__gates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; margin: 2px 0 0; font-size: 0.7rem; line-height: 1.4; }
@container plan (min-width: 26rem) {
  .verdict__gates { grid-template-columns: repeat(6, auto); justify-content: space-between; }
}
.verdict__gate { min-width: 0; padding-left: 5px; overflow: hidden; border-left: 3px solid var(--rule); color: var(--neutral); text-overflow: ellipsis; white-space: nowrap; }
.verdict__gate.is-pass { border-left-color: var(--up); }
.verdict__gate.is-pass .verdict__gate-mark { color: var(--up-text); }
.verdict__gate.is-fail { border-left-color: var(--down); color: var(--text); }
.verdict__gate.is-fail .verdict__gate-mark { color: var(--down-text); }
.verdict__gate.is-skip { color: var(--muted); }
.verdict__gate.is-decisive { font-weight: 700; }

/* 手仕舞いの条件 (畳む)。 */
.verdict__subhead { margin: 2px 0 0; color: var(--neutral); font-size: 0.7rem; font-weight: 700; }
.verdict__exits-box > summary { cursor: pointer; list-style: none; }
.verdict__exits-box > summary::-webkit-details-marker { display: none; }
.verdict__exits-box > summary::before { content: "▸ "; color: var(--muted); }
.verdict__exits-box[open] > summary::before { content: "▾ "; }
.verdict__exits-box > summary small { color: var(--muted); font-weight: normal; }
.verdict__exits { display: grid; gap: 0; margin: 0; padding-left: 1.1em; color: var(--text); font-size: 0.7rem; line-height: 1.45; }
.verdict__exits li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decision__plan.verdict--inactive .verdict__exits { color: var(--muted); }

/* 根拠 (選んだ期間)。軸の上の出どころの丸 (AI ページの「AI の読み」の .outlook-digest__track・__dot・__needle をそのまま使い、
   決定の暗い地に合わせて角と高さを詰める) と、束ねた見通しの語・基準の横ばいの 2 つの数字。出どころごとの文は畳む (.why__list)。 */
.why__digest { display: grid; gap: 2px; min-width: 0; }
.why__axis { display: flex; justify-content: space-between; margin: 0; color: var(--muted); font-size: 0.7rem; line-height: 1.2; }
.decision .why__track { height: 34px; border-radius: 4px; }
.decision .why__track .outlook-digest__lean { top: 11px; height: 12px; }
.decision .why__track .outlook-digest__dot--lane0 { top: 8px; }
.decision .why__track .outlook-digest__dot--lane1 { top: 0; }
.decision .why__track .outlook-digest__dot--lane2 { top: 16px; }
.decision .why__track .outlook-digest__needle { box-shadow: 0 0 0 1.5px var(--card); }
.why__summary { margin: 0; font-size: 0.74rem; }
.why__summary strong { font-family: var(--mono); }
.why__summary-empty { color: var(--muted); }
/* 出どころの文 (畳む): 印・出どころ・いちばん高い確率・鮮度、2 行目に中身。最後に基準の確率 (事前分布) の行。 */
.why__signals { display: grid; gap: 0; margin: 2px 0 0; padding: 0; font-size: 0.7rem; list-style: none; }
.why__signal {
  display: grid;
  grid-template-columns: auto 6.4em minmax(0, 1fr) auto;
  gap: 0 6px;
  align-items: center;
  padding: 2px 0 3px;
  border-bottom: 1px solid var(--border);
}
.why__signal .outlook-digest__mark { margin-right: 0; vertical-align: 0; }
.why__signal-source { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.why__signal-source a { color: var(--text); text-decoration: none; }
.why__signal-source a:hover { color: var(--accent-text); }
.why__signal-p { justify-self: start; font-family: var(--mono); white-space: nowrap; }
.why__signal-age { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; white-space: nowrap; }
.why__signal-age.is-stale { color: var(--hot-text); }
.why__signal-detail { grid-column: 1 / -1; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.why__signal--prior { grid-template-columns: 6.4em auto minmax(0, 1fr); }
.why__signal--prior .why__signal-detail { grid-column: auto; }

/* 出どころの文と規則の材料 (畳む)。開け口は小さな灰色の字に ▸。 */
.why__list, .why__rules { font-size: 0.72rem; }
.why__list > summary, .why__rules > summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; }
.why__list > summary::before, .why__rules > summary::before { content: "▸ "; }
.why__list[open] > summary::before, .why__rules[open] > summary::before { content: "▾ "; }
.why__list > summary small, .why__rules > summary small { font-weight: normal; }
.why__list > summary::-webkit-details-marker, .why__rules > summary::-webkit-details-marker { display: none; }
.why__rules .why { margin-top: 4px; }
.why { min-width: 0; }
.why__title { margin: 0 0 2px; padding-bottom: 2px; border-bottom: 1px solid var(--border); color: var(--neutral); font-size: 0.7rem; }
.why__title small { color: var(--muted); font-weight: normal; }
.why__text { margin: 0 0 2px; color: var(--muted); font-size: 0.72rem; }
.why__windows, .why__facts, .why__levels { margin: 0; padding: 0; list-style: none; }
.why__facts { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 2px; }
.why__fact-label { color: var(--muted); }
.why__num { font-family: var(--mono); }
.why__dim { color: var(--muted); font-family: var(--mono); }
.why__levels .is-current { color: var(--accent-text); }
.why__levels .is-stop { color: var(--down-text); }
.why__levels .is-target { color: var(--up-text); }

/* 保有。保有なしは選んだ期間の計画の要約と「この計画で入った」の入力、保有中は判定・含み損益・損切りと目標と「手仕舞った」。 */
.position__head { margin: 0; overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.position__side { font-size: 1.2rem; }
.position__levels { margin: 0; overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.position__note { color: var(--muted); }
.position__levels { color: var(--text); }
.position__verdict { margin: 0; overflow: hidden; font-size: 1rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.position__verdict small { color: var(--muted); font-size: 0.7rem; font-weight: normal; }
.position__pnl { margin: 0; font-family: var(--mono); font-size: 0.78rem; }
/* 判定と、その右の含み R・残り時間は 1 行に (入らなければ折り返す)。 */
.position__status { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; min-width: 0; }
.position__status > .position__verdict { flex: 0 1 auto; min-width: 0; }
.position__status > .position__pnl { flex: none; }
.position__plan { display: grid; gap: 2px; min-width: 0; }
.decision__position .panel__empty { margin: 0; padding: 2px 0; color: var(--muted); font-size: 0.74rem; }
.position__form { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.position__inputs,
.position__form--close { display: flex; flex-flow: row wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 0.72rem; }
/* ノーポジの計画では入力欄と送信を出さない (計画の値が無いので送れない)。 */
.position__plan[data-open="false"] + .position__inputs { display: none; }
.position__note-input input { width: 9em; }
.decision__input select {
  padding: 1px 4px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}
.position__submit {
  padding: 2px 10px;
  border: 1px solid var(--accent-fill);
  border-radius: 3px;
  background: var(--accent-fill);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

/* 計画のパネルの数量 (decisions/_sizing)。サーバが取引の前提の残高から出した数量の 1 行。 */
.decision__panel-title { margin-right: 6px; color: var(--muted); font-weight: normal; }
/* 保有のフォームの入力欄 (decisions/_position)。先頭の入値は価格が入る幅にする。 */
.decision__input { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.decision__input input {
  width: 3.8em;
  padding: 1px 4px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* 入値と出値 (どちらもフォームの最初の欄)。手仕舞いのフォームは隠しの input (_method・token) が先に来るので :first-child では当たらない。 */
.decision__input:first-of-type input { width: 8em; }
.decision__sizing-result { margin: 0; overflow: hidden; font-size: 0.76rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.decision__sizing-result.is-inactive .decision__sizing-output { color: var(--muted); }
.decision__sizing-wait { color: var(--hot-text); font-weight: normal; }
.decision__sizing-note { color: var(--muted); font-weight: normal; }
a.decision__sizing-note { color: var(--accent-text); text-decoration: none; }
a.decision__sizing-note:hover,
.decision__sizing-note a:hover { text-decoration: underline; }
.decision__sizing-note a { color: var(--accent-text); text-decoration: none; }
/* 計画の見出しの右の前提の 1 行 (「費用 0.12% · 倍率 2」)。押すと設定ページの取引の前提へ。 */
.decision__premise { margin-left: 6px; color: var(--muted); text-decoration: none; }
.decision__premise:hover { color: var(--accent-text); text-decoration: underline; }

/* --- シナリオ (shared/_ensemble、ensemble_controller.js): 見通しの確率と σ から描く今後の値動きの束 (アンサンブル)。
   決定ページ (decisions/_ensemble、ダーク) と AI ページ (outlooks/_ensemble、白地) が共有する。画面の高さに合わせて隠すルールは .decision の下だけ。
   凡例 (クラスターごとに 色の線・語・確率・期間末の中心・本数) の下に図。図は残りの高さいっぱい (PC) か固定の高さ (積む配置)。 --- */
/* 凡例は 3 列 (クラスターごとに 1 列) の定型で、1 行目に 色の線・語・確率・本数、2 行目に期間末の中心の価格と % (長ければ省略記号)。
   高さが決まっているので図の高さが凡例の折り返しで変わらない。 */
.ensemble__legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; margin: 0; padding: 0; list-style: none; font-size: 0.7rem; line-height: 1.3; }
.ensemble__cluster { display: grid; grid-template-columns: 10px auto auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 5px; align-items: baseline; min-width: 0; --cluster: var(--neutral); }
.ensemble__cluster--up { --cluster: var(--up); }
.ensemble__cluster--down { --cluster: var(--down); }
.ensemble__key { grid-row: 1; grid-column: 1; align-self: center; width: 10px; height: 2px; background: var(--cluster); }
.ensemble__label { grid-row: 1; grid-column: 2; color: var(--muted); }
.ensemble__p { grid-row: 1; grid-column: 3; font-family: var(--mono); font-size: 0.78rem; }
.ensemble__count { grid-row: 1; grid-column: 4; color: var(--muted); font-size: 0.7rem; text-align: right; white-space: nowrap; }
.ensemble__end { grid-row: 2; grid-column: 2 / -1; overflow: hidden; font-family: var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.ensemble__end small { color: var(--muted); font-size: 0.7rem; }
.ensemble { display: flex; flex-direction: column; gap: 5px; min-width: 0; min-height: 0; }
.decision__ensemble .ensemble { flex: 1 1 0; }
.ensemble__chart { position: relative; flex: 1 1 0; min-width: 0; min-height: 84px; }
.ensemble__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ensemble__grid { stroke: var(--border); stroke-width: 1; }
.ensemble__axis { fill: var(--muted); font: 0.7rem var(--mono); }
.ensemble__axis--y { text-anchor: end; }
.ensemble__axis--x { text-anchor: middle; }
.ensemble__band { opacity: 0.14; stroke: none; }
.ensemble__fan { stroke: none; fill: var(--accent); }
.ensemble__fan--outer { opacity: 0.1; }
.ensemble__fan--inner { opacity: 0.18; }
.ensemble__median { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.9; }
.ensemble__member { fill: none; stroke-width: 1; opacity: 0.22; stroke-linejoin: round; }
.ensemble__mean { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ensemble__now { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; }
.ensemble__level { stroke-width: 1.2; stroke-dasharray: 4 3; }
.ensemble__level-label, .ensemble__tag { font: 0.7rem var(--mono); }
/* 文字は線の上に重なるので、地の色の縁取り (halo) で読めるようにする (クラスターの札と損切り・目標・指値の札で同じ)。 */
.ensemble__level-label, .ensemble__tag { paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.ensemble__hair { stroke: var(--text); stroke-width: 1; opacity: 0.5; pointer-events: none; }
/* 吹き出し: 1 行目に時点、以下クラスターごとに 1 行 (色の線・語と確率・中心の価格と %・帯)。図の高さに収まるよう JS が上下の位置を決める。 */
.ensemble__tip { position: absolute; z-index: 2; padding: 3px 7px 4px; background: var(--raised); border: 1px solid var(--rule); border-radius: 4px; font-size: 0.7rem; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.ensemble__tip[hidden] { display: none; }
.ensemble__tip-head { margin: 0 0 1px; color: var(--muted); font-family: var(--mono); }
.ensemble__tip-row { display: flex; gap: 6px; align-items: center; margin: 0; }
.ensemble__tip-row strong { font-family: var(--mono); font-weight: 600; }
.ensemble__tip-key { flex: none; width: 10px; height: 2px; }
.ensemble__tip-label { color: var(--muted); }
.ensemble__tip-band { color: var(--muted); font-family: var(--mono); }
.ensemble__note { margin: 0; color: var(--muted); font-size: 0.7rem; }
.ensemble__empty { padding: 4px 0; }

/* AI ページのシナリオ: 7 期間を小さな複数図 (高さ --chart-h-s) で並べる。L 3 列、XL 以上 4 列、M 2 列、S 1 列 (§8 の段)。
   凡例は確率の 3 つだけ (legend: :probabilities。価格と本数は吹き出し)、値動きの幅・横ばいの幅・本数は見出しの吹き出しにして文字は隠す。
   AI ページで 1 つの期間に絞ったときは、その 1 枚を大きく (幅 70rem まで・高さ --chart-h-l) して見出しの数字も文字で出す (下の .ai-page の規則)。
   灰・吹き出しの地・罫・等幅は :root のトークン (ライトとダークで替わる) をそのまま使い、アクセントだけ AI ページの藍にする。 */
.ai-ensemble { --accent: var(--accent-ai); }
.ai-ensemble__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.ai-ensemble__figure { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 8px 10px 6px; border: 1px solid var(--border); border-radius: 8px; }
.ai-ensemble__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ai-ensemble__key { color: var(--text); font-size: 0.95rem; }
.ai-ensemble__facts { display: none; margin-left: auto; }
.ai-ensemble .ensemble__legend { font-size: 0.74rem; }
.ai-ensemble .ensemble__p { font-size: 0.82rem; }
/* 確率だけの凡例は 1 行 (色の線・語・確率)。 */
.ensemble__legend--compact .ensemble__cluster { grid-template-columns: 10px auto minmax(0, 1fr); }
.ai-ensemble .ensemble__chart { flex: none; height: var(--chart-h-s); }
.ai-ensemble .ensemble__tip { box-shadow: 0 2px 8px color-mix(in srgb, var(--shadow) 12%, transparent); }
@media (min-width: 1600px) {
  .ai-ensemble__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1099px) {
  .ai-ensemble__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ai-ensemble__grid { grid-template-columns: minmax(0, 1fr); }
}

/* --- 中段のパネル (Jev / クイック・テイク / 予定とニュース) --- */
.panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  padding: 7px 11px 6px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.panel > * { flex-shrink: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.panel__head > * { min-width: 0; }
.panel__title { flex: none; margin: 0; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.panel__title small { color: var(--muted); font-size: 0.7rem; font-weight: normal; }
.panel__meta { margin: 0; overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.panel__meta time { font-family: var(--mono); }
.panel__meta time.is-stale { color: var(--hot-text); }
.panel__sep { margin: 0 4px; color: var(--rule); }
.panel__empty { padding: 4px 0; }
.panel__failed { margin: 0; color: var(--hot-text); font-size: 0.7rem; }
.panel__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.7rem; }
.panel__foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel__link { flex: none; color: var(--accent-text); text-decoration: none; }
.panel__link:hover { text-decoration: underline; }

/* Jev ライブの見通しのパネルの下の段 (decisions/_jev): 見出しと時刻、主導 / 清算リスクのチップ、30 分後の的中、15 分の帯。 */
.outlook__jev { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.outlook__jev-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; }
.outlook__jev-title { flex: none; font-size: 0.74rem; }
.outlook__jev-title small { color: var(--muted); font-size: 0.7rem; font-weight: normal; }
.outlook__jev-record { margin: 0; overflow: hidden; color: var(--muted); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.jev__chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.jev__strip-wrap { position: relative; flex: none; height: 2.5rem; margin-top: 2px; }
.jev__strip { display: block; width: 100%; height: 100%; }
.jev__strip-legend { position: absolute; bottom: -2px; left: 0; color: var(--muted); font-size: 0.7rem; }
.jev__strip-legend--now { right: 0; left: auto; }

/* クイック・テイク: 構え (大) と確信度のバー、見出し 1 文。理由・注目・リスクは畳む (.take__more)。 */
.take__head { display: flex; align-items: baseline; gap: 10px; }
.take__stance { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.take__confidence { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 0.7rem var(--mono); }
.take__confidence-bar { position: relative; width: 60px; height: 5px; background: var(--border); border-radius: 2px; overflow: hidden; }
.take__confidence-bar::before { content: ""; position: absolute; inset: 0; width: calc(var(--p, 0) * 1%); background: var(--neutral); }
.take__headline { margin: 0; font-size: 0.9rem; font-weight: 700; line-height: 1.4; }
.take__more { font-size: 0.72rem; }
.take__more > summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; }
.take__more > summary::-webkit-details-marker { display: none; }
.take__more > summary::before { content: "▸ "; }
.take__more[open] > summary::before { content: "▾ "; }
.take__more[open] > summary { margin-bottom: 2px; }
.take__why { margin: 0; color: var(--text); font-size: 0.74rem; line-height: 1.5; }
.take__list { display: grid; gap: 2px; margin: 0; font-size: 0.7rem; }
.take__list div { display: flex; gap: 6px; min-width: 0; }
.take__list dt { flex: none; color: var(--muted); }
.take__list dd { margin: 0; min-width: 0; }
.panel__foot .reading { font-size: 0.7rem; }

/* 吹き出し (peek コントローラ)。title の文字か、見通しの行の .peek-card の写し。画面に固定した 1 つの要素で、要素の下 (足りなければ上) に開く。 */
.peek {
  position: fixed;
  z-index: 50;
  max-width: min(22rem, calc(100vw - 16px));
  padding: 0.35rem 0.6rem 0.4rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--shadow) 45%, transparent);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.peek[hidden] { display: none; }
.peek--card { white-space: normal; }
.peek-card__head { margin: 0 0 3px; padding-bottom: 2px; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.peek-card__best { color: var(--accent-text); font-weight: 700; }
.peek-card__row { margin: 0; }
.peek-card__row.is-muted { color: var(--muted); }
.peek-card__row small { color: var(--muted); }
.peek-card__p { margin-right: 0.6rem; color: var(--muted); }
.peek-card__p strong { font-family: var(--mono); }
.peek-card__p--up strong { color: var(--up-text); }
.peek-card__p--down strong { color: var(--down-text); }
.peek-card__p--flat strong { color: var(--neutral); }
.peek-card__hint { margin: 3px 0 0; color: var(--muted); font-size: 0.7rem; }
/* タッチでは行を押すと期間が切り替わるだけなので、押せば…の案内は出さない。 */
@media (hover: none) { .peek-card__hint { display: none; } }

/* 予定とニュース。 */
.agenda__warn { margin: 0; color: var(--hot-text); font-size: 0.7rem; }
.agenda__events, .agenda__news { margin: 0; padding: 0; list-style: none; font-size: 0.72rem; }
.agenda__event { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; border-bottom: 1px solid var(--border); }
.agenda__event-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda__event.is-major .agenda__event-name { font-weight: 700; }
.agenda__event.is-soon { color: var(--hot-text); }
.agenda__event-until { flex: none; color: var(--muted); font-family: var(--mono); }
.agenda__event.is-soon .agenda__event-until { color: var(--hot-text); }
.agenda__more { margin: 0; color: var(--muted); font-size: 0.7rem; }
/* 多めに描いた予定 (4 件目から) と大口送金 (6 件目から) は、縦に余裕のある PC の 1 画面 (幅 1100px 以上・高さ 1000px 以上) でだけ出す。
   「ほか N 件」もその画面向けの数 (--tall) とほかの画面向けの数 (--short) を描いてあり、どちらかを出す。 */
@media not all and (min-width: 1100px) and (min-height: 1000px) {
  .agenda__event.is-extra, .agenda__more--tall, .theme-terminal .agenda__whales > .whale-item:nth-child(n+6) { display: none; }
}
@media (min-width: 1100px) and (min-height: 1000px) {
  .agenda__more--short { display: none; }
}
.agenda__news { margin-top: 2px; }
.agenda__article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 2px 0; border-bottom: 1px solid var(--border); }
.agenda__article-title { min-width: 0; overflow: hidden; color: var(--text); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.agenda__article-title:hover { color: var(--accent-text); }
.agenda__article-time { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
.theme-terminal .agenda__article .sentiment { font-size: 0.7rem; }
.theme-terminal .sentiment--none { color: var(--muted); }
/* 大口送金 (Whale Alert と監視ウォレット (mempool.space) の目立つ送金 5 件)。部品 (notable_transfers/_transfer) は速報ページと共有で、見た目は .whale-item の CSS なので、
   ここで 2 行 (時刻 · 向き · 金額 / 送り手 → 受け手) に詰める。行の下端の額の線は共有のまま (細くして 1px の区切りの上に引く)。
   新着 (feed-cap コントローラの is-new) は地を一瞬明るくする。 */
.agenda__whales-head { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 0; padding-top: 3px; border-top: 1px solid var(--border); color: var(--neutral); font-size: 0.7rem; font-weight: 700; }
.agenda__whales-note { min-width: 0; overflow: hidden; color: var(--muted); font-weight: normal; text-overflow: ellipsis; white-space: nowrap; }
.agenda__whales-link { flex: none; color: inherit; text-decoration: none; }
.agenda__whales-link:hover, .agenda__whales-link:focus-visible { color: var(--accent-text); text-decoration: underline; }
.theme-terminal .agenda__whales { font-size: 0.7rem; }
.theme-terminal .omen { margin-bottom: 2px; padding: 1px 6px; font-size: 0.7rem; }
.theme-terminal .omen__pill, .theme-terminal .omen__time { font-size: 0.7rem; }
.theme-terminal .agenda__whales .whale-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 2px 0 2px 6px; border-top: none; border-bottom: 1px solid var(--border); border-left-width: 2px; border-left-color: var(--rule); background-color: transparent; --flow-bar: 0.125rem; }
.theme-terminal .agenda__whales .whale-item.is-watched { border-left-color: var(--accent); }
.theme-terminal .agenda__whales .whale-item.is-major { border-left-color: var(--down); }
.theme-terminal .agenda__whales .whale-item.is-new { animation: decision-changed 1.2s ease-out 1; }
/* display: contents でも font-size は子へ受け継がれるので、共有の部品の 0.95rem をここで打ち消す。 */
.theme-terminal .agenda__whales .whale-item__meta,
.theme-terminal .agenda__whales .whale-item__body { display: contents; font-size: inherit; }
.theme-terminal .agenda__whales .whale-item__time { order: 1; color: var(--muted); font: 0.7rem var(--mono); }
.theme-terminal .agenda__whales .whale-item__kind { order: 2; padding: 0 4px; border-radius: 3px; font-size: 0.7rem; line-height: 1.5; }
.theme-terminal .agenda__whales .whale-item__watch { order: 3; padding: 0 4px; border-radius: 3px; font-size: 0.7rem; line-height: 1.5; }
/* 1 行目 (時刻 · 向き · ウォレット) と 2 行目 (金額 · 送り手 → 受け手) の間の改行 (幅いっぱいの空の flex item)。 */
.theme-terminal .agenda__whales .whale-item::after { content: ""; order: 4; flex: 1 0 100%; height: 0; }
.theme-terminal .agenda__whales .whale-item__amount { order: 5; font-family: var(--mono); font-weight: 700; }
.theme-terminal .agenda__whales .whale-item__usd { order: 6; font-size: 0.7rem; }
.theme-terminal .agenda__whales .whale-item__route { order: 7; flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.theme-terminal .agenda__whales .whale-item__flag,
.theme-terminal .agenda__whales .whale-item__address-type,
.theme-terminal .agenda__whales .whale-item__fresh { display: none; }
/* 外部のリンク (Whale Alert・mempool.space など。行の部品が 1 つだけ出す) を、行の右端の ↗ にする。リンクの文は大きさ 0 で読み上げに残す。 */
.theme-terminal .agenda__whales .whale-item__link { order: 8; flex: none; color: var(--muted); font-size: 0; text-decoration: none; }
.theme-terminal .agenda__whales .whale-item__link::before { content: "↗"; font-size: 0.72rem; }
.theme-terminal .agenda__whales .whale-item__link:hover,
.theme-terminal .agenda__whales .whale-item__link:focus-visible { color: var(--accent-text); }

/* --- 材料のタイル 10 枚 (1 列の帯。タイルの基本の見た目は上の .regime-tile で、ここで並べ替えて詰める) ---
   1 行目に題と決定の向きの点の札 (+1 / −1)、2 行目に数字と単位・読みのピル (入らなければ読みを省略記号で切る)。ミニ図 (digest_visual) と
   根拠の 1 行は、縦に余裕のある PC の 1 画面 (高さ 1000px 以上) でだけ出す (下の「縦に余裕のある画面」)。caption は吹き出しだけ。 */
.decision__tiles { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.theme-terminal .decision__tiles .regime-tile {
  display: flex;
  flex-flow: row wrap;
  align-items: baseline;
  gap: 0 4px;
  padding: 4px 8px 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--tone);
  border-radius: 4px;
}
.theme-terminal .decision__tiles .regime-tile--neutral { --tone: var(--rule); }
.theme-terminal .decision__tiles .regime-tile--missing { --tone: var(--rule); border-left-style: dashed; }
.theme-terminal .decision__tiles .regime-tile__title { flex: 1 0 100%; display: flex; align-items: baseline; gap: 4px; margin: 0; overflow: hidden; font-size: 0.7rem; white-space: nowrap; }
/* 決定の向きの点の札 (DecisionBoard#bias_parts)。+ は追い風の色、− は向かい風の色。題の行の右端。 */
.regime-tile__points { flex: none; margin-left: auto; padding: 0 3px; border-radius: 3px; font: 700 0.7rem/1.4 var(--mono); }
.regime-tile__points--up { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up-text); }
.regime-tile__points--down { background: color-mix(in srgb, var(--down) 16%, transparent); color: var(--down-text); }
.regime-tile__title-link { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.theme-terminal .regime-tile__title-link:hover,
.theme-terminal .regime-tile__title-link:focus-visible { color: var(--accent-text); }
.regime-tile__stale { flex: none; color: var(--hot-text); }
.theme-terminal .decision__tiles .regime-tile__value { display: contents; }
.theme-terminal .decision__tiles .regime-tile__value strong { flex: none; order: 1; font: 700 0.95rem/1.3 var(--mono); }
.theme-terminal .decision__tiles .regime-tile__unit { flex: none; order: 2; margin-left: 0; font-size: 0.7rem; }
.theme-terminal .decision__tiles .regime-tile__reading { flex: 1 1 0; order: 3; min-width: 0; margin: 0; overflow: hidden; text-align: right; white-space: nowrap; }
.theme-terminal .decision__tiles .regime-tile__reading .reading { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.theme-terminal .decision__tiles .regime-tile__caption,
.theme-terminal .decision__tiles .regime-tile__figure,
.theme-terminal .decision__tiles .regime-tile__basis { display: none; }
.theme-terminal .decision__tiles .regime-tile__figure { flex: 1 0 100%; order: 4; min-width: 0; margin-top: 2px; }

/* 読み上げにだけ渡す文字 (「現値」)。 */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }

/* --- 取り直し・差し替えで値が変わった所 (decision コントローラが is-changed を付ける) ---
   見ている間に気づける程度に、地をアクセント色で一度だけ「ピカッ」と光らせて 1 秒で戻す (繰り返さない)。 */
.is-changed { border-radius: 3px; animation: decision-changed 1s ease-out 1; }
@keyframes decision-changed {
  from { background-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
  to { box-shadow: 0 0 0 2px transparent; }
}
/* 中の値が変わったパネル (charts/flash の flashPanel が is-updated を付け、終わったら外す) は、枠を一度だけ光らせる。 */
.panel.is-updated { animation: panel-updated 1.2s ease-out 1; }
@keyframes panel-updated {
  from { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent); }
  to { box-shadow: 0 0 0 1px transparent, 0 0 14px transparent; }
}
/* 音で知らせた変化 (見通しの向きのチップ・Jev ライブの判定)。charts/signal が見ている間の 10 秒だけ is-signal を付ける。
   一度だけのフラッシュ (is-changed) と違い、枠と地を 10 秒点滅させ続けてどれが変わったかを目で拾えるようにする。 */
.is-signal { border-radius: 4px; outline: 2px solid var(--accent); outline-offset: 1px; background-color: color-mix(in srgb, var(--accent) 35%, transparent); animation: decision-signal 1s step-end infinite; }
@keyframes decision-signal { 50% { background-color: transparent; outline-color: transparent; } }


/* --- H-tall (幅 1100px 以上・高さ 880px 以上): 1 画面に収める。左の列は 見通しと Jev ライブ (中身の高さ) → 計画 (残りの高さ) → 保有 (中身の高さ)、
   右の 2 列は ライブ価格 1 : シナリオ | 根拠 0.5 : クイック・テイク | 予定とニュース 0.42 で分ける。タイルは 1 行。
   収まらないパネルは中をスクロールさせる (切って隠さない。続きのある端には淡い影)。
   文字は html の font-size (上の clamp) に比例するので、WQHD・4K でも同じ割り付けのまま大きくなる。結論の文字 (現値・計画の向き・見通しの語・構え) は
   画面の高さに比例させて clamp で上げ下げする (以前の 960px の段の代わり)。
   高さが 1000px に満たない H-tall (1440 × 900 の全画面など) では、左の列に高さを回すため Jev の帯と保有のフッタを出さず、見通しの行を 24px に詰め、
   計画の決め手の ✗ の 1 行 (入口の文とゲートの吹き出しにある) を出さない (1000px 以上で戻す。下の「縦に余裕のある画面」)。
   それでも足りない 880〜920px では、計画のパネルの下端 (手仕舞いの条件) が中のスクロールに回る。 --- */
@media (min-width: 1100px) and (min-height: 880px) and (pointer: fine) {
  /* 下端の 1 行のフッター (.site-footer--compact、1.75rem) のぶんも引いて、フッターまで含めて 1 画面に収める。 */
  /* 会員への帯 (.billing-notice) が出ていれば、その高さ (app-bar コントローラが測る --billing-notice-height) も引く。 */
  .container--fit { height: calc(100vh - var(--app-bar-height) - var(--billing-notice-height, 0px) - 1.75rem);
    height: calc(100dvh - var(--app-bar-height) - var(--billing-notice-height, 0px) - 1.75rem - env(safe-area-inset-bottom)); padding-bottom: 0; overflow: hidden; }
  .decision { height: 100%; grid-template-rows: minmax(0, 1fr) minmax(0, 0.5fr) minmax(0, 0.42fr) auto; }
  /* 左の列の箱の中は、frame (display: contents) の見通し・計画と、保有。計画が残りの高さを取る。 */
  .decision__board > .decision__outlook, .decision__left > .decision__frame > .decision__position,
  .decision__board > .decision__slot--outlook, .decision__left > .decision__frame > .decision__slot--position { flex: none; }
  .decision__board > .decision__plan, .decision__board > .decision__slot--plan { flex: 1 1 0; }
  .decision .panel { overflow-y: auto; scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }
  /* 続きがあることを見せる影 (スクロールの影)。macOS などスクロールバーが隠れる環境でも、下 (上) に続きがあると分かるように、
     中身の端に淡い帯を出す。上下の端までスクロールすると、中身と一緒に動く地の色の帯 (local) が影 (scroll) を覆って消える。 */
  .decision .panel {
    background:
      linear-gradient(var(--card) 40%, transparent) center top / 100% 1.75rem no-repeat local,
      linear-gradient(transparent, var(--card) 60%) center bottom / 100% 1.75rem no-repeat local,
      linear-gradient(color-mix(in srgb, var(--text) 16%, transparent), transparent) center top / 100% 0.75rem no-repeat scroll,
      linear-gradient(transparent, color-mix(in srgb, var(--text) 16%, transparent)) center bottom / 100% 0.75rem no-repeat scroll,
      var(--card);
  }
  .live__body { min-height: 0; }
  /* 見通しは中身の高さだけ取るので中をスクロールさせない。見出しの i マークの吹き出しがパネルの外へはみ出して読めるよう、切らない。 */
  .decision .decision__outlook { overflow: visible; }
  /* シナリオの注記は 1 画面では出さない (帯の意味はメタの行にある)。 */
  .decision .ensemble__note { display: none; }
  /* 結論の文字は画面の高さに比例させる (900px で小さめ、1080px 以上で上限)。 */
  .live__px { font-size: clamp(2.4rem, 4.6vh, 2.9rem); }
  .verdicts__bias { font-size: clamp(1.35rem, 2.6vh, 1.6rem); }
  .verdicts__timing { font-size: clamp(0.95rem, 1.75vh, 1.1rem); }
  .verdicts__horizon-label { font-size: clamp(0.92rem, 1.6vh, 1rem); }
  .take__stance { font-size: clamp(1.35rem, 2.5vh, 1.5rem); }
  .take__headline { font-size: clamp(0.9rem, 1.6vh, 1rem); }
}
/* 高さ 1000px 未満の PC (H-short と、1440 × 900 など低めの H-tall。マウスの端末): 左の列 (見通し → 計画 → 保有) を詰める。Jev の帯と保有のフッタを出さず、
   見通しの行を 24px に、計画の決め手の ✗ の 1 行 (入口の文とゲートの吹き出しにある) を出さない。
   1000px 以上ではどれも出す (H-tall の 1 画面に余裕があり、H-short は 1000px 以上に無い)。 */
@media (min-width: 1100px) and (max-height: 999px) and (pointer: fine) {
  .jev__strip-wrap, .decision__position .panel__foot, .verdict__decisive { display: none; }
  .verdicts__horizons { grid-auto-rows: minmax(1.5rem, auto); }
  .decision__left { gap: 6px; }
}
/* H-tall で縦に余裕のある画面 (1000px 以上。フル HD・WQHD・4K): 補足の文字を少し大きくし、余った高さに中身を足す
   (材料のタイルのミニ図と根拠の 1 行、根拠の出どころの文の中身を 2 行まで。予定 6 件・大口送金 8 件は上の「予定とニュース」)。 */
@media (min-width: 1100px) and (min-height: 1000px) {
  .theme-terminal .decision__tiles .regime-tile__figure { display: block; }
  .theme-terminal .decision__tiles .regime-tile__basis { display: block; flex: 1 0 100%; order: 5; overflow: hidden; color: var(--muted); font-size: 0.7rem; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
  .why__signal-detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; }
  .verdict__sub, .verdict__gates, .verdict__exits, .why__signals { font-size: 0.76rem; }
  .take__why { font-size: 0.8rem; }
  .agenda__events, .agenda__news { font-size: 0.78rem; }
}
/* WQHD・4K: 文字は html の font-size (上の clamp) で大きくなるが、px で描く図 (R ラダー・リスクのゲージ・根拠の軸の上の丸・
   材料のタイルのミニ図・売買のしやすさの 4 象限の点) は小さいまま残るので、zoom で文字に揃えて拡大する (幅は置き場に合わせたまま、
   高さ・札の文字・印が大きくなる)。倍率は html の font-size ÷ 16px の近似 (2560 × 1440 で約 1.2、3840 × 2160 で約 1.6)。 */
@media (min-width: 2400px) and (min-height: 1350px) {
  .decision .r-ladder__box, .decision .verdict__risk .digest-visual, .decision .why__track, .decision__tiles .regime-tile__figure, .decision .live__quadrant { zoom: 1.2; }
}
@media (min-width: 3200px) and (min-height: 1800px) {
  .decision .r-ladder__box, .decision .verdict__risk .digest-visual, .decision .why__track, .decision__tiles .regime-tile__figure, .decision .live__quadrant { zoom: 1.4; }
}
@media (min-width: 3800px) and (min-height: 2100px) {
  .decision .r-ladder__box, .decision .verdict__risk .digest-visual, .decision .why__track, .decision__tiles .regime-tile__figure, .decision .live__quadrant { zoom: 1.6; }
}
/* --- H-short (幅 1100px 以上・高さ 880px 未満。窓にした MacBook 13 / 14"): 1 画面に詰めるのをやめ、左の列 (見通し → 計画 → 保有) を
   上端のバーの下に固定 (sticky) して、右の 2 列とタイルをページでスクロールさせる。タイルは右の 2 列の下に 5 枚 × 2 段で並べ、
   左の列はページの最後まで固定したまま。左の列が窓より高いときだけ、その中をスクロールさせる。右のパネルは中をスクロールさせず、図は決まった高さ。
   高さの予算は docs/decision.md の「レイアウト」。
   指で押す端末 (pointer: coarse。iPad の横向きなど) は高さに依らずこの並びにし、左の列も固定しない (入れ子のスクロールを作らない)。 --- */
@media (min-width: 1100px) and (max-height: 879px), (min-width: 1100px) and (pointer: coarse) {
  .decision {
    grid-template-areas:
      "left hero  hero"
      "left paths why"
      "left take  agenda"
      "left tiles tiles";
  }
  .decision__left { align-self: start; }
  .decision__board > .decision__outlook, .decision__board > .decision__plan, .decision__left > .decision__frame > .decision__position { flex: none; }
  .decision__tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .live__body { flex: none; height: 17rem; }
  .decision__ensemble .ensemble { flex: none; }
  .decision .ensemble__chart { height: 11rem; flex: none; }
  .jev__strip-wrap { height: 2.5rem; flex: none; }
  .panel--scroll { overflow: visible; }
}
@media (min-width: 1100px) and (max-height: 879px) and (pointer: fine) {
  /* 高さの上限は、窓から上端のバー・上の隙間 (0.5rem) と、ページの下の余白とフッター (1 行。合わせて 3.5rem) を引いたもの。固定 (sticky) は
     ページの区画の下端で止まるので、下端まで引かないとページの最後までスクロールしたときに列の上端が上端のバーの下へ押し上げられる。 */
  .decision__left {
    position: sticky;
    top: calc(var(--app-bar-height) + 0.5rem);
    align-self: start;
    max-height: calc(100vh - var(--app-bar-height) - 4rem);
    max-height: calc(100dvh - var(--app-bar-height) - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--rule) transparent;
    scrollbar-width: thin;
  }
}
/* 1099px 以下 (タブレット): 2 列に積んでページをスクロールする。価格 → 見通しと Jev ライブ | 計画 → 保有 (見通しの下) | クイック・テイク →
   シナリオ → 根拠 | 予定とニュース → タイル 5 列。左の列の箱はほどき、パネルの中のスクロールはやめ、図は決まった高さにする。 */
@media (max-width: 1099px) {
  .decision {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "hero     hero"
      "outlook  plan"
      "position take"
      "paths    paths"
      "why      agenda"
      "tiles    tiles";
  }
  .decision__left { display: contents; }
  .decision__outlook, .decision__slot--outlook { grid-area: outlook; }
  .decision__plan, .decision__slot--plan { grid-area: plan; }
  .decision__position, .decision__slot--position { grid-area: position; }
  .decision__outlook, .decision__position, .decision .panel--take, .decision__why, .decision .panel--agenda { align-self: start; }
  .decision__tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .live__body { flex: none; height: 17.5rem; }
  .decision__ensemble .ensemble { flex: none; }
  .decision .ensemble__chart { height: 12.5rem; flex: none; }
  .jev__strip-wrap { height: 3.5rem; flex: none; }
  .panel--scroll { overflow: visible; }
}
/* 600px 以下 (スマホ): 1 列。価格 → 見通しと Jev ライブ → 計画 → 保有 → クイック・テイク → シナリオ → 根拠 → 予定 → タイル 2 列。
   主タブが 5 つあるので、タブの文字と左右の余白を詰める (どのページでも同じタブ)。 */
@media (max-width: 600px) {
  .decision {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hero" "outlook" "plan" "position" "take" "paths" "why" "agenda" "tiles";
  }
  .decision__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 見出しは 1 列に積む (価格の右に変化の行を置く幅が無い)。 */
  .live__head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sym" "price" "main" "sub"; row-gap: 4px; }
  .live__px { font-size: 2rem; }
  .live__body { height: 15rem; }
  .decision .ensemble__chart { height: 10.5rem; }
  .ensemble__legend { grid-template-columns: minmax(0, 1fr); }
  .ensemble__cluster { grid-template-columns: 10px auto auto minmax(0, 1fr) auto; grid-template-rows: auto; }
  .ensemble__end { grid-row: 1; grid-column: 4; }
  .ensemble__count { grid-column: 5; }
  .panel__head { flex-wrap: wrap; }
  .primary-tabs { font-size: 0.9rem; }
  .primary-tabs__link { padding-inline: 2px; }
}
/* 360px 未満の幅でも主タブとアイコン (タイムゾーン・アラート・設定・アカウント) を 1 行に収める。 */
@media (max-width: 359px) {
  .primary-tabs { font-size: 0.8rem; }
  .app-bar__link { min-width: 30px; }
}
/* S のタッチでは上端のバーのアイコン (時計・設定・アカウント・管理) とゲストの入口を 44px にする。::after の当たり (押せる範囲を広げる) は
   隣のアイコンと 4px しか空いていないので重なり、1 つぶんの当たりが 40px ほどに減るため、箱そのものを 44px にする
   (アイコンが 4 つ (管理者) とカードの密度でも 1 段目に収まる)。 */
@media (max-width: 600px) and (pointer: coarse) {
  .primary-tabs__link { padding: 9px 2px; }
  .app-bar__link { min-width: 44px; min-height: 44px; }
}
/* 指で押す端末 (スマホ・タブレット・iPad の横向き): 押す所を 44px にする。見通しの行 (枠の 1px を除いた行のリンクと ▸)・保有の入力と送信は 44px の高さ、
   見出しのリンク (.panel__link) は見た目を変えずに押せる範囲だけ広げる。行の吹き出しは右端の ▸ で行の下に開く。
   入力の文字は 16px 以上 (iOS の Safari が入力のたびに拡大しないように)。 */
@media (pointer: coarse) {
  .verdicts__horizons { grid-auto-rows: minmax(2.75rem, auto); }
  .verdicts__horizon-link { min-height: 44px; }
  .verdicts__more {
    min-height: 44px;
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    padding: 0;
    border: none;
    border-left: 1px solid var(--border);
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
  }
  .verdicts__more[aria-expanded="true"] { color: var(--accent-text); }
  .verdicts__more[aria-expanded="true"] > span { display: inline-block; transform: rotate(90deg); }
  .decision__input input, .decision__input select, .position__submit { min-height: 44px; font-size: max(16px, 1rem); }
  .decision .panel__link { position: relative; }
  .decision .panel__link::after { content: ""; position: absolute; inset: -12px -6px; }
}

/* 動きを減らす設定: 光る・脈打つ・ハイライトを止める (値そのものは動く)。 */
@media (prefers-reduced-motion: reduce) {
  .is-changed, .panel.is-updated, .live__px.is-flash-up, .live__px.is-flash-down, .live__feed.is-live .live__dot, .live__feed .live__dot.is-blink,
  .live__changes .is-flash-up, .live__changes .is-flash-down, .live__sale.is-new, .theme-terminal .agenda__whales .whale-item.is-new { animation: none; }
  /* 音で知らせた変化は点滅させず、枠と地を出したままにする (10 秒で外れる)。 */
  .is-signal { animation: none; }
}
/* コントラストを上げる設定: 補足の文字と罫を明るくする。 */
@media (prefers-contrast: more) {
  body.theme-terminal { --muted: #a9b4c2; --border: #3d4859; --rule: #4d5b6d; }
}

/* ---- AI ページ (/ai)、見通しと成績 (outlooks/_panel・_scorecard・index、Outlook と Scorecard) ---------------------- */

/* 上に 7 期間の列 (向きと確率・3 分割のバー・確度・edge・根拠)、下に期間ごとの部品の表。成績は表 3 枚。
   バーは AI パルスの部品 (.market-pulse__bar、左から 下げ | 横ばい | 上げ) をそのまま使う。色は既存のトークンと .reading--* だけで、
   アクセントは AI 予想の紫とパルスの空色の間の藍。確度のバッジ (.outlook-band--*) は向きでないので緑・赤を使わず、
   文字と枠の濃さで強さを出す (決定ページのダークでも同じ class)。 */
.outlook { --accent: var(--accent-ai); }
.outlook__meta { margin: 0; color: var(--muted); font-size: 0.75rem; text-align: right; }
.outlook__meta time { font-variant-numeric: tabular-nums; }
.outlook__key { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.outlook__headline { font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.outlook__facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
/* AI パルスのバーは行の折り返しで幅いっぱいに伸ばす (flex: 1 0 100%) ので、縦に積む列の中では伸ばさない (高さを全部取ってしまう)。 */
/* 3 分割のバーは引き伸ばすと割合が読みにくいので 22rem で止める (決定ページの見通しの行・審議会・部品の表も。4K で 1 本 2,000px にならない。§8)。 */
.outlook__bar { flex: none; width: 100%; max-width: 22rem; }
.outlook__bar--compact { min-width: 32px; }
.outlook__bar--compact .market-pulse__bar-part { padding-top: 0; border-top-width: 0.4rem; }
.outlook-band { display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 0.72rem; line-height: 1.5; white-space: nowrap; }
.outlook-band--high { border-color: var(--text); color: var(--text); font-weight: 700; }
.outlook-band--medium { border-color: var(--muted); color: var(--text); }
.outlook-band--none { border-style: dashed; }
.theme-terminal .outlook-band { padding: 0 5px; border-radius: 3px; font-size: 0.7rem; }
.theme-terminal .outlook-band--medium { border-color: var(--neutral); }
.outlook__side { white-space: nowrap; }
.outlook__tables { display: grid; gap: 12px; }
.outlook__table { width: 100%; max-width: 100rem; border-collapse: collapse; font-size: 0.8rem; }
.outlook__table caption { margin-bottom: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; }
.outlook__table caption small { font-weight: normal; }
.outlook__table th,
.outlook__table td { padding: 3px 10px 3px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.outlook__table thead th { color: var(--muted); font-size: 0.72rem; font-weight: normal; white-space: nowrap; }
.outlook__table tbody th { white-space: nowrap; }
.outlook__table tbody th a { color: var(--text); }
.outlook__table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.outlook__bar-cell { min-width: 9rem; }
.outlook__detail { color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.outlook__prior th, .outlook__prior td { color: var(--muted); }
/* 成績の図 (outlooks/_scorecard)。docs/design-guide.md の「図が先、数字はあと」と「横に間延びさせない」に沿う。
   ヒートマップ (出どころ × 期間): マスは決まった大きさのタイルで、地の色がスキル (緑 = 良い / 赤 = 悪い、--tile が混ぜる割合)、文字が的中率。
   表の幅は中身なり (width: auto) で、画面が広くてもマスを引き伸ばさない。採点が足りないマスは網掛け、答えない期間は点だけ。
   見通しの行は全体のまとめなので見出しを太く。件数・スキル・重みは吹き出し (title) と数表へ。
   期間ごとの成績: 期間 1 行に 確度の帯 (高 / 中 / 低) ごとの的中率の 3 本の細い棒 (縦線は見通し全体) と、計画の平均 R・内訳の積み上げ棒。 */
.outlook-scorecard__scroll { max-width: 100%; margin-top: 4px; overflow-x: auto; }
.outlook-scorecard__legend { margin: 6px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.outlook-scorecard__grid { border-collapse: separate; border-spacing: 3px; margin-left: -3px; font-size: 0.8rem; }
/* 表の説明は caption ではなく表の上の見出しに置く (caption は表の幅で折り返すので、狭いヒートマップでは縦に細長くなる)。 */
.outlook-scorecard__heading,
.outlook-scorecard__horizons caption { margin: 14px 0 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; }
.outlook-scorecard__heading small,
.outlook-scorecard__horizons caption small { font-weight: normal; }
.outlook-scorecard__grid thead th { padding: 0 0 2px; color: var(--muted); font-size: 0.72rem; font-weight: normal; text-align: center; white-space: nowrap; }
.outlook-scorecard__grid thead th:first-child { text-align: left; }
.outlook-scorecard__grid tbody th { padding: 0 10px 0 0; font-weight: 600; text-align: left; white-space: nowrap; }
.outlook-scorecard__row--outlook th { font-weight: 800; }
.outlook-scorecard__cell {
  width: 4.6rem;
  height: 2.4rem;
  padding: 0 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border) 35%, transparent);
  text-align: center;
  vertical-align: middle;
}
.outlook-scorecard__cell.is-better { background: color-mix(in srgb, var(--up) calc(var(--tile-floor) + var(--tile, 10%) * var(--tile-scale)), var(--card)); }
.outlook-scorecard__cell.is-worse { background: color-mix(in srgb, var(--down) calc(var(--tile-floor) + var(--tile, 10%) * var(--tile-scale)), var(--card)); }
.outlook-scorecard__cell.is-thin { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--border) 60%, transparent) 0 3px, transparent 3px 7px); color: var(--muted); }
.outlook-scorecard__row--outlook .outlook-scorecard__cell:not(.is-na) { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 25%, transparent); }
.outlook-scorecard__cell.is-na { background: transparent; color: var(--muted); opacity: 0.5; font-size: 1.2rem; line-height: 1; }
.outlook-scorecard__hit { font-size: 0.95rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.outlook-scorecard__hit small { font-size: 0.7rem; font-weight: 600; }
.outlook-scorecard__horizons { width: 100%; max-width: 52rem; margin-top: 6px; border-collapse: collapse; font-size: 0.8rem; }
.outlook-scorecard__horizons th, .outlook-scorecard__horizons td { padding: 5px 14px 5px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.outlook-scorecard__horizons thead th { padding-top: 0; padding-bottom: 3px; color: var(--muted); font-size: 0.72rem; font-weight: normal; white-space: nowrap; }
.outlook-scorecard__horizons tbody th { width: 2.6rem; font-weight: 600; white-space: nowrap; }
.outlook-scorecard__horizons td:last-child { padding-right: 0; }
.outlook-scorecard__bands { width: 45%; }
.outlook-scorecard__band-stack { display: grid; gap: 3px; min-width: 9rem; }
.outlook-scorecard__band { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); align-items: center; gap: 4px; }
.outlook-scorecard__band-label { color: var(--muted); font-size: 0.7rem; font-weight: 700; line-height: 1; }
.outlook-scorecard__band .outlook-scorecard__meter { height: 5px; margin: 0; }
.outlook-scorecard__band .outlook-scorecard__meter-ref { top: -2px; bottom: -2px; }
/* 実効件数が MIN_EFFECTIVE に満たない帯・計画は薄く出す (件数は多くても独立な窓が少ない)。薄くするのは棒 (図) だけで、
   文字は半透明にすると 2.1:1 まで落ちて読めないので、色を外した灰の細い字にする (--muted は地の上で 4.5:1 以上)。 */
.outlook-scorecard__band.is-thin .outlook-scorecard__meter { opacity: 0.5; }
.outlook-scorecard__total.is-thin,
.outlook-scorecard__total.is-thin * { color: var(--muted); font-weight: 400; }
/* スキルの棒 (中央から右 = 良い、緑 / 左 = 悪い、赤)。予想の成績と学習 (forecast_lab) の前進検証と材料の棒が使う。 */
.outlook-scorecard__skill { position: relative; display: block; height: 6px; margin: 5px 0 4px; border-radius: 3px; background: var(--border); }
.outlook-scorecard__skill.is-empty { background: repeating-linear-gradient(90deg, var(--border) 0 4px, transparent 4px 7px); }
.outlook-scorecard__skill::before { content: ""; position: absolute; top: -2px; bottom: -2px; left: calc(50% - 0.5px); width: 1px; background: var(--muted); }
.outlook-scorecard__skill-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.outlook-scorecard__skill-fill.is-up { left: 50%; background: var(--up); }
.outlook-scorecard__skill-fill.is-down { right: 50%; background: var(--down); }
.outlook-scorecard__meter { position: relative; display: block; height: 8px; margin: 3px 0 4px; border-radius: 4px; background: var(--border); }
.outlook-scorecard__meter.is-empty { background: repeating-linear-gradient(90deg, var(--border) 0 4px, transparent 4px 7px); }
.outlook-scorecard__meter-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--accent); }
.outlook-scorecard__meter-ref { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); }
.outlook-scorecard__total { width: 5.5rem; font-size: 1.05rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.outlook-scorecard__plan-bar { min-width: 9rem; }
.outlook-scorecard__plan-none { color: var(--muted); font-size: 0.75rem; }
.outlook-scorecard__results .market-pulse__bar-part { padding-top: 1px; border-top-width: 0.6rem; font-size: 0.7rem; }
.outlook-scorecard__results .market-pulse__bar-part + .market-pulse__bar-part { margin-left: 2px; }
/* 向きの語の割合 (outlooks/_direction_mix): 期間 1 行。語の割合のバーは見通しのバーと同じ部品なので色はそのまま。 */
.outlook-scorecard__mix { width: 100%; max-width: 100rem; margin-top: 14px; border-collapse: collapse; font-size: 0.8rem; }
.outlook-scorecard__mix caption { margin-bottom: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; }
.outlook-scorecard__mix caption small { font-weight: normal; }
.outlook-scorecard__mix th, .outlook-scorecard__mix td { padding: 6px 12px 6px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.outlook-scorecard__mix thead th { padding-top: 0; padding-bottom: 3px; color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.outlook-scorecard__mix tbody th { white-space: nowrap; font-weight: 600; }
.outlook-scorecard__mix td:last-child { padding-right: 0; }
.outlook-scorecard__mix-shares { min-width: 11rem; }
.outlook-scorecard__mix-text { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 3px; color: var(--muted); font-size: 0.7rem; }
.outlook-scorecard__mix-text span { white-space: nowrap; }
.outlook-scorecard__mix small { color: var(--muted); }
.outlook-scorecard__flat { width: 100%; max-width: 100rem; margin-top: 14px; border-collapse: collapse; font-size: 0.8rem; }
.outlook-scorecard__flat caption { margin-bottom: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; }
.outlook-scorecard__flat caption small { font-weight: normal; }
.outlook-scorecard__flat th, .outlook-scorecard__flat td { padding: 6px 12px 6px 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.outlook-scorecard__flat thead th { padding-top: 0; padding-bottom: 3px; color: var(--muted); font-size: 0.72rem; font-weight: normal; white-space: nowrap; }
.outlook-scorecard__flat tbody th { white-space: nowrap; font-weight: 600; }
.outlook-scorecard__flat td:last-child { padding-right: 0; }
.outlook-scorecard__flat .is-off { color: var(--hot-text); font-weight: 700; }
.outlook-scorecard__flat .is-thin { color: var(--muted); }
.outlook-scorecard__details { margin-top: 10px; }
.outlook-scorecard__details summary { color: var(--muted); font-size: 0.78rem; cursor: pointer; }
.outlook-scorecard__details[open] summary { margin-bottom: 8px; }
@media (max-width: 480px) {
  .outlook__meta { text-align: left; }
}
/* 見通しのパネルの最上段「AI の読み」(outlooks/_digest)。AI ページの中身を 7 期間の行に縮めて図で見せる。
   行は 期間 | 向きの矢印と確率 | 軸 | 確度の 3 本の棒 | 開閉の印 の 5 列。軸は左端 = 下げ一色、真ん中 = 拮抗、右端 = 上げ一色で、
   出どころの丸 (1 文字の印。色は向き、濃さは重み。近い丸は上下の段へ逃がす) と見通しの針 (真ん中から針までを向きの色で塗り、濃さは確度) を置く。丸は針より上に重ね、針に隠れないようにする。
   行 (<details>) を押すと確率のバー・事実・部品の表・各セクションへのリンクが開く。狭い画面では軸を 2 行目に幅いっぱいに。
   色は既存のトークン (--up / --down / --muted / --border) と .reading--* / .tone--* だけ。 */
.outlook-digest { --digest-cols: 2.8rem 7.6rem minmax(0, 1fr) 2rem 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.outlook-digest__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; }
.outlook-digest__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.outlook-digest__chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.outlook-digest__chip small { color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.outlook-digest__chip:hover { border-color: currentColor; }
.outlook-digest__head {
  display: grid;
  grid-template-columns: var(--digest-cols);
  gap: 0 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}
.outlook-digest__head-axis { grid-column: 3; display: flex; justify-content: space-between; }
.outlook-digest__head-band { grid-column: 4; text-align: center; }
.outlook-digest__rows { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.outlook-digest__row { border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.outlook-digest__row[open] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.outlook-digest__summary {
  display: grid;
  grid-template-columns: var(--digest-cols);
  align-items: center;
  gap: 4px 10px;
  min-height: 52px;
  padding: 6px 12px;
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
}
.outlook-digest__summary::-webkit-details-marker { display: none; }
.outlook-digest__summary:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.outlook-digest__summary .outlook__key { color: var(--text); font-size: 0.9rem; white-space: nowrap; }
.outlook-digest__call { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.outlook-digest__arrow { flex: none; font-size: 1.35rem; font-weight: 800; line-height: 1; }
.outlook-digest__call .outlook__headline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 軸。背景は審議会の目盛りと同じ 赤 → 灰 → 緑 の淡いグラデーション。丸は 3 段 (真ん中・上・下)。 */
.outlook-digest__track {
  position: relative;
  display: block;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--down) 16%, transparent), color-mix(in srgb, var(--border) 45%, transparent) 50%, color-mix(in srgb, var(--up) 16%, transparent));
}
.outlook-digest__track i { position: absolute; font-style: normal; }
.outlook-digest__zero { left: 50%; top: 3px; bottom: 3px; width: 1px; background: var(--muted); opacity: 0.6; }
.outlook-digest__lean { top: 13px; height: 12px; border-radius: 3px; }
.outlook-digest__lean--positive { background: var(--up); }
.outlook-digest__lean--negative { background: var(--down); }
.outlook-digest__lean--neutral { background: var(--muted); }
.outlook-digest__lean--high { opacity: 0.6; }
.outlook-digest__lean--medium { opacity: 0.38; }
.outlook-digest__lean--low { opacity: 0.2; }
.outlook-digest__needle { top: 1px; bottom: 1px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 1.5px var(--card); z-index: 1; }
/* 丸の中の 1 字は文字の下限の 11px。丸はそれが縁に触れない 18px。 */
.outlook-digest__dot,
.outlook-digest__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--card);
  color: var(--on-fill);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.outlook-digest__dot { z-index: 2; margin-left: -9px; }
.outlook-digest__dot--lane0 { top: 10px; }
.outlook-digest__dot--lane1 { top: 0; }
.outlook-digest__dot--lane2 { top: 20px; }
.outlook-digest__dot--positive { background: var(--up-text); }
.outlook-digest__dot--negative { background: var(--down-text); }
.outlook-digest__dot--neutral { background: var(--muted); }
.outlook-digest__mark { flex: none; margin-right: 6px; vertical-align: -3px; border-width: 0; }
/* 確度の 3 本の棒 (電波の強さの形)。塗る本数が帯の強さ。向きではないので文字色 (--text) で塗る。 */
.outlook-pips { display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; height: 16px; }
.outlook-pips__pip { display: block; width: 5px; border-radius: 1px; background: var(--border); }
.outlook-pips__pip:nth-child(1) { height: 6px; }
.outlook-pips__pip:nth-child(2) { height: 11px; }
.outlook-pips__pip:nth-child(3) { height: 16px; }
.outlook-pips__pip.is-on { background: var(--text); }
.outlook-digest__chevron { justify-self: end; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.outlook-digest__row[open] .outlook-digest__chevron { transform: rotate(45deg); }
.outlook-digest__body { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 12px; border-top: 1px dashed var(--border); }
.outlook-digest__body .outlook__facts { margin: 0; }
.outlook-digest__body > .outlook__bar { margin-top: 6px; }
.outlook-digest__jumps { display: flex; flex-wrap: wrap; gap: 6px; }
.outlook-digest__jump { padding: 3px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent-text); font-size: 0.78rem; font-weight: 600; text-decoration: none; }
.outlook-digest__jump:hover { border-color: var(--accent); }
.outlook-digest__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 2px 0 0; color: var(--muted); font-size: 0.7rem; }
.outlook-digest__legend span { display: inline-flex; align-items: center; white-space: nowrap; }
.outlook-digest__legend .outlook-digest__legend-note { white-space: normal; }
.outlook-digest__legend .outlook-digest__mark { margin-right: 4px; vertical-align: 0; }
.outlook-digest__legend-needle { display: inline-block; width: 4px; height: 14px; margin-right: 4px; border-radius: 2px; background: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .outlook-digest__chevron { transition: none; }
}
/* 狭い画面: 1 行目に 期間・向き・確度・開閉、2 行目に軸を幅いっぱいに。列の見出しは出さない。 */
@media (max-width: 600px) {
  .outlook-digest__head { display: none; }
  .outlook-digest__summary {
    grid-template-columns: 2.2rem minmax(0, 1fr) auto 0.9rem;
    grid-template-areas: "key call band chevron" "track track track track";
    padding: 8px 10px;
  }
  .outlook-digest__summary .outlook__key { grid-area: key; }
  .outlook-digest__call { grid-area: call; }
  .outlook-digest__track { grid-area: track; }
  .outlook-digest__summary .outlook-pips { grid-area: band; }
  .outlook-digest__summary .outlook-digest__chevron { grid-area: chevron; }
  .outlook-digest__body { padding: 4px 10px 10px; }
}
/* 狭い画面の部品の表: 7 列のままだと「中身」の列が 1 文字幅まで潰れて行が縦に伸び、空白だらけになる。
   行を 1 枚ずつに組み替え、1 行目に 出どころ と 重み・スキル・n・鮮度 (見出しは data-label)、2 行目にバー、3 行目に中身を幅いっぱいに。 */
@media (max-width: 600px) {
  .outlook__tables .outlook__table, .outlook__tables .outlook__table tbody { display: block; }
  .outlook__tables .outlook__table caption { display: block; }
  .outlook__tables .outlook__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .outlook__tables .outlook__table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .outlook__tables .outlook__table tbody th,
  .outlook__tables .outlook__table tbody td { padding: 0; border-bottom: 0; }
  .outlook__tables .outlook__table tbody th { margin-right: auto; }
  .outlook__tables .outlook__table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.7rem; }
  .outlook__bar-cell { display: flex; flex: 1 0 100%; align-items: center; gap: 8px; min-width: 0; order: 1; }
  .outlook__bar-cell .outlook__bar { flex: 1 1 auto; width: auto; }
  .outlook__detail { flex: 1 0 100%; order: 2; }
}
/* 狭い画面の成績の図: ヒートマップはマスを少し縮めて横に流し (表の中だけ横スクロール)、期間ごとの成績は 1 行目に 期間・平均 R、
   2 行目に確度の棒と計画の内訳を半分ずつ。 */
@media (max-width: 600px) {
  .outlook-scorecard__cell { width: 3.2rem; height: 2.2rem; }
  .outlook-scorecard__hit { font-size: 0.82rem; }
  .outlook-scorecard__grid tbody th { padding-right: 6px; font-size: 0.75rem; white-space: normal; }
  .outlook-scorecard__horizons, .outlook-scorecard__horizons tbody { display: block; }
  .outlook-scorecard__horizons caption { display: block; }
  .outlook-scorecard__horizons thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .outlook-scorecard__horizons tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "key total" "bands plan"; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .outlook-scorecard__horizons tbody th, .outlook-scorecard__horizons tbody td { width: auto; min-width: 0; padding: 0; border-bottom: 0; }
  .outlook-scorecard__horizons tbody th { grid-area: key; }
  .outlook-scorecard__horizons .outlook-scorecard__total { grid-area: total; text-align: right; }
  .outlook-scorecard__horizons .outlook-scorecard__bands { grid-area: bands; }
  .outlook-scorecard__horizons .outlook-scorecard__plan-bar { grid-area: plan; }
  .outlook-scorecard__mix, .outlook-scorecard__mix tbody, .outlook-scorecard__mix caption { display: block; }
  .outlook-scorecard__mix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .outlook-scorecard__mix tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .outlook-scorecard__mix tbody th, .outlook-scorecard__mix tbody td { padding: 0; border-bottom: 0; }
  .outlook-scorecard__mix tbody th, .outlook-scorecard__mix-shares { grid-column: 1 / -1; }
  .outlook-scorecard__mix-shares { min-width: 0; }
  .outlook-scorecard__mix td[data-label]:not(.outlook-scorecard__mix-shares)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
  .outlook-scorecard__flat, .outlook-scorecard__flat tbody { display: block; }
  .outlook-scorecard__flat caption { display: block; }
  .outlook-scorecard__flat thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .outlook-scorecard__flat tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .outlook-scorecard__flat tbody th, .outlook-scorecard__flat tbody td { padding: 0; border-bottom: 0; }
  .outlook-scorecard__flat tbody th { flex: 1 0 100%; }
  .outlook-scorecard__flat td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.7rem; }
}

/* AI ページの期間の絞り込み。期間を選ぶ場所は見通しの行 (outlooks/_digest) で、ここの nav は見通しが画面の上へ流れたときにだけ
   上端のバーの下に出す「縮めた切り替え」(ai-horizon コントローラが data-ai-horizon-docked-value を立てる)。見通しが見えている間は隠し、
   同じ期間の列を 2 つ並べない (docs/design-guide.md)。流れの外 (fixed) に置くので、出し入れしても下の中身はずれない。
   見出しへ飛ぶ位置がこの高さを足すよう --summary-height を置く。選んでいるものは枠を濃く (審議会の期間の切り替えと同じ)。
   絞り込みは ai-horizon コントローラが .ai-page の data-ai-horizon-shown-value に書いた期間と違う data-horizon-item を隠すだけ。 */
.ai-page { --summary-height: 44px; }
.ai-horizons {
  position: fixed;
  top: var(--app-bar-height);
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  gap: 4px;
  padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--shadow) 6%, transparent);
  transform: translateY(-110%);
  visibility: hidden;
  transition: transform 0.15s ease, visibility 0s linear 0.15s;
}
.ai-page[data-ai-horizon-docked-value="true"] .ai-horizons { transform: none; visibility: visible; transition: transform 0.15s ease; }
.ai-horizons__tab,
.outlook-digest__all {
  min-width: 3.2rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
:is(.ai-horizons__tab, .outlook-digest__all):hover { color: var(--text); border-color: var(--muted); }
:is(.ai-horizons__tab, .outlook-digest__all)[aria-pressed="true"] { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
:is(.ai-horizons__tab, .outlook-digest__all):focus-visible { outline: 2px solid var(--accent-ai); outline-offset: 1px; }
/* 見通しの「全期間」のボタンは AI ページの中でだけ出す (単独の /outlook には絞る相手がいない)。 */
.outlook-digest__all { display: none; margin-left: auto; }
.ai-page .outlook-digest__all { display: inline-block; }
/* 見通しの軸 (出どころの丸と針) は幅いっぱいに伸ばすと位置が読みにくいので、XL 以上では見通しのカードを 90rem で止める
   (docs/design-guide.md §4「横に間延びさせない」・§8)。下のシナリオ・審議会・パルスは列を増やして埋めるので止めない。 */
@media (min-width: 1600px) {
  .ai-page .outlook-frame > .card { max-width: 90rem; }
}
@media (max-width: 600px) {
  .ai-horizons__tab { flex: 1 1 0; min-width: 0; padding-inline: 2px; white-space: nowrap; }
  /* 8 つのボタンを 375px でも 1 行に収めるため、「全期間」は「全」だけにする (読み上げの名前は aria-label の「全期間」)。 */
  .ai-horizons__rest { display: none; }
}
/* 指で押す端末では期間の切り替えのチップを 36px 以上に (docs/design-guide.md の 8 章)。縮めた切り替えは 6 + 36 + 6 + 線 1 = 49px になるので、
   見出しへ飛ぶ位置 (--summary-height) もその高さにして、飛んだ先の見出しと添え書きを縮めた切り替えの下に隠さない。 */
@media (pointer: coarse) {
  .ai-page { --summary-height: 49px; }
  .ai-horizons__tab, .outlook-digest__all { min-height: 36px; padding-block: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-horizons, .ai-page[data-ai-horizon-docked-value="true"] .ai-horizons,
  .digest-dock, .digest[data-analysis-digest-docked-value="true"] .digest-dock { transition: none; }
}
.ai-page[data-ai-horizon-shown-value="5m"] [data-horizon-item]:not([data-horizon-item="5m"]),
.ai-page[data-ai-horizon-shown-value="10m"] [data-horizon-item]:not([data-horizon-item="10m"]),
.ai-page[data-ai-horizon-shown-value="30m"] [data-horizon-item]:not([data-horizon-item="30m"]),
.ai-page[data-ai-horizon-shown-value="1h"] [data-horizon-item]:not([data-horizon-item="1h"]),
.ai-page[data-ai-horizon-shown-value="4h"] [data-horizon-item]:not([data-horizon-item="4h"]),
.ai-page[data-ai-horizon-shown-value="1d"] [data-horizon-item]:not([data-horizon-item="1d"]),
.ai-page[data-ai-horizon-shown-value="7d"] [data-horizon-item]:not([data-horizon-item="7d"]) { display: none; }
/* 成績の出どころのうち、選んだ期間に答えないもの (マスが「·」) は行ごと出さない。 */
.ai-page[data-ai-horizon-shown-value="5m"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="5m"]),
.ai-page[data-ai-horizon-shown-value="10m"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="10m"]),
.ai-page[data-ai-horizon-shown-value="30m"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="30m"]),
.ai-page[data-ai-horizon-shown-value="1h"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="1h"]),
.ai-page[data-ai-horizon-shown-value="4h"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="4h"]),
.ai-page[data-ai-horizon-shown-value="1d"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="1d"]),
.ai-page[data-ai-horizon-shown-value="7d"] .outlook-scorecard__grid tbody tr:has(> .is-na[data-horizon-item="7d"]) { display: none; }
/* 1 つに絞ったら、シナリオの図はその 1 枚だけを大きく (幅 70rem まで・高さ --chart-h-l)、見出しの数字も文字で出す。 */
.ai-page:not([data-ai-horizon-shown-value="all"]) .ai-ensemble__grid { grid-template-columns: minmax(0, 70rem); }
.ai-page:not([data-ai-horizon-shown-value="all"]) .ai-ensemble .ensemble__chart { height: var(--chart-h-l); }
.ai-page:not([data-ai-horizon-shown-value="all"]) .ai-ensemble__facts { display: inline; }
/* 見通しのまとめ (AI の読み) は絞らずに 7 期間を出し、選んだ期間の行を枠で示す (行がそのまま期間の切り替え)。 */
.ai-page[data-ai-horizon-shown-value="5m"] .outlook-digest__row[data-horizon="5m"],
.ai-page[data-ai-horizon-shown-value="10m"] .outlook-digest__row[data-horizon="10m"],
.ai-page[data-ai-horizon-shown-value="30m"] .outlook-digest__row[data-horizon="30m"],
.ai-page[data-ai-horizon-shown-value="1h"] .outlook-digest__row[data-horizon="1h"],
.ai-page[data-ai-horizon-shown-value="4h"] .outlook-digest__row[data-horizon="4h"],
.ai-page[data-ai-horizon-shown-value="1d"] .outlook-digest__row[data-horizon="1d"],
.ai-page[data-ai-horizon-shown-value="7d"] .outlook-digest__row[data-horizon="7d"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

/* ---- AI 審議会 (ai_council/_panel、AiCouncil) ---------------------------------------------------- */

/* 他のパネルと同じ白地のカード。上段は 決議 (左) と 3 役の立場の目盛り (右)、下段は 3 役のカードを 3 列に並べ、
   狭い画面 (720px 以下) では 1 列に積む。色は既存のトークン (--up / --down / --muted / --border) と .reading--* だけで、
   アクセントは AI 予想の紫とパルスの空色の間の藍。 */
.ai-council { --accent: var(--accent-ai); }
.ai-council__motion { margin: 0; color: var(--muted); font-size: 0.8rem; text-align: right; }
.ai-council__failed { margin: 0; color: var(--down-text); font-size: 0.85rem; overflow-wrap: anywhere; }
/* 予想の期間の切り替え (5 分〜7 日の 7 つ)。期間の名前だけのリンクを横に並べ、選んでいる期間は枠を濃く (期間ごとの数字は見通しの行が持つ)。
   狭い画面では折り返す。管理画面の履歴の絞り込みも同じ見た目。 */
.ai-council__horizons { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ai-council__horizon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}
.ai-council__horizon:hover { color: var(--text); border-color: var(--muted); }
.ai-council__horizon[aria-current="true"] { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.ai-council .ai-council__horizon { font-weight: 700; }
@media (pointer: coarse) {
  .ai-council__horizon { padding: 6px 12px; }
  .ai-council .ai-council__horizon { min-height: 36px; }
}
/* 狭い画面のパネルの切り替えは 7 等分の 1 行にする (折り返して 7 日だけが 2 行目に落ちないように)。管理画面の絞り込みは折り返しのまま。 */
@media (max-width: 600px) {
  .ai-council .ai-council__horizons { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .ai-council .ai-council__horizon { justify-content: center; padding-inline: 0; font-size: 0.78rem; white-space: nowrap; }
}
/* 結論・価格の図・3 役のカードの組み方は、置かれた幅で決める (@container council。docs/design-guide.md の 8 章)。 */
.ai-council__board { container: council / inline-size; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.ai-council__summary {
  display: grid;
  grid-template-columns: minmax(12.5rem, 1fr) 2fr;
  gap: 10px 24px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ai-council__verdict-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ai-council__verdict-wrap .outlook__bar { width: 100%; }
.ai-council__label { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.ai-council__verdict { margin: 0; padding: 2px 14px; font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.ai-council__verdict .num { font-size: 1.1rem; font-weight: 700; }
.ai-council__tally { margin: 0; font-size: 0.85rem; }
.ai-council__unanimous { margin-left: 6px; font-weight: 600; }
/* 結論の数字は 想定の変化率 (価格は吹き出し) と 一致度のメーター (3 本の棒 + 語。% は吹き出し) の 2 つだけ。 */
.ai-council__figures-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ai-council__figures { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px 28px; margin: 0; }
.ai-council__figures dt { margin: 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.ai-council__figures dd { justify-self: start; margin: 0; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.ai-council__agreement { display: inline-flex; align-items: center; gap: 6px; }
.ai-council__agreement-word { font-size: 0.85rem; }
.ai-council__arbiter, .ai-council__evaluation { margin: 0; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.ai-council__evaluation[data-scored="true"] { color: var(--text); }
/* 価格の図。左が安い価格、右が高い価格の 1 本の軸に、役ごとの行 (レンジの帯・想定の終値の点・入口の帯・損切り・目標) と
   注目水準の行を重ね、現在値の縦線を通す。位置はヘルパー (council_map_left) が % で計算する。 */
.ai-council__map { margin: 0; padding: 10px 12px 8px; border: 1px solid var(--border); border-radius: 10px; }
.ai-council__map-lanes { display: flex; flex-direction: column; gap: 6px; }
.ai-council__map-lane { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); align-items: center; gap: 8px; }
.ai-council__map-name { color: var(--muted); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.ai-council__map-track { position: relative; height: 22px; border-radius: 4px; background: color-mix(in srgb, var(--border) 45%, transparent); }
.ai-council__map-lane--levels .ai-council__map-track { height: 16px; background: transparent; }
.ai-council__map-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.7; }
.ai-council__map-range { position: absolute; top: 8px; height: 6px; border-radius: 3px; background: var(--muted); opacity: 0.55; }
.ai-council__map-range--up { background: var(--up); }
.ai-council__map-range--down { background: var(--down); }
.ai-council__map-entry { position: absolute; top: 3px; bottom: 3px; border: 1.5px dashed var(--muted); border-radius: 3px; box-sizing: border-box; }
.ai-council__map-entry--long { border-color: var(--up); }
.ai-council__map-entry--short { border-color: var(--down); }
.ai-council__map-stop, .ai-council__map-target { position: absolute; top: 0; height: 22px; width: 14px; margin-left: -7px; font-size: 0.78rem; line-height: 22px; text-align: center; font-weight: 700; }
.ai-council__map-stop { color: var(--down-text); }
.ai-council__map-target { color: var(--up-text); }
.ai-council__map-close { position: absolute; top: 6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; border: 1.5px solid var(--card); background: var(--muted); }
.ai-council__map-close--positive { background: var(--up); }
.ai-council__map-close--negative { background: var(--down); }
.ai-council__map-level { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--muted); }
.ai-council__map-level--support { background: var(--up); }
.ai-council__map-level--resistance { background: var(--down); }
.ai-council__map-axis { position: relative; height: 1.6rem; margin: 4px 0 0 calc(4.2em + 8px); border-top: 1px solid var(--border); }
.ai-council__map-flat { position: absolute; top: -1px; height: 4px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.ai-council__map-tick { position: absolute; top: 6px; color: var(--muted); font-size: 0.7rem; white-space: nowrap; }
.ai-council__map-tick--min { left: 0; }
.ai-council__map-tick--max { right: 0; }
.ai-council__map-tick--now { transform: translateX(-50%); color: var(--text); font-weight: 700; }
.ai-council__map-legend { margin: 6px 0 0; color: var(--muted); font-size: 0.7rem; }
.ai-council__units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ai-council__unit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--muted);
  border-radius: 10px;
}
.ai-council__unit.is-direction-up { border-top-color: var(--up); }
.ai-council__unit.is-direction-down { border-top-color: var(--down); }
.ai-council__unit.is-direction-flat { border-top-color: var(--muted); }
.ai-council__unit.is-offline { opacity: 0.65; border-style: dashed; }
.ai-council__unit-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; }
.ai-council__unit-name { margin: 0; font-size: 1rem; }
.ai-council__unit-role { margin: 0; color: var(--muted); font-size: 0.75rem; }
.ai-council__vote { align-self: flex-start; margin: 0; padding: 1px 10px; font-size: 1rem; font-weight: 700; }
.ai-council__unit .outlook__bar { width: 100%; }
/* 3 役のカードの頭: 左に向きのピル、右に売買案の向きと R (カードの数字はこれ 1 つ。見送りは待つ理由の短い文)。 */
.ai-council__unit-call { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.ai-council__unit-trade { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; font-size: 0.85rem; }
.ai-council__unit-trade .reading { font-weight: 700; }
.ai-council__r { font-weight: 700; }
.ai-council__trade-note { color: var(--muted); font-size: 0.78rem; }
/* 「数字で見る」: 確率・想定・レンジ・確信度・裁定役の支持の 2 列の表、経路の文、売買案の表。 */
.ai-council__unit-figures { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 3px 8px; margin: 6px 0; }
.ai-council__unit-figures div { display: contents; }
.ai-council__unit-figures dt { margin: 0; color: var(--muted); font-weight: 600; }
.ai-council__unit-figures dd { margin: 0; overflow-wrap: anywhere; }
.ai-council__unit-figures dd small { color: var(--muted); font-size: 0.72rem; }
.ai-council__numbers .ai-council__trade { margin-top: 6px; }
.ai-council__path { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; overflow-wrap: anywhere; }
/* 売買案。向き (ロング / ショート) と R を見出しに、入口・損切り・目標・手仕舞いを 2 列の表で。見送りは 1 行。 */
.ai-council__trade { padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--muted); border-radius: 8px; font-size: 0.8rem; }
.ai-council__trade.is-long { border-left-color: var(--up); }
.ai-council__trade.is-short { border-left-color: var(--down); }
.ai-council__trade-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.ai-council__trade-head .reading { font-weight: 700; }
.ai-council__trade-head .num { color: var(--muted); font-weight: 700; }
.ai-council__trade-rows { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 3px 8px; margin: 0; }
.ai-council__trade-rows div { display: contents; }
.ai-council__trade-rows dt { margin: 0; color: var(--muted); font-weight: 600; }
.ai-council__trade-rows dd { margin: 0; overflow-wrap: anywhere; }
.ai-council__trade-rows dd > .num { font-weight: 700; }
.ai-council__trade-rows dd small { display: block; color: var(--muted); font-size: 0.72rem; }
.ai-council__trade-rows dd small.num { display: inline; margin-left: 4px; }
.ai-council__thesis { margin: 2px 0 0; font-size: 0.88rem; line-height: 1.6; overflow-wrap: anywhere; }
.ai-council__unit-score { margin: 0; font-size: 0.78rem; }
.ai-council__levels small { color: var(--muted); }
.ai-council__scorecard { overflow-wrap: anywhere; }
.ai-council-history__evaluation { white-space: nowrap; }
.ai-council-history td[data-label="期間"], .ai-council-history td[data-label="状態"] { white-space: nowrap; }
.ai-council__thesis--offline { color: var(--muted); }
.ai-council__more { font-size: 0.82rem; }
.ai-council__more summary { cursor: pointer; color: var(--accent-text); font-size: 0.78rem; }
.ai-council__more-heading { margin: 6px 0 2px; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.ai-council__list { margin: 0; padding-left: 1.2em; overflow-wrap: anywhere; }
.ai-council__list li + li { margin-top: 2px; }
.ai-council__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.75rem;
}
.ai-council__footer a { color: var(--accent-text); text-decoration: none; }
.ai-council__footer a:hover { text-decoration: underline; }
.ai-council .num { font-variant-numeric: tabular-nums; }
.ai-council-history__headline { display: block; color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
/* 3 役のカードは 1 枚 18rem 前後が要るので、3 列に並べる幅が無ければ (iPad 縦・スマホ) 1 列に積む。 */
@container council (max-width: 54rem) {
  .ai-council__units { grid-template-columns: minmax(0, 1fr); }
}
/* 結論の 2 段 (向き | 数字) は狭いと縦に積む。 */
@container council (max-width: 40rem) {
  .ai-council__summary { grid-template-columns: minmax(0, 1fr); }
}
/* 価格の図の目盛り: 狭い幅では現値の札を 2 段目に下ろし、両端の価格と重ねない (広い幅では、現値が端 15% 以内のときその端の札を出さない)。 */
@container council (max-width: 40rem) {
  .ai-council__map-axis { height: 2.6rem; }
  .ai-council__map-tick--now { top: 1.45rem; }
}
@media (max-width: 600px) {
  .ai-council__motion { text-align: left; }
}

/* ---- 予想の成績と学習 (/forecast_lab、ForecastLab) ------------------------------------------------ */
.forecast-lab { --accent: var(--accent-pulse); }
.forecast-lab__meta { margin: 0; color: var(--muted); font-size: 0.75rem; text-align: right; }
.forecast-lab__models { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 10px 14px; margin-top: 8px; }
.forecast-lab__model { padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.forecast-lab__model-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.forecast-lab__status { padding: 1px 8px; border-radius: 8px; font-size: 0.75rem; }
.forecast-lab__call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 6px; }
.forecast-lab__note { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; }
.forecast-lab__facts { display: grid; gap: 2px; margin: 6px 0 0; font-size: 0.75rem; }
.forecast-lab__facts div { display: flex; gap: 6px; }
.forecast-lab__facts dt { flex: 0 0 7rem; color: var(--muted); }
.forecast-lab__facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.forecast-lab__scroll { margin-top: 12px; overflow-x: auto; }
.forecast-lab__table { border-collapse: collapse; font-size: 0.8rem; }
.forecast-lab__table caption { margin-bottom: 4px; color: var(--muted); font-size: 0.75rem; text-align: left; }
.forecast-lab__table th,
.forecast-lab__table td { padding: 3px 12px 3px 0; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.forecast-lab__table thead th { color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.forecast-lab__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.forecast-lab__table--small { margin-top: 10px; }
.forecast-lab__good { color: var(--up-text); }
.forecast-lab__bad { color: var(--down-text); }
.forecast-lab__reliability { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 20px; }
/* 図 (forecast_lab/_panel)。棒・メーターは見通しの成績の部品 (outlook-scorecard__skill / __meter / __grid) をそのまま使い、ここでは並べ方だけ足す。 */
.forecast-lab__heading { margin: 14px 0 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.forecast-lab__heading small { font-weight: normal; }
.forecast-lab__label { margin: 8px 0 2px; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.forecast-lab__label small { font-weight: normal; }
.forecast-lab__bar-row { display: grid; grid-template-columns: 5.5rem minmax(3rem, 1fr) 6.5rem; align-items: center; gap: 0 8px; font-size: 0.75rem; }
.forecast-lab__bar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 効いている材料の名前 (ForecastFeatures.label の日本語。キーは吹き出し)。切らずに 2 行まで折り返し、名前の列だけ広げる。 */
.forecast-lab__feature { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.forecast-lab__bar-row:has(> .forecast-lab__feature) { grid-template-columns: 8rem minmax(2rem, 1fr) auto; }
.forecast-lab__bar-value { min-width: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 添え書きの small は画面の幅に収める (1440px で「60 回 (単価が無いので数えない)」が 148px で右端をはみ出した)。 */
.forecast-lab__bar-value small { max-width: 100%; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.forecast-lab__skill { margin: 4px 0; }
.forecast-lab .outlook-scorecard__skill-fill.is-flat { left: 50%; background: var(--muted); }
.forecast-lab__gauge { margin-top: 8px; font-size: 0.72rem; }
.forecast-lab__gauge-label { color: var(--muted); font-weight: 600; }
.forecast-lab__gauge-label small { font-weight: normal; font-variant-numeric: tabular-nums; }
.forecast-lab__progress.is-done .outlook-scorecard__meter-fill { background: var(--up); }
.forecast-lab__more { margin-top: 6px; }
.forecast-lab__more summary { color: var(--muted); font-size: 0.72rem; cursor: pointer; }
.forecast-lab__subtitle { margin: 14px 0 4px; font-size: 0.85rem; }
.forecast-lab__experiments { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 10px 20px; margin-top: 10px; }
.forecast-lab__experiment { min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.forecast-lab__experiment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.forecast-lab__experiment-head small { color: var(--muted); font-variant-numeric: tabular-nums; }
.forecast-lab__experiment .forecast-lab__bars { margin-top: 6px; }
.forecast-lab__experiment-details summary { color: var(--muted); font-size: 0.72rem; cursor: pointer; margin-top: 6px; }
.forecast-lab__experiment-details[open] .forecast-lab__note { margin-top: 4px; }
.forecast-lab__experiment-details { min-width: 0; }
.forecast-lab__diff-lines { margin: 4px 0 0; padding: 6px 8px; font-size: 0.72rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 6px; }
.forecast-lab__diff-lines span { display: block; }
.forecast-lab__diff-removed { color: var(--down-text); }
.forecast-lab__diff-added { color: var(--up-text); }
.forecast-lab__grid tbody th small { color: var(--muted); font-weight: normal; }
.forecast-lab__curves { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 10px 20px; }
.forecast-lab__curve { margin: 0; min-width: 0; }
.forecast-lab__curve figcaption { font-size: 0.75rem; font-weight: 600; }
.forecast-lab__curve figcaption small { color: var(--muted); font-weight: normal; }
.forecast-lab__chart { display: block; width: 100%; max-width: 16rem; height: auto; overflow: visible; }
.forecast-lab__chart-over { fill: color-mix(in srgb, var(--down) 8%, transparent); }
.forecast-lab__chart-grid { stroke: var(--border); stroke-width: 1; }
.forecast-lab__chart-ideal { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.forecast-lab__chart-tick, .forecast-lab__chart-axis, .forecast-lab__chart-zone { fill: var(--muted); font-size: 11px; }
.forecast-lab__chart-zone { font-size: 11px; font-weight: 600; opacity: 0.8; }
/* スマホの幅では 2 列に並んで図が 0.92 倍になり、11 だと画面の上で 10.1px になるので、座標系の中で 12 に上げる。 */
@media (max-width: 600px) {
  .forecast-lab__chart-tick, .forecast-lab__chart-axis, .forecast-lab__chart-zone { font-size: 12px; }
}
.forecast-lab__chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.forecast-lab__chart-point { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.forecast-lab__chart-point:hover { stroke: var(--text); }
.forecast-lab__details { margin-top: 14px; }
.forecast-lab__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; color: var(--muted); font-size: 0.75rem; }
.forecast-lab__footer a { color: var(--accent-text); text-decoration: none; }
.forecast-lab__footer a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .forecast-lab__meta { text-align: left; }
  .forecast-lab__curves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
}

/* ---- 管理画面 (/admin、Admin::AiCallsController) ---------------------------------------------------- */

.admin-calls + .admin-calls { margin-top: 16px; }
.admin-calls__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.admin-calls__head h2 { margin: 0; font-size: 1rem; }
.admin-calls__windows { display: flex; flex-wrap: wrap; gap: 6px; }
/* リンクのほか、ボタン (バッチの「見に行く」) にも付く。地を透明にしておかないと、ボタンはブラウザの既定の明るい地のままで、
   ダークで灰の字が 1.8:1 になる。 */
.admin-calls__window {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: none;
}
button.admin-calls__window { cursor: pointer; }
.admin-calls__window[aria-current="true"] { background: var(--text); border-color: var(--text); color: var(--on-fill); }
/* 履歴のタブ (AI 予想・AI 審議会・AI パルス) の行から、その回の呼び出しのページへのリンク。失敗した呼び出しは赤。 */
.admin-calls__links { white-space: nowrap; }
.admin-call-links { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.8rem; }
.admin-call-link--error { color: var(--down-text); }
/* 列が多いので、狭い画面ではセルを折り返さずに横へスクロールさせる (失敗の理由だけは折り返す)。 */
.admin-calls th,
.admin-calls td { white-space: nowrap; }
.admin-calls td.admin-calls__error { white-space: normal; }
.admin-calls__summary tfoot th,
.admin-calls__summary tfoot td { border-bottom: none; font-weight: 600; }
.admin-calls__errors { color: var(--down-text); }
.admin-calls__list tr.is-error td,
.admin-calls__list tr.is-error th { background: color-mix(in srgb, var(--down) 6%, transparent); }
.admin-calls__list code { font-size: 0.78rem; }
/* モデル名 (gpt-5-2025-08-07 など)。表の列を広げすぎないよう、長い名前は折り返す。 */
.admin-call__model { font-size: 0.78rem; overflow-wrap: anywhere; }
/* AI の呼び先 (/admin/ai_endpoints、Admin::AiEndpointsController)。割り当てた行は色を付け、操作のボタンは右に寄せる。 */
.ai-endpoints tr.is-active td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ai-endpoints .alert-table__actions { align-items: center; }
.ai-endpoints code { font-size: 0.8rem; }
/* URL と「割り当てた機能」は長いので、広い画面でも折り返して表を囲みの幅に収める (.admin-calls の nowrap のままだと 1440px で表が 1,527px になり、
   右端の操作の列 (編集・削除) が囲みの外へ出て、横に送らないと押せない)。操作の列は折り返さない。 */
.ai-endpoints td.ai-endpoints__wrap { white-space: normal; }
/* API トークン (/admin/api_tokens) の発行した値。狭い画面でもカードからはみ出さずに折り返す (選んで写せるよう 1 つの code のまま)。 */
.api-tokens__value { overflow-wrap: anywhere; user-select: all; }
.ai-endpoints code { overflow-wrap: anywhere; }
.ai-endpoints__form label small { color: var(--muted); }
.ai-endpoints__assign input[type="submit"] { margin-top: 12px; }
.ai-endpoints__assign select { max-width: 100%; }
/* 会員 (/admin/members、Admin::Members::IndexComponent)。帯は概要と同じ KPI のタイル (名前はリンクにしない)。表は .admin-calls の nowrap のまま 1 行に保ち、
   メールアドレス (最大 22rem)・手付けの理由・付与の行だけを折り返す (メールアドレスまで 1 行に保つと、104 文字のアドレスで 1440px でも表が囲みの外へ出て、
   状態と操作の列が横に送らないと見えなかった)。生きている Stripe の契約の行の「Stripe で管理」は灰色の文字 (ボタンに見せない)。 */
.admin-kpi__name { color: var(--text); font-size: 0.82rem; font-weight: 700; line-height: 1.35; }
.admin-kpis__tiles.admin-members__kpis { grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr)); }
.admin-members__kpis .digest-tile__figure { margin: 0; }
.admin-kpis + .admin-members { margin-top: 16px; }
.admin-kpi__sub { margin: 0; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.admin-members__order { color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.admin-members__table td, .admin-members__table th { vertical-align: top; }
/* 付与の行を開いたとき・付け外しのあと (#user_<id>) の飛び先の行を、上端のバーの下に見せる。 */
.admin-members__table tbody tr { scroll-margin-top: calc(var(--app-bar-height) + 12px); }
/* 行の頭のメールアドレスは列見出し (.alert-table th の小さな灰色) ではなく、ほかのセルと同じ字にする。長いアドレスはどこででも折り返す。 */
.admin-members__table .admin-members__email { max-width: 22rem; color: var(--text); font-size: inherit; font-weight: normal; text-align: left;
  white-space: normal; overflow-wrap: anywhere; }
/* 手付けの理由は 2 行で切る (全文は吹き出し。data-tip)。 */
.admin-members__note { display: -webkit-box; max-width: 16rem; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  color: var(--muted); font-size: 0.75rem; white-space: normal; overflow-wrap: anywhere; }
.admin-members__stripe { color: var(--muted); font-size: 0.78rem; }
.admin-members__actions { text-align: right; }
.admin-members__toggle { font-size: 0.85rem; }
.admin-members__revoke { margin: 6px 0 0; }
.admin-members__revoke button { background: transparent; color: var(--down-text); border-color: var(--down); }
/* 付与の行 (会員の行のすぐ下の全幅の行)。上の会員の行と 1 つに見えるよう、間の罫線を消して淡い地を敷く。頭に相手のメールアドレス、
   その下にフォームを横に並べる箱 (.admin-members__grant-forms。入りきらなければ折り返す)。 */
.admin-members__table tr:has(+ .admin-members__grant) > * { border-bottom-color: transparent; }
.admin-members__table .admin-members__grant > td { padding: 4px 8px 12px; background: color-mix(in srgb, var(--accent) 6%, transparent); white-space: normal; text-align: left; }
.admin-members__grant-head { margin: 0 0 8px; overflow-wrap: anywhere; }
.admin-members__grant-head span { margin-right: 6px; color: var(--muted); font-size: 0.8rem; }
.admin-members__grant-forms { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 32px; }
.admin-members__grant-forms .alert-form input:not([type=submit]) { min-width: 0; }
/* 課金が有効なときの、利用者の番号と Stripe の顧客・契約の id の並び (Stripe のダッシュボードへ写すので等幅の地の文) と、読み直しのフォーム。
   読み直しのフォームの添え書きは、欄とボタンの下の 1 行に回す。 */
.admin-members__ids { margin: -4px 0 8px; color: var(--muted); font: 0.78rem/1.4 var(--mono); overflow-wrap: anywhere; }
.admin-members__resync input[name=subscription_id] { font-family: var(--mono); }
.admin-members__hint { flex-basis: 100%; color: var(--muted); font-size: 0.75rem; }
@media (max-width: 600px) {
  .admin-members__table .admin-members__email,
  .admin-members__note { max-width: none; }
  .admin-members__table tr:has(+ .admin-members__grant) { border-bottom: none; }
  .admin-members__table .admin-members__grant > td { padding: 8px; border-radius: 8px; }
}
.ai-endpoints__check span { flex-direction: row; display: flex; align-items: center; gap: 4px; }
/* Message Batches API が使える呼び先の印 (admin_ai_endpoint_batch)。 */
.ai-endpoints__batch { padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.admin-calls__error { min-width: 16em; max-width: 40em; color: var(--down-text); font-size: 0.78rem; overflow-wrap: anywhere; }
/* 呼び出しの集計の図 (admin/ai_calls/index): 回数・失敗のメーター (赤)・トークンの積み上げ棒 (入力 | 出力 | 推論)・所要時間の棒 (平均と最長の縦線)・最後の点。
   棒の長さは表の中で最も多い・長い行に対する量 (ヘルパーが style に書く)。数字は吹き出しと折りたたみの数表 (.admin-calls__numbers)。 */
.admin-calls__summary td, .admin-calls__summary th { vertical-align: middle; }
.admin-calls__summary th .admin-call__model { display: block; margin-top: 2px; color: var(--muted); font-weight: normal; }
.admin-calls__count { font-weight: 700; }
.admin-calls__fail-meter .outlook-scorecard__meter-fill { background: var(--down); }
.admin-calls__fail.has-errors .admin-meter__value { color: var(--down-text); }
/* flow-root にして、狭い画面のカード行 (stack-table) で左に浮かせた見出しの横に並べる (見出しの上に棒が重ならない)。 */
.admin-calls__tokens { display: flow-root; min-width: 10rem; }
.admin-calls__duration .outlook-scorecard__meter { margin: 0; }
.admin-calls__duration-meter .outlook-scorecard__meter-fill { background: var(--muted); }
.admin-calls__last { text-align: center; }
.admin-calls__more { margin-top: 10px; }
/* ページの頭 (admin/shared/_header): タブの中の 2 段目の切り替えのチップ (.filter-chips) → 戻り先 → 見出し。 */
.admin-header__back { margin: 0 0 4px; font-size: 0.85rem; }
/* 履歴と呼び出しの一覧の日付の欄 (admin/shared/_date_filter) と、下端のページ送り (_pager)。 */
.admin-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 0.8rem; }
.admin-date__label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.admin-date input[type="date"], .admin-date input[type="search"] { padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--input); color: var(--text); font: inherit; }
.admin-date__submit { padding: 2px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.admin-date__submit:hover { border-color: var(--muted); }
.admin-pager { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 0.85rem; }
.admin-pager a[rel="next"] { margin-left: auto; }
/* 履歴 (AI 予想・AI 審議会・AI パルス・見通し。AdminHelper の「履歴」): カードの頭 (日付の欄と利用者向けのパネルへのリンク)、表の上の期間ごとの帯
   (admin/shared/_strips)、判定のマス (.admin-verdict)、サマリーの折りたたみ。色はトークンだけ (§6): 帯の棒とマスの色は向き (--up / --down / --muted)、
   濃さは採点 (的中 = 濃い / 外れ = 薄い / 採点待ち・評価不能 = 中間。帯の棒は利用者の AI パルスの帯と同じ 1 / 0.35 / 0.6)。 */
.admin-history__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.admin-history__panel { font-size: 0.85rem; white-space: nowrap; }
.admin-history__table th, .admin-history__table td { vertical-align: middle; }
.admin-strips { display: grid; gap: 2px; max-width: 100rem; margin: 0 0 12px; }
.admin-strips__row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: center; gap: 8px; }
.admin-strips__label { color: var(--muted); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.admin-strips__svg { display: block; width: 100%; height: 26px; }
.admin-strips__base { stroke: var(--border); }
.admin-strips__bar--up { fill: var(--up); }
.admin-strips__bar--down { fill: var(--down); }
.admin-strips__bar--flat { fill: var(--muted); }
.admin-strips__bar--miss { opacity: 0.35; }
.admin-strips__bar--pending { opacity: 0.6; }
.admin-strips a:hover .admin-strips__bar { opacity: 1; }
.admin-strips__legend { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }
/* 判定のマス (admin_verdict_cell)。地は向きの色を濃さ (--verdict-fill) の割合でカードの地に混ぜる (ダークは成績のマスと同じ --tile-* で伸ばす)。 */
.admin-history__verdict { text-align: center; }
.admin-verdict {
  --verdict: var(--muted);
  --verdict-fill: 16%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  min-height: 2.3rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--verdict) calc(var(--tile-floor) + var(--verdict-fill) * var(--tile-scale)), var(--card));
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.admin-verdict--up { --verdict: var(--up); }
.admin-verdict--down { --verdict: var(--down); }
.admin-verdict--hit { --verdict-fill: 34%; }
.admin-verdict--miss { --verdict-fill: 7%; }
.admin-verdict__main { font-size: 0.8rem; font-weight: 700; }
/* 印 (的中・外れ・待ち) は色を敷いた札の上なので、灰にせず本文の色 (ダークの札の上で灰は 4.1:1)。的中だけ太字。 */
.admin-verdict__mark { color: var(--text); font-size: 0.7rem; }
.admin-verdict--hit .admin-verdict__mark { color: var(--text); font-weight: 700; }
/* AI 予想のサマリー: 1 行に切り、押すと全文 (summary をそのまま折り返す)。 */
.admin-history__fold { max-width: 28rem; text-align: left; }
.admin-history__fold > summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; list-style: none; }
.admin-history__fold > summary::-webkit-details-marker { display: none; }
.admin-history__fold[open] > summary { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
/* 帯の棒・1 回のページの「←」で移った行 (#ai_council_12・呼び出しの一覧の #call-34) は、アプリのバーの下に止め、地を薄く塗って示す。 */
.admin-history__table tbody tr, .admin-calls__list tbody tr { scroll-margin-top: calc(var(--app-bar-height) + 12px); }
.admin-history__table tbody tr:target > *, .admin-calls__list tbody tr:target > * { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* 狭い画面のカード行 (stack-table) では、空のセル (成功した回の「失敗の理由」) を出さない。カード行は横にはみ出さないので、表の囲みを横に流さない
   (読み上げ用に隠した列見出しの 1px で囲みが「流せる」ことになり、右端が薄れの手掛かり (.scroll-cue) で消えるのを防ぐ)。 */
@media (max-width: 600px) {
  .admin-calls__list.stack-table td:empty { display: none; }
  :is(.admin-calls, .admin-scores, .admin-history) .market-pulse__scroll:has(> .stack-table) { overflow-x: visible; }
  .admin-calls__tokens, .admin-calls__duration, .admin-meter { min-width: 0; }
  /* 履歴のカード行では、判定のマスを列 (--verdict-columns。AI 予想は資産ごとの 2 列、ほかは 3 列) に並べ、列の名前はマスの上に小さく出す。
     ほかのセル (時刻・状態・呼び出しなど) は 1 行ずつ。 */
  .admin-history__table.stack-table tr { display: grid; grid-template-columns: repeat(var(--verdict-columns, 3), minmax(0, 1fr)); gap: 2px 6px; }
  .admin-history__table.stack-table tr > :not(.admin-history__verdict) { grid-column: 1 / -1; }
  .admin-history__table.stack-table td.admin-history__verdict { padding: 4px 0 0; text-align: center; }
  .admin-history__table.stack-table td.admin-history__verdict::before { display: block; float: none; margin: 0 0 2px; text-align: center; }
  .admin-history__table--forecasts { --verdict-columns: 2; }
  .admin-verdict { width: 100%; }
  .admin-strips__row { grid-template-columns: 3.6rem minmax(0, 1fr); gap: 6px; }
  .admin-history__fold { max-width: none; }
  /* 呼び出しへのリンクの並びは、左に浮かせた見出しの横の幅で折り返す (ブロックの flex にして浮きを避けさせる。inline-flex だとセルの幅いっぱいを取ってはみ出す)。 */
  .stack-table .admin-call-links { display: flex; justify-content: flex-end; }
  /* 呼び先の表のカード行では、URL とモデル名をカードの幅で折り返す (広い画面の表では .admin-calls の nowrap で 1 行に保つ)。 */
  .ai-endpoints.stack-table td { white-space: normal; }
  .ai-endpoints.stack-table code { overflow-wrap: anywhere; }
}
/* 指で押す端末では日付の欄とボタンを 36px に、文字を 16px にする (16px 未満だと iOS がフォーカスで拡大する)。 */
@media (pointer: coarse) {
  .admin-date input[type="date"], .admin-date__submit { min-height: 36px; font-size: 16px; }
}
.admin-status { display: inline-block; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up-text); font-size: 0.75rem; white-space: nowrap; }
.admin-status--error { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down-text); }
/* バッチ (admin/ai_batches) の途中の状態 (積んでいる・送った・同期に落とした) と、expired / fallback の率が警告に当たる機能の行。 */
.admin-status--muted { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }
.ai-batches tr.is-warning td,
.ai-batches tr.is-warning th { background: color-mix(in srgb, var(--hot) 8%, transparent); }
.ai-budgets__delivery { margin-top: 4px; }
.admin-call__facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 0.9rem; }
.admin-call__facts dt { color: var(--muted); }
.admin-call__facts dd { margin: 0; overflow-wrap: anywhere; white-space: normal; }
.admin-call__rerun { margin-top: 12px; }
.admin-call__size { color: var(--muted); font-size: 0.8rem; }
.admin-call__label { margin: 14px 0 4px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.admin-call__label:first-of-type { margin-top: 0; }
/* 1 回ぶんの入力と出力。1 行が長い JSON と文なので 60rem で止める (§8)。 */
.admin-call__pre {
  max-width: 60rem;
  max-height: 32rem;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--muted) 6%, transparent);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-call__raw { margin-top: 14px; font-size: 0.85rem; }
.admin-call__raw summary { color: var(--accent-text); cursor: pointer; }
.admin-call__raw .admin-call__pre { margin-top: 8px; }

/* 成績の図 (AI の機能の成績・急変・呼び出しの集計。AdminHelper の「成績の図」)。見通しの成績の部品 (.outlook-scorecard__meter・__cell・__results) を
   そのまま使い、ここでは並べ方と、メーターの右の割合・積み上げ棒の区画の色・マスのリンクだけを足す。色はトークンだけ (§6)。 */
.admin-scores + .admin-scores, .admin-calls + .admin-scores, .admin-scores + .admin-calls { margin-top: 16px; }
/* 区画を 1 つずつ Turbo Frame で読む管理画面のページ (AI の機能の成績・バッチの一覧・予想の成績と学習) は、区画どうしではなく
   フレーム (.admin-frame。Admin::BaseController::FRAME_CLASS) どうしの間を空ける (別々のフレームに入った区画には上の「+」が効かない)。 */
.admin-frame { display: block; }
.admin-frame + .admin-frame { margin-top: 16px; }
.admin-scores__table { width: 100%; max-width: 64rem; border-collapse: collapse; font-size: 0.8rem; }
.admin-scores__table th, .admin-scores__table td { padding: 6px 14px 6px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.admin-scores__table thead th { padding-top: 0; color: var(--muted); font-size: 0.72rem; font-weight: normal; white-space: nowrap; }
.admin-scores__table tbody th { font-weight: 600; white-space: nowrap; }
.admin-scores__table td:last-child { padding-right: 0; }
.admin-scores__table--council { max-width: 80rem; }
.admin-scores__grid tbody th { white-space: nowrap; }
.admin-scores__more { margin-top: 10px; }
/* 的中率のメーターと右の割合 (admin_rate_meter)。件数が足りなければ薄く。 */
.admin-meter { display: grid; grid-template-columns: minmax(5rem, 1fr) 2.8rem; align-items: center; gap: 8px; min-width: 9rem; }
.admin-meter .outlook-scorecard__meter { margin: 0; }
/* 所要時間の棒の右の平均 (「850 ms」「67.5 s」) は % より長いので、数字の列を広げる。 */
.admin-meter.admin-calls__duration { grid-template-columns: minmax(5rem, 1fr) 3.8rem; }
.admin-meter__value { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.admin-meter.is-thin .outlook-scorecard__meter { opacity: 0.5; }
.admin-meter.is-thin .admin-meter__value { color: var(--muted); font-weight: 400; }
/* 役ごとの売買案の積み上げ棒と R の合計。 */
.admin-scores__unit { min-width: 10rem; }
.admin-scores__unit .admin-bar { margin-bottom: 2px; }
.admin-scores__r { font-size: 0.78rem; font-weight: 700; }
.admin-scores__none { color: var(--muted); }
/* 積み上げ棒の区画の色: 向きと良し悪し (up / down / flat)、結果の無いもの (none: 未約定)、急変の 続いた / 横ばい / 戻した (odds-*。利用者の急変の確率のバーと同じ色)、
   向きの無い量 (muted / text / accent: トークンの 入力 | 出力 | 推論)。 */
.admin-bar-part--up { border-top-color: var(--up); }
.admin-bar-part--down { border-top-color: var(--down); }
.admin-bar-part--flat, .admin-bar-part--muted { border-top-color: var(--muted); }
.admin-bar-part--none { border-top-color: var(--border); }
.admin-bar-part--odds-hot { border-top-color: var(--odds-hot); }
.admin-bar-part--odds-neutral { border-top-color: var(--odds-neutral); }
.admin-bar-part--odds-calm { border-top-color: var(--odds-calm); }
.admin-bar-part--text { border-top-color: var(--text); }
.admin-bar-part--accent { border-top-color: var(--accent); }
/* 狙いの帯つきのメーター (admin_band_meter。横ばいの幅の検証の「実績の横ばい」): 帯は破線の枠、縦線は狙い、帯の外の実績は橙。 */
.admin-band-meter__band { position: absolute; top: -3px; bottom: -3px; border: 1px dashed var(--muted); border-radius: 3px; }
.admin-band-meter .outlook-scorecard__meter-fill.is-off { background: var(--hot); }
/* 見通しの成績のカードの頭: 窓のチップ (絞り込みのチップの 1 段) と集計の時刻。見出しはページの h1。 */
.outlook-scorecard__head { align-items: center; }
.outlook-scorecard__head .filter-chips { margin: 0; }
/* ヒートマップのマスをリンクにしたとき (押すとその履歴へ。吹き出しはリンクに付く)。マスいっぱいを押せるようにし、文字の色はマスのまま。 */
.admin-cell-link { display: flex; align-items: center; justify-content: center; min-height: 2.2rem; border-radius: 6px; color: inherit; text-decoration: none; }
.admin-cell-link:hover { box-shadow: inset 0 0 0 1px var(--text); }

/* 概要 (/admin、admin/dashboard と AdminOverview)。KPI のタイルを 3 群 (AI の呼び出し・機能の鮮度・成績と学習) に並べる。
   タイルは今の地合いのタイル (.digest-tile: 名前と鮮度の点 → 数字 1 つと窓の札 → 高さ 40px のミニ図) をそのまま使い、ここでは並べ方と
   数字の大きさだけを足す。列は文字に比例させた 14rem を下限に増やし (4K でも 1 枚が間延びしない)、全体は 100rem で止める (§8)。
   スマホ (S) は 2 列 (今の地合いのタイルと同じ)。 */
.admin-kpis { max-width: 100rem; }
.admin-kpis + .admin-kpis { margin-top: 20px; }
.admin-kpis__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0 0 8px; }
.admin-kpis__head h2 { margin: 0; font-size: 1rem; }
.admin-kpis__head small { color: var(--muted); font-size: 0.72rem; font-weight: normal; }
.admin-kpis__head a { font-size: 0.85rem; white-space: nowrap; }
.admin-kpis__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.admin-kpi .digest-tile__value { font-size: 1.4rem; line-height: 1.2; }
/* 一時停止中の AI (スキーマの不一致が続いて止めている用途・モデル)。注意の橙の左の線で AI の欄の頭に出し、右に解除のボタン。 */
.admin-paused { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--hot); border-left-width: 4px; border-radius: 6px; background: color-mix(in srgb, var(--hot) 10%, transparent); font-size: 0.85rem; }
.admin-paused__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.admin-paused__item strong { color: var(--hot-text); }
.admin-paused__reason { color: var(--muted); overflow-wrap: anywhere; }
.admin-paused__reset { margin: 0; }
/* プロンプトの実験: 期間ごとの判定までのペアの進み具合 (見通しの成績のメーター) を 3 段。ミニ図と同じ高さに収める。 */
.admin-kpi__meters { display: grid; align-content: center; gap: 4px; height: 40px; margin-top: auto; }
.admin-kpi__meter { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) 3.6rem; align-items: center; gap: 6px; font-size: 0.7rem; }
.admin-kpi__meter-label { color: var(--muted); font-weight: 700; }
.admin-kpi__meter .outlook-scorecard__meter { height: 6px; margin: 0; }
.admin-kpi__meter small { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  .admin-kpis__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-kpi .digest-tile__value { font-size: 1.15rem; }
}

/* ---- オンチェーン・インテリジェンスのパネル (/onchain/*、分析ページの「オンチェーン・インテリジェンス」。perps と polymarket は公開 API) ---- */
/* 5 つの Turbo Frame を 2〜3 列 (狭ければ 1 列) に並べる。各フレームの中身は機能ごとの部分テンプレートが .card で描く。
   カードは中身の高さのまま上に揃える (隣の長いカードに合わせて引き伸ばすと、短いカードの下に大きな空きの枠が残る)。 */
.onchain-panels { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr)); align-items: start; }
.onchain-frame { display: block; min-width: 0; }
.onchain-card__summary { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.onchain-card__summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.onchain-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.onchain-table th, .onchain-table td { padding: 4px 6px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.onchain-table th:first-child, .onchain-table td:first-child { text-align: left; overflow: hidden; text-overflow: ellipsis; max-width: 16em; }
.onchain-table thead th { color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.onchain-table .is-positive { color: var(--up-text); }
.onchain-table .is-negative { color: var(--down-text); }
.onchain-note { color: var(--muted); font-size: 0.75rem; margin: 8px 0 0; }
/* 0 を中心に左右へ伸ばす横棒 (発散棒、OnchainHoldingsHelper#onchain_diverge)。保有者の区分の変化・大口の出入りの準備高の変化・
   Hyperliquid のロング / ショートが使う。長さは --size (片側いっぱいに対する %、0〜100)、向きは .is-right / .is-left、
   色は .is-up (上昇色) / .is-down (下落色)。0 の線を軌道の真ん中に引き、どの行でも同じ位置にそろえる。 */
.onchain-diverge { display: block; position: relative; height: 10px; min-width: 3rem; border-radius: 2px; background: color-mix(in srgb, var(--border) 70%, transparent); }
.onchain-diverge::before { content: ""; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--muted); }
.onchain-diverge__bar { position: absolute; top: 0; bottom: 0; width: calc(var(--size, 0) * 0.5%); min-width: 1px; }
.onchain-diverge__bar.is-right { left: 50%; border-radius: 0 2px 2px 0; }
.onchain-diverge__bar.is-left { right: 50%; border-radius: 2px 0 0 2px; }
.onchain-diverge__bar.is-up { background: var(--up); }
.onchain-diverge__bar.is-down { background: var(--down); }
/* 真ん中の順位から左右に伸ばす順位棒 (OnchainHoldingsHelper#onchain_ranked_cell)。大口の出入り (流入が左・流出が右) と
   Hyperliquid (ショートが左・ロングが右) が使う。行は 左のます | 順位 | 右のます で、ますの中は名前と金額の 1 行の下に棒。
   棒は順位の側から外へ伸ばし、長さは --size (ますの幅に対する %)。棒の色の既定は分類色の淡い色で、向きや種類の色は各パネルが当てる。 */
.onchain-ranked { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.onchain-ranked__row { display: grid; grid-template-columns: minmax(0, 1fr) 1.75rem minmax(0, 1fr); align-items: end; }
.onchain-ranked__no { align-self: center; color: var(--muted); font-size: 0.72rem; text-align: center; font-variant-numeric: tabular-nums; }
.onchain-ranked__cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.75rem; }
.onchain-ranked__cell--left { text-align: right; }
.onchain-ranked__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onchain-ranked__name { color: var(--text); font-weight: 500; }
.onchain-ranked__value { color: var(--muted); font-variant-numeric: tabular-nums; }
.onchain-ranked__track { position: relative; display: block; height: 8px; }
.onchain-ranked__bar { position: absolute; top: 0; bottom: 0; width: calc(var(--size, 0) * 1%); min-width: 1px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.onchain-ranked__cell--left .onchain-ranked__bar { right: 0; border-radius: 2px 0 0 2px; }
.onchain-ranked__cell--right .onchain-ranked__bar { left: 0; border-radius: 0 2px 2px 0; }

/* 確率・見立て・計画を出すページの下の免責の 1 文 (shared/_disclaimer)。 */
.disclaimer { max-width: 52rem; margin: 16px 0 0; color: var(--muted); font-size: 0.8rem; }

/* 利用者向けの文言の見直し: 管理者だけの運用の 1 行・絞り込みの札・お知らせ。 */
.operator-note { display: block; margin-top: 4px; color: var(--muted); font-size: 0.75rem; }
.news-item__external { color: var(--muted); font-size: max(0.69rem, 0.75em); }
.summary__venue { color: var(--muted); font-size: max(0.69rem, 0.85em); font-weight: normal; }
.move-odds-row__horizon { width: auto; min-width: 3.5em; }
.omen-about { position: relative; margin: 0 0 6px; color: var(--muted); font-size: 0.8rem; }
.agenda__omens .omen-about { display: none; }
.alert-rules__note { margin: 4px 0 8px; color: var(--muted); font-size: 0.85rem; }
.alert-rules__note:last-child { margin-bottom: 0; }
.toast__settings { margin-left: 8px; font-size: 0.8rem; }
/* アカウントのページ: メールアドレスの確認がまだのときの 1 行 (確認のメールの再送への入口つき) */
.auth__unverified { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; }
.auth__unverified a { margin-left: 4px; }
/* 保有の履歴 (/positions) の表。狭い画面では表の中だけを横に送り (ページは広げない)、セルは折り返さない
   (狭い列で「見通しの反転」などが 1 文字ずつ折り返して、行の高さが不揃いになるのを防ぐ)。続きのある側の端は囲みの .scroll-cue で薄く消す。 */
.positions-history__scroll { max-width: 100%; overflow-x: auto; }
.positions-history th,
.positions-history td { white-space: nowrap; }
/* 最後の列 (計画時の確率と確度): 確率は 1 つながり、確度の札は入りきらなければ下の行へ回す (1440px で列が切れない)。 */
.positions-history td:last-child { white-space: normal; }
/* 9 列が 72rem に収まるよう、セルの左右の余白を表の既定 (8px) から少し詰める。 */
.positions-history th,
.positions-history td { padding-inline: 6px; }
.positions-history__probs { white-space: nowrap; }
/* 保有の履歴の、決定ページを開けない会員 (Free) の分: 開いている保有 (入った時点の値を見出しつきで横に並べ、狭ければ折り返す) と
   手仕舞いのフォーム (出値と送信。欄は文字 16px・高さ 36px 以上、§8)、その下の「新しい保有の記録は Pro で」の 1 行。 */
.positions-open { gap: 12px; margin-bottom: 12px; }
.positions-open__title { margin: 0; font-size: 1.05rem; }
.positions-open__facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.positions-open__facts > div { display: grid; gap: 2px; }
.positions-open__facts dt { color: var(--muted); font-size: 0.75rem; }
.positions-open__facts dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positions-open__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0; }
.positions-open__field { display: grid; gap: 4px; color: var(--muted); font-size: 0.8rem; }
.positions-open__field input { width: 12rem; max-width: 100%; min-height: 36px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; background: var(--card); color: var(--text); font: inherit; font-size: max(16px, 1rem); }
.positions-needs-pro { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.positions-needs-pro a { color: var(--accent-text); }
/* 表の上の要約 (勝率・合計 R の 2 つ。件数と勝ち負け・平均 R は吹き出し) と、R の棒グラフ (PositionsHelper#position_r_chart)。
   棒は閉じた順に左から、勝ち --up・負け --down。累積 R の線は強調色。図は横に引き伸ばすので、線と 0 の線は太さを保つ (non-scaling-stroke)。 */
.positions-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.positions-summary strong { font-size: 1.25rem; }
.positions-summary__sep { color: var(--muted); }
.positions-r { margin: 0 0 12px; }
.positions-r__chart { display: block; width: 100%; height: var(--chart-h-s); border-radius: 6px; background: var(--bg); }
.positions-r__zero { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.positions-r__bar--up { fill: var(--up); }
.positions-r__bar--down { fill: var(--down); }
.positions-r__bar--flat { fill: var(--muted); }
.positions-r__total { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.positions-r__legend { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--muted); font-size: 0.75rem; }
.positions-r__key::before { content: ""; display: inline-block; margin-right: 4px; vertical-align: middle; }
.positions-r__key--bar::before { width: 8px; height: 10px; border-radius: 1px; background: linear-gradient(var(--up) 50%, var(--down) 50%); }
.positions-r__key--total::before { width: 14px; height: 2px; background: var(--accent); }

/* 分析・管理の仕上げ: 管理画面のタブ (スマホ)、大口の出入りの表のはみ出し。 */
/* 管理画面のタブはスマホの幅ではアイコンの下の 1 行を占めて横にスクロールさせる (主タブは下端のバーに移る)。
   管理のタブは .primary-tabs の見た目を借りているので、主タブ向けに文字の左右の余白を 2px へ詰める規則 (決定ページの media) から戻し、幅は中身なりにする。 */
@media (max-width: 600px) {
  .app-bar .admin-tabs { order: 0; flex: 1 0 100%; }
  .app-bar .admin-tabs .primary-tabs__link { flex: none; padding-inline: 12px; }
}
/* 大口の出入りの表は列を折り返さないので、狭い画面では表の囲みの中だけ横に流す (ページを横に広げない)。 */
.onchain-top-flows__block { overflow-x: auto; position: relative; } /* 表頭の読み上げ用の span (absolute) も囲みの中に閉じ込め、ページの幅を広げない */
/* AI の呼び先のフォームの欄は、size を明示していても狭い画面ではカードの幅で止める。 */
.ai-endpoints__form label,
.ai-endpoints__form input { max-width: 100%; }

/* ---- 共通部品: キーボードのフォーカスの枠 (focus-visible) ---------------------------------- */
/* 押せる部品のキーボードのフォーカスは、アクセントの 2px の枠を 1px 離して描く。角を丸める部品 (border-radius を足すもの) と、
   枠の離し方や色が違う部品 (i マーク・サマリーのタイル・AI の期間のタブなど) はそれぞれの所に書く。:is() の詳細度は中のいちばん高い
   セレクタになるので、中は 1 クラス (と [data-tip]) だけにし、要素名を含むセレクタは外に並べる。 */
:is(
  .primary-tabs__link, .app-bar__link, .pin-toggle, .summary__pause,
  .heatmap__cell, .members__button, .digest-dock__item, .decision__sound-open, .decision__sound-item,
  .verdicts__horizon-link, .position__submit, .outlook-digest__chip, .outlook-digest__summary, .outlook-digest__jump,
  .ai-council__horizon, .admin-cell-link, [data-tip]
):focus-visible,
.decision__input input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- 共通部品: 吹き出し (tip) ---------------------------------------------------- */
/* data-tip の要素をクリック・タップ・キーボードのフォーカスで開く札 (tip_controller.js。レイアウトの body に 1 つ、属性は ApplicationHelper#tip_attrs)。
   見た目は i マークの吹き出し (.info__tip) と同じ: 地はカード、枠、影、0.8rem。画面に固定した 1 つの要素を、要素の下 (足りなければ上) に置く。
   札は押されても下の要素の邪魔をしない (pointer-events: none)。data-tip の改行 (\n) はそのまま改行にする。 */
.tip__card {
  position: fixed;
  z-index: 50;
  max-width: min(22rem, calc(100vw - 16px));
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--shadow) 14%, transparent);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.6;
  text-align: left;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.tip__card[hidden] { display: none; }
.theme-terminal .tip__card { border-color: var(--rule); border-radius: 4px; background: var(--raised); box-shadow: none; }
/* 開く要素。マウスでは help のカーソル (リンクとボタンは自分のカーソルのまま)、キーボードのフォーカスは枠で示す (上の focus-visible の共通の規則)。 */
[data-tip]:not(a, button) { cursor: help; }

/* ---- 共通部品: パネルの頭 (panel-lead) -------------------------------------------- */
/* shared/_panel_lead。card__header の直下に、読みのピル → 要の数字 (と札) → 1 文 を 1 行で並べ、入りきらなければ折り返す
   (カードの縦の間は .card の gap に任せる)。大きさは今の地合いのタイル (.digest-tile) の並びに揃える: ピルは既存の .reading、
   数字は 1.4rem の太字で桁を揃え (tabular-nums)、札は .digest-tile__window と同じ細い枠、1 文は灰色の小さめの字。 */
.panel-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.panel-lead__reading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.panel-lead__figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0; font-variant-numeric: tabular-nums; line-height: 1.25; }
.panel-lead__value { font-size: 1.4rem; font-weight: 700; }
.panel-lead__label { padding: 0 4px; border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.panel-lead__note { flex: 1 1 16rem; min-width: 0; margin: 0; color: var(--muted); font-size: 0.85rem; }

/* ---- 共通部品: 絞り込みのチップ (filter-chips) --------------------------------------- */
/* shared/_filter_chips。軸 1 つで 1 段 (role="group")、段の頭に軸の名前 (__label)、選択中のチップは aria-current="true" で黒地。
   /news・/whales の絞り込みはこれ 1 つ。続けて置いた段は詰めて並べる。
   チップは読みのピル (.reading) と違い、押すと絞り込みのページへ移るリンク。 */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.filter-chips + .filter-chips { margin-top: -8px; }
/* 軸の名前は最小幅をそろえ、段を重ねたときにチップの始まりを縦にそろえる (「AI の判定」が入る幅)。 */
.filter-chips__label { align-self: center; min-width: 4.5em; margin-right: 2px; color: var(--muted); font-size: 0.8rem; }
.filter-chips__chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.8rem;
  text-decoration: none;
}
.filter-chips__chip[aria-current="true"] { background: var(--text); border-color: var(--text); color: var(--on-fill); }
/* 指で押す端末では押しやすい大きさにする。 */
@media (pointer: coarse) {
  .filter-chips__chip { padding: 6px 14px; }
}
/* 狭い画面では段を折り返さず、指で横に送る (画面の端まで使う)。 */
@media (max-width: 600px) {
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: calc(-1 * max(12px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(12px, env(safe-area-inset-right)));
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips__chip,
  .filter-chips__label { flex: none; white-space: nowrap; }
  /* 段ごとに横へ送るので、狭い画面では軸の名前の幅をそろえない (チップに幅を回す)。 */
  .filter-chips__label { min-width: 0; }
  /* 横へ続くことが分かるよう、続きのある側の端を薄く消す (partial が付ける .scroll-cue。冒頭の「横スクロールの手掛かり」)。
     チップは大きいので表の囲み (24px) より広く消し、最後のチップが薄れの下に残らないよう右に余白を足す。
     スクロール駆動のアニメーションが無いブラウザでは右端だけをいつも薄くする。 */
  .filter-chips { --scroll-cue-size: 40px; padding-right: 28px; }
  @supports not (animation-timeline: scroll()) {
    .filter-chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  }
}

/* ---- 共通部品: 表を行ごとのカードに (stack-table) ---------------------------------- */
/* 表 (table) に class="stack-table" を足すと、狭い画面 (600px 以下) で 1 行を 1 枚のカードに組み替える (docs/design-guide.md の 7 章)。
   列見出し (thead) は読み上げ用に残して見た目からは隠し、各セルの見出しはセルの data-label から左に小さな灰色の字で出す (値は右に寄せる)。
   見出しの要らないセル (操作のボタンなど) には data-label を付けない。見出しは左へ浮かせ、中身はその右から右寄せで流すので、
   セルに文字・リンク・チップが混ざってもよい。行の見出し (tbody の th) も同じ形にする。使っているのは設定のアラートと保有の履歴。 */
@media (max-width: 600px) {
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack-table,
  .stack-table tbody,
  .stack-table tr { display: block; }
  .stack-table tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .stack-table tr:last-child { border-bottom: none; }
  .stack-table td,
  .stack-table tbody th { display: flow-root; padding: 2px 0; border-bottom: none; text-align: right; }
  .stack-table td[data-label]::before,
  .stack-table tbody th[data-label]::before {
    content: attr(data-label);
    float: left;
    margin-right: 12px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: normal;
    text-align: left;
  }
  /* 保有の履歴: 広い画面ではセルを折り返さず表の中を横に送るが (.positions-history)、カードではカードの幅で折り返す。 */
  .positions-history tbody th,
  .positions-history td,
  .positions-history .num { white-space: normal; }
}

/* ---- タイムライン (/timeline、Timeline::ShowComponent / Timeline::EntryComponent) ---------------------------------- */
/* 急変・大口送金・AI の見立てを起きた順に 1 本の列で。行は左の列 (時刻と出どころの札) と本文の 2 列で、左の列に縦の線と種類の点を描く
   (点の色は分類色: 急変 = --accent-feed、大口送金 = --accent-onchain、AI = --accent-ai。向きの意味は持たせない)。
   本文の急変と大口送金は速報の欄と同じ部品 (move-list / whale-list) をそのまま置き、時刻は左の列が持つので行の中の時刻を隠し、
   行の上の罫線と上下の余白はこちらの行に任せる。狭い画面 (S) では左の列を本文の上の 1 行にする。 */
.timeline-card { --accent: var(--accent-feed); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__entry {
  display: grid;
  /* 左の列は news-time が書く「50 分前 · 10/24 08:53」が 1 行に収まる幅。 */
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--app-bar-height) + 12px);
}
.timeline__entry:first-child { border-top: 0; }
.timeline__rail { position: relative; min-width: 0; padding-left: 16px; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.timeline__rail::before { content: ""; position: absolute; top: 0; bottom: -10px; left: 3px; width: 1px; background: var(--border); }
.timeline__entry:last-child .timeline__rail::before { bottom: auto; height: 0.7em; }
.timeline__rail::after { content: ""; position: absolute; top: 0.4em; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--muted)); }
.timeline__entry--move { --dot: var(--accent-feed); }
.timeline__entry--whale { --dot: var(--accent-onchain); }
.timeline__entry--ai { --dot: var(--accent-ai); }
.timeline__time { display: block; font-variant-numeric: tabular-nums; }
.timeline__source { display: block; }
.timeline__body { min-width: 0; }
.timeline__body .move-list > .move-item,
.timeline__body .whale-list > .whale-item { padding-top: 0; padding-bottom: 0; border-top: 0; }
/* 大口送金の行は下端に額の線を引くので、文字と線の間を少し空ける。 */
.timeline__body .whale-list > .whale-item { padding-bottom: 0.375rem; }
.timeline__body .move-item__meta > time,
.timeline__body .whale-item__time { display: none; }
.timeline__title { margin: 0; font-weight: 600; }
.timeline__title a { text-decoration: none; }
.timeline__title a:hover { text-decoration: underline; }
.timeline__headline { margin: 2px 0; font-weight: 600; }
.timeline__text { margin: 2px 0; color: var(--muted); font-size: 0.85rem; }
.timeline__pills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 0; font-size: 0.85rem; }
.timeline__pill-label { color: var(--muted); }
.timeline__arrow { color: var(--muted); }
/* AI パルスの変わり目の 1 行は、見出しの行に 前 → 後 のピルと確信度を並べる (見出しで変わり目そのものを言う。行は 1 段)。 */
.timeline__title--turn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.timeline__title--turn .timeline__pills { margin: 0; font-weight: 400; }
/* AI パルスの束 (TimelineBoard#bundle): 本文は変わり目の列のピルと最新の確信度、その下に 1 回ずつの行の折りたたみ (.panel-more)。
   開いた中は 時刻 · 前 → 後 · 確信度 の 1 段ずつ (時刻は左の列と同じ news-time の書き方)。 */
.timeline__turns-more { margin-top: 2px; }
.timeline__turns { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.timeline__turn { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.timeline__turn .timeline__time { min-width: 11rem; color: var(--muted); font-size: 0.8rem; }
.timeline__turn .timeline__pills { margin: 0; }
/* 急変の分析の行の 1 時間の確率のバー。速報の行と同じ幅で止める (3 分割のバーは引き伸ばさない。§8)。 */
.timeline__odds { max-width: 20rem; }
.timeline__truncated { margin: 12px 0 0; color: var(--muted); font-size: 0.85rem; }
/* 列が空のときの「ありません」は列の後ろに置き、新着が差し込まれて列が空でなくなったら隠す (速報の大口送金の欄と同じ)。 */
.timeline:not(:empty) ~ .empty { display: none; }
@media (max-width: 600px) {
  .timeline__entry { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .timeline__rail { display: flex; flex-wrap: wrap; gap: 0 8px; }
  .timeline__rail::before { display: none; }
  .timeline__time,
  .timeline__source { display: inline; }
}

/* ---- LP (pages/landing。ゲストの /) ---------------------------------------------------------------
   Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: docs/design-guide.md (10 章) · designed-as-app
   Hallmark · pre-emit critique: P4 H4 E4 S5 R5 V4
   実画面を主役にした案内。ほかのページと同じトークン・同じ文字 (システムのゴシックと、数字と添え書きの --mono) で、左に寄せて組む。
   区画は 76rem で止め、ヒーローの画面だけを右へはみ出させて画面の端で切る (.lp の overflow-x: clip)。締めの帯だけ画面の端まで広げる (main の余白は .lp-main で外す)。
   置かないもの (docs/design-guide.md の 10 章): 光のにじみ・グラデーションの文字と塗り・すりガラス・描いたブラウザの枠・傾き・視差・数え上げ・流れる帯・
   画面に入ったら出す動き・区画ごとの英字の札。中身は最初から全部見え、JS は使わない。動くのはボタンを押したときの 1px だけ。
   色はトークンだけ: 地と文字は --bg / --text、罫は --lp-rule (--text を薄めた線) と --rule、主の入口は --brand-a に --on-brand。締めの帯は地と文字を入れ替える (ライトは暗い帯、ダークは明るい帯)。
   画面の画像はダーク 1 種類なので、枠の地はライトでも暗い色 (--shadow を濃く混ぜる)。寸法は rem (--lp-space-* の 4pt の段)。 */
.container.lp-main { padding: 0; }
.lp { --lp-max: 76rem; --lp-gutter: max(1.25rem, env(safe-area-inset-left), env(safe-area-inset-right)); --lp-wide: calc(var(--lp-max) + var(--lp-gutter) * 2);
  --lp-space-xs: 0.5rem; --lp-space-sm: 0.75rem; --lp-space-md: 1rem; --lp-space-lg: 1.5rem; --lp-space-xl: 2.5rem;
  --lp-gap: clamp(2rem, 5vw, 4.5rem); --lp-section: clamp(5rem, 10vw, 8.5rem);
  --lp-ease: cubic-bezier(0.16, 1, 0.3, 1); --lp-rule: color-mix(in srgb, var(--text) 14%, transparent);
  overflow-x: clip; font-feature-settings: "palt"; }
.lp h1, .lp h2, .lp h3, .lp p, .lp li, .lp summary { word-break: auto-phrase; }

/* 入口。主の入口は塗り、ログインは下線の文字。押せる文字は折り返さない。 */
.lp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lp-space-md) var(--lp-space-lg); margin: 0; }
.lp-button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; border: 1px solid transparent; border-radius: 0.5rem; padding: 0 var(--lp-space-lg);
  font-size: 1rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background-color 120ms var(--lp-ease), transform 120ms var(--lp-ease); }
.lp-button--primary { background: var(--brand-a); color: var(--on-brand); }
.lp-button--primary:hover { background: color-mix(in srgb, var(--brand-a) 86%, var(--shadow)); }
.lp-button--invert { background: var(--bg); color: var(--text); }
.lp-button--invert:hover { background: color-mix(in srgb, var(--bg) 88%, var(--text)); }
.lp-button:active { transform: translateY(1px); }
.lp-link { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; white-space: nowrap; }
.lp-link:hover { text-decoration-thickness: 2px; }
.lp-button:focus-visible,
.lp-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (pointer: coarse) {
  .lp-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
}

/* 実画面の画像。枠は細い線と小さな角丸だけ (影・傾き・ブラウザの枠は描かない)。添え書きは等幅の小さな字で、どのページの画面かを言う。
   切り抜き (--crop) は、画像の一部を枠いっぱいに見せる (縦横比と画像の幅・位置は Pages::LandingComponent#crop_style が枠の style に書く)。 */
.lp-shot { min-width: 0; margin: 0; }
.lp-shot__frame { overflow: hidden; border: 1px solid var(--lp-rule); border-radius: 0.5rem; background: color-mix(in srgb, var(--shadow) 88%, var(--card)); }
.lp-shot__frame img { display: block; width: 100%; height: auto; }
.lp-shot--crop .lp-shot__frame { position: relative; aspect-ratio: var(--lp-crop-ratio); }
.lp-shot--crop .lp-shot__frame img { position: absolute; top: var(--lp-crop-y); left: var(--lp-crop-x); width: var(--lp-crop-w); max-width: none; }
.lp-shot__caption { display: flex; align-items: center; gap: var(--lp-space-xs); margin-top: var(--lp-space-sm); color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

/* ヒーロー。左に見出し・リード・入口、右に指標ページの実画面 (列より 35% 広くして、画面の右端で切る)。下の余白は上より広く取る。 */
.lp-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--lp-space-xl) var(--lp-gap); align-items: start;
  max-width: var(--lp-wide); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5.5rem) var(--lp-gutter) clamp(3.5rem, 8vw, 7.5rem); }
.lp-hero__copy { min-width: 0; padding-top: clamp(0rem, 2vw, 2rem); }
.lp-hero__title { min-width: 0; margin: 0 0 var(--lp-space-lg); font-size: clamp(2.1rem, 4.4vw, 3.9rem); font-weight: 800; line-height: 1.16; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.lp-hero__title > span { display: block; }
.lp-hero__accent { color: var(--accent-text); }
.lp-hero__lead { max-width: 34rem; margin: 0 0 var(--lp-space-xl); color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.12rem); line-height: 1.95; }
.lp-hero__chips { display: flex; flex-wrap: wrap; gap: 0.25rem 0; margin: var(--lp-space-xl) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.85rem; }
.lp-hero__chips li:not(:last-child)::after { content: "/"; margin: 0 0.7em; color: var(--rule); }
.lp-hero__figure { width: 135%; }

/* 数字と出どころ。上に濃い罫を 1 本引き、数字 4 つを等幅の字で並べる。出どころは流さず、全部の名前を 1 段の文字の列で並べる。 */
.lp-facts { max-width: var(--lp-wide); margin: 0 auto; padding: 0 var(--lp-gutter); }
.lp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--text); border-bottom: 1px solid var(--lp-rule); }
.lp-stat { display: flex; flex-direction: column; min-width: 0; padding: var(--lp-space-lg) var(--lp-space-lg) var(--lp-space-lg) 0; }
.lp-stat + .lp-stat { border-left: 1px solid var(--lp-rule); padding-left: var(--lp-space-lg); }
.lp-stat__value { order: -1; margin: 0 0 var(--lp-space-sm); font-family: var(--mono); font-size: clamp(2.6rem, 3.8vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.lp-stat__value small { margin-left: 0.25rem; font-size: 0.4em; letter-spacing: 0; }
.lp-stat__label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lp-space-xs); margin: 0; font-weight: 700; }
.lp-stat__note { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.8rem; }
.lp-sources { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--lp-space-xs) 0; padding-top: var(--lp-space-lg); }
.lp-sources__title { margin: 0; padding-right: var(--lp-space-lg); font-size: 0.85rem; font-weight: 700; line-height: 1.8; }
.lp-sources__list { display: flex; flex-wrap: wrap; margin: 0; padding: 0 0 0 var(--lp-space-lg); list-style: none; color: var(--muted); font-size: 0.85rem; line-height: 1.8; }
.lp-sources__list li:not(:last-child)::after { content: "·"; margin: 0 0.6em; color: var(--rule); }

/* セクション。見出しと添え文を左に寄せて重ね、その下に中身 (区画ごとの英字の札は置かない)。 */
.lp-section { max-width: var(--lp-wide); margin: 0 auto; padding: var(--lp-section) var(--lp-gutter) 0; }
.lp-section__head { max-width: 40rem; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.lp-section__title { min-width: 0; margin: 0 0 var(--lp-space-md); font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.lp-section__lead { margin: 0; color: var(--muted); font-size: 1.02rem; line-height: 1.9; }
.lp-section__lead a,
.lp-faq__item p a { color: var(--accent-text); }

/* 機能紹介。組み方は 3 通り (Pages::LandingComponent#feature_layout): beside は文の右に画像 (4 : 8)、wide は文 (左に見出しと説明、右に要点) の下に
   幅いっぱいの画像、pair は wide の画像を 2 枚 (7 : 5) 並べる。文はどれも左から始め、左右を入れ替えない。要点は罫で区切った行にする。 */
.lp-features { display: grid; gap: clamp(4.5rem, 9vw, 8rem); }
.lp-feature { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--lp-space-xl) var(--lp-gap); align-items: start; }
.lp-feature--beside { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.lp-feature--wide .lp-feature__text,
.lp-feature--pair .lp-feature__text { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: var(--lp-gap); align-items: start; }
.lp-feature--wide .lp-feature__points,
.lp-feature--pair .lp-feature__points { grid-column: 2; grid-row: 1 / span 2; }
.lp-feature--wide .lp-feature__detail,
.lp-feature--pair .lp-feature__detail { margin-bottom: 0; }
.lp-feature--pair .lp-feature__media { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--lp-space-lg); align-items: start; }
.lp-feature__text { min-width: 0; }
.lp-feature__title { min-width: 0; margin: 0 0 var(--lp-space-md); font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.lp-feature__detail { margin: 0 0 var(--lp-space-lg); color: var(--muted); line-height: 1.9; }
.lp-feature__points { margin: 0; padding: 0; list-style: none; font-size: 0.95rem; line-height: 1.6; }
.lp-feature__points li { border-top: 1px solid var(--lp-rule); padding: var(--lp-space-sm) 0; }
.lp-feature__points li:last-child { border-bottom: 1px solid var(--lp-rule); }
.lp-feature__media { min-width: 0; }
/* 添え書きのページの名前は本文の色で (Pro の札はその右)。 */
.lp-feature__label { color: var(--text); font-weight: 700; }

/* 使い始めるまで。番号・見出し・説明を 1 行に組んだ 3 行の表 (カードにしない)。番号は順番そのものなので等幅の数字で出す。 */
.lp-steps { margin: 0; padding: 0; border-top: 1px solid var(--text); list-style: none; }
.lp-step { display: grid; grid-template-columns: 3rem minmax(0, 4fr) minmax(0, 7fr); gap: var(--lp-space-xs) var(--lp-space-lg); align-items: baseline; border-bottom: 1px solid var(--lp-rule); padding: var(--lp-space-lg) 0; }
.lp-step__number { color: var(--muted); font-family: var(--mono); font-size: 1rem; font-variant-numeric: tabular-nums; }
.lp-step__title { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.5; }
.lp-step__text { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.85; }

/* 料金 (課金が有効なときだけ)。カードは料金ページと同じ部品 (.pricing-plan) を、2 枚ぶんの幅で左に置く (間延びさせない)。 */
.lp-pricing__plans { max-width: 52rem; }
.lp-pricing__more { margin: var(--lp-space-lg) 0 0; }

/* よくある質問。左に見出し (広い画面では貼り付け)、右に罫で区切った開閉の行。開け口の印は + / −。 */
.lp-faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--lp-space-xl) var(--lp-gap); align-items: start; }
.lp-faq__head { position: sticky; top: calc(var(--app-bar-height) + 1.5rem); }
.lp-faq__list { border-top: 1px solid var(--text); }
.lp-faq__item { border-bottom: 1px solid var(--lp-rule); }
.lp-faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: var(--lp-space-md); min-height: 3.5rem; padding: var(--lp-space-sm) 0; font-weight: 700; line-height: 1.6; list-style: none; cursor: pointer; }
.lp-faq__item summary::-webkit-details-marker { display: none; }
.lp-faq__item summary::after { content: "+"; flex: none; color: var(--muted); font-family: var(--mono); font-size: 1.2rem; font-weight: 400; }
.lp-faq__item[open] summary::after { content: "−"; }
.lp-faq__item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-faq__item p { max-width: 44rem; margin: 0; padding: 0 0 var(--lp-space-lg); color: var(--muted); line-height: 1.9; }
.lp-faq__item p a { margin-left: 0.25rem; }

/* 締め。地と文字を入れ替えた帯を画面の端まで (ライトは暗い帯、ダークは明るい帯)。文は左に寄せ、入口は 1 つ (ログインは下線の文字)。 */
.lp-final { margin-top: var(--lp-section); background: var(--text); color: var(--bg); }
.lp-final__inner { max-width: var(--lp-wide); margin: 0 auto; padding: clamp(3.5rem, 8vw, 6.5rem) var(--lp-gutter); }
.lp-final__title { min-width: 0; margin: 0 0 var(--lp-space-md); font-size: clamp(1.9rem, 4.4vw, 3.4rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.lp-final__lead { max-width: 40rem; margin: 0 0 var(--lp-space-xl); color: color-mix(in srgb, var(--bg) 80%, var(--text)); font-size: 1.05rem; line-height: 1.85; }
.lp-final__note { margin: var(--lp-space-xl) 0 0; color: color-mix(in srgb, var(--bg) 72%, var(--text)); font-size: 0.78rem; }
.lp-final .lp-link { color: var(--bg); }
.lp-final .lp-button:focus-visible,
.lp-final .lp-link:focus-visible { outline-color: var(--bg); }

/* M 以下: ヒーロー・機能紹介 (beside)・よくある質問を 1 列に。画像は列の幅に収める。 */
@media (max-width: 1099px) {
  .lp-hero,
  .lp-feature--beside,
  .lp-faq { grid-template-columns: minmax(0, 1fr); }
  .lp-hero__figure { width: 100%; }
  .lp-faq__head { position: static; }
}
/* S: 数字は 2 列、文と要点・2 枚の画像・ステップは縦に。画面の画像は左上を大きく見せる (全体を縮めると字が読めないので)。 */
@media (max-width: 600px) {
  .lp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .lp-stat:nth-child(n + 3) { border-top: 1px solid var(--lp-rule); }
  .lp-sources { grid-template-columns: minmax(0, 1fr); }
  .lp-sources__list { padding-left: 0; }
  .lp-feature--wide .lp-feature__text,
  .lp-feature--pair .lp-feature__text,
  .lp-feature--pair .lp-feature__media { grid-template-columns: minmax(0, 1fr); }
  .lp-feature--wide .lp-feature__points,
  .lp-feature--pair .lp-feature__points { grid-column: auto; grid-row: auto; margin-top: var(--lp-space-lg); }
  .lp-step { grid-template-columns: 2rem minmax(0, 1fr); }
  .lp-step__text { grid-column: 2; }
  .lp-shot:not(.lp-shot--crop) .lp-shot__frame { aspect-ratio: 5 / 4; }
  .lp-shot:not(.lp-shot--crop) .lp-shot__frame img { width: 190%; max-width: none; }
  .lp-faq__item summary { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-button { transition: none; }
}
