/*
 * FX窓開け・窓埋め実測データ — 本番フロントエンド スタイル
 * デザイン正本(ユーザー承認済みモック): scratchpad/gap-mock/gap-stats-mock-v0.1.html を踏襲。
 * WP埋め込み前提のため、全セレクタを .bsnygap でスコープしグローバルCSSへ漏らさない
 * (パターンは site/public/volatility/style.css と同一)。
 */

.bsnygap, .bsnygap * { box-sizing: border-box; }

.bsnygap {
  --page-bg: #f2f5fa; --page-grad-a: #e8eef8; --page-grad-b: #f6f8fc;
  --glass-fill: rgba(255,255,255,0.65); --glass-border: rgba(255,255,255,0.22);
  --glass-shadow: 0 8px 28px rgba(5,25,62,0.12);
  --ink: #1b2a41; --ink-soft: #5a6b82; --accent: #0b3a75; --accent-soft: #dce7f5;
  --up: #0e8a5f; --down: #c43d4b;
  --bar: linear-gradient(90deg,#2e6fc4,#0b3a75);
  --chip-bg: rgba(11,58,117,0.08); --row-line: rgba(27,42,65,0.08);
  --warn-bg: #fdf3d7; --warn-ink: #7a5c00;
  --cat-fx: #2e6fc4; --cat-energy: #c4522e; --cat-metals: #a8862e; --cat-indices: #7a5ac4;

  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--page-grad-a), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, var(--page-grad-b), transparent 55%),
    var(--page-bg);
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  .bsnygap {
    --page-bg: #0d1526; --page-grad-a: #101b31; --page-grad-b: #0b1220;
    --glass-fill: rgba(20,33,56,0.65); --glass-border: rgba(255,255,255,0.10);
    --glass-shadow: 0 8px 28px rgba(0,0,0,0.45);
    --ink: #e4ebf5; --ink-soft: #93a3ba; --accent: #7db0e8; --accent-soft: #1b2f4d;
    --bar: linear-gradient(90deg,#3d7fd4,#7db0e8);
    --chip-bg: rgba(125,176,232,0.14); --row-line: rgba(228,235,245,0.09);
    --warn-bg: #3a3216; --warn-ink: #e8cf7a;
  }
}
:root[data-theme="light"] .bsnygap, .bsnygap[data-theme="light"] {
  --page-bg: #f2f5fa; --page-grad-a: #e8eef8; --page-grad-b: #f6f8fc;
  --glass-fill: rgba(255,255,255,0.65); --glass-border: rgba(255,255,255,0.22);
  --glass-shadow: 0 8px 28px rgba(5,25,62,0.12);
  --ink: #1b2a41; --ink-soft: #5a6b82; --accent: #0b3a75; --accent-soft: #dce7f5;
  --bar: linear-gradient(90deg,#2e6fc4,#0b3a75);
  --chip-bg: rgba(11,58,117,0.08); --row-line: rgba(27,42,65,0.08);
  --warn-bg: #fdf3d7; --warn-ink: #7a5c00;
}
:root[data-theme="dark"] .bsnygap, .bsnygap[data-theme="dark"] {
  --page-bg: #0d1526; --page-grad-a: #101b31; --page-grad-b: #0b1220;
  --glass-fill: rgba(20,33,56,0.65); --glass-border: rgba(255,255,255,0.10);
  --glass-shadow: 0 8px 28px rgba(0,0,0,0.45);
  --ink: #e4ebf5; --ink-soft: #93a3ba; --accent: #7db0e8; --accent-soft: #1b2f4d;
  --bar: linear-gradient(90deg,#3d7fd4,#7db0e8);
  --chip-bg: rgba(125,176,232,0.14); --row-line: rgba(228,235,245,0.09);
  --warn-bg: #3a3216; --warn-ink: #e8cf7a;
}

.bsnygap .wrap { max-width: 900px; margin: 0 auto; padding: 20px 14px 48px; }

.bsnygap .meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.bsnygap .badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--chip-bg); color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
}
.bsnygap .badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.bsnygap .src-note { font-size: 11.5px; color: var(--ink-soft); }

.bsnygap .glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
}

