/* Shared components, design spec part 5 in the look of design D «Sportello» (research/design-d-spec.md 4 to 7), on the
   roles of theme.css, the eight spacing steps of 4.3 and the type steps of 4.4. Shape by kind: buttons, fields, selects
   and menu items take --radius, cards, sheets and popovers --radius-l, chips, badges and segments --radius-s, discs
   stay round. Depth by kind: a resting card takes --shadow-1 and no border, a floating layer --shadow-2. Task 043 rewrote the shell, header, button, form, flash, alert, panel, facts, menu and tab rules and folded
   in the list components of task 042a (toolbar, table, drawer, pagination, figures, empty state, flow bar) for task
   044 to finish; every rule is a plain component rule, none scoped to a page. A partial in src/views/partials renders
   each component; feature files keep only widgets unique to one module. */

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Buttons, spec 5.2 and design-d-spec.md 6: a bare button and .button are tonal (a soft blue fill, no shadow); the main
   button is opt in, appears once per header and once per form, and is the one button that casts a shadow; a ghost is
   text that underlines on hover; danger is never the main button and is drawn with a 1px outline; a disabled button is
   flat. Every button carries a 1px border, transparent but on the danger button, inside its height: where the system
   forces its own colours and drops fills and shadows, the border is what gives the button a shape. Compact only inside
   table rows on desktop. Background and shadow fade in 120ms, nothing moves. */
button, .button, .button-primary, .button-ghost, .button-danger { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: var(--ph-control-h); margin: 0; padding: 0 var(--space-2); border: var(--border-w) solid transparent; border-radius: var(--radius); background: var(--ph-tonal); color: var(--ph-tonal-ink); font: inherit; font-size: var(--ph-text-md); font-weight: 600; line-height: 1.35; text-align: center; text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-enter), box-shadow var(--dur-micro) var(--ease-enter); }
:is(.button, .button-primary, .button-ghost, .button-danger):visited { color: var(--ph-tonal-ink); }
button:hover, .button:hover { background: var(--ph-tonal-hover); }
.button-primary, .button-primary:visited { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.button-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-2); }
.button-ghost, .button-ghost:visited { background: transparent; color: var(--accent-text); }
.button-ghost:hover { background: transparent; text-decoration: underline; text-underline-offset: 0.2em; }
.button-ghost.is-danger, .button-ghost.is-danger:visited { color: var(--err); }
.button-danger, .button-danger:visited { background: var(--surface-1); border-color: var(--err); color: var(--err); }
.button-danger:hover { background: var(--ph-err-bg); }
.button-compact { min-height: var(--ph-control-h-compact); padding: 0 var(--ph-space-15); font-size: var(--ph-text-sm); }
button:disabled, .button:disabled, .button-primary:disabled, .button-ghost:disabled, .button-danger:disabled,
.button[aria-disabled="true"], .button-primary[aria-disabled="true"], .button-ghost[aria-disabled="true"], .button-danger[aria-disabled="true"] { background: var(--surface-2); border-color: transparent; color: var(--ink-3); box-shadow: none; text-decoration: none; cursor: not-allowed; opacity: 1; }
/* A text link that submits a form (logout, the wizard's secondary exits) keeps the link look. */
.link-button { display: inline; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
.link-button:hover { background: transparent; text-decoration-thickness: 2px; }
.button-pencil::before { content: ""; flex: none; width: 0.75rem; height: 0.75rem; background: linear-gradient(135deg, transparent 40%, currentColor 40%, currentColor 60%, transparent 60%); border-bottom: 1.5px solid currentColor; }

/* Focus ring, spec 4.7: 2px ring with 2px offset on paper and canvas (base.css), drawn inside the main button in the
   colour of its text. The current segment is a paper chip since design D, so it keeps the ring of base.css. */
.button-primary:focus-visible { outline-color: var(--on-accent); outline-offset: -3px; }
.tabs a:focus-visible { outline-offset: -2px; }

/* Form fields, spec 5.4 to 5.7: the label above the control, help or error in one slot linked by aria-describedby,
   widths by content, native selects, sections as fieldsets with a legend, actions under the last field. A field keeps a
   1px boundary in --ink-3, which reaches 3:1 on the card, and its placeholder is --ink-3 at full opacity, 4.5:1 on the
   field, instead of each browser's paler default (design-d-spec.md 6). */
input, select, textarea { width: 100%; min-height: var(--ph-control-h); margin: 0; padding: var(--space-1) var(--ph-space-15); border: var(--border-w) solid var(--ink-3); border-radius: var(--radius); background: var(--surface-1); color: var(--ink); font: inherit; font-size: var(--ph-text-md); line-height: 1.35; }
/* A single line field and a select are exactly as tall as the control height (design-d-spec.md 10). WebKit gives them
   the font's own line spacing when it is larger than the one set, and Mukta's is 1.66 of the font size, so a minimum
   height let the field grow about 4px in Safari. The height is fixed and the block padding is none, so the text is
   centred by the control itself in every engine. A box, a file, a colour and a range input are not text fields and keep
   their own size; a list select and a textarea grow with their lines and stay on the minimum height. */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"], [type="range"]), select:not([multiple], [size]) { height: var(--ph-control-h); padding-block: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); cursor: not-allowed; }
input[readonly], textarea[readonly] { border-color: transparent; background: transparent; padding-inline: 0; }
input[type="checkbox"], input[type="radio"] { flex: none; width: 1rem; height: 1rem; min-height: 0; margin: 0; padding: 0; vertical-align: middle; }
input[type="file"] { padding: var(--ph-space-05); border-style: dashed; }
input[type="date"] { width: min(100%, var(--ph-input-date)); }
input[type="color"] { width: var(--space-6); padding: var(--ph-space-05); }
textarea { min-height: 6rem; resize: vertical; line-height: var(--leading-body); }
select { padding-right: var(--space-4); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select[multiple] { padding-right: var(--ph-space-15); background-image: none; }
[aria-invalid="true"] { border: 2px solid var(--err); }
.input-short { width: min(100%, var(--ph-input-short)); }
.input-medium { width: min(100%, var(--ph-input-medium)); }
.form-field { display: grid; align-content: start; gap: var(--ph-space-05); min-width: 0; margin: 0 0 var(--space-2); }
.form-grid .form-field, .form-field:last-child { margin-bottom: 0; }
/* A label that wraps its control (the templates the pay consoles clone carry no ids) stacks the text above it. */
label.form-field { color: var(--ink); font-size: var(--ph-text-md); font-weight: 600; line-height: 1.35; }
label.form-field > :is(input, select, textarea), label.form-field > .field-help { font-weight: 400; }
.form-field > label { color: var(--ink); font-size: var(--ph-text-md); font-weight: 600; line-height: 1.35; }
.form-field .required, .form-field > label > span[aria-hidden="true"] { color: var(--err); }
.field-help { display: block; color: var(--ink-2); font-size: var(--text--1); line-height: 1.35; }
.field-error { display: inline-flex; align-items: center; gap: var(--ph-space-05); color: var(--err); font-size: var(--text--1); font-weight: 600; line-height: 1.35; }
.field-error::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(var(--surface-1), var(--surface-1)) 50% 2px / 2px 5px no-repeat, linear-gradient(var(--surface-1), var(--surface-1)) 50% 8px / 2px 2px no-repeat, var(--err); }
p.field-help, p.field-error { margin: 0; }
/* A checkbox or radio sits left of its label on one line with a 44px tall hit area. */
.check-field { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); min-height: var(--ph-control-h); }
.check-field > label { display: inline-flex; align-items: center; min-height: var(--ph-control-h); font-weight: 400; cursor: pointer; }
.check-field > :is(.field-help, .field-error) { flex-basis: 100%; }
/* Task 192: the label of a choice that cannot be taken reads as unavailable, as its box does. */
.check-field > input:disabled + label { color: var(--ink-2); cursor: not-allowed; }
.form-field-wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.form-lead { color: var(--ink-2); max-width: var(--ph-measure); }
fieldset { min-width: 0; margin: 0 0 var(--space-2); padding: var(--space-2); border: var(--border-w) solid var(--line); border-radius: var(--radius); }
/* Task 295 (#10 of task 293): a legend that is a file name with no space wraps inside its fieldset. */
legend { max-width: 100%; padding: 0 var(--space-1); font-weight: 600; overflow-wrap: anywhere; }
fieldset.form-section { margin: 0 0 var(--space-3); padding: 0; border: 0; border-radius: 0; }
fieldset.form-section + fieldset.form-section { padding-top: var(--space-3); border-top: var(--border-w) solid var(--line); }
/* Task 195: the fields of a settings page of a read-only company, shown disabled in the place of its form; the form's
   actions are not drawn there. */
fieldset.read-only-fields { margin: 0; padding: 0; border: 0; border-radius: 0; }
fieldset.read-only-fields .form-actions { display: none; }
.form-section > legend { float: left; width: 100%; margin: 0 0 var(--space-2); padding: 0; font-size: var(--ph-text-lg); font-weight: 600; }
.form-section > legend + * { clear: both; }
/* A section whose legend is only for assistive technology (the time blocks of a day): the section rule above must not
   give the hidden legend the full width, which would reach past the page (044 round 2). */
.form-section > legend.visually-hidden { float: none; width: 1px; margin: 0; }
.panel.form-section { margin: 0 0 var(--space-3); padding: var(--space-3); background: var(--surface-1); border: 0; border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel.form-section + .panel.form-section { padding-top: var(--space-3); border-top: 0; }
.form-section-lead { margin: 0 0 var(--space-2); color: var(--ink-2); max-width: var(--ph-measure); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: var(--space-3) 0 0; }
/* Task 371 (#3 of task 370): a button that still names data (an address, a one-word company) wraps inside its box
   instead of running off both sides of a phone. */
.form-actions > button { min-width: 0; overflow-wrap: anywhere; }
.form-actions > a:not([class]) { display: inline-flex; align-items: center; min-height: var(--ph-control-h); }
/* Long forms keep their actions in reach: a sticky bar with a top hairline (spec 5.4, 6.4). */
.form-actions-sticky { position: sticky; bottom: 0; z-index: 5; margin-inline: calc(-1 * var(--space-2)); padding: var(--space-2); background: var(--bg); border-top: var(--border-w) solid var(--line); }
/* The error summary of a refused POST, spec 5.4: an alert at the top of the form, one link per field. */
.form-errors { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) calc(var(--space-2) * 2 + var(--ph-space-15)); position: relative; border: var(--border-w) solid var(--ph-err-line); border-radius: var(--radius); background: var(--ph-err-bg); color: var(--err); font-size: var(--ph-text-md); }
.form-errors::before { content: ""; position: absolute; top: calc(var(--space-2) + 0.125rem); left: var(--space-2); width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) 50% 2px / 2px 6px no-repeat, linear-gradient(currentColor, currentColor) 50% 9px / 2px 2px no-repeat; box-sizing: border-box; }
.form-errors > h2 { margin: 0 0 var(--space-1); color: var(--err); font-size: var(--ph-text-md); font-weight: 600; }
.form-errors > p { margin: 0 0 var(--space-1); }
.form-errors > ul { margin: 0; padding-left: var(--space-2); }
.form-errors a { display: inline-flex; align-items: center; min-height: 1.5rem; color: inherit; font-weight: 600; }

/* Panels, design-d-spec.md 5: a panel is a card, a paper sheet with the large radius, one soft shadow and no border. A
   card never sits inside another card: a panel inside a panel is a section under a hairline. */
