/* Value comparison · tool per l'Advisory Board Abrocitinib (schermo proiettato, tablet e smartphone) */

:root {
  /* Palette dal deck */
  --brand: #0b3fd1;
  --brand-2: #3366e0;
  --navy: #0a1360;
  --navy-2: #001a6e;
  --deep: #000066;
  --ice-50: #f6f8fe;
  --ice-100: #eef2fc;
  --ice-200: #e3e9fa;
  --ice-300: #d6def5;
  --line: #b6c3ea;
  --ink: #1a1a1a;
  --ink-2: #3a4366;
  --ink-3: #5b6488;
  --paper: #ffffff;
  /* molecole: abrocitinib nel blu più scuro del deck, upadacitinib in grigio */
  --abro: #0a1360;
  --abro-200: #c9cfea;
  --upa: #646a78;
  --upa-50: #f0f1f3;
  --upa-200: #d5d8de;
  --warn-ink: #8a4b06;
  --warn-bg: #fff3df;
  --warn-line: #f1c27d;
  --danger: #a5281b;
  --ok: #0b7a4b;
  --ok-50: #e3f4ec;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-s: 10px;
  --shadow-1: 0 1px 2px rgb(10 19 96 / 0.06), 0 4px 14px rgb(10 19 96 / 0.07);
  --shadow-2: 0 2px 6px rgb(10 19 96 / 0.1), 0 18px 48px rgb(10 19 96 / 0.2);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 70px;
  --subnav-h: 76px;
  --band-h: 34px;
  --gutter: 28px;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(180deg, var(--ice-100) 0%, #f7f9fe 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

::selection {
  background: rgb(51 102 224 / 0.3);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

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

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--ink-3);
}

/* ───────── Shell ───────── */

/* Su schermi grandi (proiettore, monitor full HD) tutto si ingrandisce per essere leggibile in sala */
@media (min-width: 1600px) {
  :root {
    --z: 1.15;
  }
}

@media (min-width: 1880px) {
  :root {
    --z: 1.3;
  }
}

/* con l'ingrandimento le cinque sessioni occupano la barra: dello stato resta l'icona */
@media (min-width: 1600px) {
  .sync__text {
    display: none;
  }

  .sync {
    min-width: 0;
  }
}

.app {
  zoom: var(--z, 1);
  height: calc(var(--app-h, 100dvh) / var(--z, 1));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--header-h) var(--subnav-h) 1fr var(--band-h);
  padding-top: env(safe-area-inset-top);
}

.app.is-welcome {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  background:
    radial-gradient(120% 220% at 100% 0%, rgb(51 102 224 / 0.55) 0%, transparent 55%),
    linear-gradient(100deg, var(--navy) 0%, var(--brand) 100%);
  color: #fff;
  position: relative;
  z-index: 3;
}

.topbar__brand {
  display: flex;
  align-items: center;
  height: 100%;
  flex: none;
}

.topbar__brand img {
  height: 22px;
  width: auto;
  display: block;
}

.ws-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 5px;
  border-radius: 999px;
  background: rgb(0 0 40 / 0.25);
  box-shadow: inset 0 1px 2px rgb(0 0 40 / 0.3);
  min-width: 0;
}

.ws-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.ws-tab__num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.ws-tab[aria-current="page"] {
  background: #fff;
  color: var(--brand);
}

.ws-tab[aria-current="page"] .ws-tab__num {
  background: var(--brand);
  color: #fff;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.group-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.group-chip--icon {
  width: 46px;
  min-height: 46px;
  padding: 0;
  justify-content: center;
}

.sync {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 120px;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: 500;
  color: rgb(255 255 255 / 0.92);
}

.sync .icon {
  width: 18px;
  height: 18px;
}

.sync[data-state="saving"] .icon {
  animation: spin 0.9s linear infinite;
}

.sync[data-state="offline"] {
  color: #ffe2b0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Una sola sessione: il titolo prende il posto delle schede */
.topbar__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 auto;
  min-width: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__title strong {
  font-size: 20px;
}

.topbar__title span {
  font-size: 16px;
  opacity: 0.8;
}

/* Sotto-navigazione */

.subnav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid rgb(182 195 234 / 0.6);
  background: rgb(255 255 255 / 0.7);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  position: relative;
  z-index: 2;
  min-width: 0;
}

.track {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ice-200) 0%, var(--ice-100) 100%);
  box-shadow: inset 0 1px 3px rgb(10 19 96 / 0.12), 0 1px 0 rgb(255 255 255 / 0.9);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
}

.track::-webkit-scrollbar {
  display: none;
}

/* scorre col tocco, con la rotella e trascinando col mouse (app.js) */
.track {
  cursor: grab;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.track.is-dragging {
  cursor: grabbing;
}

.track.is-dragging .stop {
  pointer-events: none;
}

.track.fade-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}

.track.fade-l {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px);
  mask-image: linear-gradient(90deg, transparent, #000 48px);
}

.track.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

.track__sep {
  flex: none;
  width: 1px;
  height: 26px;
  margin: 0 6px;
  background: var(--line);
}

.stop {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 14px 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stop:active {
  transform: scale(0.98);
}

.stop--tool {
  color: var(--navy);
}

.stop--add {
  gap: 6px;
  margin-left: 4px;
  border: 1.5px dashed var(--line);
  color: var(--brand);
}

.stop--add .icon {
  width: 18px;
  height: 18px;
}

.stop[aria-current="page"] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgb(11 63 209 / 0.35);
}

