/* Flusso · the style of the approved mockups (QUA-06, docs/mockup/style.css), light theme.
   Fonts are in the project (static/fonts, licence OFL): pages call no other site. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.49215a3bccae.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin.f4634c3bc1fa.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600-latin.2027d0e0b02a.woff2") format("woff2");
}

:root {
  --ink: #0b0c10;
  --ink-2: #3d4250;
  --ink-3: #6b7280;
  --bg: #ffffff;
  --side: #fafafb;
  --hover: #f6f7f9;
  --line: #ececf0;
  --line-2: #dfe1e6;

  --accent: #3049f5; /* the blue of Flusso's logo (QUA-08, chosen on 17/11) */
  --accent-ink: #293ed0;
  --accent-soft: #eff1fe;

  --red: #c4320a;
  --red-soft: #fff1ec;
  --red-ink: #a12a07;
  --amber-soft: #fff6e0;
  --amber-ink: #8a5300;
  --green: #0e9f80;
  --green-soft: #e7f7f2;
  --green-ink: #06695a;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-pop: 0 12px 32px -8px rgb(11 12 16 / 0.18), 0 2px 6px rgb(11 12 16 / 0.06);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-plate: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(48 73 245 / 0.3); border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
svg.icon { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.link { color: var(--accent-ink); font-weight: 550; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration: underline; text-underline-offset: 3px; } }

/* ---------- Shell ---------- */

