/* Page patterns of the interface. Each block is one pattern of DIRECTION.md; a rebuilt page reuses
   the block of its pattern and adds nothing that components.css already has. */

/* ================================================================ page containers (every page beyond the six)
   One column of a known width, the large title on top. .page for lists and detail pages,
   --narrow for forms and settings, --read for a page you read, --wide for boards. */
.page { max-width: 1180px; margin: 0 auto; padding-top: var(--s5); }
.page--narrow { max-width: 760px; }
.page--read { max-width: 980px; }
.page--wide { max-width: 1280px; }
.page > .summary { margin-top: var(--s5); }
/* a detail page with an aside of facts: the aside drops under the main column below 1180 */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s8); align-items: start; }
.split-aside { position: sticky; top: calc(var(--toolbar-h) + var(--s4)); }
@media (max-width: 1180px) { .split { grid-template-columns: minmax(0, 1fr); gap: var(--s7); } .split-aside { position: static; } }
.stub .banner { max-width: 72ch; }
.stub-states-title { margin: var(--s7) 0 var(--s3); }
.auth .stub-states-title { margin-top: var(--s6); }

/* ================================================================ hero question page (domanda) */
.ask { max-width: 1040px; margin: 0 auto; }
.ask-hero { padding-top: clamp(40px, 11vh, 120px); text-align: center; }
.ask-title { font-size: var(--t-hero); line-height: 1.08; font-weight: var(--w-bold); letter-spacing: -.02em; text-wrap: balance; }
.ask-sub { margin: 14px auto 0; max-width: 46ch; font-size: 17px; line-height: 1.5; color: var(--label-2); letter-spacing: -.01em; }

.field {
  position: relative; max-width: 760px; margin: 40px auto 0; text-align: left;
  border-radius: var(--r-xl); background: var(--bg-elev); box-shadow: var(--shadow-field);
  transition: box-shadow .3s var(--ease-out), background-color .3s var(--ease-out);
}
:root[data-theme='dark'] .field { background: var(--bg-group); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .field { background: var(--bg-group); } }
.field:focus-within { box-shadow: var(--shadow-field), 0 0 0 4px var(--accent-soft); }
.field textarea {
  display: block; width: 100%; min-height: 96px; max-height: 280px; resize: none; border: 0; background: none; outline: none;
  padding: 22px 26px 6px; font-size: var(--t-read); line-height: 1.45; letter-spacing: -.016em; color: var(--label);
}
.field textarea::placeholder { color: var(--placeholder); transition: opacity .3s; }
.field-foot { display: flex; align-items: center; gap: 4px; padding: 8px 10px 10px 14px; }
.field-foot .btn--plain { font-size: 13.5px; height: 30px; padding: 0 10px; color: var(--label-2); font-weight: var(--w-medium); transition: opacity var(--fade), background-color var(--fade), color var(--fade); }
.field-foot .btn--plain:hover { color: var(--label); }
.field-foot .spacer { flex: 1; }
.field-hint { font-size: 12px; color: var(--label-2); margin-right: 10px; transition: opacity var(--fade); }
.send {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--fill); color: var(--label-3);
  transition: background-color .25s var(--ease-out), color .25s, transform var(--spring-bouncy-d) var(--spring-bouncy);
}
.send .icon { grid-area: 1 / 1; width: var(--icon-l); height: var(--icon-l); stroke-width: 2.25; transition: opacity 160ms var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy); }
.send .send-stop { width: 12px; height: 12px; grid-area: 1 / 1; border-radius: 3px; background: currentColor; opacity: 0; transform: scale(.4); transition: opacity 160ms var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy); }
.field.has-text .send { background: var(--accent-fill); color: var(--on-accent); }
.field.has-text .send:active { transform: scale(.96); }
.field.is-invalid { animation: nope .4s var(--ease-out); }
@keyframes nope { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(5px); } }
.field-error { max-width: 760px; margin: 10px auto 0; font-size: 13.5px; color: var(--negative); text-align: left; padding-left: 26px; }
.ask-notes { max-width: 560px; margin: 18px auto 0; text-align: center; transition: opacity var(--fade); }

/* asking: the field keeps the question and its place; only its tools step back, and the send
   button becomes the stop button. Nothing travels across the page. */
