/* Attendance, design spec 5.17 and 9.1: only the timesheet specifics (the head line of figures and period, the four
   column grid and its phone day cards, the state mark, the delivery state, the inline editor host), the month matrix
   with its sticky person column, and the time blocks of the day forms. Tables, toolbars, drawers and panels come from
   components.css. attendance.js toggles tr.attendance-problem and rewrites the data-field cells (spec 5.21). */
.timesheet-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.timesheet-head > .figures-group { flex: 1 1 32rem; margin: 0; }
.timesheet-bulk { align-items: flex-end; }
.timesheet-bulk .field-help { flex-basis: 100%; margin: 0; }
.timesheet-grid th[scope="row"] { white-space: nowrap; }
.timesheet-grid th[scope="row"] input[type="checkbox"] { margin-right: var(--space-1); }
.day-link { font-weight: 600; text-decoration: none; }
.day-link:hover, .day-link:focus-visible { text-decoration: underline; }
.day-kind { display: block; font-weight: 600; }
.day-kind small { display: block; color: var(--ink-2); font-size: var(--text--1); font-weight: 400; }
.day-blocks { display: grid; gap: var(--ph-space-05); margin-top: var(--ph-space-05); }
.day-block { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }
.day-block strong { font-weight: 600; }
.day-note-label { color: var(--ink-2); }
/* The day's breakdown reads at the body's text size, its values in ink (task 052h, A7). */
.timesheet-grid .day-hours .cell-note { color: var(--ink); font-size: var(--ph-text-md); }
/* A day not recorded yet names its planned shift (task 052h, A5 and A8). */
.day-planned { display: block; margin-top: var(--ph-space-05); color: var(--ink); font-variant-numeric: tabular-nums; }
.day-planned:empty { display: none; }
/* «Oggi» beside the day's label, and the day lands with its header in view (task 052h, A8b, I31 and I32). */
.day-today { margin-left: var(--ph-space-05); }
.timesheet-grid tbody th[id] { scroll-margin-top: var(--space-4); }
/* The box that picks a day for a day template, with its visible label (task 052h, A18). */
.day-pick { min-height: var(--ph-control-h); font-size: var(--ph-text-md); }
.day-meal:has(> [data-field="mealVoucher"]:empty) { display: none; }
.day-worked { font-weight: 600; }
.day-state { min-width: 3rem; max-width: 12rem; }
/* A problem and a day to come carry their word beside the mark (task 051b items 6 and 8); a day in order says so in
   words too, not only to screen readers (task 052h, A9). */
.day-state-word { display: block; font-size: var(--ph-text-md); }
.day-ok-word { color: var(--ok); }
.day-state-word:empty { display: none; }
tr.attendance-problem .day-state-word { color: var(--warn); }
.day-upcoming-word { color: var(--ink-2); }
tr.is-upcoming .day-mark { border-style: dashed; border-color: var(--line); }
tr.is-upcoming .day-mark::after { content: none; }
tr.is-upcoming .day-ok-word { display: none; }
.day-mark { position: relative; display: inline-block; width: 1rem; height: 1rem; border: 1.5px solid var(--ok); border-radius: 50%; vertical-align: middle; }
.day-mark::after { content: ""; position: absolute; top: 2px; left: 4px; width: 3px; height: 6px; border-right: 1.5px solid var(--ok); border-bottom: 1.5px solid var(--ok); transform: rotate(45deg); }
tr.attendance-problem .day-mark { border-color: var(--warn); background: linear-gradient(var(--warn), var(--warn)) 50% 2px / 1.5px 6px no-repeat, linear-gradient(var(--warn), var(--warn)) 50% 10px / 1.5px 1.5px no-repeat; }
tr.attendance-problem .day-mark::after, tr.is-muted .day-mark::after { content: none; }
tr.is-muted:not(.attendance-problem) .day-mark { width: 0.75rem; height: 0; border: 0; border-top: 1.5px solid var(--ink); border-radius: 0; }
tr.attendance-problem .day-ok-word, tr.is-muted .day-ok-word { display: none; }
/* A day the plan filled but the person has not confirmed is not «In ordine» yet: its plan word says what it is. */
tr.is-plan-unconfirmed .day-ok-word { display: none; }
/* Task 272 (browser pass): nor does its mark tick it as in order; the mark is the open circle of a day that waits. */
tr.is-plan-unconfirmed .day-mark { border-style: dashed; border-color: var(--line); }
tr.is-plan-unconfirmed .day-mark::after { content: none; }
/* An empty day a whole day request covers while it waits (task 216b): «In attesa di decisione», neutral like a day to
   come, never «In ordine» and never a day to fill. */