.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side {
  background: var(--side); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100dvh;
}
/* Flusso's logo (QUA-08): the user's drawing of 17/11, static/brand/flusso-marchio.svg, set by its height. */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px; min-width: 0; }
.brand-logo { display: block; height: 24px; width: auto; flex: none; }
.company { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); font-size: 13.5px; font-weight: 550; }
.company .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.company img.logo { object-fit: contain; background: var(--bg); border: 1px solid var(--line); }
.logo-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.logo-preview { display: block; width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav a svg { color: var(--ink-3); }
.nav a[aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(11 12 16 / 0.05); }
.nav a[aria-current="page"] svg { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .nav a:not([aria-current="page"]):hover { background: #f1f2f5; color: var(--ink); } }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 8px 0 8px 8px; }
.side-foot .avatar { margin-right: 4px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot form { margin: 0; display: contents; }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; color: #fff; flex: none; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.a1 { background: #3049f5; } .a2 { background: #0e9f80; } .a3 { background: #b4489a; } .a4 { background: #c47a0a; }

.main { min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 36px 40px 56px; display: flex; flex-direction: column; gap: 22px; }
.page.narrow { max-width: 780px; padding-bottom: 72px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.page-head p { color: var(--ink-3); margin-top: 6px; font-size: 15px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-3); font-weight: 500; align-self: flex-start; }
.back svg { width: 16px; height: 16px; }

.mobile-bar { display: none; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; padding: 6px; border-radius: 50%; }
.account summary::-webkit-details-marker { display: none; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  padding: 6px; display: flex; flex-direction: column;
}
.account-menu p { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-menu p b { display: block; font-size: 14.5px; }
.account-menu p small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.account-menu a, .account-menu button {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border-radius: 9px; font-size: 15px; cursor: pointer;
}
.account-menu svg { color: var(--ink-3); }
.account-menu form { margin: 0; }
@media (hover: hover) and (pointer: fine) { .account-menu a:hover, .account-menu button:hover { background: var(--hover); } }

/* ---------- Controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  font: 550 14.5px var(--font); cursor: pointer; white-space: nowrap;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-icon { width: 40px; padding: 0; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-icon.btn-sm { width: 34px; padding: 0; }
.btn-wide { width: 100%; height: 46px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--hover); }
  .btn-dark:hover { background: #23252d; }
  .btn-ghost:hover { background: var(--hover); color: var(--ink); }
}

/* ---------- Plate ---------- */

.plate {
  display: inline-flex; align-items: stretch; height: 26px;
  border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; overflow: hidden;
  font: 600 16px/1 var(--font-plate); letter-spacing: 0.07em; color: var(--ink); white-space: nowrap; flex: none;
}
.plate::before { content: ""; width: 9px; background: var(--accent); }
.plate span { display: grid; place-items: center; padding: 1px 8px 0 7px; }
.plate.big { height: 34px; font-size: 22px; border-width: 2px; border-radius: 7px; }
.plate.big::before { width: 12px; }
.plate.big span { padding: 2px 11px 0 9px; }
.plates { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Signals: colour only where something needs attention ---------- */

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill-red { background: var(--red-soft); color: var(--red-ink); }
.pill-urgent { background: var(--red); color: #fff; }
.pill-amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill-green { background: var(--green-soft); color: var(--green-ink); }
.pill-quiet { background: #f3f4f6; color: var(--ink-2); }

.notice { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.notice-red { background: var(--red-soft); border-color: transparent; color: var(--red-ink); font-weight: 500; }
.notice-quiet { background: #f3f4f6; border-color: transparent; align-items: flex-start; }
.notice-quiet p { overflow-wrap: anywhere; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.block-notice { align-items: flex-start; }
.block-notice p { overflow-wrap: anywhere; }
.block-notice .small { font-size: 13.5px; font-weight: 400; }
.block-history { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.block-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.block-history li { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.block-history span, .block-history small { color: var(--ink-3); font-size: 13.5px; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.empty h2 { font-size: 18px; font-weight: 650; }
.empty p { color: var(--ink-3); max-width: 420px; }

/* ---------- Stages ---------- */

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 0; }
.stepper li { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.stepper li::before { content: ""; height: 6px; border-radius: 3px; background: var(--line); }
.stepper li.done::before { background: var(--ink); }
.stepper li.now::before { background: var(--accent); }
.stepper b { font-size: 14px; font-weight: 600; }
.stepper li:not(.done):not(.now) b { color: var(--ink-3); font-weight: 500; }

/* ---------- Practice list ---------- */

.list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; container-type: inline-size; }
/* PRA-14 (DOC-07, 20/11): the WinCar number, in a column of its own before the plate; the vehicle took a
   little of the room of «Cosa serve adesso», to stay as wide as it was. PRA-15 (24/11): «N. e data», with
   the day WinCar created the practice under the number. */
.list-head, .list .item { display: grid; grid-template-columns: 64px minmax(200px, 1.2fr) minmax(150px, 0.8fr) minmax(216px, 1.4fr) 180px; gap: 24px; align-items: center; padding: 0 22px; }
.list-head { height: 42px; font-size: 12.5px; font-weight: 550; color: var(--ink-3); border-bottom: 1px solid var(--line); background: var(--side); }
.list-head span:first-child, .list-head span:last-child { text-align: right; }
.list-head span:first-child { white-space: nowrap; }
.list .item { min-height: 84px; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); transition: background-color 150ms ease; }
.list .item:last-child { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .list .item:hover { background: var(--hover); } }
/* The vehicle takes the number's column too: the number on the plate's line, the customer under the
   plate. The number is right-aligned in figures of one width: the plates start at the same place. */
.list .vehicle { grid-column: span 2; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 24px; row-gap: 7px; align-items: center; justify-items: start; min-width: 0; }
.list .vehicle > .pnum { grid-column: 1; grid-row: 1; justify-self: stretch; }
.list .vehicle > .plate, .list .vehicle > .pill { grid-column: 2; grid-row: 1; }
.list .vehicle > .who { grid-column: 2; grid-row: 2; }
/* The day, as the number above it: right-aligned in figures of one width. */
.list .vehicle > .pdate { grid-column: 1; grid-row: 2; justify-self: stretch; min-width: 0; font-size: 13px; line-height: 20px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pnum { min-width: 0; font-size: 15px; font-weight: 600; line-height: 26px; color: var(--ink-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.list .who { max-width: 100%; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .who span { color: var(--ink-3); }
.list .stage { display: flex; flex-direction: column; gap: 8px; }
.list .item .stage { padding: 0; border: 0; } /* the stages of «Oggi» (.stage, below) are another thing */
.list .stage .name { font-size: 14.5px; font-weight: 550; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 200px; }
.steps i { height: 5px; border-radius: 3px; background: var(--line); }
.steps i.done { background: var(--ink); }
.steps i.now { background: var(--accent); }
.list .todo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.list .todo .what { font-size: 15px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.list .todo .what.quiet { color: var(--ink-3); font-weight: 500; }
.list .todo .meta { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.list .todo .meta .late, .list .todo .meta b { white-space: nowrap; }
.list .todo .meta b { color: var(--ink); font-weight: 600; }
.list .todo .meta .late { color: var(--red-ink); font-weight: 600; }
.list .signals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

@container (max-width: 860px) {
  .list-head { display: none; }
  .list .item {
    grid-template-columns: minmax(0, 1fr); gap: 10px 12px; padding: 16px;
    grid-template-areas: "vehicle" "signals" "todo" "stage";
  }
  /* The cards: the number before the plate, on its line, in a slot as wide in every card, and the day at
     the end of it; the customer and the rest of the card full width under them. */
  .list .vehicle { grid-area: vehicle; grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 10px; }
  .list .vehicle > .who { grid-column: 1 / -1; }
  .list .vehicle > .pdate { grid-column: 3; grid-row: 1; align-self: center; }
  .list .todo { grid-area: todo; }
  .list .signals { grid-area: signals; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .list .signals:empty { display: none; }
  .list .stage { grid-area: stage; flex-direction: row; align-items: center; justify-content: space-between; }
  .list .steps { width: 120px; }
}

/* List tools (PRA-04): search, filters, views, active filters, order, pages. */
.toolbar { display: flex; gap: 10px; align-items: center; }
.search { position: relative; flex: 1; max-width: 520px; margin: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 42px; border-radius: var(--radius); border: 1px solid var(--line-2);
  font: 400 15px var(--font); color: var(--ink); background: var(--bg); transition: border-color 150ms ease, box-shadow 150ms ease;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }
.search input::placeholder { color: #9aa0ad; }
.today-search .search { max-width: 520px; }
.btn .count { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; font-weight: 550; max-width: 100%;
  touch-action: manipulation; transition: background-color 150ms ease;
}
.chip svg { width: 15px; height: 15px; flex: none; }
@media (hover: hover) and (pointer: fine) { .chip:hover { background: #e2e6fe; } }
.chip-clear { font-size: 13.5px; font-weight: 550; color: var(--ink-3); padding: 0 4px; }
.toolbar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
/* The order (PRA-15): «Ordinate per …» opens the choices; the arrow turns the order round. */
.sort { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort-by, .sort-way {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
  cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.sort-by b { color: var(--ink); font-weight: 550; }
.sort-way { color: var(--ink-2); font-weight: 550; }
.sort-by:active, .sort-way:active { transform: scale(0.98); }
.sort-by:focus-visible, .sort-way:focus-visible { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
@media (hover: hover) and (pointer: fine) { .sort-by:hover, .sort-way:hover { background: var(--hover); } }
.sort-by svg, .sort-way svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 560px) {
  /* The phone: the choice as wide as the page, the arrow alone beside it (its words are read by a screen
     reader, and are in the choices). */
  .sort { width: 100%; flex-wrap: nowrap; }
  .sort-by { flex: 1; min-width: 0; min-height: 44px; }
  .sort-by > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .sort-by svg:last-child { margin-left: auto; }
  .sort-way { flex: none; width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .sort-way svg { width: 18px; height: 18px; }
  .sort-way > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) { .sort-by, .sort-way { transition: none; } }
/* A choice that is a link, with what it does beside its name. */
a.option:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { a.option:not(.option-now):hover { background: #e9eaee; } }
.option .quiet { font-size: 14px; font-weight: 450; color: var(--ink-3); text-align: right; }
.option-now .quiet { color: rgb(255 255 255 / 0.72); }
/* A part of the page on its way (a link in place): dimmed only when it takes a while. */
main[aria-busy="true"] .list, .cal[aria-busy="true"] .cal-row { opacity: 0.55; transition: opacity 150ms ease 150ms; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend-note { font-size: 13.5px; color: var(--ink-3); }
.pager { display: flex; gap: 8px; }

.sheet-wide { width: min(600px, calc(100% - 32px)); }
.filters .filter-block { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.filters legend, .filters .legend { font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.filters .legend { margin-bottom: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { position: relative; display: inline-flex; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.check input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.check input:focus-visible + span { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.filter-group { border: 1px solid var(--line); border-radius: var(--radius); }
.filter-group summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 550; touch-action: manipulation;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 150ms var(--ease-out); }
.filter-group[open] summary::after { transform: rotate(-135deg); }
.filter-group .count { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-weight: 650; }
.filter-group .checks { padding: 2px 14px 14px; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit input { max-width: 120px; }
.with-unit span { font-size: 14.5px; color: var(--ink-3); }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; position: sticky; bottom: -20px; background: var(--bg); padding: 10px 0 0; margin-top: 4px; }

/* ---------- Practice card ---------- */

.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.head-id { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.head-id h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.head-id .who { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-3); flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { all: unset; cursor: pointer; padding: 10px 2px; margin-right: 18px; font-size: 15px; font-weight: 550; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button .count { font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red-soft); color: var(--red-ink); display: inline-grid; place-items: center; padding: 0 6px; font-weight: 650; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button:focus-visible { box-shadow: 0 2px 0 0 var(--accent); border-radius: 0; }

[role="tabpanel"] > .item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
[role="tabpanel"] > .item:last-child { border-bottom: 0; }
.item .name { font-size: 16px; font-weight: 550; }
.item .note { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.item .note.bad { color: var(--red-ink); font-weight: 550; }

/* The label keeps 180px for its text (120px on the phone), and some room before the value. */
.facts { display: grid; grid-template-columns: 196px 1fr; margin: 0; }
.facts dt, .facts dd { padding: 13px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 15px; }
.facts dt { color: var(--ink-3); padding-right: 16px; }
.facts dd { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

.history { list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-direction: column; gap: 16px; }
.history li { font-size: 15px; overflow-wrap: anywhere; }
.history time { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.note-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0 18px; }
.note-form textarea { width: 100%; min-height: 64px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; font: 400 15.5px var(--font); color: var(--ink); resize: vertical; }
.note-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }
.note-card { padding: 10px 12px; border-radius: var(--radius); background: var(--amber-soft); color: var(--ink); overflow-wrap: anywhere; }

.block { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }

/* «Cosa serve adesso» (PRA-06), as in the approved card. */
.next-up { padding: 22px 24px; border-radius: var(--radius-lg); background: var(--ink); color: #fff; display: flex; flex-direction: column; gap: 16px; }
.next-up .label { font-size: 13.5px; color: #a7acb8; font-weight: 500; }
.next-up .what { font-size: 23px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
.next-up .what.quiet { color: #c9ccd5; font-weight: 500; }
.next-up .when { font-size: 14.5px; color: #c9ccd5; margin-top: 6px; }
.next-up .late { color: #ffb4a0; font-weight: 600; }
.next-up .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-light { background: #fff; border-color: #fff; color: var(--ink); }
.btn-on-dark { background: transparent; border-color: #3a3d47; color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn-light:hover { background: #eceef2; } .btn-on-dark:hover { background: #1b1d24; } }

.handoff { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--side); font-size: 14px; }
.handoff dt { color: var(--ink-3); }
.handoff dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- Status change: the sheet of choices (mockup «telefono», two taps) ---------- */

.flash { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--green-soft); color: var(--green-ink); font-size: 15px; font-weight: 500; }
.flash p { display: flex; gap: 8px; align-items: flex-start; }
.flash svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.flash:has(.flash-warning) { background: var(--amber-soft); color: var(--amber-ink); }
.flash:has(.flash-error) { background: var(--red-soft); color: var(--red-ink); }
.tab-foot:has(form) { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wincar-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f3f4f6; color: var(--ink-2); font-size: 12px; font-weight: 600; }

.sheet {
  margin: auto; width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 20px; padding: 20px;
  background: var(--bg); color: var(--ink); box-shadow: 0 24px 64px rgb(11 12 16 / 0.22);
}
.sheet::backdrop { background: rgb(11 12 16 / 0.32); }
.sheet:popover-open { transition: opacity 160ms ease-out, transform 220ms var(--ease-out); }
@starting-style { .sheet:popover-open { opacity: 0; transform: translateY(8px); } }
.sheet form { display: flex; flex-direction: column; gap: 14px; }
.sheet h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 50px; padding: 12px 16px; border-radius: var(--radius-lg); background: #f2f3f5;
  font-size: 16px; font-weight: 500; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.option:focus-visible { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
button.option:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { button.option:hover { background: #e9eaee; } }
.option-now { background: var(--ink); color: #fff; cursor: default; }
.option-bad { background: var(--red-soft); color: var(--red-ink); justify-content: center; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { button.option-bad:hover { background: #ffe4da; } }
.redo { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.redo label { font-size: 14px; font-weight: 550; color: var(--ink-2); }
.redo label small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.redo textarea {
  width: 100%; min-height: 64px; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 12px 14px; font: 400 15.5px var(--font); color: var(--ink); resize: vertical;
}
.redo textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }
.right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.item-main { min-width: 0; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }


/* «Carica» (DOC-03, DOC-06). The rows of small pictures and the sheet's list of files of
   before DOC-06 are gone (18/11): the «Documenti» tab and the window over the page show them. */
.upload { display: inline-flex; gap: 8px; }
.upload label { cursor: pointer; }
.upload label:focus-within { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.upload.is-sending { opacity: 0.55; pointer-events: none; }
.option-upload { justify-content: center; gap: 8px; font-weight: 600; }
.option-upload svg, .upload svg { width: 18px; height: 18px; }
.sheet .upload { display: flex; }
.sheet .upload label { flex: 1; }
.only-sm { display: none; }
.option small { font-size: 13px; font-weight: 500; color: var(--amber-ink); }
.option-now small { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: rgb(255 255 255 / 0.72); }
.option-now svg { width: 16px; height: 16px; }

/* ---------- Tasks (TSK): the card's «Task» tab and «I miei task» ---------- */

.nav a .n { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 550; }
.tabs button .count.quiet { background: #f0f1f4; color: var(--ink-2); }
.task-mark { display: inline-grid; place-items: center; flex: none; color: var(--ink-3); }
.task-mark svg { width: 20px; height: 20px; }
.task-mark.is-in_corso { color: var(--accent); }
.task-mark.is-bloccato { color: var(--amber-ink); }
.task-mark.is-completato { color: var(--green); }
[role="tabpanel"] > .item.task { justify-content: flex-start; align-items: flex-start; }
.item.task { scroll-margin-top: 76px; }
.item.task .task-mark { margin-top: 1px; }
.item.task .item-main { flex: 1; }
.item.task .name { overflow-wrap: anywhere; }
.item.task .right { margin-left: auto; }
.item .note .late { color: var(--red-ink); font-weight: 600; }
.item .note .today { color: var(--ink); font-weight: 600; }
.item .note.desc { color: var(--ink-2); overflow-wrap: anywhere; }
.item .note.origin { font-size: 13px; }
.tab-foot { padding: 14px 0 2px; }
.done-tasks { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 6px; }
.done-tasks summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 550; color: var(--ink-3); touch-action: manipulation;
}
.done-tasks summary::-webkit-details-marker { display: none; }
.done-tasks summary span { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #f0f1f4; color: var(--ink-2); display: inline-grid; place-items: center; }
.done-tasks summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 150ms var(--ease-out); }
.done-tasks[open] summary::after { transform: rotate(45deg); }
.done-tasks ul { list-style: none; margin: 0; padding: 0; }
.done-tasks li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.done-tasks li:last-child { border-bottom: 0; }
.done-tasks .name { font-size: 15px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }
.done-tasks .note { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

/* «Tra colleghi» (TSK-07): the tasks of no practice, as in the approved drawing
   (docs/mockup/giro-task.html). The tick is the program's own, the one of the documents. */
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 22px; align-items: start; }
.colleague-tasks .views { margin: 16px 20px 10px; }
.colleague-tasks .empty { border: 0; padding: 28px 20px 32px; }
.colleague-tasks .empty h3 { font-size: 17px; font-weight: 650; }
.colleague-list { list-style: none; margin: 0; padding: 0; }
.colleague-task { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; padding: 13px 20px; align-items: start; scroll-margin-top: 76px; }
.colleague-task + .colleague-task { border-top: 1px solid var(--line); }
.colleague-task .tick { width: auto; min-height: 0; padding: 0; }
.colleague-task span.tick .box { color: var(--ink-3); }
.colleague-task span.tick .box svg { opacity: 1; }
.colleague-task .tick.is-done .box { background: var(--ink); border-color: var(--ink); color: #fff; }
.colleague-main { min-width: 0; }
.colleague-main .what { font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.colleague-main .what.is-closed { color: var(--ink-3); text-decoration: line-through; }
.colleague-main .meta { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.colleague-main .meta b { color: var(--ink); font-weight: 600; }
.colleague-main .meta .late { color: var(--red-ink); font-weight: 600; }
.colleague-main .meta .today { color: var(--ink); font-weight: 600; }
.colleague-main .meta.note { color: var(--ink-2); }
.colleague-task .act { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.colleague-tasks .list-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.colleague-form { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.colleague-form > .btn { align-self: flex-start; }
.people { border: 0; margin: 0; padding: 0; min-width: 0; }
.people legend { font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 12px 4px 5px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 550; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.person-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.person-chip .avatar { width: 24px; height: 24px; font-size: 9.5px; }
.person-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.person-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
@media (hover: hover) and (pointer: fine) { .person-chip:hover { border-color: var(--ink-3); } }
@media (max-width: 960px) { .board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .colleague-tasks .views { margin: 14px 16px 8px; }
  .colleague-task { grid-template-columns: 24px minmax(0, 1fr); padding: 13px 16px; }
  .colleague-task .act { grid-column: 2; justify-content: flex-start; }
  .colleague-tasks .list-foot { padding: 12px 16px 14px; }
  .colleague-form { padding: 0 16px 16px; }
}

.page-head .late { color: var(--red-ink); font-weight: 600; }
.views { display: inline-flex; gap: 4px; padding: 4px; background: #f3f4f6; border-radius: 12px; overflow-x: auto; max-width: 100%; align-self: flex-start; }
.views a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--ink-2); white-space: nowrap; touch-action: manipulation; }
.views a span { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.views a[aria-current="page"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgb(11 12 16 / 0.08), 0 0 0 1px rgb(11 12 16 / 0.04); }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); overflow: hidden; }
.group-label { display: flex; align-items: center; gap: 6px; padding: 14px 20px 6px; font-size: 13px; font-weight: 550; color: var(--ink-3); }
.rows + .group-label { border-top: 1px solid var(--line); }
.group-label svg { width: 15px; height: 15px; }
.group-label.late { color: var(--red-ink); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row-link { display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: center; padding: 13px 20px; transition: background-color 150ms ease; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .row-link:hover { background: var(--hover); } }
.row-plate { justify-self: start; }
/* «Oggi» and the tasks (PRA-14): the WinCar number, then the plate, then what to do. */
.row-link.numbered { grid-template-columns: 56px 112px minmax(0, 1fr) auto; }
.row-link.numbered > .pnum { grid-column: 1; }
.row-link.numbered > .row-plate { grid-column: 2; }
.row-link.numbered > .row-text { grid-column: 3; }
.row-link.numbered > svg { grid-column: 4; }
.row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-link .what { display: flex; align-items: flex-start; gap: 8px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.row-link .what .task-mark { margin-top: 1px; }
.row-link .what .task-mark svg { width: 18px; height: 18px; }
.row-link .meta { font-size: 13.5px; color: var(--ink-3); padding-left: 26px; overflow-wrap: anywhere; }
.row-link .meta .avatar { vertical-align: -5px; margin-right: 2px; }
.row-link .meta b { color: var(--ink); font-weight: 600; }
.row-link .meta .late { color: var(--red-ink); font-weight: 600; }
.row-link .meta.bad { color: var(--amber-ink); font-weight: 550; }
.nowrap { white-space: nowrap; }
.row-link > svg { color: var(--ink-3); }

.bar-end { display: flex; align-items: center; gap: 2px; }
.bar-icon { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); touch-action: manipulation; }
.bar-icon svg { width: 22px; height: 22px; }
.bar-icon.is-here { color: var(--accent); }
.bar-icon .badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 650; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }

/* ---------- «Oggi» (DSH), as in the approved dashboard mockup ---------- */

.person-head { display: flex; align-items: center; gap: 10px; }
.card-head p .late { color: var(--red-ink); font-weight: 600; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.today-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; }
.card-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.card-head .link { font-size: 14px; white-space: nowrap; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 20px; font-size: 14px; }
.card-empty { padding: 0 20px 18px; color: var(--ink-3); font-size: 14.5px; }
.todo .row-link .meta { padding-left: 0; }
.page-head p a.link { font-weight: 550; }

.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stage { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stage + .stage { border-left: 1px solid var(--line); }
.stage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-radius: 6px; }
.stage-top b { font-size: 15px; font-weight: 600; }
.stage-top span { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.stage .bar { display: block; width: 100%; height: 6px; border-radius: 3px; }
.stage .bar .rest { fill: #c9ccd5; }
.stage .bar.is-empty .rest { fill: var(--line); }
.stage .bar .bad { fill: var(--red); }
.stage .caption { font-size: 13px; color: var(--ink-3); }
.stage a.caption { color: var(--red-ink); font-weight: 600; align-self: flex-start; }
.stage .samples { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stage .samples a { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13px; color: var(--ink-2); max-width: 100%; overflow-wrap: anywhere; }
.stage .samples .plate { height: 22px; font-size: 14px; }
.stage .samples .plate::before { width: 7px; }

.problems a { display: grid; grid-template-columns: 22px 1fr auto 16px; gap: 10px; align-items: center; padding: 12px 20px; transition: background-color 150ms ease; }
.problems .ico { width: 22px; height: 22px; border-radius: 7px; background: var(--red-soft); color: var(--red-ink); display: grid; place-items: center; }
.problems .ico svg { width: 14px; height: 14px; }
.problems .label { font-weight: 550; }
.problems .num { font-weight: 650; font-size: 15px; }
.problems a > svg { color: var(--ink-3); }
.problems a.zero .ico { background: #f3f4f6; color: var(--ink-3); }
.problems a.zero .label, .problems a.zero .num { color: var(--ink-3); font-weight: 500; }

.money { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.money a { background: var(--bg); padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; transition: background-color 150ms ease; }
.money .amount { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.money .what { font-size: 13px; color: var(--ink-3); }
.money .bad .amount { color: var(--red-ink); }
@media (hover: hover) and (pointer: fine) { .problems a:hover, .money a:hover { background: var(--hover); } .stage-top:hover b, .stage .samples a:hover { text-decoration: underline; text-underline-offset: 3px; } }

@media (max-width: 1200px) { .today-grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .stages { grid-template-columns: 1fr 1fr; }
  .stage + .stage { border-left: 0; }
  .stage:nth-child(2n) { border-left: 1px solid var(--line); }
  .stage:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .card-head, .card-foot { padding-left: 16px; padding-right: 16px; }
  .card-empty { padding: 0 16px 16px; }
  .stage { padding: 14px 16px 16px; }
  .problems a { padding: 12px 16px; }
  .money a { padding: 14px 16px; }
}

/* ---------- Money: sums of the list and «Soldi» of «Oggi» in euros (IMP-06, DSH-04) ---------- */
.sums { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-size: 14px; color: var(--ink-3); }
.sums b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.sums .bad, .sums .bad b { color: var(--red-ink); }
/* The margin says how many invoiced practices it is of (30/11); on a phone, on its own line. */
.sums small { font-size: inherit; white-space: nowrap; }
.sums small::before { content: "· "; }
@media (max-width: 419px) {
  .sums-margin { flex-basis: 100%; }
  .sums small { display: block; }
  .sums small::before { content: none; }
}
.money .how-many { font-size: 13px; color: var(--ink-3); }
.money-more { display: block; padding: 12px 20px; font-size: 13.5px; color: var(--ink-3); border-top: 1px solid var(--line); }
.money-more b { color: var(--ink); font-weight: 650; }
@media (max-width: 560px) { .money-more { padding: 12px 16px; } }
@media (hover: hover) and (pointer: fine) { .money-more:hover { background: var(--hover); } }

/* ---------- «Impostazioni» (ADM) ---------- */

.panel-form { padding: 4px 20px 20px; }
.panel-links { display: flex; gap: 8px; flex-wrap: wrap; }
.user-row { grid-template-columns: 28px 1fr auto; }
.user-row .meta { padding-left: 0; }
.panel-card + .notice, .notice + .panel-card { margin-top: 0; }
.log-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; overflow-wrap: anywhere; }
.log-row span { color: var(--ink-2); }
.log-row small { color: var(--ink-3); font-size: 13px; }
@media (max-width: 560px) {
  .panel-form { padding: 4px 16px 16px; }
  .log-row { padding: 12px 16px; }
  .row-link.user-row { grid-template-columns: 28px 1fr auto; }
.user-row .meta { padding-left: 0; }
  .row-link.user-row .row-text { grid-column: 2; }
  .row-link.user-row > svg { grid-column: 3; grid-row: 1; }
}

/* ---------- A colleague's change (INF-06) ---------- */

.live-note {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px;
  border-radius: 14px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: 0 12px 32px rgb(11 12 16 / 0.25);
}
.live-note[hidden] { display: none; }

/* ---------- Notices (AVV-01) ---------- */

.notices form { margin: 0; }
.notices button.row-link { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.notices .row-link .what, .notices .row-link .meta { padding-left: 0; }
.notices .row-link.is-unread .what { font-weight: 700; }
.notices .row-link:not(.is-unread) .what { font-weight: 450; color: var(--ink-2); }
.notices .dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--ink); }
.panel-form .subhead { font-size: 15px; font-weight: 650; margin-top: 8px; }

/* ---------- The customer area, office side (phase 6, CLI-02, CLI-05) ---------- */

.customer-link .item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.customer-link .item .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.customer-link .item .note { overflow-wrap: anywhere; }
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.chat li { max-width: 88%; display: flex; flex-direction: column; gap: 2px; }
.chat .chat-text { padding: 10px 14px; border-radius: 16px; font-size: 15.5px; overflow-wrap: anywhere; background: #f3f4f6; color: var(--ink); }
.chat li.from-office { align-self: flex-end; align-items: flex-end; }
.chat li.from-office .chat-text { background: var(--accent-soft); }
.chat li.is-new .chat-text { box-shadow: 0 0 0 2px var(--accent); }
.chat time { font-size: 13px; color: var(--ink-3); }
.chat .chat-empty { max-width: none; }
.link-box { display: flex; gap: 10px; align-items: stretch; }
.link-box-text { flex-direction: column; align-items: flex-start; }
.link-url, .link-message { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; font: 400 15px var(--font); color: var(--ink); background: var(--bg); }
.link-url { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.link-message { min-height: 180px; resize: vertical; line-height: 1.5; }
/* The customer's email address (13/11): long ones wrap instead of widening the page. */
.link-email p, .link-email b { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 600px) {
  .link-box:not(.link-box-text) { flex-direction: column; }
  .chat li { max-width: 96%; }
}

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 32px; }
.form-tight { display: flex; flex-direction: column; gap: 16px; }
.section { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.section > legend { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; padding: 0; margin-bottom: 14px; }
.section.notice { border: 1px solid var(--accent); background: var(--accent-soft); padding: 18px; }
.section.notice > legend { float: left; width: 100%; margin-bottom: 0; }
.hint { font-size: 14px; color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field > label, .field > .label { font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 0; }
.field input, .field select, .auth-card input {
  width: 100%; height: 46px; border-radius: var(--radius); border: 1px solid var(--line-2);
  padding: 0 14px; font: 400 15.5px var(--font); color: var(--ink); background: var(--bg);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field select { appearance: none; padding-right: 40px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }
.field textarea { width: 100%; min-height: 64px; border-radius: var(--radius); border: 1px solid var(--line-2); padding: 12px 14px; font: 400 15.5px var(--font); color: var(--ink); background: var(--bg); resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }
.field input:focus, .field select:focus, .auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }
.field input::placeholder { color: #9aa0ad; }
.field input.upper { text-transform: uppercase; }
.field input.upper::placeholder { text-transform: none; }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.field .error { color: var(--red-ink); font-size: 13.5px; font-weight: 500; }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: #f3f4f6; border-radius: 12px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; height: 38px; border-radius: 9px; font-size: 14.5px; font-weight: 550; color: var(--ink-2); transition: background-color 150ms ease, color 150ms ease; }
.seg input:checked + span { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgb(11 12 16 / 0.08), 0 0 0 1px rgb(11 12 16 / 0.04); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.3); }

.choices { display: flex; flex-direction: column; gap: 8px; clear: both; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.choice input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.choice b { display: block; font-weight: 600; }
.choice small { color: var(--ink-3); font-size: 13.5px; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* AVV-06: server and port of the mailbox only with «Altro», with no script; a browser
   without :has() shows them always. */
@supports selector(:has(*)) {
  .mailbox-form:not(:has(input[name="provider"][value="ALTRO"]:checked)) .mailbox-altro { display: none; }
}

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* ---------- Sign-in and other plain pages ---------- */

.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--side); }
.auth-card { width: min(420px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.auth-card p { color: var(--ink-2); }
.auth-card label { font-size: 14px; font-weight: 550; color: var(--ink-2); }
.auth-card .helptext, .auth-card .helptext ul { font-size: 13px; color: var(--ink-3); }
.auth-foot { text-align: center; font-size: 14.5px; }
.auth .brand { padding: 0; }
.auth .brand-logo { height: 32px; }

/* ---------- Phone ---------- */

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 10; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
    background: rgb(255 255 255 / 0.92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand { padding: 10px; }
  .page { padding: 20px 16px 40px; gap: 16px; }
  .page-head h1, .head-id h1 { font-size: 25px; }
  .next-up { padding: 18px; }
  .next-up .what { font-size: 20px; }
  .facts { grid-template-columns: 128px 1fr; }
  .facts dt { padding-right: 8px; }
  .hide-sm { display: none !important; }
  .only-sm { display: inline; }
  input, select, textarea { font-size: 16px !important; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sheet { width: 100%; max-width: none; margin: auto 0 0; max-height: 85dvh; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  @starting-style { .sheet:popover-open { transform: translateY(100%); } }
  .form-actions .btn { flex: 1; }
  [role="tabpanel"] > .item { flex-wrap: wrap; }
  .item.task .item-main { flex-basis: calc(100% - 34px); }
  .item.task .right { margin-left: 34px; justify-content: flex-start; }
  .row-link { grid-template-columns: 1fr auto; row-gap: 8px; padding: 12px 16px; }
  .toolbar .btn { flex: none; }
  .search { max-width: none; }
  .sheet-actions { bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .row-link .row-plate, .row-link .row-text { grid-column: 1; }
  .row-link > svg { grid-column: 2; grid-row: 1 / span 2; }
  /* PRA-14: the number and the plate on the first line, what to do under them, full width. */
  .row-link.numbered { grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 10px; }
  .row-link.numbered > .pnum { grid-column: 1; grid-row: 1; }
  .row-link.numbered > .row-plate { grid-column: 2; grid-row: 1; }
  .row-link.numbered > .row-text { grid-column: 1 / span 2; grid-row: 2; }
  .row-link.numbered > svg { grid-column: 3; grid-row: 1 / span 2; }
  .group-label { padding: 12px 16px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .nav a, .seg span, .option, .sheet:popover-open, .row-link, .problems a, .money a, .done-tasks summary::after, .chip, .check span, .filter-group summary::after { transition: none; }
  .btn:active, button.option:active { transform: none; }
}

/* ---------- «Tipi di pratica» e checklist (ADM-01, ADM-02) ---------- */
.edit-row { display: flex; align-items: center; gap: 10px; padding: 12px 20px; }
.edit-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.edit-main span { color: var(--ink-3); font-size: 13.5px; }
a.edit-main b { color: var(--accent-ink); }
.row-actions { display: flex; gap: 6px; flex: none; }
.star { color: var(--amber-ink); }
@media (max-width: 560px) { .edit-row { flex-wrap: wrap; padding: 12px 16px; } .edit-main { flex-basis: 100%; } }

/* ---------- Soldi on the card (phase 3) ---------- */
.money-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; padding: 6px 0 2px; }
.money-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.money-line span { font-size: 15px; color: var(--ink-3); }
.money-line b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-line b.late { color: var(--red-ink); }
.money-title { font-size: 15px; font-weight: 650; color: var(--ink-2); margin: 22px 0 4px; }
.item.invoice { align-items: flex-start; }
.item.invoice .item-main { flex: 1; overflow-wrap: anywhere; }
.item.invoice .right { align-items: flex-start; }
.money-dues { list-style: none; margin: 4px 0 2px; padding: 0; font-size: 14px; color: var(--ink-2); }
.money-dues li.late { color: var(--red-ink); font-weight: 600; }
.money-collection { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.money-collection span { flex: 1; min-width: 0; }
.money-dues-form { gap: 10px; }
.money-dues-form .due-row { margin-left: 28px; }
@media (max-width: 560px) {
  .money-sum { grid-template-columns: 1fr; }
  .item.invoice .item-main { flex-basis: 100%; }
  .item.invoice .right { margin-left: 0; justify-content: flex-start; }
  .money-dues-form .due-row { margin-left: 0; }
}
.money-dues-form > legend { font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 0; margin-bottom: 4px; }

/* ---------- Customer area (phase 6) ---------- */
/* The pages of the customer's link (CLI-02..CLI-05): a phone first, one column, no menu. */
.c-body { background: var(--side); }
.c-shell {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.c-main { width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; }
.c-top { display: flex; align-items: center; gap: 10px; padding: 4px 2px; font-size: 15px; font-weight: 600; min-width: 0; }
.c-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
img.c-logo { object-fit: contain; background: var(--bg); border: 1px solid var(--line); }
.c-company { overflow-wrap: anywhere; }
.c-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.c-card h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.c-hero { align-items: flex-start; }
.c-hero h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.c-hero > p { color: var(--ink-2); }
.c-hero .btn { margin-top: 4px; }
.c-form { display: flex; flex-direction: column; gap: 14px; width: 100%; }
/* The plate as it is written on the car; the phone rule keeps inputs at 16px, this one is bigger. */
.field .c-plate-input { height: 56px; text-align: center; text-transform: uppercase; letter-spacing: 0.08em; font: 600 24px/1 var(--font-plate) !important; }
.field .c-plate-input::placeholder { color: #b4b9c4; }
.c-card .flash, .c-notice { width: 100%; }

.c-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.c-stages li { position: relative; padding: 0 0 16px 30px; color: var(--ink-3); }
.c-stages li:last-child { padding-bottom: 0; }
.c-stages li::before { content: ""; box-sizing: border-box; position: absolute; left: 3px; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); }
.c-stages li::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: -2px; width: 2px; border-radius: 1px; background: var(--line); }
.c-stages li:last-child::after { display: none; }
.c-stages li.done { color: var(--ink-2); }
.c-stages li.done::before { background: var(--ink); border-color: var(--ink); }
.c-stages li.done::after { background: var(--ink); }
.c-stages li.now { color: var(--ink); }
.c-stages li.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.c-stages b { display: block; font-size: 15.5px; font-weight: 500; }
.c-stages li.now b { font-weight: 650; }
.c-stages p { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }

.c-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.c-doc { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.c-doc-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.c-doc-note, .c-doc-hint { font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.c-doc-why { font-size: 14.5px; font-weight: 550; color: var(--red-ink); overflow-wrap: anywhere; }
.c-upload { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.c-upload label { height: 50px; font-size: 16px; font-weight: 600; border-radius: 14px; border-color: transparent; background: #f2f3f5; }
@media (hover: hover) and (pointer: fine) { .c-upload label:hover { background: #e9eaee; } }
.c-done { display: flex; align-items: center; gap: 8px; color: var(--green-ink); font-weight: 550; }

.c-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.c-msg { align-self: flex-start; max-width: 88%; padding: 10px 12px; border-radius: 16px 16px 16px 6px; background: #f2f3f5; }
.c-msg p { white-space: pre-line; overflow-wrap: anywhere; }
.c-msg small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.c-msg-mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: var(--accent-soft); }
.c-write { display: flex; flex-direction: column; gap: 8px; }
.c-write label { font-size: 14px; font-weight: 550; color: var(--ink-2); }
.c-write textarea { width: 100%; min-height: 88px; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font: 400 16px/1.45 var(--font); color: var(--ink); background: var(--bg); resize: vertical; }
.c-write textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(48 73 245 / 0.12); }

.c-expiry { font-size: 13.5px; color: var(--ink-3); text-align: center; }
.c-foot { width: min(560px, 100%); margin-top: auto; }
.c-privacy { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.c-privacy b { font-weight: 600; color: var(--ink-2); }
.c-by { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.c-by img { width: 16px; height: 16px; margin-top: 1.5px; flex: none; }

/* ---------- Assistant: «Chiedi a Flusso» (phase 2b) ---------- */
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); } }

/* The bar at the bottom of the card and of «Oggi»: the page leaves room for it */
.page.with-ask { padding-bottom: 128px; }
.ask-bar {
  position: fixed; left: 248px; right: 0; bottom: 0; z-index: 10; margin: 0;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(rgb(255 255 255 / 0), var(--bg) 40%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.ask-bar > * { pointer-events: auto; }
.ask-field {
  width: min(732px, 100%); min-height: 52px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg);
  box-shadow: 0 8px 24px -10px rgb(11 12 16 / 0.25); display: flex; align-items: center; gap: 10px; padding: 0 6px 0 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ask-field > svg { color: var(--accent); flex: none; }
.ask-field input { flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink); }
.ask-field input::placeholder { color: #8b91a0; }
.ask-field input:focus-visible { box-shadow: none; } /* the field shows the focus around it */
.ask-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 24px -10px rgb(11 12 16 / 0.25); }
.ask-field .btn-icon { width: 38px; height: 38px; border-radius: 11px; flex: none; }
.ask-wait { font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: var(--bg); padding: 2px 10px; border-radius: 8px; }
.ask-wait[hidden] { display: none; }
.is-asking .ask-field, .is-asking textarea { opacity: 0.6; }
.ask-bar ~ .live-note { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

/* The conversation */
.ask-title { display: flex; align-items: center; gap: 10px; }
.ask-title svg { color: var(--accent); width: 26px; height: 26px; }
.ask-chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.exchange { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
.bubble { max-width: min(560px, 92%); padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble-me { align-self: flex-end; background: #f1f2f5; border-bottom-right-radius: 6px; }
.bubble-ai { align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 6px; display: flex; flex-direction: column; gap: 10px; }
/* The answer read at a glance (17/11): paragraphs, bold and real lists, never their marks.
   list-style is inherited from the chat's own list, which has none: set again here. */
.reply { display: flex; flex-direction: column; gap: 8px; }
.reply p, .reply ul, .reply ol { margin: 0; }
.reply ul, .reply ol { padding-left: 1.3em; }
.reply ul { list-style: disc; }
.reply ol { list-style: decimal; }
.reply li ul { list-style: circle; }
.reply li + li, .reply li > ul, .reply li > ol { margin-top: 4px; }
.reply li::marker { color: var(--ink-3); }
.reply strong { font-weight: 600; }
.bubble-notice { align-self: flex-start; max-width: min(560px, 92%); }
.bubble-notice p { display: flex; gap: 8px; align-items: flex-start; }
.bubble-notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.notice-amber { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); font-weight: 500; }
.proposal { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.proposal-head { font-size: 14px; font-weight: 600; }
.change-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.change-list li { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.change-list li > svg { color: var(--accent); flex: none; width: 18px; height: 18px; margin-top: 2px; }
.change-list .from { color: var(--ink-3); }
.proposal.is-annullata .change-list, .proposal.is-scaduta .change-list { color: var(--ink-3); }
.proposal.is-annullata .change-list li > svg, .proposal.is-scaduta .change-list li > svg { color: var(--ink-3); }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-row form { margin: 0; }
.fine { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); }
.fine svg { width: 15px; height: 15px; flex: none; }
.fine.is-done { color: var(--green-ink); }
.ask-empty { display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions form { margin: 0; }
.suggestions .btn { height: auto; min-height: 36px; padding: 7px 12px; white-space: normal; text-align: left; }
.composer {
  position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgb(255 255 255 / 0), var(--bg) 24%);
}
.composer textarea {
  width: 100%; min-height: 52px; max-height: 40dvh; resize: vertical; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.45;
}
.composer textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .btn-icon { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 3px; }
.composer .ask-wait { grid-column: 1 / -1; justify-self: start; padding-left: 0; }
/* «Chiedi a Flusso» by voice (17/11): the browser's own dictation, only where it exists. The
   finger finds the microphone 44 points wide even where it is drawn smaller (the bar); while
   it listens it is red, like any live microphone, with a ring going out. */
.dictate { position: relative; }
.dictate::after { content: ""; position: absolute; inset: -4px; }
.dictate[aria-pressed="true"] { background: var(--red-soft); color: var(--red); }
.dictate[aria-pressed="true"]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--red);
  opacity: 0; animation: dictate-listening 1.6s var(--ease-out) infinite;
}
@keyframes dictate-listening { from { opacity: 0.5; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
.composer:has(> .dictate:not([hidden])) { grid-template-columns: 1fr auto auto; }

/* The conversation over the card and «Oggi» (17/11): as in the mockup, it opens only when used */
.ask-sheet {
  inset: 0 0 0 248px; margin: auto auto 16px; width: min(640px, calc(100% - 48px));
  max-height: min(80dvh, 760px); padding: 0; overflow: hidden;
}
.ask-sheet:popover-open { display: flex; flex-direction: column; }
.ask-sheet-top { display: flex; align-items: center; justify-content: flex-start; gap: 4px; padding: 12px 10px 6px 20px; }
.ask-sheet-top h2 { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ask-sheet-top h2 svg { color: var(--accent); }
.ask-history svg { width: 17px; height: 17px; }
.ask-sheet .ask-chat { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 16px; gap: 16px; }
.ask-sheet .exchange { scroll-margin-top: 8px; }
/* a grid, not the column of the other sheets' forms: the box and «Invia» side by side */
.ask-sheet .composer { display: grid; position: static; padding: 10px 14px 14px 20px; background: var(--bg); border-top: 1px solid var(--line); }
.ask-sheet .composer textarea { min-height: 46px; max-height: 30dvh; resize: none; field-sizing: content; }
.ask-sheet .composer .btn-icon { margin-bottom: 0; }
/* While Flusso thinks: the words at once and, in Flusso's place, the elephant the user drew
   (17/11), with «Sto preparando la risposta…». Its colours are the user's, as variables; the
   sparks' directions are here because the page may not write styles (Content-Security-Policy). */
.exchange.is-pending .bubble-me { white-space: pre-wrap; }
.elephant-loader {
  --elephant-skin: #7462a9; --elephant-ear: #bba8dc; --elephant-eye: #fff; --elephant-wrinkle: #d3c4eb;
  --idea-ink: #876021; --idea-glass: #ffdc89; --idea-spark-1: #d38c20; --idea-spark-2: #e6a230; --idea-spark-3: #ac6c19;
}
.bubble-ai.elephant-loader { flex-direction: row; align-items: center; gap: 12px; color: var(--ink-2); }
.elephant { position: relative; width: 44px; height: 48px; flex: none; margin-top: 10px; }
.elephant span { position: absolute; display: block; }
.elephant__head { inset: 10px 8px 13px; border-radius: 48% 48% 42% 42%; background: var(--elephant-skin); }
.elephant__ear { top: 13px; width: 14px; height: 21px; border: 2px solid var(--elephant-skin); background: var(--elephant-ear); }
.elephant__ear--left { left: 1px; border-radius: 55% 42% 48% 60%; transform: rotate(-15deg); }
.elephant__ear--right { right: 1px; border-radius: 42% 55% 60% 48%; transform: rotate(15deg); }
.elephant__eyes { top: 21px; left: 16px; width: 3px; height: 4px; border-radius: 50%; background: var(--elephant-eye); box-shadow: 9px 0 var(--elephant-eye); animation: elephant-blink 3.6s infinite; }
.elephant__trunk { position: absolute; top: 25px; left: 15px; width: 24px; height: 25px; overflow: visible; transform-origin: 6px 3px; animation: elephant-sway 1.8s ease-in-out infinite; }
.elephant__skin { fill: var(--elephant-skin); }
.elephant__wrinkles { stroke: var(--elephant-wrinkle); stroke-opacity: 0.54; }
.elephant__idea { position: absolute; top: -10px; left: 13px; width: 18px; height: 19px; color: var(--idea-ink); overflow: visible; }
.elephant__glass { fill: var(--idea-glass); }
.elephant__bulb { transform-origin: 9px 10px; animation: elephant-idea-light 0.82s infinite; }
.elephant__spark { opacity: 0; animation: elephant-idea-burst 0.82s cubic-bezier(0.23, 1, 0.32, 1) infinite; }
.elephant__spark:nth-of-type(1) { --dx: 0px; --dy: -7px; fill: var(--idea-spark-1); }
.elephant__spark:nth-of-type(2) { --dx: 7px; --dy: -6px; fill: var(--idea-spark-2); }
.elephant__spark:nth-of-type(3) { --dx: 8px; --dy: -1px; fill: var(--idea-spark-3); }
.elephant__spark:nth-of-type(4) { --dx: 6px; --dy: 5px; fill: var(--idea-spark-2); }
.elephant__spark:nth-of-type(5) { --dx: -7px; --dy: 4px; fill: var(--idea-spark-1); }
.elephant__spark:nth-of-type(6) { --dx: -8px; --dy: -2px; fill: var(--idea-spark-3); }
.elephant__spark:nth-of-type(7) { --dx: -6px; --dy: -6px; fill: var(--idea-spark-2); }
@keyframes elephant-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(10deg); } }
@keyframes elephant-blink { 0%, 72%, 80%, 100% { transform: scaleY(1); } 76% { transform: scaleY(0.25); } }
@keyframes elephant-idea-light {
  0%, 100% { opacity: 0; transform: scale(0.88); }
  12%, 43% { opacity: 1; transform: scale(1); }
  48% { opacity: 1; transform: scale(1.16); }
  52%, 97% { opacity: 0; transform: scale(1.2); }
}
@keyframes elephant-idea-burst {
  0%, 46% { opacity: 0; transform: translate(0, 0); }
  51% { opacity: 1; transform: translate(0, 0); }
  86%, 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
}

/* The history of the conversations (AI-10): rows, not cards, as in the approved mockup */
.talks-list .group-label { padding: 14px 0 6px; }
.talks-list .talks + .group-label { border-top: 0; }
.talks { list-style: none; margin: 0; padding: 0; }
.talks li + li { border-top: 1px solid var(--line); }
.talk {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
  padding: 13px 10px; margin: 0 -10px; border-radius: 12px; transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .talk:hover { background: var(--hover); } .talks li:hover, .talks li:hover + li { border-top-color: transparent; } }
.talk:active { background: #f1f2f5; }
.talk .q { font-size: 15.5px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.talk .meta { grid-column: 1; display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); }
.talk .meta .plate { height: 22px; font-size: 14px; }
.talk .meta .plate::before { width: 7px; }
.talk .meta .plate span { padding: 1px 6px 0 5px; }
.talk .meta .pill { height: 22px; font-size: 12.5px; padding: 0 8px; }
.talk .done { display: inline-flex; align-items: center; gap: 4px; color: var(--green-ink); }
.talk .done svg { width: 14px; height: 14px; }
.talk > svg { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-3); }
.talks-list + .list-foot { margin-top: 4px; }
.empty .suggestions { justify-content: center; margin-top: 6px; }

/* In the history: the request of a change confirmed from the assistant (AI-04) */
.asked { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.asked svg { color: var(--accent); flex: none; width: 15px; height: 15px; margin-top: 2px; }
.asked q { quotes: "«" "»"; }

@media (max-width: 960px) {
  .ask-bar { left: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .page.with-ask { padding-bottom: 112px; }
  .ask-bar ~ .live-note { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .ask-sheet { inset: 0; }
}
@media (max-width: 560px) {
  .ask-sheet { width: 100%; margin: auto 0 0; max-height: 85dvh; }
  .ask-sheet-top { padding: 10px 8px 4px 16px; }
  .ask-sheet .ask-chat { padding: 4px 16px 12px; }
  .ask-sheet .composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)) 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-field { transition: none; }
  .elephant__trunk, .elephant__eyes, .elephant__bulb, .elephant__spark { animation: none; } /* the elephant stands still */
  .dictate[aria-pressed="true"]::before { animation: none; } /* the microphone stays red, without the ring */
}

/* ---------- «Apri da WinCar» on «Nuova pratica» (WIN-03) ---------- */
.wincar-box { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--side); }
.wincar-row { display: flex; gap: 8px; }
.wincar-row input { flex: 1; min-width: 0; }
.wincar-read ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.wincar-read .small, .wincar-read ul { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 560px) { .wincar-row { flex-direction: column; } .wincar-row .btn { width: 100%; } }
/* The practices to choose for WinCar's photos and documents (WIN-08), in «Impostazioni». */
.choose-list { display: grid; margin: 4px 0 12px; border-top: 1px solid var(--line); }
.choose-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.choose-row input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); cursor: pointer; }
.choose-row .name { display: block; font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
.choose-row .note { display: block; font-size: 14px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- Quick actions from the phone (TEL-03): shown under 960 points ---------- */
.on-phone { display: none; }
@media (max-width: 960px) { .on-phone { display: block; } }
.my-statuses { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); }
.my-statuses > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 16px; }
.my-statuses > div + div { border-top: 1px solid var(--line); }
.my-statuses > div > span { min-width: 0; }
.my-statuses small { display: block; font-size: 13px; color: var(--ink-3); }
.my-statuses b { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.my-statuses b.bad { color: var(--red-ink); }
.my-statuses .btn { flex: none; }
.mine-rows .row-link .meta { padding-left: 0; }
.mine-rows .what.quiet { color: var(--ink-3); font-weight: 500; }
.mine-rows .signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }

/* ---------- «Gestione» (ADM-06): who runs the program ---------- */

.gestione-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 40px; border-bottom: 1px solid var(--line); }
.gestione-bar .who { color: var(--ink-3); font-size: 14px; margin-right: 8px; overflow-wrap: anywhere; }
.gestione-bar .brand { padding: 4px 0; }
.brand-area { padding-left: 12px; border-left: 1px solid var(--line-2); font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-2); white-space: nowrap; }
.company-line { display: flex; flex-direction: column; gap: 3px; padding: 13px 20px; }
.company-line .what { font-weight: 550; overflow-wrap: anywhere; }
.company-line .meta { font-size: 13.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.company-line .meta.bad { color: var(--amber-ink); font-weight: 550; }
.form-title { font-size: 17px; font-weight: 650; margin-top: 8px; }
@media (max-width: 760px) { .gestione-bar { padding: 10px 16px; } .gestione-bar .who { display: none; } }
a.company-line { color: inherit; text-decoration: none; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { a.company-line:hover { background: var(--hover); } }
.card-body { padding: 0 20px 18px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sub-warning { flex-direction: row; align-items: flex-start; gap: 8px; margin: 16px 40px 0; background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; font-weight: 500; }
.sub-warning svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
@media (max-width: 760px) { .sub-warning { margin: 12px 16px 0; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); color: inherit; text-decoration: none; min-width: 0; }
.stat b { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--ink-3); }
a.stat.is-here { border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { a.stat:hover { background: var(--hover); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters input[type="search"] { flex: 1 1 220px; min-width: 0; }
.person-line .actions-row { margin-top: 6px; align-items: flex-start; }
.inline-form > summary { list-style: none; cursor: pointer; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.renew, .payment-form { margin-top: 14px; }
.gestione .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.two-steps ol { margin: 0 0 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.qr { margin: 6px 0 10px; }
.qr svg { display: block; width: 220px; max-width: 100%; height: auto; background: #fff; }
.otp-key, .backup-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.backup-codes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* LEG-10: the same verification for the Admins of the companies, on the sign-in card. */
.auth-card .two-steps ol { margin-left: 0; padding-left: 20px; }
.auth-card button.link { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 550; cursor: pointer; touch-action: manipulation; }

/* ---------- «Gestione», phase C (ADM-09): the numbers of the activity ---------- */

.figures { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.figures th, .figures td { padding: 10px 14px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.figures thead th { font-size: 12.5px; font-weight: 550; color: var(--ink-3); background: var(--side); white-space: normal; vertical-align: bottom; }
.figures th[scope="row"], .figures thead th:first-child { text-align: left; }
.figures th[scope="row"] { font-weight: 550; }
.figures th[scope="row"] small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.figures td > span { display: inline-flex; align-items: center; gap: 10px; }
.figures .bar { display: block; flex: none; width: 64px; height: 6px; border-radius: 3px; background: var(--line); }
.figures .bar rect { fill: var(--ink-2); }
.figures .neg, .stat b.neg { color: var(--red-ink); }
.explain { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.explain dt { font-weight: 550; }
.explain dd { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .figures thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .figures, .figures tbody, .figures th, .figures td { display: block; }
  .figures tr { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 4px 18px; padding: 12px 16px; border-top: 1px solid var(--line); }
  .figures th, .figures td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .figures th[scope="row"] { grid-column: 1 / -1; margin-bottom: 2px; }
  .figures th[scope="row"] small { display: inline; margin-left: 6px; }
  .figures td { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .figures td::before { content: attr(data-label); color: var(--ink-3); font-size: 13.5px; }
  .figures td.count { grid-column: auto; justify-content: flex-start; align-items: baseline; gap: 6px; }
  .figures .bar { width: 48px; }
  .explain { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .explain dd { margin-bottom: 10px; }
}

/* ---------- «Gestione», phase C (ADM-09): the risk that a company leaves ---------- */

.risk-line { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px; }
.risk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.risk-head .what { margin-right: auto; font-weight: 600; color: inherit; overflow-wrap: anywhere; }
.signal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 18px; margin: 0; font-size: 13.5px; }
.signal-list div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.signal-list dt { color: var(--ink-3); }
.signal-list dd { margin: 0; overflow-wrap: anywhere; }
.signal-list .pts-1 { color: var(--amber-ink); font-weight: 650; }
.signal-list .pts-2 { color: var(--red-ink); font-weight: 650; }
@media (max-width: 760px) { .risk-line { padding: 14px 16px; } .signal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- «Novità» (ADM-09): the news of the program, for the people of the companies ---------- */

.news-item { padding: 16px 20px; }
.news-item h2 { font-size: 16.5px; font-weight: 550; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.news-item.is-unread h2 { font-weight: 700; }
.news-item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 13.5px; color: var(--ink-3); }
.news-item .news-body { margin-top: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 760px) { .news-item { padding: 14px 16px; } }

/* ---------- «Gestione» (ADM-09): the menu, only the entries the role may use ---------- */

.gestione-nav { display: flex; gap: 4px; padding: 8px 32px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.gestione-nav::-webkit-scrollbar { display: none; }
.gestione-nav a { flex: none; padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--ink-2); white-space: nowrap; touch-action: manipulation; }
.gestione-nav a[aria-current="page"] { background: var(--hover); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .gestione-nav a:not([aria-current="page"]):hover { background: var(--hover); color: var(--ink); } }
@media (max-width: 760px) { .gestione-nav { padding: 6px 10px; } }
.role-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-form select { height: 32px; max-width: 100%; }
/* A part the role may only read (ADM-09): its fields look read only. */
.field input:disabled, .field select:disabled, .field textarea:disabled { background-color: var(--side); color: var(--ink-2); border-color: var(--line); cursor: default; }
.check input:disabled + span { opacity: 0.7; cursor: default; }

/* ---------- DOC-06: the «Documenti» tab in three parts, small pictures, the window ---------- */

.docs > .item:first-of-type { padding-top: 18px; }
.asked-line {
  display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--side);
  touch-action: manipulation; transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.asked-line:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) { .asked-line:hover { background: #f3f4f6; } }
.asked-line:focus-visible { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.asked-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.asked-text { flex: 1; min-width: 0; }
.asked-text b { display: block; font-size: 15.5px; font-weight: 600; }
.asked-text span { font-size: 14px; color: var(--ink-3); }
.asked-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.asked-line > svg:last-child { color: var(--ink-3); }

.part { padding: 26px 0 6px; border-bottom: 1px solid var(--line); scroll-margin-top: 76px; }
.part:last-of-type { border-bottom: 0; }
.part-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.part-head h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; }
.part-head h3 .n { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.part-empty { font-size: 14.5px; color: var(--ink-3); padding: 2px 0 18px; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.grid figure { margin: 0; }
.tile {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: #f1f2f4; outline: 1px solid rgb(11 12 16 / 0.06); outline-offset: -1px; color: var(--ink-3);
  touch-action: manipulation; -webkit-touch-callout: none; transition: transform 120ms var(--ease-out);
}
.tile:active { transform: scale(0.97); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile::after { content: ""; position: absolute; inset: 0; background: rgb(11 12 16 / 0); transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .tile:hover::after { background: rgb(11 12 16 / 0.08); } }
.tile:focus-visible { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.45); }
.tile .tag {
  position: absolute; left: 6px; bottom: 6px; z-index: 1; display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--amber-soft); color: var(--amber-ink);
}
.tile .tag svg { width: 12px; height: 12px; }
.tile .tag.quiet { background: rgb(255 255 255 / 0.92); color: var(--ink-2); }
/* WIN-09: the mark of a photo going to WinCar, where «Interno» sits: white, so that it reads on
   any photo; the state is in the icon's colour and in the words, never in the colour alone. */
.tile .tag.wc { background: rgb(255 255 255 / 0.94); color: var(--ink); box-shadow: 0 1px 2px rgb(11 12 16 / 0.14); white-space: nowrap; max-width: calc(100% - 12px); }
.tile .tag.wc svg { width: 13px; height: 13px; stroke-width: 2.25; }
.tile .tag.wc-in svg { color: var(--green); }
.tile .tag.wc-out svg { color: var(--amber-ink); }
.tile .tag.wc-no { background: var(--red-soft); color: var(--red-ink); }
/* The line under «Fotografie»: where they go and how many are there; on the phone it is also
   the key of the marks, which there show only their icon. */
.wc-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -4px 0 14px; font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.wc-counts { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.wc-counts > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink-2); }
.wc-counts b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.wc-counts svg { width: 14px; height: 14px; stroke-width: 2.25; }
.wc-counts .wc-in svg { color: var(--green); }
.wc-counts .wc-out svg { color: var(--amber-ink); }
.wc-counts .wc-no, .wc-counts .wc-no b { color: var(--red-ink); }
.tile.is-pdf { align-content: center; gap: 8px; background: #f4f5f7; }
.tile.is-pdf svg { width: 28px; height: 28px; }
.tile.is-pdf small { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); }
.grid.with-caption { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 14px 10px; }
.grid.with-caption figcaption { margin-top: 7px; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); font-weight: 500; overflow-wrap: anywhere; }
.grid.with-caption figcaption small { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.part .more { margin: 14px 0 12px; }
.part .more .btn { width: 100%; }

.rows-files { list-style: none; margin: 0; padding: 0; }
.rows-files li + li { border-top: 1px solid var(--line); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; margin: 0 -6px; border-radius: 10px; touch-action: manipulation; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .file-row:hover { background: var(--hover); } }
.file-row:focus-visible { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.file-icon { width: 44px; height: 44px; border-radius: 10px; background: #f1f2f4; display: grid; place-items: center; color: var(--ink-3); flex: none; overflow: hidden; outline: 1px solid rgb(11 12 16 / 0.06); outline-offset: -1px; }
.file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-text { min-width: 0; flex: 1; }
.file-text b { display: block; font-size: 15px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text span { display: block; font-size: 13.5px; color: var(--ink-3); }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; background: #f3f4f6; color: var(--ink-2); font-size: 12.5px; font-weight: 600; flex: none; }
.lock-tag svg { width: 13px; height: 13px; }

/* «Documenti chiesti al cliente», in the «Cliente» tab */
.asked-list > .item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.asked-list > .hint { margin: 4px 0 4px; }
.asked-list > .tab-foot { padding-top: 14px; }
#chiesti { scroll-margin-top: 76px; }
.mini-thumbs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mini-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: #f3f4f6; outline: 1px solid rgb(11 12 16 / 0.06); outline-offset: -1px; color: var(--ink-3); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-thumb svg { width: 20px; height: 20px; }

/* ---------- The documents to tick (DOC-07, approved 20/11) ---------- */
/* A document asked: the box with its name (one place to tap), then the camera and «⋯»; under
   the name its files. Ticked, it arrived, and that is all the row says (the user: no «Da
   guardare» and no «Verifica» on the row). The same rows in «Cliente» and in «Mancano». */
.tick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tick tools" "files files"; align-items: center; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tick-row:last-child { border-bottom: 0; }
.tick-row .tick-form { grid-area: tick; min-width: 0; }
.tick-row .tools { grid-area: tools; display: flex; align-items: center; gap: 2px; }
.tick-row .tools:empty { display: none; }
.tick-row .tools .btn-icon { width: 40px; height: 40px; color: var(--ink-2); }
.tick-row .tools .btn-icon svg { width: 20px; height: 20px; }
.tick-row .mini-thumbs { grid-area: files; margin: 2px 0 6px 38px; }
.tick-row > .in-place-error { grid-column: 1 / -1; margin: 0 0 8px 38px; }
.tick { all: unset; box-sizing: border-box; display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 48px; padding: 8px 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
span.tick, .tick.is-verified { cursor: default; }
.tick .box { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px; border: 1.75px solid #b8bcc6; background: var(--bg); color: #fff; display: grid; place-items: center; transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 120ms var(--ease-out); }
.tick .box svg { width: 16px; height: 16px; stroke-width: 2.75; opacity: 0; transition: opacity 120ms ease-out; }
.tick .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tick .name { font-size: 16px; font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.tick .note { font-size: 14px; color: var(--ink-3); overflow-wrap: anywhere; }
.tick .note.bad { color: var(--red-ink); font-weight: 550; }
.tick .note svg { width: 13px; height: 13px; vertical-align: -1px; margin-right: 3px; }
button.tick:active .box { transform: scale(0.9); }
.tick:focus-visible .box { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
@media (hover: hover) and (pointer: fine) { button.tick:not(.is-verified):hover .box { border-color: var(--ink-2); } }
/* Arrived: black, as the program's other ticks; verified: green, and it stays. */
.tick[aria-checked="true"] .box { background: var(--ink); border-color: var(--ink); }
.tick[aria-checked="true"] .box svg { opacity: 1; }
.tick.is-verified .box { background: var(--green); border-color: var(--green); }
button.tick.is-verified:active .box { transform: none; }
/* Not needed: no box, a dash, the name quiet. Just ticked in «Mancano»: quieter, until the card loads again. */
.tick-row.is-na .box { border-style: dashed; border-color: var(--line-2); color: var(--ink-3); }
.tick-row.is-na .box::before { content: ""; width: 10px; height: 2px; border-radius: 1px; background: currentColor; }
.tick-row.is-na .name { color: var(--ink-3); font-weight: 500; }
.tick-row.is-done .name { color: var(--ink-2); }
/* «Mancano»: a claim datum has no box, its name in line with the documents'; at the end, the way to the whole list. */
.claim-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.claim-row .spacer { flex: none; width: 24px; display: grid; place-items: center; color: var(--ink-3); }
.claim-row .spacer svg { width: 18px; height: 18px; }
.claim-row .name { font-size: 16px; font-weight: 550; }
.claim-row .note { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.missing-foot { padding: 16px 0 2px; }
.missing-foot a { display: inline-flex; align-items: center; gap: 4px; }
.missing-foot svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .tick-row .tools .btn-icon { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .tick .box, .tick .box svg { transition: none; } button.tick:active .box { transform: none; } }

/* The window over the page */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0d0e12; color: #f4f5f7; overflow: hidden; overscroll-behavior: contain;
}
.viewer::backdrop { background: rgb(11 12 16 / 0.6); }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; animation: viewer-in 180ms var(--ease-out); }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer.is-closing { animation: viewer-out 120ms ease-out forwards; }
@keyframes viewer-out { to { opacity: 0; } }
.v-top { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
.v-count { font-size: 14.5px; color: #b9bdc8; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-count b { color: #f4f5f7; font-weight: 600; }
.v-actions { display: flex; gap: 6px; align-items: center; }
.v-actions form { display: flex; }
.v-btn {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; min-width: 42px; padding: 0 12px; border-radius: 12px; color: #f4f5f7;
  font: 550 14.5px var(--font); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.v-btn:active { transform: scale(0.96); }
.v-btn:focus-visible { box-shadow: 0 0 0 3px rgb(140 155 255 / 0.6); }
.v-btn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .v-btn:hover { background: #1b1d24; } }
.v-btn.v-close { padding: 0; width: 42px; }
.v-btn svg { width: 20px; height: 20px; }
.v-btn.v-danger { color: #ffb4a3; }
.v-stage { position: relative; min-height: 0; overflow: hidden; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.v-stage.is-zoomed { overflow: auto; touch-action: auto; cursor: zoom-out; }
.v-slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 72px; }
.v-stage.is-zoomed .v-slide { position: static; padding: 0; display: block; width: max-content; height: max-content; }
.v-pic { position: relative; max-width: 100%; max-height: 100%; display: grid; }
.v-pic img { grid-area: 1 / 1; max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; border-radius: 4px; -webkit-user-drag: none; }
.v-pic .v-mini { filter: blur(6px); transform: scale(1.01); }
.v-pic .v-full { opacity: 0; transition: opacity 160ms ease-out; cursor: zoom-in; }
.v-pic.is-loaded .v-full { opacity: 1; }
.v-pic.is-loaded .v-mini { visibility: hidden; }
.v-stage.is-zoomed .v-pic img { max-width: none; max-height: none; }
.v-error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: #0d0e12; font-size: 15px; color: #f4f5f7; }
.v-nav {
  all: unset; box-sizing: border-box; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; background: rgb(27 29 36 / 0.86); border: 1px solid rgb(255 255 255 / 0.08);
  color: #f4f5f7; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; transition: background-color 150ms ease, opacity 150ms ease;
}
.v-nav:active { transform: translateY(-50%) scale(0.95); }
.v-nav:focus-visible { box-shadow: 0 0 0 3px rgb(140 155 255 / 0.6); }
@media (hover: hover) and (pointer: fine) { .v-nav:hover { background: #2a2d37; } }
.v-nav svg { width: 24px; height: 24px; }
.v-prev { left: 14px; }
.v-next { right: 14px; }
.v-nav:disabled { opacity: 0.3; cursor: default; }
.v-doc { display: grid; place-items: center; height: 100%; padding: 16px; }
.v-doc-card { width: min(420px, 100%); border-radius: 18px; background: #1b1d24; padding: 28px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.v-doc-card .big { width: 72px; height: 88px; border-radius: 10px; background: #f4f5f7; color: var(--red); display: grid; place-items: center; font: 700 15px var(--font); letter-spacing: 0.03em; }
.v-doc-card b { font-size: 17px; overflow-wrap: anywhere; }
.v-doc-card p { font-size: 14px; color: #b9bdc8; }
.v-doc-card .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.v-info { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); border-top: 1px solid rgb(255 255 255 / 0.07); }
.v-text { min-width: 0; }
.v-name { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-meta { font-size: 13.5px; color: #b9bdc8; margin-top: 2px; }
.v-meta .v-internal { color: #f4f5f7; }
.v-meta .v-internal svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
/* WIN-09: in the window, one line more for a photo going to WinCar. */
.v-wincar { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 13.5px; color: #d6d9e0; line-height: 1.4; }
.v-wincar[hidden], .v-wincar [hidden] { display: none; }
.v-wincar svg { flex: none; width: 15px; height: 15px; margin-top: 1px; stroke-width: 2.25; }
.v-wincar.is-in svg { color: #5fd6b5; }
.v-wincar.is-out svg { color: #f2c46b; }
.v-wincar.is-no { color: #ffb4a3; }
.v-wincar-text { overflow-wrap: anywhere; }
.v-openings { font-size: 13px; color: #b9bdc8; }
.v-openings summary { cursor: pointer; min-height: 24px; }
.v-openings ul { list-style: none; margin: 2px 0 0; padding: 0; }
.v-request { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v-request .what { font-size: 14px; color: #b9bdc8; }
.v-request .what b { color: #f4f5f7; font-weight: 600; }
.v-request .pill { height: 24px; font-size: 12.5px; }
.v-request .btns { display: flex; gap: 8px; }
.v-redo { display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; }
.v-redo label { font-size: 14px; font-weight: 550; }
.v-redo label small, .v-redo > small { font-weight: 400; color: #b9bdc8; font-size: 13px; }
.v-redo textarea { width: 100%; min-height: 56px; border: 1px solid #3a3d47; border-radius: 12px; padding: 10px 12px; font: 400 15.5px var(--font); color: #f4f5f7; background: #1b1d24; resize: vertical; }
.v-redo textarea:focus { outline: none; border-color: #8c9bff; }
.v-redo .v-redo-send { align-self: flex-start; background: var(--red-soft); border-color: var(--red-soft); color: var(--red-ink); }
.v-phone-nav { display: none; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  /* WIN-09: three small pictures a row: the mark keeps its icon only, a round badge; the words
     stay for screen readers, and the line above says what each icon means. */
  .tile .tag.wc { width: 24px; height: 24px; padding: 0; justify-content: center; left: 5px; bottom: 5px; }
  .tile .tag.wc svg { width: 14px; height: 14px; }
  .tile .tag.wc .wc-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .wc-note { gap: 4px 12px; font-size: 13.5px; }
  .grid.with-caption { grid-template-columns: repeat(3, 1fr); gap: 12px 6px; }
  .grid.with-caption figcaption { font-size: 13px; }
  .tile { border-radius: 10px; }
  .asked-line { position: relative; align-items: flex-start; flex-wrap: wrap; padding-right: 40px; }
  .asked-text { flex-basis: calc(100% - 60px); }
  .asked-pills { justify-content: flex-start; margin-left: 50px; }
  .asked-line > svg:last-child { position: absolute; right: 14px; top: 22px; }
  .asked-list > .item { flex-wrap: wrap; }
  .v-slide { padding: 0; }
  .v-pic img { max-height: calc(100dvh - 210px); border-radius: 0; }
  .v-nav { display: none; }
  .v-btn .lbl { display: none; }
  .v-info { flex-direction: column; align-items: stretch; gap: 12px; }
  .v-request { justify-content: space-between; }
  .v-phone-nav { display: flex; justify-content: space-between; align-items: center; }
  .v-phone-nav .v-btn { background: #1b1d24; }
}
@media (prefers-reduced-motion: reduce) {
  .viewer[open], .viewer.is-closing { animation-duration: 1ms; }
  .v-slide { transition: none !important; }
}

/* ---------- A quick action without loading the page again (18/11, SCALETTA part 8) ---------- */
/* For every form marked data-in-place (static/js/flusso.js, flusso/in_place.py). */

/* What a button did, said at the bottom for a few seconds (role="status": screen readers
   hear it too); in the window over the page, at its top. Never in the way of a tap. */
.say {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 14px; background: var(--ink); color: #fff;
  font-size: 14.5px; font-weight: 500; box-shadow: 0 12px 32px rgb(11 12 16 / 0.25);
  opacity: 0; transform: translate(-50%, 6px); pointer-events: none;
  transition: opacity 160ms ease-out, transform 200ms var(--ease-out);
}
.say:empty { padding: 0; box-shadow: none; }
.say.is-shown { opacity: 1; transform: translate(-50%, 0); }
.say p + p { color: rgb(255 255 255 / 0.78); font-weight: 450; }
body:has(.ask-bar) > .say { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.viewer .say { top: calc(64px + env(safe-area-inset-top, 0px)); bottom: auto; background: #fff; color: var(--ink); transform: translate(-50%, -6px); }
.viewer .say.is-shown { transform: translate(-50%, 0); }
.viewer .say p + p { color: var(--ink-2); }
@media (max-width: 960px) {
  body:has(.ask-bar) > .say { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* A button on its way: it shows the press was taken; it is not sent twice. */
form[aria-busy="true"] button { opacity: 0.55; cursor: progress; }
/* Files on their way: «Carica» waits, a thin bar says how far they have gone. */
.upload[aria-busy="true"] label { opacity: 0.55; pointer-events: none; }
.upload { position: relative; }
.upload-progress { position: absolute; left: 0; right: 0; bottom: -7px; width: 100%; height: 4px; border: 0; border-radius: 2px; overflow: hidden; background: var(--line); appearance: none; }
.upload-progress::-webkit-progress-bar { background: var(--line); }
.upload-progress::-webkit-progress-value { background: var(--accent); }
.upload-progress::-moz-progress-bar { background: var(--accent); }

/* What went wrong, next to the button. */
.in-place-error { margin-top: 6px; color: var(--red-ink); font-size: 14px; font-weight: 550; }
.viewer .in-place-error { color: #ffb4b4; }


/* A box that only names a part of the page, for the pieces to find it: no box of its own. */
.contents { display: contents; }

/* What holds a button that went away takes the focus: visible only from the keyboard. */
.in-place-focus:focus { outline: none; }
.in-place-focus:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .say, .viewer .say { transition: opacity 120ms linear; transform: translate(-50%, 0); }
}

/* ---------- VET-01: the courtesy cars (approved mockup docs/mockup/cortesia.html) ---------- */

.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.attention { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.attention-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.attention-row + .attention-row { border-top: 1px solid var(--line); }
.attention-row > svg { width: 20px; height: 20px; flex: none; }
.attention-row.late > svg { color: var(--red); }
.attention-row.today > svg, .attention-row.leaving > svg { color: var(--amber-ink); }
.attention-row .item-main { flex: 1; min-width: 0; }
.attention-row .name { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.attention-row .note { font-size: 14px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.attention-row.late .when { color: var(--red-ink); }
.fleet { border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 14px; }
.fleet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; }
.fleet-row + .fleet-row { border-top: 1px solid var(--line); }
.fleet-id { display: flex; align-items: center; gap: 8px 12px; min-width: 0; flex-wrap: wrap; }
.fleet-id .name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .fleet-id a.name:hover { text-decoration: underline; text-underline-offset: 3px; } }
.fleet-state { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; color: var(--ink-3); overflow-wrap: anywhere; }
.fleet-state b { color: var(--ink); font-weight: 600; }
.fleet-state .late, .head-id .who .late { color: var(--red-ink); font-weight: 600; }
.fleet-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.fleet-aside { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0 18px; }
.fleet-aside summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; list-style: none; touch-action: manipulation; }
.fleet-aside summary::-webkit-details-marker { display: none; }
.fleet-aside summary .count { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.fleet-aside summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 150ms var(--ease-out); }
.fleet-aside[open] summary::after { transform: rotate(-135deg); }
.fleet-aside .fleet { border: 0; margin: 0 0 10px; }
.fleet-aside .fleet-row { padding: 14px 0; }
.options form { display: contents; }
@media (max-width: 760px) {
  .fleet-row { grid-template-columns: 1fr; padding: 14px 16px; }
  .fleet-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .attention-row { align-items: flex-start; flex-wrap: wrap; row-gap: 10px; }
  .attention-row .item-main { flex-basis: calc(100% - 34px); }
}
/* The handover and the booking: the cars to choose, the fuel, the driver. */
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.pick-row input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-text .name { font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.pick-text .note { font-size: 13.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.pick-tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; flex: none; }
.pick-tick svg { width: 14px; height: 14px; }
.pick-row:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick-row:has(input:checked) .pick-tick { background: var(--ink); border-color: var(--ink); color: #fff; }
.pick-row:has(input:focus-visible) { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.pick-row.off { opacity: 0.6; cursor: not-allowed; background: var(--side); }
.segmented.five { grid-template-columns: repeat(5, 1fr); }
.segmented.two { grid-template-columns: repeat(2, 1fr); }
.segmented.two .seg span { height: 100%; min-height: 38px; padding: 6px 8px; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
/* Who drives: the name only for somebody else, with no script; a browser without :has() shows it. */
@supports selector(:has(*)) {
  .driver-fields:has(input[name="driver"][value="cliente"]:checked) .driver-name { display: none; }
}
.driver-fields .driver-name { margin-top: 10px; }
.courtesy { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.courtesy .item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); flex-wrap: wrap; }
.courtesy .item .item-main { flex: 1; min-width: 180px; }
.courtesy .past { font-size: 14px; color: var(--ink-3); }
.loan-practice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.loan-practice .item-main { flex: 1; min-width: 0; }
.loan-practice .name { font-weight: 600; overflow-wrap: anywhere; }
.loan-practice .note { font-size: 14px; color: var(--ink-3); }
.loan-practice > svg { color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .loan-practice:hover { background: var(--hover); } .pick-row:not(.off):hover { border-color: var(--ink-3); } }
@media (max-width: 560px) {
  .courtesy .item .right { width: 100%; }
  .courtesy .item .right .btn { flex: 1; }
}
.damage-fields .damage-text { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
@supports selector(:has(*)) {
  .damage-fields:has(input[name="new_damage"][value="no"]:checked) .damage-text { display: none; }
}
.loan-list { border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 14px; }
.loan-list + .hint { margin-top: 10px; }
.facts.lines dd { white-space: pre-line; }
.head-id + .btn-icon { flex: none; }
.loan-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 16px; font-size: 14.5px; }
.loan-row + .loan-row { border-top: 1px solid var(--line); }
.loan-row .when { font-weight: 600; }
.loan-row .what { color: var(--ink-2); overflow-wrap: anywhere; }
.loan-row .what small { display: block; color: var(--ink-3); font-size: 13px; }
.loan-row .km { color: var(--ink-3); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .loan-row:hover { background: var(--hover); } }
@media (max-width: 760px) {
  .loan-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .loan-row .what { grid-column: 1 / -1; grid-row: 2; }
}

/* VET-01: the photos of the sheet, the signed form, the form to print (A4). */
.photos-field { align-items: flex-start; }
.photos-field > label.btn { position: relative; padding: 0 16px; font-size: 14.5px; color: var(--ink); }
.photos-field .btn:focus-within { box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.signed-block { display: flex; flex-direction: column; gap: 12px; }
.signed { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--amber-soft); color: var(--amber-ink); flex-wrap: wrap; }
.signed.is-signed { background: var(--green-soft); color: var(--green-ink); }
.signed .item-main { flex: 1; min-width: 180px; }
.signed b { display: block; }
.signed small { font-size: 13.5px; }
.paper-page { background: #f3f4f6; min-height: 100dvh; padding-bottom: 32px; }
.print-bar { display: flex; justify-content: center; gap: 10px; padding: 16px; flex-wrap: wrap; }
.paper { max-width: 794px; margin: 8px auto; padding: 48px 56px; background: #fff; box-shadow: 0 1px 3px rgb(11 12 16 / 0.08), 0 0 0 1px var(--line); color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.paper h1 { font-size: 20px; font-weight: 650; margin: 18px 0 4px; }
.paper h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 18px 0 6px; font-weight: 650; }
.paper .sub { color: var(--ink-3); }
.paper-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th, .paper td { padding: 6px 8px; border: 1px solid var(--line-2); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.paper td { white-space: pre-line; }
.paper th { width: 34%; font-weight: 500; color: var(--ink-2); background: var(--side); }
.paper td:empty { height: 28px; }
.paper ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.signs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; }
.signs div { border-top: 1px solid var(--ink); padding-top: 6px; color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 760px) {
  .paper { margin: 0; padding: 24px 16px; box-shadow: none; }
  .signs { grid-template-columns: 1fr; gap: 44px; }
}
@media print {
  .print-bar, .say { display: none !important; }
  .paper-page { background: #fff; padding: 0; }
  .paper { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  @page { margin: 16mm; }
}
/* The progress of photos sent with a form in a sheet: under its fields, in the flow. */
.sheet-body > .upload-progress { position: static; height: 5px; }

/* VET-01, slice 6: the cars day by day. The columns are classes, not styles in the page (CSP). */
.cal { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-top h2 { font-size: 16px; font-weight: 650; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-row { display: grid; grid-template-columns: 210px repeat(14, minmax(0, 1fr)); align-items: stretch; min-height: 58px; }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-head { min-height: 46px; background: var(--side); }
.cal-car { grid-row: 1; grid-column: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 16px; min-width: 0; }
.cal-car .plate { align-self: flex-start; }
.cal-car small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day { grid-row: 1; border-left: 1px solid var(--line); }
.cal-head .cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.cal-head .cal-day b { font-size: 14px; color: var(--ink); font-weight: 600; }
.cal-day.weekend { background: #f7f8fa; }
.cal-head .cal-day.weekend { background: #f1f2f5; color: var(--ink-2); }
.cal-day.today { background: var(--accent-soft); }
.cal-head .cal-day.today b { color: var(--accent-ink); }
.cal-head .cal-day.today { color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent); }
.cal-bar { grid-row: 1; z-index: 1; align-self: center; margin: 0 3px; height: 30px; border-radius: 8px; display: flex; align-items: center; gap: 6px; padding: 0 9px; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; touch-action: manipulation; }
.cal-bar span { overflow: hidden; text-overflow: ellipsis; }
.cal-bar em { font-style: normal; font-weight: 500; }
.cal-bar svg { width: 15px; height: 15px; flex: none; }
.cal-bar:not(.short):not(.cal-bar-late) svg { display: none; }
.cal-bar.short span { display: none; }
.cal-bar.goes-on-left { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-bar.goes-on-right { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal-bar-out { background: var(--ink); color: #fff; }
.cal-bar-late { z-index: 2; background: repeating-linear-gradient(-45deg, var(--red) 0 6px, #d0400f 6px 12px); color: #fff; }
.cal-bar-booked { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-bar-stop { background: repeating-linear-gradient(-45deg, #e4e6eb 0 6px, #f1f2f5 6px 12px); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.cal-bar-back { background: #eef0f3; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { a.cal-bar:hover { filter: brightness(1.06); } }
.cal-legend { display: flex; gap: 8px 18px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 22px; height: 12px; border-radius: 4px; display: inline-block; }
.cal .from-2 { grid-column-start: 2; }
.cal .from-3 { grid-column-start: 3; }
.cal .from-4 { grid-column-start: 4; }
.cal .from-5 { grid-column-start: 5; }
.cal .from-6 { grid-column-start: 6; }
.cal .from-7 { grid-column-start: 7; }
.cal .from-8 { grid-column-start: 8; }
.cal .from-9 { grid-column-start: 9; }
.cal .from-10 { grid-column-start: 10; }
.cal .from-11 { grid-column-start: 11; }
.cal .from-12 { grid-column-start: 12; }
.cal .from-13 { grid-column-start: 13; }
.cal .from-14 { grid-column-start: 14; }
.cal .from-15 { grid-column-start: 15; }
.cal .to-3 { grid-column-end: 3; }
.cal .to-4 { grid-column-end: 4; }
.cal .to-5 { grid-column-end: 5; }
.cal .to-6 { grid-column-end: 6; }
.cal .to-7 { grid-column-end: 7; }
.cal .to-8 { grid-column-end: 8; }
.cal .to-9 { grid-column-end: 9; }
.cal .to-10 { grid-column-end: 10; }
.cal .to-11 { grid-column-end: 11; }
.cal .to-12 { grid-column-end: 12; }
.cal .to-13 { grid-column-end: 13; }
.cal .to-14 { grid-column-end: 14; }
.cal .to-15 { grid-column-end: 15; }
.cal .to-16 { grid-column-end: 16; }
@media (max-width: 960px) { .cal-row { grid-template-columns: 170px repeat(14, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  /* On the phone the car is on its own line, its 14 days under it; a first column of no width keeps the columns' numbers. */
  .cal-row { grid-template-columns: 0 repeat(14, minmax(0, 1fr)); grid-template-rows: auto 34px; min-height: 0; padding-bottom: 10px; }
  .cal-head { grid-template-rows: 40px; padding-bottom: 0; }
  .cal-car { grid-column: 1 / -1; grid-row: 1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 12px 6px; }
  .cal-head .cal-car { display: none; }
  .cal-row:not(.cal-head) .cal-day, .cal-row:not(.cal-head) .cal-bar { grid-row: 2; }
  .cal-head .cal-day { font-size: 10.5px; }
  .cal-head .cal-day b { font-size: 12.5px; }
  .cal-day { border-left: 0; }
  .cal-row:not(.cal-head) .cal-day { border-radius: 4px; margin: 0 1px; }
  .cal-bar { margin: 0 1px; padding: 0 5px; font-size: 11px; border-radius: 6px; }
  .cal-bar em { display: none; }
}


/* ---------- RIC-01 (approved 26/11): the parts' box, the bolla and the voice notes ---------- */
/* In «Stati» the parts' row is a box; on the phone the parts' person has the bolla and the
   note in «I tuoi stati». ▶ and «Registra» are touched on 44 points at least; colour only with
   the words («Nuova», the red of a microphone that listens). */
.item.parts { display: block; scroll-margin-top: 76px; }
.item.parts .parts-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.parts-box { margin-top: 14px; padding: 16px; border-radius: var(--radius-lg); background: #f7f8fa; display: flex; flex-direction: column; gap: 18px; }
.parts-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.parts-actions .upload { display: flex; }
.parts-box .parts-actions .btn { background: var(--bg); }
.parts-section h3 { font-size: 15px; font-weight: 650; display: flex; align-items: baseline; gap: 6px; margin: 0 0 10px; }
.parts-section h3 .n { font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
.bolle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px 10px; }
.bolle li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bolle .tile { aspect-ratio: 4 / 3; }
.bolle small { font-size: 13px; color: var(--ink-3); }

.arrived { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.arrived-q { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; margin: 0; }
.arrived-q svg { width: 18px; height: 18px; color: var(--green); margin-top: 2px; flex: none; }
.arrived-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arrival {
  font: inherit; color: inherit; text-align: left; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg);
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.arrival b { font-size: 15px; font-weight: 600; }
.arrival small { font-size: 12.5px; color: var(--ink-3); }
.arrival:active { transform: scale(0.98); background: var(--hover); }
@media (hover: hover) and (pointer: fine) { .arrival:hover { background: var(--hover); } }
.arrived-later { align-self: flex-start; }
@media (max-width: 560px) { .arrived-choices { grid-template-columns: minmax(0, 1fr); } }

.voice-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.voice-notes .vn + .vn { border-top: 1px solid var(--line); }
.vn { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.vn-play {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--ink); color: #fff; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.vn-play svg { width: 18px; height: 18px; fill: currentColor; stroke-width: 0; }
.vn-play:active { transform: scale(0.94); }
.vn-play[data-playing] { background: var(--accent); }
.vn-play .when-playing, .vn-play[data-playing] .when-stopped { display: none; }
.vn-play[data-playing] .when-playing { display: contents; }
.vn-play .when-stopped { display: contents; }
.vn-play:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(48 73 245 / 0.35); }
.vn.is-new .vn-play { box-shadow: 0 0 0 3px var(--accent-soft); }
.vn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.vn-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-3); }
.vn-line b { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.vn-bar { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.vn-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.vn-text { margin: 0; font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.vn-text.quiet { color: var(--ink-3); }
.vn-heard { margin: 0; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.vn-time { flex: none; font-size: 14px; color: var(--ink-3); padding-top: 12px; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.vn-delete { margin-top: 2px; }
.vn-problem { margin: 0; font-size: 13.5px; color: var(--red-ink); }
.pill-new { background: var(--accent-soft); color: var(--accent-ink); }
.more-notes summary { cursor: pointer; padding: 8px 0; font-size: 14.5px; font-weight: 550; color: var(--accent-ink); }
.history .vn-history { margin: 8px 0 2px; padding: 10px 12px; border-radius: var(--radius); background: #f7f8fa; align-items: center; }
.history .vn-history .vn-main { padding-top: 0; }
.history .vn-history .vn-time { padding-top: 0; }

.my-statuses > .my-parts { flex-wrap: wrap; }
.my-statuses > .my-parts > .parts-actions { flex: 1 1 100%; }
.my-statuses > .my-parts .parts-actions .upload, .my-statuses > .my-parts .parts-actions > .btn { flex: 1 1 0; }
.my-statuses > .my-parts .parts-actions label { flex: 1; justify-content: center; }
.parts-summary {
  flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 -16px -10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
}
.parts-summary svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }

/* The sheet of a voice note: «Registra», the time, the voice's level; then listen and save. */
.recorder form { gap: 12px; }
.recorder-head .hint { margin-top: 2px; }
.recorder-live { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; }
.recorder-live[hidden] { display: none; }
.rec-button {
  position: relative; width: 88px; height: 88px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--red); color: #fff; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 140ms var(--ease-out);
}
.rec-button svg { width: 34px; height: 34px; }
.rec-button:active { transform: scale(0.95); }
.rec-button:focus-visible { outline: none; box-shadow: 0 0 0 4px rgb(196 50 10 / 0.3); }
.rec-button .when-on { display: none; }
.rec-button[aria-pressed="true"] .when-on { display: block; }
.rec-button[aria-pressed="true"] .when-ready { display: none; }
.rec-button[aria-pressed="true"] svg { fill: currentColor; width: 28px; height: 28px; }
.rec-button:disabled { opacity: 0.5; cursor: default; }
.rec-ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--red); opacity: 0; pointer-events: none; }
.rec-button[aria-pressed="true"] .rec-ring { animation: rec-ring 1.4s ease-out infinite; }
@keyframes rec-ring { from { opacity: 0.5; transform: scale(0.92); } to { opacity: 0; transform: scale(1.18); } }
.rec-clock { display: flex; align-items: baseline; gap: 6px; margin: 0; font-variant-numeric: tabular-nums; }
.rec-clock b { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.rec-clock span { font-size: 14px; color: var(--ink-3); }
.rec-clock.is-ending b { color: var(--red-ink); }
.rec-level { display: flex; align-items: center; gap: 4px; height: 28px; }
.rec-level span { width: 5px; height: 6px; border-radius: 3px; background: var(--line-2); transition: height 90ms linear; }
.recorder-live.is-on .rec-level span { background: var(--red); }
.rec-said { margin: 0; min-height: 21px; font-size: 14px; color: var(--ink-3); text-align: center; }
.recorder-review { display: flex; flex-direction: column; gap: 10px; }
.vn-review { padding: 4px 0; align-items: center; }
.vn-review .vn-time { padding-top: 0; }
.recorder-review input[type="text"] { font-size: 16px; } /* never the phone's zoom on the field */
.hint-inline { font-weight: 400; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
  .rec-button[aria-pressed="true"] .rec-ring { animation: none; opacity: 0.4; }
  .rec-level span { transition: none; }
}
@media (max-width: 560px), (pointer: coarse) {
  .parts-actions .btn { min-height: 44px; } /* the bolla and the voice note under a finger */
}

/* ---------- DSH-06: the workshop's calendar (approved mockup docs/mockup/calendario.html) ---------- */

.dc { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "top top" "week week" "late undated"; align-items: start; }
.dc-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dc-top h2 { font-size: 16px; font-weight: 650; }
.dc-nav { display: flex; align-items: center; gap: 6px; }
.dc-week { grid-area: week; display: grid; grid-template-columns: 1.3fr repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.dc-late { grid-area: late; }
.dc-undated { grid-area: undated; }
.dc[aria-busy="true"] .dc-week { opacity: 0.55; transition: opacity 150ms ease 150ms; }
.dc-day { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 160px; background: var(--bg); }
.dc-day.is-today { background: var(--accent-soft); border-color: rgb(48 73 245 / 0.35); }
.dc-day h3 { font-size: 15px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 0 4px; }
.dc-day h3 .dc-count { color: var(--ink-3); font-weight: 500; font-size: 13px; white-space: nowrap; }
.dc-day.is-today h3 b { color: var(--accent-ink); }
.dc-none { font-size: 13.5px; color: var(--ink-3); padding: 2px 4px; }
.dc-car { position: relative; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dc-car .plate { align-self: flex-start; }
.dc-open { position: absolute; inset: 0; border-radius: inherit; }
.dc-model { font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-flag { font-size: 12.5px; font-weight: 600; color: var(--red-ink); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dc-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.dc-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.s-da_iniziare { color: var(--ink-3); }
.s-in_lavorazione { color: var(--accent-ink); }
.s-aspetta_ricambi { color: var(--amber-ink); }
.s-lavoro_finito, .s-pronta { color: var(--green-ink); }
.s-lavoro_finito::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.dc-car .dc-date { position: relative; z-index: 1; margin-left: auto; width: 30px; height: 30px; padding: 0; border-radius: 8px; color: var(--ink-2); flex: none; }
.dc-car .dc-date svg { width: 16px; height: 16px; }
.dc-date-word { display: none; }
.dc-loan { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--side); font-size: 13px; color: var(--ink-2); }
.dc-loan svg { width: 15px; height: 15px; color: var(--ink-3); }
.dc-loan .plate { height: 22px; font-size: 13.5px; }
.dc-loan .plate::before { width: 7px; }
.dc-loan-text { white-space: nowrap; }
.dc-loan-text b { font-weight: 600; color: var(--ink); }
.dc .card-head h2.late { color: var(--red-ink); }
.dc-list { list-style: none; margin: 0; padding: 0; }
.dc-list li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--line); }
.dc-list .btn { position: relative; z-index: 1; }
.dc-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dc-what b { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-late-when { color: var(--red-ink); font-weight: 600; font-size: 13.5px; }
.dc-courtesy { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.dc-courtesy svg { width: 14px; height: 14px; }
.dc-empty { padding: 0 20px 18px; font-size: 14px; color: var(--ink-3); }
.dc-for { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.dc-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-quick .btn { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.dc-quick .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) {
  .dc-car:hover, .dc-list li:hover, .dc-loan:hover { border-color: var(--line-2); }
}
@media (max-width: 1200px) { .dc-week { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .dc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "late" "week" "undated"; gap: 14px; }
  .dc-week { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dc-day { padding: 0; gap: 0; overflow: hidden; min-height: 0; }
  .dc-day h3 { padding: 12px 16px 10px; font-size: 15.5px; }
  .dc-day.is-today { background: var(--bg); border-color: rgb(48 73 245 / 0.45); }
  .dc-day.is-today h3 { background: var(--accent-soft); }
  .dc-none { padding: 0 16px 14px; }
  .dc-car { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 112px 12px 16px; }
  .dc-car .dc-date { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: auto; height: 40px; padding: 0 12px; font-size: 14px; gap: 6px; }
  .dc-car .dc-date:active { transform: translateY(-50%) scale(0.97); }
  .dc-date-word { display: inline; }
  .dc-loan { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 16px; font-size: 14px; }
  .dc-list li { padding: 12px 16px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "plate btn" "what btn"; row-gap: 6px; }
  .dc-list li > .plate { grid-area: plate; justify-self: start; }
  .dc-list li > .dc-what { grid-area: what; }
  .dc-list li > .btn { grid-area: btn; height: 40px; }
  .dc-empty { padding: 0 16px 16px; }
}

/* DSH-06: «Impostazioni → Schermo TV» (approved mockup docs/mockup/tv-impostazioni.html). */
.tv-code-field input { height: 56px; max-width: 240px; font: 600 30px/1 var(--font-plate); letter-spacing: 0.18em; }
.tv-address { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.tv-warning { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; font-weight: 500; }
.tv-never { display: flex; gap: 8px; align-items: flex-start; }
.tv-never svg { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.tv-screens { list-style: none; margin: 0; padding: 0; }
.tv-screens li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.tv-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--side); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.tv-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tv-what b { font-weight: 600; }
.tv-what small { color: var(--ink-3); font-size: 13.5px; }
.tv-acts { display: flex; gap: 6px; align-items: center; }
.tv-acts form { margin: 0; }
.tv-empty { padding: 0 20px 18px; color: var(--ink-3); font-size: 14px; }
@media (max-width: 560px) {
  .tv-code-field input { max-width: none; font-size: 28px !important; }
  .tv-screens li { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 16px; }
  .tv-acts { grid-column: 1 / -1; }
  .tv-acts > *, .tv-acts .btn { flex: 1; width: 100%; height: 44px; }
}