.ask.is-asking .field { box-shadow: 0 0 0 var(--hairline) var(--sep-strong); }
.ask.is-asking .field textarea { color: var(--label); cursor: default; }
.ask.is-asking .field-foot .btn--plain, .ask.is-asking .field-hint, .ask.is-asking .ask-notes { opacity: 0; pointer-events: none; }
.ask.is-asking .send { background: var(--fill); color: var(--label); }
.ask.is-asking .send .icon { opacity: 0; transform: scale(.4); }
.ask.is-asking .send .send-stop { opacity: 1; transform: none; }

.ask-section { margin-top: var(--s9); transition: opacity 220ms var(--ease-out), transform var(--spring-smooth-d) var(--spring-smooth); }
.ask-section.is-leaving { opacity: 0; transform: translateY(8px); pointer-events: none; }
.suggest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 48px; }
.suggest-theme { display: flex; align-items: center; gap: 8px; font-size: var(--t-sub); font-weight: var(--w-semibold); color: var(--label-2); margin-bottom: 8px; }
.suggest-theme .icon { width: var(--icon-m); height: var(--icon-m); color: var(--accent); }
.suggest-q {
  position: relative; display: flex; align-items: flex-start; gap: 8px; width: calc(100% + 20px); margin-left: -10px; padding: 9px 10px; border-radius: var(--r-sm);
  font-size: var(--t-body); line-height: 1.4; color: var(--label); text-align: left; letter-spacing: -.01em;
  transition: background-color var(--fade) var(--ease-out);
}
.suggest-q:hover { background: var(--fill-soft); }
.suggest-q:active { background: var(--fill); }
.suggest-q .icon { width: var(--icon-m); height: var(--icon-m); margin-top: 3px; margin-left: auto; color: var(--label-3); opacity: 0; transition: opacity var(--fade); }
.suggest-q:hover .icon, .suggest-q:focus-visible .icon { opacity: 1; }
.suggest-q.is-picked { background: var(--accent-soft); }

.recent li + li .recent-row { border-top: var(--hairline) solid var(--sep); }
.recent-row { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; color: var(--label); width: 100%; text-align: left; font: inherit; }
.recent-row:hover .recent-q { color: var(--accent); }
.recent-q { flex: 1; font-size: var(--t-body); transition: color .15s; min-width: 0; }
.recent-state { font-size: var(--t-sub); color: var(--label-2); white-space: nowrap; }
.recent-when { font-size: var(--t-sub); color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; width: 92px; text-align: right; }

/* the turn, in place under the field */
.ask-turn { max-width: 760px; margin: var(--s6) auto 0; text-align: left; }
.ask-turn .outcome { margin-top: var(--s6); }

/* ================================================================ the turn on its own page (attesa) */
.wait { max-width: 980px; margin: 0 auto; padding-top: var(--s5); }
.wait-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s6); }
.wait-head .large-title { max-width: 24ch; }
.wait-head .subhead { margin-top: 10px; }
.wait-body { margin-top: var(--s7); }
.wait-body .outcome { margin-top: var(--s7); }
.wait-note { margin-top: var(--s7); max-width: 64ch; }