.day-waiting-word { color: var(--ink-2); }
tr:is(.is-waiting, .is-quiet) .day-mark { border-style: dashed; border-color: var(--line); }
tr:is(.is-waiting, .is-quiet) .day-mark::after { content: none; }
tr:is(.is-waiting, .is-quiet) .day-ok-word { display: none; }
/* The inline editor opens in a row under the day it edits (task 051b item 8). */
.timesheet-grid tr.day-editor-row > td { padding: var(--space-1) 0; background: var(--bg); }
.data-table tr.attendance-problem > :first-child { box-shadow: inset 3px 0 0 var(--warn); }
.day-out { color: var(--ink); }
.grid-help { max-width: var(--ph-measure); margin: calc(-1 * var(--space-2)) 0 var(--space-3); color: var(--ink-2); font-size: var(--ph-text-sm); }
.timesheet-editor:not(:empty) { margin: 0 0 var(--space-3); }
.day-editor { margin: 0; }
.timesheet-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-3); padding: var(--ph-space-15) var(--space-2); background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.timesheet-footer-state { margin: 0; font-weight: 600; }
.timesheet-footer-label { color: var(--ink-2); font-weight: 400; }
.timesheet-footer > form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; }
.timesheet-footer > form > .field-help, .timesheet-footer-why { flex: 1 1 16rem; margin: 0; }
.timesheet-gaps ul { margin: 0; }
.timesheet-bulk-none { margin: 0 0 var(--space-2); }
/* The phone week (task 052h, A5 and A8): its heading and the link to the whole month show on a phone only. */
.timesheet-week { display: none; }
.timesheet-week-title { margin: var(--space-2) 0 0; font-size: var(--ph-text-lg); }
.timesheet-week-range { margin: 0 0 var(--space-1); }
.day-copied { color: var(--ink); font-weight: 600; }
.day-note-more { margin: var(--space-1) 0; }
.timesheet-aside .history-list > li { font-size: var(--ph-text-md); }

/* The day in focus on the person's sheet (task 053b, G4): today or the first day to fill, with its one action and the
   editor opening in the panel. A problem's help line says what it means and who takes it up (N33). */
.timesheet-focus { margin: 0 0 var(--space-3); }
.timesheet-focus > h2 { margin: 0 0 var(--ph-space-05); font-size: var(--ph-text-lg); }
.timesheet-focus-day, .timesheet-focus-state { margin: 0 0 var(--ph-space-05); }
.timesheet-focus-day .day-kind { display: inline; }
.timesheet-focus-day .day-blocks { display: inline; margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.timesheet-focus-day .day-planned { margin-top: var(--ph-space-05); }
/* The confirmation box of the day form sits beside its words on one line, as on the day page (I28). */
.day-editor label.check-field { flex-wrap: nowrap; align-items: flex-start; gap: var(--space-1); }
.day-editor label.check-field > input { flex: none; margin-top: var(--ph-space-05); }
.timesheet-focus-state [data-focus-field="worked"] { font-weight: 600; font-variant-numeric: tabular-nums; }
.timesheet-focus-state .day-state-word { display: inline; margin-left: var(--ph-space-05); color: var(--warn); }
.timesheet-focus-state .day-upcoming-word { color: var(--ink-2); }
.timesheet-focus-actions { margin: var(--space-1) 0 0; }
.timesheet-focus-earlier { margin: var(--space-1) 0 0; font-size: var(--ph-text-md); }
.timesheet-focus .day-editor-row { margin-top: var(--space-2); }
.timesheet-focus .day-editor-row.flash { margin-bottom: 0; }
.day-problem-help { display: block; max-width: var(--ph-measure); margin-top: var(--ph-space-05); color: var(--ink-2); font-size: var(--ph-text-sm); }
.day-problem-help:empty { display: none; }
.timesheet-to-check { margin: 0 0 var(--space-2); }
/* The day form's way back (task 053b, G5): «Svuota la giornata» sits beside «Salva» and says what it does under them. */
.day-empty-help { margin: var(--ph-space-05) 0 0; }

/* The month matrix: the person column stays in view while the days scroll inside the sheet. */
/* A matrix has a head per day: its heads keep sentence case on one line, as the body text is drawn, not the uppercase
   label of a list table that wraps (design-d-spec.md 2). */
.data-table.timesheet-matrix thead th { padding-inline: var(--space-2); font-size-adjust: inherit; letter-spacing: normal; text-transform: none; vertical-align: middle; white-space: nowrap; }
.timesheet-matrix th[scope="row"], .timesheet-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; min-width: 12rem; background: var(--surface-1); box-shadow: inset -1px 0 0 var(--line); }
.timesheet-matrix th[scope="row"] small, .timesheet-matrix td small { display: block; color: var(--ink-2); font-size: var(--text--1); font-weight: 400; }
.timesheet-matrix .matrix-day, .timesheet-matrix td { min-width: 4.5rem; text-align: center; white-space: nowrap; }
.timesheet-matrix td.num { text-align: right; }
.timesheet-matrix td.attendance-problem { background: var(--ph-warn-bg); }
.timesheet-matrix td.attendance-problem small { color: var(--warn); }

/* The time blocks of the preset and day forms and of the inline editor: a block shows the options of its kind only,
   held by CSS so it works without script (task 051b item 9); unused blocks wait under «Altri blocchi». A block is a
   group inside the form's card, so it is a well on the page tone with no border (design-d-spec.md 5). The block is a
   fieldset.form-section, and the selectors name the fieldset so they hold against the form section rules of
   components.css, which square a section, take its padding and rule it off from the one before. */