.panel { min-width: 0; margin: 0 0 var(--space-4); padding: var(--space-4); background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel .panel { margin: var(--space-3) 0 0; padding: var(--space-3) 0 0; border: 0; border-top: var(--border-w) solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel > h2, .panel-heading > h2 { margin: 0 0 var(--space-2); font-size: var(--ph-text-lg); }
.panel-section { margin-top: var(--space-3); padding-top: var(--space-3); border-top: var(--border-w) solid var(--line); }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); }
.panel-heading > h2 { margin: 0; }
.panel-lead { color: var(--ink-2); max-width: var(--ph-measure); }

/* Page containers, spec 3.5 and 3.7 */
.page { min-width: 0; }
/* Design «Segnale»: a reading page takes the width every page takes, header and tabs included; its running text keeps
   the measure, so lines stay short where tables and panels use the room. */
/* The lines of the header (the subtitle, the context line) take the width of the heading: one short sentence is not cut in two. */
.page-read :not(.page-heading) > p { max-width: var(--ph-measure); }
/* A record's facts read in two columns where the page is wide enough, one where it is not (design «Segnale»): the
   panels keep their order, down the first column and then the second, and never split between the two. */
.read-columns { columns: 2 26rem; column-gap: var(--space-3); }
.read-columns > * { break-inside: avoid; margin-top: 0; }
.read-columns:has(> :only-child) { columns: auto; }
.page-form { max-width: var(--ph-page-form); }
.page-split { display: grid; grid-template-columns: minmax(0, 1fr) var(--ph-aside); gap: var(--space-4); align-items: start; }
.page-aside { min-width: 0; }
.page-aside > .panel { padding: var(--space-2); }
/* Long record forms: a sticky section index beside the form, a chip row under 64rem. */
.page-nav { display: grid; grid-template-columns: var(--ph-section-index) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.section-index { position: sticky; top: var(--space-3); }
.section-index ul { display: grid; margin: 0; padding: 0; list-style: none; border-left: var(--border-w) solid var(--line); }
.section-index a { display: flex; align-items: center; min-height: var(--ph-control-h); padding: 0 var(--ph-space-15); color: var(--ink-2); font-size: var(--ph-text-md); text-decoration: none; }
.section-index a:hover { color: var(--accent-text); background: var(--accent-subtle-bg); }
.page-nav .panel[id], .page-nav fieldset[id] { scroll-margin-top: var(--space-3); }
.page-section { margin: 0 0 var(--space-4); }
.page-section > h2 { margin: 0 0 var(--space-2); }

/* Page header, spec 3.4 and 5.1 */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); padding: 0 0 var(--space-3); border-bottom: var(--border-w) solid var(--line); }
.page-header:has(+ .tabs) { margin-bottom: 0; }
.page-heading { flex: 1 1 24rem; min-width: 0; }
.page-header > .record-disc { align-self: center; }
.page-header > .record-disc + .page-heading { flex-basis: 20rem; }
.page-heading > h1 { margin: 0; font-size: var(--text-2); font-weight: 800; letter-spacing: -0.02em; line-height: var(--leading-display); overflow-wrap: break-word; }
.page-back, .page-eyebrow { margin: 0 0 var(--space-1); color: var(--ink-2); font-size: var(--ph-text-sm); line-height: 1.35; }
/* The context line keeps the height of the way back (its link is 1.5rem tall), so a title stands at one height on every page. */
.page-back, .page-eyebrow { min-height: 1.5rem; display: flex; align-items: center; }
.page-back a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 1.5rem; color: var(--ink-2); text-decoration: none; }
.page-back a::before { content: ""; width: 0.4em; height: 0.4em; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.page-back a:hover { color: var(--accent-text); text-decoration: underline; }
/* Task 331 (Silvia D5): the facts that say which record the page is (a matricola, a month) read second, under the title, at
   body size in the ink of the text, never as the smallest grey line of the page. */
.page-facts { margin: var(--ph-space-05) 0 0; color: var(--ink); font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.page-lead { max-width: none; margin: var(--space-1) 0 0; color: var(--ink-2); font-size: var(--ph-text-md); line-height: var(--leading-body); }
.page-status { margin: var(--space-1) 0 0; color: var(--ink-2); font-size: var(--ph-text-sm); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-1); max-width: 32rem; }
.page-actions > form { margin: 0; }

/* Overflow menu, user menu and the page info disclosure, spec 5.20 and 3.4 */
.menu, .page-info { position: relative; display: inline-block; }
.menu > summary, .page-info > summary, .row-drawer > summary { list-style: none; }
.menu > summary::-webkit-details-marker, .page-info > summary::-webkit-details-marker, .row-drawer > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 0.4em; height: 0.4em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.menu[open] > summary { background: var(--ph-tonal-hover); }
.page-info > summary::before { content: ""; flex: none; width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) 50% 3px / 2px 2px no-repeat, linear-gradient(currentColor, currentColor) 50% 6px / 2px 5px no-repeat; }
.menu-panel, .page-info-panel { position: absolute; top: calc(100% + var(--ph-space-05)); right: 0; z-index: 20; min-width: 16rem; max-width: calc(100vw - 2 * var(--space-2)); margin: 0; background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-2); }
/* The items are inset by one step, so their rounded hover ground sits inside the panel's corners. */
.menu-panel { padding: var(--space-1); list-style: none; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 2.75rem; padding: 0 var(--space-2); border: 0; border-radius: var(--radius); background: transparent; box-shadow: none; color: var(--ink); font-size: var(--ph-text-md); font-weight: 400; text-align: left; text-decoration: none; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--accent-subtle-bg); }
.menu-panel a:focus-visible, .menu-panel button:focus-visible { outline-offset: -2px; }
.menu-panel form { margin: 0; }
.page-info-panel { width: 24rem; padding: var(--space-2); color: var(--ink); font-size: var(--ph-text-md); }
.page-info-panel > p { margin: 0; }

/* Tabs, spec 5.15 */
.tabs { display: flex; gap: 0; margin: 0 0 var(--space-3); padding: 0; overflow-x: auto; background: transparent; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); --tabs-ground: var(--bg); }
.tabs a { display: inline-flex; flex: none; align-items: center; gap: var(--space-1); min-height: 2.75rem; padding: 0 var(--space-2); color: var(--ink-2); font-size: var(--ph-text-md); text-decoration: none; }
.tabs a:hover { background: var(--surface-1); color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); scroll-margin-inline: var(--space-4); scroll-initial-target: nearest; }
.tab-icon { flex: none; width: 1rem; height: 1rem; }
/* Task 198 (Silvia P34): a strip wider than its place scrolls sideways and says that it goes on. The fade is the last
   item of the strip, stuck to its trailing edge and drawn over the strip's rule: over the cut tab while more
   follows, in a place of its own after the last tab once the strip is scrolled to its end or fits. The page opens on
   the current tab in view (scroll-initial-target). No script. */
.tabs::after { content: ""; position: sticky; right: 0; flex: none; width: var(--space-4); background: linear-gradient(to right, transparent, var(--tabs-ground)); box-shadow: inset 0 -1px 0 var(--line); pointer-events: none; }
:is(.panel, .side-panel) .tabs { --tabs-ground: var(--surface-1); }

/* Status mark, pill, value pill and count, spec 5.10 and design-d-spec.md 5 and 7. A status is a round 8px dot and a
   word in the ink of the text inside a chip: the mark carries its dot as an element and the pill draws the same dot, in
   the colour of its tone or, for the neutral tone, in --ink-3. The chip ground is --surface-2 on the page and --bg on a
   card, and it always differs from what the chip sits on: on a row that takes a tone (under the pointer, selected, with
   its drawer open) and on the current date of a list the chip is paper, and in a well, which is the page tone inside a
   card, it takes the ground it has on the page. State is never carried by colour alone: every dot has its word. */
.status, .pill, .value-pill { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-1); border-radius: var(--radius-s); background: var(--surface-2); color: var(--ink); line-height: 1.35; vertical-align: middle; }
.status, .pill { gap: var(--space-1); }
.status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status-ok .status-dot, .pill-ok::before { background: var(--ok); }
.status-info .status-dot, .pill-info::before { background: var(--ph-info); }
.status-warn .status-dot, .pill-warn::before { background: var(--warn); }
.status-err .status-dot, .pill-err::before { background: var(--err); }
/* Decision of 2026-10-15 (Iris I2): the one strong state, a month late, filled in its tone with white text and no dot, the
   same on every surface (the context fills below leave it alone). */
.pill-strong { font-weight: 600; }
.pill-strong::before { content: none; }
.pill-strong.pill-err { background: var(--err); color: var(--on-accent); }
.pill { font-size: var(--ph-text-sm); font-weight: 400; }
.value-pill { max-width: 15rem; font-size: var(--ph-text-sm); font-weight: 600; overflow-wrap: anywhere; }
:is(.panel, .table-scroll, .empty, .date-groups, .menu-panel, .page-info-panel, .row-drawer-panel) :is(.status, .pill:not(.pill-strong), .value-pill) { background: var(--bg); }
.data-table tbody tr:is(:hover, .is-selected, :has(.row-drawer[open])) :is(.status, .pill:not(.pill-strong), .value-pill), .date-group[aria-current="date"] :is(.status, .pill:not(.pill-strong), .value-pill) { background: var(--surface-1); }
:is(.disclosure-panel, .panel .empty) :is(.status, .pill:not(.pill-strong), .value-pill) { background: var(--surface-2); }
/* A count, design-d-spec.md 7. A plain total (the counts of a segmented control, of a tab that lists, of an org unit) is
   a quiet number in --ink-2 with no ground. A count of things that wait for the user is a badge on the attention ground
   with the ink of the text: a tab of work to do asks for it with the waiting local of the tabs partial, and the sidebar
   and the bell draw theirs in shell.css. */
