/* ============================================================
   E-計算！ Fortune — 共通CSS（../assets/css/ek.css の v2 層の上に重ねる）
   2026-10-16 作成。中身は math/css/math.css と同じ部品（vp-・ms- の名前もそのまま）。
   分野の色（金茶 #7A5410）は ../assets/css/ek.css 末尾の「分野の色」にある。
   ============================================================ */


main form [hidden] { display: none !important; }
.formula .fl { display: block; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---- 名前と数を並べる入力表 ---- */
.vp-rows { display: grid; gap: 8px; }
.vp-row { display: grid; grid-template-columns: 1.4fr 1fr 36px; gap: 8px; align-items: center; }
/* 入力欄は共通CSSの .input-unit input と同じ見た目（名前は左寄せ、数は右寄せ） */
.vp-row input {
  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);
}
.vp-row input.vp-w { text-align: right; }
.vp-row input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.vp-row input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
table.data th .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.vp-head { display: grid; grid-template-columns: 1.4fr 1fr 36px; gap: 8px; font-size: 12px; color: var(--muted); }
.vp-del { width: 36px; height: 36px; border: 0; border-radius: var(--r); background: var(--page); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.vp-del:hover { background: var(--accent-soft); color: var(--accent); }
.vp-del:disabled { opacity: .35; cursor: default; }
.vp-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; font-size: 13px; }
.vp-add, .vp-sample { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.vp-add:disabled { opacity: .4; cursor: default; }
.vp-samples { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 4px 0 14px; font-size: 13px; color: var(--ink-2); }

/* ---- 結果の表 ---- */
.vp-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.vp-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.vp-tag.zero { background: var(--page); color: var(--muted); }
.vp-mwc { margin: 8px 0 0; padding-left: 1.4em; max-height: 320px; overflow: auto; font-size: 13.5px; }
.vp-frac { font-variant-numeric: tabular-nums; }

/* ---- 項目ごとの横棒（MS.groupBars） ---- */
.ms-chart { margin: 22px 0 0; padding: 18px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); min-width: 0; }
.ms-chart figcaption { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 10px; line-height: 1.6; }
.ms-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0 0 14px; font-size: 12px; color: var(--ink-2); }
.ms-legend li { display: flex; align-items: center; gap: 6px; }
.ms-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ms-bars { list-style: none; padding: 0; margin: 0; }
.ms-bars > li { margin: 0 0 14px; }
.ms-bar-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.ms-bar { display: grid; grid-template-columns: 1fr 64px; gap: 8px; align-items: center; margin-bottom: 3px; }
.ms-bar b { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.ms-bar b small { font-size: 10px; font-weight: 400; color: var(--muted); }
.ms-track { display: block; height: 10px; border-radius: 3px; background: var(--page); overflow: hidden; }
.ms-fill { display: block; height: 100%; border-radius: 3px; }
.ms-fill.s-share, .ms-legend i.s-share { background: color-mix(in srgb, var(--ink) 28%, var(--surface)); }
.ms-fill.s-ssi, .ms-legend i.s-ssi { background: var(--accent); }
.ms-fill.s-bz, .ms-legend i.s-bz { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.ms-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ms-chart-note { font-size: 11.5px; color: var(--ink-2); line-height: 1.8; padding-top: 12px; margin: 6px 0 0; border-top: 1px solid var(--grid); }

/* ---- 入力の案内（入力欄のすぐ下。role="status" で読み上げにも伝わる） ---- */
.vp-msg { margin: 8px 0 0; font-size: 13px; line-height: 1.7; color: var(--tint-warn-ink, #8A4B00); }
.vp-msg.info { color: var(--muted); }
.vp-msg:empty { display: none; }
/* 単位が空のとき（「数」で指定）は単位の欄を出さない */
.input-unit .unit:empty { display: none; }
/* 表の見出しの補足は折り返してよい（狭い画面で列が押し出されないように） */
table.data th.n .sub { white-space: normal; word-break: keep-all; }
/* 立場の列は折り返してよい（狭い画面で横にはみ出さないように） */
table.data td.vp-pos { white-space: normal; min-width: 7em; }

/* ============================================================
   表はシンプル・中身はたたむ（2026-11-04 試作。<main data-layout="simple"> のページだけ。sougou・kyusei・tarot）
   表＝題名・1〜2行の説明・入力。答え＝結果の一番上に具体的な読み。中と裏＝解説は <details> でたたむ（本文は HTML に残す）
   部品は js/fortune.js の MS.answer・MS.items・MS.wait
   ============================================================ */
html[data-ui="v2"] main[data-layout="simple"] .breadcrumb { margin-top: 14px; }
html[data-ui="v2"] main[data-layout="simple"] .page-title { margin: 4px 0 6px; }
html[data-ui="v2"] main[data-layout="simple"] .page-lede { margin-bottom: 4px; }
html[data-ui="v2"] main[data-layout="simple"] .byline { margin: 0 0 14px; font-size: 12px; }
/* 入力：「占う」ボタンは入力欄のすぐ下。くわしい条件と例はその下 */
html[data-ui="v2"] main[data-layout="simple"] form .btn-calc { margin-bottom: 12px; }
main[data-layout="simple"] #resultPanel { scroll-margin-top: 64px; }
@media (max-width: 560px) {
  html[data-ui="v2"] main[data-layout="simple"] .page-title { font-size: 21px; line-height: 1.4; }
  html[data-ui="v2"] main[data-layout="simple"] .page-lede { font-size: 14px; line-height: 1.7; }
}

/* ---- 入力の前の案内 ---- */
.ms-wait { margin: 4px 0 0; padding: 18px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--page); color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
/* 入力の前（案内だけ）は、結果の欄の高さを取らない（ページの #result の min-height より強く） */
main[data-layout="simple"] #result:has(> .ms-wait) { min-height: 0; }
/* 答えの欄の中の短い箇条書き（MS.pts） */
.ms-pts { margin: 0; padding-left: 1.2em; }
.ms-pts li { margin: 0 0 3px; }
.ms-pts li:last-child { margin-bottom: 0; }

/* ---- 答え（結果の一番上） ---- */
.ms-ans { min-width: 0; }
.ms-ans-k { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.ms-ans-big { margin: 2px 0 0; line-height: 1.2; overflow-wrap: anywhere; }
.ms-ans-big b { font-size: 38px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.ms-ans-big small { margin-left: 8px; font-size: 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ms-ans-lead { margin: 8px 0 0; font-size: 15.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.ms-ans-lead b { color: var(--accent); }
.ms-ans-fig { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start; }
.ms-ans-fig > :first-child { min-width: 0; }
.ms-ans-main { min-width: 0; }
.ms-kw { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.ms-kw li { margin: 0; padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; line-height: 1.6; }
.ms-kw-src { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
/* 具体的な読みの並び（見出し｜答え） */
.ms-read { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--grid); }
.ms-read > li { display: grid; grid-template-columns: 6.6em 1fr; gap: 2px 12px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.ms-read-k { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.7; overflow-wrap: anywhere; }
.ms-read-v { min-width: 0; font-size: 14.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.ms-read-v > b { font-size: 16px; color: var(--accent); }
.ms-read-s { display: block; font-size: 13.5px; color: var(--ink-2); }
.ms-src { display: inline-block; margin-top: 2px; padding: 0 8px; border: 1px solid var(--grid); border-radius: 999px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.ms-read .ms-kw { margin: 4px 0 0; }
/* 恋愛・仕事・お金のように、見出しと短い読みを並べる */
dl.ms-dl { display: grid; grid-template-columns: 2.6em 1fr; gap: 4px 8px; margin: 0; }
dl.ms-dl dt { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); line-height: 1.75; }
dl.ms-dl dd { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ms-read .ms-kw li { padding: 1px 9px; font-size: 12.5px; }
@media (max-width: 420px) {
  .ms-read > li { grid-template-columns: 1fr; }
  .ms-ans-big b { font-size: 32px; }
  .ms-ans-fig { grid-template-columns: 84px 1fr; gap: 12px; }
}

/* ---- 押すと開く答えの一覧（MS.items） ---- */
.ms-items { margin: 10px 0 0; border-top: 1px solid var(--grid); }
details.ms-item { border-bottom: 1px solid var(--grid); min-width: 0; }
details.ms-item > summary { list-style: none; cursor: pointer; position: relative; display: block; padding: 10px 26px 10px 2px; min-width: 0; }
details.ms-item > summary::-webkit-details-marker { display: none; }
details.ms-item > summary::after { content: ""; position: absolute; right: 6px; top: 20px; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform .15s; }
details.ms-item[open] > summary::after { transform: rotate(-135deg); top: 24px; }
details.ms-item > summary:hover .ms-item-v b { text-decoration: underline; text-underline-offset: 3px; }
details.ms-item > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ms-item-k { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }
.ms-item-k small { margin-left: 6px; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ms-item-v { display: block; line-height: 1.45; overflow-wrap: anywhere; }
.ms-item-v b { font-size: 18px; color: var(--accent); }
.ms-item-v small { margin-left: 8px; font-size: 13px; color: var(--ink-2); }
.ms-item-s { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.ms-item-body { padding: 2px 2px 14px; min-width: 0; }
.ms-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
/* 結果の下の1行の断り */
.ms-note1 { margin: 12px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* ---- 結果の中の小さな折りたたみ（くわしい読み・計算の根拠） ---- */
details.ms-sfold { margin: 10px 0 0; border: 1px solid var(--grid); border-radius: var(--r); padding: 0 12px; background: var(--surface); min-width: 0; }
details.ms-sfold > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
details.ms-sfold[open] { padding-bottom: 10px; }

/* ---- たたんだ解説（section.panel.ms-fold > details > summary > h2）。本文は HTML に残し、見出しを目次のように並べる ---- */
html[data-ui="v2"] main[data-layout="simple"] .article { margin-top: 24px; }
html[data-ui="v2"] main[data-layout="simple"] .article > .callout { margin: 0 0 14px; }
html[data-ui="v2"] main[data-layout="simple"] section.panel.ms-fold { padding: 0; margin: 0 0 8px; }
html[data-ui="v2"] main[data-layout="simple"] > section.panel.ms-fold { margin: 12px 0 0; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details { padding: 0 22px; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details[open] { padding-bottom: 20px; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary { list-style: none; cursor: pointer; position: relative; padding: 15px 30px 15px 0; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary::-webkit-details-marker { display: none; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform .15s; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary h2 { display: inline; margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink); }
html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary:hover h2 { color: var(--accent); }
/* 根拠・出典のまとまりの中の小見出し */
html[data-ui="v2"] main[data-layout="simple"] .ms-basis .ms-sub + .ms-sub { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--grid); }
html[data-ui="v2"] main[data-layout="simple"] .ms-basis .ms-sub > h3 { margin-top: 4px; }
@media (max-width: 560px) {
  html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details { padding: 0 16px; }
  html[data-ui="v2"] main[data-layout="simple"] .panel.ms-fold > details > summary h2 { font-size: 16px; }
}