/* ================================================================ answer page (risultato) */
.answer { max-width: 980px; margin: 0 auto; padding-top: var(--s5); }
.answer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s6); }
.answer-title { max-width: 24ch; }
.answer-meta { margin-top: 10px; }
.answer-actions { display: flex; gap: 8px; padding-top: 4px; flex: none; }
.pin-label { display: inline-grid; }
.pin-label > span { grid-area: 1 / 1; transition: opacity 180ms var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy); }
.pin-label > span + span { opacity: 0; transform: translateY(6px); }
.is-pinned .pin-label > span:first-child { opacity: 0; transform: translateY(-6px); }
.is-pinned .pin-label > span + span { opacity: 1; transform: none; }
.reading { margin-top: var(--s6); max-width: 64ch; font-size: var(--t-read); line-height: 1.58; letter-spacing: -.014em; }
.reading strong { font-weight: 620; font-variant-numeric: tabular-nums; }
.how { margin-top: var(--s4); max-width: 64ch; }
.how summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--t-control); color: var(--label-2); list-style: none; border-radius: var(--r-xs); }
.how summary::-webkit-details-marker { display: none; }
.how summary .icon { width: var(--icon-s); height: var(--icon-s); transition: transform .35s var(--spring-snappy); }
.how[open] summary .icon { transform: rotate(90deg); }
.how p { margin-top: 8px; padding-left: 20px; font-size: 14.5px; line-height: 1.55; color: var(--label-2); }
.receipt { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--s4); font-size: var(--t-sub); color: var(--label-2); line-height: 1.5; text-align: left; border-radius: var(--r-xs); }
.receipt .icon { width: var(--icon-s); height: var(--icon-s); margin-top: 2px; color: var(--positive); }
.receipt:hover span { color: var(--label); }
.receipt u { text-decoration-color: var(--sep-strong); text-underline-offset: 3px; }
.followups { margin-top: var(--s6); }
.followups-label { font-size: var(--t-sub); font-weight: var(--w-semibold); color: var(--label-2); margin-bottom: 12px; }
.followups ul { display: flex; flex-wrap: wrap; gap: 8px; }
.block { margin-top: var(--s8); }
.chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: var(--s5); }
.scrub-label { font-size: var(--t-sub); color: var(--label-2); font-weight: var(--w-medium); min-height: 19px; }
.scrub-value { font-size: 30px; font-weight: 650; letter-spacing: -.028em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.scrub-value .kpi-unit { font-size: 16px; }
.scrub-sub { font-size: var(--t-sub); color: var(--label-2); margin-top: 2px; min-height: 19px; }
.chart-tools { display: flex; align-items: center; gap: 20px; }
.chart-host { position: relative; }
/* the follow-up composer: the one floating material of the page, because the answer scrolls
   under it. The page reserves its height at the end, so nothing is ever hidden for good. */
.composer-dock { position: sticky; bottom: 0; z-index: 15; padding: 24px 0 20px; margin-top: var(--s7); pointer-events: none; }
.composer {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 680px; margin: 0 auto; padding: 6px 6px 6px 20px;
  border-radius: var(--r-pill); background: var(--material); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-field);
}
.composer input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15.5px; height: 36px; }
.composer input::placeholder { color: var(--label-2); }
.composer .send { width: 34px; height: 34px; }
.composer.has-text .send { background: var(--accent-fill); color: var(--on-accent); }

.chart-hint { margin-top: 12px; }
/* a single figure as the answer: the number is the protagonist, one sentence beneath */
.hero-figure-value { font-size: 64px; line-height: 1; font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-figure-value .kpi-unit { font-size: 28px; margin-left: 6px; }
.hero-figure-sub { margin-top: 12px; font-size: var(--t-body); color: var(--label-2); }
/* a filter in force on the table: one sentence and the way out */
.filter-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 14px; font-size: var(--t-control); color: var(--label-2); }
.filter-line .icon { width: var(--icon-s); height: var(--icon-s); color: var(--accent); }
.filter-line strong { color: var(--label); font-weight: var(--w-semibold); }
/* the judgement: a quiet question at the end, two answers */
.feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-top: var(--s8); padding-top: var(--s5); border-top: var(--hairline) solid var(--sep); font-size: var(--t-control); color: var(--label-2); }
.feedback-moves { display: flex; gap: 8px; }
/* follow-ups answered in place, under the answer */
.thread { margin-top: var(--s7); }
.thread-list > li + li { margin-top: var(--s6); }
.exchange-q { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-head); font-weight: var(--w-semibold); letter-spacing: -.012em; }
.exchange-q .icon { width: var(--icon-m); height: var(--icon-m); margin-top: 3px; color: var(--accent); flex: none; }
.exchange-wait { display: flex; align-items: center; gap: 10px; margin: 10px 0 0 24px; font-size: var(--t-sub); color: var(--label-2); }
.exchange-step { display: inline-block; }
.exchange-spin { width: 14px; height: 14px; border-radius: 50%; border: 1.75px solid var(--sep-strong); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.exchange-a { margin: 10px 0 0 24px; max-width: 64ch; }
.exchange-a p { font-size: 17px; line-height: 1.55; letter-spacing: -.012em; }
.exchange-a strong { font-weight: 620; font-variant-numeric: tabular-nums; }
.exchange-a .link-button { display: inline-block; margin-top: 8px; }
/* a table inside the inspector keeps the sheet's margins */
.sheet-table { margin: 18px 0 0; }
.sheet-note { margin-top: 12px; }

/* ================================================================ dashboard */
.dash { max-width: 1280px; margin: 0 auto; padding-top: var(--s5); }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: var(--s6); transition: opacity .3s var(--ease-out); }
.filters .toggle { margin-left: 12px; }
.is-editing .filters { opacity: .35; pointer-events: none; }
/* the edit bar slides down from under the title when «Modifica» is pressed */
.edit-bar { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--spring-smooth-d) var(--spring-smooth); }
.edit-bar > div { overflow: hidden; min-height: 0; }
.is-editing .edit-bar { grid-template-rows: 1fr; }
.edit-bar-inner { display: flex; align-items: center; gap: 16px; padding: 22px 0 0; }
.edit-bar-text { flex: 1; font-size: 14.5px; color: var(--label-2); max-width: 80ch; }
.edit-bar-text strong { color: var(--label); font-weight: var(--w-semibold); }
.edit-narrow { display: none; }