.count { color: var(--ink-2); font-size: var(--ph-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.count-waiting { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 var(--ph-space-05); border-radius: var(--radius-s); background: var(--ph-attention-bg); color: var(--ink); line-height: 1; }
.identifier-hint, .mono { font-family: var(--font-mono); font-size: var(--ph-text-sm); font-size-adjust: none; }
:is(input, textarea).mono { font-size: var(--ph-text-md); }

/* Flash, spec 5.9: rendered by the layout at the top of main, above the page header; the tone is the second class */
.flash { position: relative; margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) calc(var(--space-2) * 2 + var(--ph-space-15)); border: var(--border-w) solid var(--ph-ok-line); border-radius: var(--radius); background: var(--ph-ok-bg); color: var(--ok); font-size: var(--ph-text-md); font-weight: 400; }
.flash::before { content: ""; position: absolute; top: calc(var(--space-2) + 0.125rem); left: var(--space-2); width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.flash::after { content: ""; position: absolute; top: calc(var(--space-2) + 0.3rem); left: calc(var(--space-2) + 0.35rem); width: 4px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.flash-info { border-color: var(--ph-info-line); background: var(--ph-info-bg); color: var(--ph-info); }
.flash-warning { border-color: var(--ph-warn-line); background: var(--ph-warn-bg); color: var(--warn); }
.flash-error { border-color: var(--ph-err-line); background: var(--ph-err-bg); color: var(--err); }
.flash:is(.flash-info, .flash-warning, .flash-error)::before { background: linear-gradient(currentColor, currentColor) 50% 2px / 2px 6px no-repeat, linear-gradient(currentColor, currentColor) 50% 9px / 2px 2px no-repeat; }
.flash:is(.flash-info, .flash-warning, .flash-error)::after { content: none; }
.flash a { color: inherit; font-weight: 600; margin-left: var(--space-1); }

/* Alert, spec 5.9: tone colours on their tinted grounds, glyph drawn in CSS */
/* Task 284 (#5 of task 283): a long word, a file's name, wraps inside the box; the page never runs past the screen. */
.alert { position: relative; overflow-wrap: anywhere; margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) calc(var(--space-2) * 2 + var(--ph-space-15)); border: var(--border-w) solid var(--ph-info-line); border-radius: var(--radius); background: var(--ph-info-bg); color: var(--ph-info); font-size: var(--ph-text-md); }
.alert > * { margin: 0; }
.alert > * + * { margin-top: var(--space-1); }
.alert-title { font-weight: 600; }
.alert-items { padding-left: var(--space-2); }
.alert a { color: inherit; font-weight: 600; }
/* Spec 7.2: text link targets reach 24px on desktop; the 64rem block raises them to 44px. */
.alert-link a, a.person-name { display: inline-flex; align-items: center; min-height: 1.5rem; }
/* The links of a cell list (the sources of the calendar export) and the plain links of a panel's actions reach the same
   24px target (045 review round 2, axe target-size). */
.cell-list a, .panel-actions > a:not([class]) { display: inline-flex; align-items: center; min-height: 1.5rem; }
.alert-glyph { position: absolute; top: calc(var(--space-2) + 0.125rem); left: var(--space-2); width: 1rem; height: 1rem; margin: 0; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) 50% 2px / 2px 6px no-repeat, linear-gradient(currentColor, currentColor) 50% 9px / 2px 2px no-repeat; }
.alert-info .alert-glyph { background: linear-gradient(currentColor, currentColor) 50% 2px / 2px 2px no-repeat, linear-gradient(currentColor, currentColor) 50% 5px / 2px 6px no-repeat; }
.alert-success .alert-glyph { background: none; }
.alert-success .alert-glyph::after { content: ""; position: absolute; top: 2px; left: 4px; width: 4px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.alert-success { background: var(--ph-ok-bg); border-color: var(--ph-ok-line); color: var(--ok); }
.alert-warning { background: var(--ph-warn-bg); border-color: var(--ph-warn-line); color: var(--warn); }
.alert-error { background: var(--ph-err-bg); border-color: var(--ph-err-line); color: var(--err); }
.alert-error .alert-glyph { background: none; }
.alert-error .alert-glyph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(currentColor, currentColor) 50% 50% / 2px 8px no-repeat, linear-gradient(currentColor, currentColor) 50% 50% / 8px 2px no-repeat; transform: rotate(45deg); }

/* Record facts, spec 5.19: two columns with a hairline per pair */
.facts { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; margin: 0 0 var(--space-2); }
.facts > dt, .facts > dd, .facts > div > dt, .facts > div > dd { margin: 0; padding: var(--space-1) var(--space-2) var(--space-1) 0; border-top: var(--border-w) solid var(--line); overflow-wrap: anywhere; }
.facts > div { display: contents; }
.facts dt { color: var(--ink-2); }
.facts dd { color: var(--ink); }
.facts-single { grid-template-columns: minmax(0, 1fr); }

/* Disclosures: a form that has no page of its own opens in place (spec 10, criterion 10); the summary is a button. */
.disclosure { margin: 0 0 var(--space-2); }
.disclosure > summary { display: inline-flex; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] { flex-basis: 100%; }
.disclosure-panel { margin-top: var(--space-1); padding: var(--space-2); background: var(--bg); border-radius: var(--radius); }
.disclosure-panel > p { margin: 0 0 var(--space-2); }
.disclosure-create[open] > :not(summary) { margin-top: var(--space-2); padding: var(--space-3); background: var(--surface-1); border: 0; border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel.disclosure { padding: var(--space-2) var(--space-3); }
/* A long list by year (task 291, the payslips): each year a native disclosure whose summary names the year and how many
   rows it holds, with a chevron that turns when it opens; the current year open, the others closed. */
.year-group { margin: 0 0 var(--space-2); }
.year-group > summary { display: flex; align-items: center; gap: var(--space-2); min-height: var(--ph-control-h-touch); padding-block: var(--space-1); border-bottom: var(--border-w) solid var(--line); list-style: none; cursor: pointer; }
.year-group > summary::-webkit-details-marker { display: none; }
.year-group > summary::before { content: ""; flex: none; width: 0.45em; height: 0.45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.year-group[open] > summary::before { transform: rotate(45deg); }
.year-group[open] > summary { margin-bottom: var(--space-2); }
.year-group-year { color: var(--ink); font-size: var(--ph-text-lg); font-weight: 600; }
.year-group-count { color: var(--ink-2); }

/* The seven day toggles of a working week (spec 5.7): a row of chips, not seven selects. */
.weekday-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.weekday-chips > .check-field { margin: 0; min-height: 0; padding: 0 var(--ph-space-15); background: var(--surface-1); border: var(--border-w) solid var(--ink-3); border-radius: var(--radius-s); }
.weekday-chips > .check-field:has(input:checked) { background: var(--ph-tonal); border-color: var(--accent); }

/* Checklist, spec 6.3 and 6.14: a done mark, the label and the link that fixes it */
.checklist { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.checklist > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-height: var(--ph-control-h); padding: var(--space-1) 0; border-top: var(--border-w) solid var(--line); }
.checklist > li:first-child { border-top: 0; }
/* Task 295 (#3 of task 293): a long e-mail or a one-word name wraps inside its row, never widens the page. */
.checklist-label { flex: 1 1 12rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
/* Task 369 (rompi-ui 368 #18): the note beside the label (an e-mail of 90 characters) wraps the same way at 320. */
.checklist > li > .cell-note { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

/* Discs: the logo or initials disc of a record header (spec 6.3, 6.4), an avatar on the tonal ground (design-d-spec.md 7) */
.record-disc { display: inline-grid; flex: none; place-items: center; width: 3rem; height: 3rem; overflow: hidden; border-radius: 50%; background: var(--ph-tonal); color: var(--ph-tonal-ink); font-size: var(--ph-text-lg); font-weight: 600; }
.record-disc img { width: 100%; height: 100%; object-fit: cover; }

/* Meter, spec 6.14: a bar the browser draws, tinted with the accent */
meter { width: min(100%, 28rem); height: var(--space-2); }
/* The comporto meter of an absence case (absence-events comporto.ejs) stands on its own line, one step taller. */
.absence-comporto meter { display: block; height: var(--space-3); }
.meter-field { display: grid; gap: var(--ph-space-05); margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--ph-text-md); font-weight: 600; line-height: 1.35; }

/* Empty state, spec 5.14: a card on the page; inside a panel it is a well on the page tone (a group inside a card,
   design-d-spec.md 5), and inside a table sheet it is the sheet itself. */
.empty { display: grid; justify-items: center; gap: var(--space-1); margin: 0; padding: var(--space-5) var(--space-3); text-align: center; background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel .empty { background: var(--bg); border-radius: var(--radius); box-shadow: none; }
.table-scroll .empty { border-radius: 0; box-shadow: none; }
/* Task 307: an empty card on the page followed by a panel («Nessun cedolino da abbinare» then «Già decisi») keeps the
   gap between two panels instead of touching it. */
.page > .empty + .panel { margin-top: var(--space-4); }
.empty-glyph { width: 2rem; height: 2rem; border: 1.5px solid var(--ink-2); border-radius: var(--radius-s); background: linear-gradient(var(--ink-2), var(--ink-2)) 50% 60% / 60% 1.5px no-repeat; }
.empty > h2 { margin: var(--space-1) 0 0; font-size: var(--ph-text-lg); font-weight: 600; }
.empty-lead { max-width: var(--ph-measure); margin: 0; color: var(--ink-2); font-size: var(--ph-text-md); }
.empty-action { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1) var(--space-2); margin: var(--space-1) 0 0; }
/* A short fact that stands where a list would be ("Nessun movimento") */
.muted { color: var(--ink-2); }

/* Toolbar, search, segments and period navigator, spec 5.11 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-3); }
.toolbar-form { display: flex; flex: 1 1 18rem; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; }
.toolbar .form-field { margin: 0; }
.toolbar:has(.form-field) { align-items: flex-end; }
.toolbar select { width: auto; max-width: 100%; }
.toolbar-count { margin: 0 0 0 auto; color: var(--ink-2); font-size: var(--ph-text-sm); }
/* The filter bar (task 122, Silvia S11): a form of the search alone keeps a search's width and leaves the line to the
   segments beside it, instead of taking half the page. */
@media (min-width: 40.0625rem) { .filter-bar-form:not(:has(.toolbar-filter)) { flex: 0 1 24rem; } }
/* Task 213: with public/js/filters.js running, a marked filter form applies as it changes, so its «Mostra» is not drawn;
   without the script it stays. A filter bar holding a period (/festivita) keeps its few fields to their width, so the
   period sits right after them on the same line. */
.js-autosubmit form[data-autosubmit] .filters-submit { display: none; }
.filter-bar-form:has(~ .period) { flex: 0 1 auto; }
.search { display: flex; flex: 1 1 18rem; align-items: center; gap: var(--space-1); min-width: 0; max-width: 32rem; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field::before { content: ""; position: absolute; top: 50%; left: var(--ph-space-15); width: 0.7rem; height: 0.7rem; border: 1.5px solid var(--ink-2); border-radius: 50%; transform: translateY(-60%); pointer-events: none; }
.search-field::after { content: ""; position: absolute; top: 50%; left: calc(var(--ph-space-15) + 0.6rem); width: 0.35rem; height: 1.5px; background: var(--ink-2); transform: translateY(0.25rem) rotate(45deg); pointer-events: none; }
.search input { height: var(--ph-control-h); padding: 0 var(--space-1) 0 var(--space-4); border: var(--border-w) solid var(--ink-3); border-radius: var(--radius); background: var(--surface-1); color: var(--ink); font-size: var(--ph-text-md); }
.search input:hover { border-color: var(--ink); }
/* A segmented control, design-d-spec.md 6: a well one tone off its ground (--surface-2 on the page, --bg on a card, as
   the chips) with --radius; the current segment is a paper chip with --radius-s, the one soft shadow and bold ink. */
.segments { display: inline-flex; flex-wrap: wrap; gap: var(--ph-space-05); margin: 0; padding: var(--ph-space-05); background: var(--surface-2); border: 0; border-radius: var(--radius); }
:is(.panel, .table-scroll, .empty, .date-groups) .segments { background: var(--bg); }
.segments a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: calc(var(--ph-control-h) - 2 * var(--ph-space-05)); padding: 0 var(--ph-space-15); border-radius: var(--radius-s); color: var(--ink-2); font-size: var(--ph-text-md); font-weight: 400; text-decoration: none; transition: background-color var(--dur-micro) var(--ease-enter), box-shadow var(--dur-micro) var(--ease-enter); }
.segments a:hover { background: var(--surface-1); color: var(--ink); }
.segments a[aria-current="true"] { background: var(--surface-1); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
/* The rare states of a segmented control sit in a menu after the visible ones (design «Segnale»): its summary is drawn as
   one more segment, and as the current one when the list shows a rare state. Its panel opens from its left edge, since
   the control sits on the left of the toolbar. */
.segments-more > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: calc(var(--ph-control-h) - 2 * var(--ph-space-05)); padding: 0 var(--ph-space-15); border-radius: var(--radius-s); color: var(--ink-2); font-size: var(--ph-text-md); cursor: pointer; }
.segments-more > summary:hover, .segments-more[open] > summary { background: var(--surface-1); color: var(--ink); }
.segments-more > summary[data-current="true"] { background: var(--surface-1); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.segments-more > .menu-panel { left: 0; right: auto; min-width: 12rem; }
.segments-more .menu-panel a { justify-content: space-between; width: 100%; min-height: 2.75rem; color: var(--ink); }
.segments-more .menu-panel a[aria-current="true"] { background: var(--accent-subtle-bg); font-weight: 600; box-shadow: none; }
/* A group that would wrap on a phone folds there (task 123, Iris on «Il mese» at 390): the items marked phoneMore leave the
   row for one menu with the rare ones, so the control stays one row. The partial draws both menus; one shows. */
.segments-folding > .segments-phone { display: none; }
@media (max-width: 40rem) {
  .segments-folding > .segments-wide { display: none; }
  .segments-folding > .segments-phone { display: inline-block; }
}
/* The one client filter of the consultant's pages across clients (task 121, partials/client-filter.ejs): a menu drawn as
   a well with one chip, «Azienda» then the client shown, whose panel lists every client by name, scrolling past a screen,
   with the company switch's search on top. */
.client-filter > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--ph-control-h); padding: 0 var(--ph-space-15); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); font-size: var(--ph-text-md); cursor: pointer; }
.client-filter > summary:hover, .client-filter[open] > summary { background: var(--ph-tonal-hover); }
.client-filter-label { color: var(--ink-2); }
.client-filter-chosen { font-weight: 600; }
.client-filter > .menu-panel { left: 0; right: auto; min-width: 16rem; max-height: min(70vh, 32rem); overflow-y: auto; }
/* Task 295 (#4 of task 293): a client's one-word name of 60 letters wraps inside the menu, never past its edge. */
.client-filter > .menu-panel a { overflow-wrap: anywhere; }
.client-filter .menu-panel a[aria-current="true"] { background: var(--accent-subtle-bg); font-weight: 600; }
.client-filter-search { position: sticky; top: calc(-1 * var(--space-1)); z-index: 1; padding: 0 0 var(--ph-space-05); background: var(--surface-1); }
.client-filter-search input { width: 100%; }
/* «Prendo in carico» of a chiarimento (task 121, partials/thread-hold.ejs): a quiet button, or who holds it in the muted
   ink, with «Lascia» beside the reader's own. */
.thread-hold { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0; }
.thread-hold form { margin: 0; }
.thread-hold-note, .thread-hold-other { color: var(--ink-2); font-size: var(--ph-text-md); }
/* The joined control clips its parts to its rounded boundary, so their focus rings are drawn inside. */
.period { display: inline-flex; flex-wrap: wrap; align-items: stretch; margin: 0; padding: 0; overflow: hidden; background: var(--surface-1); border: var(--border-w) solid var(--ink-3); border-radius: var(--radius); }
.period :focus-visible { outline-offset: -2px; }
.period > * + * { border-left: var(--border-w) solid var(--line); }
.period-step, .period-today { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ph-control-h); padding: 0 var(--ph-space-15); color: var(--ink); font-size: var(--ph-text-md); text-decoration: none; }
.period-step { min-width: var(--ph-control-h); }
.period-step::before { content: ""; width: 0.45em; height: 0.45em; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.period-next::before { transform: rotate(-135deg); }
.period a:hover { background: var(--surface-2); }
.period [aria-disabled="true"] { color: var(--ink-2); cursor: not-allowed; }
.period-form { display: inline-flex; align-items: stretch; margin: 0; }
/* A period navigator straight in the page flow keeps its distance from the table or note it rules (owner 2026-10-30). */
.period + :is(.table-scroll, .panel, .page-note, .alert, .empty, section, table) { margin-top: var(--space-3); }
.period-form select { width: auto; height: var(--ph-control-h); padding: 0 var(--space-4) 0 var(--ph-space-15); border: 0; border-radius: 0; background-color: transparent; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; color: var(--ink); font-size: var(--ph-text-md); font-weight: 600; appearance: none; }
.period-form .button { min-height: var(--ph-control-h); border: 0; border-left: var(--border-w) solid var(--line); border-radius: 0; background: transparent; color: var(--ink); }
.period-form .button:hover { background: var(--surface-2); }

/* Data table, person cell and row states, spec 5.11 */
/* The wrapper is the containing block of its content, so a visually hidden header label (position: absolute) stays inside
   the scroll box instead of widening the page (043 round 4, /impostazioni/benefit at 390). */
/* A table sheet is a card (design-d-spec.md 5): its head is small uppercase labels with tracking on the card itself, with
   no band, and its rows are separated by a 1px --surface-2 rule. The uppercase label is the head of a list table only
   (design-d-spec.md 2): a matrix, a console and a desk have many narrow heads and keep sentence case, each in its own
   stylesheet. Inside a panel the sheet loses its frame and keeps a hairline above.
   An uppercase label is wider than the same words in sentence case, and a head that may not wrap makes its column as
   wide as its whole label, so the uppercase head once made tight tables wider than their box. Three things keep the head
   from widening a table. The label wraps, so its column is never held wider than its longest word, and a label on two
   lines sits on the bottom line like the others. It is drawn at the plain 12px, out of the x height adjustment of
   base.css, which exists for lowercase and would only widen capitals. And the head cell gives up the padding after its
   label (before it, for a number, which is set to the right): that side only spaces the label from the next column,
   which brings its own, so the label still lines up with its cells and the 12px it gives up is what a single word gains
   in capitals. The edge of the sheet keeps its full step. A table that the head still makes wider than its box opts
   out, as the matrices do in their own stylesheets. */
.table-scroll { position: relative; max-width: 100%; min-width: 0; margin: 0 0 var(--space-3); overflow-x: auto; background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel .table-scroll { margin: 0; border-top: var(--border-w) solid var(--line); border-radius: 0; box-shadow: none; }
.table-scroll > table:not(.data-table) { background: transparent; }
.data-table { width: 100%; border-collapse: collapse; background: transparent; font-size: var(--ph-text-md); line-height: 1.35; font-variant-numeric: tabular-nums; }
.data-table caption { padding: var(--ph-space-15) var(--space-2); background: transparent; color: var(--ink-2); font-size: var(--ph-text-sm); text-align: left; }
.data-table thead th { padding: var(--ph-space-15) var(--ph-space-05) var(--ph-space-15) var(--space-3); border-bottom: var(--border-w) solid var(--surface-2); font-size-adjust: none; letter-spacing: var(--tracking-caps); text-align: left; text-transform: uppercase; vertical-align: bottom; white-space: normal; }
.data-table thead th:last-child { padding-right: var(--space-3); }
.data-table tbody :is(th, td) { padding: var(--ph-space-15) var(--space-3); border-bottom: var(--border-w) solid var(--surface-2); font-weight: 400; text-align: left; vertical-align: middle; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg); }
/* A table's totals line: the cells of its body, set apart by a stronger line and the weight of a total. */
.data-table tfoot :is(th, td) { padding: var(--ph-space-15) var(--space-3); border-top: var(--border-w) solid var(--line-strong); font-weight: 600; text-align: left; vertical-align: top; }
.data-table tfoot td.num { text-align: right; }
.data-table :is(th, td).num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* A number never breaks, but the head label of its column wraps like every other head label, and gives up the padding
   before it, since it is set to the right with its numbers. */
.data-table thead th.num { padding-inline: var(--ph-space-05) var(--space-3); white-space: normal; }
.data-table thead th.num:first-child { padding-left: var(--space-3); }
.data-table td.date { white-space: nowrap; }
/* Task 192: a note under a date (the reason a deadline was extended) wraps; only the date itself stays on one line. */
.data-table td.date .cell-note { white-space: normal; }
/* Task 272 (browser pass): a state chip alone in a cell keeps its words on one line, as a date does («Da sistemare»
   broke in two at 1440 in the review of the import from payslips); on a phone the stacked row gives it the width. */
@media (min-width: 40rem) {
  .data-table td > .status:only-child { white-space: nowrap; }
}
.data-table td.row-actions { text-align: right; white-space: nowrap; }
.data-table td.row-actions > * + * { margin-left: var(--space-1); }
.data-table td.row-actions > form { display: inline-flex; margin: 0; }
.data-table tr.is-attention > :first-child { box-shadow: inset 3px 0 0 var(--warn); }
.data-table tr.is-muted { background: var(--surface-2); }
/* A muted row stands on the tone of the row rule, so its own rule is the hairline: two rest days in a row stay two rows. */
.data-table tr.is-muted > * { border-bottom-color: var(--line); }
.data-table tr.is-muted .person-meta, .data-table tr.is-muted .muted { color: var(--ink); }
.data-table tr.is-selected { background: var(--accent-subtle-bg); }
.data-table tr:has(.row-drawer[open]) { background: var(--bg); }
.person-cell { display: flex; align-items: center; gap: var(--ph-space-15); min-width: 0; }
.person-disc { display: inline-grid; flex: none; place-items: center; width: var(--ph-disc); height: var(--ph-disc); border-radius: 50%; background: var(--ph-tonal); color: var(--ph-tonal-ink); font-size: var(--text--1); font-weight: 600; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-name { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: break-word; }
span.person-name { color: var(--ink); }
a.person-name:hover, a.person-name:focus-visible { color: var(--accent-text); text-decoration: underline; }
.person-meta { color: var(--ink-2); font-size: var(--text--1); }
/* The title link of a row that is not a person (a month, a place, a catalogue entry) is set like a person's name. */
.data-table tbody th > a:not([class]) { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.data-table tbody th > a:not([class]):hover, .data-table tbody th > a:not([class]):focus-visible { color: var(--accent-text); text-decoration: underline; }

/* A second line inside a cell (a date under an amount, a reason under a state), a list inside a cell, several pills in
   one cell, and the chevron that opens the record of a row with no other action (spec 5.11). */
.cell-note { display: block; margin-top: var(--ph-space-05); color: var(--ink-2); font-size: var(--text--1); font-weight: 400; overflow-wrap: break-word; }
.data-table tr.is-muted .cell-note { color: var(--ink); }
.cell-list { margin: 0; padding-left: var(--space-2); }
.pill-list { display: inline-flex; flex-wrap: wrap; gap: var(--ph-space-05); }
.pill-link { text-decoration: none; }
.pill-link:hover .pill, .pill-link:focus-visible .pill { text-decoration: underline; }
/* A row the bulk action can take: its checkbox sits left of the person in the first cell. */
.row-select { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.row-select > input[type="checkbox"] { flex: none; }
.row-open { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ph-control-h-compact); min-height: var(--ph-control-h-compact); border-radius: var(--radius); color: var(--ink-2); }
.row-open::before { content: ""; width: 0.45em; height: 0.45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.row-open:hover { background: var(--accent-subtle-bg); color: var(--accent-text); }
/* Task 212: a row whose arrow opens one destination opens on the whole row. The arrow's link is stretched over the row
   (row-clickable on the tr or the row's box), so the keyboard still reaches one link per row with its own name, and no
   script or tabindex is added; every other control of the row stays above it and keeps its own click. The focus ring of
   the link is drawn around the whole row. A row without the arrow is not stretched. */
.row-clickable { position: relative; cursor: pointer; }
.row-clickable .row-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.row-clickable :is(a:not(.row-open), button, input, select, textarea, label, summary, :not(td, th)[title]) { position: relative; z-index: 1; }
.row-clickable:hover .row-open { background: var(--accent-subtle-bg); color: var(--accent-text); }
.row-clickable .row-open:focus-visible { outline: none; }
.row-clickable .row-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.setting-row.row-clickable:hover { background: var(--bg); }
/* A drawer that opens in the cell (a browser without anchor positioning, a phone) stays above the stretched link; the
   anchored popover keeps its own fixed layer, set after this rule. */
:where(.row-clickable) .row-drawer-panel { position: relative; z-index: 1; }
/* The one line that qualifies a figure strip (coverage of the data, the sources note) */
.figures-caption { 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); }

/* A filter of the toolbar that is a labelled select (the delivery state of the review roster, the month of the
   correction queue) keeps its label beside the control; a list of checkboxes in a fieldset (spec 5.5) flows in columns. */
/* One place for a label across the product, design «Segnale»: above its control, filters included. */
.toolbar-filter { display: flex; flex-direction: column; align-items: stretch; gap: var(--ph-space-05); margin: 0; }
.toolbar-filter > label { white-space: nowrap; }
@media (min-width: 40.0625rem) { .toolbar-form:has(> .toolbar-filter) { align-items: flex-end; } }
.toolbar.toolbar-form { margin-bottom: var(--space-3); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0 var(--space-2); }
/* Task 192: a long name in a grid of checkboxes wraps beside its box, never below it; task 224: in a list of whole
   sentences, one under the other, too. */
.check-grid > label.check-field { flex-wrap: nowrap; }
.check-grid > label.check-field > input { flex: none; }
.check-list > label.check-field { flex-wrap: nowrap; }
.check-list > label.check-field > input { flex: none; }
/* A muted note under the page header that qualifies the whole page, and the action row at the end of a panel. */
.page-note { max-width: var(--ph-measure); margin: 0 0 var(--space-3); color: var(--ink-2); font-size: var(--ph-text-sm); }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: 0; }

/* Row drawer, spec 5.12: a details popover anchored under its summary, no script. The table region keeps scrolling while
   a drawer is open, so a table wider than its region never widens the page (044 review C-3). Where CSS anchor positioning
   exists the panel is a fixed popover anchored to its summary, right aligned to it and kept inside the viewport by the
   position fallbacks, and hidden while its summary is scrolled out of view unless it holds the focus; elsewhere it opens
   in the cell under the summary, inside the region. */
.row-drawer { display: inline-block; text-align: left; white-space: normal; }
.row-drawer-panel { width: 22rem; max-width: calc(100vw - 2 * var(--space-2)); margin-top: var(--ph-space-05); padding: var(--space-2); background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-2); }
@media (min-width: 40rem) {
  @supports (anchor-scope: all) and (position-try-fallbacks: flip-inline) {
    .row-drawer { anchor-scope: --row-drawer; }
    .row-drawer > summary { anchor-name: --row-drawer; }
    .row-drawer-panel { position: fixed; z-index: 20; position-anchor: --row-drawer; position-area: block-end span-inline-start; position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline;
      position-visibility: anchors-visible; max-height: calc(100vh - 2 * var(--space-2)); overflow-y: auto; }
    /* A panel holding the focus stays on screen even when its summary scrolls out of the table region. */
    .row-drawer-panel:focus-within { position-visibility: always; }
  }
}
.row-drawer-panel > form { display: grid; gap: var(--space-2); margin: 0; }
.row-drawer .form-field { margin: 0; }
.row-drawer textarea { min-height: 5rem; }
.row-drawer-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.row-drawer-lead { margin: 0; color: var(--ink-2); font-size: var(--ph-text-sm); }

/* Pagination, spec 5.13 */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); margin: var(--space-2) 0 0; padding: 0; background: transparent; border: 0; font-size: var(--ph-text-md); }
.pagination-range { margin: 0; color: var(--ink-2); font-size: var(--ph-text-sm); }
.pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ph-space-05); margin: 0; padding: 0; list-style: none; }
.pagination-pages > li > :is(a, span) { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ph-control-h); min-height: var(--ph-control-h); padding: 0 var(--space-1); border: var(--border-w) solid transparent; border-radius: var(--radius); color: var(--ink); font-variant-numeric: tabular-nums; text-decoration: none; }
.pagination-pages > li > a { background: var(--surface-1); }
.pagination-pages > li > a:hover { background: var(--ph-tonal); }
.pagination-pages [aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.pagination-pages [aria-disabled="true"] { color: var(--ink-2); cursor: not-allowed; }
.pagination-step::before { content: ""; width: 0.45em; height: 0.45em; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.pagination-next::before { transform: rotate(-135deg); }
.pagination-gap { color: var(--ink-2); }

/* Figures, spec 5.18: hairlines between cells, no cards; the value dd alone carries data-total. A figure is set in the
   display face (design-d-spec.md 10). */
.figures-group { margin: 0 0 var(--space-3); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0; overflow: hidden; border-top: var(--border-w) solid var(--line-strong); }
/* The lines of a figure (its label, its value, its note) are packed at the top of its cell: a strip is a grid whose cells
   take the height of the tallest, and lines left to share that height put the value of a figure with no note lower than
   the value of one with a note (task 097, round 2). */
.figure { display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 0 var(--ph-space-05); padding: var(--ph-space-15) var(--space-2); box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.figure > dt { flex-basis: 100%; margin: 0; color: var(--ink-2); font-size: var(--text--1); }
.figure > dd { margin: 0; }
.figure-value { color: var(--ink); font-family: var(--font-display); font-size: var(--ph-text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.figures-header .figure-value { font-size: var(--text-1); }
.figure-unit { color: var(--ink-2); font-family: var(--font-body); font-size: var(--ph-text-sm); font-weight: 400; }
.figure-note { flex-basis: 100%; color: var(--ink-2); font-size: var(--text--1); }
.figure-missing .figure-value { color: var(--ink-2); font-weight: 400; }
.figure-ok :is(.figure-value, .figure-note) { color: var(--ok); }
.figure-info :is(.figure-value, .figure-note) { color: var(--ph-info); }
.figure-warn :is(.figure-value, .figure-note) { color: var(--warn); }
.figure-err :is(.figure-value, .figure-note) { color: var(--err); }

/* Calendars, spec 5.17: the month grid of the year views (the employee calendar, the admin year view, the holidays
   page) and its legend. A day carries its state by a mark, a rule, a hatch or a border style as well as a colour. */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-3); }
.cal-month-block { min-width: 0; }
.cal-month-block > h2 { margin: 0 0 var(--space-1); font-size: var(--ph-text-md); font-weight: 600; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--ph-space-05); }
.cal-weekday { padding: var(--ph-space-05) 0; color: var(--ink-2); font-size: var(--text--1); text-align: center; }
.cal-day { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 2.75rem; padding: var(--ph-space-05); background: var(--surface-1); border: var(--border-w) solid var(--line); border-radius: var(--radius-s); color: var(--ink); font-size: var(--text--1); font-variant-numeric: tabular-nums; line-height: 1.2; text-decoration: none; }
a.cal-day:hover { border-color: var(--ink-2); }
.cal-day.is-rest, .cal-swatch.is-rest { background: var(--surface-2); }
.cal-day.is-holiday, .cal-swatch.is-holiday { box-shadow: inset 0 3px 0 var(--ph-info); }
.cal-day.is-closure, .cal-swatch.is-closure { background: repeating-linear-gradient(135deg, var(--surface-1) 0 4px, var(--line) 4px 5px); }
.cal-day.is-approved, .cal-swatch.is-approved { background: var(--ph-ok-bg); border-color: var(--ph-ok-line); }
.cal-day.is-pending, .cal-swatch.is-pending { background: var(--ph-warn-bg); border-style: dashed; border-color: var(--warn); }
.cal-day.is-rejected .cal-mark { text-decoration: line-through; }
/* Task 151 (D7): a day of company closure keeps its hatch under the fill of the state of its requests, at every width. */
.cal-day.is-closure.is-approved { background: repeating-linear-gradient(135deg, var(--ph-ok-bg) 0 4px, var(--line) 4px 5px); }
.cal-day.is-closure.is-pending { background: repeating-linear-gradient(135deg, var(--ph-warn-bg) 0 4px, var(--line) 4px 5px); }
.cal-mark.is-closed { max-width: 100%; overflow: hidden; font-weight: 600; }
.cal-swatch.is-rejected { background: linear-gradient(to top right, transparent 45%, var(--ink-2) 45% 55%, transparent 55%); }
.cal-day.is-today, .cal-swatch.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.is-today .cal-day-number { font-weight: 600; }
.cal-mark { align-self: flex-end; font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-3); padding: 0; list-style: none; color: var(--ink); font-size: var(--ph-text-sm); }
.cal-legend > li { display: inline-flex; align-items: center; gap: var(--space-1); }
.cal-swatch { display: inline-block; flex: none; width: 1rem; height: 1rem; background: var(--surface-1); border: var(--border-w) solid var(--line); border-radius: var(--radius-s); }
/* A list grouped by date (the fiscal calendar, the glance feed): the date as a label column, the items beside it. */
.date-groups { display: grid; gap: 0; margin: 0 0 var(--space-3); padding: 0; overflow: hidden; list-style: none; background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.panel .date-groups { border-radius: 0; box-shadow: none; }
.date-group { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding: var(--ph-space-15) var(--space-2); border-top: var(--border-w) solid var(--line); }
.date-group:first-child { border-top: 0; }
.date-group[aria-current="date"] { background: var(--accent-subtle-bg); box-shadow: inset 3px 0 0 var(--accent); }
.date-group-label { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.date-group-items { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.date-group-items > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ph-space-05) var(--space-1); }

/* Month flow bar, spec 5.16. Task 122 (owner, 2026-10-15): an even stepper, one equal column per step across the width,
   each step a block with its disc, its name and its one line of state: done a check on the ok disc, the current step
   an accent border on the accent subtle ground, the steps to come a muted name; below 40rem one full line per step. */
.flow-bar { margin: 0 0 var(--space-3); padding: 0; background: transparent; border: 0; }
.flow-bar > ol { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.flow-step { display: flex; min-width: 0; }
.flow-link { display: flex; flex: 1; align-items: flex-start; gap: var(--space-1); min-width: 0; padding: var(--space-1) var(--space-2); border: var(--border-w) solid var(--line); border-radius: var(--radius); color: var(--ink); font-size: var(--ph-text-md); text-decoration: none; }
a.flow-link:hover { background: var(--surface-2); border-color: var(--line-strong); }
.flow-link[aria-current="page"] { background: var(--accent-subtle-bg); border-color: var(--accent-border); box-shadow: inset 0 0 0 1px var(--accent-border); }
.flow-disc { position: relative; display: inline-grid; flex: none; place-items: center; width: 1.5em; height: 1.5em; border: 1.5px solid var(--line-strong); border-radius: 50%; color: var(--ink); font-size: var(--ph-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.flow-text { display: flex; flex-direction: column; min-width: 0; }
.flow-name { font-weight: 600; overflow-wrap: anywhere; }
.flow-todo .flow-name { color: var(--ink-2); font-weight: 400; }
.flow-detail { color: var(--ink-2); font-size: var(--text--1); overflow-wrap: anywhere; }
/* Task 331 (Silvia D3): from 40rem a step's name and its work left read on one line, wrapping when it does not fit. */
@media (min-width: 40rem) {
  .flow-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-1); }
}
.flow-done .flow-disc { border-color: var(--ok); color: transparent; }
.flow-done .flow-disc::after { content: ""; position: absolute; top: 20%; left: 36%; width: 25%; height: 45%; border-right: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(45deg); }
.flow-progress .flow-disc { border-color: var(--ph-info); color: var(--ph-info); }
.flow-progress .flow-detail { color: var(--ph-info); }
.flow-attention .flow-disc { border-color: var(--warn); color: var(--warn); }
.flow-attention .flow-detail { color: var(--warn); }
.flow-link[aria-current="page"] .flow-disc { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.flow-link[aria-current="page"] .flow-disc::after { content: none; }
.flow-link[aria-current="page"] .flow-detail { color: var(--ink); }

/* Wizard steps, spec 5.8 (task 045): a numbered row from 40rem up, below it "Passo 2 di 5 · Presenze" with the same
   list in a details. Done is a check on the ok disc and links back, current the filled accent disc, todo an outlined
   disc with a muted name, blocked a warn disc with the reason under the name; each state also carries its word. */
.steps-block { margin: 0 0 var(--space-3); }
.steps { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.steps-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-1) var(--space-2); }
.panel.page-form { margin-inline: 0; }
.steps-row > .step + .step::before { content: ""; flex: none; align-self: flex-start; width: 0.45em; height: 0.45em; margin: var(--space-1) var(--space-2) 0 0; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); }
.step { display: flex; align-items: center; min-width: 0; }
.step-link { display: inline-flex; align-items: flex-start; gap: var(--space-1); min-height: 1.5rem; color: var(--ink); font-size: var(--ph-text-md); text-decoration: none; }
a.step-link { border-radius: var(--radius-s); }
a.step-link:hover .step-name { text-decoration: underline; }
.step-disc { position: relative; display: inline-grid; flex: none; place-items: center; width: 1.75em; height: 1.75em; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface-1); color: var(--ink); font-size: var(--ph-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.step-text { display: flex; flex-direction: column; min-width: 0; padding-top: var(--ph-space-05); }
.step-name { font-weight: 400; line-height: 1.35; }
.step-detail { color: var(--ink-2); font-size: var(--text--1); line-height: 1.35; }
.step-done .step-disc { background: var(--ok); border-color: var(--ok); color: transparent; }
.step-done .step-disc::after { content: ""; position: absolute; top: 22%; left: 37%; width: 24%; height: 42%; border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(45deg); }
.step-done .step-name { color: var(--accent-text); }
.step-current .step-disc { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-current .step-name { font-weight: 600; }
.step-todo .step-name { color: var(--ink-2); }
.step-blocked .step-disc { background: var(--ph-warn-bg); border-color: var(--warn); color: var(--warn); }
.step-blocked .step-name { color: var(--ink-2); }
.step-blocked .step-detail { color: var(--warn); }
.steps-compact { display: none; background: var(--surface-1); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.steps-compact > summary { display: flex; align-items: center; gap: var(--space-1); min-height: var(--ph-control-h-touch); padding: 0 var(--space-2); list-style: none; cursor: pointer; font-size: var(--ph-text-md); }
.steps-compact > summary::-webkit-details-marker { display: none; }
.steps-compact > summary::after { content: ""; flex: none; width: 0.45em; height: 0.45em; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.steps-compact[open] > summary::after { transform: rotate(-135deg); }
.steps-position { font-weight: 600; }
.steps-compact > .steps { padding: var(--space-1) var(--space-2) var(--space-2); border-top: var(--border-w) solid var(--line); }
.steps-compact .step-link { min-height: var(--ph-control-h-touch); align-items: center; }
.steps-compact .step-text { padding-top: 0; }
/* The wizard around the steps (spec 5.8, 6.10): the welcome line at the hero size and what the wizard asks, the seven
   day choices of the working week in one row, and Riprendi in seguito pushed to the right end of the actions. */
.wizard-hero { margin: 0 0 var(--space-2); color: var(--ink); font-size: var(--text-3); font-weight: 600; line-height: var(--leading-display); letter-spacing: -0.02em; }
.wizard-asks { display: grid; gap: var(--space-1); margin: 0 0 var(--space-3); padding-left: var(--space-3); }
.wizard-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: var(--space-1) var(--space-2); }
.wizard-summary { margin: 0 0 var(--space-3); }
.wizard-actions > .wizard-later { margin-left: auto; }
.wizard-actions > .link-button { display: inline-flex; align-items: center; min-height: var(--ph-control-h); }
/* ==== Steps of the setup in the sidebar (task 114): start ====
   src/views/partials/wizard-steps.ejs. An open step is a link of the sidebar (shell.css), the step on the page its
   current row; the number or check follows the name in the markup, so the name keeps the link's growing first span, and
   is drawn before it. A done step's disc is filled and checked, an open one outlined, one not open yet dashed with its
   name in the muted ink and never a link. */
.wizard-nav-list { margin: 0; padding: 0; list-style: none; }
.wizard-nav-locked { display: flex; align-items: center; gap: var(--ph-space-15); min-height: var(--ph-control-h-touch); margin-block: var(--ph-space-05); padding: var(--space-1) var(--ph-space-15); color: var(--ph-sidebar-muted); font-size: var(--text-0); line-height: 1.35; }
.wizard-nav-locked > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.wizard-nav-mark { position: relative; display: inline-grid; flex: none; order: -1; place-items: center; width: 1.75em; height: 1.75em; border: 1.5px solid var(--ph-sidebar-rail); border-radius: 50%; font-size: var(--ph-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.wizard-nav-locked > .wizard-nav-mark { border-style: dashed; border-color: var(--ph-sidebar-muted); }
.is-done .wizard-nav-mark { background: var(--ph-sidebar-rail); color: transparent; }
.is-done .wizard-nav-mark::after { content: ""; position: absolute; top: 22%; left: 37%; width: 24%; height: 42%; border-right: 2px solid var(--ph-sidebar); border-bottom: 2px solid var(--ph-sidebar); transform: rotate(45deg); }
/* ==== Steps of the setup in the sidebar (task 114): end ==== */


/* Print, spec 7.3: what exists only on paper (the company, person and month of a timesheet, the signature lines), and
   the landscape page of the wide sheets (the wallchart and the timesheet matrix); its 15mm margins come from the @page
   rule of base.css, which every named page inherits. */
.print-only { display: none; }
@media print {
  .legal-footer { display: none; }
  .print-only { display: block; }
  @page wide { size: A4 landscape; }
  .print-landscape { page: wide; }
  /* The quiet --surface-2 row rule of the screen does not show on paper. A data table prints every cell with a full rule
     in --ink-3, which reaches 3:1 on white paper (design-d-spec.md 5), the last row and the muted rows included; the
     selectors repeat the screen rules above, so this block wins by coming after them. A sheet prints square and flat
     (base.css sets the shadow roles to none in print). */
  .data-table thead th, .data-table tbody :is(th, td), .data-table tbody tr:last-child > *, .data-table tr.is-muted > * { border: var(--border-w) solid var(--ink-3); }
  .table-scroll { border-radius: 0; }
}

/* Setting rows, spec 6.10: the admin catalogue and the person's own settings; the name, one sentence and the meta line,
   the value pill and the Modifica action on the right, a hairline between rows. */
.setting-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-top: var(--border-w) solid var(--line); }
.setting-text { flex: 1 1 18rem; min-width: 0; }
.setting-text > :is(h2, h3) { margin: 0 0 var(--ph-space-05); font-size: var(--ph-text-md); font-weight: 600; }
.setting-text > p { margin: var(--ph-space-05) 0; color: var(--ink-2); }

/* Responsive rules, spec 7.1: 64rem swaps to touch targets and 16px inputs, 40rem stacks */
@media (max-width: 63.999rem) {
  button, .button, .button-primary, .button-ghost, .button-danger, .button-compact, .period-step, .period-today, .pagination-pages > li > :is(a, span) { min-height: var(--ph-control-h-touch); }
  .row-open { min-width: var(--ph-control-h-touch); min-height: var(--ph-control-h-touch); }
  .segments a { min-height: var(--ph-control-h-touch); }
  .segments-more > summary { min-height: var(--ph-control-h-touch); }
  .page-back a, a.person-name, .alert-link a { display: inline-flex; align-items: center; min-height: var(--ph-control-h-touch); }
  .page-eyebrow { min-height: var(--ph-control-h-touch); }
  .flow-link { min-height: var(--ph-control-h-touch); }
  .cell-list a, .panel-actions > a:not([class]) { min-height: var(--ph-control-h-touch); }
  a.step-link { min-height: var(--ph-control-h-touch); }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: var(--ph-control-h-touch); font-size: var(--text-0); }
  input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"], [type="range"]), select:not([multiple], [size]) { height: var(--ph-control-h-touch); }
  :is(input, textarea).mono { font-size: var(--text-0); }
  .check-field, .check-field > label, .form-actions > a:not([class]), .section-index a, .form-errors a, .wizard-actions > .link-button { min-height: var(--ph-control-h-touch); }
  .page-nav { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .section-index { position: static; }
  .section-index ul { display: flex; flex-wrap: wrap; gap: var(--space-1); border-left: 0; }
  .section-index a { min-height: var(--ph-control-h-touch); background: var(--surface-2); border-radius: var(--radius-s); }
  .page-split { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
}
@media (max-width: 40rem) {
  .page-actions { flex-basis: 100%; max-width: none; justify-content: stretch; }
  .page-actions > * { flex: 1 1 100%; }
  .page-actions > form > button, .page-actions > details > summary, .page-actions > .menu, .page-actions > .page-info { width: 100%; }
  .page-actions > .menu > .menu-panel, .page-actions > .page-info > .page-info-panel { left: 0; right: 0; width: auto; min-width: 0; }
  .panel, .panel.form-section { padding: var(--space-2); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > dd, .facts > div > dd { padding-top: 0; border-top: 0; }
  .form-actions > * { flex: 1 1 100%; }
  .form-actions > a:not([class]) { justify-content: center; }
  .form-actions-sticky { margin-inline: calc(-1 * var(--space-2)); }
  /* In a column the 18rem basis of the form and of the search would become their height, and the end alignment of a
     toolbar holding fields would push them right: both reset so the toolbar stacks tight and full width. */
  .toolbar, .toolbar-form, .toolbar:has(.form-field) { flex-direction: column; align-items: stretch; }
  .toolbar > *, .toolbar-form > * { flex: none; }
  .search { max-width: none; }
  /* A filter whose longest option is wider than the phone would widen the column: its select takes the column's width. */
  .toolbar select { width: 100%; }
  .toolbar-count { margin: 0; }
  /* Task 122 (owner, 2026-10-15: at 390 the navigator was cut, «Oggi» off the screen): the navigator takes the width in
     two rows, previous, the period and next on the first, so the period's name has the room it needs, «Mostra» and
     «Oggi» on the second. The form lends its children to the navigator's rows (display: contents keeps them in it). */
  .period { display: flex; width: 100%; }
  .period-form { display: contents; }
  .period-form select { flex: 1 1 calc(100% - 2 * var(--ph-control-h-touch)); order: 2; min-width: 0; padding-left: var(--space-1); border-left: var(--border-w) solid var(--line); }
  .period > .period-previous { order: 1; }
  .period > .period-next { order: 3; border-left: var(--border-w) solid var(--line); }
  .period-form .button { flex: 1 1 50%; order: 4; border-top: var(--border-w) solid var(--line); border-left: 0; }
  .period > .period-today { flex: 1 1 50%; order: 5; border-top: var(--border-w) solid var(--line); }
  .row-drawer { display: block; }
  /* On a phone the drawer opens in the row's card, so it is a well on the page tone, not a floating layer. */
  .row-drawer-panel { position: static; width: auto; max-width: none; margin-top: var(--space-1); background: var(--bg); border-radius: var(--radius); box-shadow: none; }
  .row-drawer-panel :is(.status, .pill:not(.pill-strong), .value-pill) { background: var(--surface-2); }
  :where(.row-clickable) .row-drawer-panel { position: relative; z-index: 1; }
  /* Task 122: one full line per step, its name and its state beside the disc, never a bare number. */
  .flow-bar > ol { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); }
  .setting-row { align-items: flex-start; }
  .steps-row { display: none; }
  .steps-compact { display: block; }
  .date-group { grid-template-columns: minmax(0, 1fr); gap: var(--ph-space-05); }
  .data-table.stack-on-phone, .data-table.stack-on-phone tbody { display: block; }
  .data-table.stack-on-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table.stack-on-phone tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ph-space-05) var(--space-2); padding: var(--ph-space-15) var(--space-2); border-bottom: var(--border-w) solid var(--line); }
  .data-table.stack-on-phone tbody :is(th, td) { display: block; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  /* Task 192: a stacked date cell lets its pill (a passed term) go under the date instead of past the screen's edge. */
  .data-table.stack-on-phone td.date { white-space: normal; }
  .data-table.stack-on-phone tbody th, .data-table.stack-on-phone td.row-actions { grid-column: 1 / -1; }
  /* A cell with no label that spans the row's columns is a row of its own (the inline editor of the staff cost table,
     the flash of a row), not a field of the card: it takes the card's whole width, not one of its two columns, where
     the staff cost editor's fields and buttons were drawn past their half (task 135, KNOWN-ISSUES of task 095). */
  .data-table.stack-on-phone tbody td[colspan]:not([data-label]) { grid-column: 1 / -1; min-width: 0; }
  .data-table.stack-on-phone tbody td.row-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-1); }
  .data-table.stack-on-phone td.row-actions > * + * { margin-left: 0; }
  .data-table.stack-on-phone td.row-actions > .row-drawer[open] { flex-basis: 100%; }
  .data-table.stack-on-phone td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: var(--text--1); }
  .data-table.stack-on-phone tr.is-muted td[data-label]::before { color: var(--ink); }
  .data-table.stack-on-phone tbody tr.is-attention > :first-child { box-shadow: none; }
  .data-table.stack-on-phone tbody tr.is-attention { box-shadow: inset 3px 0 0 var(--warn); }
  /* Task 281 (D5 of task 272): a cell with nothing to show prints neither its label nor an empty line, in every
     stacked table. A table where an empty cell means something prints that meaning in the cell. */
  .data-table.stack-on-phone tbody td:empty { display: none; }
}

/* Task 373 (rompi-ui 372 #12, decision 4): a table whose rows hold long text beside several buttons (the people's
   deadlines board, the correction requests) stacks its rows as the phone's cards below 1100px, so at 1024 and at 200%
   nothing scrolls sideways and no button is cut. The card rules of stack-on-phone, on a wider screen; the table keeps
   stack-on-phone too, so below 40rem nothing changes. */
@media (max-width: 68.749rem) {
  .data-table.stack-below-wide, .data-table.stack-below-wide tbody { display: block; }
  .data-table.stack-below-wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table.stack-below-wide tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ph-space-05) var(--space-2); padding: var(--ph-space-15) var(--space-2); border-bottom: var(--border-w) solid var(--line); }
  .data-table.stack-below-wide tbody :is(th, td) { display: block; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .data-table.stack-below-wide tbody th, .data-table.stack-below-wide td.row-actions { grid-column: 1 / -1; }
  .data-table.stack-below-wide tbody td.row-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-1); }
  .data-table.stack-below-wide td.row-actions > * + * { margin-left: 0; }
  .data-table.stack-below-wide td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: var(--text--1); }
  .data-table.stack-below-wide tbody tr.is-attention > :first-child { box-shadow: none; }
  .data-table.stack-below-wide tbody tr.is-attention { box-shadow: inset 3px 0 0 var(--warn); }
  .data-table.stack-below-wide tbody td:empty { display: none; }
  /* Task 376 (rompi-ui 375 #11): a cell with no label that spans the row's columns is a row of its own (why a returned
     file has its person), the card's whole width, as in stack-on-phone. */
  .data-table.stack-below-wide tbody td[colspan]:not([data-label]) { grid-column: 1 / -1; }
}

