/* Map For Trading CRM console, tema "Industriale" (design handoff 2026-10). Tokens first, then the shell, then the vocabulary. */

:root {
  --bg: #d6d3cb;
  --plate: linear-gradient(160deg, #edebe6, #dedbd3);
  --plate-grain: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 1px, rgba(0,0,0,0) 1px 3px, rgba(0,0,0,.035) 3px 4px);
  --surface: linear-gradient(170deg, #fbfaf8, #eeece6);
  --surface-flat: #fbfaf8;
  --ink: #1c1f22; --muted: #6a6f74; --faint: #9a9ea2;
  --line: #b9b6ae; --line-soft: #eeece6; --line-strong: #8a8f94;
  --accent: #f4c900; --accent-grad: linear-gradient(180deg, #ffd21a, #f0c000); --accent-shadow: #a88600;
  --accent-soft: #fff8d6; --accent-text: #8a7000;
  --dark-grad: linear-gradient(180deg, #2e3338, #1c1f22);
  --danger: #c43c2a; --danger-soft: #fff0ee;
  --ok: #2e8b57; --ok-soft: #e6f2ea;
  --warn: #ff8a1a;
  --neutral-soft: #f4f3ef;
  --r-sm: 5px; --r-md: 8px; --r-lg: 10px; --r-sheet: 16px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --sh-plate: 0 30px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.9);
  --sh-card: inset 0 1px 0 #fff, 0 2px 4px rgba(0,0,0,.1);
  --sh-btn-y: 0 3px 0 var(--accent-shadow), 0 6px 12px rgba(0,0,0,.2);
  --sh-btn-dark: 0 3px 0 #000, 0 6px 12px rgba(0,0,0,.25);
  --sh-btn-grey: 0 2px 0 #a7a49c;
  --sh-inset: inset 0 2px 4px rgba(0,0,0,.08);
  --sh-pop: 0 12px 30px rgba(0,0,0,.14);
  --hazard: repeating-linear-gradient(135deg, #f4c900 0 12px, #1c1f22 12px 24px);
  --cond: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --sans: Barlow, "Segoe UI", system-ui, sans-serif;
  --sidebar-w: 232px;
  --header-h: 52px;
  --quickbar-h: 64px;
  /* The stripe, the header and everything pinned under them start below a phone's status bar (viewport-fit=cover lets the
     page run under it: on an iPhone the stripe slid under the clock when scrolling, owner 2026-10-30); 0 on Android and PC. */
  --top: calc(6px + env(safe-area-inset-top, 0px));
}

/* ------------------------------------------------------------------------------------------------- aspetto (themizer) */
/* Tokens the person can change live in pages-theme.js; here what depends on their choices. */
:root { --ui-zoom: 1; --text-weight: 400; }
.app { zoom: var(--ui-zoom); }
body, .btn, input, select, textarea { font-weight: var(--text-weight); }
html[data-sidebar="dark"] .sidebar { background: var(--dark-grad); color: #fff; border-right-color: #000; }
html[data-sidebar="dark"] .sidebar .muted, html[data-sidebar="dark"] .sb-group-title, html[data-sidebar="dark"] .sb-brand small, html[data-sidebar="dark"] .sb-user .who small { color: #c7ccd1; }
html[data-sidebar="dark"] .sb-item:hover { background: rgba(255,255,255,.08); }
html[data-sidebar="dark"] .sb-item.active { background: var(--accent); color: #1c1f22; }
html[data-sidebar="dark"] .logo-badge { background: var(--accent); color: #1c1f22; }
html[data-sidebar="accent"] .sidebar { background: var(--accent-grad); color: #1c1f22; border-right-color: var(--accent-shadow); }
html[data-sidebar="accent"] .sb-item.active { background: #1c1f22; color: #fff; }
html[data-sidebar="accent"] .sb-item:hover { background: rgba(0,0,0,.08); }
html[data-sidebar="accent"] .sb-group-title, html[data-sidebar="accent"] .sb-brand small, html[data-sidebar="accent"] .sb-user .who small { color: rgba(28,31,34,.7); }
html[data-header="dark"] .m-header { background: var(--dark-grad); color: #fff; border-bottom-color: #000; }
html[data-header="dark"] .m-header .icon-btn { color: #fff; }
html.theme-dark input, html.theme-dark select, html.theme-dark textarea, html.theme-dark .sheet .field input, html.theme-dark .sheet .field select, html.theme-dark .sheet .field textarea, html.theme-dark .mail-body, html.theme-dark .sheet .search-box, html.theme-dark .search-box { background: #1b1e22; color: var(--ink); border-color: var(--line); }
html.theme-dark .sheet-head, html.theme-dark .sheet-foot, html.theme-dark .preview-row, html.theme-dark .choice, html.theme-dark .ev { background: var(--surface-flat); }
html.theme-dark .btn:not(.primary):not(.danger):not(.confirm) { background: var(--surface-flat); color: var(--ink); border-color: var(--line-strong); box-shadow: 0 2px 0 #000; }
html.theme-dark .sheet-scroll p.muted, html.theme-dark .sheet .context, html.theme-dark .sheet .hint { color: var(--muted); }
html.theme-dark .chip.ink, html.theme-dark .logo-badge { background: var(--accent); color: #1c1f22; border-color: var(--accent); }
html.theme-dark .avatar-sq { background: #3a4046; color: #fff; }
html.theme-dark .segmented button.active, html.theme-dark .filter.active, html.theme-dark .tabs [data-tab].active, html.theme-dark .doc-tabs button.active { background: var(--accent); color: #1c1f22; }
html.theme-dark .card, html.theme-dark .kpi { box-shadow: var(--sh-card); }
html.theme-dark .segmented { background: none; }
html.theme-dark .segmented button { color: var(--ink); }
html.theme-dark .filter, html.theme-dark .tabs [data-tab] { background: var(--surface-flat); color: var(--ink); border-color: var(--line); }
.themizer { font-size: 14px; }
.th-label { font: 600 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: var(--s-4) 0 8px; }
.th-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
@media (max-width: 600px) { .th-presets { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .th-preset { padding: 6px 2px; font-size: 11px; } }   /* A43: the five presets in one row (Notte sat alone) */
.th-preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface-flat); color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; }
.th-preset.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.th-sw { display: block; width: 100%; height: 34px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); }
.th-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.th-row > span { width: 110px; flex: none; font-weight: 600; }
.th-seg { flex: 1; min-width: 240px; }
.th-seg button { font-size: 13px; }
.th-custom input[type=color] { position: absolute; opacity: 0; width: 28px; height: 28px; cursor: pointer; }
.swatch-pick i.rainbow { background: conic-gradient(#f4c900, #ff8c00, #e74856, #e3008c, #8764b8, #0078d4, #30c6cc, #47d041, #f4c900); }

/* ------------------------------------------------------------------------------------------------------- base */
/* Phones: no blue flash on a tap, and a held tap on a button, chip, tab or the bar does not select its text or open the
   copy menu (owner 2026-10-30: a light blue overlay); text in notes, descriptions and fields stays selectable. */
html { -webkit-tap-highlight-color: transparent; }
button, .btn, .chip, .filter, .tabs, .doc-tabs, .segmented, .qb, .pop-item, .sb-item, .icon-btn, .avatar-btn, .ent, .ev, .ev-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
* { box-sizing: border-box; scrollbar-width: none; }   /* no scrollbar anywhere, the content still scrolls (owner 2026-10-27: "I hate them") */
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plate-grain), var(--plate); background-attachment: fixed; color: var(--ink); font: 400 14px/1.4 var(--sans); min-height: calc(100vh - 1px); min-height: calc(var(--app-h, 100dvh) - 1px); }   /* --app-h: the visible height measured by app.js (innerHeight); dvh came out larger than what a phone shows. 1 px under the screen: a phone's rounding of a fractional dvh made every page a hair taller, so scrollable, so Chrome hid its bar on a drag and the page slid by the bar's height (owner 2026-10-30) */   /* dvh: the height seen, address bar included; 100vh on a phone is the taller one without it, and the page scrolled by that much (owner 2026-10-30) */
body.auth-open { background: #0f1113; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--cond); text-transform: uppercase; line-height: 1; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.caps { font: 600 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ------------------------------------------------------------------------------------------------------ shell */
.app { min-height: calc(100vh - 1px); min-height: calc(var(--app-h, 100dvh) - 1px); }
.app::before { content: ""; position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 6px; background: var(--hazard); z-index: 60; }

.m-header { position: fixed; top: var(--top); left: 0; right: 0; height: var(--header-h); display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-2) 0 var(--s-1); background: var(--plate); border-bottom: 1px solid var(--line-strong); border-radius: 0 0 14px 14px; z-index: 40; }
.m-brand { display: flex; align-items: center; gap: var(--s-2); min-width: 0; flex: 1; }
.m-title { font: 700 22px/1 var(--cond); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* the page's name lives here on phones and tablets (owner 2026-10-30) */
.m-actions { display: flex; align-items: center; gap: 2px; }
.logo-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--ink); color: var(--accent); font: 700 12px/1 var(--cond); flex: none; }
.sb-brand .logo-badge { width: 36px; height: 36px; font-size: 15px; border-radius: 8px; }

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: var(--r-md); cursor: pointer; position: relative; }
.icon-btn:hover { background: rgba(0,0,0,.06); }
.icon-btn .ico { width: 22px; height: 22px; }
.badge-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font: 600 10px/16px var(--sans); text-align: center; }
.avatar-btn { width: 32px; height: 32px; margin: 0 4px; border-radius: 50%; border: 0; background: var(--ink); color: var(--accent); font: 700 12px/1 var(--cond); cursor: pointer; display: grid; place-items: center; }
.avatar-btn.linked { box-shadow: 0 0 0 2px var(--accent), 0 0 0 3px var(--ink); }

.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--sidebar-w); display: flex; flex-direction: column; background: var(--plate); border-right: 1px solid var(--line-strong); z-index: 50; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-3) var(--s-3); border-bottom: 1px solid var(--line); margin-bottom: var(--s-2); }   /* a clear line under the brand, like the footer's (owner 2026-10-27) */
.sb-brand { display: flex; align-items: center; gap: var(--s-3); }
.sb-brand strong { display: block; font: 700 14px/1 var(--cond); letter-spacing: .5px; }
.sb-brand small { display: block; font: 500 11px/1.2 var(--sans); color: var(--muted); }
.sb-close { display: none; }
.sb-nav { flex: 1; overflow-y: auto; padding: 0 var(--s-3); scrollbar-width: none; }   /* scrolls when the screen is short, never shows a bar (owner 2026-10-27) */
.sb-nav::-webkit-scrollbar { display: none; }
/* Short screens: tighter rows so the whole menu fits without scrolling at all. */
@media (max-height: 860px) { .sb-item { height: 36px; } .sb-group { margin-bottom: 4px; } }
@media (max-height: 760px) { .sb-item { height: 32px; font-size: 14px; } .sb-group-title { height: 32px; } }
.sb-group { margin-bottom: var(--s-2); }
.sb-group-title { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 40px; padding: 0 var(--s-2); border: 0; background: none; cursor: pointer; }
.sb-group-title .ico { width: 14px; height: 14px; transition: transform .15s; color: var(--muted); }
.sb-group.open .sb-group-title .ico { transform: rotate(90deg); }
.sb-group-items { display: none; }
.sb-group.open .sb-group-items { display: block; }
.sb-item { display: flex; align-items: center; gap: var(--s-3); height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md); font-weight: 500; }
.sb-item:hover { background: rgba(0,0,0,.05); }
.sb-item.active { background: var(--accent); color: var(--ink); font-weight: 600; }
.sb-item .badge { margin-left: auto; }
.sb-foot { border-top: 1px solid var(--line); padding: var(--s-3); }
.sb-user { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-2); border: 0; border-radius: var(--r-md); background: none; text-align: left; cursor: pointer; }
.sb-user:hover { background: rgba(0,0,0,.05); }
.sb-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--accent); display: grid; place-items: center; font: 700 12px/1 var(--cond); flex: none; }
.sb-user .who { flex: 1; min-width: 0; }
.sb-user .who b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .who small { display: block; font-size: 11px; color: var(--muted); }
.sb-user .ico { width: 16px; height: 16px; color: var(--muted); }
.drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(28,31,34,.45); z-index: 45; }

.main { padding: calc(var(--header-h) + var(--top)) 0 var(--quickbar-h); }
.page { padding: var(--s-2); }   /* phones: a thin gutter all round, the room goes to the content (owner 2026-10-27; bottom as the top, 2026-10-30) */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: #fff; font: 600 11px/1 var(--sans); }
.badge.danger { background: var(--danger); }

/* The phone's bottom bar (owner 2026-10-27): Indietro · Home · Da fare · Agenda · Altro, the page's slot lit. */
.quickbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--quickbar-h); display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; padding: 4px var(--s-1) 2px; padding-bottom: calc(2px + env(safe-area-inset-bottom)); background: var(--plate); border-top: 1px solid var(--line-strong); border-radius: 14px 14px 0 0; z-index: 43; }   /* over the fan's backdrop, under sheets; rounded like the header (owner 2026-10-27) */
.qb { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--ink); }
.qb .key { position: relative; display: grid; place-items: center; width: 40px; height: 30px; border-radius: 7px; background: linear-gradient(180deg, #fbfaf8, #e4e1da); border: 1px solid var(--line); box-shadow: var(--sh-btn-grey); }
.qb span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A number on a slot: small, on the key's corner, not over the next slot (owner 2026-10-30: too big). */
.qb-badge { position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px; padding: 1px 4px 0; border-radius: 8px; background: var(--danger); color: #fff; font: 700 10px/1 var(--sans); display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--surface-flat); box-sizing: content-box; }
.qb-badge[hidden] { display: none; }   /* the flex above would otherwise show an empty badge */
/* Barlow sits high in its line box: centred by flex, nudged 1 px down (owner 2026-10-30: the number sat at the top). */
.qb.active .qb-badge { border-color: var(--accent); }
@media (max-width: 380px) { .qb span:last-child { font-size: 10px; } .qb .key { width: 36px; } }
.qb.active .key, .qb.open .key { background: var(--accent-grad); border-color: var(--accent-shadow); box-shadow: 0 2px 0 var(--accent-shadow); }
.qb:active .key { transform: translateY(2px); box-shadow: none; }
.qb span { font: 500 11px/1 var(--sans); }
/* Altro: a fan of round buttons on a half-moon over the bar; the page's own actions as pills above it. */
.fan-backdrop { position: fixed; inset: 0; background: rgba(28,31,34,.55); backdrop-filter: blur(2px); z-index: 41; }
.fan { position: fixed; left: 0; right: 0; bottom: calc(var(--quickbar-h) + env(safe-area-inset-bottom)); z-index: 42; pointer-events: none; }
.fan-ring { position: absolute; left: 50%; bottom: 6px; width: 0; height: 0; }
.fan-item { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; margin-left: -36px; margin-top: -30px; border: 0; background: none; padding: 0; cursor: pointer; pointer-events: auto; color: #fff;
  transform: translate(0, 40px) scale(.4); opacity: 0; transition: transform .28s cubic-bezier(.2,.9,.3,1.2) var(--d), opacity .2s var(--d); }
.fan.open .fan-item { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; }
.fan-item .disc { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent-grad); color: #1c1f22; border: 2px solid #fff; box-shadow: 0 4px 0 var(--accent-shadow), 0 10px 20px rgba(0,0,0,.35); }
.fan-item .disc .ico { width: 24px; height: 24px; }
.fan-item:active .disc { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-shadow); }
.fan-item .lbl { font: 600 10.5px/1.1 var(--sans); text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.6); max-width: 76px; }
.fan-item.edit .disc { width: 40px; height: 40px; background: var(--dark-grad); color: #fff; border-color: #fff; box-shadow: 0 3px 0 #000, 0 8px 16px rgba(0,0,0,.35); }
.fan-item.edit .disc .ico { width: 18px; height: 18px; }
.fan-page { position: absolute; left: var(--s-3); right: var(--s-3); pointer-events: auto; color: #fff; }
.fan-page .caps { color: #d9dde1; margin-bottom: 6px; }
.fan-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fan-list { display: flex; flex-direction: column; gap: 4px; }
.fan-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 0 4px 0 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-flat); }
.fan-row.on { border-color: var(--line); }
.fan-row .check { display: flex; align-items: center; gap: 10px; flex: 1; font: 500 15px/1.2 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; cursor: pointer; }
.fan-move { display: flex; }
.fan-move .icon-btn { width: 36px; height: 36px; }
.fan-move .icon-btn[disabled] { opacity: .3; }

@media (min-width: 1081px) {
  .m-header { display: none; }
  .drawer-backdrop { display: none !important; }
  .main { margin-left: var(--sidebar-w); padding: var(--top) 0 0; }
  .page { padding: var(--s-2) var(--s-6) var(--s-3); }   /* short gaps: the title right under the stripe, the bottom no bigger (owner 2026-10-27, 2026-10-30) */
  .quickbar, .fan, .fan-backdrop { display: none; }
}
@media (max-width: 1080px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease-out; width: 300px; box-shadow: none; border-radius: 0 14px 14px 0; overflow: hidden; }   /* the drawer's right corners rounded like the header and the bar */
  body.drawer-open .sidebar { transform: none; box-shadow: var(--sh-pop); }
  body.drawer-open .drawer-backdrop { display: block; }
  .sb-close { display: inline-grid; }
}
@media (max-width: 600px) {
  .page { padding: var(--s-2); }
}

/* ------------------------------------------------------------------------------------------------ typography */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.page-head .eyebrow { font: 600 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
/* Phones and tablets: the header above already names the page, so the page's own title and its eyebrow go (the room is
   the content's, owner 2026-10-30); its buttons stay, on one short row at the right; the dashboard's greeting goes too. */
@media (max-width: 1080px) {
  .page-head, .dash-head { display: none; }   /* its buttons are in the header (movePageActions, app.js) */
  /* Tabs that now open the page (Admin) rest where they pin, right under the header: the page's top padding above them made
     them slide up 8 px on the first scroll (owner 2026-10-30). */
  .page > .page-head + .tabs { margin-top: calc(-1 * var(--s-2)); }
}
/* A narrow phone (360 px): the page's name needs the room more than the logo (\"Macchine\", \"Da chiamare · 7\" were cut). */
@media (max-width: 400px) { .m-brand .logo-badge { display: none; } .m-title { font-size: 20px; } }
/* A20 (audit): with a page's "+" and the DEMO pill the title read "MACC…": a smaller title and pill on a narrow phone. */
@media (max-width: 400px) {
  .m-header:has(#mPageActs > *) .m-title { font-size: 18px; letter-spacing: .2px; }
  .demo-pill { margin-left: 2px; padding: 3px 5px; font-size: 10px; min-height: 24px; }
  .m-actions { gap: 0; }
}
/* A14 (audit): start and end side by side left the time under the browser's calendar icon on a phone: one per line. */
@media (max-width: 600px) { .field-row:has(input[type="datetime-local"]) { flex-direction: column; } }
/* The page's buttons in the header: compact icons, the main one yellow (their name on a long press / the pointer). */
.m-page-acts { display: flex; align-items: center; gap: 4px; }
.m-page-acts .btn { width: 40px; height: 40px; padding: 0; gap: 0; font-size: 0; border-radius: 10px; }
.m-page-acts .btn .ico { width: 20px; height: 20px; }
.m-page-acts .btn span { display: none; }
/* The search overlay: full screen on a phone, a panel from the top on a larger screen; results scroll inside it. */
.finder { position: fixed; inset: 0; z-index: 90; background: rgba(20,22,24,.45); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; animation: loader-in .18s ease-out both; }
.finder-panel { width: min(100%, 720px); max-height: 100%; display: flex; flex-direction: column; background: var(--plate-grain), var(--plate); box-shadow: var(--sh-pop); }
@media (min-width: 601px) { .finder { padding: 8vh var(--s-4) var(--s-4); } .finder-panel { max-height: 80vh; border-radius: 14px; overflow: hidden; } }
@media (max-width: 600px) { .finder-panel { height: 100%; } }
.finder-bar { flex: none; display: flex; align-items: center; gap: var(--s-2); padding: 10px var(--s-3); padding-top: calc(10px + env(safe-area-inset-top)); background: var(--surface-flat); border-bottom: 1px solid var(--line); }
/* The field: one rounded plate with the glass, the text and the filter button inside it (owner 2026-10-30: nicer box). */
.finder-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px; border-radius: 23px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-inset); cursor: text; }
.finder-field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(244,201,0,.35); }
.finder-field > .ico { width: 19px; height: 19px; color: var(--muted); flex: none; }
.finder-field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0 !important; background: none !important; box-shadow: none !important; font: 500 16px/1 var(--sans); color: var(--ink); outline: none; }
.finder-field input::-webkit-search-cancel-button { display: none; }
.finder-filter { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 18px; background: none; color: var(--ink); cursor: pointer; }
.finder-filter:hover { background: rgba(0,0,0,.06); }
.finder-filter .ico { width: 18px; height: 18px; }
.finder-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-flat); }
.finder-on { flex: none; padding: 8px var(--s-3) 0; }
.finder-on .chip { display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer; font: inherit; }
.finder-on .chip .ico { width: 13px; height: 13px; }
.pop-title { padding: 6px 10px 4px; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.finder-results { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s-2) var(--s-3) var(--s-4); overscroll-behavior: contain; }
.finder-hint { padding: var(--s-4) var(--s-2); text-align: center; }
body.finder-open { overflow: hidden; }
body.finder-open .popover-backdrop { z-index: 94; }   /* the filter menu opens over the search, not under it */
body.finder-open .popover { z-index: 95; }
.page-title { font-size: 32px; letter-spacing: .6px; }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }
.sec-title { display: flex; align-items: center; gap: var(--s-2); font: 600 15px/1 var(--cond); text-transform: uppercase; letter-spacing: .3px; margin: var(--s-5) 0 var(--s-3); }
.sec-title .ico { width: 16px; height: 16px; stroke-width: 2; }
.sec-title .right { margin-left: auto; font: 400 12px/1 var(--sans); color: var(--muted); text-transform: none; letter-spacing: 0; }
/* A card's title row is as tall as the small button some of them carry (Nuovo prospect, Registra vendita, Modifica...), so a
   title with a button sits exactly where one without sits ("Collegamenti" sat lower than "Ricevute"), and the button keeps
   the card's padding above it (pulling it up glued it to the edge; owner 2026-10-30). */
