/* ============================================================
   E-計算！ Math どっちがお得（単価比較）（math/tanka-hikaku.html）だけの見た目
   共通の部品は assets/css/tool-kit.css（sp-…）と ek-simple.css（ks-…）。色は変数だけを使う。
   ============================================================ */

/* 入力欄の背景は surface */
#form .input-unit input[type="text"], #form select { background: var(--surface, #fff); }
#form .th-name { text-align: left; }

/* ---- 商品の行 ---- */
.th-rows { display: grid; gap: 12px; margin: 12px 0 0; }
.th-item { position: relative; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--grid); border-radius: var(--r); min-width: 0; }
.th-item legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.th-letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); font-size: 13px; }
.th-item .field { margin: 8px 0 0; }
.th-q { display: grid; grid-template-columns: minmax(0, 1fr) 6.5em; gap: 8px; align-items: end; }
.th-q .input-unit { gap: 6px; }
.th-q select, .th-more select, #qtyBox select { flex: none; width: auto; min-width: 0; max-width: 6.2em; padding: 9px 4px; }
.th-x { flex: none; font-weight: 700; color: var(--ink-2); }
.th-del { position: absolute; top: -4px; right: 8px; appearance: none; width: 36px; height: 36px; border: 1px solid var(--grid); background: var(--surface, #fff); color: var(--muted); border-radius: var(--r); font: inherit; font-size: 18px; cursor: pointer; }
.th-del:hover { color: var(--ink); border-color: var(--line-strong); }
.th-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-more { margin-top: 10px; }
#form select.bad { border-color: var(--s2, #B4442C); border-width: 2px; }

/* ---- 結果 ---- */
.th-basis { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.th-basis .sp-btn { padding: 5px 10px; font-size: 13px; }
.th-basis .sp-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink, #fff); }
.th-bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.th-bars li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.th-bl { font-weight: 700; text-align: center; }
.th-bt { height: 14px; border-radius: 7px; background: var(--grid); overflow: hidden; }
.th-bb { display: block; height: 100%; border-radius: 7px; background: var(--muted); }
.th-bars li.best .th-bb { background: var(--accent); }
.th-bars li.best .th-bv { font-weight: 700; }
.th-tbl td, .th-tbl th { font-variant-numeric: tabular-nums; }
.th-tbl td small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
#ans .ks-ans-big b { overflow-wrap: anywhere; }

@media (max-width: 560px) {
  #ans .ks-ans-big b { font-size: 28px; }
}

@media print {
  .th-bars li .th-bb { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
