/* /military-time-calculator/ page layout. Tokens only; loaded after tools.css (which holds the shared time-tools block). */
#rDiff .t-line { font-size: var(--fs-body); }
/* The worked-out line explains the exact total: right under HOURS/DECIMAL behind the dashed rule, in every state;
   the rounding group (its own dashed .t-rule) follows it. */
#math { margin-top: calc(var(--group-gap) - var(--space-3)); padding-top: var(--space-3); border-top: var(--border-w) dashed var(--accent-bd); }
/* Row message: the field-error block of Hours (#err), under the field at fault, at its width (page.js moves it there).
   A message about the whole row (both fields) spans the row above the subtotal line. */
.pair .t-field > .pair-msg { margin-top: var(--space-1); }
.pair-msg { color: var(--text); }
/* The empty echo line under a field with a message would only add a blank line. */
.pair-msg:not([hidden]) + .echo:empty { display: none; }
/* No subtotal yet: the empty line collapses; a Remove button keeps its own right-aligned line. */
.pair-foot:not(:has(> .pair-hm:not(:empty), > .pair-day:not([hidden]), > .pair-rm)) { display: none; }
.pair-foot:not(:has(> .pair-hm:not(:empty), > .pair-day:not([hidden]))) { margin-top: calc(-1 * var(--space-2)); }
/* Action buttons share each line they sit on, so two stacked buttons are the same width. */
.t-actions > .btn-secondary { flex: 1 1 auto; }
/* "24-hour" stays on one line; the 12-hour column takes the rest. */
.t-cols .data-grid thead th:first-child { white-space: nowrap; }
.t-cols .data-grid { table-layout: auto; }
.t-cols .data-grid :is(th, td):first-child { width: 1%; }
/* Two short columns (punch, rounded punch): the table hugs them instead of spreading over the compare width. */
.t-chart.t-compare { max-width: calc(2 * var(--chart-col)); }
/* Phones: each echo stays right under its input; a row message then spans the whole pair below both echoes.
   The fields' children join the pair grid (labels, inputs, message, echoes, subtotal), so no JS or ARIA change. */
@media (min-width: 301px) and (max-width: 560px) {
  .pair { row-gap: var(--space-1); }
  .pair > .t-field { display: contents; }
  .pair > .t-field:first-child > * { grid-column: 1; }
  .pair > .t-field:nth-child(2) > * { grid-column: 2; }
  .pair > .t-field > label { order: 1; }
  .pair > .t-field > input { order: 2; }
  .pair > .t-field > .echo { order: 3; }
  .pair > .t-field > .pair-msg, .pair > .pair-msg { order: 4; grid-column: 1 / -1; margin-top: var(--space-1); }
  .pair > .pair-foot { order: 5; margin-top: var(--space-1); }
  .pair > .pair-foot:not(:has(> .pair-hm:not(:empty), > .pair-day:not([hidden]))) { margin-top: calc(var(--space-1) - var(--space-2)); }
}
