/* Trial. Direction B, "Calendario". Phone first: the base rules are the iPhone, the computer
   comes in at 761 px. Black ground always, the yellow sparingly. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff') format('woff');
  font-weight: 600 900;
  font-stretch: 100% 112%;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff') format('woff');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --card: #151518;
  --well: #0b0b0d;
  --raise: #26262b;
  --line: #26262b;
  --line-strong: #55555e;
  --text: #ffffff;
  --muted: #a9a9b2;
  --faint: #7e7e88;
  --accent: #fae60c;
  --danger: #ff5a4d;
  --radius: 8px;
  --gutter: 16px;
  --dock-height: 122px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: 'Archivo', 'Inter', system-ui, -apple-system, sans-serif;
  --font-text: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
select { cursor: pointer; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.display {
  font-family: var(--font-display);
  font-stretch: 105%;
  font-weight: 800;
  letter-spacing: -0.005em;
}

.muted { color: var(--muted); }
.text { color: var(--text); }
.strong { font-weight: 600; }
.small { font-size: 13px; }
.tone-muted { color: var(--muted); }
.tone-text { color: var(--text); }
.tone-accent { color: var(--accent); }
.tone-danger { color: var(--danger); }
.tone-bg-muted { background: var(--muted); }
.tone-bg-text { background: var(--text); }
.tone-bg-accent { background: var(--accent); }
.tone-bg-danger { background: var(--danger); }
.line-accent { border-color: var(--accent) !important; }
.line-danger { border-color: var(--danger) !important; }
.line-text { border-color: var(--text) !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mark { flex: none; }
.only-desktop { display: none !important; }
.only-phone { display: inline-flex; }

/* ---- status: always the word plus a mark */
.st { display: inline-flex; align-items: flex-start; gap: 5px; font-weight: 600; font-size: 13px; line-height: 1.25; }
.st .mark { margin-top: 1px; }
.st-big { font-size: 15px; }

/* ---- covers */
.cover { object-fit: cover; background: var(--raise); }
.cover.dim { filter: grayscale(1) brightness(0.55); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--raise);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.tile-hook { color: var(--text); font-weight: 700; }

/* ---- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--raise);
  color: var(--text);
  font-weight: 700;
  text-align: center;
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #000; }
.btn-white { background: var(--text); color: #000; }
.btn-danger { background: var(--danger); color: #000; }
.btn-danger-line { background: none; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.btn-ghost { background: none; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600; }
.btn-small { min-height: 44px; padding: 0 12px; font-size: 13px; }
.btn-big { min-height: 56px; font-size: 16px; }
.btn-full { width: 100%; }

.iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  background: none;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

/* ---- states */
.panel-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
}
.skeleton { background: var(--card); border-radius: var(--radius); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; } }
.sk-line { height: 16px; margin-bottom: 10px; }
.sk-cover { width: 96px; height: 170px; flex: none; }
.sk-daytab { height: 60px; }
.sk-pcard { height: 90px; }
.sk-strip { height: 190px; }
.sk-cell { height: 120px; }
.sk-row { height: 80px; margin-bottom: 8px; }
.sk-curve { height: 150px; }
.sk-side { height: 240px; }
.grid-loading { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---- toast */
.toast {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--dock-height) + var(--safe-bottom) + 10px);
  z-index: 60;
  display: flex;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s;
}
.toast.on { opacity: 1; }
.toast-in {
  max-width: 460px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: #000;
  font-weight: 600;
  text-align: center;
}
.toast-danger { background: var(--danger); }
dialog .toast { bottom: calc(var(--safe-bottom) + 16px); }

/* ---- dialogs */
dialog { color: var(--text); padding: 0; border: 0; }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