/* Motion, design-d-spec.md 4: the only motion is the 120ms fade of background and shadow on buttons and segments (the
   sidebar links fade in shell.css); nothing moves or scales. A person who asked for less motion gets none. */
@media (prefers-reduced-motion: reduce) {
  button, .button, .button-primary, .button-ghost, .button-danger, .segments a { transition: none; }
}

/* Side panel, design «Segnale» (partials/side-panel.ejs): the form of a record opens from the right over the list, which
   stays visible behind a shade; the panel scrolls on its own and keeps the form's actions at its foot. No script: the
   address opens it, the close link and the shade close it. On a phone it takes the whole screen. */
body:has(.side-panel-layer) { overflow: hidden; }
.side-panel-layer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.side-panel-shade { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 38%, transparent); cursor: default; }
.side-panel { position: relative; display: flex; flex-direction: column; width: min(42.5rem, 100vw); height: 100svh; background: var(--surface-1); box-shadow: var(--shadow-3); }
.side-panel-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-2); border-bottom: var(--border-w) solid var(--line); }
.side-panel-head h2 { flex: 1; min-width: 0; margin: 0; font-size: var(--text-1); overflow-wrap: anywhere; }
.side-panel-close { display: inline-grid; place-items: center; flex: none; width: var(--ph-control-h); height: var(--ph-control-h); border-radius: var(--radius); color: var(--ink-2); }
.side-panel-close:hover { background: var(--surface-2); color: var(--ink); }
.side-panel-close .app-icon { width: 1.5rem; height: 1.5rem; }
.side-panel-lead { margin: 0; padding: var(--space-2) var(--space-4) 0; color: var(--ink-2); overflow-wrap: anywhere; }
.side-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-3) var(--space-4) 0; }
/* Task 295 (#5 of task 293): a one-word name of 60 letters wraps in the title, the lead and the body, never under the ×. */
.side-panel-body { display: flex; flex-direction: column; overflow-wrap: break-word; }
/* A panel is narrow: its fields go one under the other. */
.side-panel-body .form-grid { grid-template-columns: minmax(0, 1fr); }
.side-panel-body > * { flex: none; }
/* The buttons of the panel's form live in its footer: the bar is pinned to the bottom of the panel, outside what
   scrolls (a sticky bar moved with the scroll), and the body keeps room under its last field for it. */
