/* 買い時ウォッチ：相場の画面のような、落ち着いた紺の見出しと細い線の表。見出しもゴシック。
   データの色は dataviz の検証済みパレットの先頭3色（青＝株価・売られすぎ、オレンジ＝50日線・過熱、緑＝200日線）。
   面の色は検証の既定値（ライト #fcfcfb・ダーク #1a1a19）。3色目の緑はライトで3:1を切るので、凡例と表を必ず添える */
:root {
  color-scheme: light;
  --page: #f2f3f0; --surface: #fcfcfb; --surface-2: #f5f5f2;
  --ink: #16191d; --ink-2: #474c53; --muted: #686d73;
  --grid: #e6e7e3; --axis: #c9cbc5; --border: rgba(20,30,40,0.12);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --cold-bg: rgba(42,120,214,0.12); --hot-bg: rgba(235,104,52,0.14);
  --cold-ink: #1c5cab; --hot-ink: #a8431a;
  --up: #1f7a45; --dn: #b23a3a;
  --accent: #0f6d6a; --bar: #101c2b; --bar-ink: #e5ebf2; --bar-dim: #a9b6c6; --bar-line: #37d1c1;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #111211; --surface: #1a1a19; --surface-2: #20211f;
    --ink: #eceeea; --ink-2: #c3c6c0; --muted: #969a94;
    --grid: #2a2b29; --axis: #3c3e3a; --border: rgba(220,230,240,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --cold-bg: rgba(57,135,229,0.18); --hot-bg: rgba(217,89,38,0.15);
    --cold-ink: #86b6ef; --hot-ink: #f0a07c;
    --up: #5cc38a; --dn: #ec7c7c;
    --accent: #5cc9c0; --bar: #0a111a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111211; --surface: #1a1a19; --surface-2: #20211f;
  --ink: #eceeea; --ink-2: #c3c6c0; --muted: #969a94;
  --grid: #2a2b29; --axis: #3c3e3a; --border: rgba(220,230,240,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --cold-bg: rgba(57,135,229,0.18); --hot-bg: rgba(217,89,38,0.15);
  --cold-ink: #86b6ef; --hot-ink: #f0a07c;
  --up: #5cc38a; --dn: #ec7c7c;
  --accent: #5cc9c0; --bar: #0a111a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--page);
  font: 15px/1.8 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { word-break: auto-phrase; text-wrap: balance; letter-spacing: 0.01em; }

/* ヘッダー */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-ink); border-bottom: 2px solid var(--bar-line); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 11px 20px 2px; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; flex-direction: column; text-decoration: none; color: inherit; line-height: 1.3; }
.logo .mark { font: 600 11.5px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0.22em; color: var(--bar-line); }
.logo .name { font: 700 20px/1.3 system-ui, sans-serif; letter-spacing: 0.04em; color: #fff; }
.tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang, .theme { white-space: nowrap; font: 500 12px system-ui, sans-serif; color: var(--bar-ink); background: transparent;
  border: 1px solid #34465c; border-radius: 999px; padding: 4px 11px; text-decoration: none; cursor: pointer; }
.lang:hover, .theme:hover { border-color: var(--bar-line); color: #fff; }
.tabs { max-width: 1120px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; color: var(--bar-dim); text-decoration: none; padding: 8px 10px 9px; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current] { color: #fff; font-weight: 700; }
.tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--bar-line); border-radius: 2px 2px 0 0; }

main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 24px; }
.alert { background: rgba(208,59,59,0.10); border: 1px solid rgba(208,59,59,0.35); border-radius: 8px; padding: 10px 14px; margin: 16px 0; }

/* 冒頭 */
.hero { padding: 40px 0 6px; }
.kicker { font: 600 11.5px/1.6 ui-monospace, Consolas, monospace; letter-spacing: 0.16em; color: var(--accent); margin: 0 0 10px; }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.35; margin: 0 0 16px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sm { padding: 30px 0 0; }
.hero-sm h1 { font-size: clamp(24px, 3.6vw, 32px); margin-bottom: 6px; }
.lead { color: var(--ink-2); font-size: 15.5px; margin: 0 0 14px; max-width: 48em; }
.gsum { font-size: 15px; font-weight: 600; margin: 4px 0 0; }

/* 節 */
.block { margin: 44px 0; }
.block > h2 { font-size: 21px; margin: 0 0 12px; padding-left: 12px; border-left: 4px solid var(--accent); line-height: 1.4; }
.block p { max-width: 52em; }
.more { margin: 8px 0 0; }
.more a { text-decoration: none; font-weight: 600; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.empty { color: var(--ink-2); background: var(--surface); border: 1px dashed var(--axis); border-radius: 10px; padding: 14px 16px; }
.updated { color: var(--muted); font-size: 12.5px; margin: 32px 0 0; }
ul.plain { padding-left: 1.2em; margin: 0; }
ul.plain li { margin: 4px 0; }

/* 要点 */
.summary { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px 12px; margin: 24px 0 8px; }
.s-head { font: 700 13px/1.5 system-ui, sans-serif; letter-spacing: 0.08em; color: var(--accent); margin: 0 0 4px; }
.summary ol { margin: 0; padding-left: 1.4em; }
.summary li { font-size: 15.5px; line-height: 1.8; margin: 4px 0; }

/* 判定の印 */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; line-height: 1.5; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.st i { font-style: normal; font-size: 10px; }
.st-cold { background: var(--cold-bg); color: var(--cold-ink); box-shadow: inset 0 0 0 1px var(--s1); }
.st-hot { background: var(--hot-bg); color: var(--hot-ink); box-shadow: inset 0 0 0 1px var(--s2); }
.st-norm { color: var(--muted); box-shadow: inset 0 0 0 1px var(--axis); font-weight: 500; }
.near { display: block; font-size: 12px; margin-top: 2px; white-space: nowrap; }
.near::before { content: "→ "; }
.near-cold { color: var(--cold-ink); }
.near-hot { color: var(--hot-ink); }
.vt { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 0 8px; border-radius: 4px; white-space: nowrap; }
.v-works { background: var(--accent); color: var(--surface); }
.v-unclear { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.v-none { box-shadow: inset 0 0 0 1px var(--axis); color: var(--muted); }

/* 今日の判定のタイル */
.gtiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gtile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  text-decoration: none; color: inherit; transition: border-color .15s; }
.gtile:hover { border-color: var(--accent); }
.g-name { font-weight: 800; font-size: 16px; }
.t-counts { margin: 0; display: grid; gap: 4px; }
.t-counts div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.t-counts dt .near { margin: 0; font-weight: 600; }
.t-counts dd { margin: 0; font: 700 20px/1.3 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.t-note, .t-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
.gtile .go { margin-top: auto; color: var(--accent); font-size: 13px; font-weight: 600; }

/* 判定の説明 */
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.stc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stc.cold { border-top: 3px solid var(--s1); }
.stc.hot { border-top: 3px solid var(--s2); }
.stc.norm { border-top: 3px solid var(--axis); }
.stc p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
table.vtbl td small { display: block; color: var(--muted); font-size: 12px; }

/* 分類ページ：効き目の箱 */
.evbox { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 18px 0 8px; }
.evcs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evc p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.evc .evc-h { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* チャートの枠 */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 12px; margin: 18px 0; scroll-margin-top: 110px; }
.p-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.p-name { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.4; }
.p-meta { margin: 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.c-lab { margin: 10px 0 0; font-size: 13px; font-weight: 700; }
.c-lab span { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.canvas { position: relative; }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px 12px; margin: 14px 0; }
.chart figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.chart figcaption strong { font-size: 14.5px; }
.chart figcaption span { font-size: 13px; color: var(--ink-2); }
.pick-g { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.pick-g select { font: inherit; font-weight: 400; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); }

/* 表 */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: middle; }
thead th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); line-height: 1.4; vertical-align: bottom; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
tbody th small, td small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); line-height: 1.4; }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
thead th:not(:first-child) { text-align: right; }
table.gl thead th:nth-child(2), table.gl thead th:nth-child(8), table.gl thead th:nth-child(9), table.lst thead th:nth-child(2), table.lst thead th:nth-child(3),
table.vtbl thead th, table.src thead th { text-align: left; }
td.up, small.up { color: var(--up); }
td.dn, small.dn { color: var(--dn); }
td.txt { white-space: normal; min-width: 10em; }
td.macd { min-width: 8.5em; font-size: 13px; }
td.sp { width: 170px; padding: 4px 10px; }
.spark { display: block; width: 160px; height: 40px; }
.sp-line { fill: none; stroke: var(--s1); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sp-ma { fill: none; stroke: var(--s3); stroke-width: 1.2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
table.gl tbody tr { cursor: pointer; }
table.gl tbody tr:hover th, table.gl tbody tr:hover td { background: var(--surface-2); }
table.gl tbody tr.on th, table.gl tbody tr.on td { background: var(--cold-bg); }
table.gl tbody tr.on th { box-shadow: inset 3px 0 0 var(--s1); }
.pick { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.pick:hover { color: var(--accent); text-decoration: underline; }
.ext { font-size: 12px; margin-left: 4px; }
table.evt tr.hl th, table.evt tr.hl td { background: var(--surface-2); font-weight: 700; }
table.evt td { text-align: right; }

/* 注意の一覧 */
.caveats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: cv; }
.caveats li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px 12px 46px; position: relative; counter-increment: cv; }
.caveats li::before { content: counter(cv); position: absolute; left: 16px; top: 12px; font: 800 17px/1.4 system-ui, sans-serif; color: var(--accent); }
.caveats p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.methods { padding-left: 1.2em; font-size: 14px; }
.methods li { margin-bottom: 6px; }

footer.site-foot { max-width: 1120px; margin: 0 auto; padding: 18px 20px 40px; border-top: 1px solid var(--grid);
  display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
footer.site-foot a { color: var(--ink); }

@media (max-width: 900px) {
  .gtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .states { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .bar-in { padding: 9px 14px 2px; }
  .logo .name { font-size: 18px; }
  .logo .mark { font-size: 10.5px; letter-spacing: 0.12em; white-space: nowrap; }
  .tabs { padding-right: 32px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .tabs a { font-size: 13.5px; }
  main { padding: 4px 14px 20px; }
  .hero { padding: 26px 0 4px; }
  .lead { font-size: 14.5px; }
  .summary li { font-size: 14.5px; }
  .block { margin: 34px 0; }
  .block > h2 { font-size: 19px; }
  .evcs { grid-template-columns: 1fr; }
  .panel { padding: 12px 8px 10px; }
  .p-head { padding: 0 4px; }
  .chart { padding: 12px 10px 8px; }

  /* 表はスマホ幅では1行を1枚のカードにする（列の見出しをセルの前に出す） */
  .tbl-wrap { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr { display: block; width: 100%; }
  table.stack tr { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
  table.stack th[scope="row"] { display: block; padding: 0 0 6px; border: 0; font-size: 15px; }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; white-space: normal; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: 0 1 auto; }
  table.stack td small { display: inline; margin-left: 6px; }
  table.stack td .near { display: inline; margin-left: 6px; }
  table.stack td.txt { display: flex; min-width: 0; }
  table.stack td.sp { width: auto; padding: 4px 0; align-items: center; }
  /* 分類の一覧は、数字を3列に並べた詰めたカードにする（1行目：判定・株価、2行目：RSI・200日線・高値、3行目：3か月・MACD、4行目：1年の線） */
  table.gl.stack tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 12px; }
  table.gl.stack th[scope="row"] { grid-column: 1 / -1; padding: 0; }
  table.gl.stack td { display: block; text-align: left; padding: 0; min-width: 0; }
  table.gl.stack td::before { display: block; font-size: 11.5px; line-height: 1.4; }
  table.gl.stack td:nth-of-type(1), table.gl.stack td.macd { grid-column: span 2; }
  table.gl.stack td.sp { grid-column: 1 / -1; }
  table.gl.stack td.sp::before { display: none; }
  table.gl.stack .spark { width: 100%; height: 36px; }
  table.gl.stack td.macd { font-size: 13px; }
  table.gl.stack td small { display: inline; margin-left: 4px; }
  table.gl tbody tr.on { box-shadow: inset 3px 0 0 var(--s1); }
  table.gl tbody tr.on th, table.gl tbody tr.on td { background: transparent; box-shadow: none; }
}
@media (forced-colors: active) {
  .st, .vt { forced-color-adjust: none; }
}

/* 検証ページ：比較の表と、折りたたんだ対象ごとの表 */
table.evm td.ok { font-weight: 800; box-shadow: inset 0 0 0 2px var(--accent); }
table.evm tr.hl th, table.evm tr.hl td { background: var(--cold-bg); }
.evd { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; }
.evd > summary { cursor: pointer; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.evd > summary strong { font-size: 15px; }
.evd > summary span { font-size: 13px; color: var(--ink-2); }
.evd[open] > summary { border-bottom: 1px solid var(--grid); }
.evd .tbl-wrap { border: 0; border-radius: 0 0 10px 10px; }

/* 見やすさの手直し：一覧の見出しと MACD は折り返さない、長い補足は幅を抑える */
table.gl thead th { white-space: nowrap; }
table.gl td.macd { white-space: nowrap; }
table.gl tbody th small, table.lst tbody th small { max-width: 26em; }

/* 見やすさの手直し：今日の結論・分類の結論・用語 */
.headline { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.concl { margin: 2px 0 8px; font-weight: 700; font-size: 15px; }
.evc p strong { display: block; font-size: 13.5px; color: var(--ink); }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.terms > div { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; }
.terms dt { font-weight: 800; font-size: 14.5px; }
.terms dd { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
@media (max-width: 720px) { .terms { grid-template-columns: 1fr; } .headline { font-size: 15px; } }