fieldset.attendance-block { margin: 0 0 var(--space-1); padding: var(--space-1) var(--space-2) var(--space-2); background: var(--bg); border: 0; border-radius: var(--radius); }
fieldset.attendance-block + fieldset.attendance-block { padding-top: var(--space-1); border-top: 0; }
.attendance-block > legend { padding: 0 var(--ph-space-05); font-weight: 600; }
.attendance-block-options { margin-top: var(--space-2); padding-top: var(--space-2); border-top: var(--border-w) solid var(--line); }
.attendance-block:not(:has(.block-kind option[value="work"]:checked)) .attendance-work-options { display: none; }
.attendance-block:not(:has(.block-kind option[value="absence"]:checked)) .attendance-absence-options { display: none; }
.attendance-more-blocks[open] > .attendance-block:first-of-type { margin-top: var(--space-1); }
.day-proposal { color: var(--ink); font-weight: 600; }
.attendance-reminder .panel-actions { margin-top: var(--space-1); }
/* The roster says under its filter when the automatic reminder leaves (task 052h, R22). */
.roster-reminder { margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--ph-text-md); }
.grant-state { display: block; }
.grant-state + .grant-state { margin-top: var(--space-1); }
.clock-failures { display: block; }

/* Print, spec 7.3: the company, the person and the month above the grid and two signature lines under it. */
.print-signatures { gap: var(--space-5); margin-top: var(--space-5); }
@media print {
  .print-signatures { display: flex; }
  .print-signatures > p { flex: 1; padding-top: var(--space-4); border-top: var(--border-w) solid var(--ink); }
  .timesheet-footer, .timesheet-gaps, .timesheet-bulk, .timesheet-aside .attendance-decisions, .grid-help, .timesheet-focus, .timesheet-to-check { display: none; }
  .day-mark { display: none; }
  .timesheet-grid .visually-hidden[data-field="problem"] { position: static; width: auto; height: auto; clip-path: none; white-space: normal; }
}

@media (max-width: 63.999rem) {
  .attendance-more-blocks > summary { min-height: var(--ph-control-h-touch); }
}
/* Phone, spec 6.11 and 7.1: the day rows become compact cards and the sheet opens on the current week (task 052h, A5 and
   A8), after the day in focus with its action (task 053b, G4). */
@media (max-width: 40rem) {
  /* One grid column, not a flex column: a column sizes the strip by its intrinsic height, taller than the laid out
     figures, the blank band of the phone (task 051b item 8). */
  .timesheet-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .timesheet-grid, .timesheet-grid tbody { display: block; }
  .timesheet-grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* The day's label keeps its width and the state's word wraps beside it, never over it (task 052h, N19). */
  .timesheet-grid tr { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; grid-template-areas: "day state action" "cell cell cell" "hours hours hours"; align-items: center; gap: var(--ph-space-05) var(--space-2); padding: var(--ph-space-15) var(--space-2); border-bottom: var(--border-w) solid var(--line); }
  .timesheet-grid tbody :is(th, td) { display: block; padding: 0; border: 0; text-align: left; }
  .timesheet-grid tbody th { grid-area: day; }
  .timesheet-grid .day-cell { grid-area: cell; }
  .timesheet-grid .day-hours { grid-area: hours; }
  .timesheet-grid .day-state { grid-area: state; width: auto; }
  .timesheet-grid .row-actions { grid-area: action; }
  .timesheet-grid .day-out { grid-column: 1 / -1; }
  .timesheet-grid tr.attendance-problem > :first-child { box-shadow: none; }
  .timesheet-grid tr.attendance-problem { box-shadow: inset 3px 0 0 var(--warn); }
  .timesheet-week { display: block; }
  .timesheet-grid tr.is-other-week { display: none; }
  .timesheet-footer > form, .timesheet-footer > form > button { flex: 1 1 auto; width: 100%; }
  .timesheet-grid tr.day-editor-row { display: block; padding: 0; }
  .timesheet-grid tr.day-editor-row > td { display: block; }
}
/* Task 216a (Silvia's decision B): the parts of a mixed day, each absence on its own muted line under the kind, with the
   absence drawing, its name and its hours; the same lines on the person's, the office's and the team manager's sheets.
   On a wide desk the «Giornata» column of the person's and the team manager's sheets holds the longest type name
   («Visite mediche, terapie ed esami diagnostici 15:00–17:00», about 23rem of text) on one line; the office's sheet,
   which prints every block and the day's figures beside it, keeps its columns and lets a long part wrap. */
.day-parts { display: block; }
.day-parts:empty { display: none; }
/* Task 259: what a late change did to a frozen day, in one line under its kind: read by a thumb at 390, so full ink on a quiet row. */
.day-late-line { display: block; margin-top: var(--ph-space-05); color: var(--ink); font-size: var(--ph-text-sm); font-weight: 600; }
.day-part { display: flex; align-items: center; gap: var(--ph-space-05); color: var(--ink-2); font-size: var(--ph-text-sm); font-variant-numeric: tabular-nums; }
.day-part .app-icon { flex: none; width: 1rem; height: 1rem; }
@media (min-width: 80rem) {
  .timesheet-grid.is-person .day-cell { min-width: 26rem; }
}
/* Task 054a (item 6, I10): «Presenze del mese» is a quiet link after the roster, never the header's one button. */
.roster-matrix { margin: 0 0 var(--space-3); font-size: var(--ph-text-md); }
/* Task 054a (theme 2, I11): each decision that needs a motivation is a disclosure named by the decision; opened, it says
   what the decision does, then asks the motivation. */