.side-panel-body:has(> form:last-child > .form-actions) { padding-bottom: calc(var(--ph-control-h) + 2 * var(--space-2) + var(--space-3)); }
.side-panel-body > form:last-child > .form-actions { position: absolute; inset: auto 0 0; z-index: 1; margin: 0; padding: var(--space-2) var(--space-4); background: var(--surface-1); border-top: var(--border-w) solid var(--line); }
.side-panel-body .form-actions:not(form:last-child > .form-actions) { margin: var(--space-3) 0 0; }
/* Decision of 2026-10-15 (Iris I3): a panel that is no form has its actions in the same pinned footer, the panel's own
   last row under the body that scrolls (side-panel.ejs footer). */
.side-panel-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; padding: var(--space-2) var(--space-4); background: var(--surface-1); border-top: var(--border-w) solid var(--line); }
.side-panel:has(> .side-panel-foot) > .side-panel-body { padding-bottom: var(--space-3); }
/* Task 352 (D-A): a panel closes onto the link that opened it (#apri-…, lib/panel-layer.js); the browser starts the next Tab
   there, and the link wears the focus ring until the reader moves on, so the eye lands where the keyboard is. */
[id^="apri-"]:target { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A menu in a panel's pinned footer opens upwards (the chiarimento's «Altre azioni», decision of 2026-10-14). */
.menu-up { position: relative; }
.menu-up > .menu-panel { top: auto; bottom: calc(100% + var(--ph-space-05)); left: 0; right: auto; }
@media (max-width: 47.999rem) {
  .side-panel { width: 100vw; }
  .side-panel-head { padding: var(--space-2) var(--space-2) var(--space-1); }
  .side-panel-lead { padding-inline: var(--space-2); }
  .side-panel-body { padding-inline: var(--space-2); }
  .side-panel-body > form:last-child > .form-actions, .side-panel-foot { padding-inline: var(--space-2); }
}

