#tool .zt-ux-presets button[aria-pressed="true"] { background: var(--go); }
.times-controls, .times-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.times-controls .zt-field { flex: 0 1 8rem; min-width: 0; }
.times-actions button, #times-again, .times-summary .zt-next a { min-width: 44px; min-height: 44px; }
.times-controls input, #times-answer { width: 100%; min-height: 44px; font-size: 1rem; }
.times-controls:has([aria-invalid="true"]) .zt-field { flex-basis: 100%; }
.times-error:empty { display: none; }
.times-error { color: var(--ws-error, #9a271c); }
.times-summary { padding: 0; border: 0; margin: 12px 0; }
.times-summary output { display: block; font: 650 clamp(1.5rem, 4vw, 2.4rem)/1.2 var(--font-prose); }
.times-summary .zt-next { margin-block: 2px; }
.times-summary .zt-explain { margin: 4px 0 0; }
#times-table-wrap { max-width: 100%; overflow-x: auto; }
.times-table { width: 100%; border-collapse: collapse; text-align: center; background: var(--ws); }
.times-table caption { padding: 6px 0; text-align: left; font-weight: 650; }
.times-table :is(th, td) { padding: 6px; border: 1px solid var(--ws-line-strong); white-space: nowrap; }
.times-table th { background: var(--ws-2); }
.times-table tbody tr:nth-child(even) td { background: var(--ws-2); }
.times-chart th:first-child { position: sticky; left: 0; background: var(--ws-2); }
#times-quiz { border: 1px solid var(--ws-line-strong); border-radius: 10px; padding: 12px; }
#times-progress, #times-feedback { margin: 0; }
#times-feedback:not(:empty) { margin-top: 8px; }
#times-question { font-size: 1.5rem; margin: 4px 0 8px; }
#times-quiz-form .zt-field { max-width: 12rem; margin-bottom: 8px; }
#times-again { margin-top: 8px; }

@page times-portrait { size: A4 portrait; margin: 12mm; }
@page times-landscape { size: A4 landscape; margin: 12mm; }

@media print {
  body > :not(main),
  main > :not(.zt-tool-page),
  .zt-tool-page > :not(#tool),
  #tool > :not(#times-sheet) { display: none !important; }
  body, main, .zt-tool-page, #tool, #times-sheet, #times-table-wrap {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #000;
    background: #fff;
    overflow: visible;
  }
  #times-sheet { page: times-portrait; }
  #times-sheet:has(.times-chart) { page: times-landscape; }
  .times-table { break-inside: avoid; color: #000; background: #fff; }
  .times-table caption { font-size: 18pt; margin-bottom: 3mm; }
  .times-table :is(th, td) { height: 8mm; border: .5pt solid #555; padding: 0; background: #fff !important; }
  .times-chart th:first-child { position: static; }
  .times-chart { font-size: 9pt; table-layout: fixed; }
}

.times-sheet-actions { margin-top: 8px; }
#times-rows { min-height: 44px; }
@media screen and (min-width: 721px) {
  #tool:has(.times-sheet-actions) { display: flex; flex-direction: column; }
  .times-controls { order: 0; }
  .times-sheet-actions { order: 1; }
  :is(.times-summary, #times-sheet, #times-quiz) { order: 2; }
  #tool:has(.times-sheet-actions) > .zt-next { order: 3; }
}

@media screen and (max-width: 720px) {
  /* Show whole rows: the table scrolls sideways only, never inside a short box. */
  #times-table-wrap { max-height: none; overflow-x: auto; overflow-y: visible; }
  .times-table :is(th, td) { padding: 6px 4px; }
}
