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

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

/* 計算すること（3つの切り替え）・入れ方などの切り替え：狭い画面では、ラベルを <wbr> の所で2行に折る */
html[data-ui="v2"] .radio-row.tc-seg label { white-space: normal; word-break: keep-all; text-align: center; line-height: 1.35; }
@media (max-width: 400px) {
  html[data-ui="v2"] .radio-row.tc-seg label { padding-left: 4px; padding-right: 4px; font-size: 13.5px; }
}
#form [hidden], #convForm [hidden], #resultPanel [hidden] { display: none !important; }

/* ---- 時間を行で入れる（足す・引く｜時間｜削除） ---- */
.tc-rows { display: grid; gap: 8px; }
.tc-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
html[data-ui="v2"] .tc-row select {
  width: 100%; height: 44px; padding: 0 6px; font-size: 16px; font-weight: 700; text-align: center;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
html[data-ui="v2"] .tc-row input,
html[data-ui="v2"] .tc-in {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
html[data-ui="v2"] .tc-row select:focus, html[data-ui="v2"] .tc-row input:focus, html[data-ui="v2"] .tc-in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
@media (max-width: 560px) { html[data-ui="v2"] .tc-row input, html[data-ui="v2"] .tc-in { font-size: 16px; } }   /* iOS で入力時に拡大されないように */
/* 入力の誤り（math.css の .vp-row input.bad と同じ見た目） */
html[data-ui="v2"] .tc-row input.bad, html[data-ui="v2"] .tc-in.bad, html[data-ui="v2"] .input-unit input.bad { border-color: var(--s2); border-width: 2px; }
.tc-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) 36px; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* 「時間」「分」の2つの欄、出勤・退勤など：狭い画面でも2列のまま */
.tc-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tc-2 > .field { margin-bottom: 14px; }
.tc-2 .input-unit .unit { min-width: 0; }

/* くわしい条件（フォームの中の折りたたみ） */
html[data-ui="v2"] details.why.tc-more { margin: 4px 0 14px; }
.tc-more > .tc-more-in { padding-top: 12px; }
html[data-ui="v2"] .field > label.tc-check { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.6; color: var(--ink); }
.tc-check input { margin-top: 4px; flex: none; }
.tc-brk { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 1.2em minmax(0, 1fr); gap: 6px; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.tc-brk .tc-to { text-align: center; color: var(--muted); }

/* ---- 結果 ---- */
#result { min-height: 236px; }
/* 時間の大きな数字：「25時間30分」。数字の途中では折らず、単位のあと（<wbr>）でだけ折り返せる */
html[data-ui="v2"] .tc-out .res-hero .big { flex-wrap: wrap; }
html[data-ui="v2"] .tc-out .res-hero .big b { font-size: clamp(28px, 8.5vw, 44px); overflow-wrap: normal; }
html[data-ui="v2"] .tc-out .res-hero .big b span { margin: 0 4px 0 2px; }
html[data-ui="v2"] .tc-out .res-mini .v { overflow-wrap: normal; word-break: normal; }
html[data-ui="v2"] .tc-out .res-mini .v small { white-space: nowrap; }
html[data-ui="v2"] .tc-out .res-mini .s { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  html[data-ui="v2"] .tc-out .res-mini .v { font-size: 15px; }
}
/* それでも欄からはみ出す数（320px の画面で 5,999,999分 など）がある行は、3つの箱を縦に並べる（ページの script の fitMinis が付ける） */
html[data-ui="v2"] .tc-out .res-mini.tc-stack { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
html[data-ui="v2"] .tc-out .res-mini.tc-stack > div { padding: 0; }
html[data-ui="v2"] .tc-out .res-mini.tc-stack > div + div { border-left: 0; padding: 10px 0 0; border-top: 1px solid var(--grid); }
.tc-notes { display: grid; gap: 6px; margin-top: 14px; }
.tc-notes .verdict { margin: 0; }
.tc-h3 { margin: 20px 0 4px; font-size: 15px; }
table.data.tc-tbl td, table.data.tc-tbl th { white-space: normal; }
table.data.tc-tbl td.n, table.data.tc-tbl th.n { white-space: nowrap; }
/* 内訳の表の入力・読み取り・累計の数は折り返さない（表は .table-scroll の中で横に動く。320px で「99,00／0:00」と折れないように） */
table.data.tc-tbl td.tc-in-col { white-space: nowrap; }
table.data tr.tc-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.tc-fl { display: block; margin: 0 0 6px; overflow-wrap: anywhere; }

/* ---- 勤務の時間帯の図（SVG。viewBox の幅は表示する幅に合わせる） ---- */
.tc-fig { margin: 18px 0 0; padding: 12px 12px 10px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); min-width: 0; }
.tc-fig figcaption { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 6px; line-height: 1.6; }
.tc-fig svg { display: block; width: 100%; height: auto; }
.tc-fig .tc-night { fill: color-mix(in srgb, var(--ink) 11%, var(--surface)); }
.tc-fig .tc-work { fill: var(--accent); }
.tc-fig .tc-break { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
.tc-fig .tc-axis { stroke: var(--line-strong); stroke-width: 1; }
.tc-fig .tc-dayline { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
.tc-fig .tc-tick { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.tc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.tc-legend li { display: flex; align-items: center; gap: 6px; }
.tc-legend svg { width: 22px; height: 12px; flex: none; }
.tc-fig-note { font-size: 11.5px; color: var(--ink-2); line-height: 1.8; padding-top: 8px; margin: 8px 0 0; border-top: 1px solid var(--grid); }

/* ---- 10進⇔60進の換算（入力｜結果の2列。狭い画面では縦に並べる） ---- */
.tc-split { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .tc-split { grid-template-columns: minmax(0, 1fr); } }
.tc-split > * { min-width: 0; }
#cOut { min-height: 200px; }
#cOut .res-hero { margin-top: 0; }
table.data.tc-mtbl td.n:first-child { text-align: right; }
