:root {
    --surface-1: #fcfcfb;
    --page: #f9f9f7;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --muted: #898781;
    --grid: #e1e0d9;
    --baseline: #c3c2b7;
    --border: rgba(11,11,11,0.10);
    --series-price: #2a78d6;  /* 青: 価格 */
    --series-ma50: #1baf7a;   /* アクア: 50日MA */
    --series-ma200: #eda100;  /* 黄: 200日MA */
    --div-pos: #2a78d6;       /* 買い寄り(+) */
    --div-neg: #e34948;       /* 売り寄り(-) */
    --div-mid: #f0efec;
    /* Fear & Greed ゲージ（恐怖=赤 → 中立=グレー → 強欲=青） */
    --g1: #e34948;
    --g2: #f0a9a8;
    --g3: #e1e0d9;
    --g4: #9ec5f4;
    --g5: #2a78d6;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --surface-1: #1a1a19;
      --page: #0d0d0d;
      --text-primary: #ffffff;
      --text-secondary: #c3c2b7;
      --muted: #898781;
      --grid: #2c2c2a;
      --baseline: #383835;
      --border: rgba(255,255,255,0.10);
      --series-price: #3987e5;
      --series-ma50: #199e70;
      --series-ma200: #c98500;
      --div-pos: #3987e5;
      --div-neg: #e66767;
      --div-mid: #383835;
      --g1: #e66767;
      --g2: #8f4a49;
      --g3: #383835;
      --g4: #2f5e91;
      --g5: #3987e5;
    }
  }
  * { box-sizing: border-box; margin: 0; }
  body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 700;
    background: var(--page);
    color: var(--text-primary);
    padding: 24px 16px 48px;
  }
  svg text { font-weight: 700; }
  .wrap { max-width: 960px; margin: 0 auto; }
  h1 { font-size: 26px; font-weight: 700; }
  .updated { color: var(--muted); font-size: 14px; margin-top: 4px; }
  .tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: start;
    gap: 12px;
    margin: 20px 0;
  }
  .tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
  }
  .tile .label { font-size: 15px; color: var(--text-secondary); }
  .tile .value { font-size: 36px; font-weight: 700; margin-top: 6px; }
  .tile .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
  .meter { height: 10px; border-radius: 5px; background: var(--div-mid); position: relative; margin-top: 12px; }
  .meter .center { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--baseline); }
  .meter .fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
  /* 指標内訳の発散バー */
  .sig-grid { display: grid; grid-template-columns: 1fr; column-gap: 40px; }
  @media (min-width: 700px) { .sig-grid { grid-template-columns: 1fr 1fr; } }
  .sig { padding: 12px 0; border-bottom: 1px solid var(--grid); }
  .sig:last-child { border-bottom: none; padding-bottom: 4px; }
  .sig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .sig-name { font-size: 15px; }
  .sig-score { font-size: 17px; font-variant-numeric: tabular-nums; }
  .sig-bar { height: 10px; border-radius: 5px; background: var(--div-mid); position: relative; margin: 8px 0 6px; }
  .sig-bar .center { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--baseline); }
  .sig-bar .fill { position: absolute; top: 0; bottom: 0; }
  .sig-desc { font-size: 14px; color: var(--muted); }
  /* 需給タイル */
  .sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; gap: 12px; }
  .tile .value.mid { font-size: 28px; }
  .split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin-top: 12px; }
  .spark { display: block; width: 100%; height: auto; margin-top: 10px; }
  .gauge-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
  .tile-gauge .gauge { max-width: 128px; flex: none; display: block; margin: 0; }
  .gauge-info { display: flex; flex-direction: column; }
  .gauge-info .value { font-size: 32px; font-weight: 700; margin-top: 0; }
  .gauge-info .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
  .card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
  }
  .card h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
  .card .desc { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
  .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
  .legend span::before {
    content: ""; display: inline-block; width: 12px; height: 3px;
    border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--c);
  }
  .chart-box { position: relative; }
  svg { display: block; width: 100%; height: auto; }
  .tooltip {
    position: absolute; pointer-events: none; display: none;
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); white-space: nowrap; z-index: 5;
  }
  .tooltip .t-date { color: var(--muted); margin-bottom: 4px; }
  .tooltip .row { display: flex; justify-content: space-between; gap: 12px; }
  .tooltip .row b { font-variant-numeric: tabular-nums; }
  .note { font-size: 14px; color: var(--muted); line-height: 1.7; }
  .status { padding: 32px; text-align: center; color: var(--muted); }
  a { color: var(--series-price); }