.board { --tx: 20px; --tt: 20px; --tb: 48px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 68px 60px; margin-top: var(--s7); position: relative; isolation: isolate; transition: row-gap var(--spring-smooth-d) var(--spring-smooth); }
/* in edit mode every lifted sheet reaches 20 px above and 48 px below its tile, and the S, M, L
   capsule lives inside that lower margin: the rows open up so the sheets, and the controls on them,
   never touch (48 + 20 + 28 of air). No control leaves its own tile's sheet. */
@media (min-width: 641px) { .is-editing .board { row-gap: 96px; } }
.w { position: relative; grid-column: span 12; min-width: 0; }
.w[data-size='s'] { grid-column: span 4; }
.w[data-size='m'] { grid-column: span 8; }
.w[data-size='l'], .w[data-fixed] { grid-column: span 12; }
.w-inner { position: relative; height: 100%; isolation: isolate; container-type: inline-size; }
/* at rest a widget has no body; in edit mode it gains one (a lifted sheet behind it) */
.w-inner::before {
  content: ''; position: absolute; z-index: -1; inset: calc(var(--tt) * -1) calc(var(--tx) * -1) calc(var(--tb) * -1);
  border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-lift);
  opacity: 0; transform: scale(.97);
  transition: opacity .3s var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy), box-shadow .25s var(--ease-out);
}
:root[data-theme='dark'] .w-inner::before { background: var(--bg-group); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .w-inner::before { background: var(--bg-group); } }
.is-editing .w-inner::before { opacity: 1; transform: none; }
.w-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.w-title { font-size: var(--t-head); font-weight: var(--w-semibold); letter-spacing: -.012em; }
.w-sub { font-size: var(--t-sub); color: var(--label-2); margin-top: 2px; }
.w-more { flex: none; margin: -6px -8px 0 0; color: var(--label-3); }
.w:hover .w-more, .w-more:focus-visible, .w-more[aria-expanded='true'] { color: var(--label); }
.w-figure { display: flex; align-items: baseline; gap: 10px; margin: -6px 0 16px; }
.w-figure .kpi-value { font-size: 26px; margin: 0; }
.w-table .table { font-size: var(--t-control); }
.w-table .table td { padding: 9px 12px; }
@container (max-width: 520px) { .col-opt { display: none; } }