.attendance-decision { margin: var(--space-2) 0 0; }
.attendance-decision > summary { list-style: none; cursor: pointer; }
.attendance-decision > summary::-webkit-details-marker { display: none; }
.attendance-decision[open] > form { margin-top: var(--space-2); padding: var(--space-2); border-radius: var(--radius); background: var(--bg); }
.attendance-decision-consequence { margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--ph-text-md); }
.attendance-decision-approve > p { margin: 0 0 var(--space-1); color: var(--ink); font-size: var(--ph-text-md); }
/* Task 059b (Nina N40 to N42, Franco F29 F30): while a working day is empty «Approva senza consegna» is one line that says
   which days and from when, in the body's type, never a button or a form that would be refused. */
.attendance-decision-wait { margin: var(--space-2) 0 0; color: var(--ink); font-size: var(--ph-text-md); }

/* Task 056c (theme 6). «Aggiungi un blocco» opens one more block at a time: each unused block has its own disclosure
   inside the one before, and an open one hides its summary, so the blocks read as one list (Asia F12). */
.attendance-more-blocks[open] { margin: 0; }
.attendance-more-blocks[open] > summary { display: none; }
.attendance-more-blocks[open] > .attendance-block:first-of-type { margin-top: 0; }
/* The line that says the day kind switched to «Lavoro», and the confirmation of work on a day off, right under the
   times they concern (I22 to I24). */
.day-switched { margin: 0 0 var(--space-1); color: var(--ink); font-weight: 600; }
.day-confirm { margin: 0 0 var(--space-2); }
/* The day template picker right under the days; once a day is ticked it stays in view at the bottom of the screen
   (Asia F8). */
.timesheet-bulk { margin: 0 0 var(--space-3); }
.timesheet-main:has(input[name="localDates"]:checked) .timesheet-bulk { position: sticky; bottom: 0; z-index: 2; padding: var(--space-2);
  background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-2); }
/* Icon and colour of a day template, optional and folded (Asia F13). */
.preset-looks { margin: 0 0 var(--space-2); }
/* A day whose figures are all zero shows no line of zeros (I7, Asia F9); each figure keeps its label and value together,
   so the line wraps between figures and never clips on a phone. */
.day-figures.is-zero { display: none; }
.day-figure { white-space: nowrap; }
/* Task 311: the office's breakdown wraps between its figures, never inside one, so the «Giornata» column beside it keeps room
   for a day's times and a late change's line (at 1440 that line wrapped to four lines while the breakdown held one). */
.timesheet-grid .day-hours .day-figures { white-space: normal; }
/* The five figures of a sheet on one row where they fit; on a phone three and two, never one alone on a row (I7, I28).
   Task 290 (#5 of task 289): beside the office's aside at 1024 five fixed columns overlapped their words, so the boxes
   reflow by their width as every strip of figures does (components.css .figures). */
.timesheet .figures { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
/* People without access to the app, on the roster and on their sheet (Rosa F14), and the office's fill of the empty
   days from the schedule (Rosa F15). */
.roster-no-account { display: block; margin-top: var(--ph-space-05); padding-left: calc(var(--ph-disc) + var(--ph-space-15)); color: var(--ink); font-size: var(--ph-text-sm); }
.attendance-fill .form-actions { margin-top: var(--space-2); }
.attendance-fill-lead { margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--ph-text-md); }
@media (max-width: 40rem) {
  .timesheet-grid .day-hours, .timesheet-grid .day-hours .cell-note { white-space: normal; }
  .timesheet .figures { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .timesheet .figure { grid-column: span 2; }
  .timesheet .figure:nth-child(n + 4) { grid-column: span 3; }
  /* Task 331 (Silvia D5): the office's sheet of a person, whose figures may be six (the days the plan wrote), reads them in
     three columns, two rows, so the first day comes inside the first screen; the person's own sheet keeps three and two. */
  .timesheet.month-page .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .timesheet.month-page .figure, .timesheet.month-page .figure:nth-child(n + 4) { grid-column: auto; }
  .timesheet-main:has(input[name="localDates"]:checked) .timesheet-bulk .field-help { display: none; }
}
/* Task 057c (Iris I3, I4, I6 to I8, I45, I47; Rosa F9, F11). The sheets the office fills with days still to fill lead the
   roster under their own heading; a day to fill an absence covers says so under its state; the fill lists the days it
   leaves to the office's hand, each a link to its day; on a narrow screen the office's fill and decision come before the
   days; the close's row says what the office does before the close. */
.roster-group, .roster-group th { background: var(--surface-2); }
.roster-group th { font-size: var(--ph-text-sm); font-weight: 600; text-align: left; }
.day-absence-word { display: block; color: var(--ink); font-size: var(--ph-text-sm); }
.day-absence-help { max-width: var(--ph-measure); margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--ph-text-md); }
.attendance-fill-days { margin: 0 0 var(--space-2); padding-left: var(--space-3); font-size: var(--ph-text-md); }
.attendance-fill-days > li + li { margin-top: var(--ph-space-05); }
.close-todo { margin: 0 0 var(--ph-space-05); color: var(--ink); font-size: var(--ph-text-md); }
/* Task 059b: the close's row says why «Approva senza consegna» waits in the sheet's one line, wrapped in its cell. */
.data-table td.row-actions > .close-force-wait { min-width: 14rem; max-width: 22rem; margin: 0; color: var(--ink); font-size: var(--ph-text-sm); text-align: left; white-space: normal; }
@media (max-width: 63.999rem) {
  .page-split.is-office-fill > .timesheet-aside { order: -1; }
}
/* The personal clock's entry (task 083): the place of work and its note above the punch buttons, and the next punch as
   one big button that takes the whole row, at the kiosk's height, on a phone as on a desk. */