.stop__badge {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-left: -4px;
  padding: 0 6px;
  border-radius: 13px;
  background: rgb(11 63 209 / 0.1);
  color: var(--brand);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.stop__badge .icon {
  width: 16px;
  height: 16px;
}

.stop[aria-current="page"] .stop__badge {
  background: rgb(255 255 255 / 0.22);
  color: #fff;
}

/* Stato di compilazione: anello vuoto, mezzo, pieno */
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  border: 2px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.dot[data-fill="some"] {
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand) 50%, transparent 50%);
}

.dot[data-fill="all"] {
  border-color: var(--brand);
  background: var(--brand);
}

.stop[aria-current="page"] .dot {
  border-color: rgb(255 255 255 / 0.7);
}

.stop[aria-current="page"] .dot[data-fill="some"] {
  border-color: #fff;
  background: linear-gradient(90deg, #fff 50%, transparent 50%);
}

.stop[aria-current="page"] .dot[data-fill="all"] {
  border-color: #fff;
  background: #fff;
}

.dot--tab {
  margin-left: -2px;
  border-color: rgb(255 255 255 / 0.55);
}

.dot--tab[data-fill="some"] {
  border-color: #fff;
  background: linear-gradient(90deg, #fff 50%, transparent 50%);
}

.dot--tab[data-fill="all"] {
  border-color: #fff;
  background: #fff;
}

.ws-tab[aria-current="page"] .dot--tab {
  border-color: var(--line);
}

.ws-tab[aria-current="page"] .dot--tab[data-fill="some"] {
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand) 50%, transparent 50%);
}

.ws-tab[aria-current="page"] .dot--tab[data-fill="all"] {
  border-color: var(--brand);
  background: var(--brand);
}

.subnav__aside {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex: none;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--ice-300);
  border-radius: 999px;
  background: var(--paper);
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(10 19 96 / 0.06);
}

.ghost-btn:active {
  background: var(--ice-200);
}

.ghost-btn.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Contenuto */

.main {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
}

.page {
  min-height: 100%;
  padding: 22px var(--gutter) 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: page-in 0.38s var(--ease); /* senza "both": se l'animazione non parte, il contenuto resta visibile */
}

.page--quiet {
  animation: none;
}

@keyframes page-in {
  from {
    opacity: 0.001;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.page-head__kicker {
  margin: 0 0 4px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.page-head__title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-head__title::before {
  content: "";
  width: 6px;
  align-self: stretch;
  min-height: 34px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand-2), var(--navy));
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--navy);
  text-wrap: balance;
}

.page-head__lead {
  margin: 4px 0 0 20px;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 76ch;
}

.page-head__end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

/* Pannelli e campi */

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  border: 1px solid rgb(214 222 245 / 0.9);
}

.field-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.field-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 15px;
}

.write {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 12px 16px;
  border: 1px solid var(--ice-300);
  border-radius: var(--radius-s);
  background-color: var(--ice-50);
  line-height: 1.5;
  font-size: 18px;
  resize: none;
  caret-color: var(--brand);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.write::placeholder {
  color: #7b84a6;
}

.write:focus {
  outline: none;
  border-color: var(--brand);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgb(51 102 224 / 0.18);
}

.write--fill {
  flex: 1;
  min-height: 160px;
}

.write--cell {
  min-height: 56px;
  padding: 10px 12px;
  font-size: 16px;
  border-color: transparent;
  background: transparent;
  border-radius: 8px;
}

.write--cell:hover {
  background-color: var(--ice-50);
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ice-200);
  color: var(--navy);
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.counter[data-state="done"] {
  background: var(--brand);
  color: #fff;
}

.counter[data-state="over"] {
  background: var(--warn-bg);
  color: var(--warn-ink);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}

.counter .icon {
  width: 18px;
  height: 18px;
}

.check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  border: 2px solid var(--line);
  background: #fff;
  color: transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.check .icon {
  width: 20px;
  height: 20px;
  stroke-width: 3;
}

.guide-box {
  padding: 16px 20px 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--brand);
  background: var(--ice-50);
}

.guide-box__label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-box ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: g;
  display: grid;
  gap: 8px;
}

.guide-box li {
  counter-increment: g;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: baseline;
  font-weight: 600;
  color: var(--navy);
}

.guide-box li::before {
  content: counter(g);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
}

.footnote {
  margin: 12px 4px 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* ───────── Selezione domande ───────── */

.qlist {
  display: grid;
  gap: 10px;
}

.qlist--two {
  grid-template-columns: 1fr 1fr;
}

.qitem {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--ice-300);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.qitem__pick {
  display: grid;
  grid-template-columns: 40px 1fr 32px;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  flex: 1;
}

.qitem__n {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ice-200);
  color: var(--brand);
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.qitem__text {
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}

.qlist--two .qitem__text {
  font-size: 16.5px;
}

.qitem.is-picked {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-1);
}

.qitem.is-picked .qitem__n {
  background: var(--brand);
  color: #fff;
}

.qitem.is-picked .qitem__text {
  color: var(--navy);
  font-weight: 600;
}

.qitem.is-picked .check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.qitem__open {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-top: 1px solid var(--ice-200);
  background: var(--ice-50);
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
}

.qitem__open .icon {
  width: 18px;
  height: 18px;
}

/* ───────── Card domanda (slide 12) ───────── */

.qcard {
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  border: 1px solid var(--ice-300);
}

.qcard__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
}

.qcard__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-2);
}