/* edit controls are in the DOM always and appear only while editing */
.w-ctl { position: absolute; z-index: 3; opacity: 0; visibility: hidden; transform: scale(.6); transition: opacity var(--fade) var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy), visibility 0s var(--fade); }
.is-editing .w-ctl { opacity: 1; visibility: visible; transform: none; transition: opacity var(--fade) var(--ease-out), transform var(--spring-snappy-d) var(--spring-snappy), visibility 0s; }
.w-remove { top: calc(var(--tt) * -1 - 11px); left: calc(var(--tx) * -1 - 11px); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-elev); color: var(--label); box-shadow: var(--shadow-pop); }
.w-remove .icon { width: var(--icon-s); height: var(--icon-s); stroke-width: 2.5; }
.w-remove:hover { color: var(--negative); }
.w-handle { top: calc(var(--tt) * -1 + 8px); right: calc(var(--tx) * -1 + 8px); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--label-2); cursor: grab; touch-action: none; }
.w-handle:hover { background: var(--fill); color: var(--label); }
.w-sizes { left: 50%; bottom: calc(var(--tb) * -1 + 9px); transform: translateX(-50%) scale(.6); padding: 2px; border-radius: var(--r-sm); background: var(--bg-elev); box-shadow: var(--shadow-pop); display: inline-flex; }
.is-editing .w-sizes { transform: translateX(-50%); }
.w-sizes button { position: relative; width: 34px; height: 26px; border-radius: 8px; font-size: 12.5px; font-weight: var(--w-semibold); color: var(--label-2); }
.w-sizes button:hover { color: var(--label); }
.w-sizes button[aria-pressed='true'] { background: var(--accent-fill); color: var(--on-accent); }
.is-editing .w { cursor: grab; }
.is-editing .w-more { visibility: hidden; }
.is-editing .chart-host, .is-editing .w-table, .is-editing .kpis { pointer-events: none; }
.w.is-dragging { z-index: 40; cursor: grabbing; }
.w.is-dragging .w-inner { transform: scale(1.02); transition: transform var(--spring-snappy-d) var(--spring-snappy); }
.w.is-dragging .w-inner::before { box-shadow: var(--shadow-drag); }
.w.is-target .w-inner::before { box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent); }
.w.is-new .w-inner::before { box-shadow: var(--shadow-lift), 0 0 0 2px var(--accent-soft); }

/* the free grid (behind «Altro»): the twelve columns become visible, a corner handle sets the width */
.board-guides { position: absolute; left: 0; right: 0; top: -30px; height: 5px; z-index: 6; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 60px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.board-guides span { background: var(--accent); border-radius: 3px; opacity: .3; }
.is-free .board-guides { opacity: 1; }
.board.is-resizing .board-guides { bottom: -20px; height: auto; }
.board.is-resizing .board-guides span { opacity: .06; }
.is-free .w-sizes { display: none; }
.w-resize { right: calc(var(--tx) * -1 + 8px); bottom: calc(var(--tb) * -1 + 8px); width: 24px; height: 24px; border-radius: 50%; background: var(--bg-elev); box-shadow: var(--shadow-pop); display: none; place-items: center; cursor: ew-resize; color: var(--label-2); touch-action: none; }
.w-resize .icon { width: var(--icon-s); height: var(--icon-s); }
.is-free .w-resize { display: grid; }
.w-span { position: absolute; right: calc(var(--tx) * -1 + 48px); top: calc(var(--tt) * -1 + 15px); font-size: 12px; font-weight: var(--w-semibold); color: var(--label-2); display: none; font-variant-numeric: tabular-nums; }
.is-free .w-span { display: block; }
.add-list { display: flex; flex-direction: column; }
.add-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; text-align: left; font-size: var(--t-control); }
.add-item .icon { width: var(--icon-m); height: var(--icon-m); color: var(--accent); }
.add-item:hover, .add-item:focus-visible { background: var(--fill-soft); outline: none; }
.add-item:focus-visible { box-shadow: 0 0 0 3px var(--focus); }
.add-item small { display: block; font-size: 12px; color: var(--label-2); }