.clock-place-fields { display: grid; gap: var(--space-2); margin: 0 0 var(--space-2); }
.clock-place-fields > .form-field { margin: 0; }
.clock-now-form .clock-actions > .button-primary { flex: 1 1 100%; min-height: var(--ph-control-h-kiosk); font-size: var(--text-1); }
.clock-place { font-weight: 600; }

/* The team manager's pages (task 104): the week of today on a phone, as the person's own sheet folds the other weeks,
   and the lines of who is away. The tables are the shared stacked table of components.css. */
.team-week { display: none; }
.team-away-line { margin: 0 0 var(--ph-space-05); }
.team-sheet-total { margin: var(--space-1) 0; }
@media (max-width: 40rem) {
  .team-week { display: block; }
  .team-sheet-grid tr.is-other-week { display: none; }
  /* The team's sheet reads as the person's own card of a day, with no label over each value. */
  .data-table.stack-on-phone.team-sheet-grid td[data-label]::before { content: none; }
}
/* The planning page (task 105): the grid of the people and the days is a wide table on a desktop; on a phone it gives
   way to the list of the people, each a link to that person's week, which reads as the shared stacked table. A cell
   holds its state, the times and the project on lines of their own. */
.plan-people-list { display: none; margin: 0; padding: 0; list-style: none; }
.plan-people-list li { padding: var(--space-1) 0; }
.plan-grid-nav { margin: 0 0 var(--space-1); }
/* The column of the people keeps room for a first name: a name may break between its words and not inside one (seen
   2026-10-11, «Alessandr o Pozzi»). */
.plan-grid th[scope="row"] { min-width: 9rem; }
.plan-cell-link { display: block; min-height: var(--space-5); }
.plan-cell .plan-mark, .plan-cell .plan-times, .plan-cell .plan-project, .plan-cell .plan-reason { display: block; }
.plan-cell .plan-reason { color: var(--ink-2); font-size: var(--ph-text-sm); line-height: 1.2; }
.plan-cell .plan-reason:empty { display: none; }
.plan-cell-off, .plan-cell-out, .plan-cell-absent { color: var(--ink-2); }
.plan-cell-planned .plan-mark, .plan-cell-turned .plan-mark, .plan-cell-not_turned .plan-mark { font-weight: 600; }
.plan-skipped-list { margin: 0; padding-left: var(--space-3); }
.team-plan-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
/* Task 379 (Tiziana's T12): the month of the team fits its box with no sideways scroll on a desktop: each day a narrow
   column of one letter, the head of a day on two lines, the times and the reasons kept for screen readers alone; the
   letters are explained by the legend over the grid. The office's month matrix keeps its own widths. */
.data-table.plan-grid-month.timesheet-matrix { table-layout: fixed; width: 100%; }
.data-table.plan-grid-month.timesheet-matrix thead th, .plan-grid-month.timesheet-matrix td { min-width: 0; padding-inline: 0; white-space: normal; font-size: var(--ph-text-sm); }
.data-table.plan-grid-month.timesheet-matrix th[scope="row"], .data-table.plan-grid-month.timesheet-matrix thead th:first-child { min-width: 0; width: 9rem; padding-inline: var(--space-1); }
.plan-grid-month .plan-times, .plan-grid-month .plan-reason, .plan-grid-month .plan-absent-part { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plan-legend { margin: 0 0 var(--space-2); }
.plan-legend-title { margin: 0 0 var(--ph-space-05); font-weight: 600; }
.plan-legend dl { display: flex; flex-wrap: wrap; gap: var(--ph-space-05) var(--space-3); margin: 0; }
.plan-legend dl > div { display: flex; gap: var(--ph-space-05); }
.plan-legend dt { font-weight: 600; }
.plan-legend dd { margin: 0; }
/* Task 379 (Tiziana's T11): on a phone each person of the list reads the days of the view, one line for each day. */
.plan-glance-days { display: block; margin-top: var(--ph-space-05); }
.plan-glance-day { display: block; color: var(--ink-2); font-size: var(--ph-text-sm); }
.plan-glance-date { display: inline-block; min-width: 3.5rem; color: var(--ink); font-weight: 600; }

.day-confirm { display: inline; }
@media (max-width: 40rem) {
  .plan-grid-wide { display: none; }
  .plan-people-list { display: block; }
  .team-plan-actions .button { width: 100%; }
}
/* /presenze, design «Segnale»: the reminder is one quiet line under the months, with room above it. */
.attendance-reminder-line { margin: var(--space-3) 0 0; }
/* The rules' form in the side panel: the date the rules would apply from under «Salva»; the pauses one under the other,
   close together. */
.policy-next { flex-basis: 100%; margin: 0; }
.policy-pauses .check-field { min-height: var(--ph-control-h-compact); }
/* The preset form in the side panel: the people to choose one by one only while «Tutte le persone» is off; the way to
   delete the preset apart under the form. */
.preset-audience:has(.preset-for-all input:checked) .preset-people { display: none; }
.preset-for-all { margin-bottom: var(--space-1); font-weight: 600; }
.preset-blocks-head { margin: var(--space-3) 0 var(--space-1); }
.preset-delete { margin-top: var(--space-3); padding-top: var(--space-2); border-top: var(--border-w) solid var(--line); }

/* Design «Segnale»: the roster's person on one line, «Senza accesso all'app» a quiet mark under it; the reminder a compact
   block with its settings in a menu beside the title. */
.timesheet-roster th[scope="row"] { min-width: 13rem; }
.timesheet-roster .roster-no-account { display: block; color: var(--ink-2); font-size: var(--ph-text-sm); font-weight: 400; white-space: nowrap; }
.roster-reminder-card { padding-block: var(--space-2); }
.roster-reminder-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1); }
.roster-reminder-head > h2 { margin: 0; }
.roster-reminder-card .roster-reminder { margin: var(--space-1) 0 0; }
/* On a phone a cell with nothing to fix is left out by the shared rule of every stacked table (components.css, task 281). */
/* Design «Segnale», the person's sheet: a day is one line (day, kind and times, hours, state, one control at most) and
   the whole row opens the day in the side panel. On a phone a day is a card of two lines, the day with its state, then
   the kind and the times with the hours, and «Conferma» or the box of a day template under them, never beside the state. */
