/* ============================================================
   E-計算！ Fortune — 生年月日の総合占い（sougou.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラスは sg- で始める。
   入力欄の形は数秘術・12星座のページ（css/suuhijutsu.css・css/seiza.css）にそろえた。
   ============================================================ */

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

/* ---- 入力 ---- */
/* 日付の入力欄（ふつうの文字の欄＋カレンダーのボタン） */
.sg-date { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-ui="v2"] .sg-date input[type="text"], html[data-ui="v2"] input.sg-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"] .sg-date input[type="text"]:focus, html[data-ui="v2"] input.sg-text:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
html[data-ui="v2"] .sg-date input.bad, html[data-ui="v2"] input.sg-text.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
.sg-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;
}
.sg-pick:hover { background: var(--accent-soft); color: var(--accent); }
.sg-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sg-pick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sg-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"] .sg-date input[type="text"], html[data-ui="v2"] input.sg-text { font-size: 16px; } }
details.sg-more { margin: 4px 0 14px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 2px 0; }
details.sg-more > summary { cursor: pointer; padding: 10px 2px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
details.sg-more[open] > summary { margin-bottom: 4px; }
.sg-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.6; cursor: pointer; min-width: 0; }
.sg-check input { margin-top: 5px; flex: none; }
.sg-hint { margin: 6px 0 0; }
.vp-samples .vp-sample { max-width: 100%; white-space: normal; text-align: left; }

/* ---- 結果 ---- */
/* 読み込み直後（計算の前）は欄の高さを確保する。計算が最初に外す（値は見込み。描画確認で直す） */
#resultPanel.sg-pending { min-height: 900px; }
#result { min-height: 0; }
/* 計算できたとき（一番上の表がある）だけ高さを確保する。エラーのときは下が空かないように */
#result:has(.sg-top) { min-height: 420px; }
#resultPanel [hidden] { display: none !important; }
.sg-h3 { margin: 18px 0 6px; font-size: 15px; }
.sg-head { margin: 0 0 8px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.sg-head small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }

/* 一番上：9つの答えの一覧 */
html[data-ui="v2"] table.data.sg-top { width: 100%; }
html[data-ui="v2"] table.data.sg-top th, html[data-ui="v2"] table.data.sg-top td { vertical-align: middle; white-space: normal; overflow-wrap: anywhere; text-align: left; }
html[data-ui="v2"] table.data.sg-top tbody th { width: 40%; min-width: 0; font-size: 13.5px; font-weight: 600; text-align: left; }
html[data-ui="v2"] table.data.sg-top tbody th a { color: inherit; }
html[data-ui="v2"] table.data.sg-top td b { font-size: 18px; line-height: 1.4; color: var(--accent); }
html[data-ui="v2"] table.data.sg-top td .sub, html[data-ui="v2"] table.data.sg-top th .sub { white-space: normal; }
@media (max-width: 400px) {
  html[data-ui="v2"] table.data.sg-top th, html[data-ui="v2"] table.data.sg-top td { padding-left: 6px; padding-right: 6px; }
  html[data-ui="v2"] table.data.sg-top td b { font-size: 16px; }
}
.sg-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); overflow-wrap: anywhere; }