.qcard__kicker {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qcard__num {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qcard__num small {
  font-size: inherit;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.qcard__body {
  position: relative;
  padding: 22px 28px 26px;
  background: radial-gradient(60% 140% at 100% 50%, var(--ice-100) 0%, transparent 70%), #fff;
}

.qcard__label {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.qcard__q {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.28;
  font-weight: 700;
  color: var(--navy);
  text-wrap: pretty;
}

.qcard__off {
  margin: 12px 0 0;
  color: var(--warn-ink);
  font-weight: 600;
}

.notes {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
  min-height: 240px;
}

.notes__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notes__head .ghost-btn {
  margin-left: auto;
}

.notes .write {
  font-size: 20px;
}

/* ───────── Sintesi (campi in griglia) ───────── */

.syn {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.syn--three {
  grid-template-columns: repeat(3, 1fr);
}

.syn__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
  box-shadow: inset 0 5px 0 var(--brand), var(--shadow-1);
}

.syn__field--wide {
  grid-column: 1 / -1;
}

.syn__n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.syn__q {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--navy);
  min-height: 4.2em;
}

/* ───────── Value comparison · elemento ───────── */

.dim {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) 1.1fr;
  gap: 18px;
}

.dim__vote {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 22px;
}

.dim__vote-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  border-radius: var(--radius);
  background: var(--ice-100);
}

.rate + .rate {
  margin-top: 12px;
}

.rate--upa {
  background: var(--upa-50);
}

.rate__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rate__name {
  font-size: 20px;
  font-weight: 700;
  color: var(--abro);
}

.rate__val {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--abro);
}

.rate--upa .rate__val {
  color: var(--upa);
}

.rate--upa .rate__name {
  color: var(--upa);
}

.rate__scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.rate__btn {
  min-height: 64px;
  border: 1.5px solid var(--ice-300);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rate__btn:active {
  transform: scale(0.97);
}

.rate--abro .rate__btn.is-under {
  background: var(--abro-200);
  border-color: var(--abro-200);
  color: var(--abro);
}

.rate--abro .rate__btn.is-on {
  background: var(--abro);
  border-color: var(--abro);
  color: #fff;
  box-shadow: 0 4px 12px rgb(10 19 96 / 0.3);
}

/* mezzo punto: il pulsante successivo è pieno a metà */
.rate--abro .rate__btn.is-half {
  background: linear-gradient(90deg, var(--abro-200) 50%, #fff 50%);
  border-color: var(--abro-200);
  color: var(--abro);
}

.rate--upa .rate__btn.is-half {
  background: linear-gradient(90deg, var(--upa-200) 50%, #fff 50%);
  color: var(--upa);
}

.rate--upa .rate__btn {
  border-color: var(--upa-200);
}

.rate--upa .rate__btn.is-under {
  background: var(--upa-200);
  color: var(--upa);
}

.rate--upa .rate__btn.is-on {
  background: var(--upa);
  border-color: var(--upa);
  color: #fff;
  box-shadow: 0 4px 12px rgb(100 106 120 / 0.3);
}

.dim__qs {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--ice-200);
}

.dim__qs p {
  margin: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: baseline;
  font-weight: 600;
  color: var(--navy);
}

.dim__qs span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
}

.dim__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dim__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}

/* ───────── Value comparison · confronto ───────── */

.quadro {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.quadro__table {
  padding: 8px;
  overflow: hidden;
}

.vtable,
.etable,
.gtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.vtable th,
.vtable td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ice-200);
}

.vtable thead th {
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 0;
}

.vtable thead th:first-child {
  border-top-left-radius: 10px;
}

.vtable thead th:last-child {
  border-top-right-radius: 10px;
}

.vtable thead .vtable__mol--upa {
  background: var(--upa);
}

.vtable tbody th {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.vtable tbody tr {
  cursor: pointer;
}

.vtable tbody tr:active {
  background: var(--ice-100);
}

.vtable__mol {
  width: 72px;
  text-align: center !important;
}

.vtable__val {
  text-align: center !important;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--abro);
}

.vtable__val--upa {
  color: var(--upa);
  background: rgb(240 241 243 / 0.8);
}

.vtable thead .vtable__mol--abro {
  background: var(--abro);
}

.vtable__rel {
  font-size: 15px;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-width: 0;
  width: 46%;
  overflow: hidden;
  display: -webkit-box;
}

.vtable td.vtable__rel {
  display: table-cell;
}

.quadro__chart {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar {
  width: 100%;
  max-width: 640px;
  height: auto;
  overflow: visible;
}

.radar__ring {
  fill: none;
  stroke: var(--ice-300);
  stroke-width: 1;
}

.radar__axis {
  stroke: var(--ice-300);
  stroke-width: 1;
}

.radar__label {
  font-size: 17px;
  font-weight: 700;
  fill: var(--navy);
}

.radar__series polygon {
  stroke-width: 3;
  stroke-linejoin: round;
}

.radar__series--abro polygon {
  fill: rgb(10 19 96 / 0.14);
  stroke: var(--abro);
}

.radar__series--abro .radar__dot {
  fill: var(--abro);
}

.radar__series--upa polygon {
  fill: rgb(100 106 120 / 0.14);
  stroke: var(--upa);
}

.radar__series--upa .radar__dot {
  fill: var(--upa);
}

.legend {
  display: flex;
  gap: 24px;
  font-weight: 600;
  color: var(--ink-2);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__swatch {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--abro);
}

.legend__item--upa .legend__swatch {
  background: var(--upa);
}

/* ───────── Tabelle a righe dinamiche ───────── */

.grid {
  padding: 8px 8px 10px;
}

.gtable th,
.gtable td {
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ice-200);
}

