/* ============================================================
   E-計算！ Fortune — 宿曜占星術の相性（sukuyo-aisho.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラスは sa- で始める。
   入力欄・解釈の枠・比較表は本命宿のページ（css/sukuyo.css）と同じ形。
   ============================================================ */

/* ページ上部の要点 */
.sa-quick { margin: 4px 0 20px; }
.sa-quick ul { margin: 2px 0 0; }
.sa-quick li { margin: 2px 0; }

/* ---- 入力 ---- */
/* 日付の入力欄（ふつうの文字の欄＋カレンダーのボタン） */
.sa-date { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-ui="v2"] .sa-date input[type="text"] {
  flex: 1 1 auto; width: 100%; min-width: 0; height: 44px; padding: 0 12px; font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
html[data-ui="v2"] .sa-date input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
html[data-ui="v2"] .sa-date input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
.sa-pick {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.sa-pick:hover { background: var(--accent-soft); color: var(--accent); }
.sa-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sa-pick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sa-native { position: absolute; right: 0; bottom: 0; width: 44px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
@media (max-width: 560px) { html[data-ui="v2"] .sa-date input[type="text"] { font-size: 16px; } }
.sa-lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
details.sa-more { margin: 4px 0 14px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 2px 0; }
details.sa-more > summary { cursor: pointer; padding: 10px 2px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
details.sa-more[open] > summary { margin-bottom: 4px; }
.sa-rule { display: grid; gap: 6px; }
.sa-rule label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.6; cursor: pointer; min-width: 0; }
.sa-rule input { margin-top: 5px; flex: none; }
.sa-hint { margin: 6px 0 0; }
.vp-samples .vp-sample { max-width: 100%; white-space: normal; text-align: left; }

/* ---- 結果 ---- */
html[data-ui="v2"] .sa-out .res-hero .big b { font-size: clamp(32px, 9vw, 44px); overflow-wrap: anywhere; }
html[data-ui="v2"] .sa-out .res-mini .v { overflow-wrap: anywhere; }
html[data-ui="v2"] .sa-out .res-mini .v small { white-space: nowrap; }
html[data-ui="v2"] .sa-out .res-mini .s { overflow-wrap: anywhere; }
html[data-ui="v2"] .sa-out .res-mini > div { min-width: 0; }
@media (max-width: 400px) { html[data-ui="v2"] .sa-out .res-mini .v { font-size: 15px; } }
.sa-rule-line { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); padding: 8px 10px; background: var(--page); border-radius: var(--r); }
/* 読み込み直後（計算の前）は欄の高さを確保する。計算が最初に外す（値は見込み。描画確認で直す） */
#resultPanel.sa-pending { min-height: 200px; }
#result { min-height: 0; }
/* 答えの中の箇条（好相性の要素・違い・注意点） */
#resultPanel [hidden] { display: none !important; }
.sa-h3 { margin: 18px 0 6px; font-size: 15px; }
.sa-note { margin-top: 12px; }
.sa-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* 出典での読み方（結果のすぐ下。答えを先に） */
.sa-verdict { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--surface); min-width: 0; }
.sa-verdict .sa-interp-tag { margin-top: 0; }
.sa-verdict p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.8; overflow-wrap: anywhere; }
.sa-verdict p.sa-v-main { font-size: 17px; font-weight: 700; color: var(--ink); }
.sa-verdict p.sa-v-note { font-size: 12.5px; color: var(--ink-2); }
#verdict:empty { display: none; }