/* Info tip, design «Segnale»: the «i» beside a figure, a column or a heading that opens a short explanation on a click,
   the page information disclosure without its words. Its panel opens from the mark's left edge; on a phone it takes the
   width of the screen, under the mark. */
.info-tip { position: relative; display: inline-block; vertical-align: middle; }
.info-tip > summary { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ph-control-h-compact); min-height: var(--ph-control-h-compact); border-radius: var(--radius); color: var(--accent-text); list-style: none; cursor: pointer; }
.info-tip > summary::-webkit-details-marker { display: none; }
.info-tip > summary::before { content: ""; flex: none; width: 1rem; height: 1rem; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(currentColor, currentColor) 50% 3px / 2px 2px no-repeat, linear-gradient(currentColor, currentColor) 50% 6px / 2px 5px no-repeat; }
.info-tip > summary:hover, .info-tip[open] > summary { background: var(--accent-subtle-bg); }
.info-tip > .page-info-panel { left: 0; right: auto; font-size: var(--ph-text-md); font-weight: 400; letter-spacing: normal; text-align: left; text-transform: none; white-space: normal; }
.info-tip > .page-info-panel > p + p { margin-top: var(--space-1); }
/* An «i» at the right end of a panel's heading opens its panel towards the left, inside the panel. */
.panel-heading > .info-tip > .page-info-panel { left: auto; right: 0; }
.heading-with-tip { display: flex; align-items: center; gap: var(--ph-space-05); }
.heading-with-tip > :is(h2, h3, h4) { margin: 0; }
@media (max-width: 40rem) {
  .info-tip { position: static; }
  .info-tip > .page-info-panel { left: var(--space-2); right: var(--space-2); top: auto; width: auto; margin-top: var(--ph-space-05); }
}