.gtable td + td {
  border-left: 1px solid var(--ice-200);
}

.gtable thead th {
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 0;
  vertical-align: bottom;
}

.gtable thead th:first-child {
  border-top-left-radius: 10px;
}

.gtable thead th:last-child {
  border-top-right-radius: 10px;
}

.gtable thead small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0;
}

.gtable tbody tr:nth-child(odd) td {
  background: rgb(238 242 252 / 0.45);
}

.gtable__del {
  width: 60px;
  text-align: center !important;
  vertical-align: middle !important;
}

.gtable__prio {
  width: 260px;
}

td.gtable__prio {
  vertical-align: middle !important;
}

.add-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  margin: 10px 6px 2px;
  padding: 0 18px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  font-size: 16px;
}

.add-row:active {
  background: var(--ice-100);
}

.prio {
  display: flex;
  gap: 6px;
}

.prio__btn {
  flex: 1;
  min-height: 44px;
  padding: 0 10px;
  border: 1.5px solid var(--ice-300);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prio__btn--alta.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.prio__btn--media.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.prio__btn--bassa.is-on {
  background: #8fa8ec;
  border-color: #8fa8ec;
  color: #fff;
}

.prio-legend {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 6px;
  font-size: 15px;
  color: var(--ink-2);
}

.prio-legend__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.prio-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.prio-legend .prio__btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-height: 30px;
  padding: 0 14px;
  font-size: 12px;
  pointer-events: none;
}

/* ───────── Strategy card ───────── */

.scard {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) 1.2fr;
  gap: 18px;
}

.scard__card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--ice-300);
  box-shadow: 10px 10px 0 -1px var(--ice-100), 10px 10px 0 0 var(--ice-300), var(--shadow-2);
  overflow: hidden;
}

.scard__head {
  padding: 18px 24px;
  background: var(--navy);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scard__head strong {
  color: #8fb0ff;
}

.scard__text {
  margin: 0;
  padding: 26px 28px;
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--navy);
}

.scard__edit {
  flex: 1;
  display: flex;
  padding: 18px;
}

.scard__edit .write {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
}

.scard__work {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scard__verdict {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
}

.verdicts {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.verdict {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border: 1.5px solid var(--ice-300);
  border-radius: 14px;
  background: var(--ice-50);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.verdict .check {
  width: 28px;
  height: 28px;
}

.verdict.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.verdict.is-on .check {
  background: #fff;
  border-color: #fff;
  color: var(--brand);
}

.verdict--eliminare.is-on {
  background: var(--navy);
  border-color: var(--navy);
}

.verdict--eliminare.is-on .check {
  color: var(--navy);
}

.scard__cols {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.scard__col {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: background 0.2s var(--ease);
}

.scard__col + .scard__col {
  border-left: 1px solid var(--ice-200);
}

.scard__col-head {
  margin: 0;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.scard__col .write {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scard__col .write:focus {
  box-shadow: inset 0 0 0 2px var(--brand-2);
}

.scard__col.is-on {
  background: var(--ice-100);
}

.scard__col.is-on .scard__col-head {
  background: var(--navy);
}

.scard__dis {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 18px;
}

.scard__dis .write {
  min-height: 80px;
}

/* Esiti */

.etable th,
.etable td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ice-200);
  text-align: center;
  vertical-align: middle;
}

.etable thead th {
  padding: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.etable thead th:first-child {
  border-top-left-radius: var(--radius);
  text-align: left;
}

.etable thead th:last-child {
  border-top-right-radius: var(--radius);
}

.etable tbody th {
  width: 52%;
  text-align: left;
}

.etable__msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  justify-content: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.etable__msg strong {
  color: var(--navy);
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.etable__msg span {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.etable__msg:active {
  background: var(--ice-100);
}

.etable__cell {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-radius: 12px;
  background: var(--ice-50);
  color: var(--brand);
}

.etable__cell .icon {
  width: 34px;
  height: 34px;
  stroke-width: 3;
}

.etable__cell.is-on {
  background: var(--ice-200);
}

/* ───────── Take-home ───────── */

.th {
  flex: 1;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  align-items: start;
}

.th__list {
  padding: 12px 14px 14px;
}

.th__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.th__item {
  display: grid;
  grid-template-columns: 44px 1fr 48px;
  gap: 12px;
  align-items: start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--ice-200);
}

.th__n {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.th__item .write {
  min-height: 56px;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
}

.th__item .icon-btn {
  margin-top: 8px;
}

.th__recap {
  padding: 18px 20px;
}

.th__recap ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.th__recap li {
  padding: 10px 14px;
  border-radius: var(--radius-s);
  background: var(--ice-50);
  border-left: 4px solid var(--brand);
  white-space: pre-wrap;
  font-size: 16px;
}

.th__recap li span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.th__recap p {
  margin: 10px 0 0;
}

/* ───────── Banda in basso ───────── */

.band {
  background: url("../img/band.webp") center / cover no-repeat, linear-gradient(90deg, var(--navy), var(--brand));
}

body.is-typing .app {
  grid-template-rows: var(--header-h) var(--subnav-h) 1fr 0;
}

/* ───────── Benvenuto (solo con più gruppi) ───────── */

.welcome {
  position: relative;
  height: var(--app-h, 100dvh);
  display: grid;
  place-items: center;
  background: url("../img/cover.webp") center / cover no-repeat, var(--navy);
}

.welcome__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 36px 44px;
  border-radius: 24px;
  background: rgb(10 19 96 / 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  text-align: center;
}

.welcome__mark {
  width: min(420px, 60vw);
  height: auto;
}

.welcome__ask {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.welcome__groups {
  display: flex;
  gap: 14px;
}

.group-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 180px;
  padding: 18px 26px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--brand);
}

.group-btn strong {
  font-size: 24px;
}

.group-btn span {
  font-size: 15px;
  color: var(--ink-3);
}

.welcome__note,
.welcome__event {
  margin: 0;
  font-size: 15px;
  opacity: 0.85;
}

/* ───────── Pannello laterale ───────── */

.sheet {
  margin: 0 0 0 auto;
  width: min(540px, 92vw);
  zoom: var(--z, 1);
  height: calc(100dvh / var(--z, 1));
  max-height: none;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-2);
}

.sheet[open] {
  animation: sheet-in 0.42s var(--ease) both;
}

.sheet::backdrop {
  background: rgb(10 19 96 / 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

@keyframes sheet-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  padding: calc(26px + env(safe-area-inset-top)) 30px 30px;
  overflow-y: auto;
}

.sheet__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet__top h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: var(--navy);
}

.sheet__kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.sheet__obj {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--ice-50);
}

.sheet__obj span {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet__obj p {
  margin: 0;
  font-size: 16.5px;
}

.timing {
  display: flex;
  gap: 3px;
}

.timing__seg {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}

.timing__seg strong {
  padding: 6px 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.timing__seg:first-child strong {
  border-radius: 6px 0 0 6px;
  background: var(--brand-2);
}

.timing__seg:last-child strong {
  border-radius: 0 6px 6px 0;
  background: var(--navy);
}

.timing__seg:only-child strong {
  border-radius: 6px;
}

.timing__seg span {
  padding-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--ice-200);
  color: var(--navy);
  flex: none;
}

.icon-btn--s {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  background: transparent;
  color: var(--ink-3);
}

.icon-btn--s:active {
  background: #fbe4e0;
  color: var(--danger);
}

.icon-btn--s .icon {
  width: 20px;
  height: 20px;
}

.sheet__goal {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
}

.how {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: how;
}

.how li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  counter-increment: how;
}

.how li::before {
  content: counter(how);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.how strong {
  display: block;
  color: var(--navy);
}

.how p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 16px;
}

.pin-input {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--ice-300);
  border-radius: var(--radius-s);
  background: var(--ice-50);
  font-size: 30px;
  letter-spacing: 0.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pin-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(51 102 224 / 0.2);
}

.line-input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--ice-300);
  border-radius: var(--radius-s);
  background: var(--ice-50);
  font-size: 19px;
}

.line-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(51 102 224 / 0.2);
}