.timesheet-grid.is-person tbody tr { position: relative; }
.timesheet-grid.is-person tbody tr:hover { background: var(--surface-2); }
.timesheet-grid.is-person .day-row-link::after { content: ""; position: absolute; inset: 0; }
.timesheet-grid.is-person .row-actions > * { position: relative; z-index: 1; }
.timesheet-grid.is-person .day-kind { display: inline; }
.day-span { margin-left: var(--space-1); font-variant-numeric: tabular-nums; }
.day-span.is-planned { color: var(--ink-2); }
/* The state's words wrap inside their cell (task 216b): a long plan pill («Piano non applicato: c'è un'assenza per una
   parte del giorno») stays inside the table at 1440, 1280 and on a phone, never past its right edge. */
.timesheet-grid.is-person .day-state { max-width: 22rem; white-space: normal; }
.timesheet-grid.is-person .day-state-word:not(.day-ok-word) { display: inline; margin-left: var(--ph-space-05); }
.timesheet-grid.is-person tr:not(.is-upcoming, .attendance-problem, .is-muted, .is-plan-unconfirmed, .is-waiting, .is-quiet) .day-ok-word { display: inline; margin-left: var(--ph-space-05); }
.timesheet-grid.is-person .day-state-word:empty { display: none; }
.timesheet-grid.is-person .day-plan-word { padding: 0 var(--ph-space-05); border-radius: var(--radius-s); background: var(--ph-info-bg); color: var(--ink); font-size: var(--ph-text-sm); box-decoration-break: clone; }
.timesheet-grid.is-person .day-pick { min-height: var(--ph-control-h-compact); }
.timesheet-head > .figures { flex: 1 1 32rem; margin: 0; }
.timesheet-bulk-help { flex-basis: 100%; margin: 0; }
.timesheet-history { margin: 0 0 var(--space-3); }
@media (max-width: 40rem) {
  .timesheet-grid.is-person tr { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "day state state" "cell cell hours" "action action action"; gap: var(--ph-space-05) var(--space-2); }
  .timesheet-grid.is-person tbody .day-hours { text-align: right; }
  .timesheet-grid.is-person .day-state { max-width: none; text-align: right; white-space: normal; }
  .timesheet-grid.is-person .row-actions:not(:has(> :not([hidden]))) { display: none; }
  .timesheet-grid.is-person .row-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
  .timesheet-grid.is-person .day-span { display: block; margin-left: 0; }
}
/* The day in the side panel of the person's sheet: the form without its card, then the punches and the requests. */
.day-panel .day-main > .alert:first-child, .day-panel .facts { margin-top: 0; }
.day-panel-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-3); padding: var(--space-2); background: var(--bg); border-radius: var(--radius); }
.day-panel-confirm > p { margin: 0; }
.day-blocks-head { margin: var(--space-2) 0 var(--space-1); }
.day-panel-aside { margin-top: var(--space-3); padding-top: var(--space-2); border-top: var(--border-w) solid var(--line); }
.day-panel-part > h3 { margin: 0 0 var(--space-1); font-size: var(--ph-text-lg); }
.day-panel-part + .day-panel-part { margin-top: var(--space-3); }
.day-no-punches { margin: 0; }
/* A block reads as one line: kind, from, to; mode, project and place under «Altri dettagli». */
.attendance-block-times { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
.attendance-block-times .input-short { width: 100%; }
.attendance-block-options:has(> .attendance-block-more) { margin-top: var(--space-1); padding-top: 0; border-top: 0; }
.attendance-block-more > .form-grid { margin-top: var(--space-1); }
@media (max-width: 30rem) {
  .attendance-block-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .attendance-block-times > :first-child { grid-column: 1 / -1; }
}
/* «La mia squadra», design «Segnale»: one quiet line while nobody is away; the people's figures muted at zero and the
   days to fill in weight; the whole row opens the person's month in the side panel (the shared row-clickable, task 212). */
.team-glance { margin: 0 0 var(--space-3); color: var(--ink-2); }
.team-glance .team-waiting { color: var(--ink); font-weight: 600; }
.team-people tbody tr:hover { background: var(--surface-2); }
.team-count.is-zero { color: var(--ink-2); }
.team-count.is-due { color: var(--warn); font-weight: 600; }
.team-person-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0 0 var(--space-2); }
.team-person-line { color: var(--ink-2); font-size: var(--ph-text-sm); }
.team-person-days { margin: 0; padding: 0; list-style: none; }
.team-person-days > li { padding: var(--ph-space-05) 0; border-top: var(--border-w) solid var(--line); }
.team-person-days > li:first-child { border-top: 0; }
.team-person-day { display: inline-block; min-width: 5rem; font-variant-numeric: tabular-nums; }
.side-panel-body > .figures { margin: 0 0 var(--space-3); }
/* «Pianifica il mese»: on a wide screen the form is a column beside the grid, and its button stays at the bottom of the
   screen while the form scrolls. The people show only while «Tutta la squadra» is off, the fields of a source only while
   it is the chosen one. Task 272 (browser pass): at 1440 the column left the week grid 584px of a 708px table, so
   Saturday, Sunday and the «Alle» field of the day editor were cut at the card's edge; the form stands beside the grid
   only from 100rem, where the whole week fits, and above it below that width. */
