.ts-page { max-width: 1080px; margin: 0 auto; }
.ts-page p { line-height: 1.6; }
.ts-page .panel { margin: 20px 0; }
.ts-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 20px 0; }
.ts-controls label { display: grid; gap: 6px; min-width: 0; }
.ts-controls input, .ts-controls select { max-width: 100%; font: inherit; padding: 10px; }
.ts-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.ts-grid th, .ts-grid td { padding: 8px 12px 8px 0; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.ts-grid thead th { color: var(--muted); font-weight: 500; }
.ts-grid tbody th { font-weight: 500; white-space: nowrap; }
.ts-grid tbody th small { display: block; color: var(--muted); font-weight: 400; }
.ts-grid input { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; }
.ts-grid input.ts-hours { max-width: 96px; font-variant-numeric: tabular-nums; }
.ts-grid tfoot th, .ts-grid tfoot td { border-bottom: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ts-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ts-item { padding: 14px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ts-item:last-of-type { border-bottom: 0; }
.ts-item p { margin: 0 0 4px; }
.ts-days { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.ts-days li { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius); background: var(--sunken); font-size: 12px; }
.ts-days li strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.ts-days li small { color: var(--muted); }
.ts-entry { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.ts-entry:last-of-type { border-bottom: 0; }
.ts-entry small { display: block; color: var(--muted); }
@media (max-width: 600px) {
  .ts-controls label { width: 100%; }
  .ts-grid thead { display: none; }
  .ts-grid tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ts-grid th, .ts-grid td { border-bottom: 0; padding: 2px 0; }
}

/* CL-37: Compact worked-time screens; keep day, hours and headings together when scrolling. */
@media (max-width: 600px) {
  body[data-view="timesheets"] .ts-page { padding: 12px; min-width: 0; overflow-wrap: anywhere; }
  body[data-view="timesheets"] .page-head { margin-bottom: 12px; }
  body[data-view="timesheets"] .ts-controls { margin: 12px 0; gap: 8px; }
  body[data-view="timesheets"] .ts-page .panel { padding: 12px; margin: 12px 0; min-width: 0; }
  body[data-view="timesheets"] .metric-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body[data-view="timesheets"] .metric { padding: 12px; min-width: 0; }
  body[data-view="timesheets"] :is(.ts-page, .dialog) :is(p, small, .small, label, .hint, .ts-entry, .ts-days li, .chip, .metric span) { font-size: 14px; }
  body[data-view="timesheets"] :is(.ts-page, .dialog) button { min-height: 44px; min-width: 44px; max-width: 100%; white-space: normal; font-size: 14px; }
  body[data-view="timesheets"] :is(.ts-page, .dialog) :is(input, select, textarea) { min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
  body[data-view="timesheets"] .ts-scroll { max-width: 100%; overflow-x: auto; }
  body[data-view="timesheets"] .ts-grid { min-width: 560px; font-size: 14px; }
  body[data-view="timesheets"] .ts-grid thead { display: table-header-group; }
  body[data-view="timesheets"] .ts-grid tr { display: table-row; }
  body[data-view="timesheets"] .ts-grid :is(th, td) { padding: 8px; }
  body[data-view="timesheets"] .ts-grid input.ts-hours { min-width: 80px; }
  body[data-view="timesheets"] .ts-grid tfoot { white-space: nowrap; }
  body[data-view="timesheets"] .dialog { padding: 14px; overflow-wrap: anywhere; font-size: 14px; }
  body[data-view="timesheets"] .dialog .btns { flex-wrap: wrap; }
}