.pin-error[hidden] {
  display: none;
}

.pin-error {
  margin: 0;
  color: #a33a1f;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.btn:active {
  background: var(--navy);
}

.btn--soft {
  background: var(--ice-200);
  color: var(--navy);
}

.btn-row {
  display: flex;
  gap: 12px;
}

.btn-row .btn {
  flex: 1;
}

.danger-zone {
  margin-top: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid #f0c4bd;
  background: #fdf3f1;
}

.danger-zone h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}

.danger-zone p {
  margin: 6px 0 14px;
  color: var(--ink-2);
  font-size: 15px;
}

.danger-box {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fdf3f1;
  border: 1px solid #f0c4bd;
  color: var(--ink);
}

.danger-box > .icon {
  width: 28px;
  height: 28px;
  color: var(--danger);
}

.danger-box p {
  margin: 0 0 8px;
}

.danger-box__count {
  font-weight: 600;
  color: var(--danger);
}

.btn--danger {
  background: var(--danger);
}

.btn--danger:active {
  background: #7f1d14;
}

.btn--danger:disabled {
  opacity: 0.7;
}

.btn--danger .icon,
.btn--danger-soft .icon {
  width: 20px;
  height: 20px;
}

.btn--danger:disabled .icon {
  animation: spin 0.9s linear infinite;
}

.btn--danger-soft {
  background: #fff;
  color: var(--danger);
  box-shadow: inset 0 0 0 1.5px var(--danger);
  font-size: 16px;
}

.btn--danger-soft:active {
  background: #fbe4e0;
}

.sheet__status {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ice-200);
  font-size: 14px;
  color: var(--ink-3);
}

/* ───────── Viewer (sola lettura) ───────── */

.viewer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viewer-badge .icon {
  width: 18px;
  height: 18px;
}

.viewer-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgb(0 0 40 / 0.25);
}

.viewer-switch button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.viewer-switch button[aria-current="true"] {
  background: #fff;
  color: var(--brand);
}

.sync--viewer {
  border: 0;
  background: transparent;
  color: #fff;
  min-height: 40px;
  padding: 0;
}

.live-pin {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 5px;
  border-radius: 999px;
  background: #ffe9c2;
  color: var(--warn-ink);
  font-size: 12px;
  font-weight: 700;
}

.live-pin .icon {
  width: 14px;
  height: 14px;
}

.ws-tab.is-live .ws-tab__num {
  box-shadow: 0 0 0 2px #ffd48a;
}

.is-viewer .rate__btn,
.is-viewer .qitem__pick,
.is-viewer .verdict,
.is-viewer .etable__cell,
.is-viewer .prio__btn {
  pointer-events: none;
}

.is-viewer .add-row,
.is-viewer [data-row-del],
.is-viewer .gtable__del {
  display: none;
}

.is-viewer .write {
  background-color: #fff;
  caret-color: transparent;
}

.is-viewer .write--cell,
.is-viewer .scard__col .write {
  background-color: transparent;
}