.card-head .sec-title, .card > .sec-title:first-child { min-height: 36px; }
.rec-title { font-size: 25px; }
.counter { display: inline-block; padding: 3px 8px 1px; border-radius: 4px; background: var(--ink); color: #fff; font: 700 24px/1 var(--cond); box-shadow: inset 0 -3px 0 rgba(0,0,0,.5); }
@media (max-width: 600px) { .page-title { font-size: 30px; } }

/* ---------------------------------------------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 44px; padding: 0 var(--s-4); border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(180deg, #fbfaf8, #e4e1da); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; box-shadow: var(--sh-btn-grey); white-space: nowrap; transition: transform .1s, box-shadow .1s; }
.btn .ico { width: 16px; height: 16px; }
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn.primary { background: var(--accent-grad); border-color: var(--accent-shadow); box-shadow: var(--sh-btn-y); }
.btn.primary:active { transform: translateY(3px); }
.btn.confirm { background: var(--dark-grad); border-color: #000; color: #fff; box-shadow: var(--sh-btn-dark); }
.btn.confirm:active { transform: translateY(3px); }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); box-shadow: none; }
.btn.sm { height: 36px; padding: 0 var(--s-3); font-size: 13px; border-radius: var(--r-md); }
.btn.ghost { background: none; border-color: transparent; box-shadow: none; }
.btn:disabled, .btn.disabled { background: #e3e1db; color: var(--faint); border-color: var(--line); box-shadow: none; transform: none; cursor: default; filter: none; }
.btn.loading { color: transparent; position: relative; }
.btn.loading::after { content: "…"; position: absolute; color: var(--ink); }
.btn.confirm.loading::after { color: #fff; }
@media (min-width: 1081px) { .btn { height: 40px; } }

/* ------------------------------------------------------------------------------------------------------ chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: var(--r-sm); border: 1px solid var(--line); font: 600 10px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .3px; color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.chip.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.ok { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.chip.soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-text); }
/* In the demo organisation (039): a DEMO pill by the logo; a tap goes back. */
.demo-pill { flex: none; align-self: center; margin-left: 6px; min-height: 28px; padding: 4px 8px; border: 0; border-radius: 6px; background: var(--accent); color: #1c1f22; box-shadow: 0 0 0 2px #1c1f22; font: 700 12px/1 var(--cond); letter-spacing: 1px; cursor: pointer; }
.chip.urgent { background: var(--danger, #c62828); border-color: var(--danger, #c62828); color: #fff; }   /* urgent, solid red (owner 2026-10-30); .chip.danger below stays the pale warning */
.chip.warn { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip.danger { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
.chip.src { padding: 1px 5px; border-radius: 4px; border-color: var(--faint); font-size: 10px; }
.chip.src.conflict { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.due { display: inline-block; padding: 2px 7px; border-radius: 6px; font: 600 11px/1.3 var(--sans); background: var(--neutral-soft); color: var(--muted); white-space: nowrap; }
.due.yesterday, .due.overdue { background: var(--danger-soft); color: var(--danger); }
.due.today { background: var(--accent-soft); color: var(--accent-text); }

/* filters and segmented */
.filters { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters.grabbing, .tabs.grabbing, .doc-tabs.grabbing { cursor: grabbing; user-select: none; -webkit-user-select: none; }   /* a sideways row dragged with the mouse (app.js) */
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 7px 12px;   /* A19/A22 (audit): one chip height everywhere (30 / 34 px before), a full tap target */ border-radius: 6px; border: 1px solid var(--line); background: var(--surface-flat); font: 500 12px/1.2 var(--sans); white-space: nowrap; cursor: pointer; }
.filter.active { background: var(--dark-grad); border-color: var(--ink); color: #fff; }
.segmented { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: #e9e8e3; }
.segmented button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: none; font: 600 13px/1 var(--sans); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.segmented button .ico { width: 16px; height: 16px; }
.segmented button.active { background: var(--ink); color: #fff; }
/* An option not chosen is a button too, raised like the tabs (owner 2026-10-30: it read as plain text); the chosen one is
   pressed in, dark. */
.segmented { gap: 6px; padding: 0; background: none; }   /* the buttons are raised now: no grey tray around them (owner 2026-10-30) */
.segmented button:not(.active) { background: linear-gradient(180deg, #fbfaf8, #e4e1da); border: 1px solid var(--line); box-shadow: var(--sh-btn-grey); color: var(--ink); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.segmented button:not(.active):hover { filter: brightness(.97); }
.segmented button:not(.active):active { transform: translateY(2px); box-shadow: none; }
.segmented button.active { box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
html.theme-dark .segmented button:not(.active) { background: var(--surface-flat); border-color: var(--line); color: var(--ink); }
.segmented button .n { font-weight: 500; opacity: .7; }

/* ------------------------------------------------------------------------------------------- cards and rows */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-card); padding: var(--s-3) var(--s-4); }
.card.tight { padding: 0; overflow: hidden; }
.card + .card { margin-top: var(--s-2); }
.grid > .card { margin-top: 0; }
.ent { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.ent .thumb { width: 56px; height: 44px; border-radius: 6px; background: repeating-linear-gradient(135deg, #e3e1db 0 6px, #eeece6 6px 12px); flex: none; object-fit: cover; }
.ent .body { flex: 1; min-width: 0; }
.ent .body b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ent .body small { display: block; font-size: 12px; color: var(--muted); }
.ent-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 7px 12px; font: 600 12px/1.3 var(--sans); background: var(--neutral-soft); color: var(--muted); border-top: 1px solid var(--line-soft); }
.ent-foot.today { background: var(--accent-soft); color: var(--accent-text); }
.ent-foot.yesterday, .ent-foot.overdue { background: var(--danger-soft); color: var(--danger); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv label { font-size: 13px; color: var(--muted); flex: none; }
.kv .v { font-weight: 600; text-align: right; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kv .v .ico { width: 14px; height: 14px; color: var(--muted); }
.kv .owner-only { font: 400 11px/1 var(--sans); color: var(--faint); }
.row { display: flex; align-items: center; gap: var(--s-3); min-height: 54px; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row .time { width: 46px; font: 700 17px/1 var(--cond); flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .body b { display: block; font-weight: 600; }
.row .body small { display: block; font-size: 12px; color: var(--muted); }
.row.past { color: var(--faint); }
.row.past b { text-decoration: line-through; font-weight: 500; color: var(--faint); }
.row.next { background: var(--accent-soft); }
.grid { display: grid; gap: var(--s-3); }
.grid.cols-4 { grid-template-columns: 1fr 1fr; gap: var(--s-2); }
@media (min-width: 1081px) { .grid.cols-3 { grid-template-columns: 1fr 1fr 1.45fr; } .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); } }
.kpi { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.kpi .sq { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--neutral-soft); flex: none; }
.kpi .sq.accent { background: var(--accent-soft); }
.kpi .sq .ico { width: 18px; height: 18px; }
.kpi small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.indicators { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s-3); }
.indicators::-webkit-scrollbar { display: none; }
.indicator { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface-flat); font: 600 12px/1 var(--sans); }
.indicator .ico { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------------------------------- dashboard */
.only-desktop { display: none; }
@media (min-width: 1081px) { .only-desktop { display: block; } .grid.only-desktop { display: grid; } .page-actions.only-desktop { display: flex; } .only-phone { display: none !important; } }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.dash-head .page-title { margin-top: 4px; }
.dash-seg { position: sticky; top: calc(var(--header-h) + var(--top)); z-index: 20; margin: 0 0 var(--s-3); box-shadow: 0 6px 12px -8px rgba(0,0,0,.3); }
.dash-sections { display: grid; gap: var(--s-3); }
/* Quick links at the bottom of the dashboard (owner 2026-10-30): tiles, one row on the PC, 4 by 2 on phones. */
.dash-links { flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); }
.dash-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 64px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-card); color: var(--ink); font: 600 12px/1.1 var(--sans); text-align: center; text-decoration: none; }
.dash-link:active { transform: translateY(1px); box-shadow: none; }
.dash-link .ico { width: 20px; height: 20px; }
.dash-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-link b { position: absolute; top: 5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--neutral-soft); font: 700 11px/18px var(--sans); }
.dash-link b.hot { background: var(--danger, #c62828); color: #fff; }
@media (max-width: 1080px) {
  /* One row that slides sideways (A3, audit: two rows of tiles took ~125 px of a phone's screen). */
  .dash-links { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; padding: var(--s-2) 0; margin: 0 calc(-1 * var(--s-2)); padding-left: var(--s-2); padding-right: var(--s-2); }
  .dash-links::-webkit-scrollbar { display: none; }
  .dash-link { flex: 0 0 78px; min-height: 54px; font-size: 11px; }
}
.card-head { padding: var(--s-3) var(--s-4) 0; }
.card-head .sec-title { margin: 0 0 var(--s-2); }
/* A title that opens a card sits where a .card-head's does: the card's padding only, not also the section gap above it
   ("Dove venderla" sat lower than its neighbours, owner 2026-10-30). */
.card > .sec-title:first-child { margin-top: 0; margin-bottom: var(--s-2); }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--s-4); border-top: 1px solid var(--line-soft); font-size: 12px; }
.row-label { padding: 10px var(--s-3) 4px; border-top: 1px solid var(--line-soft); }
.card.tight .state { padding: var(--s-5) var(--s-4); }
.card.tight .state h3 { font-size: 16px; }
.card.tight .state p { margin-bottom: 0; font-size: 13px; }
.progress { height: 5px; border-radius: 3px; background: #e3e1db; margin: 0 0 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ink); width: 0; transition: width .25s; }
.todo { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px var(--s-3) 4px var(--s-4); border-bottom: 1px solid var(--line-soft); }
.todo .tick { width: 22px; height: 22px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface-flat); display: grid; place-items: center; cursor: pointer; padding: 0; }
.todo .tick .ico { width: 14px; height: 14px; color: var(--accent); stroke-width: 3; }
.todo.done .tick { background: var(--ink); border-color: var(--ink); }
.todo .tick.dashed { border-style: dashed; cursor: default; }
.todo .text { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; }
.todo.done .text { text-decoration: line-through; color: var(--faint); }
.todo .icon-btn.sm { width: 36px; height: 36px; opacity: 0; }
@media (hover: none) { .todo .icon-btn.sm { opacity: .55; } }   /* A7 (audit): a touch screen has no hover, so the X was invisible yet tappable */
.todo .tick { position: relative; }
.todo .tick::after { content: ""; position: absolute; inset: -9px; }   /* A5 (audit): a 40 px tap target around the 22 px box */
.card-foot a { padding: 8px 0; }   /* A6 (audit): "Agenda ›", "Tutte ›" were 17 px tall to tap */
.todo:hover .icon-btn.sm, .todo .icon-btn.sm:focus-visible { opacity: 1; }
@media (hover: none) { .todo .icon-btn.sm { opacity: .6; } }
.todo .icon-btn.sm .ico { width: 16px; height: 16px; color: var(--muted); }
.todo.add { width: 100%; border: 0; border-top: 1px solid var(--line-soft); background: none; cursor: pointer; text-align: left; font: inherit; }
.todo.add:hover { background: rgba(0,0,0,.03); }
.todo.add .tick.dashed .ico { color: var(--muted); stroke-width: 2; }
.todo .text { cursor: pointer; }
.filters.top-sm { margin-top: 8px; }
.todo-empty { padding: var(--s-4); font-size: 13px; }
/* the two panes of Da fare: open ones above, the ones ticked today below a label that never scrolls away */
.todo-panes { display: flex; flex-direction: column; min-height: 0; }
.todo-split { display: flex; align-items: center; gap: 6px; flex: none; padding: 8px var(--s-4); background: var(--ok-soft); color: var(--ok); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.todo-split .ico { width: 14px; height: 14px; stroke-width: 2.5; }
.todo-pane.done { background: var(--neutral-soft); }
@media (min-width: 1081px) {
  .dash-fixed .todo-panes { flex: 1; min-height: 0; }
  .dash-fixed .todo-pane { flex: 1 1 60%; min-height: 0; overflow-y: auto; }
  .dash-fixed .todo-pane.done { flex: 0 1 40%; }
}
.table.deals td { padding: 10px 12px; }
.table.deals tr:last-child td { border-bottom: 0; }
.accent-text { color: var(--accent-text); font-weight: 600; }
.danger-text { color: var(--danger); font-weight: 600; }
.deals-cards { padding: var(--s-3); }
@media (max-width: 1080px) {
  /* The calendar and the dashboard fill the screen and scroll inside; the page itself never moves (owner 2026-10-30: on a
     phone a pull on the calendar's date scrolled it, the address bar and safe areas leaving a few pixels over). */
  /* the dashboard on phones: greeting, indicators and the selector stay put, only the cards scroll */
  .page.dash { height: calc(100vh - var(--header-h) - var(--top) - var(--quickbar-h) - 1px); height: calc(var(--app-h, 100dvh) - var(--header-h) - var(--top) - var(--quickbar-h) - 1px); display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
  .page.dash .dash-head, .page.dash .indicators, .page.dash .dash-seg { flex: none; }
  .page.dash .dash-seg { position: static; box-shadow: none; }
  /* The chosen card takes the height the others leave and scrolls inside; Messaggi recenti right under it (A3/A4, audit
     2026-10-31: on a tablet ~260 px sat empty; an explicit 1fr row, not the spare spread between rows that floated it). */
  .page.dash .dash-sections { align-content: stretch; grid-template-rows: minmax(0, 1fr) auto; }
  .page.dash .dash-main > .card { height: 100%; display: flex; flex-direction: column; min-height: 0; }
  .page.dash .dash-main > .card > .card-scroll, .page.dash .dash-main > .card > .todo-panes { flex: 1; min-height: 0; overflow-y: auto; }
  .page.dash .dash-main > .card > :not(.card-scroll):not(.todo-panes) { flex: none; }
  .page.dash .dash-sections { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: var(--s-4); margin: 0 calc(-1 * var(--s-2)); padding-left: var(--s-2); padding-right: var(--s-2); }
  .dash-sections > [data-seg] { display: none; }
  .dash-sections[data-active="oggi"] > [data-seg="oggi"], .dash-sections[data-active="fare"] > [data-seg="fare"], .dash-sections[data-active="trattative"] > [data-seg="trattative"] { display: block; }
}
.kpi { min-width: 0; }   /* A1 (audit 2026-10-31): a long "next" line widened the PC's four cards past the screen */
.kpi .kpi-body { min-width: 0; flex: 1; }
#kpiTodo { display: contents; }
.kpi .kpi-next { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .kpi-next b { color: var(--ink); }
.card-scroll { position: relative; }
.todos-group + .todos-group { margin-top: var(--s-3); }
@media (min-width: 1081px) {
  .dash-sections { grid-template-columns: 1fr 1fr 1.45fr; }
  /* The page is exactly the window (never a scroll of a few pixels: it was 23 px over at 1853x959, the cards' height assumed
     360 px for the rest and it took 462). The main row takes what the greeting, the indicators and Messaggi leave, its lists
     scroll inside their card; below 700 px of window the page keeps that height and scrolls instead of squashing. */
  .page.dash { height: max(700px, calc(100vh - 6px)); height: max(700px, calc(100dvh - 6px)); display: flex; flex-direction: column; }
  .page.dash > * { flex: none; }
  .page.dash > .dash-sections { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  .dash-main { min-height: 0; }
  .dash-main .dash-fixed { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .dash-fixed .card-head, .dash-fixed .card-foot, .dash-fixed .todo.add { flex: none; }
  .dash-fixed .card-scroll { flex: 1; min-height: 0; overflow-y: auto; }
  .dash-sections > .dash-bottom { grid-column: 1 / -1; }   /* one bottom card (Messaggi) across the row */
  #dashKpi { margin-bottom: var(--s-3); }
  .dash-seg { display: none; }
  /* A2 (audit): the PC has the sidebar, so no quick-link tiles there (they took the three cards' height); Messaggi recenti
     keeps to a few rows and scrolls inside, the main row gets the rest. */
  .page.dash .dash-links { display: none; }
  .dash-sections > .dash-bottom .card-scroll, .dash-sections > .dash-bottom .row-list { max-height: 168px; overflow-y: auto; }
}

/* tables (desktop lists) */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 8px 12px; font: 600 11px/1.2 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: rgba(0,0,0,.03); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }   /* a number's heading over its numbers */

/* ------------------------------------------------------------------------------------------------------ forms */
.field { margin-bottom: var(--s-3); }
.field label { display: block; font: 600 11px/1.2 var(--sans); letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field.error label { color: var(--danger); }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.field-row { display: flex; gap: var(--s-2); }
.field-row > * { flex: 1; min-width: 0; }
input, select, textarea { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-flat); color: var(--ink); font: 500 15px/1.2 var(--sans); box-shadow: var(--sh-inset); }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border: 1.5px solid var(--ink); }
input::placeholder { color: var(--faint); }
.input-unit { position: relative; }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); }
.input-unit input { padding-right: 36px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; min-height: 32px; }
input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); box-shadow: none; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; }
/* A list of options to pick one from (radio rows): the whole row is the label, the chosen one is marked. */
.choices { display: flex; flex-direction: column; gap: 6px; margin: var(--s-3) 0; }
.choice, .field .choices .choice { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-flat); cursor: pointer; font: 500 14px/1.3 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.field .choices { margin-top: 4px; }
.choice input[type=radio] { width: 18px; height: 18px; margin: 0; padding: 0; flex: none; accent-color: var(--ink); box-shadow: none; border: 0; background: none; }
.choice small { color: var(--muted); font-size: 12px; margin-left: auto; white-space: normal; text-align: right; }
.choice > span { flex: none; }
.field .swatches .swatch-pick { display: block; margin: 0; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice .inline-num { display: inline-block; width: 76px; height: 32px; padding: 0 8px; margin: 0 4px; font-size: 14px; }
.choices.row3 { flex-direction: row; flex-wrap: wrap; }
.choices.row3 .choice { flex: 1 1 140px; min-height: 40px; padding: 0 10px; font-size: 13px; }
.step.top { margin-top: var(--s-4); }
/* Email in arrivo (033): the rules, the colour swatches, the preview */
.rule-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.rule-row.off { opacity: .6; }
.rule-row .body { flex: 1; min-width: 0; }
.rule-row .body b { display: block; font-size: 14px; }
.rule-row .body small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.rule-row .btn-row { flex: none; flex-wrap: wrap; justify-content: flex-end; }
.rule-pos { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px/26px var(--sans); text-align: center; flex: none; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.swatch-pick { position: relative; width: 34px; height: 34px; margin: 0; cursor: pointer; display: grid; place-items: center; }   /* A43 (audit): 28 px swatches, a 34 px target */
.swatch-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-pick i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.swatch-pick i.none { background: repeating-linear-gradient(45deg, #fff 0 4px, #ccc 4px 8px); }
.swatch-pick input:checked + i { border-color: var(--ink); outline: 2px solid var(--accent); }
/* The preview: one card per mail on the plate (text never sits on the grain), the taken ones marked on the left. */
.preview-list { display: flex; flex-direction: column; gap: 8px; margin-top: var(--s-3); max-height: 320px; overflow-y: auto; padding: 2px; }
.preview-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface-flat); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; box-shadow: var(--sh-card); }
.preview-row.hit { border-left-color: var(--accent); }
.preview-row:not(.hit) .body b { color: var(--muted); }
.preview-row .body { flex: 1; min-width: 0; }
.preview-row .body b { display: block; font-size: 14px; }
.preview-row .body small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.preview-row .chip { flex: none; margin-top: 2px; }
.ok-text { color: var(--ok); font-weight: 600; }
/* Email page (034): one row per mail, unread in bold with a dot, marks and Claude's reading under the subject. */
.mail-list { display: flex; flex-direction: column; }
.mail-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px 10px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.mail-row:hover { background: rgba(0,0,0,.03); }
.mail-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 8px; flex: none; }
.mail-row.unread .mail-dot { background: var(--accent-text); }
.mail-row .body { flex: 1; min-width: 0; }
.mail-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mail-who { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.mail-row.unread .mail-who, .mail-row.unread .mail-subj { font-weight: 700; }
.mail-lead { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--accent-text); white-space: nowrap; }
.mail-lead .ico { width: 13px; height: 13px; }
.mail-when { margin-left: auto; white-space: nowrap; flex: none; }
.mail-subj { font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; min-width: 0; }
.mail-meta .mail-sum { flex: 1 1 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-flag { color: var(--danger); display: inline-flex; } .mail-flag .ico, .mail-att .ico { width: 14px; height: 14px; }
.mail-att { color: var(--muted); display: inline-flex; }
.mail-actions { display: flex; gap: 4px; flex: none; }
.mail-actions .icon-btn.on { color: var(--danger); }
.filters-count { margin-left: auto; align-self: center; white-space: nowrap; }
.seg-count { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--ink); font: 700 11px/18px var(--sans); text-align: center; vertical-align: middle; margin-left: 4px; }
.segmented button.active .seg-count { background: var(--accent); }
.btn-row.center { justify-content: center; }
@media (max-width: 1080px) { .mail-actions { display: none; } .mail-meta .mail-sum { display: none; } }
.mail-hist .body { position: relative; padding-bottom: 18px; }
.mail-hist-when { position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-hist-when .ico { width: 13px; height: 13px; }
.mail-hist.clickable { cursor: pointer; }
.mail-hist.clickable:hover { background: rgba(0,0,0,.03); }
.mail-facts { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--ink); line-height: 1.45; }
.mail-facts .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ok); }
.mail-body { white-space: pre-wrap; font: 400 14px/1.5 var(--sans); max-height: 50vh; overflow-y: auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 1080px) { .rule-row { flex-wrap: wrap; } .rule-row .btn-row { width: 100%; justify-content: flex-start; } }
.form-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: var(--s-2) 0; }
/* The who/what picker: chips of what is linked, a search input, suggestions right under it. */
.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-chips:not(:empty) { margin-bottom: 8px; }
.ref-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border-radius: 16px; background: var(--ink); color: #fff; font: 600 13px/1 var(--sans); max-width: 100%; }
.ref-chip .ico { width: 15px; height: 15px; flex: none; }
.ref-chip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-chip button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; padding: 0; flex: none; }
.ref-chip button .ico { width: 13px; height: 13px; }
.ref-input { position: relative; }
.ref-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface-flat); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-pop); padding: 6px; max-height: 260px; overflow-y: auto; }
.ref-list .pop-item { height: auto; min-height: 42px; padding: 8px 10px; }
.ref-list .pop-item > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-none { padding: 10px 12px; font-size: 13px; }
.actions-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-top: var(--s-3); }

/* ------------------------------------------------------------------------------------------------ bottom sheet */
/* The sheet is a plate: hazard band on top, brushed metal, four rivets. Bottom sheet with a margin on phones, centred on desktop. */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(28,31,34,.5); z-index: 70; display: none; padding: 10px; }
.sheet-backdrop.open { display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); overflow: hidden; background: var(--plate-grain), var(--plate); border: 1px solid var(--line-strong); border-radius: var(--r-sheet); padding: 14px var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); box-shadow: var(--sh-plate); }
.sheet::before { content: ""; flex: none; display: block; height: 6px; margin: -14px calc(-1 * var(--s-4)) 10px; background: var(--hazard); }
/* Title and buttons always in view, only the middle scrolls (owner 2026-10-27). */
.sheet-body { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; }
/* Three zones (owner 2026-10-27): head and foot are flat bands edge to edge, no grain, so their text reads cleanly; only
   the body scrolls and keeps the grain. */
