/* timezone-compare: reference and add-zone rows, the comparison table and the hour-by-hour planner. */
.tz-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--matrix-space-12) var(--matrix-space-16); align-items: end; margin-bottom: var(--matrix-space-12); }
.tz-field { display: grid; gap: var(--matrix-space-8); min-width: 0; }
.tz-field--wide { grid-column: span 2; }
.tz-field label { font-weight: 600; }
.tz-field select, .tz-field input { width: 100%; box-sizing: border-box; }
.tz-error { margin: 0; font-size: var(--matrix-type-caption); }
.tz-error:empty { display: none; }
.tz-line { font-size: 1.25rem; overflow-wrap: anywhere; }
.tz-scroll { overflow: auto; border: 1px solid var(--matrix-border); border-radius: var(--matrix-radius-control); background: var(--matrix-surface); margin-top: var(--matrix-space-12); }
.tz-table, .tz-planner { width: 100%; border-collapse: collapse; font-size: var(--matrix-type-control); }
.tz-table th, .tz-planner thead th { background: var(--matrix-surface-subtle); color: var(--matrix-muted); font-weight: 600; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--matrix-border); white-space: nowrap; }
.tz-table td { padding: 6px 8px; border-bottom: 1px solid var(--matrix-border); vertical-align: top; }
.tz-table tr.tz-ref td { background: var(--matrix-selected); }
.tz-table .tz-city { font-weight: 600; }
.tz-table .tz-id { font-size: var(--matrix-type-caption); }
.tz-table .tz-time strong { font-family: var(--matrix-font-mono); font-size: 1.05rem; }
.tz-table .tz-num { font-family: var(--matrix-font-mono); white-space: nowrap; }
.tz-table .tz-actions { text-align: right; }
.tz-planner th[scope="row"] { position: sticky; left: 0; background: var(--matrix-surface-subtle); font-weight: 600; color: var(--matrix-text); white-space: nowrap; border-right: 1px solid var(--matrix-border); }
.tz-planner .tz-hour { text-align: center; font-family: var(--matrix-font-mono); }
.tz-planner td.tz-cell { font-family: var(--matrix-font-mono); text-align: center; padding: 4px 2px; min-width: 2.6em; border-bottom: 1px solid var(--matrix-border); }
.tz-planner td.tz-work { background: var(--matrix-success-background); color: var(--matrix-success); font-weight: 600; }
.tz-planner td.tz-night { background: var(--matrix-surface-subtle); color: var(--matrix-muted); }
.tz-planner .tz-now { box-shadow: inset 0 0 0 2px var(--matrix-brand); }
.tz-planner sup { font-size: 0.65em; margin-left: 1px; }
.result h3 { margin: var(--matrix-space-16) 0 var(--matrix-space-8); font-size: var(--matrix-type-control); }
@media (max-width: 560px) {
  .tz-field--wide { grid-column: span 1; }
}
.tz-find-note { margin: 0 0 var(--matrix-space-12); }
.tz-find-note:empty { display: none; }
/* A phone stacks each zone: its name with the remove button beside it, then every value on a line of its own and named, so that
   nothing is cut off at the side (Jack's review of 2026-10-12, appendix 42b: the Offset column was cut). The headers stay for
   screen readers, and the table's roles are set in the controller. The planner is shown the other way round: a row per hour,
   a column per zone, whose names read upwards so that five zones fit across. */
.tz-plan-tall { display: none; }
@media (max-width: 600px) {
  .tz-zones { overflow: visible; }
  .tz-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tz-table, .tz-table tbody, .tz-table tr, .tz-table td { display: block; }
  .tz-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 6px 8px; border-bottom: 1px solid var(--matrix-border); }
  .tz-table tbody tr:last-child { border-bottom: 0; }
  .tz-table tr.tz-ref { background: var(--matrix-selected); }
  .tz-table td { padding: 1px 0; border: 0; grid-column: 1; }
  .tz-table tr.tz-ref td { background: none; }
  .tz-table td.tz-actions { grid-column: 2; grid-row: 1 / span 5; align-self: start; }
  .tz-table td[data-label]::before { content: attr(data-label) ": "; font-family: var(--matrix-font); font-weight: 400; color: var(--matrix-muted); }
  .tz-table .tz-num { white-space: normal; overflow-wrap: anywhere; }
  .tz-table .tz-id { overflow-wrap: anywhere; }
  .tz-table .tz-time .matrix-muted { white-space: nowrap; } /* a date is not broken at its hyphens */
  .tz-plan-wide { display: none; }
  .tz-plan-tall { display: block; }
  .tz-planner--tall { table-layout: fixed; }
  .tz-planner--tall + .tz-planner--tall { border-top: 2px solid var(--matrix-border); }
  .tz-planner--tall thead th { vertical-align: bottom; text-align: center; padding: 4px 2px; }
  .tz-planner--tall thead th.tz-hour-head { width: 2.8em; }
  .tz-planner--tall td.tz-cell { min-width: 0; padding: 4px 1px; }
  .tz-planner--tall thead th.tz-zone span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
  /* a zone's Chinese name stands upright and reads downwards, as vertical Chinese does (queue row 104); turned, it would be upside down */
  .tz-planner--tall thead th.tz-zone span[lang="zh-Hans"] { transform: none; }
  .tz-planner--tall th[scope="row"] { text-align: center; font-family: var(--matrix-font-mono); padding: 4px 6px; }
}
/* the cities kept in this browser, the link to the comparison and Start again (Jack's register T42-01) */
.tz-keep { margin-top: var(--matrix-space-12); }
.tz-kept { margin: 0 0 var(--matrix-space-12); }
.tz-kept:empty { display: none; }
.tz-link-text { display: block; width: 100%; box-sizing: border-box; margin-top: var(--matrix-space-8); font-family: var(--matrix-font-mono); font-size: var(--matrix-type-caption); }
.tz-link-text[hidden] { display: none; }