.is-viewer .write:focus {
  border-color: var(--ice-300);
  box-shadow: none;
}

/* ───────── Contributi dei partecipanti (vista del moderatore) ───────── */

.peers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  border-radius: var(--radius-s);
  background: var(--ice-100);
  border-left: 4px solid var(--brand-2);
}

.peers[hidden],
.peer-rows[hidden],
.peer-votes[hidden],
.peer-count[hidden] {
  display: none;
}

.peers__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.peers__head .icon {
  width: 18px;
  height: 18px;
}

.peers__head span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0;
}

.peers ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.peers li {
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.peers li strong {
  display: block;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.peer-rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 15px;
  color: var(--ink-2);
}

.peer-rate__mean strong {
  font-size: 18px;
  color: var(--navy);
}

.peer-rate__mean strong {
  color: var(--abro);
}

.rate--upa .peer-rate__mean strong {
  color: var(--upa);
}

.peer-rate__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.peer-rate__list span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.peer-rate__use {
  margin-left: auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: #fff;
  color: var(--abro);
  font-size: 14px;
  font-weight: 700;
}

.rate--upa .peer-rate__use {
  color: var(--upa);
}

.vtable__val span,
.vtable__val small {
  display: block;
}

.peer-mean {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}

.peer-votes,
.mod-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  margin-right: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ice-200);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.mod-tag {
  background: #ffe9c2;
  color: var(--warn-ink);
}

.peer-votes .icon,
.mod-tag .icon {
  width: 15px;
  height: 15px;
}

.verdict,
.etable__cell {
  position: relative;
}

.peer-count {
  position: absolute;
  top: -8px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 13px;
  background: var(--brand-2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}

.etable__cell .peer-count {
  top: 6px;
  right: 6px;
}

.peer-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
}

.peer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.peer-card {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--ice-50);
  border: 1px solid var(--ice-200);
}

.peer-card h3 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.peer-card ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.peer-card li {
  font-size: 15px;
}

.peer-card__f {
  display: block;
  white-space: pre-wrap;
}

.peer-card__f em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.people ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.people li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ice-50);
  font-weight: 600;
}

.people li .muted {
  font-weight: 500;
  font-size: 14px;
}

/* partecipante */

.name-grid,
.welcome__groups--names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
}

.welcome__groups--names {
  max-width: 680px;
}

.welcome__groups--names .group-btn {
  min-width: 0;
  padding: 16px 12px;
}

.welcome__groups--names .group-btn strong {
  font-size: 19px;
}

