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

/* 要点（解説の最初） */
.sy-quick { margin: 4px 0 20px; }
.sy-quick ul { margin: 2px 0 0; }
.sy-quick li { margin: 2px 0; }

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

/* ---- 結果 ---- */
html[data-ui="v2"] .sy-out .res-hero .big b { font-size: clamp(32px, 9vw, 44px); overflow-wrap: normal; }
html[data-ui="v2"] .sy-out .res-mini .v { overflow-wrap: normal; word-break: keep-all; }
html[data-ui="v2"] .sy-out .res-mini .v small { white-space: nowrap; }
html[data-ui="v2"] .sy-out .res-mini .s { overflow-wrap: anywhere; }
html[data-ui="v2"] .sy-out .res-mini > div { min-width: 0; }
@media (max-width: 400px) { html[data-ui="v2"] .sy-out .res-mini .v { font-size: 15px; } }
.sy-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.sy-pending { min-height: 620px; }
#result { min-height: 230px; }
.sy-detail { margin: 6px 0 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); overflow-wrap: anywhere; }
#resultPanel [hidden] { display: none !important; }
.sy-h3 { margin: 18px 0 6px; font-size: 15px; }
.sy-note { margin-top: 12px; }
.sy-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.sy-ml { width: 100%; }
html[data-ui="v2"] table.data.sy-ml td { white-space: nowrap; vertical-align: middle; }
html[data-ui="v2"] table.data.sy-ml tr.hit td { background: var(--accent-soft); font-weight: 600; }

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

/* 解釈（宿曜経の説明の紹介）：計算と見た目で分ける */
.sy-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); }
.sy-interp-box { margin: 16px 0 0; padding: 12px 14px; border: 1px dashed var(--grid); border-radius: var(--r); background: var(--page); min-width: 0; }
.sy-interp-box .sy-h3 { margin-top: 10px; }
.sy-in-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 560px) { .sy-in-grid { grid-template-columns: minmax(0, 1fr); } }
.sy-in { min-width: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); }
.sy-in b { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.sy-in p { margin: 0; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.sy-in-note { margin: 4px 0 6px; }
.sy-ke { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--ink-2); }
.sy-interp-sec .sy-interp-tag { margin-top: 0; }

/* ---- 早見表（旧暦の月×日。1文字ずつなので狭い画面でも枠の中に収まる） ---- */
html[data-ui="v2"] table.data.sy-hy { width: 100%; }
html[data-ui="v2"] table.data.sy-hy th, html[data-ui="v2"] table.data.sy-hy td { text-align: center; white-space: nowrap; padding: 4px 6px; }
html[data-ui="v2"] table.data.sy-hy td.hit { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 400px) { html[data-ui="v2"] table.data.sy-hy th, html[data-ui="v2"] table.data.sy-hy td { padding: 3px 3px; font-size: 13px; } }

/* ---- 本文 ---- */
.sy-formula { padding: 10px 12px; background: var(--page); border-radius: var(--r); }
html[data-ui="v2"] table.data.sy-mt td { white-space: nowrap; }
html[data-ui="v2"] table.data.sy-it, html[data-ui="v2"] table.data.sy-kt { width: 100%; }
html[data-ui="v2"] table.data.sy-it th, html[data-ui="v2"] table.data.sy-it td,
html[data-ui="v2"] table.data.sy-kt th, html[data-ui="v2"] table.data.sy-kt td { white-space: normal; vertical-align: top; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.sy-it tbody th { min-width: 8em; }
html[data-ui="v2"] table.data.sy-it td, html[data-ui="v2"] table.data.sy-kt td:last-child { min-width: 14em; }
html[data-ui="v2"] table.data.sy-kt tbody th { white-space: nowrap; }
/* 狭い画面では、性格・区分の表を1行ずつ縦に並べる（横スクロールを出さない） */
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.sy-it thead, html[data-ui="v2"] table.data.sy-kt thead { display: none; }
  html[data-ui="v2"] table.data.sy-it, html[data-ui="v2"] table.data.sy-it tbody, html[data-ui="v2"] table.data.sy-it tr,
  html[data-ui="v2"] table.data.sy-it th, html[data-ui="v2"] table.data.sy-it td,
  html[data-ui="v2"] table.data.sy-kt, html[data-ui="v2"] table.data.sy-kt tbody, html[data-ui="v2"] table.data.sy-kt tr,
  html[data-ui="v2"] table.data.sy-kt th, html[data-ui="v2"] table.data.sy-kt td { display: block; width: auto; min-width: 0; }
  html[data-ui="v2"] table.data.sy-it tr, html[data-ui="v2"] table.data.sy-kt tr { border-top: 2px solid var(--grid); padding: 6px 0; }
  html[data-ui="v2"] table.data.sy-it tbody th, html[data-ui="v2"] table.data.sy-kt tbody th { border: 0; padding-bottom: 2px; }
  html[data-ui="v2"] table.data.sy-it td, html[data-ui="v2"] table.data.sy-kt td { border: 0; padding-top: 2px; }
  html[data-ui="v2"] table.data.sy-it td::before, html[data-ui="v2"] table.data.sy-kt td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); }
}