/* 27宿の円の図 */
.sa-wheel { margin: 14px auto 0; max-width: 340px; min-width: 0; }
.sa-wheel:empty { display: none; }
.sa-wheel svg { display: block; width: 100%; height: auto; }
.sa-wheel figcaption { margin-top: 4px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.sa-w-g1 { fill: var(--accent-soft); }
.sa-w-g2 { fill: var(--page); }
.sa-w-g3 { fill: var(--grid); }
.sa-w-shuku, .sa-w-rel, .sa-w-center, .sa-w-center-s { text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.sa-w-shuku { font-size: 14px; }
.sa-w-rel { font-size: 12px; fill: var(--ink-2); }
.sa-w-rel.sa-w-good { font-weight: 700; fill: var(--ink); }
.sa-w-shuku.sa-w-me, .sa-w-shuku.sa-w-you, .sa-w-rel.sa-w-me, .sa-w-rel.sa-w-you { font-weight: 700; fill: var(--accent); }
.sa-w-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.sa-w-dot-me { fill: var(--accent); }
.sa-w-dot-you { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.sa-w-center { font-size: 26px; font-weight: 700; }
.sa-w-center-s { font-size: 11px; fill: var(--ink-2); }
.sa-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.sa-key-me { background: var(--accent); }
.sa-key-you { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }

/* 数え方ごとの比較表（選んでいる方式と違う所に印） */
html[data-ui="v2"] table.data.sa-cmp { width: 100%; }
html[data-ui="v2"] table.data.sa-cmp td { vertical-align: middle; white-space: normal; }
html[data-ui="v2"] table.data.sa-cmp td:first-child { min-width: 10em; }
html[data-ui="v2"] table.data.sa-cmp td:nth-child(2), html[data-ui="v2"] table.data.sa-cmp td:nth-child(3) { min-width: 3.5em; }
html[data-ui="v2"] table.data.sa-cmp td:last-child { min-width: 8em; }
html[data-ui="v2"] table.data.sa-cmp tr.sa-sel-row td { background: var(--accent-soft); }
html[data-ui="v2"] table.data.sa-cmp td.sa-diff { font-weight: 700; color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
html[data-ui="v2"] table.data.sa-cmp tr.sa-ref td { color: var(--ink-2); }
.sa-cmp-note { margin: 6px 0 0; }

/* 解釈（宿曜経と解説書の紹介）：計算と見た目で分ける */
.sa-interp-tag { display: inline-block; margin: 4px 0 8px; padding: 1px 10px; border-radius: 999px; font-size: 12px; background: var(--page); color: var(--ink-2); border: 1px solid var(--grid); }
.sa-interp-box { margin: 16px 0 0; padding: 12px 14px; border: 1px dashed var(--grid); border-radius: var(--r); background: var(--page); min-width: 0; }
.sa-in { min-width: 0; margin: 0 0 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); }
.sa-in > b { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.sa-in p { margin: 4px 0 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.sa-who { margin-right: 6px; }
.sa-in-note { margin: 4px 0 0; }
.sa-interp-sec .sa-interp-tag { margin-top: 0; }

/* ---- 早見表（27×27。1〜2文字なので .table-scroll の中で横に送る） ---- */
html[data-ui="v2"] table.data.sa-hy th, html[data-ui="v2"] table.data.sa-hy td { text-align: center; white-space: nowrap; padding: 3px 5px; font-size: 13px; }
html[data-ui="v2"] table.data.sa-hy tbody th { position: sticky; left: 0; background: var(--surface); }
html[data-ui="v2"] table.data.sa-hy td.sa-g0 { font-weight: 700; }
html[data-ui="v2"] table.data.sa-hy td.sa-g1 { background: var(--accent-soft); }
html[data-ui="v2"] table.data.sa-hy td.sa-g3 { background: var(--page); }
html[data-ui="v2"] table.data.sa-hy td.sa-hit { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- 本文 ---- */
.sa-formula { padding: 10px 12px; background: var(--page); border-radius: var(--r); overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.sa-pt th, html[data-ui="v2"] table.data.sa-pt td,
html[data-ui="v2"] table.data.sa-dt th, html[data-ui="v2"] table.data.sa-dt td { white-space: nowrap; text-align: center; }
html[data-ui="v2"] table.data.sa-bt { width: 100%; }
html[data-ui="v2"] table.data.sa-bt th, html[data-ui="v2"] table.data.sa-bt td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.sa-bt tbody th { white-space: nowrap; }
html[data-ui="v2"] table.data.sa-bt td { min-width: 8em; }
html[data-ui="v2"] table.data.sa-rt { width: 100%; }
html[data-ui="v2"] table.data.sa-rt th, html[data-ui="v2"] table.data.sa-rt td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.sa-rt tbody th { min-width: 6em; }
html[data-ui="v2"] table.data.sa-rt td { min-width: 10em; }
/* 狭い画面では、読み方の表・組の表・比較表を1行ずつ縦に並べる（横スクロールを出さない） */
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.sa-bt thead, html[data-ui="v2"] table.data.sa-cmp thead { display: none; }
  html[data-ui="v2"] table.data.sa-bt, html[data-ui="v2"] table.data.sa-bt tbody, html[data-ui="v2"] table.data.sa-bt tr,
  html[data-ui="v2"] table.data.sa-bt th, html[data-ui="v2"] table.data.sa-bt td,
  html[data-ui="v2"] table.data.sa-cmp, html[data-ui="v2"] table.data.sa-cmp tbody, html[data-ui="v2"] table.data.sa-cmp tr,
  html[data-ui="v2"] table.data.sa-cmp td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.sa-bt tr, html[data-ui="v2"] table.data.sa-cmp tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.sa-bt th, html[data-ui="v2"] table.data.sa-bt td, html[data-ui="v2"] table.data.sa-cmp td { border: 0; padding: 2px 8px; }
  html[data-ui="v2"] table.data.sa-cmp td:first-child, html[data-ui="v2"] table.data.sa-cmp td:last-child,
  html[data-ui="v2"] table.data.sa-cmp td:nth-child(2), html[data-ui="v2"] table.data.sa-cmp td:nth-child(3) { min-width: 0; }
  html[data-ui="v2"] table.data.sa-cmp td.sa-cmp-dash { display: none; }
  html[data-ui="v2"] table.data.sa-bt td[data-label]::before, html[data-ui="v2"] table.data.sa-cmp td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
  html[data-ui="v2"] table.data.sa-rt thead { display: none; }
  html[data-ui="v2"] table.data.sa-rt, html[data-ui="v2"] table.data.sa-rt tbody, html[data-ui="v2"] table.data.sa-rt tr,
  html[data-ui="v2"] table.data.sa-rt th, html[data-ui="v2"] table.data.sa-rt td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.sa-rt tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.sa-rt tbody th { border: 0; padding-bottom: 2px; }
  html[data-ui="v2"] table.data.sa-rt td { border: 0; padding-top: 2px; }
  html[data-ui="v2"] table.data.sa-rt td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
}
