/* ============================================================
   E-計算！ Math — 消費税の計算（consumption-tax.html）だけで使う見た目
   共通（../assets/css/ek.css・css/math.css）の上に重ねる。色は変数だけを使う。
   ============================================================ */

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

/* ---- 入力 ---- */
/* 計算すること（3つの切り替え）：狭い画面でも「税抜→税込」などが途中で2行に折れないよう、左右の余白を詰めて1行に */
html[data-ui="v2"] .radio-row.ct-seg3 label { white-space: nowrap; }
@media (max-width: 400px) {
  html[data-ui="v2"] .radio-row.ct-seg3 label { padding-left: 4px; padding-right: 4px; font-size: 13.5px; }
}
.ct-calc-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
/* 入力の誤り（math.css の .vp-row input.bad と同じ見た目） */
html[data-ui="v2"] .input-unit input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
/* くわしい条件（端数処理） */
.ct-more { margin: 0 0 14px; }
.ct-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.ct-more > summary b { color: var(--ink); }
.ct-more[open] > summary { margin-bottom: 10px; }
.ct-more .field { margin-bottom: 0; }

/* レシートの品目の行：品目 | 金額 | 税率 | 削除。狭い画面では2段（品目と削除／金額と税率）にする */
.ct-rows { display: grid; gap: 8px; }
.ct-row, .ct-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 80px 36px; gap: 6px; align-items: center; }
.ct-head { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.ct-row input, .ct-row select {
  width: 100%; min-width: 0; height: 44px; padding: 0 10px; font-size: 15px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
/* 共通の html[data-ui="v2"] .field select（左右12px・右32px）より強く指定して、狭い欄でも「10%」が切れないように */
html[data-ui="v2"] .ct-row select { padding: 0 4px 0 8px; }
.ct-row input.ct-amt { text-align: right; font-variant-numeric: tabular-nums; }
.ct-row input:focus, .ct-row select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.ct-row input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
@media (max-width: 560px) { .ct-row input, .ct-row select { font-size: 16px; } }   /* iOS で入力時に拡大されないように */
@media (max-width: 420px) {
  .ct-head { display: none; }
  .ct-row { grid-template-columns: minmax(0, 1fr) 80px 36px; grid-template-areas: "nm nm del" "am rt rt"; padding-bottom: 8px; border-bottom: 1px solid var(--grid); }
  .ct-row .ct-name { grid-area: nm; }
  .ct-row .ct-amt { grid-area: am; }
  .ct-row .ct-rate { grid-area: rt; }
  .ct-row .vp-del { grid-area: del; }
}

/* ---- 結果 ---- */
/* 結果の欄の高さを先に確保する（読み込み直後の計算で下の要素が動かないように） */
.ct-out #result { min-height: 236px; }
.ct-out [hidden] { display: none !important; }
/* 大きな数字は狭い画面で縮める。数字の途中では折り返さない（ページの script が桁区切りのカンマのあとに <wbr> を入れる） */
html[data-ui="v2"] .ct-out .res-hero .big b { font-size: clamp(28px, 8.5vw, 44px); overflow-wrap: normal; }
html[data-ui="v2"] .ct-out .res-mini .v { overflow-wrap: normal; word-break: normal; }
html[data-ui="v2"] .ct-out .res-mini .v small { white-space: nowrap; }
html[data-ui="v2"] .ct-out .res-mini .s { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  html[data-ui="v2"] .ct-out .res-mini .v { font-size: 15px; }
  html[data-ui="v2"] .ct-out .res-mini .v.long { font-size: 14px; }
}
/* それでも欄からはみ出す数がある行は、3つの箱を縦に並べる（ページの script の fitMinis が付ける） */
html[data-ui="v2"] .ct-out .res-mini.ct-stack { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
html[data-ui="v2"] .ct-out .res-mini.ct-stack > div { padding: 0; }
html[data-ui="v2"] .ct-out .res-mini.ct-stack > div + div { border-left: 0; padding: 10px 0 0; border-top: 1px solid var(--grid); }
.ct-verdict { margin-top: 14px; line-height: 1.8; }
.ct-verdict b { color: var(--ink); }
.ct-verdict small { display: block; margin-top: 4px; color: var(--ink-2); }
.ct-range { margin: 8px 0 0; overflow-wrap: anywhere; }
.ct-h3 { margin: 20px 0 4px; font-size: 15px; }
.ct-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* ---- 表 ---- */
table.data th.ct-l, table.data td.ct-l { text-align: left; }
table.ct-wrap td, table.ct-wrap th { white-space: normal; }
table.ct-wrap td.n, table.ct-wrap th.n { white-space: nowrap; }
/* 見出し（税率ごとに1回 など）は <wbr> の位置で折り返してよい（狭い画面で表が枠より広くならないように） */
table.ct-ab th.n { white-space: normal; word-break: keep-all; }
table.ct-items td.ct-nm { white-space: normal; overflow-wrap: anywhere; min-width: 4em; max-width: 10em; }
html[data-ui="v2"] table.data tbody tr.hit td .sub { color: var(--muted); font-weight: 400; }
@media (max-width: 400px) {
  html[data-ui="v2"] table.ct-cmp th, html[data-ui="v2"] table.ct-cmp td { padding-left: 6px; padding-right: 6px; }
}

/* ---- 解説の図（÷1.1 と ×0.9 の違い）。棒の長さは 1,100円を全体とした割合 ---- */
.ct-fig { margin: 16px 0; padding: 14px 16px 6px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); }
.ct-fig figcaption { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.ct-fig-row { margin: 0 0 12px; }
.ct-fig-k { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.ct-fig-k b { color: var(--ink); }
.ct-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--page); }
.ct-bar > span { display: block; height: 100%; }
.ct-b-net { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.ct-b-tax { background: var(--accent); }
.ct-b-wrong { background: color-mix(in srgb, var(--ink) 22%, var(--surface)); }
.ct-b-cut { background: var(--s2); }
.ct-w-1000 { width: 90.909%; }
.ct-w-100 { width: 9.091%; }
.ct-w-990 { width: 90%; }
.ct-w-110 { width: 10%; }
.ct-fig-t { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.ct-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 0; vertical-align: -1px; }
