/* ============================================================
   E-計算！ Math 家電の電気代（math/denkidai.html）だけの見た目
   共通の部品は assets/css/tool-kit.css（sp-…）と ek-simple.css（ks-…）。色は変数だけを使う。
   ============================================================ */

.dk-top-note { margin: 0 0 14px; }

/* 家電の行 */
.dk-row { padding: 12px 0 2px; border-top: 1px solid var(--grid); }
.dk-row:first-child { border-top: 0; padding-top: 0; }
.dk-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 0; }
.dk-row-head:has(.dk-del:not([hidden])) { margin-bottom: 8px; }
.dk-row-no { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.dk-del { appearance: none; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); border-radius: var(--r); padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.dk-del:hover { background: var(--accent-soft); }
.dk-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dk-del[hidden] { display: none; }
.dk-row .field { margin-bottom: 12px; }
.dk-row .ks-msg { margin-top: -4px; }

/* 名前の欄（input-unit の外の文字の欄） */
.dk-name input {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface, #fff); border: 1px solid var(--line-strong); border-radius: var(--r);
}
.dk-name input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* 時間と分を横に並べる */
.dk-time { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 使う日数の欄 */
.dk-days { margin-top: 8px; max-width: 12em; }
.dk-rows-note { margin: 0; }
#fWatt > .sp-actions { margin: 0 0 18px; }

/* 入力欄の背景は surface（tool-kit.css の textarea と同じ） */
#watt .input-unit input[type="text"], #annual .input-unit input[type="text"], #amp .input-unit input[type="text"] { background: var(--surface, #fff); }

/* 本文の表は長い見出しを折り返す（table.data の nowrap より強い指定） */
table.data.dk-wrap { white-space: normal; }
table.data.dk-wrap th.n { white-space: normal; }
table.data.dk-wrap td:first-child { text-align: left; min-width: 9em; }
table.data.dk-wrap td small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* 結果の表 */
.dk-tbl td, .dk-tbl th { font-variant-numeric: tabular-nums; }
.dk-tbl tr.dk-sum td { font-weight: 700; border-top: 2px solid var(--grid); }
/* 家電の名前（30文字まで）は、幅に関係なく折り返して表を横に広げない */
table.data.dk-tbl td:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 5em; max-width: 14em; text-align: left; }

@media (max-width: 560px) {
  .dk-name input { font-size: 16px; }   /* iOS で入力時に拡大されないように */
  #watt .radio-row label { flex: 1 1 40%; }
  .dk-tbl { font-size: 13px; }
  html[data-ui="v2"] table.dk-tbl th, html[data-ui="v2"] table.dk-tbl td,
  html[data-ui="v2"] table.dk-wrap th, html[data-ui="v2"] table.dk-wrap td { padding: 8px 4px; }
  table.data.dk-wrap td:first-child { min-width: 7.5em; }
}
.dk-tbl td small { color: var(--muted); }