.sheet-head { flex: none; margin: -10px calc(-1 * var(--s-4)) 0; padding: 10px var(--s-4) 12px; background: var(--surface-flat); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset; }
.sheet-head h3 { margin: 2px 0 0; padding-right: 24px; }
.sheet-head .step { margin-bottom: 2px; }
.sheet-head .context { margin-bottom: 0; margin-top: 4px; }
.sheet-form { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; }
.sheet-scroll { flex: 1; min-height: 0; min-width: 0; width: 100%; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; padding: var(--s-3) 2px 4px; }
.sheet-foot { flex: none; margin: 0 calc(-1 * var(--s-4)) calc(-1 * (var(--s-4) + env(safe-area-inset-bottom))); padding: 12px var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); background: var(--surface-flat); border-top: 1px solid var(--line); box-shadow: 0 -4px 10px rgba(0,0,0,.06); }
.sheet-foot .actions-2 { margin-top: 0; }
.sheet-foot .form-err:empty { display: none; }
.sheet-foot .form-err { margin: 0 0 10px; min-height: 0; }
.sheet-backdrop.top { z-index: 75; background: rgba(28,31,34,.35); }
.sheet-backdrop.top .preview-list { max-height: none; margin: 0; overflow: visible; }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: #b9b6ae; margin: 2px auto 14px; }
.sheet h3 { font-size: 22px; margin: 8px 0 4px; }
.sheet .context { font-size: 12px; color: var(--muted); margin-bottom: var(--s-4); }
.sheet .step { font: 600 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.sheet .field input, .sheet .field select, .sheet .field textarea, .sheet .search-box { background: #fff; }
/* Text in a sheet reads black and a touch larger (owner 2026-10-27: "grey on grey, I can't read it"); hints a shade darker. */
.sheet-scroll { font-size: 15px; color: var(--ink); }
.sheet-scroll p { color: var(--ink); font-size: 15px; line-height: 1.5; }
.sheet-scroll p.muted, .sheet .context { color: #3f4347; }
.sheet .hint { color: #5a5e63; font-size: 13px; }
.sheet .check-row label, .sheet .checks label { font-size: 14px; color: var(--ink); }
@media (min-width: 1081px) {
  .sheet-backdrop.open { align-items: center; }
  .sheet { width: min(600px, 92vw); max-height: 90vh; border-radius: 14px; padding: 14px 32px 0; }
  .sheet::before { margin: -14px -32px 14px; height: 8px; top: -14px; }
  .sheet-grab { display: none; }
  .sheet::before { margin-bottom: 0; }
  .sheet-head { margin: 0 -32px 0; padding: 14px 32px 14px; }
  .sheet-foot { margin: 0 -32px 0; padding: 14px 32px 20px; }
  .sheet-scroll { padding: var(--s-4) 4px 8px; }
}
/* owner 2026-11-03: no rivets on a sheet (the last one, top-left, is gone too) */
.sheet-rivets { display: none; }

/* ---------------------------------------------------------------------------------------------------- popover */
.popover-backdrop { position: fixed; inset: 0; z-index: 80; display: none; }
.popover-backdrop.open { display: block; }
.popover { position: fixed; z-index: 81; width: 260px; background: var(--surface-flat); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-pop); padding: 6px; }
.pop-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.pop-head b { display: block; font-size: 14px; }
.pop-head small { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: 500 14px/1 var(--sans); cursor: pointer; }
.pop-item:hover { background: rgba(0,0,0,.05); }
.pop-item .ico { width: 18px; height: 18px; color: var(--muted); }
.pop-item .right { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pop-item.danger { color: var(--danger); }
.pop-item.danger .ico { color: var(--danger); }
.pop-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }
.pop-foot { padding: 8px 12px 6px; font-size: 11px; color: var(--faint); display: flex; justify-content: space-between; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.accent { background: var(--accent); }

/* ------------------------------------------------------------------------------------------------------ toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--quickbar-h) + 12px); transform: translate(-50%, 20px); display: flex; align-items: center; gap: var(--s-3); max-width: min(92vw, 480px); padding: 10px 12px 10px 16px; border-radius: var(--r-lg); background: var(--ink); color: #fff; font: 500 14px/1.3 var(--sans); box-shadow: var(--sh-pop); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.err { background: var(--danger); }
.toast button { height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; background: none; color: var(--accent); font: 600 13px/1 var(--sans); cursor: pointer; }
.toast.err button { color: #fff; }
/* Desktop (owner 2026-10-27: the centred one was in the way): bottom right, smaller, slides in from the right. */
@media (min-width: 1081px) {
  .toast { left: auto; right: 20px; bottom: 20px; transform: translate(16px, 0); max-width: 360px; padding: 8px 10px 8px 14px; font-size: 13px; }
  .toast.show { transform: translate(0, 0); }
  .toast button { height: 28px; font-size: 12px; }
}

/* ----------------------------------------------------------------------------------------------- screen states */
.skel { background: linear-gradient(90deg, #e3e1db 25%, #eeece6 50%, #e3e1db 75%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 6px; min-height: 14px; }
.skel.t { height: 14px; width: 60%; margin: 8px 0; }
.skel.s { height: 12px; width: 40%; margin: 6px 0; }
.skel.card { height: 86px; margin-bottom: var(--s-2); border-radius: var(--r-md); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Loader "Industriale": a riveted plate with a hazard strip that runs like a conveyor and a yellow LED that blinks.
   One per page while the data comes; it spans every column of the grid it sits in. */
/* the loader sits over the whole page, centred, on a light veil, while a page's data comes */
.loader { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: var(--s-4); background: rgba(214,211,203,.55); backdrop-filter: blur(2px); animation: loader-in .25s ease-out both; }
.loader-plate { position: relative; width: min(100%, 300px); padding: var(--s-5) var(--s-5) var(--s-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-card), 0 10px 24px rgba(0,0,0,.08); text-align: center; }
.loader-plate .rivet { width: 9px; height: 9px; }
.loader-plate .rivet.tl, .loader-plate .rivet.tr { top: 8px; } .loader-plate .rivet.bl, .loader-plate .rivet.br { bottom: 8px; }
.loader-plate .rivet.tl, .loader-plate .rivet.bl { left: 8px; } .loader-plate .rivet.tr, .loader-plate .rivet.br { right: 8px; }
.loader-label { display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin-bottom: var(--s-3); font: 700 15px/1 var(--cond); letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); }
.loader-led { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--ink), 0 0 8px var(--accent); animation: led-blink 1s steps(1) infinite; }
.loader-bar { height: 12px; border-radius: 6px; overflow: hidden; background: var(--ink); box-shadow: var(--sh-inset), 0 1px 0 #fff; }
.loader-bar::before { content: ""; display: block; height: 100%; width: calc(100% + 34px); background: var(--hazard); animation: hazard-run .9s linear infinite; }
.loader-hint { margin-top: var(--s-2); font: 500 11px/1.2 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
@keyframes hazard-run { to { transform: translateX(-33.94px); } }
@keyframes led-blink { 50% { background: var(--accent-shadow); box-shadow: 0 0 0 2px var(--ink); } }
@keyframes loader-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .loader-bar::before, .loader-led, .loader { animation: none; } }
.state { text-align: center; padding: var(--s-6) var(--s-4); }
.state .sq { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto var(--s-3); background: var(--neutral-soft); }
.state .sq .ico { width: 26px; height: 26px; color: var(--muted); }
.state.error .sq { background: var(--danger-soft); }
.state.error .sq .ico { color: var(--danger); }
.state h3 { font-size: 20px; margin-bottom: 6px; }
.state p { margin: 0 0 var(--s-4); color: var(--muted); }
.state .btn { margin: 0 4px; }
.banner { display: flex; align-items: center; gap: var(--s-2); padding: 10px 14px; border-radius: var(--r-md); font-weight: 500; margin-bottom: var(--s-3); }
.banner.offline { background: var(--ink); color: #fff; }
.banner.stale { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--ink); }
.banner .btn { margin-left: auto; }

/* ------------------------------------------------------------------------------------------------- auth screens */
.auth { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 72px var(--s-4) 56px; background: #0f1113 radial-gradient(ellipse at 30% 70%, rgba(244,201,0,.08), transparent 55%); color: #fff; overflow: hidden; }
.auth-scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.auth-top { position: absolute; top: 20px; left: 24px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.auth-top .logo-badge { width: 36px; height: 36px; font-size: 15px; border-radius: 8px; }
.auth-top b { display: block; font: 700 14px/1 var(--cond); letter-spacing: .5px; }
.auth-top small { display: block; font-size: 11px; color: rgba(255,255,255,.55); margin-top: 3px; }
.auth-foot { position: absolute; left: 24px; right: 24px; bottom: 16px; display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.4); z-index: 2; }
.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.plate-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.hours { text-align: right; margin-top: 6px; }
.hours small { display: block; margin-bottom: 4px; font-size: 9px; letter-spacing: 1px; }
.hours .digit { display: inline-grid; place-items: center; width: 16px; height: 24px; margin-left: 2px; border-radius: 3px; background: var(--ink); color: #fff; font: 700 17px/1 var(--cond); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.hours .digit.last { background: var(--accent); color: var(--ink); }
.plate { transition: transform .15s ease-out; will-change: transform; }
/* Phones: the card anchored at the bottom, whole on any height; the excavator in what is left above it (owner 2026-10-30: with
   the browser's bars the card ran off the bottom under a fixed 44% band). */
@media (max-width: 859px) { .auth { align-items: end; padding-top: 72px; } .auth-scene { position: absolute; } }
.auth-eyebrow { font: 600 12px/1.2 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.auth-claim { font: 700 44px/.95 var(--cond); text-transform: uppercase; color: #fff; margin-bottom: 10px; }
.auth-sub { color: rgba(255,255,255,.6); font-size: 15px; margin: 0 0 var(--s-5); }
.plate { position: relative; background: var(--plate-grain), var(--plate); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--sh-plate); padding: 26px 28px 22px; overflow: hidden; }
.plate::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: var(--hazard); }
.rivet { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #b9b6ae 55%, #7d7a73); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.rivet.tl { top: 14px; left: 10px; } .rivet.tr { top: 14px; right: 10px; } .rivet.bl { bottom: 10px; left: 10px; } .rivet.br { bottom: 10px; right: 10px; }
.plate .caps { margin-top: 6px; }
.plate h1 { font-size: 38px; margin: 4px 0 14px; }
.plate-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); padding: 10px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: var(--s-4); }
.plate-meta small { display: block; font: 600 9px/1.2 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.plate-meta b { font: 700 15px/1.1 var(--cond); text-transform: uppercase; }
.plate .field label { display: flex; justify-content: space-between; }
.plate .field label a { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 8px; border: 0; background: none; font: 600 13px/1 var(--sans); cursor: pointer; }
.btn.start { width: 100%; height: 56px; font-size: 16px; margin-top: var(--s-2); }
.btn.start .keyhole { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); }
.btn.start.loading .keyhole { border-color: var(--accent); background: var(--accent); }
.plate-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s-4); padding-top: 12px; border-top: 1px solid var(--line); font: 600 10px/1.2 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.plate-foot .led { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 860px) {
  .auth-wrap { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--s-6); align-items: center; }
  .auth-claim { font-size: 56px; }
  .plate { padding: 26px 40px 24px; }
}
@media (max-width: 859px) { .auth-copy { display: none; } }

/* ---------------------------------------------------------------------------------------------- lists, records */
.small { font-size: 12px; }
.top { margin-top: var(--s-3); }
.pad { padding: var(--s-3) var(--s-4); }
.stack { display: grid; gap: var(--s-2); }
.stack > * { min-width: 0; }   /* a long unbroken word (an email address) widened the whole card past the screen (owner 2026-10-30) */
.card.msg { overflow-wrap: anywhere; }
.filters .info-btn { display: inline-flex; align-items: center; padding-left: 10px; padding-right: 10px; }
.page-info { margin: 0 0 var(--s-2); }
.stack.pad { padding: var(--s-3); }
.more { margin: var(--s-3) 0; text-align: center; }
.search-box { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-2) 0 var(--s-3); height: 48px; margin-bottom: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-flat); box-shadow: var(--sh-inset); }
.search-box .ico { color: var(--muted); }
.search-box input { height: 100%; border: 0; box-shadow: none; background: none; padding: 0; }
.search-box input:focus { border: 0; }
/* A list's search and chips stay pinned while the list scrolls under them (owner 2026-10-30). */
.list-head { position: sticky; top: var(--top); z-index: 19; display: grid; gap: var(--s-2); padding: var(--s-2) 0 6px; margin-bottom: var(--s-2); background: var(--plate-grain), var(--plate); background-attachment: fixed; box-shadow: 0 10px 12px -12px rgba(0,0,0,.35); }
.list-head .search-box, .list-head .filters { margin: 0; }
/* Its top padding is there for when it pins; resting, it is pulled up by as much, so the search starts where any page's
   content does (owner 2026-10-30: Macchine sat 8 px lower than Cercano on the PC). */
.page > .page-head + .list-head { margin-top: calc(-1 * var(--s-2)); }
@media (max-width: 1080px) {
  .list-head { top: calc(var(--header-h) + var(--top)); margin-left: calc(-1 * var(--s-2)); margin-right: calc(-1 * var(--s-2)); padding-left: var(--s-2); padding-right: var(--s-2); }
}
/* Pages of a list on phones: the pager under it, the cards sliding in from the side swiped to. */
/* « ‹ [page] / total › » (owner 2026-10-30) */
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s-1); margin-top: var(--s-1); font: 600 14px/1 var(--sans); }
.more:has(> .pager) { margin-top: 0; margin-bottom: 0; }
/* The mailbox in pages: every row the same height (one line each, the subject and Claude's reading clipped), stretched alike. */
.mail-list.paged > .mail-row { height: var(--row-h, auto); overflow: hidden; flex: none; }   /* never squeezed to fit (overflow hidden drops the minimum size: rows shrank to one line, owner 2026-10-30) */
.page.list-fit .list-body > * { flex-shrink: 0; }
.mail-list.paged .mail-subj, .mail-list.paged .mail-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-list.paged .mail-meta { flex-wrap: nowrap; min-height: 1.5em; }
.mail-list.slide-l { animation: slide-l .22s ease-out both; }
.mail-list.slide-r { animation: slide-r .22s ease-out both; }
.pager .icon-btn { width: 36px; height: 36px; }   /* the pager down on the bottom of the page, one more item above it (owner 2026-10-30) */
.pager .icon-btn[disabled] { opacity: .3; }
.pager-at { display: flex; align-items: center; gap: 6px; margin: 0 var(--s-2); color: var(--muted); }
.pager-at input { width: 52px; height: 36px; padding: 0 4px; text-align: center; font: 600 15px/1 var(--sans); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.pager-at input::-webkit-inner-spin-button, .pager-at input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pager-at input:disabled { opacity: 1; background: none; }
/* An endless list (Aspetto): while the next ones load, this line at its end, with a spinner. */
.more-sentinel { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--s-4) 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
.list-cards.slide-l, #tableWrap.slide-l { animation: slide-l .22s ease-out both; }
.list-cards.slide-r, #tableWrap.slide-r { animation: slide-r .22s ease-out both; }
@keyframes slide-l { from { opacity: 0; transform: translateX(40px); } }
@keyframes slide-r { from { opacity: 0; transform: translateX(-40px); } }
@media (prefers-reduced-motion: reduce) { .list-cards.slide-l, .list-cards.slide-r, #tableWrap.slide-l, #tableWrap.slide-r { animation: none; } }
.list-cards { display: grid; gap: var(--s-2); }
.list-cards > .card > .ent { padding-top: 9px; padding-bottom: 9px; }   /* compact: a list page holds as many as fit (owner 2026-10-30) */
/* A page of a list: the rows grow alike to fill the screen down to the pager (the height comes from the page's measure). */
/* Phones and tablets, a list in pages: the page is the visible height, the list fills it, the pager at its bottom, nothing to
   scroll (owner 2026-10-30). */
@media (max-width: 1080px) {
  /* clip, not hidden: a hidden overflow can still be scrolled (a resize did), and the sticky search then floated 58 px down
     inside the page over the first card (owner 2026-10-30); nothing scrolls here, so the search is not sticky either. */
  .page.list-fit { height: calc(100vh - var(--header-h) - var(--top) - var(--quickbar-h) - 1px); height: calc(var(--app-h, 100dvh) - var(--header-h) - var(--top) - var(--quickbar-h) - 1px); display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
  .page.list-fit > * { flex: none; }
  .page.list-fit > .list-head { position: static; box-shadow: none; }
  .page.list-fit > #listBody, .page.list-fit > .list-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .page.list-fit #more, .page.list-fit .list-body > .more { margin-top: auto; }
}
/* Pages: every card the same height whatever its text (owner 2026-10-30: page 2 had taller ones and scrolled): the name on one
   line, the details on two at most; --row-min is the compact height the page counts with, --row-h what it stretches to. */
.list-cards.paged { --row-min: 74px; gap: 6px; }
.list-cards.paged > .card { height: var(--row-h, var(--row-min)); display: flex; align-items: center; overflow: hidden; }
.list-cards.paged > .card > .ent { flex: 1; min-width: 0; }
.list-cards.paged > .card .body > b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-cards.paged > .card .body > small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#tableWrap.fitted tbody > tr { height: var(--row-h); }
.list-cards > .card { margin-top: 0; }   /* the grid's gap only (.card + .card added its own: twice the space, owner 2026-10-30) */
.ent-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ent-foot.ok-foot { background: var(--ok-soft); color: var(--ok); display: flex; gap: 6px; }
.ent-foot .ico { width: 14px; height: 14px; }
.ent.nopad { padding: 0; }
.ent .body small a, .row .body small a, .kv a, .prose a, .note a { text-decoration: underline; text-underline-offset: 2px; }
.avatar-sq { width: 40px; height: 40px; border-radius: 8px; background: #e3e1db; color: var(--ink); display: grid; place-items: center; font: 700 13px/1 var(--cond); flex: none; }
.avatar-sq.ai { background: var(--ink); color: var(--accent); }
.avatar-sq .ai-logo { width: 20px; height: 20px; color: #fff; }
.avatar-sq .ico { width: 18px; height: 18px; color: var(--muted); }
/* The history in plain words (owner 2026-10-30): a day heading, sentences, the old value struck through. */
.day-head { padding: 10px var(--s-4) 4px; font: 600 12px/1 var(--cond); letter-spacing: .5px; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line-soft); }
.card-head + .day-head { border-top: 0; }
.receipt .what { color: var(--ink); font-size: 13px; }
.hist-what { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.hist-old { color: var(--faint); text-decoration: line-through; }
.hist-long summary { cursor: pointer; list-style: none; }
.hist-long summary::-webkit-details-marker { display: none; }
.hist-long p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.receipt-more { margin: -4px var(--s-4) 8px 64px; }
.receipt-more summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 4px 0; }
.receipt-more .row { padding-left: 0; padding-right: 0; }
.avatar-sq.big { width: 56px; height: 56px; font-size: 20px; }
.tcell { display: flex; align-items: center; gap: var(--s-3); }
.thumb.sm { width: 72px; height: 54px; }   /* owner 2026-10-29: the list's photos were too small to tell machines apart */
/* a machine without a photo: the same hatched placeholder as the cards (audit A23: the table showed an empty gap) */
.thumb.sm:not(.has-img) { border-radius: 6px; flex: none; background: repeating-linear-gradient(135deg, rgba(0,0,0,.07) 0 6px, rgba(0,0,0,.02) 6px 12px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.thumb img.loading { opacity: 0; }
.thumb.has-img { background: none; }
.table td.chev { width: 28px; color: var(--muted); }
.table td.chev .ico { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-bottom: var(--s-3); }
.back .ico { width: 16px; height: 16px; }
/* A record's header (photo, name, details, Modifica) and its tabs: on a phone only the tabs stick (the header would take
   the screen), from a tablet up both stick together, as one plate, under the app header. */
.rec-top { display: contents; }
@media (min-width: 601px) {
  .rec-top { display: block; position: sticky; top: calc(var(--header-h) + var(--top)); z-index: 20; padding-top: var(--s-2); margin-top: calc(-1 * var(--s-2)); background: var(--plate-grain), var(--plate); background-attachment: fixed; }
  .rec-top .tabs { position: static; margin-bottom: 0; padding-bottom: var(--s-2); }
  .rec-top + .banner, .rec-top + #tab { margin-top: var(--s-3); }
}
@media (min-width: 1081px) { .rec-top { top: var(--top); } }   /* like .tabs: right under the stripe */
.rec-head { display: flex; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-3); }
.rec-cover { transition: width .18s ease, height .18s ease; }
.rec-top.stuck .rec-cover { width: 66px; height: 50px; }   /* pinned: a thumbnail, the page gets the room */
.rec-top.stuck .rec-head { margin-bottom: var(--s-2); gap: var(--s-3); align-items: center; }
/* Pinned, the page scrolls under it: a soft shadow along its bottom edge marks where (owner 2026-10-30). */
.rec-top { transition: box-shadow .18s ease; }
.rec-top.stuck { box-shadow: 0 10px 14px -10px rgba(0,0,0,.35); }
/* ...and the rest of it with the photo: a smaller name and detail line, the chips closer (owner 2026-10-30). */
.rec-title { transition: font-size .18s ease; }
.rec-top.stuck .rec-title { font-size: 19px; line-height: 1.1; }
.rec-top.stuck .rec-main > .muted { font-size: 12px; line-height: 1.3; }
.rec-top.stuck .rec-chips { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .rec-title { transition: none; } }
@media (prefers-reduced-motion: reduce) { .rec-cover { transition: none; } }
.rec-cover { width: 120px; height: 90px; border-radius: var(--r-md); background: repeating-linear-gradient(135deg, #e3e1db 0 6px, #eeece6 6px 12px); flex: none; overflow: hidden; }
.rec-cover img { width: 100%; height: 100%; object-fit: cover; }
.rec-main { flex: 1; min-width: 0; }
.rec-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.rec-actions { display: flex; gap: var(--s-2); flex: none; }
.rec-actions .btn[aria-label] { width: 44px; padding: 0; }
@media (max-width: 600px) { .rec-head { flex-wrap: wrap; } .rec-cover { width: 100%; height: 160px; } .rec-actions { width: 100%; } .rec-actions .btn.primary { flex: 1; } }
/* A26 (audit): without a photo the 160 px box on a phone pushed the data ~480 px down; a small hatched thumbnail instead. */
@media (max-width: 600px) { .rec-cover:not(:has(img)) { width: 72px; height: 54px; } .rec-head:has(.rec-cover:not(:has(img))) { flex-wrap: nowrap; } }
/* A21 (audit): on a phone the search's own "Cerca" button cut the placeholder short; Enter searches. */
@media (max-width: 600px) { .search-box > .btn { display: none; } }
/* tabs as keys: one row of pressed-metal buttons, the active one dark */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; margin-bottom: var(--s-3); }
/* The tabs stay in view while their page scrolls (owner 2026-10-29: Admin's tabs went away with the title): under the
   phone's header, under the hazard stripe on desktops; the plate behind them hides what scrolls past. */
.tabs { position: sticky; top: calc(var(--header-h) + var(--top)); z-index: 20; background: var(--plate-grain), var(--plate); background-attachment: fixed; }
@media (min-width: 1081px) { .tabs { top: var(--top); } }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #fbfaf8, #e4e1da); box-shadow: var(--sh-btn-grey); font: 600 13px/1 var(--sans); color: var(--ink); cursor: pointer; white-space: nowrap; transition: transform .1s, box-shadow .1s; }
.tabs button:hover { filter: brightness(.96); }
.tabs button:active { transform: translateY(2px); box-shadow: none; }
.tabs button.active { background: var(--dark-grad); border-color: #000; color: #fff; box-shadow: inset 0 2px 4px rgba(0,0,0,.5); transform: translateY(1px); }
.tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
/* a long email or web address breaks instead of widening the record past a 360 px phone (found checking the audit fixes) */
.rec-col .v, .rec-col .v a { min-width: 0; overflow-wrap: anywhere; }
.rec-col { display: grid; gap: var(--s-3); align-content: start; }
@media (min-width: 1081px) { .rec-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0 0 var(--s-3); }
.section-head h2 { font: 600 16px/1 var(--cond); text-transform: uppercase; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.btn-row.top { margin-top: var(--s-3); }
.btn-row.pad { padding: var(--s-2) var(--s-3) var(--s-3); }
.row .btn-row { flex: none; }
.conflict { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.conflict .btn-row { margin-top: 6px; }
.prose { margin-top: var(--s-3); }
.prose p, .pre { white-space: pre-wrap; margin: 4px 0 0; }
.kv .owner-only { margin-left: 4px; }
.caps.top { margin-top: var(--s-3); margin-bottom: 6px; }
ul.plain { margin: 4px 0 0; padding-left: 18px; }
.checks.col { flex-direction: column; align-items: flex-start; }
/* a sheet's checkbox list in even columns, not a ragged wrap (audit A35: the new person's roles) */
.sheet .checks:not(.col) { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
details.det { padding: 0; }
details.det summary { padding: var(--s-3) var(--s-4); cursor: pointer; font-weight: 600; }
details.det[open] summary { border-bottom: 1px solid var(--line-soft); }
details.det > .card { border: 0; box-shadow: none; }
/* The rows and buttons inside keep the card's side margins (owner 2026-10-29: Admin → ChatGPT, "Dettagli tecnici"). */
details.det > :not(summary):not(.card) { margin-inline: var(--s-4); }
details.det[open] > :last-child:not(summary) { margin-bottom: var(--s-3); }
details.det summary:focus:not(:focus-visible) { outline: none; }   /* the focus ring for the keyboard only */
/* Long technical values (ids, keys, tool lists): the label above, the value under it, left-aligned and wrapping. */
details.det .kv { display: block; min-height: 0; padding: 10px 0; }
details.det .kv label { display: block; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 4px; }
details.det .kv .v { display: block; text-align: left; font-weight: 500; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
details.det .kv .v .btn { margin-left: 6px; vertical-align: middle; }
details.det code { font-size: 12px; }
.more-det summary { padding: 8px var(--s-3); cursor: pointer; font-size: 12px; }
.table.compact td, .table.compact th { padding: 6px 8px; font-size: 13px; }
.table.compact { margin-top: var(--s-2); }
.counter.sm { font-size: 16px; padding: 2px 6px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); }
@media (min-width: 1081px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }   /* PC: twice as big (owner 2026-10-30) */
/* A machine's files (038): one panel, its sections as sub-tabs (scrolling sideways on a phone), the open one's files below. */
.doc-panel { padding: var(--s-3) var(--s-4) var(--s-4); }
.doc-panel-head { display: flex; align-items: center; gap: var(--s-2); min-height: 34px; }
.doc-panel-head b { font: 600 15px/1 var(--cond); text-transform: uppercase; letter-spacing: .4px; }
.doc-panel-head .btn { margin-left: auto; flex: none; }
/* the sections and Carica on one row, no title repeating the tab (audit A28: two rows of tabs under a heading) */
.doc-panel-head { border-bottom: 1px solid var(--line-soft); margin: 0 calc(-1 * var(--s-4)) var(--s-3); padding: 0 var(--s-4) var(--s-2) 0; }
.doc-panel-head .doc-tabs { flex: 1; min-width: 0; margin: 0; padding: 0 0 0 var(--s-4); border-bottom: 0; }
.doc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: var(--s-2) calc(-1 * var(--s-4)) var(--s-3); padding: 0 var(--s-4) var(--s-2); border-bottom: 1px solid var(--line-soft); }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs button { flex: none; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font: 600 13px/1 var(--sans); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.doc-tabs button:hover { background: var(--surface-flat, #f1f0ec); color: var(--ink); }
.doc-tabs button.active { background: var(--ink); color: #fff; }
.doc-tabs button .n { font-weight: 500; opacity: .7; }
.doc-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.doc-panel .state { padding: var(--s-4) 0; }
.g-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-card); padding: 6px; }
.g-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
/* A photo's or document's caption and what was read on it: the size of a note's text (owner 2026-10-30), not .small's 12 px. */
.g-item .small { font-size: 14px; line-height: 1.4; margin-top: 6px; }
.g-pdf { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--neutral-soft); color: var(--muted); font: 600 12px/1 var(--sans); gap: 4px; }
.g-pdf .ico { width: 28px; height: 28px; }
.g-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
/* ChatGPT read this photo or document (its "Letto da ChatGPT" text below): the logo at the right of the row under it. */
.g-ai { width: 18px; height: 18px; flex: none; color: var(--ink); opacity: .85; }
.g-ai-btn { margin-left: auto; display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.g-ai-btn:hover { background: rgba(0,0,0,.06); }
.g-ai-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* What ChatGPT read, in the popover its logo opens. */
.pop-note { padding: 8px 10px; }
.pop-note-head { display: flex; align-items: center; gap: 8px; font: 600 13px/1 var(--cond); text-transform: uppercase; letter-spacing: .3px; }
.pop-note p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; max-height: 50vh; overflow-y: auto; }
.g-actions { position: absolute; top: 8px; right: 8px; }
.g-actions .icon-btn { background: rgba(251,250,248,.9); width: 32px; height: 32px; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pick-grid label { display: flex; flex-direction: column; gap: 4px; font: 500 12px/1.2 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); }
.pick-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.pick-grid input { width: 16px; height: 16px; vertical-align: middle; }
.note-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: 4px; }
.card.draft { border-left: 3px solid var(--accent); }
.card.msg.unread { border-left: 3px solid var(--accent); }
.receipt.undone .body b { text-decoration: line-through; color: var(--faint); }
.prospect .offers { margin: 0 var(--s-3) var(--s-2); width: auto; }
/* A prospect (Da chiamare, a machine's Vendita): head, short icon lines, the reason folded, the next step, an even grid of
   actions (owner 2026-10-30). */
.pr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-3) 6px; }
.pr-who { min-width: 0; }
.pr-who b { display: block; margin-top: 3px; font-size: 17px; line-height: 1.25; }
.pr-head > .chip { flex: none; }
/* The status and, with a phone in the contact, a call button (owner 2026-10-30: Da chiamare "needs some more love"). */
.pr-side { display: flex; align-items: center; gap: 6px; flex: none; }
.pr-call { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-grad); color: #1c1f22; box-shadow: var(--sh-btn, 0 2px 0 var(--accent-shadow)); }
.pr-call .ico { width: 17px; height: 17px; }
.pr-line a[href^="tel:"] { white-space: nowrap; }
/* A37/A39 (audit): phone, email and record links in cards were 14-20 px tall: a taller tap area, the same line. */
.pr-line a, .card.msg .small a, .card.want a { display: inline-block; padding: 6px 0; margin: -6px 0; }   /* a number in one piece, never 030 / 9651530 */
.pr-line.clamp1 { min-width: 0; }
.pr-line.clamp1 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-actions .btn .ico { width: 15px; height: 15px; flex: none; }
.pr-body { display: grid; gap: 5px; padding: 0 var(--s-3) var(--s-3); }
.pr-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.pr-line > .ico { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--muted); }
.pr-reason { margin: 2px 0; font-size: 13px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.pr-reason.open { -webkit-line-clamp: unset; display: block; }
.pr-next { display: flex; align-items: center; gap: 8px; padding: 9px var(--s-3); border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.pr-next .ico { width: 16px; height: 16px; flex: none; }
.pr-next.missing { color: var(--danger); font-weight: 600; }
.pr-next.today { background: var(--accent-soft); color: var(--accent-text); }
.pr-next.yesterday, .pr-next.overdue { background: var(--danger-soft); color: var(--danger); }
.pr-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: var(--s-2) var(--s-3) var(--s-3); border-top: 1px solid var(--line-soft); }
.pr-actions .btn { width: 100%; }
/* Phones: the reason on two lines (a tap opens it), the actions on one row: the next step and Prezzo with their words,
   Non interessato and Modifica as icons (owner 2026-10-30). */
@media (max-width: 1080px) {
  .pr-reason { -webkit-line-clamp: 2; }
  .pr-actions { display: flex; gap: 6px; }
  .pr-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; gap: 4px; overflow: hidden; }   /* A24 (audit): icons spilled out of narrow buttons */
  .pr-actions .pr-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pr-actions .pr-main { flex: 1.6 1 0; }
  .pr-actions .pr-icon { flex: 0 0 44px; padding: 0; justify-content: center; }
  .pr-actions .pr-icon .pr-lbl { display: none; }
}
/* The PC: the buttons in a column on the card's right (owner 2026-10-30), the card a row shorter. */
@media (min-width: 1081px) {
  /* Only on Da chiamare's wide cards (A25, audit: on a machine's Vendita tab the card is narrow and the column squeezed the
     text into 150 px); elsewhere the buttons stay a row under the card. */
  .calls-list .prospect { display: grid; grid-template-columns: minmax(0, 1fr) 210px; }
  .calls-list .prospect > :not(.pr-actions) { grid-column: 1; }
  .calls-list .prospect > .pr-actions { grid-column: 2; grid-row: 1 / span 6; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: var(--s-3); border-top: 0; border-left: 1px solid var(--line-soft); }
  .calls-list .prospect > .pr-actions .btn { justify-content: flex-start; }
}
/* Da chiamare: one list with its group titles among the cards (pages of whole cards). */
.calls-list .calls-title { margin-top: var(--s-2); }
.calls-list .calls-title:first-child { margin-top: 0; }
.calls-list.slide-l, .triage-list.slide-l { animation: slide-l .22s ease-out both; }
.triage-list.slide-r { animation: slide-r .22s ease-out both; }
.want-list.slide-l, .act-list.slide-l, .msg-list.slide-l { animation: slide-l .22s ease-out both; }
.msg-list.slide-r { animation: slide-r .22s ease-out both; }
/* A Cercano card, compact (owner 2026-10-30): head (what + urgency), facts, must-haves, one foot line with Abbinamenti. */
.want-list { gap: 6px; }
.card.want { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px var(--s-3); }   /* the column never wider than the card: the one-line foot pushed Abbinamenti off the page */
.want-list > .card { margin-top: 0; }   /* the list's 6 px gap only (.card + .card added 8 more) */
.want-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.want-head b { font-size: 16px; line-height: 1.2; min-width: 0; }
.want-head .chip { flex: none; }
.want-facts { font-size: 13px; line-height: 1.35; }
.want-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.want-chips .chip { padding: 1px 6px; font-size: 9.5px; }
.want-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: 12.5px; line-height: 1.35; }
.want-foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* one line (it wrapped to two beside the button): one more card per page (owner 2026-10-30) */
.want-foot .btn { flex: none; height: 28px; padding: 0 10px; font-size: 12px; }   /* the foot was the button's 36 px tall */
.card.want > [data-matches]:empty { display: none; }   /* no gap for the matches until they are asked for */
.want-list.slide-r, .act-list.slide-r, .calls-list.slide-r { animation: slide-r .22s ease-out both; }
.list-head .page-info { margin: 0; }
.calls-list.slide-r { animation: slide-r .22s ease-out both; }
.top-seg { margin-bottom: var(--s-3); max-width: 420px; }
/* Email's toolbar (owner 2026-10-30: "give this some love"): the folder switch and the search on one row on the PC, stacked
   on phones; the count right after the chips. */
.mail-bar { display: flex; gap: var(--s-2); align-items: stretch; }
.mail-bar .mail-seg { display: flex; flex: none; margin: 0; }
.mail-bar .mail-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-width: 128px; padding: 0 var(--s-4); }
.mail-bar .mail-seg .ico { width: 16px; height: 16px; }
.mail-bar .search-box { flex: 1; min-width: 0; height: 44px; margin: 0; }
#mailFilters .filters-count { margin-left: var(--s-2); align-self: center; white-space: nowrap; }
@media (max-width: 1080px) {
  .mail-bar { flex-direction: column; }
  .mail-bar .mail-seg button { flex: 1; min-width: 0; height: 38px; }   /* the controls took 205 px of the phone (audit A38) */
  .mail-bar .search-box { flex: none; height: 48px; }   /* in the column, flex 1 started it at zero height */
}
/* Admin > Utenti e seat (owner 2026-10-30): one row per user, who | role | ChatGPT | every action at the right; on a narrower
   screen the ChatGPT state and the actions go under the name. The seat summary on one line. */
/* The columns are the list's, shared by every row (subgrid), so role, ChatGPT and the buttons line up whatever a row holds. */
.user-list { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(240px, 1fr) auto auto; }   /* who, role, ChatGPT, seat button, the rest */
.user-seat { margin: 0; justify-content: flex-start; }
.user-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding: 10px var(--s-4); border-bottom: 1px solid var(--line-soft); align-items: center; gap: 8px var(--s-4); }
.user-row:last-child { border-bottom: 0; }
.user-chat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-chat .ico { width: 16px; height: 16px; opacity: .8; }
.user-acts { justify-content: flex-end; margin: 0; }
/* PC: the buttons' wrapper steps aside, the seat button and the rest sit in their own columns. Narrower (owner 2026-10-30:
   "chaos"): who and the role on one line, ChatGPT under it, then every button as one even grid, the seat one first. */
.user-btns { display: contents; }
@media (max-width: 1280px) {
  .user-list { grid-template-columns: 1fr auto; }
  .user-role { justify-self: end; }
  .user-chat { grid-column: 1 / -1; }
  .user-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }   /* two by two, never three and one */
  .user-btns:not(:has(.user-acts .btn)) .btn { grid-column: 1 / -1; }                       /* a lone seat button (your own row): full width */
  .seat-side { justify-content: space-between; text-align: left; }
  .user-btns .user-seat, .user-btns .user-acts { display: contents; }
  .user-btns .btn { width: 100%; }
}
.seat-sum { padding: 0 var(--s-4) var(--s-3); border-bottom: 1px solid var(--line-soft); }
/* The seats at a glance: used of bought on a bar (red when more are used than bought), the explanation and Revoca tutti aside. */
.seat-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); padding: var(--s-2) 0; }   /* straight in the card, edges with the rows below */
.seat-meter { flex: 1 1 320px; max-width: 460px; }
.seat-meter-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.seat-meter-head .ico { width: 18px; height: 18px; }
.seat-meter-head b { font: 600 15px/1 var(--cond); text-transform: uppercase; letter-spacing: .3px; }
.seat-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.seat-count b { font: 700 18px/1 var(--cond); color: var(--ink); letter-spacing: 0; }
.seat-bar { height: 8px; border-radius: 4px; margin-bottom: 8px; }
.seat-bar > div { background: var(--accent); }
.seat-bar.over > div { background: var(--danger); }
.seat-side { flex: 1 1 260px; display: flex; align-items: center; justify-content: flex-end; gap: var(--s-3); text-align: right; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.link-btn .ico { width: 13px; height: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 var(--s-3); }
/* Forms in sheets: two columns, section titles, wide fields across. */
.sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-3); }
.sheet-grid .field.wide, .sheet-grid .form-sec { grid-column: 1 / -1; }
.form-sec { font: 600 11px/1.2 var(--sans); letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-text); margin: 6px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-sec:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.sheet-grid .field { margin-bottom: var(--s-3); }
.rec-company { text-transform: none; letter-spacing: 0; font-size: 12px; gap: 5px; }
.rec-company .ico { width: 13px; height: 13px; }
.interest-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.interest-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.4fr) 36px; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-flat); }
.interest-row select, .interest-row input { height: 40px; font-size: 14px; box-shadow: none; }
.interest-row .icon-btn { justify-self: center; }
@media (max-width: 600px) { .interest-row { grid-template-columns: 1fr 36px; } .interest-row .icon-btn { grid-row: 1; grid-column: 2; } }
/* Phones (audit A31: the machine form was 2.4 screens in one column): two short fields side by side; anything else (a value
   with its source picker, text areas, chips, pickers of people) keeps the whole width. */