.confirm {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding: 20px var(--gutter) calc(16px + var(--safe-bottom));
  background: var(--card);
  border-radius: 14px 14px 0 0;
}
.confirm-title { font-size: 22px; line-height: 1.15; }
.confirm-body { margin-top: 8px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.confirm-error { margin-top: 12px; color: var(--danger); font-weight: 600; }
.confirm-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  margin: auto 0 0;
  background: #101012;
  border-radius: 14px 14px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sheet-stop { position: sticky; bottom: 0; z-index: 2; display: flex; padding: 8px var(--gutter) calc(8px + var(--safe-bottom)); background: #101012; border-top: 1px solid var(--line); }
.sheet-stop .stop-sheet { flex: 1; justify-content: center; }
.sheet .toast { bottom: calc(var(--safe-bottom) + 76px); }
.sheet-close { position: sticky; top: 4px; display: flex; margin: 4px 4px -48px auto; z-index: 2; background: #101012; }
.sheet-body { display: flex; flex-direction: column; padding: 16px var(--gutter) calc(24px + var(--safe-bottom)); }
.sheet-top { display: flex; gap: 14px; padding-right: 36px; }
.sheet-cover { width: 96px; height: 170px; flex: none; border-radius: 6px; }
.sheet-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sheet-title h2 { font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.sheet-meaning { font-size: 14px; color: var(--muted); line-height: 1.4; }
.sheet-section { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding: 16px 0; border-top: 1px solid var(--line); margin-top: 16px; }
.sheet-section:first-of-type { margin-top: 14px; }
.sheet-section .textlink { align-self: flex-start; }
.sheet-vs { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.sheet-vs .vs { align-items: flex-start; }
.section-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.slot-table { display: grid; gap: 2px; }
.slot-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 28px; }
.slot-row dt { color: var(--muted); }
.slot-row dd { font-weight: 600; }
.caption-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.file-name { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
/* A clip or a format can be one long word: it wraps, and the page never goes sideways. */
.field-label-row > :first-child, .file-text, .out-text, .sheet-title, .pcard-text, .band-text, .pin-text, .cell-text, .mini-text, .mini-queued, .kcard-main, .treel-text, .blocker, .side-kicker { min-width: 0; overflow-wrap: anywhere; }
/* The numbers next to such a name keep their one line. */
.count, .pcard-top > .small, .cell-size { flex: none; white-space: nowrap; }
.action-block { display: flex; flex-direction: column; gap: 10px; }
.action-stack { display: flex; flex-direction: column; gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-grid .btn { min-height: 48px; padding: 0 8px; white-space: nowrap; }

/* ---- forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); padding: 0; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
}
select.input, .zone-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23A9A9B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.textarea { padding: 12px; font-weight: 400; line-height: 1.45; resize: vertical; min-height: 104px; }
.field-error { color: var(--danger); font-weight: 600; font-size: 13px; }
.check { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }

.when { display: flex; flex-direction: column; gap: 8px; }
.when-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.zones { grid-column: 1 / -1; }
.zones .field-label { display: block; padding-bottom: 5px; }
.zones-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.zone-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 8px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px transparent;
  cursor: pointer;
}
.zone-tile.on { box-shadow: inset 0 0 0 1px var(--text); }
.zone-tile input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.zone-text { min-width: 0; }
.zone-name { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.zone-time { display: block; font-size: 13px; color: var(--muted); }

.zone-select { min-height: 44px; border: 0; font-weight: 600; font-size: 16px; color: var(--text); border-radius: var(--radius); appearance: none; -webkit-appearance: none; }
.zone-select-card { padding: 0 32px 0 12px; background-color: var(--card); }
.zone-select-bare { padding: 0 20px 0 4px; background-color: var(--bg); background-position: right 2px center; }

/* ---- login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px var(--gutter); }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { font-size: 44px; font-stretch: 112%; letter-spacing: -0.015em; margin-bottom: 8px; line-height: 1; }
.login-note { margin-top: 4px; }
.login .input { background: var(--card); }

/* ---- shell on the phone */
.topbar { display: none; }
.screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 10px var(--gutter) calc(var(--dock-height) + var(--safe-bottom) + 18px);
}
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--bg);
  padding-bottom: var(--safe-bottom);
}
.dock-bar { display: flex; align-items: center; gap: 10px; padding: 8px var(--gutter); border-top: 1px solid var(--line); }
.dock-counts { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.dock-counts strong { color: var(--text); font-weight: 600; }
.dock-stopped { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--danger); }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 58px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); }
.tab[aria-current='page'] { color: var(--text); }
.tab-dot { position: absolute; top: 8px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tab-dot[hidden] { display: none; }
.tab-badge { position: absolute; top: 5px; right: calc(50% - 34px); font-size: 11px; color: var(--accent); }
.tab-badge:empty { display: none; }

.stop {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--danger);
  color: #000;
  font-family: var(--font-display);
  font-stretch: 105%;
  font-weight: 800;
  font-size: 15px;
}
.stop-resume { background: var(--text); }
.stop[disabled] { opacity: 0.4; cursor: not-allowed; }

.verify { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 13px; }
.verify-none { color: var(--muted); font-weight: 500; cursor: default; }

/* ---- bands */
.bands { display: flex; flex-direction: column; }
.bands:empty { display: none; }
.band-in { display: flex; align-items: flex-start; gap: 10px; padding: 12px var(--gutter); }
.band-note { background: var(--card); color: var(--text); font-size: 13px; }
.band-note p strong { font-weight: 700; }
.band-note + .band-note { border-top: 1px solid var(--line); }
.band-note-line { border-bottom: 1px solid var(--text); }
.band-stop { background: var(--card); border-top: 2px solid var(--danger); border-bottom: 2px solid var(--danger); }
.band-stop > .band-in > .mark { color: var(--danger); margin-top: 3px; }
.band-title { font-size: 19px; line-height: 1.15; color: var(--danger); }
.band-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.band-action { flex: none; }
.blockers { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.blocker { width: 100%; justify-content: flex-start; gap: 10px; text-align: left; }
.blocker .mark { margin-left: auto; }
body.is-stopped .topbar { border-top: 3px solid var(--danger); }

/* ---- phone calendar (B4) */
.phead { display: flex; flex-direction: column; }
.phead-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phead-title { font-size: 22px; font-stretch: 100%; line-height: 1.1; letter-spacing: -0.01em; }
.reassure { font-size: 12.5px; line-height: 1.25; min-width: 0; }
.head-kpi { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.daytabs { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 4px 0 8px; background: var(--bg); }
.daytab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 0; border: 0; border-radius: var(--radius); background: var(--well); color: var(--muted); }
.daytab.has { background: var(--card); color: var(--text); }
.daytab.on { background: var(--text); color: #000; }
.daytab.today.on { background: var(--accent); }
.daytab.today:not(.on) .daytab-num { color: var(--accent); }
.daytab-dow { font-size: 12px; font-weight: 600; line-height: 1.1; }
.daytab-num { font-size: 18px; line-height: 1.1; }
.daytab-pips { display: flex; gap: 2px; height: 3px; }
.daytab-pips span { display: block; width: 3px; height: 3px; background: currentColor; }

.plist { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; touch-action: pan-y; }
.prow { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; }
.prow-hour { padding-top: 7px; font-size: 14px; font-weight: 700; font-stretch: 100%; }
.pcard { background: var(--card); border: 1px solid transparent; border-radius: var(--radius); overflow: hidden; min-width: 0; }
.pcard-open { display: flex; width: 100%; min-height: 90px; padding: 0; background: none; border: 0; text-align: left; }
.pcard-cover { flex: none; width: 51px; height: auto; min-height: 90px; align-self: stretch; }
.pcard-text { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 10px; }
.pcard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pcard-clip { font-size: 16px; line-height: 1.2; }
.pcard-format { font-size: 13px; }
.pcard-status { margin-top: auto; padding-top: 6px; }
.pcard-reason { padding-left: 19px; font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-check { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pfree { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 56px; padding: 0; background: var(--well); border: 0; border-radius: var(--radius); color: var(--faint); font-size: 13px; font-weight: 600; }
.pnow { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; align-items: center; height: 14px; }
.now-time { font-size: 14px; font-stretch: 100%; color: var(--accent); }
.now-line { display: flex; align-items: center; min-width: 0; }
.now-line i { display: block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.now-line b { display: block; flex: 1; height: 2px; background: var(--accent); }
.pempty { padding: 16px 0; }
.pweek { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pweek .btn { flex: 1 1 0; white-space: nowrap; min-height: 44px; font-size: 13px; padding: 0 8px; gap: 5px; }

/* The band of a reel waiting for his check. */
.band { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); overflow: hidden; }
.band-open { flex: none; padding: 0; background: none; border: 0; }
.band-cover { width: 44px; height: 72px; }
.band-text { flex: 1 1 calc(100% - 64px); min-width: 0; padding-right: 10px; }
.band-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.band-name .display { font-size: 17px; }
.band-actions { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; }
.band-note-text { font-size: 13px; }

/* ---- step cards, Nuovo (B2) */
.h-page { font-size: 22px; font-stretch: 100%; line-height: 1.1; letter-spacing: -0.01em; }
.new-body { display: flex; flex-direction: column; gap: 12px; }
.t-cols, .t-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step, .card { background: var(--card); border-radius: var(--radius); min-width: 0; }
.step-in { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.step-rest { display: contents; }
.step-title, .card-title { font-size: 17px; line-height: 1.2; }
.step-num { color: var(--muted); }

.pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  background: var(--text);
  color: #000;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.pick:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.pick-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.files-count { display: flex; justify-content: space-between; gap: 12px; }
.files-count strong { font-weight: 600; }
.files { display: flex; flex-direction: column; gap: 2px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 4px; padding: 4px 4px 4px 8px; border-radius: var(--radius); }
.file-row.on { background: var(--raise); }
.file-main { display: flex; align-items: center; gap: 10px; min-height: 61px; min-width: 0; cursor: pointer; }
.file-row.fail .file-main { cursor: not-allowed; }
.file-cover { flex: none; width: 30px; height: 53px; border-radius: 3px; font-size: 8px; }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.file-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; margin-top: 1px; }
.file-track { display: block; height: 3px; margin-top: 3px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.file-track span { display: block; height: 100%; background: var(--text); transition: width 0.2s; }
.file-side { display: flex; align-items: center; gap: 2px; }
.file-reason { grid-column: 1 / -1; padding: 0 4px 6px; }
.stay-line { display: flex; align-items: flex-start; gap: 6px; font-weight: 600; font-size: 13px; color: var(--accent); }

.quick { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius); cursor: pointer; }
.fields-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fields-3 > :first-child { grid-column: 1 / -1; }
.chooser { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chooser::-webkit-scrollbar { display: none; }
.chooser-item { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; padding: 4px; background: none; border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px transparent; }
.chooser-item.on { box-shadow: inset 0 0 0 1px var(--text); }
.chooser-item.flagged .chooser-time { color: var(--danger); }
.chooser-cover { width: 44px; height: 78px; border-radius: 4px; font-size: 9px; }
.chooser-time { font-size: 11px; line-height: 1.2; white-space: nowrap; font-weight: 600; }
.count { font-size: 12px; color: var(--muted); font-weight: 500; }

.check-cols { display: flex; flex-direction: column; gap: 16px; }
.out-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.out-row { display: flex; align-items: center; gap: 12px; min-height: 70px; padding-right: 8px; background: var(--bg); border-radius: var(--radius); overflow: hidden; }
.out-flagged { box-shadow: inset 0 0 0 1px var(--danger); }
.out-cover { flex: none; width: 40px; min-height: 70px; align-self: stretch; height: auto; font-size: 8px; }
.out-text { flex: 1; min-width: 0; padding: 6px 0; }
.out-when { font-size: 16px; line-height: 1.2; }
.out-caption { overflow-wrap: anywhere; }
.out-reason { display: flex; gap: 5px; margin-top: 3px; font-weight: 600; }
.out-reason .mark { margin-top: 2px; }
.out-change { flex: none; }
.batch-error { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); font-weight: 600; }
.batch-error .mark { margin-top: 2px; }
.go { display: flex; flex-direction: column; gap: 12px; }
.btn-go { min-height: 60px; padding: 0 36px; font-size: 18px; font-family: var(--font-display); font-stretch: 105%; font-weight: 800; width: 100%; }
.done { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.done-title { display: flex; align-items: center; gap: 10px; font-size: 24px; line-height: 1.15; }
.done-actions { display: flex; flex-direction: column; gap: 8px; }
.done-left, .done-in-plan { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.done-left { color: var(--danger); }
.done-left .mark, .done-in-plan .mark { flex: none; margin-top: 2px; }
.done-left span, .done-in-plan span { min-width: 0; overflow-wrap: anywhere; }

/* ---- KPI (B3) */
.ranking-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.ranking-line { padding-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--well); border-radius: 10px; }
.seg-btn { min-height: 44px; border: 0; border-radius: 7px; background: none; color: var(--text); font-weight: 500; }
.seg-btn.on { background: var(--text); color: #000; font-weight: 700; }
.sorts { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.sorts::-webkit-scrollbar { display: none; }
.sorts-label { margin-right: 6px; flex: none; }
.sort-btn { flex: none; min-height: 44px; padding: 0 11px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 13px; font-weight: 500; }
.sort-btn.on { background: var(--text); color: #000; font-weight: 700; }
.kpi-layout { display: flex; flex-direction: column; gap: 12px; }
.kpi-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ranking { min-width: 0; transition: opacity 0.12s; }
.ranking.is-refreshing { opacity: 0.6; }

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.4; }

.vs { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.vs-number { font-weight: 700; }
.vs-bar { position: relative; display: block; width: 72px; height: 6px; background: var(--bg); }
.vs-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--muted); }
.vs-fill.above { background: var(--text); }
.vs-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }

.kcards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.kcard-open { display: flex; align-items: stretch; width: 100%; padding: 0; background: none; border: 0; text-align: left; }
.kcard-rank { flex: none; width: 28px; padding-top: 10px; text-align: center; font-size: 16px; }
.kcard-cover { flex: none; width: 51px; height: 90px; border-radius: 4px; margin: 8px 0; font-size: 9px; }
.kcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 10px 6px 12px; gap: 1px; }
.kcard-title { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.kcard-big { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.kcard-value { font-size: 22px; line-height: 1.15; }
.kcard-rest { padding: 2px 10px 10px; }
.kcard-vs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; }
.metric dt { font-size: 12px; color: var(--muted); line-height: 1.25; }
.metric dd { font-weight: 600; font-size: 14px; }
.metric-lifted dd { font-family: var(--font-display); font-weight: 800; font-size: 18px; }

.side-panel { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; min-width: 0; }
.side-title { font-size: 16px; line-height: 1.2; margin: 3px 0 10px; }
.side-kicker { margin-bottom: 2px; }
.alarm-tag { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--accent); }
.bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.bar-col { display: flex; flex-direction: column; min-width: 0; }
.bar-area { height: 142px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; border-bottom: 1px solid var(--line-strong); }
.bar-value { font-size: 20px; line-height: 1.15; margin-bottom: 2px; }
.bar { width: 24px; border-radius: 4px 4px 0 0; }
.bar-norm { background: #6e6e78; }
.bar-alarm { background: var(--danger); }
.bar-now { background: var(--accent); }
.bar-note { margin-top: 6px; font-size: 12px; line-height: 1.3; min-height: 32px; }
.alarm-note { margin-top: 8px; font-size: 13px; font-weight: 600; }

.insight { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.insight-title { font-size: 16px; line-height: 1.2; }
.insight-curve { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.curve { position: relative; width: 100%; }
.curve-svg { display: block; max-width: 100%; touch-action: pan-y; }
.curve-grid { stroke: var(--raise); stroke-width: 1; }
.curve-label { fill: var(--muted); font-size: 11px; font-family: var(--font-text); }
.curve-area { fill: var(--text); opacity: 0.06; }
.curve-end { fill: var(--text); font-size: 12px; font-weight: 600; font-family: var(--font-text); }
.curve-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.curve-cross { stroke: var(--line-strong); stroke-width: 1; }
.curve-dot { fill: var(--accent); stroke: #151518; stroke-width: 2; }
.curve-tip { position: absolute; top: 0; left: 52px; padding: 3px 7px; background: var(--text); color: #000; font-size: 12px; font-weight: 600; border-radius: 4px; pointer-events: none; }
.curve-empty { min-height: 72px; display: flex; align-items: flex-end; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); font-size: 13px; }
.curve-numbers { width: 100%; font-size: 13px; }
.curve-numbers summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.curve-numbers li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.lane-fix { width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---- Impostazioni */
.settings-grid { display: flex; flex-direction: column; gap: 12px; }
.settings-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.ramp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ramp-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 76px; padding: 4px 0; border: 0; border-radius: var(--radius); background: var(--bg); color: var(--text); }
.ramp-btn.on { background: var(--text); color: #000; }
.ramp-value { font-size: 24px; line-height: 1.1; }
.ramp-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; }
.gap-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.gap-btn { background: var(--bg); color: var(--text); min-width: 66px; }
.alerts { display: flex; flex-direction: column; }
.alert { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.alert:first-child { border-top: 0; padding-top: 0; }
.alert-mark { color: var(--accent); padding-top: 1px; }
.alert-read .alert-mark { color: var(--muted); }
.alert-read .alert-text > p:first-child { color: var(--muted); }
.alert-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.4; overflow-wrap: anywhere; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.alert-actions:empty { display: none; }
.meter { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--text); }

/* ---- a computer */
@media (min-width: 761px) {
  :root { --dock-height: 0px; --gutter: 32px; }

  .only-desktop { display: flex !important; }
  .only-phone { display: none !important; }
  .dock { display: none; }

  .topbar { display: block; position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
  .topbar-in { max-width: 1280px; margin: 0 auto; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
  .brand { display: flex; align-items: center; min-height: 44px; font-stretch: 112%; font-size: 20px; letter-spacing: -0.01em; }
  .nav { display: flex; gap: 4px; }
  .nav-link { position: relative; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--radius); color: var(--muted); font-weight: 500; }
  .nav-link:hover { color: var(--text); }
  .nav-link[aria-current='page'] { background: var(--card); color: var(--text); font-weight: 600; }
  .nav-badge { font-size: 12px; color: var(--accent); }
  .nav-badge:empty { display: none; }
  .counts-wrap { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); }
  .counts { display: flex; align-items: center; gap: 18px; }
  .counts strong { color: var(--text); font-weight: 600; }
  .cap { display: flex; align-items: center; gap: 10px; }
  .gauge { display: flex; gap: 2px; }
  .gauge-cell { display: block; width: 7px; height: 16px; border-radius: 1px; border: 1px solid #77777f; }
  .gauge-cell.open { border-color: var(--text); }
  .gauge-cell.used { border-color: var(--text); background: var(--text); }
  .verify:not(.verify-none):hover { color: var(--text); }
  .settings-link { color: var(--muted); }
  .settings-link:hover, .settings-link[aria-current='page'] { color: var(--text); }
  .settings-link[aria-current='page'] { background: var(--card); }
  .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .stopped-word { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--danger); }
  .stopped-word[hidden] { display: none; }
  .stop { min-height: 44px; padding: 0 16px; }

  .band-in { max-width: 1280px; margin: 0 auto; padding: 12px var(--gutter); align-items: center; }
  .band-stop > .band-in { padding-top: 14px; padding-bottom: 14px; }

  .screen {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px var(--gutter) 28px;
    gap: 12px;
  }

  .toast { bottom: 24px; }

  .confirm { width: 420px; max-width: calc(100vw - 32px); margin: auto; padding: 22px; border-radius: 10px; }
  .confirm-actions { flex-direction: row-reverse; }
  .confirm-actions .btn { flex: 1; min-height: 48px; font-size: 14px; }

  .sheet {
    position: fixed;
    inset: 0 0 0 auto;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border-left: 1px solid var(--line);
  }
  .sheet-body { padding: 20px 22px 32px; }
  .sheet .when-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet .zones { grid-column: 1 / -1; }

  /* The head of the week. */
  .head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
  .head-title { display: flex; align-items: center; gap: 2px; }
  .head-title h1 { margin-right: 8px; }
  .head-title .btn { margin-left: 8px; }
  .head-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
  .zone-label { display: flex; align-items: center; gap: 8px; }
  .h-page { font-stretch: 112%; font-size: 30px; letter-spacing: -0.015em; }

  /* The band of a reel to verify. */
  .band { flex-wrap: nowrap; min-height: 72px; gap: 14px; }
  .band-text { flex: 1; padding: 0; }
  .band-actions { flex: none; flex-direction: row; align-items: center; gap: 10px; padding: 0 12px 0 0; }
  .band-actions .check-grid { display: flex; gap: 10px; }
  .band-actions .btn { min-height: 44px; padding: 0 18px; }

  /* The strip of today. */
  .strip { background: var(--card); border-radius: var(--radius); padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
  .strip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 24px; }
  .strip-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
  .strip-title h2 { font-size: 16px; line-height: 1.2; }
  .strip-gap { display: flex; align-items: baseline; gap: 16px; }
  .strip-gap strong { font-weight: 600; }
  .strip-scroll { overflow-x: auto; }
  .strip-body { position: relative; min-width: 1040px; }
  .strip-empty { position: absolute; left: 0; bottom: 56px; }
  .pin { position: absolute; display: flex; gap: 7px; align-items: flex-start; width: 11.1%; padding: 0 4px 0 7px; background: none; border: 0; text-align: left; color: var(--text); }
  .pin:hover .pin-clip { text-decoration: underline; text-underline-offset: 2px; }
  .pin-cover { flex: none; width: 28px; height: 50px; font-size: 7px; }
  .pin-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .pin-time { font-size: 13px; font-stretch: 100%; white-space: nowrap; }
  .pin-clip { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
  .pin-format { font-size: 12px; white-space: nowrap; }
  .pin-status { font-size: 11.5px; line-height: 1.15; margin-top: 2px; gap: 3px; }
  .pin-line { position: absolute; bottom: 18px; width: 1px; }
  .pin-mark { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -22px; padding: 0; background: var(--card); border: 0; border-radius: 50%; }
  .strip-distances { position: absolute; left: 0; right: 0; bottom: 44px; height: 14px; }
  .strip-distance { position: absolute; top: 0; display: flex; align-items: center; gap: 5px; padding: 0 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
  .strip-distance i { flex: 1; height: 1px; background: #4a4a52; }
  .strip-track { position: absolute; left: 0; right: 0; bottom: 18px; height: 24px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
  .strip-past { position: absolute; left: 0; top: 0; bottom: 0; background: #232328; }
  .strip-after { position: absolute; right: 0; top: 0; bottom: 0; background: #141417; }
  .strip-tick { position: absolute; bottom: 0; width: 1px; height: 35%; background: #33333a; }
  .strip-tick.major { height: 100%; background: #4a4a52; }
  .strip-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
  .strip-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: 11px; color: var(--muted); }
  .strip-hours span { position: absolute; transform: translateX(-50%); }
  .strip-hours span:first-child { transform: none; }

  /* The week grid (B1). */
  .grid-scroll { overflow-x: auto; }
  .grid { min-width: 1040px; display: flex; flex-direction: column; gap: 6px; }
  .grid-row { display: grid; column-gap: 6px; }
  .grid-hour { position: sticky; left: 0; z-index: 2; background: var(--bg); padding-top: 7px; font-size: 14px; font-weight: 700; font-stretch: 100%; }
  .grid-now { align-items: center; height: 18px; }
  .grid-now .grid-hour { padding-top: 0; font-weight: 800; color: var(--accent); }
  .grid-day { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 2px; min-width: 0; }
  .grid-dow { font-size: 13px; font-weight: 600; }
  .grid-num { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: var(--radius); font-size: 20px; }
  .grid-num.today { background: var(--accent); color: #000; }
  .grid-count { margin-left: auto; font-size: 12px; white-space: nowrap; }
  .grid-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 120px; }
  .cell { flex: 1; display: flex; width: 100%; min-height: 120px; padding: 0; background: var(--card); border: 1px solid transparent; border-radius: var(--radius); overflow: hidden; text-align: left; }
  .cell:hover { background: #1c1c20; }
  .cell-cover { flex: none; width: 66px; align-self: stretch; height: auto; min-height: 118px; font-size: 10px; }
  .cell-dense .cell-cover { width: 44px; font-size: 8px; }
  .cell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 8px 8px 10px; }
  .cell-dense .cell-text { padding: 7px 5px 7px 7px; }
  .cell-clip { font-size: 15px; line-height: 1.2; }
  .cell-format { margin-top: 2px; font-size: 12.5px; }
  .cell-size { font-size: 12px; }
  .cell-status { margin-top: auto; padding-top: 6px; font-size: 12px; }
  .cell-reason { padding-left: 19px; font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cell-slim { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: 0 8px; background: var(--well); border: 0; border-radius: var(--radius); text-align: left; flex: none; }
  .cell-slim .st { font-size: 12px; }
  .cell-slim-name { font-size: 12px; white-space: nowrap; }
  .free { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 72px; padding: 0; background: var(--well); border: 0; border-radius: var(--radius); color: var(--faint); }
  .free:hover { background: var(--card); color: var(--text); }
  .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); }
  .legend-item { font-size: 12px; font-weight: 500; color: inherit; }
  .legend-item.tone-accent .mark { color: var(--accent); }
  .legend-item.tone-danger .mark { color: var(--danger); }
  .legend-item.tone-text .mark { color: var(--text); }

  /* Nuovo (B2). */
  .t-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: start; }
  .when-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 2.4fr); }
  .zones { grid-column: auto; }
  .fields-3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.7fr); }
  .fields-3 > :first-child { grid-column: auto; }
  .check-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
  .check-cols > .out-list:first-child { grid-column: 1 / -1; }
  .mini { flex-direction: column; gap: 4px; min-width: 0; }
  .mini-row { display: grid; column-gap: 4px; }
  .mini-head { font-size: 12px; font-weight: 600; }
  .mini-head span { padding: 0 0 2px 2px; }
  .mini-head .mini-zone { padding-left: 0; font-size: 10px; font-weight: 500; line-height: 1.1; color: var(--muted); overflow-wrap: anywhere; }
  .mini-hour { padding-top: 3px; font-size: 12px; font-weight: 600; }
  .mini-row { align-items: stretch; }
  .mini-new { display: flex; align-items: stretch; gap: 6px; min-height: 56px; border: 1px solid var(--accent); border-radius: 6px; background: var(--raise); overflow: hidden; }
  .mini-cover { flex: none; width: 30px; height: auto; font-size: 7px; }
  .mini-text { min-width: 0; font-size: 12px; line-height: 1.25; display: flex; flex-direction: column; justify-content: center; }
  .mini-text b { font-weight: 700; }
  .mini-tag { color: var(--accent); }
  .mini-queued { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 56px; padding: 3px 4px; border: 1px solid var(--raise); border-radius: 6px; font-size: 12px; line-height: 1.2; }
  .mini-queued b { font-weight: 600; }
  .mini-status { font-size: 11px; font-weight: 500; line-height: 1.15; }
  .mini-empty { height: 56px; }
  .go { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px 20px; }
  .btn-go { width: auto; flex: none; min-height: 56px; }
  .done { max-width: 620px; }
  .done-actions { flex-direction: row; }
  .done-actions .btn { flex: 1; }

  /* KPI (B3). */
  .screen-kpi .head-kpi { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ranking { background: var(--card); border-radius: var(--radius); padding: 10px 14px 6px; }
  .ranking-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; padding-bottom: 0; }
  .ranking-line { padding-bottom: 4px; }
  .seg { display: flex; gap: 18px; padding: 0; background: none; border-radius: 0; }
  .seg-btn { padding: 0; min-height: 44px; border-radius: 0; color: var(--muted); font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
  .seg-btn:hover { color: var(--text); }
  .seg-btn.on { background: none; color: var(--text); font-weight: 800; }
  .sorts { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .kpi-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .kpi-layout-wide { display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .kpi-layout-wide .kpi-side { display: flex; flex-direction: column; align-items: stretch; position: sticky; top: 76px; }
  .table-scroll { overflow-x: auto; }
  .table { min-width: 860px; }
  .thead, .trow { display: grid; column-gap: 8px; text-align: right; }
  .thead { align-items: end; min-height: 34px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.2; font-weight: 600; color: var(--muted); }
  .th-left { text-align: left; }
  .th-on { color: var(--text); }
  .th-arrow { display: inline-flex; margin-left: 3px; vertical-align: -1px; }
  .trow { position: relative; align-items: center; min-height: 84px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .trow:last-child { border-bottom-color: transparent; }
  .trow:hover { background: #1a1a1d; }
  .trow.selected { box-shadow: inset 2px 0 0 var(--text); background: #1a1a1d; }
  .trank { text-align: left; font-size: 18px; padding-left: 4px; }
  .treel { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
  .trow-cover { flex: none; width: 41px; height: 72px; border-radius: 4px; font-size: 8px; }
  .treel-text { min-width: 0; }
  .trow-open { display: block; padding: 0; background: none; border: 0; text-align: left; color: var(--text); }
  .trow-open::after { content: ''; position: absolute; inset: 0; }
  .treel-title { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
  .tnum { font-size: 14px; }
  .tnum-lifted { font-size: 20px; line-height: 1.1; }
  .side-title { margin-top: 3px; }

  /* Impostazioni. */
  .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .counts-wrap { order: 4; flex-basis: 100%; margin-left: 0; flex-wrap: wrap; gap: 0 16px; }
  .counts { flex-wrap: wrap; gap: 0 16px; }
  .settings-link { margin-left: auto; }
  .t-cols { grid-template-columns: minmax(0, 1fr); }
}
