/* ============================================================
   E-計算！ Fortune — 家族の相性（kazoku.html）だけで使う見た目
   共通（../assets/css/ek.css・css/fortune.css）の上に重ねる。色は変数だけを使う。クラスは kz- で始める。
   入力欄・3つの束・札（出典の判定＝塗りと実線、このページの読み方＝点線）の形は、総合相性（sougou-aisho.css）と同じにした。
   ============================================================ */

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

/* ---- 入力：1人ずつのカード ---- */
.kz-people { display: grid; gap: 10px; min-width: 0; }
.kz-person { padding: 10px 12px 4px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); min-width: 0; }
.kz-ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0 0 6px; min-width: 0; }
.kz-pn { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.kz-ops { display: flex; flex-wrap: wrap; gap: 6px; }
.kz-op { min-height: 32px; padding: 0 10px; font-size: 13px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.kz-op:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.kz-op:disabled { opacity: .4; cursor: default; }
.kz-op:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kz-row2 { display: flex; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
.kz-row2 > .field { flex: 1 1 9em; min-width: 0; }
html[data-ui="v2"] .kz-person select { max-width: 100%; width: 100%; height: 44px; }
.kz-date { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-ui="v2"] .kz-date input[type="text"], html[data-ui="v2"] input.kz-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"] .kz-date input[type="text"]:focus, html[data-ui="v2"] input.kz-text:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
html[data-ui="v2"] .kz-date input.bad, html[data-ui="v2"] input.kz-text.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
.kz-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;
}
.kz-pick:hover { background: var(--accent-soft); color: var(--accent); }
.kz-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kz-pick svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.kz-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"] .kz-date input[type="text"], html[data-ui="v2"] input.kz-text { font-size: 16px; } }
details.kz-more { margin: 0 0 6px; }
details.kz-more > summary { cursor: pointer; padding: 6px 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
details.kz-opt { margin: 10px 0 10px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 2px 0; }
details.kz-opt > summary { cursor: pointer; padding: 10px 2px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.kz-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.6; cursor: pointer; min-width: 0; }
.kz-check input { margin-top: 5px; flex: none; }
.kz-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.kz-addbtn { min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 700; border: 1px solid var(--accent); border-radius: var(--r); background: var(--surface); color: var(--accent); cursor: pointer; }
.kz-addbtn:disabled { opacity: .45; cursor: default; }
.kz-store { margin: 10px 0 8px; padding: 8px 10px; background: var(--page); border-radius: var(--r); font-size: 13px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.kz-store p { margin: 0 0 4px; }
.kz-store .kz-op { margin: 2px 6px 2px 0; }
.vp-samples .vp-sample { max-width: 100%; white-space: normal; text-align: left; }

/* ---- 結果 ---- */
html[data-ui="v2"] .kz-out .res-hero .big b { font-size: clamp(22px, 6.2vw, 32px); line-height: 1.35; overflow-wrap: anywhere; }
html[data-ui="v2"] .kz-out .res-hero .sub { overflow-wrap: anywhere; }
html[data-ui="v2"] .kz-out .res-mini > div { min-width: 0; }
html[data-ui="v2"] .kz-out .res-mini .v { overflow-wrap: anywhere; word-break: normal; font-size: 15px; line-height: 1.45; }
html[data-ui="v2"] .kz-out .res-mini .s { overflow-wrap: anywhere; }
@media (min-width: 481px) { html[data-ui="v2"] .kz-out .res-mini { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) {
  html[data-ui="v2"] .kz-out .res-mini { grid-template-columns: 1fr; }
  html[data-ui="v2"] .kz-out .res-mini > div, html[data-ui="v2"] .kz-out .res-mini > div + div { padding: 8px 0 0; border-left: 0; }
  html[data-ui="v2"] .kz-out .res-mini > div + div { margin-top: 8px; border-top: 1px solid var(--grid); }
}
/* 読み込み直後（計算の前）は欄の高さを確保する。計算が最初に外す（値は見込み。描画確認で直す） */
#resultPanel.kz-pending { min-height: 900px; }
#result { min-height: 120px; }
#resultPanel [hidden] { display: none !important; }
.kz-h3 { margin: 22px 0 6px; font-size: 16px; }
.kz-lead { margin: 0 0 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.kz-note { margin-top: 12px; overflow-wrap: anywhere; }
.kz-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }
.kz-rule-line { margin: 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; }
details.kz-fold { margin: 10px 0 0; border: 1px solid var(--grid); border-radius: var(--r); padding: 0 12px; background: var(--surface); min-width: 0; }
details.kz-fold > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
details.kz-fold[open] { padding-bottom: 10px; }
.kz-fold p, .kz-fold li { font-size: 13.5px; line-height: 1.75; overflow-wrap: anywhere; }
.kz-small { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }

/* 相性表（N×N のマス）。マスはボタン。狭い画面ではマスの表をやめて組ごとのカードにする */
html[data-ui="v2"] table.data.kz-mx { width: 100%; }
html[data-ui="v2"] table.data.kz-mx th, html[data-ui="v2"] table.data.kz-mx td { padding: 4px; vertical-align: middle; text-align: center; font-size: 12.5px; line-height: 1.45; }
html[data-ui="v2"] table.data.kz-mx th { white-space: normal; min-width: 4.5em; overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.kz-mx td { white-space: normal; min-width: 5.5em; }
html[data-ui="v2"] table.data.kz-mx td.kz-self { background: var(--page); color: var(--muted); }
.kz-cell { display: block; width: 100%; min-height: 48px; padding: 6px 4px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: 12.5px; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere; }
.kz-cell:hover { border-color: var(--accent); }
.kz-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kz-cell.kz-c-g { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); border-color: transparent; }
.kz-cell.kz-c-c { box-shadow: inset 3px 0 0 var(--ink-2); }
.kz-cell[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.kz-plist { display: none; }
.kz-pcard { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; margin: 0 0 8px; padding: 8px 10px; text-align: left; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; }
.kz-pcard b { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.kz-pcard span { font-size: 13.5px; overflow-wrap: anywhere; min-width: 0; }
.kz-pcard.kz-c-g { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); border-color: transparent; }
.kz-pcard.kz-c-c { box-shadow: inset 3px 0 0 var(--ink-2); }
.kz-pcard[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) {
  html[data-ui="v2"] .kz-mxwrap { display: none; }
  .kz-plist { display: block; }
}

/* 選んだ2人の内訳（総合相性の3つの束と同じ形） */
.kz-pair { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--page); min-width: 0; overflow-wrap: anywhere; }
.kz-pair-h { margin: 0 0 2px; font-size: 16px; }
.kz-pair-big { margin: 4px 0 2px; font-size: 18px; font-weight: 700; color: var(--ink); }
.kz-pair-who { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-2); }
.kz-pair-hl { margin: 0 0 4px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.kz-group { margin: 14px 0 0; min-width: 0; }
.kz-gh { margin: 0 0 2px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.kz-gn { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kz-g-g .kz-gh { color: var(--accent); }
.kz-gnote { margin: 0 0 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.kz-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; }
.kz-i-g { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); border-color: transparent; }
.kz-i-c { box-shadow: inset 3px 0 0 var(--ink-2); }
.kz-item.kz-ref { background: var(--surface); }
.kz-ih { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.kz-cn { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; text-decoration: none; }
.kz-cn:hover { text-decoration: underline; }
.kz-ca { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; flex: 1 1 10em; }
.kz-key { margin: 6px 0 4px; font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.kz-sub { margin: 0 0 4px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.kz-yomi-note { margin: 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.kz-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); }
.kz-b-g { border-color: var(--accent); color: var(--accent); }
.kz-b-m { border-color: var(--accent); color: var(--ink); background: var(--page); }
.kz-b-b { border-color: var(--ink-2); color: var(--ink); }
.kz-b-n { color: var(--muted); }
/* 札の形：出典の札はどれも実線。このページの読み方の札・印は点線 2px。吉凶の決まりなしの印は灰色の実線 */
.kz-b-pg, .kz-b-pc { border-style: dotted; border-width: 2px; background: var(--page); font-weight: 600; }
.kz-b-pg { border-color: var(--accent); color: var(--accent); }
.kz-b-pc { border-color: var(--ink-2); color: var(--ink); }
.kz-item.kz-i-page { background: var(--surface); box-shadow: none; border: 2px dotted var(--grid); }
.kz-item.kz-i-page.kz-i-g { border-color: var(--accent); }
.kz-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); }
.kz-nokime { 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(--grid); color: var(--muted); background: var(--page); }
details.kz-card { margin: 6px 0 0; padding: 0 12px; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; min-width: 0; }
details.kz-card > summary { cursor: pointer; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--accent); }
details.kz-card[open] { padding-bottom: 10px; }
.kz-detail { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.kz-detail p { margin: 0 0 4px; }
.kz-who { display: block; font-size: 13px; color: var(--ink-2); }
.kz-case { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kz-books { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 4px; }
.kz-books li { padding: 6px 8px; background: var(--page); border-radius: var(--r); }
.kz-books li b { display: block; font-size: 12.5px; color: var(--ink-2); }
.kz-more-link { margin: 8px 0 0; font-size: 13px; }

/* 家族のバランス（帯） */
.kz-bal { margin: 10px 0 0; min-width: 0; }
.kz-bal-h { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--ink); }
.kz-band { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.kz-band.kz-band-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kz-bc { padding: 6px 6px 8px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.kz-bc b { display: block; font-size: 16px; line-height: 1.3; color: var(--ink); }
.kz-bc .kz-bn { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.kz-bc .kz-bw { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.45; color: var(--ink-2); }
.kz-bar { display: block; height: 6px; margin: 4px 0 0; border-radius: 3px; background: var(--grid); overflow: hidden; }
.kz-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.kz-bc.kz-many { border-color: var(--accent); background: var(--accent-soft); }
.kz-bc.kz-zero { background: var(--page); }
.kz-bc.kz-zero b { color: var(--muted); }
.kz-read { margin: 8px 0 0; font-size: 13.5px; line-height: 1.75; overflow-wrap: anywhere; }
.kz-read-page { margin: 8px 0 0; padding: 8px 10px; border: 2px dotted var(--accent); border-radius: var(--r); background: var(--surface); font-size: 13.5px; line-height: 1.75; overflow-wrap: anywhere; }

/* 関わり方の図（九星の五行の向き） */
.kz-fig { margin: 8px 0 0; min-width: 0; }
.kz-svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.kz-svg .kz-e { fill: none; stroke-width: 1.2; stroke: var(--grid); }
.kz-svg .kz-e-sei { stroke: var(--accent); stroke-width: 3; }
.kz-svg .kz-e-koku { stroke: var(--ink-2); stroke-width: 2.2; }
.kz-svg .kz-mk-sei { fill: var(--accent); }
.kz-svg .kz-mk-koku { fill: var(--ink-2); }
.kz-svg .kz-mk-off { fill: var(--grid); }
.kz-svg .kz-nd { fill: var(--surface); stroke: var(--grid); stroke-width: 1.5; }
.kz-svg .kz-nd-on { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.kz-svg .kz-nt { fill: var(--ink); font-size: 17px; font-weight: 700; }
.kz-svg .kz-nc { fill: var(--ink-2); font-size: 11px; }
.kz-svg .kz-off { fill: var(--muted); }
.kz-legend { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.kz-legend i { display: inline-block; width: 22px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 3px solid var(--accent); }
.kz-legend i.kz-lk { border-top: 2px solid var(--ink-2); }
.kz-flist { margin: 8px 0 0; padding: 0 0 0 1.2em; font-size: 13.5px; line-height: 1.75; }
.kz-flist li { overflow-wrap: anywhere; }

/* 宿曜・六親・1人ずつの表 */
html[data-ui="v2"] table.data.kz-tb th, html[data-ui="v2"] table.data.kz-tb td { padding: 4px 6px; vertical-align: middle; text-align: center; font-size: 12.5px; line-height: 1.5; white-space: normal; min-width: 4em; overflow-wrap: anywhere; }
html[data-ui="v2"] table.data.kz-tb td.kz-self { background: var(--page); color: var(--muted); }
html[data-ui="v2"] table.data.kz-tb td.kz-sk-g { background: var(--accent-soft); }
.kz-tag { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
.kz-tag-same { color: var(--accent); font-weight: 700; }
html[data-ui="v2"] table.data.kz-ppl th, html[data-ui="v2"] table.data.kz-ppl td { padding: 6px 8px; vertical-align: top; text-align: left; font-size: 13px; line-height: 1.55; white-space: nowrap; }
html[data-ui="v2"] table.data.kz-ppl td small { display: block; font-size: 11.5px; color: var(--ink-2); }

/* ---- 本文 ---- */
html[data-ui="v2"] table.data.kz-art td, html[data-ui="v2"] table.data.kz-art th { vertical-align: top; font-size: 13.5px; line-height: 1.7; text-align: left; white-space: normal; }
html[data-ui="v2"] table.data.kz-art td { min-width: 7em; }
html[data-ui="v2"] table.data.kz-art td:first-child { white-space: nowrap; min-width: 0; }
@media (max-width: 400px) {
  html[data-ui="v2"] table.data.kz-art th, html[data-ui="v2"] table.data.kz-art td,
  html[data-ui="v2"] table.data.kz-tb th, html[data-ui="v2"] table.data.kz-tb td { padding-left: 4px; padding-right: 4px; }
}

/* 2026-10-24 点検：内訳の「向きを入れ替える」ボタン、狭い画面の帯は1行ずつ（名前が細かく折れないように） */
.kz-swap { margin: 2px 0 0 8px; }
@media (max-width: 480px) {
  .kz-band, .kz-band.kz-band-4 { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .kz-bc { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 4px 8px; }
  .kz-bc b { display: inline; font-size: 15px; min-width: 1.4em; }
  .kz-bc .kz-bn { display: inline; min-width: 2.6em; }
  .kz-bar { flex: 1 1 60px; margin: 0; min-width: 0; }
  .kz-bc .kz-bw { flex: 1 1 100%; margin: 0; font-size: 12px; }
}

/* 2026-10-24 点検：8人の相性表などが横に流れても、だれの行か分かるように左の列（行の人）を固定する */
html[data-ui="v2"] table.data.kz-mx th[scope="row"], html[data-ui="v2"] table.data.kz-mx thead th:first-child,
html[data-ui="v2"] table.data.kz-tb th[scope="row"], html[data-ui="v2"] table.data.kz-tb thead th:first-child,
html[data-ui="v2"] table.data.kz-ppl th[scope="row"], html[data-ui="v2"] table.data.kz-ppl thead th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--grid);
}

/* 表はシンプル・中身はたたむ（2026-11-04。<main data-layout="simple">）：一人ひとりの相性は MS.items の1行ずつ。押すと7つの答えと内訳のボタン */
main[data-layout="simple"] .kz-mh { margin-top: 18px; }
main[data-layout="simple"] .kz-out .ms-items { margin-top: 4px; }
dl.kz-mdl { display: grid; grid-template-columns: 5.5em 1fr; gap: 2px 10px; margin: 4px 0 6px; font-size: 14px; line-height: 1.7; }
dl.kz-mdl dt { margin: 0; color: var(--ink-2); font-size: 13px; }
dl.kz-mdl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kz-mbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.kz-how-lead { margin: 0 0 4px; font-size: 13.5px; line-height: 1.75; overflow-wrap: anywhere; }
.ms-ans details.kz-head-more { margin-top: 10px; }
main[data-layout="simple"] #mxBox .kz-lead { margin-top: 2px; }