/* The same for Admin's long forms (A41: Documenti was 3,700 px in one column on a phone). */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-2); align-items: end; }   /* a two-line label keeps its pair's boxes level */
  .form-grid > :not(.field), .form-grid > .field.wide,
  .form-grid > .field:not(:has(> input:not([type="checkbox"]):not([type="radio"]), > select)),
  .form-grid > .field:has(.field-row, textarea) { grid-column: 1 / -1; }
  .form-grid .field-row > select:last-child:not(:first-child) { flex: 0 0 128px; min-width: 0; }
}
/* an example in an empty field reads as an example, not as a value already saved (audit A42) */
.form-grid input::placeholder, .form-grid textarea::placeholder { font-style: italic; }
.banner.block { display: block; }
.banner.block p { margin: 6px 0; }
/* Istruzioni ChatGPT: the text area fills the window (its height is set from the space left, pages-admin.js), the version
   it is and the save button in one row under it. */
.pb-text { min-height: 320px; resize: vertical; }
.pb-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
.diff { white-space: pre-wrap; font: 12px/1.4 ui-monospace, Consolas, monospace; max-height: 420px; overflow: auto; background: var(--surface-flat); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 8px 0 0; }
.diff-add { background: rgba(46,139,87,.15); }
.diff-del { background: rgba(196,60,42,.15); }
textarea.mono { font: 13px/1.5 ui-monospace, Consolas, monospace; }
.check-row.small { font-size: 12px; min-height: 0; gap: 6px; }
.check-row.small input { width: 16px; height: 16px; }
.row-label { padding: 10px var(--s-3) 4px; }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------------------------------------------- calendar */
/* The calendar takes the visible height, on phones and desktops alike: the page never scrolls, only the hours grid
   does (owner 2026-10-27). The grid row is capped, the card fills it, the side column scrolls on its own if ever taller. */