/* A page's main step while it is not possible yet (design «Segnale», month pages): the disabled button keeps its place at
   the top right, with a short line under it that says why or from when. */
.page-action-off { display: inline-flex; flex-direction: column; align-items: flex-end; gap: var(--ph-space-05); }

@media (max-width: 40rem) {
  .page-action-off { align-items: stretch; }
  .page-action-off > button { width: 100%; }
}

/* Row menu, design «Segnale» (block 05): the «⋯» beside a row's one visible action, holding its rarer actions (forms with a
   button each); the destructive one in the error ink. It reuses the menu panel, opened from the right edge of the row. */
.row-actions:has(> .row-menu) { white-space: nowrap; }
.row-actions > .row-menu { margin-inline-start: var(--ph-space-05); }
.row-menu > summary { min-width: var(--ph-control-h-compact); padding: 0 var(--space-1); }
.row-menu > summary::after { content: none; }
.row-menu > summary::before { content: "\22EF"; font-weight: 700; }
.row-menu > .menu-panel form { margin: 0; }
.menu-panel .menu-danger { color: var(--err); }

/* The scadenzario's deadline (design «Segnale», block 05): one line, its detail opens under it on a click; a deadline
   already passed and the folded past months read quieter. */
.fiscal-entry > summary { display: flex; list-style: none; cursor: pointer; }
.fiscal-entry > summary::-webkit-details-marker { display: none; }
.fiscal-entry > summary::after { content: ""; flex: none; align-self: center; width: 0.4em; height: 0.4em; margin-inline-start: var(--space-1); border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); }
.fiscal-entry[open] > summary::after { transform: rotate(-135deg); }
.fiscal-entry-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--ph-space-05) var(--space-1); }
.fiscal-entry-detail { display: grid; gap: var(--ph-space-05); margin: var(--space-1) 0 0; padding: 0; list-style: none; color: var(--ink-2); max-width: 70ch; }
.date-group.is-past .date-group-label, .date-group.is-past strong { color: var(--ink-2); font-weight: 400; }
.fiscal-passed { color: var(--ink-2); font-size: var(--ph-text-sm); }
.fiscal-past { margin-block-end: var(--space-3); }
/* The closures of /festivita on a phone: the period wraps in its own cell of the stacked row. */
@media (max-width: 40rem) { .closures-table td.date { white-space: normal; } }

/* A choice of segments at the top of a side panel (the type of a submission, the kind of a correction) keeps its form
   apart, and a short help under it stays with it. A row menu may hold a note instead of a form, for an action that is
   not offered and why (design «Segnale», area dipendente). */
.side-panel-body > .segments { margin: 0 0 var(--space-1); }
.side-panel-body > .segments + .field-help { margin: 0 0 var(--space-2); }
.side-panel-body > .segments + form { margin-top: var(--space-2); }
.menu-panel > .menu-note { max-width: 18rem; margin: 0; padding: var(--space-1); color: var(--ink-2); font-size: var(--ph-text-md); white-space: normal; }