/* 占いごとの答えと解釈 */
.sg-cards { display: grid; gap: 12px; margin: 16px 0 0; }
.sg-card { min-width: 0; padding: 12px 14px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); }
.sg-card h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.sg-card h3 .sg-no { display: inline-block; min-width: 1.6em; color: var(--ink-2); font-weight: 600; }
.sg-kind { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 400; vertical-align: 2px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.sg-ans { margin: 0 0 6px; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.sg-ans b { font-size: 17px; color: var(--accent); }
.sg-detail { margin: 0 0 6px; font-size: 13px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.sg-notes { margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r) var(--r) 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.sg-notes p { margin: 0; }
.sg-notes p + p { margin-top: 4px; }
/* 解釈（本の説明の紹介）：計算と見た目で分ける */
.sg-in { margin: 6px 0 0; padding: 8px 10px; background: var(--page); border: 1px dashed var(--grid); border-radius: var(--r); min-width: 0; }
.sg-in + .sg-in { margin-top: 6px; }
.sg-tag { display: inline-block; margin: 0 0 4px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--grid); }
.sg-in b { display: block; font-size: 13px; margin: 0 0 2px; }
.sg-in p { margin: 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.sg-in p.sg-in-note { margin-top: 4px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
/* 折りたたみ（計算の根拠・途中の計算） */
details.sg-fold { margin: 10px 0 0; border: 1px solid var(--grid); border-radius: var(--r); padding: 0 12px; background: var(--surface); min-width: 0; }
details.sg-fold > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
details.sg-fold[open] { padding-bottom: 10px; }
details.sg-fold.sg-card-more { border: 0; padding: 0; margin: 4px 0 0; background: none; }
details.sg-fold.sg-card-more > summary { padding: 4px 0; font-size: 12.5px; }
.sg-in p.sg-pt { font-size: 14.5px; }
.sg-in p.sg-src { margin: 4px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.sg-src .sg-tag { margin: 0 6px 0 0; }
.sg-card-foot { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.sg-card-foot a { font-weight: 600; }
.sg-interp-note { margin: 10px 0 0; }

/* 生まれた日の暦 */
html[data-ui="v2"] table.data.sg-ko { width: 100%; }
html[data-ui="v2"] table.data.sg-ko th, html[data-ui="v2"] table.data.sg-ko td { text-align: left; white-space: normal; vertical-align: top; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
html[data-ui="v2"] table.data.sg-ko tbody th { width: 5.5em; min-width: 5.5em; font-weight: 600; text-align: left; }

/* ほかの方式で数えると */
html[data-ui="v2"] table.data.sg-cmp { width: 100%; }
html[data-ui="v2"] table.data.sg-cmp th, html[data-ui="v2"] table.data.sg-cmp td { text-align: left; white-space: normal; vertical-align: top; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.sg-cmp tbody th { min-width: 6.5em; font-weight: 600; text-align: left; }
html[data-ui="v2"] table.data.sg-cmp td { min-width: 8em; }
html[data-ui="v2"] table.data.sg-cmp tr.sg-diff th { box-shadow: inset 3px 0 0 var(--accent); }
.sg-o { display: block; }
.sg-o + .sg-o { margin-top: 4px; }
.sg-o.sg-d b { color: var(--accent); }
.sg-o .sub { display: block; font-size: 11.5px; color: var(--muted); }
.sg-cmp-note { margin: 6px 0 0; }
/* 狭い画面では、比較表と暦の表を1行ずつ縦に並べる（横スクロールを出さない） */
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.sg-cmp thead { display: none; }
  html[data-ui="v2"] table.data.sg-cmp, html[data-ui="v2"] table.data.sg-cmp tbody, html[data-ui="v2"] table.data.sg-cmp tr,
  html[data-ui="v2"] table.data.sg-cmp th, html[data-ui="v2"] table.data.sg-cmp td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.sg-cmp tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.sg-cmp tbody th { border: 0; padding-bottom: 2px; }
  html[data-ui="v2"] table.data.sg-cmp td { border: 0; padding-top: 2px; }
  html[data-ui="v2"] table.data.sg-cmp td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
}
.sg-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* ---- 本文 ---- */
html[data-ui="v2"] table.data.sg-see { width: 100%; }
html[data-ui="v2"] table.data.sg-see th, html[data-ui="v2"] table.data.sg-see td { text-align: left; white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.sg-see td.sg-k { white-space: nowrap; }
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.sg-see thead { display: none; }
  html[data-ui="v2"] table.data.sg-see, html[data-ui="v2"] table.data.sg-see tbody, html[data-ui="v2"] table.data.sg-see tr,
  html[data-ui="v2"] table.data.sg-see th, html[data-ui="v2"] table.data.sg-see td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.sg-see tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.sg-see th, html[data-ui="v2"] table.data.sg-see td { border: 0; padding-top: 2px; padding-bottom: 2px; }
  html[data-ui="v2"] table.data.sg-see td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
}