.group-chip__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────── Schermi più stretti (iPad 13" orizzontale e sotto) ───────── */

@media (max-width: 1480px) {
  .ws-tab {
    padding-right: 14px;
    font-size: 15px;
  }

  .ws-tab:not([aria-current]) .ws-tab__label {
    display: none;
  }

  .ws-tab:not([aria-current]) {
    padding-right: 10px;
  }
}

@media (max-width: 1180px) {
  :root {
    --gutter: 20px;
  }

  .topbar__brand img {
    height: 18px;
  }

  .viewer-badge,
  .sync__text {
    display: none;
  }

  .sync {
    min-width: 0;
  }

  .dim,
  .scard,
  .quadro,
  .th {
    grid-template-columns: 1fr;
  }

  .qlist--two,
  .syn--three {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-wrap: wrap;
  }
}

/* Barra precedente / successiva: solo sul telefono */
.pager {
  display: none;
}

/* ───────── Smartphone (i partecipanti usano il proprio telefono) ───────── */

@media (max-width: 760px) {
  :root {
    --header-h: auto;
    --subnav-h: 58px;
    --band-h: 0px;
    --gutter: 14px;
  }

  .app {
    grid-template-rows: var(--header-h) var(--subnav-h) 1fr auto var(--band-h);
  }

  .pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgb(182 195 234 / 0.6);
    background: rgb(255 255 255 / 0.94);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    position: relative;
    z-index: 2;
  }

  .pager:empty {
    display: none;
  }

  .pager__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    min-height: 50px;
    padding: 0 12px;
    border: 1px solid var(--ice-300);
    border-radius: 14px;
    background: #fff;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
    justify-self: start;
  }

  .pager__btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pager__btn .icon {
    width: 18px;
    height: 18px;
    transform: rotate(180deg);
  }

  .pager__btn--next {
    justify-self: end;
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
  }

  .pager__btn--next .icon {
    transform: none;
  }

  .pager__live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #ffe9c2;
    color: var(--warn-ink);
    font-size: 13px;
    font-weight: 700;
  }

  .pager__live .icon {
    width: 16px;
    height: 16px;
  }

  .pager__pos {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
  }

  /* il "successivo" in pagina è doppio: c'è la barra in basso */
  .page-head__end .ghost-btn[data-go],
  .notes__head .ghost-btn[data-go] {
    display: none;
  }

  .page-head__end:not(:has(.ghost-btn:not([data-go]), .counter)) {
    display: none;
  }

  body {
    font-size: 16px;
  }

  /* barra in alto su due righe: marchio e stato, poi le cinque sessioni */
  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px var(--gutter) 10px;
  }

  .topbar__brand {
    flex: 1 1 0;
    height: 40px;
    min-width: 0;
  }

  .topbar__brand img {
    width: 100%;
    max-width: 230px;
    height: auto;
  }

  .topbar__meta {
    margin-left: auto;
    gap: 8px;
  }

  .group-chip--icon {
    width: 40px;
    min-height: 40px;
  }

  .group-chip {
    min-height: 40px;
    padding: 0 12px 0 10px;
    font-size: 14px;
  }

  /* sul telefono il titolo della sessione è già nell'intestazione della pagina */
  .topbar__title {
    display: none;
  }

  .topbar__title strong {
    font-size: 17px;
  }

  .topbar__title span {
    font-size: 14px;
  }

  .ws-tabs {
    order: 3;
    width: 100%;
    margin: 0;
    padding: 4px;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ws-tabs::-webkit-scrollbar {
    display: none;
  }

  .ws-tab,
  .ws-tab:not([aria-current]) {
    flex: 1;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 6px;
  }

  .ws-tab .ws-tab__label {
    display: none;
  }

  .ws-tab__num {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .dot {
    width: 12px;
    height: 12px;
  }

  .viewer-switch button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  /* sotto-navigazione: le tappe scorrono in orizzontale */
  .subnav {
    gap: 8px;
    padding: 0 0 0 var(--gutter);
  }

  .track {
    padding: 4px;
  }

  .stop {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
    gap: 7px;
  }

  .stop__badge {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .subnav__aside {
    padding-right: var(--gutter);
  }

  .subnav__aside .ghost-btn {
    width: 42px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
  }

  .ghost-btn__text {
    display: none;
  }

  .ghost-btn {
    min-height: 44px;
    font-size: 14px;
  }

  /* pagina */
  .page {
    padding: 16px var(--gutter) 28px;
    gap: 14px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-head__kicker {
    margin-left: 16px;
    font-size: 11.5px;
  }

  .page-head__title {
    gap: 10px;
  }

  .page-head__title::before {
    width: 5px;
    min-height: 26px;
  }

  h1 {
    font-size: 23px;
  }

  .page-head__lead {
    margin-left: 16px;
    font-size: 15.5px;
  }

  .page-head__end {
    margin-left: 0;
    justify-content: flex-start;
  }

  .page-head__end .ghost-btn {
    width: 100%;
    justify-content: center;
  }

  .write {
    font-size: 16.5px;
    padding: 10px 12px;
  }

  .field-label {
    font-size: 13.5px;
  }

  .field-hint {
    font-size: 14px;
  }

  .counter {
    min-height: 38px;
    font-size: 14px;
  }

  /* selezione domande */
  .qitem__pick {
    grid-template-columns: 32px 1fr 28px;
    gap: 12px;
    padding: 14px;
  }

  .qitem__n {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .qitem__text,
  .qlist--two .qitem__text {
    font-size: 15.5px;
  }

  .check {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  /* card domanda */
  .qcard__head {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 12px 16px;
  }

  .qcard__icon {
    width: 32px;
    height: 32px;
  }

  .qcard__kicker {
    font-size: 12.5px;
  }

  .qcard__num {
    font-size: 12px;
  }

  .qcard__body {
    padding: 16px 16px 18px;
  }

  .qcard__q {
    font-size: 19px;
  }

  .notes {
    padding: 14px;
    min-height: 0;
  }

  /* sul telefono il pulsante "successiva" va sotto il campo */
  .notes__head {
    display: contents;
  }

  .notes__head .ghost-btn {
    order: 3;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .notes .write {
    font-size: 17px;
    min-height: 200px;
  }

  /* sintesi */
  .syn,
  .syn--three {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .syn__field {
    padding: 16px 14px 14px;
  }

  .syn__q {
    min-height: 0;
    font-size: 16px;
  }

  .write--fill {
    min-height: 130px;
  }

  /* value comparison */
  .dim__vote {
    padding: 14px;
    gap: 14px;
  }

  .rate {
    padding: 12px;
  }

  .rate__name {
    font-size: 17px;
  }

  .rate__scale {
    gap: 6px;
  }

  .rate__btn {
    min-height: 52px;
    font-size: 21px;
  }

  .dim__field {
    padding: 14px;
  }

  .dim__qs p {
    font-size: 15px;
  }

  .quadro__table {
    padding: 6px;
  }

  /* tabella del confronto: dimensione e voti su una riga, rilevanza sotto */
  .vtable,
  .vtable thead,
  .vtable tbody {
    display: block;
  }

  .vtable tr {
    display: grid;
    grid-template-columns: 1fr 54px 54px;
    align-items: center;
  }

  .vtable thead th:last-child {
    display: none;
  }

  .vtable thead th:nth-child(3) {
    border-top-right-radius: 10px;
  }

  .vtable th,
  .vtable td {
    padding: 10px;
    border-bottom: 0;
  }

  .vtable tbody tr {
    border-bottom: 1px solid var(--ice-200);
  }

  .vtable tbody th {
    white-space: normal;
    font-size: 15px;
  }

  .vtable__mol {
    width: auto;
  }

  .vtable__val {
    align-self: stretch;
    display: grid !important;
    place-items: center;
    font-size: 20px;
  }

  .vtable td.vtable__rel {
    grid-column: 1 / -1;
    display: block;
    width: auto;
    max-width: none;
    padding-top: 0;
    font-size: 14px;
  }

  .vtable td.vtable__rel:has(> .muted) {
    display: none;
  }

  .quadro__chart {
    padding: 10px 6px 14px;
  }

  .radar__label {
    font-size: 26px;
  }

  .radar__series polygon {
    stroke-width: 4;
  }

  .legend {
    gap: 16px;
    font-size: 14px;
  }

  /* tabelle a righe: ogni riga diventa una scheda */
  .grid {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .gtable,
  .gtable tbody,
  .gtable tr,
  .gtable td {
    display: block;
    width: auto;
  }

  .gtable thead {
    display: none;
  }

  .gtable tbody {
    display: grid;
    gap: 12px;
  }

  .gtable tbody tr {
    position: relative;
    padding: 12px 12px 14px;
    border-radius: var(--radius);
    background: var(--paper);
    border: 1px solid rgb(214 222 245 / 0.9);
    box-shadow: var(--shadow-1);
    counter-increment: grow;
  }

  .gtable tbody {
    counter-reset: grow;
  }

  .gtable tbody tr::before {
    content: counter(grow);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
  }

  .gtable tbody tr:nth-child(odd) td {
    background: transparent;
  }

  .gtable td,
  .gtable td + td {
    padding: 8px 0 0;
    border: 0;
  }

  .gtable td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand);
  }

  .gtable .write--cell {
    min-height: 48px;
    border: 1px solid var(--ice-300);
    background-color: var(--ice-50);
    font-size: 16px;
  }

  .gtable .write--cell:focus {
    border-color: var(--brand);
    background-color: #fff;
  }

  .gtable td.gtable__del {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0;
  }

  .gtable__prio {
    width: auto;
  }

  .add-row {
    width: 100%;
    justify-content: center;
    margin: 12px 0 0;
    background: var(--paper);
  }

  .prio__btn {
    font-size: 13px;
  }

  .prio-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
  }

  /* strategy card */
  .scard__head {
    padding: 14px 16px;
    font-size: 15px;
  }

  .scard__card {
    box-shadow: 6px 6px 0 -1px var(--ice-100), 6px 6px 0 0 var(--ice-300), var(--shadow-1);
  }

  .scard__text {
    padding: 18px 16px;
    font-size: 19px;
  }

  .scard__edit {
    padding: 12px;
  }

  .scard__edit .write {
    font-size: 18px;
    min-height: 110px;
  }

  .scard__verdict {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }

  .verdicts {
    gap: 6px;
  }

  .verdict {
    flex-direction: column;
    gap: 6px;
    min-height: 74px;
    padding: 8px 4px;
    font-size: 14px;
  }

  .scard__cols {
    flex: none;
    grid-template-columns: 1fr;
  }

  .scard__col {
    min-height: 0;
  }

  .scard__col + .scard__col {
    border-left: 0;
    border-top: 1px solid var(--ice-200);
  }

  .scard__col-head {
    text-align: left;
    font-size: 13px;
  }

  .scard__col .write {
    min-height: 100px;
  }

  .scard__dis {
    padding: 14px;
  }

  /* esiti */
  .etable th,
  .etable td {
    padding: 6px 3px;
  }

  .etable thead th {
    padding: 10px 4px;
    font-size: 10.5px;
    letter-spacing: 0.02em;
  }

  .etable thead th:first-child {
    padding-left: 10px;
  }

  .etable tbody th {
    width: 46%;
  }

  .etable__msg {
    min-height: 60px;
    padding: 6px;
  }

  .etable__msg strong {
    font-size: 14px;
  }

  .etable__msg span {
    font-size: 13.5px;
  }

  .etable__cell {
    min-height: 56px;
  }

  .etable__cell .icon {
    width: 26px;
    height: 26px;
  }

  /* take-home */
  .th__list {
    padding: 8px 10px 12px;
  }

  .th__item {
    grid-template-columns: 32px 1fr 40px;
    gap: 8px;
    padding: 10px 0;
  }

  .th__n {
    width: 30px;
    height: 30px;
    margin-top: 8px;
    font-size: 15px;
  }

  .th__item .write {
    font-size: 17px;
  }

  .th__item .icon-btn {
    margin-top: 2px;
  }

  .th__recap {
    padding: 14px;
  }

  .th__recap li {
    font-size: 15px;
  }

  .icon-btn--s {
    width: 40px;
    height: 40px;
  }

  /* pannello laterale a tutto schermo */
  .sheet {
    width: 100%;
    max-width: 100%;
  }

  .sheet__inner {
    padding: calc(16px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  .sheet__top h2 {
    font-size: 21px;
  }

  .sheet__goal {
    font-size: 16.5px;
  }

  .timing {
    flex-wrap: wrap;
  }

  .timing__seg {
    min-width: 60px;
  }

  .btn-row {
    flex-direction: column;
  }

  /* benvenuto */
  .welcome__panel {
    margin: 0 var(--gutter);
    padding: 26px 20px;
  }

  .welcome__groups {
    flex-wrap: wrap;
    justify-content: center;
  }

  .group-btn {
    min-width: 130px;
    padding: 14px 18px;
  }

  .group-chip__name {
    max-width: 96px;
  }

  .peers li {
    font-size: 15px;
  }

  .peer-rate__use {
    margin-left: 0;
  }

  .peer-rows {
    padding: 14px;
  }

  .peer-cards {
    grid-template-columns: 1fr;
  }

  .welcome__groups--names {
    grid-template-columns: 1fr 1fr;
  }

  .vtable__val small {
    font-size: 11.5px;
  }

  /* mentre si scrive, con la tastiera aperta, resta solo il campo */
  body.is-typing .ws-tabs,
  body.is-typing .subnav,
  body.is-typing .pager {
    display: none;
  }

  body.is-typing .topbar {
    padding-bottom: 8px;
  }

  /* la sotto-navigazione esce dalla griglia: restano barra, contenuto e banda (a zero) */
  body.is-typing .app {
    grid-template-rows: auto 1fr 0;
  }
}

@media (max-width: 380px) {
  .verdict {
    font-size: 12.5px;
  }

  .etable thead th {
    font-size: 9.5px;
  }

  .stop {
    padding: 0 10px;
  }
}