.dash-note { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dash-note .state { align-items: baseline; }
.dash-note .state::before { transform: translateY(-2px); }
/* a widget that cannot show its chart: its title stays, one sentence, one move */
.w-message { max-width: 44ch; padding: 8px 0 4px; }
.w-message-title { display: flex; align-items: center; gap: 8px; font-size: var(--t-control); font-weight: var(--w-semibold); }
.w-message-title .icon { width: var(--icon-s); height: var(--icon-s); color: var(--label-2); }
.w-message p + p { margin-top: 6px; font-size: var(--t-sub); color: var(--label-2); line-height: 1.5; }
.w-message-moves { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.w-loading { padding-top: 4px; }
.dash-empty { margin-top: var(--s6); }
.empty-moves { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.empty-moves .btn { margin-top: 0; }
/* «Ingrandisci»: the dialog widens for the chart */
.dialog--zoom { width: min(1040px, calc(100vw - 32px)); }
.zoom-tools { display: flex; justify-content: flex-end; margin-bottom: var(--s4); }
.zoom-chart { min-height: 200px; }
.zoom-table .table-wrap { margin: 0; }

/* ================================================================ list and table page (users) */
.list { max-width: 1180px; margin: 0 auto; padding-top: var(--s5); }
.list-summary { margin-top: var(--s5); font-size: var(--t-body); color: var(--label-2); max-width: 72ch; }
.list-summary strong { color: var(--label); font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: var(--s6); }
.list-tools .search { margin-right: 4px; }
.list-tools .spacer { flex: 1; }
.list-count { font-size: var(--t-sub); color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-table { margin-top: var(--s5); }
.users-table td { padding-top: 10px; padding-bottom: 10px; }
.users-table td:last-child, .users-table th:last-child { width: 44px; padding-right: 4px; text-align: right; }
.users-table tr.is-off .person-name { color: var(--label-2); }
.users-table tr.is-off .avatar { color: var(--label-2); }
.users-table .groups { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.users-table .more-groups { color: var(--label-2); }
.users-table tr.is-new td { animation: arrive 1.6s var(--ease-out); }
@keyframes arrive { 0%, 30% { background-color: var(--accent-soft); } 100% { background-color: transparent; } }
.secret-help { margin-top: 14px; }
.secret { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 16px 18px; border-radius: var(--r-md); background: var(--bg-group); }

/* ================================================================ full-page auth and error (accesso) */
.auth-page { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-bar { display: flex; justify-content: flex-end; padding: 14px 20px; }
.auth-bar .switcher { border-left: 0; }
/* anchored to a fixed top, not centred: an error or the second step grows the column downwards
   and nothing above it moves */
.auth { flex: 1; display: flex; flex-direction: column; width: min(380px, calc(100% - 40px)); margin: 0 auto; padding: clamp(32px, 15vh, 150px) 0 72px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: var(--t-control); color: var(--label-2); font-weight: var(--w-medium); }
.auth-brand .brand-mark { width: 26px; height: 26px; }
.auth-brand .brand-mark svg { width: 26px; height: 26px; }
.auth h1 { margin-top: var(--s6); font-size: var(--t-large); line-height: 1.12; font-weight: var(--w-bold); letter-spacing: -.02em; }
.auth-sub { margin-top: 10px; font-size: var(--t-body); color: var(--label-2); line-height: 1.5; }
.auth-form { margin-top: var(--s6); }
.auth-form .form { gap: var(--s4); }
.auth-form .btn--primary { margin-top: var(--s2); }
/* A standalone link in the form's width wraps rather than widening the page on a 320 px
   screen: the company link's label is longer than the local submit's. */
.auth-form > .btn { height: auto; min-height: 44px; padding-block: 10px; white-space: normal; text-align: center; }
.auth-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--negative) 9%, transparent); color: var(--label); font-size: var(--t-control); line-height: 1.45; }
.auth-alert .icon { width: var(--icon-m); height: var(--icon-m); margin-top: 1px; color: var(--negative); }
.auth-help { margin-top: var(--s5); font-size: var(--t-sub); color: var(--label-2); line-height: 1.5; }
.auth-foot { padding: 0 20px 24px; text-align: center; font-size: 12px; color: var(--label-2); }
.auth-steps { position: relative; }
.auth-step { transition: opacity 220ms var(--ease-out), transform var(--spring-gentle-d) var(--spring-gentle); }
.auth-step.is-out { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.auth-step.is-in-start { opacity: 0; transform: translateX(24px); transition: none; }

/* ================================================================ index of the proposal */
.index { max-width: 760px; margin: 0 auto; padding: 96px 32px 120px; }
.index-bar { position: fixed; top: 14px; right: 20px; }
.index-bar .switcher { border-left: 0; }
.index h1 { font-size: var(--t-large); font-weight: var(--w-bold); letter-spacing: -.02em; line-height: 1.15; }
.index-lead { margin-top: 12px; font-size: 17px; color: var(--label-2); line-height: 1.5; max-width: 60ch; }
.index-list { margin-top: var(--s7); }
.index-list > li { padding: 20px 0; border-top: var(--hairline) solid var(--sep); }
.index-list a.index-main { font-size: 17px; font-weight: var(--w-semibold); letter-spacing: -.012em; }
.index-list p { margin-top: 4px; font-size: var(--t-control); color: var(--label-2); line-height: 1.5; }
.index-states { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: var(--t-sub); }
.index-foot { margin-top: var(--s7); }

/* ================================================================ narrow */
@media (max-width: 1180px) {
  .suggest-grid { grid-template-columns: repeat(2, 1fr); }
}
/* the users table drops columns before it would scroll: groups first, then the state column,
   whose «Disattivato» moves under the person's name */
.person-off { display: none; font-size: var(--t-foot); color: var(--label-2); }
@media (max-width: 1280px) {
  .users-table .col-groups { display: none; }
}
.th-short { display: none; }
.users-table .col-person { max-width: 300px; }
@media (max-width: 1180px) {
  .users-table .col-state { display: none; }
  .person-off { display: block; }
  .th-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .th-short { display: inline; }
  .users-table .col-person { max-width: 250px; }
}
@media (max-width: 640px) {
  .ask-hero { padding-top: 28px; }
  .ask-title { font-size: 32px; }
  .ask-sub { font-size: 15.5px; }
  .field { margin-top: 28px; border-radius: 24px; }
  .field textarea { font-size: 17px; padding: 18px 20px 4px; min-height: 84px; }
  .field-hint { display: none; }
  /* hidden to the eye and kept in the accessible name: a button of one drawing still says what it does */
  .field-foot .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .field-foot .btn--plain { width: 34px; padding: 0; }
  .suggest-grid { grid-template-columns: 1fr; gap: 32px; }
  .ask-section { margin-top: var(--s8); }
  .ask-turn { margin-top: var(--s6); }
  .recent-when { width: auto; }
  .recent-state { display: none; }
  .answer-head, .wait-head { flex-direction: column; gap: 18px; }
  /* At a phone the commands of the head take more than one row: «Add to the dashboard»,
     «Full analysis», «Agents» and «Other» do not fold to icons (templates/outcome.html:117-120). */
  .answer-actions { flex-wrap: wrap; max-width: 100%; }
  .reading { font-size: 17px; }
  .chart-tools { width: 100%; justify-content: space-between; gap: 12px; }
  .segmented [role='radio'] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .board { gap: 52px 20px; --tx: 14px; --tt: 16px; --tb: 26px; }
  .w[data-size], .w[style] { grid-column: span 12 !important; }
  .w-remove { left: calc(var(--tx) * -1 - 2px); top: calc(var(--tt) * -1 - 8px); }
  .w-sizes, .w-resize, .board-guides, .w-span { display: none !important; }
  .edit-wide { display: none; }
  .edit-narrow { display: inline !important; }
  .filters .toggle { margin-left: 0; }
  .edit-bar-inner { flex-wrap: wrap; }
  .edit-bar-text { flex-basis: 100%; }
  /* hidden to the eye, kept for the accessible name: display: none would leave an icon-only button unnamed */
  .page-actions .btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page-actions .btn:has(.btn-text) { width: var(--control-h); padding: 0; }
  .toolbar .icon-button[href='domanda.html'] { display: none; }
  /* the users table becomes a list: person on the first line, role and access on the second */
  .list-tools .search { width: 100%; margin-right: 0; }
  .users-table thead { display: none; }
  .users-table, .users-table tbody { display: block; }
  .users-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding: 12px 0; border-bottom: var(--hairline) solid var(--sep); }
  .users-table tr:last-child { border-bottom: 0; }
  .users-table td { display: block; padding: 0; border: 0; white-space: normal; }
  .users-table tbody tr:hover td { background: none; }
  .users-table td.col-person { grid-column: 1; grid-row: 1; min-width: 0; }
  .users-table td:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: auto; }
  .users-table td.col-role, .users-table td.col-2fa, .users-table td.col-access, .users-table td.col-state { display: none; }
  .users-table .col-person { max-width: none; }
  .person-off { display: none; }
  .users-table td.col-line { display: block; grid-column: 1; grid-row: 2; margin: 6px 0 0 42px; font-size: var(--t-foot); color: var(--label-2); }
  .secret { flex-direction: column; align-items: stretch; }
}
@media (min-width: 641px) {
  .users-table .col-line { display: none; }
}
.auth-form.is-invalid { animation: nope .4s var(--ease-out); }

/* the fading copy a widget leaves where it was when it changes place (dashboard.js, flip) */
.w-ghost { position: absolute; z-index: 1; pointer-events: none; }

/* utenti: the selection column, only while «Seleziona più utenti» is on */
.users-table .col-check { width: 36px; padding-right: 0; }
.sheet-link { display: inline-block; margin-top: 16px; }
@media (max-width: 640px) {
  .is-selecting .users-table tr { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .users-table td.col-check { grid-column: 1; grid-row: 1 / span 2; align-self: center; width: auto; }
  .is-selecting .users-table td.col-person, .is-selecting .users-table td.col-line { grid-column: 2; }
  .is-selecting .users-table td:last-child { grid-column: 3; }
}

/* accesso: why the person is here again, above the form */
.auth-note { margin-top: var(--s5); }
.btn.is-waiting[disabled] { opacity: 1; background: var(--fill); color: var(--label-2); font-variant-numeric: tabular-nums; transition: none; }

/* index.html: the map */
.index--map { max-width: 880px; }
.index-summary { margin-top: var(--s4); }
.index-moves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--s6); }
.index-moves .popup { height: var(--control-h); }
.index-toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: var(--s7); padding-bottom: var(--s3); border-bottom: var(--hairline) solid var(--sep); font-size: var(--t-control); font-weight: var(--w-medium); }
.index-area { margin-top: var(--s8); scroll-margin-top: var(--s5); }
.index-area .index-list { margin-top: var(--s4); }
.index-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.index-file { margin-left: auto; font-size: var(--t-foot); color: var(--label-2); }