.plan-people:has(#plan-everyone:checked) .plan-people-choices { display: none; }
.plan-source:has(#plan-source-week:not(:checked)) .plan-source-week { display: none; }
.plan-source:has(#plan-source-preset:not(:checked)) .plan-source-preset { display: none; }
.plan-source-week, .plan-source-preset { margin: 0 0 var(--space-2) var(--space-4); }
.plan-month-actions { position: sticky; bottom: 0; z-index: 1; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-inline: calc(-1 * var(--space-4)); padding: var(--space-2) var(--space-4); background: var(--surface-1); border-top: var(--border-w) solid var(--line); }
.plan-month-actions > .field-help { margin: 0; }
@media (min-width: 100rem) {
  .plan-layout { display: grid; grid-template-columns: minmax(22rem, 26rem) minmax(0, 1fr); align-items: start; gap: var(--space-3); }
  .plan-layout > .panel { margin: 0; }
  .plan-layout .plan-source-week { grid-template-columns: 1fr 1fr; }
  .plan-layout .plan-grid-week :is(th, td) { padding-inline: var(--space-1); }
  .plan-layout .plan-grid-week th[scope="row"] { min-width: 8rem; }
}
.team-page .period + .figures { margin-top: var(--space-2); }
.plan-page > .period { margin-bottom: var(--space-3); }

/* The blocks of a day as compact rows (task 214, day-rows.ejs): one line per block, the kind as a drawing and a short
   label, «dalle – alle», the length, the tools; «Altri dettagli» folds under the row. A day of three blocks takes about a
   third of the height of the old cards. The absences of the day read only, in the same rows. */
.block-list { display: grid; gap: var(--ph-space-05); margin: 0 0 var(--space-1); }
.block-rows { display: grid; gap: var(--ph-space-05); }
.block-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ph-space-05) var(--space-1); min-width: 0; margin: 0; padding: var(--ph-space-05) var(--space-1); background: var(--bg); border: var(--border-w) solid transparent; border-radius: var(--radius); }
.block-row[hidden] { display: none; }
.block-row.is-invalid { border-color: var(--err); }
.block-row.is-dragging, .block-row.is-carried { border-color: var(--accent); background: var(--surface-1); }
.block-row.is-absence { background: var(--surface-2); color: var(--ink-2); }
.block-icon { display: inline-grid; place-items: center; flex: none; color: var(--ink-2); }
.block-icon .app-icon, .block-tool .app-icon, .block-handle .app-icon, .clock-event-icon .app-icon { width: 1.25rem; height: 1.25rem; }
.block-kind select { width: auto; min-width: 6.5rem; }
.block-times { display: inline-flex; align-items: center; gap: var(--ph-space-05); }
.block-time { width: 4.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.block-dash { color: var(--ink-2); }
.block-length { min-width: 2.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.block-tools { display: inline-flex; gap: 0; margin-left: auto; }
.block-tool, .block-handle { display: inline-grid; place-items: center; width: var(--ph-control-h); height: var(--ph-control-h); padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); }
.block-tool:hover:not(:disabled), .block-handle:hover { background: var(--surface-2); color: var(--ink); }
.block-tool:disabled { color: var(--ink-3); cursor: not-allowed; }
.block-handle { cursor: grab; touch-action: none; }
.block-row.is-dragging .block-handle { cursor: grabbing; }
.block-list.is-scripted [data-block-move] { display: none; }
.block-more { flex: 1 0 100%; }
.block-more > summary { width: max-content; color: var(--accent-text); font-size: var(--ph-text-sm); cursor: pointer; }
.block-more-fields { display: grid; gap: var(--space-1); margin-top: var(--space-1); }
.block-row:not([data-kind="work"]) .block-options-work, .block-row:not([data-kind="absence"]) .block-options-absence { display: none; }
.block-row:not([data-kind="work"]):not([data-kind="absence"]) .block-more { display: none; }
.block-row > .field-error { flex: 1 0 100%; }
.block-absence-label { font-weight: 600; color: var(--ink); }
.block-absence-link { margin-left: auto; }
.block-absence-link + .block-absence-link { margin-left: 0; }
.block-absence-link + .block-absence-link::before { content: "\00b7"; display: inline-block; margin-right: var(--space-1); color: var(--ink-2); }
/* On a phone two ways to one absence wrap: each takes its own line, with no dot left at the start of one (task 238). */
@media (max-width: 40rem) {
  .block-absence-link:has(+ .block-absence-link), .block-absence-link + .block-absence-link { flex: 1 0 100%; margin-left: 0; }
  .block-absence-link + .block-absence-link::before { content: none; }
}
.block-add { margin: 0; }
.day-blocks-head .day-copy { margin-left: auto; }
.day-absence-ways { margin: var(--space-1) 0; }
/* «Assente?» on an empty working day (task 216c): three secondary buttons of one weight with their drawing, above the day
   template, wrapping on a phone; the task of the day, writing the hours, keeps the eye below them. */
.day-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-3); }
.day-shortcuts-title { margin: 0; font-weight: 600; }
.day-shortcuts-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.day-shortcuts .app-icon { flex: none; width: 1.25rem; height: 1.25rem; }
.day-form-actions { position: sticky; bottom: 0; z-index: 1; padding: var(--space-1) 0; background: var(--surface-1); border-top: var(--border-w) solid var(--line); }
.clock-events li { align-items: center; }
.clock-event-icon { display: inline-grid; place-items: center; color: var(--ink-2); }
.day-panel-aside .clock-events li { gap: var(--space-2); padding: var(--ph-space-05) 0; }
/* «Le mie presenze» (task 233, Iris: «righe di orario attenuate, eccezioni e assenze in evidenza»): a day as the schedule
   says reads in the quiet ink at the body's weight, an exception carries the accent's rule at its start; «Segnala
   un'eccezione» offers each exception as a large row of the whole panel's width, its box, its words and one help line. */
