/* ============================================================
   E-計算！ Fortune — 算命学の相性（sanmei-aisho.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラスは sma- で始める。
   入力欄・答えの表・解釈の札・比較表の形は、総合相性（sougou-aisho.css）と九星気学の相性（kyusei-aisho.css）とそろえた。
   ============================================================ */

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

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

/* ---- 結果 ---- */
html[data-ui="v2"] .sma-out .res-hero .big b { font-size: clamp(26px, 7.5vw, 38px); line-height: 1.3; overflow-wrap: anywhere; }
html[data-ui="v2"] .sma-out .res-hero .sub { overflow-wrap: anywhere; }
html[data-ui="v2"] .sma-out .res-mini > div { min-width: 0; }
html[data-ui="v2"] .sma-out .res-mini .v { overflow-wrap: anywhere; word-break: normal; font-size: 15px; line-height: 1.45; }
html[data-ui="v2"] .sma-out .res-mini .s { overflow-wrap: anywhere; }
.sma-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; }
/* 読み込み直後（計算の前）は欄の高さを確保する。計算が最初に外す（値は見込み。描画確認で直す） */
#resultPanel.sma-pending { min-height: 200px; }
#result { min-height: 0; }
/* 答えの中の項目（3つの分け方） */
.sma-ans-it { margin: 0 0 6px; }
.sma-ans-it:last-child { margin-bottom: 0; }
.sma-ans-it .sma-b { margin-left: 6px; vertical-align: 1px; }
.sma-out .sma-warn { display: block; }
.sma-none { color: var(--ink-2); font-size: 13.5px; }
#resultPanel [hidden] { display: none !important; }
.sma-h3 { margin: 18px 0 6px; font-size: 15px; }
.sma-note { margin-top: 12px; overflow-wrap: anywhere; }
.sma-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* 見るものごとの答えの表（結果の一番上） */
.sma-ans-wrap { margin-top: 12px; }
html[data-ui="v2"] table.data.sma-ans { width: 100%; }
html[data-ui="v2"] table.data.sma-ans th, html[data-ui="v2"] table.data.sma-ans td { vertical-align: middle; font-size: 13.5px; line-height: 1.6; }
html[data-ui="v2"] table.data.sma-ans td { min-width: 0; }
/* 共通 CSS の表の nowrap（ek.css）を、答えの表と比較表だけ折り返しに戻す（td.sma-what と .sma-b は nowrap のまま） */
html[data-ui="v2"] table.data.sma-ans td, html[data-ui="v2"] table.data.sma-cmp td { white-space: normal; }
html[data-ui="v2"] table.data.sma-ans td.sma-what { white-space: nowrap; font-weight: 700; }
html[data-ui="v2"] table.data.sma-ans td.sma-what .sub { white-space: normal; font-weight: 400; min-width: 5.5em; }
html[data-ui="v2"] table.data.sma-ans td:nth-child(2) { min-width: 8em; }
html[data-ui="v2"] table.data.sma-ans td:nth-child(3) { min-width: 6.5em; }
.sma-a { display: block; font-size: 16px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.sma-ans tr.sma-c-g td { background: var(--accent-soft); }
html[data-ui="v2"] table.data.sma-ans tr.sma-c-g td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sma-b { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.7; white-space: nowrap; border: 1px solid var(--grid); background: var(--surface); color: var(--ink-2); }
.sma-b-g { border-color: var(--accent); color: var(--accent); }
.sma-b-m { border-color: var(--accent); color: var(--ink); }
.sma-b-b { border-color: var(--ink-2); color: var(--ink); }
.sma-b-n { border-color: var(--muted); color: var(--muted); background: var(--page); }
.sma-ans-note { margin: 6px 0 0; }

/* 解釈（出典の本の読み方の紹介）：計算と見た目で分ける */
.sma-small { font-size: 13px; color: var(--ink-2); }

/* 数え方を変えた場合の比較表 */
html[data-ui="v2"] table.data.sma-cmp { width: 100%; }
html[data-ui="v2"] table.data.sma-cmp th, html[data-ui="v2"] table.data.sma-cmp td { vertical-align: middle; font-size: 13.5px; line-height: 1.6; }
html[data-ui="v2"] table.data.sma-cmp td.sma-what { white-space: nowrap; font-weight: 700; background: var(--page); }
html[data-ui="v2"] table.data.sma-cmp td { min-width: 8em; }
html[data-ui="v2"] table.data.sma-cmp tr.sma-sel-row td:not(.sma-what) { background: var(--accent-soft); }
html[data-ui="v2"] table.data.sma-cmp td.sma-diff { font-weight: 700; color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sma-cmp-note { margin: 6px 0 0; }
@media (max-width: 400px) {
  html[data-ui="v2"] table.data.sma-ans th, html[data-ui="v2"] table.data.sma-ans td,
  html[data-ui="v2"] table.data.sma-cmp th, html[data-ui="v2"] table.data.sma-cmp td,
  html[data-ui="v2"] table.data.sma-tbl th, html[data-ui="v2"] table.data.sma-tbl td { padding-left: 6px; padding-right: 6px; }
  .sma-a { font-size: 15px; }
  html[data-ui="v2"] table.data.sma-cmp td { min-width: 6em; }
}

/* ---- 本文 ---- */
html[data-ui="v2"] table.data.sma-tbl td, html[data-ui="v2"] table.data.sma-tbl th { vertical-align: top; font-size: 13.5px; line-height: 1.7; }
html[data-ui="v2"] table.data.sma-tbl td { min-width: 7em; }
html[data-ui="v2"] table.data.sma-tbl td:first-child { white-space: nowrap; min-width: 0; }

/* 並び（2026-10-18 改善の依頼）：要点を先に、出典ごとの文・注意は小さく。くわしい計算の根拠は折りたたみ */
.sma-key { margin: 0 0 6px; font-size: 15px; line-height: 1.75; color: var(--ink); }
.sma-detail { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.sma-detail p { margin: 0 0 4px; }
.sma-basis-h { margin-top: 22px; }
details.sma-fold { margin: 10px 0 0; border: 1px solid var(--grid); border-radius: var(--r); padding: 0 12px; background: var(--surface); min-width: 0; }
details.sma-fold > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
details.sma-fold[open] { padding-bottom: 10px; }
details.sma-fold .sma-rule-line { margin-top: 0; }

/* 狭い画面（2026-10-18 統括の点検）：答えの表は1行ずつのカード（占いの名前 → 2人の答え → 善し悪しの札の縦並び）、
   小さな箱は1列に。1280px などの広い画面は変えない */
@media (max-width: 560px) {
  html[data-ui="v2"] table.data.sma-tbl td, html[data-ui="v2"] table.data.sma-tbl td:first-child, html[data-ui="v2"] table.data.sma-cmp td, html[data-ui="v2"] table.data.sma-cmp td.sma-what { min-width: 0; white-space: normal; }
  html[data-ui="v2"] .sma-ans-wrap { overflow: visible; }
  html[data-ui="v2"] table.data.sma-ans, html[data-ui="v2"] table.data.sma-ans tbody,
  html[data-ui="v2"] table.data.sma-ans tr, html[data-ui="v2"] table.data.sma-ans td { display: block; width: 100%; }
  html[data-ui="v2"] table.data.sma-ans thead { display: none; }
  html[data-ui="v2"] table.data.sma-ans tr { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); }
  html[data-ui="v2"] table.data.sma-ans tr.sma-c-g { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  html[data-ui="v2"] table.data.sma-ans td, html[data-ui="v2"] table.data.sma-ans td.sma-what { min-width: 0; padding: 2px 0; border: 0; background: none; box-shadow: none; white-space: normal; }
  html[data-ui="v2"] table.data.sma-ans tr.sma-c-g td:first-child { box-shadow: none; }
  html[data-ui="v2"] table.data.sma-ans td.sma-what .sub { display: inline; margin-left: 6px; }
}
@media (max-width: 480px) {
  html[data-ui="v2"] .sma-out .res-mini { grid-template-columns: 1fr; }
  html[data-ui="v2"] .sma-out .res-mini > div, html[data-ui="v2"] .sma-out .res-mini > div + div { padding: 8px 0 0; border-left: 0; }
  html[data-ui="v2"] .sma-out .res-mini > div + div { margin-top: 8px; border-top: 1px solid var(--grid); }
}

/* 3つの分け方（2026-10-19。総合相性 sougou-aisho.css の末尾と同じ形）：好相性の要素・違い・注意点・関係の特徴の束。
   項目ごとに名前・答え・札 → 特徴の1〜2文 → 朱学院の説明（折りたたみ）。出典の判定は塗りと実線、このページの読み方は点線の枠 */
.sma-count { margin: 6px 0 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.sma-warn { margin: 6px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.sma-group { margin: 16px 0 0; min-width: 0; }
.sma-gh { margin: 0 0 2px; font-size: 16px; display: flex; align-items: baseline; gap: 8px; }
.sma-gn { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.sma-g-g .sma-gh { color: var(--accent); }
.sma-gnote { margin: 0 0 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.sma-item { margin: 0 0 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.75; }
.sma-i-g { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); border-color: transparent; }
.sma-i-c { box-shadow: inset 3px 0 0 var(--ink-2); }
.sma-ih { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.sma-cn { font-size: 13px; font-weight: 700; color: var(--accent); }
.sma-ca { font-size: 17px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; flex: 1 1 10em; }
.sma-item .sma-key { margin: 6px 0 4px; }
.sma-sub { margin: 0 0 4px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.sma-yomi-note { margin: 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.sma-yomi { display: inline-block; margin: 0 6px 2px 0; padding: 0 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.7; border: 2px dotted var(--accent); color: var(--accent); background: var(--surface); }
/* 札の形（2026-10-19 統括の決まり）：出典の札は実線、読み方の札と「このページの読み方」の印は点線 2px、「吉凶の決まりなし」は灰色の実線（地は page） */
.sma-nj { display: inline-block; margin: 0 6px 2px 0; padding: 0 8px; border-radius: 999px; font-size: 11.5px; line-height: 1.7; border: 1px solid var(--muted); color: var(--muted); background: var(--page); }
.sma-b-pg, .sma-b-pc { border-style: dotted; border-width: 2px; background: var(--page); font-weight: 600; }
.sma-b-pg { border-color: var(--accent); color: var(--accent); }
.sma-b-pc { border-color: var(--ink-2); color: var(--ink); }
/* 読み方で入れた項目は、出典の判定（塗りと実線）と分けて点線の枠だけにする */
.sma-item.sma-i-page { background: var(--surface); box-shadow: none; border: 2px dotted var(--grid); }
.sma-item.sma-i-page.sma-i-g { border-color: var(--accent); }
.sma-item.sma-i-page.sma-i-c { border-color: var(--ink-2); }
details.sma-icard { margin: 6px 0 0; }
details.sma-icard > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); padding: 6px 0; }
details.sma-list { margin-top: 14px; }