/* ================================================================ components.html: the catalogue
   Each component sits on the sheet as it does in a page; a caption names its class and its
   function. The specimens are the real components, never copies drawn for the catalogue. */
.catalog { max-width: 980px; }
.cat-toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: var(--s6); padding-bottom: var(--s3); border-bottom: var(--hairline) solid var(--sep); font-size: var(--t-control); font-weight: var(--w-medium); }
.cat { margin-top: var(--s8); scroll-margin-top: calc(var(--toolbar-h) + var(--s4)); }
.cat > .title-2 + .cat-note { margin-top: 6px; }
.cat-note { max-width: 68ch; font-size: var(--t-control); color: var(--label-2); line-height: 1.55; }
.cat-sub { margin-top: var(--s6); font-size: var(--t-head); font-weight: var(--w-semibold); letter-spacing: -.012em; }
.cat-demo { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s5) var(--s6); margin-top: var(--s5); }
.cat-demo--col { flex-direction: column; align-items: stretch; }
.cat-demo > * { min-width: 0; max-width: 100%; }
.cat-spec { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.cat-spec--grow { flex: 1 1 320px; align-items: stretch; }
.cat-spec--full { flex: 1 1 100%; align-items: stretch; }
.cat-cap { font-size: var(--t-foot); color: var(--label-2); line-height: 1.45; overflow-wrap: anywhere; }
.cat-cap code, .cat-note code { font-family: var(--mono); font-size: 11.5px; color: var(--label); }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s4) var(--s5); margin-top: var(--s5); }
.swatch { display: flex; align-items: center; gap: 12px; min-width: 0; }
.swatch-chip { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 var(--hairline) var(--sep-strong); }
.swatch-name { display: block; font-size: var(--t-control); font-weight: var(--w-medium); }
.swatch-token { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--label-2); }
.type-list > li { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: baseline; gap: var(--s4); padding: 14px 0; border-bottom: var(--hairline) solid var(--sep); }
.type-list > li:last-child { border-bottom: 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; margin-top: var(--s5); }
.icon-grid li { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: var(--t-sub); color: var(--label-2); overflow: hidden; }
.icon-grid .icon { flex: none; width: var(--icon-m); height: var(--icon-m); color: var(--label); }
.icon-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-sizes { display: flex; align-items: flex-end; gap: var(--s5); }
.icon-sizes .isz-s { width: var(--icon-s); height: var(--icon-s); } .icon-sizes .isz-m { width: var(--icon-m); height: var(--icon-m); } .icon-sizes .isz-b { width: var(--icon-b); height: var(--icon-b); } .icon-sizes .isz-l { width: var(--icon-l); height: var(--icon-l); } .icon-sizes .isz-xl { width: var(--icon-xl); height: var(--icon-xl); }
.icon-sizes figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cat-chart { width: 100%; }
@media (max-width: 640px) {
  .type-list > li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cat-demo { gap: var(--s5); }
}