.cal { display: grid; gap: var(--s-3); grid-template-rows: minmax(0, 1fr); }
.cal-side { display: grid; gap: var(--s-3); align-content: start; min-height: 0; overflow-y: auto; }
.btn.wide { width: 100%; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i, .mc-dots i, .mini-d i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--k, var(--ink)); }
.k-visit { --k: #f4c900; } .k-inspection { --k: #1c1f22; } .k-delivery { --k: #2e8b57; } .k-call { --k: #2459a6; } .k-other { --k: #8a8f94; } .k-followup { --k: #ff8a1a; } .k-deal { --k: #8a7000; }
.cal-main { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.cal-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-nav h2 { flex: 1; min-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* the title stays one line; what does not fit goes behind [⋯] */
.fit-more { padding-left: 8px; padding-right: 8px; flex: none; }
.cal-nav h2 { font-size: 22px; margin-left: 8px; text-transform: none; font-family: var(--cond); }
.cal-sync { margin-left: 10px; }
.cal-sync.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cal-views { width: 300px; }
.segmented button.only-desktop-inline { display: none; }
.cal-side.only-desktop { display: none; }
.cal-body { flex: 1; min-height: 0; }
/* month */
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-head span { padding: 8px 4px; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line-soft); }
.mc { min-height: 112px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 4px; cursor: pointer; }
.mc:nth-child(7n) { border-right: 0; }
.mc.other { background: rgba(0,0,0,.025); }
.mc.other .mc-day { color: var(--faint); }
.mc.today .mc-day { background: var(--accent); color: var(--ink); }
.mc-day { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; font: 700 13px/1 var(--cond); cursor: pointer; }
.mc-day:hover { background: rgba(0,0,0,.08); }
.mc-evs { display: grid; gap: 2px; margin-top: 2px; }
.mc-more { border: 0; background: none; font: 600 11px/1 var(--sans); color: var(--muted); text-align: left; padding: 2px 6px; cursor: pointer; }
.mc-dots { display: none; gap: 3px; margin-top: 4px; }
.month-legend { display: none; }
#mPageActs:not(:empty) { margin-left: 6px; }
.admin-pick { display: none; }
/* The workflow editor (Admin > Istruzioni ChatGPT): the workflows on the left, the chosen one's steps on the right; on a phone one at a time. */
/* The end of Email's chip row is a count or an info button: one width, or a row slid to its end shifts when a chip swaps them. */
#mailFilters .filters-count, #mailFilters .info-btn { flex: none; box-sizing: border-box; width: 72px; margin-left: var(--s-2); text-align: center; justify-content: center; }
/* Equal widths whichever is selected: the selected tab's different border moved its neighbour 2 px in a flex row. */
.top-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.wf-tabs { margin: var(--s-3) 0; }
.wf-rule textarea { width: 100%; min-height: 56px; resize: vertical; }
.wf-rule select { max-width: 240px; }
.filter.attn:not(.active) { background: var(--danger); border-color: var(--danger); color: #fff; }
small.attn-note, .ent-foot.attn-foot .attn-note { display: block; color: var(--danger); font-size: 12px; white-space: normal; }
.ent-foot.attn-foot { display: block; }
#rows .card:has(.attn-foot) { flex-direction: column; align-items: stretch; height: auto; flex-wrap: nowrap; }
#rows .card:has(.attn-foot) > .ent { flex: none; width: 100%; box-sizing: border-box; }
.filter.attn .filter-n { opacity: 1; font-weight: 700; }
.filter-n { margin-left: 6px; font-size: 11px; font-variant-numeric: tabular-nums; opacity: .65; }
.filter.active .filter-n { opacity: .8; }
/* The number on the bar opens what it counts: a target a thumb can hit. */
.qb-badge { pointer-events: auto; cursor: pointer; }
.qb-badge::after { content: ''; position: absolute; inset: -10px; }
#pbCheck { margin-bottom: var(--s-3); }
.wf-plugin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: var(--s-2); }
.wf-plugin span { min-width: 0; overflow-wrap: anywhere; }
.wf-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.wf-list { display: flex; flex-direction: column; gap: 4px; }
.wf-item { position: relative; display: block; width: 100%; padding: 8px 30px 8px 10px; text-align: left; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-flat); color: var(--ink); cursor: pointer; }
.wf-item b, .wf-item small { display: block; }
.wf-item small { color: var(--muted); font-size: 12px; }
.wf-item.active { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.wf-bad { position: absolute; top: 10px; right: 8px; color: var(--danger); }
.wf-bad .ico { width: 16px; height: 16px; }
.wf-list-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-2); }
.wf-edit { min-width: 0; }
.wf-none { padding: var(--s-5); text-align: center; }
.wf-back { display: none; margin-bottom: var(--s-2); }
.wf-edit-acts { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-2); }
.wf-steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s-2); }
.wf-step { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-flat); }
.wf-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px/24px var(--sans); text-align: center; }
.wf-step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* Two rows on a wide screen: the action and its ask-first tick, then the condition and the note; a workflow can have 14 steps. */
@media (min-width: 761px) {
  .wf-step-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'act ask' 'when note' 'err err'; gap: 6px; }
  .wf-step-main > [data-f="action"] { grid-area: act; }
  .wf-step-main > .wf-step-row { grid-area: when; }
  .wf-step-main > [data-f="note"] { grid-area: note; }
  .wf-step-main > .wf-ask { grid-area: ask; }
  .wf-step-main > [data-err] { grid-area: err; }
  .wf-step-main > [data-err]:empty { display: none; }
  .wf-step-btns { flex-direction: row; align-items: flex-start; }
  .wf-rule .wf-step-main { display: flex; }
}
.wf-step-row { display: flex; gap: 6px; }
.wf-step-row > * { flex: 1; min-width: 0; }
.wf-step-btns { flex: none; display: flex; flex-direction: column; gap: 4px; }
.wf-ask { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font: 500 13px/1.2 var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.wf-preview { max-height: calc(var(--app-h, 100dvh) - 340px); overflow: auto; padding: var(--s-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface-flat); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .wf-layout { grid-template-columns: minmax(0, 1fr); }
  .wf-layout.has-flow .wf-list { display: none; }
  .wf-back { display: inline-flex; }
  .wf-layout:not(.has-flow) .wf-none { display: none; }
  .wf-step-row { flex-direction: column; }
  .wf-step-row > * { flex: none; }   /* stacked, flex: 1 squeezed the field to a sliver */
}
/* PC machine table (audit A23): 6 px above and below a row, not 10, so a page holds one row more and stretches each less */
#tableWrap .table tbody td { padding-top: 6px; padding-bottom: 6px; }   /* measured unstretched too (measure() drops .fitted) */
@media (max-width: 600px) {
  .admin-pick { display: block; width: 100%; margin-bottom: var(--s-3); font-weight: 600; }
  #view .tabs:has(+ .admin-pick) { display: none; }
}
@media (max-width: 1080px) { .rec-main .rec-id { display: none; } }   /* the header already names the record by its ID (audit A33) */   /* the page's + clear of the DEMO pill (audit A18) */
.finder-recent { margin: var(--s-3) var(--s-3) var(--s-2); }
.row > .counter.sm:first-child { min-width: 46px; justify-content: center; text-align: center; flex: none; }   /* match % in one width, names aligned (A36) */
.ent .body b.intent-what { white-space: normal; overflow: visible; text-overflow: clip; }   /* a want's whole summary (audit A34) */
.ev-chip .ev-sub { color: var(--muted); font-weight: 400; }
.ev-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--k, var(--ink)); border-radius: 4px; background: var(--neutral-soft); padding: 3px 6px; font: 500 12px/1.3 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev-chip:hover { background: #e9e8e3; }
.ev-chip.done { text-decoration: line-through; color: var(--faint); }
.ev-chip.late { background: var(--danger-soft); color: var(--danger); }
/* time grid */
.tg { display: flex; flex-direction: column; height: 100%; }
.tg-head { display: grid; grid-template-columns: 56px repeat(var(--cols, 7), 1fr); border-bottom: 1px solid var(--line); }
.tg.cols-7 { --cols: 7; } .tg.cols-1 { --cols: 1; }
.tg-dh { padding: 8px 6px 4px; text-align: center; }
.tg-dh small { display: block; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.tg-dh b { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-top: 2px; border-radius: 50%; font: 700 16px/1 var(--cond); }
.tg-dh.today b { background: var(--accent); }
.tg-adl { padding: 6px 4px 6px 0; text-align: right; font-size: 9px; }
.tg-ad { min-height: 30px; padding: 3px; border-left: 1px solid var(--line-soft); border-top: 1px solid var(--line-soft); display: grid; gap: 2px; align-content: start; cursor: pointer; }
.tg-scroll { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 56px repeat(var(--cols, 7), 1fr); position: relative; }
.tg-hours .tg-h { height: 48px; font: 500 11px/1 var(--sans); color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-6px); }
.tg-col { position: relative; border-left: 1px solid var(--line-soft); }
.tg-col.today { background: rgba(244,201,0,.06); }
.tg-slot { height: 48px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.tg-slot:hover { background: rgba(0,0,0,.03); }
.ev { position: absolute; display: block; text-align: left; border: 0; border-left: 3px solid var(--k, var(--ink)); border-radius: 5px; background: var(--surface-flat); box-shadow: var(--sh-card); padding: 3px 6px; font: 500 12px/1.25 var(--sans); color: var(--ink); overflow: hidden; cursor: pointer; }
.ev.k-visit { background: var(--accent-soft); }
.ev small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.done { opacity: .55; text-decoration: line-through; }
.ev:hover { filter: brightness(.97); z-index: 2; }
/* drag and drop (owner 2026-10-27) */
.ev.movable { cursor: grab; touch-action: pan-y; }
.ev-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.ev-rs::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: rgba(0,0,0,.18); opacity: 0; transition: opacity .15s; }
.ev.movable:hover .ev-rs::after { opacity: 1; }
.ev.dragging { cursor: grabbing; z-index: 6; opacity: .9; box-shadow: 0 10px 24px rgba(0,0,0,.25); outline: 2px solid var(--ink); pointer-events: none; }
.ev-chip.dragging { opacity: .35; }
.drag-ghost { position: fixed; z-index: 95; pointer-events: none; opacity: .92; box-shadow: 0 10px 24px rgba(0,0,0,.25); transform: rotate(-1.5deg); }
.mc.drop-here, .tg-ad.drop-here, .tg-col.drop-here { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.mini-d.drop-here { outline: 2px solid var(--accent); }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.is-dragging .tg-slot:hover { background: none; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
/* mini month */
.mini-cal { padding: var(--s-2) var(--s-3) var(--s-3); }
.mini-head { display: flex; align-items: center; justify-content: space-between; }
.mini-head b { font: 700 14px/1 var(--cond); text-transform: uppercase; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-dn { text-align: center; font: 600 10px/1 var(--sans); color: var(--muted); padding: 4px 0; }
.mini-d { position: relative; height: 30px; border: 0; border-radius: 6px; background: none; font: 500 12px/1 var(--sans); cursor: pointer; }
.mini-d:hover { background: rgba(0,0,0,.06); }
.mini-d.other { color: var(--faint); }
.mini-d.today { font-weight: 700; color: var(--accent-text); }
.mini-d.sel { background: var(--ink); color: #fff; }
.mini-d i { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.mini-d.sel i { background: var(--accent); }
.pop-note { padding: 6px 12px 10px; font-size: 13px; white-space: pre-wrap; }
.pop-head .chip { margin-bottom: 6px; }
.top-sm { margin-top: 6px; }
@media (min-width: 1081px) {
  .cal { grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - var(--top) - var(--s-2) - var(--s-3) - 1px); height: calc(var(--app-h, 100dvh) - var(--top) - var(--s-2) - var(--s-3) - 1px); }
  .cal-side.only-desktop { display: grid; }
  .segmented button.only-desktop-inline { display: inline-flex; }
  .page:has(.cal) { padding-bottom: var(--s-3); }   /* as every page now: 8 above, 12 below; the calendar fills the rest */
}
@media (max-width: 1080px) {
  .cal { height: calc(100vh - var(--header-h) - var(--top) - var(--quickbar-h) - 2 * var(--s-2) - 1px); height: calc(var(--app-h, 100dvh) - var(--header-h) - var(--top) - var(--quickbar-h) - 2 * var(--s-2) - 1px); }
  .page:has(.cal) { padding-bottom: var(--s-2); }
  .cal-bar { padding: var(--s-2) var(--s-3); }
  .cal-nav h2 { font-size: 18px; }
  /* A phone: the row takes the width, the date what is left between the arrows and an icon-only sync (owner 2026-10-30:
     the date was cut and Sincronizza ran off the edge). */
  .cal-nav { width: 100%; }
  .cal-nav h2 { min-width: 0; margin-left: 6px; }
  .cal-sync { margin-left: auto; padding: 0; width: 36px; flex: none; }
  .cal-sync span { display: none; }
  .cal-nav h2.two-lines { display: flex; flex-direction: column; line-height: 1.05; }
  .cal-nav h2.two-lines .cal-wd { font: 600 12px/1.1 var(--sans); text-transform: lowercase; color: var(--muted); }
  .cal-nav h2.two-lines .cal-dt { font-size: 18px; }
  .cal-views { width: 100%; }
  .mc { min-height: 64px; padding: 2px; }
  .mc-evs { display: none; }
  .mc-dots { display: flex; justify-content: center; }
  .month-legend { display: flex; justify-content: center; padding: 8px 6px 4px; font-size: 11px; gap: 4px 10px; }
  .mc-day { width: 100%; height: 34px; border-radius: 6px; }   /* the whole top of the cell opens the day (was a 28 px circle) */
  .mc.today .mc-day { width: 34px; margin: 0 auto; display: block; border-radius: 50%; }
  .tg-head { grid-template-columns: 44px repeat(var(--cols, 1), 1fr); }
  .tg-scroll { grid-template-columns: 44px repeat(var(--cols, 1), 1fr); }
  .tg-hours .tg-h { font-size: 10px; padding-right: 4px; }
}

/* server-rendered pages (ChatGPT connect, CodeNexus install) share this stylesheet */
main.narrow { max-width: 560px; margin: 0 auto; }
main.narrow h1 { font-size: 28px; margin-bottom: var(--s-3); }
main.narrow p { color: var(--muted); }
main.narrow .btn { margin-top: var(--s-3); }

/* 035: offers mailed in bulk (the machine's Vendita tab) */
.sending { border-bottom: 1px solid var(--line-soft); }
.sending:last-child { border-bottom: 0; }
.sending .row.clickable { cursor: pointer; }
.sending .row.clickable:hover { background: rgba(0,0,0,.03); }
.sd-items { background: var(--neutral-soft); }
.sd-items .row { min-height: 46px; }
.sd-items .btn-row { flex-wrap: wrap; }
.hint.top { margin-top: 8px; }
.spec-items { display: flex; flex-wrap: wrap; gap: 6px; }