.bsnygap .hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px;
}
.bsnygap .hero-stats .card { padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.bsnygap .hero-stats .card .num { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.bsnygap .hero-stats .card .lbl { font-size: 12.5px; color: var(--ink-soft); }
.bsnygap .hero-stats .card .sub { font-size: 11px; color: var(--ink-soft); }
@media (max-width: 640px) { .bsnygap .hero-stats { grid-template-columns: 1fr; } }

.bsnygap section.block { margin-top: 26px; }
.bsnygap section.block:first-of-type { margin-top: 0; }
.bsnygap section.block h2 { font-size: 17px; margin: 0 0 10px; }

.bsnygap .tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 4px; }
.bsnygap .tabs button {
  flex: 0 0 auto; border: 0; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: transparent; padding: 8px 16px; border-radius: 10px;
  display: inline-flex; align-items: center; gap: 7px;
}
.bsnygap .tabs button .cdot { width: 8px; height: 8px; border-radius: 50%; }
.bsnygap .tabs button.on { background: var(--accent); color: #fff; }
.bsnygap .tabs button.on .cdot { background: #fff !important; }
.bsnygap .tabs button:focus-visible,
.bsnygap details summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.bsnygap .table-cap { font-size: 11.5px; color: var(--ink-soft); padding: 0 6px 8px; }
.bsnygap .board { padding: 6px 0 10px; overflow-x: auto; }
.bsnygap table { width: 100%; border-collapse: collapse; min-width: 640px; }
.bsnygap thead th {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  text-align: left; padding: 8px 10px; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--row-line); white-space: nowrap; cursor: pointer; user-select: none;
}
.bsnygap thead th.sym-col { cursor: default; }
.bsnygap thead th .arw { font-size: 9px; margin-left: 2px; color: var(--accent); }
.bsnygap thead th.num, .bsnygap td.num { text-align: right; }
.bsnygap tbody td { padding: 9px 10px; border-bottom: 1px solid var(--row-line); font-size: 13px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.bsnygap tbody tr:last-child td { border-bottom: 0; }
.bsnygap .sym-name { font-weight: 600; white-space: nowrap; }
.bsnygap .sym-code { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.bsnygap .cat-chip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }

.bsnygap .summary-line { font-size: 12.5px; color: var(--ink-soft); margin: 10px 2px 0; }

.bsnygap .detail-wrap { padding: 14px 14px 6px; }
.bsnygap .detail-wrap table { min-width: 520px; }
.bsnygap td.dir { white-space: nowrap; font-weight: 700; }
.bsnygap td.dir.up { color: var(--up); }
.bsnygap td.dir.down { color: var(--down); }
.bsnygap .fill-chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: rgba(14,138,95,0.14); color: var(--up);
}
.bsnygap .fill-chip.no { background: var(--warn-bg); color: var(--warn-ink); }
.bsnygap .detail-note { font-size: 11.5px; color: var(--ink-soft); padding: 4px 14px 14px; }

@media (max-width: 560px) {
  .bsnygap section.block h2 { font-size: 16px; }
}

/* ===== WP(SWELL)埋め込み時のテーマ装飾打ち消し =====
   SWELLは本文内tableのthead/td/trに紺帯・ボーダー・縞模様を適用する
   （#body_wrap配下の高特異度セレクタ）。モックのガラス調に戻すため、
   本番ページでのみ効く #body_wrap 前置＋!important で上書きする。
   (パターンは site/public/volatility/style.css と同一) */
#body_wrap .bsnygap table,
#body_wrap .bsnygap table tr,
#body_wrap .bsnygap table tbody tr:nth-child(2n),
#body_wrap .bsnygap table tbody tr:nth-child(2n+1) {
  background: transparent !important;
  border: none !important;
}
#body_wrap .bsnygap thead th {
  background: transparent !important;
  color: var(--ink-soft) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-align: left !important;
  padding: 8px 10px !important;
  letter-spacing: 0.03em !important;
  border: none !important;
  border-bottom: 1px solid var(--row-line) !important;
  white-space: nowrap;
}
#body_wrap .bsnygap thead th.num { text-align: right !important; }
#body_wrap .bsnygap tbody td {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--row-line) !important;
  padding: 9px 10px !important;
}
#body_wrap .bsnygap tbody tr:last-child td { border-bottom: none !important; }
