/* Swing Scout 共通スタイル（batch/swing_pages.py が swing-site/swing.css にそのままコピーする。2026-11-20 _base.html.j2 から切り出し）
   Tailwind が content の templates/**/*.j2 として読むよう .j2 にしている */
/* 表示中の行だけに順位を振る（規模区分・決算またぎの切り替えで行を隠しても連番になる） */
.sw-table tbody { counter-reset: sw-rank; }
.sw-table tbody tr:not([hidden]) { counter-increment: sw-rank; }
.sw-table tbody tr:not([hidden]) .sw-rank::before { content: counter(sw-rank); }
.sw-chip { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.sw-table .sq-badge { padding: 2px 7px; font-size: 11px; border-radius: 6px; }
/* 総合: 今日の売買プランの買う候補（表示中の上位N銘柄）と区切り */
.sw-table tbody tr.sw-top { background: rgb(var(--c-ok-soft) / .55); }
.sw-table tbody tr.sw-top td.sw-rank { color: rgb(var(--c-ok)); font-weight: 900; }
.sw-table tbody tr.sw-sep:not([hidden]) { counter-increment: none; }
.sw-table tbody tr.sw-sep td { padding: 6px 8px; font-size: 11px; font-weight: 700; color: rgb(var(--c-ok));
  border-top: 2px solid rgb(var(--c-ok) / .6); background: transparent; }
/* 銘柄ページのチャート（stock.html.j2）。色は theme.css の変数でライト/ダーク両対応 */
.sw-chart { width: 100%; height: auto; display: block; }
.sw-chart text { fill: rgb(var(--c-muted)); font-size: 11px; font-family: 'JetBrains Mono', monospace; }
@media (max-width: 767px) { .sw-chart text { font-size: 10px; } }
.sw-chart .sw-grid { stroke: rgb(var(--c-line)); stroke-width: 1; }
.sw-chart path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.sw-l-close { stroke: rgb(var(--c-ink)); stroke-width: 1.8; }
.sw-l-ma5 { stroke: #f59e0b; stroke-width: 1.6; }
.sw-l-ma25 { stroke: rgb(var(--c-brand)); stroke-width: 1.6; }
.sw-l-ma75 { stroke: rgb(var(--c-muted)); stroke-width: 1.4; stroke-dasharray: 5 4; }
.sw-l-rsi9 { stroke: rgb(var(--c-brand)); stroke-width: 1.6; }
.sw-l-rsi26 { stroke: #f59e0b; stroke-width: 1.4; }
.sw-h-gc { stroke: rgb(var(--c-ok)); stroke-width: 1.2; stroke-dasharray: 4 3; }
.sw-h-ob { stroke: rgb(var(--c-warn)); stroke-width: 1; stroke-dasharray: 4 3; }
.sw-h-os { stroke: rgb(var(--c-link)); stroke-width: 1; stroke-dasharray: 4 3; }
.sw-vp { fill: rgb(var(--c-muted)); fill-opacity: .16; }
.sw-vp-zone { fill: rgb(var(--c-ok)); fill-opacity: .32; }
.sw-key-box { display: inline-block; width: 10px; height: 10px; vertical-align: middle; margin-right: 2px; background: rgb(var(--c-muted) / .16); }
.sw-key-box.sw-vp-zone { background: rgb(var(--c-ok) / .32); margin-right: 4px; }
.sw-key { display: inline-block; width: 14px; height: 0; border-top-width: 2px; border-top-style: solid; vertical-align: middle; margin-right: 4px; }
/* スマホ幅: 表を1銘柄1カードに組み替える（1行目=順位・銘柄・株価、2行目=シグナル・RSI・貸借倍率、以下=注意・参考） */
@media (max-width: 767px) {
  .sw-table { min-width: 0 !important; }
  .sw-table thead { display: none; }
  .sw-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; padding: 10px 0; }
  .sw-table tbody tr[hidden] { display: none; }
  .sw-table tbody td { display: block; padding: 0 !important; }
  .sw-table td.sw-rank { width: 18px; align-self: flex-start; padding-top: 2px !important; }
  .sw-table td.sw-name { flex: 0 0 calc(100% - 18px - 92px - 20px); min-width: 0 !important; }
  .sw-table td.sw-price { flex: 0 0 92px; align-self: flex-start; }
  .sw-table td.sw-sig { margin-left: 28px; margin-top: 6px; }
  .sw-table td.sw-prob { margin-left: 28px; margin-top: 6px; text-align: left; }
  .sw-table td.sw-prob::before { content: "上昇確率 "; color: rgb(var(--c-muted)); font-size: 11px; font-family: inherit; font-weight: 400; }
  .sw-table td.sw-why { margin-top: 6px; }
  .sw-table tbody tr.sw-sep { padding: 0; }
  .sw-table tbody tr.sw-sep td { flex: 0 0 100%; padding: 6px 4px !important; }
  .sw-table td.sw-rsi, .sw-table td.sw-ratio { margin-top: 6px; text-align: left; font-size: 11px; }
  .sw-table td.sw-rsi::before { content: "RSI "; color: rgb(var(--c-muted)); font-family: inherit; }
  .sw-table td.sw-ratio::before { content: "貸借 "; color: rgb(var(--c-muted)); }
  .sw-table td.sw-warn, .sw-table td.sw-info { flex: 0 0 calc(100% - 28px); margin-left: 28px; margin-top: 6px; }
  .sw-table td:has(.sw-none), .sw-table td.sw-info:not(:has(.chip)) { display: none; }
}
/* ヘッダーの銘柄検索: 幅1024px未満は虫眼鏡ボタンで、ヘッダーの下に検索欄を開く */
#sw-search-box.sw-open { display: block; position: fixed; top: var(--header-h); left: 0; right: 0; padding: 10px 16px;
  background: rgb(var(--c-surface)); border-bottom: 1px solid rgb(var(--c-line)); z-index: 40; }
#sw-search-box.sw-open #sw-search-list { margin: 4px 0 0; }
@media (min-width: 1024px) {
  #sw-search-box.sw-open { position: static; padding: 0; border: 0; background: transparent; }
}
/* 銘柄ページのチャートのツールチップ */
.sw-chart[data-kind] { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.sw-hit { cursor: crosshair; }
.sw-cross-line { stroke: rgb(var(--c-muted)); stroke-width: 1; stroke-dasharray: 3 3; }
.sw-cross-dot { fill: rgb(var(--c-ink)); stroke: rgb(var(--c-surface)); stroke-width: 1.5; }
.sw-chart[data-kind="rsi"] .sw-cross-dot { fill: rgb(var(--c-brand)); }
.sw-cross-dot2 { fill: #f59e0b; stroke: rgb(var(--c-surface)); stroke-width: 1.5; }
.sw-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 6px 9px; border-radius: 8px;
  background: rgb(var(--c-surface) / .97); border: 1px solid rgb(var(--c-line)); box-shadow: 0 4px 14px rgb(0 0 0 / .12);
  font-size: 11px; line-height: 1.6; white-space: nowrap; }
.sw-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
#sw-search-list li[aria-selected="true"] > a { background: rgb(var(--c-sunken)); }
.sw-tier { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 6px; font-weight: 900; font-size: 12px; line-height: 1; }