.presence-grid tr.is-as-schedule .day-kind, .presence-grid tr.is-as-schedule .day-worked { color: var(--ink-2); font-weight: 400; }
.presence-grid tr.is-exception th[scope="row"] { border-left: 3px solid var(--accent); }
.presence-grid tr.is-exception .day-state-word { color: var(--accent-text); font-weight: 600; }
/* The office's sheet in «solo eccezioni» (task 234b) draws its rows with these styles: an exception row says
   «Eccezione segnalata» in place of «In ordine». */
/* «Una tabella di 31 righe tutte uguali deve essere leggera»: a day as the schedule says shows neither its line of
   figures, which only repeat the schedule, nor «In ordine»; its mark stays. */
.presence-grid tr.is-exception .day-ok-word, .presence-grid tr.is-as-schedule .day-ok-word, .presence-grid tr.is-as-schedule .day-figures { display: none; }
.exception-choices { display: grid; gap: var(--space-1); }
.exception-choices > legend { margin: 0 0 var(--space-1); padding: 0; font-weight: 600; }
.exception-choice { display: flex; align-items: flex-start; gap: var(--space-2); min-height: var(--ph-control-h-touch); padding: var(--space-2); border: var(--border-w) solid var(--ink-3); border-radius: var(--radius); cursor: pointer; }
.exception-choice > input { margin-top: 0.2rem; }
.exception-choice:has(input:checked) { border-color: var(--accent); }
.exception-choice-text { display: grid; gap: var(--ph-space-05); }
.exception-choice-title { font-weight: 600; }
.exception-times { margin-top: var(--space-2); }
@media (max-width: 30rem) {
  .block-row { padding-inline: var(--ph-space-05); }
  .block-kind select { min-width: 0; }
}

/* The day door of a CIG (task 248): under the state's word on the office's row, a block of its own on the day page. */
.cig-door { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ph-space-05) var(--space-2); margin-top: var(--ph-space-05); }
.cig-door:not(.is-compact) { margin-block: var(--space-2); }
.cig-door-form { margin: 0; }
.cig-door-line { margin: 0 0 var(--ph-space-05); font-weight: 600; }
.cig-door.is-compact .cig-door-line { font-weight: 400; font-size: var(--ph-text-md); }
.cig-door.is-compact .cig-door-more { font-size: var(--ph-text-md); white-space: nowrap; }
/* The row's button lines up with the state's word and its link above and below it. */
.cig-door.is-compact .button-ghost { min-height: 0; padding-inline: 0; text-align: left; justify-content: flex-start; }

/* Forced colours (task 071, components.css): the foot of a timesheet is a card, so it keeps a visible edge where the fills and
   the shadows are gone; so does the bar of the day templates while it floats at the bottom of the screen. */
@media (forced-colors: active) {
  .timesheet-footer { border: var(--border-w) solid; }
  .timesheet-main:has(input[name="localDates"]:checked) .timesheet-bulk { border: var(--border-w) solid; }
}