/* ==== Assistant of the top bar (task 113): start ====
   Drawn only while DEMO_AI_ASSISTANT is on (src/modules/assistant). Its rules live here and not in a stylesheet of their
   own because test/stylesheets.test.js holds the product's list of stylesheets. Task 128 (study-round2.md, owner's
   decision of 2026-10-16): the control is a violet button filled with the assistant's colour, as prominent as the
   teal work action of the page and never taken for it: another colour, the same shape as every button (owner,
   2026-10-16: the colour is enough) and its own place in the top bar. Its label is always shown, at every width and zoom; nothing of it moves.
   Where the system forces its colours it is a system button framed by a double border (the block at the end of this
   file), so it still differs from the plain frame of a work action. The panel is a modal dialog on the right over a
   shade, the whole screen on a phone; its messages are wells on the paper of the panel,
   with no shadow, so that nothing of it stands on a ground and a shadow alone where the system forces its colours. Nothing here moves: the typing dots are lit one after the
   other by the script, and not at all for a person who asked for less motion. */
.assistant-button { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--space-1); min-width: 10rem; min-height: var(--ph-control-h-touch);
  padding: var(--ph-space-05) var(--ph-space-15); border: 2px solid var(--ph-ai); border-radius: var(--radius); background: var(--ph-ai); color: var(--ph-on-ai);
  box-shadow: none; font-size: 1rem; font-weight: 600; line-height: 1.25; text-align: center; white-space: normal; }
.assistant-button:hover, .assistant-button[aria-expanded="true"] { background: var(--ph-ai-hover); border-color: var(--ph-ai-hover); }
.assistant-button:active { background: var(--ph-ai-active); border-color: var(--ph-ai-active); }
.assistant-button:focus-visible { outline: 3px solid var(--ph-ai-focus); outline-offset: 3px; }
.assistant-icon { flex: none; width: 1.25rem; height: 1.25rem; }
/* The generic button padding would leave the close icon a few pixels wide in a 40px box. */
.assistant-close { padding: 0; }
body:has(.assistant-panel[open]) { overflow: hidden; }
.assistant-panel { position: fixed; inset: 0 0 0 auto; width: min(26rem, 100vw); max-width: 100vw; height: 100svh; max-height: 100svh; margin: 0; padding: 0; border: 0;
  border-left: var(--border-w) solid transparent; background: var(--surface-1); color: var(--ink); }
.assistant-panel[open] { display: flex; flex-direction: column; }
.assistant-panel::backdrop { background: color-mix(in srgb, var(--ink) 38%, transparent); }
.assistant-head { display: flex; align-items: center; gap: var(--ph-space-15); padding: var(--space-2) var(--space-2) var(--ph-space-15) var(--space-3); border-bottom: var(--border-w) solid var(--line); }
.assistant-mark, .assistant-avatar { display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--accent-subtle-bg); color: var(--accent-text); }
.assistant-mark { width: 2.5rem; height: 2.5rem; }
.assistant-mark .app-icon { width: 1.375rem; height: 1.375rem; }
.assistant-avatar { width: 2rem; height: 2rem; }
.assistant-avatar .app-icon { width: 1.125rem; height: 1.125rem; }
.assistant-heading { flex: 1; min-width: 0; }
.assistant-heading > h2 { margin: 0; font-size: var(--ph-text-lg); }
.assistant-lead { margin: var(--ph-space-05) 0 0; color: var(--ink-2); font-size: var(--ph-text-sm); }
.assistant-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) var(--space-3); }
.assistant-log { display: flex; flex-direction: column; gap: var(--space-2); }
.assistant-message { display: flex; align-items: flex-start; gap: var(--space-1); }
.assistant-message.is-user { justify-content: flex-end; }
.assistant-message.is-user .assistant-bubble { max-width: 85%; margin: 0; padding: var(--ph-space-15) var(--space-2); border-radius: var(--radius-l); background: var(--accent); color: var(--on-accent); overflow-wrap: anywhere; }
.assistant-message.is-bot .assistant-bubble { flex: 1; min-width: 0; padding: var(--ph-space-15) var(--space-2); border-radius: var(--radius-l); background: var(--surface-2); color: var(--ink); overflow-wrap: anywhere; }
.assistant-answer > * { margin: 0 0 var(--space-1); }
.assistant-answer > :last-child { margin-bottom: 0; }
.assistant-list { margin: 0; padding-left: var(--space-2); }
.assistant-list > li + li { margin-top: var(--ph-space-05); }
.assistant-group-title { margin: var(--ph-space-15) 0 var(--ph-space-05); font-size: var(--ph-text-md); }
.assistant-table-wrap { overflow-x: auto; }
.assistant-table { width: 100%; border-collapse: collapse; font-size: var(--ph-text-sm); }
.assistant-table :is(th, td) { padding: var(--ph-space-05) var(--space-1) var(--ph-space-05) 0; text-align: left; vertical-align: top; }
.assistant-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--ph-space-15); }
.assistant-chip { display: inline-flex; align-items: center; min-height: var(--ph-control-h-compact); padding: var(--ph-space-05) var(--ph-space-15); border: var(--border-w) solid var(--accent-border);
  border-radius: var(--radius-l); background: var(--surface-1); color: var(--accent-text); font-size: var(--ph-text-sm); font-weight: 600; text-align: left; text-decoration: none; }
.assistant-chip:hover { background: var(--accent-subtle-bg); }
.assistant-working { display: flex; align-items: flex-start; gap: var(--space-1); margin-top: var(--space-2); }
.assistant-working-text { padding: var(--ph-space-15) var(--space-2); border-radius: var(--radius-l); background: var(--surface-2); color: var(--ink-2); font-size: var(--ph-text-sm); }
.assistant-dots { display: inline-flex; gap: var(--ph-space-05); padding-block: var(--ph-space-05); }
.assistant-dots > span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent-border); }
.assistant-dots > span.is-lit { background: var(--accent); }
.assistant-working-lines { margin: var(--ph-space-05) 0 0; padding: 0; list-style: none; }
.assistant-form { padding: var(--ph-space-15) var(--space-3) var(--space-2); border-top: var(--border-w) solid var(--line); }
.assistant-input { width: 100%; min-height: 4.5rem; resize: none; }
.assistant-form-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); margin-top: var(--space-1); }
.assistant-form-note { margin: var(--ph-space-05) 0 0; color: var(--err); font-size: var(--ph-text-sm); }
/* Below 64rem the top bar takes two rows (task 128): the menu, the bell and the account above; under them the company
   with the role on the left, a long name wrapping, and the assistant on the right. A consultant's bar has the studio
   there. Narrower than 22.5rem, as a phone at 200 % zoom is, the second row stacks: the name, the role, then the
   assistant, its label still shown. The search stays the first thing of the phone menu (shell.css). */
@media (max-width: 63.999rem) {
  .app-topbar:has(.assistant-button) { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "menu . user" "brand brand assistant" "company company assistant"; row-gap: var(--ph-space-05); }
  .app-topbar:has(.assistant-button):has(.app-bell) { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "menu . bell user" "brand brand assistant assistant" "company company assistant assistant"; }
  /* Task 282: the name wraps between its words only, on two lines at most; a word too wide is cut by its own box (shell.css). */
  .has-shell .app-topbar:has(.assistant-button) .app-mobile-brand { align-self: end; white-space: normal; overflow-wrap: normal; --ph-name-lines: 2; }
  .has-shell .app-topbar:has(.assistant-button):not(:has(.app-company)) .app-mobile-brand { grid-row: 2 / 4; align-self: center; }
  .assistant-button { grid-area: assistant; justify-self: end; align-self: center; }
}
@media (max-width: 47.999rem) {
  .assistant-panel { width: 100vw; border-left: 0; }
  .assistant-head { padding-inline: var(--space-2) var(--space-1); }
  .assistant-body, .assistant-form { padding-inline: var(--space-2); }
  .assistant-chip { min-height: var(--ph-control-h); }
}
@media (max-width: 22.499rem) {
  .app-topbar:has(.assistant-button) { grid-template-areas: "menu . user" "brand brand brand" "company company company" "assistant assistant assistant"; }
  .app-topbar:has(.assistant-button):has(.app-bell) { grid-template-areas: "menu . bell user" "brand brand brand brand" "company company company company" "assistant assistant assistant assistant"; }
  .has-shell .app-topbar:has(.assistant-button):not(:has(.app-company)) .app-mobile-brand { grid-row: auto; }
  .assistant-button { justify-self: start; }
}
/* ==== Assistant of the top bar (task 113): end ==== */
/* The legal footer of every page (task 172, partials/legal-footer.ejs): who runs the service and its partita IVA, then
   the legal documents, in the quiet ink at the small step, one line where it fits and wrapping on a phone. It is the
   last thing of the column in the shell and of the page elsewhere; a page printed is its content alone (the print block
   below hides it). */
.legal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--ph-space-05) var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); color: var(--ink-2); font-size: var(--ph-text-sm); }
.legal-footer-operator { margin: 0; }
.legal-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--space-2); margin: 0; padding: 0; list-style: none; }
.legal-footer-links a, .legal-footer-links a:visited { display: inline-flex; align-items: center; min-height: 1.5rem; color: var(--ink-2); }
.legal-footer-links a:hover { color: var(--accent-text); }
.has-shell .legal-footer { justify-content: flex-start; padding-inline: var(--space-5); }
/* The short notice of a page opened by a link with no account (task 175, partials/guest-notice.ejs): under the page's
   work, after a hairline, in the quiet ink at the small step, with a heading no louder than its lines. */
.guest-notice { margin-top: var(--space-4); padding-top: var(--space-3); border-top: var(--border-w) solid var(--line); color: var(--ink-2); font-size: var(--ph-text-sm); }
.guest-notice h2 { margin: 0 0 var(--ph-space-05); font-size: var(--ph-text-sm); font-weight: 600; color: var(--ink-2); }
.guest-notice p { margin: 0 0 var(--ph-space-05); max-width: 65ch; }
.guest-notice a, .guest-notice a:visited { color: var(--ink-2); }
.guest-notice a:hover { color: var(--accent-text); }
.public-page { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 100svh; }
.public-page .public-main { width: 100%; }
@media (max-width: 63.999rem) { .has-shell .legal-footer { padding-inline: var(--space-3); } }
/* Forced colours, design-d-spec.md 4 (task 071). Where the system forces its colours the fills and the shadows are
   gone, and a card, which is drawn by its ground and its shadow alone, would have no edge. There every resting card
   takes a 1px border in the colour of the text, the one colour that mode draws it in; no rule names a colour. What is
   flat inside a card stays flat, with the top rule it has. Outside that mode nothing here applies: the cards keep no
   border and not a pixel moves. A card of a feature takes the same border in its own stylesheet (test/design-d.test.js
   holds that none is left out).
   The same holds for whatever else is drawn by a ground and a shadow alone (review of round 1, finding 2): a floating
   layer (a menu, the page information, a row drawer, which keeps the border where a phone draws it in place as a well)
   and the current segment of a segmented control, which would otherwise be told apart by its bold text alone. */
@media (forced-colors: active) {
  .panel, .panel.form-section, .table-scroll, .empty, .date-groups, .steps-compact, .disclosure-create[open] > :not(summary) { border: var(--border-w) solid; }
  .panel.form-section + .panel.form-section { border-top: var(--border-w) solid; }
  .panel .panel, .panel .table-scroll { border-width: var(--border-w) 0 0; }
  .panel .date-groups, .panel .empty, .table-scroll .empty { border: 0; }
  .menu-panel, .page-info-panel, .row-drawer-panel { border: var(--border-w) solid; }
  .segments a[aria-current="true"] { border: var(--border-w) solid; }
  .segments-more > summary[data-current="true"] { border: var(--border-w) solid; }
  .assistant-button { border: 3px double; }
}
