/* Nivo SCan · tool per advisory board da remoto (PC, con adattamento a smartphone)
   Identità dal deck "BMS_Nivo-SCan_deck 20 novembre": fondo scuro a striature, magenta del logo, titoli blu petrolio. */

:root {
  /* Palette dal deck */
  --navy: #04202e;
  --blue: #083c5c;
  --blue-2: #0b5574;
  --accent: #b43e96;
  --accent-soft: #f7e6f2;
  --teal: #2e8a9b;
  --sky: #cfe1e8;
  --sky-soft: #e6eef1;
  --pale: #f4f3f1;
  --line: #d3dce0;
  --ink: #13232d;
  --ink-2: #3d4f59;
  --ink-3: #6b7b84;
  --paper: #ffffff;
  --nivo: #b43e96;
  --note: #fff6c4;
  --note-line: #ecd679;
  --danger: #a5281b;
  --ok: #2f7d4f;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-s: 8px;
  --shadow-1: 0 1px 2px rgb(4 32 46 / 0.06), 0 4px 14px rgb(4 32 46 / 0.06);
  --shadow-2: 0 2px 6px rgb(4 32 46 / 0.12), 0 18px 48px rgb(4 32 46 / 0.24);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 28px;
  --maxw: 1440px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--pale);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

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

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

.small {
  font-size: 14px;
}

.kicker,
.h-kicker {
  margin: 0;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.h-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--navy);
}

/* ───────── Pulsanti ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.1s;
}

.btn:hover {
  background: var(--blue);
}

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

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

.btn--soft:hover {
  background: var(--sky);
}

.btn--small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.btn--small .icon {
  width: 16px;
  height: 16px;
}

.btn--big {
  min-height: 52px;
  font-size: 17px;
}

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

.btn--danger:hover {
  background: #84190e;
}

.btn.is-done,
.chip.is-done {
  background: var(--ok) !important;
  color: #fff !important;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
}

.iconbtn:hover {
  background: var(--sky-soft);
  color: var(--navy);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 0 var(--gutter) 6px;
  background: url(../img/band.jpg) left bottom / 100% 6px no-repeat, var(--navy);
  color: #fff;
}

.brand {
  display: flex;
  flex-direction: column;
  flex: none;
  line-height: 1.1;
}

.brand__logo {
  display: block;
  mix-blend-mode: lighten;
  height: 30px;
  width: auto;
}

.brand__ab {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.7);
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

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

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / 0.88);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.tab:hover {
  background: rgb(255 255 255 / 0.1);
}

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

.tab--icon {
  padding: 0 12px;
}

.tab__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  font-size: 13px;
}

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

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

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.5);
}

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

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

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

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

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

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

.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 240px;
  padding: 0 14px 0 10px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

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

.chip:hover {
  background: rgb(255 255 255 / 0.16);
}

.chip .icon {
  width: 17px;
  height: 17px;
}

.chip--push {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.chip--push:hover {
  background: #9c2f80;
}

.sync {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgb(255 255 255 / 0.85);
  white-space: nowrap;
}

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

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

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

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

.follow {
  position: sticky;
  top: 64px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px var(--gutter);
  background: var(--accent-soft);
  color: var(--blue);
  font-size: 15px;
}

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px var(--gutter) 64px;
}

/* ───────── Card e intestazioni ───────── */

.card {
  min-width: 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.count {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.phead {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 2fr) auto;
  gap: 16px 28px;
  align-items: start;
  margin-bottom: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.phead h1 {
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--blue);
}

.phead__mode {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
}

.phead__q {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 12px;
}

.bq {
  padding: 14px 16px;
  border-radius: var(--radius-s);
  background: var(--sky-soft);
}

.bq__t {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.bq__q {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.phead .steps {
  grid-column: 1 / -1;
}

.phead--output {
  grid-template-columns: 1fr auto;
  align-items: center;
}

/* ───────── Home ───────── */

.hero {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
}

.hero__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  object-position: left center;
}

.hero__ab {
  position: absolute;
  right: 20px;
  top: 18px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgb(4 32 46 / 0.7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.hero__name {
  margin: 8px 0 4px;
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.hero__tag {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  margin-bottom: 20px;
}

.objectives {
  margin: 0 0 24px;
  padding-left: 20px;
}

.objectives li + li {
  margin-top: 8px;
}

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

.agenda li {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.agenda li:first-child {
  border-top: 0;
}

.agenda li.is-ws {
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--pale);
}

.agenda__time {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-2);
  font-variant-numeric: tabular-nums;
}

.agenda__body {
  display: flex;
  flex-direction: column;
}

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

.agenda__body em {
  font-size: 13px;
  font-style: normal;
  color: var(--ink-3);
}

.card--mod {
  margin-bottom: 20px;
}

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

.linkrow span {
  font-weight: 700;
}

.linkrow code {
  flex: 1 1 280px;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  background: var(--pale);
  font-size: 14px;
  word-break: break-all;
}

/* ───────── Bacheca a post-it (fasi 1 e 3) ───────── */

.board__cols {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.board--f3 {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 16px;
  align-items: start;
}

.board__gtitle {
  margin: 0 0 10px;
  padding: 8px 14px;
  border-radius: var(--radius-s);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.col {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-1);
}

.col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -14px -14px 12px;
  padding: 12px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--blue-2);
  color: #fff;
}

.col__head h2 {
  margin: 0;
  font-size: 16px;
}

.col__count {
  min-width: 26px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.col__topic {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-3);
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.note {
  padding: 10px 12px 6px;
  border: 1px solid var(--note-line);
  border-radius: 4px 4px 4px 14px;
  background: var(--note);
  box-shadow: 0 2px 4px rgb(120 90 0 / 0.08);
}

.note--own {
  border-color: #d9be45;
}

.note__text {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

textarea.note__text:focus {
  outline: none;
}

.note:focus-within {
  outline: 3px solid var(--blue-2);
  outline-offset: 1px;
}

.note__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.note__by {
  font-size: 12px;
  font-weight: 700;
  color: #7a6414;
}

.note__del {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9a8530;
  opacity: 0.7;
}

.note__del:hover {
  opacity: 1;
  background: rgb(0 0 0 / 0.06);
}

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

.add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: auto;
  border: 2px dashed var(--line);
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--blue-2);
  font-weight: 700;
}

.add:hover {
  border-color: var(--blue-2);
  background: var(--pale);
}

/* ───────── Fase 2 ───────── */

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

.step {
  flex: none;
}

/* Barre che scorrono in orizzontale (sezioni, passaggi, gruppi): touch, rotella e trascinamento.
   La sfumatura indica da che lato c'è altro contenuto. */
.hscroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  min-width: 0;
  max-width: 100%;
  --fade-l: 0px;
  --fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}

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

.hscroll.can-left {
  --fade-l: 36px;
}

.hscroll.can-right {
  --fade-r: 36px;
}

@media (pointer: fine) {
  .hscroll.can-left,
  .hscroll.can-right {
    cursor: grab;
  }
}

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

.hscroll.is-dragging > * {
  pointer-events: none;
}

.hscroll > * {
  flex-shrink: 0;
}

.step {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 15px;
}

.step[aria-current="page"] {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.f2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.card--sticky {
  position: sticky;
  top: 90px;
}

.gtag,
.drugtag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-s);
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.drugtag {
  background: var(--blue);
  min-width: 160px;
  justify-content: center;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dimtable {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.dimrow {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.3fr);
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  background: var(--pale);
}

.dimrow--head {
  padding-top: 0;
  padding-bottom: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dimrow__label {
  color: var(--blue);
  line-height: 1.25;
}

.dimrow__label small {
  font-size: 12px;
  color: var(--ink-3);
}

.field--motiv {
  min-height: 40px;
  padding: 8px 10px;
  background: var(--paper);
  resize: none;
  font-size: 15px;
  overflow: hidden;
}

.field--inline {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 14px;
  background: var(--paper);
}

.lbl--block {
  display: block;
  margin: 14px 0 6px;
}

.motivs {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.motivs li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--pale);
}

.motivs p {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.motivs__score {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--blue);
  font-weight: 800;
}

.motivs__score[data-v="4"],
.motivs__score[data-v="5"] {
  background: var(--nivo);
  color: #fff;
}

.radar__n {
  font-size: 11px;
  fill: var(--ink-3);
}

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

.radar-wrap {
  width: 100%;
}

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

.radar__ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}

.radar__ring:last-of-type {
  stroke: var(--blue);
}

.radar__axis {
  stroke: var(--sky);
  stroke-width: 1.5;
}

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

.radar__sub {
  font-size: 12px;
  fill: var(--ink-3);
}

.radar__poly {
  fill: var(--c);
  fill-opacity: 0.12;
  stroke: var(--c);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

polyline.radar__poly {
  fill: none;
}

.radar__dot {
  fill: var(--c);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-2);
}

.legend__i {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend__sw {
  width: 22px;
  height: 0;
  border-top: 3px solid var(--c);
}

.scale {
  display: inline-flex;
  gap: 4px;
}

.scale__b {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--blue-2);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

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

.scale__b:hover {
  border-color: var(--blue-2);
  background: var(--pale);
}

.field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--pale);
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
}

.field:focus {
  outline: none;
  border-color: var(--blue-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(16 87 161 / 0.18);
}

.field--line {
  min-height: 48px;
}

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

.groupbar p {
  flex: 1 1 260px;
  margin: 0;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-s);
  background: var(--pale);
  border: 1px solid var(--line);
}

.seg__b {
  min-height: 36px;
  min-width: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
}

.seg__b[aria-selected="true"] {
  background: var(--navy);
  color: #fff;
}

.seg--small .seg__b {
  min-height: 32px;
  min-width: 36px;
  padding: 0 10px;
}

.resti {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.resti__g {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.resti h3 {
  margin-top: 20px;
}

.prose {
  margin: 0;
  white-space: pre-wrap;
}

.empty {
  text-align: center;
  padding: 48px 24px;
  font-size: 17px;
}

/* ───────── Output ───────── */

.otable {
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow-1);
}

.orow {
  display: grid;
  grid-template-columns: 110px repeat(auto-fit, minmax(0, 1fr));
  gap: 2px;
}

.ophase {
  display: grid;
  place-items: center;
  background: var(--sky-soft);
  color: var(--navy);
  font-weight: 800;
  font-size: 16px;
}

.ocell {
  padding: 16px 18px;
  background: var(--paper);
}

.ot {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
}

.oq {
  margin: 2px 0 14px;
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
}

.osub {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 14px;
}

.osub__h {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--sky);
  font-weight: 700;
  color: var(--blue);
}

.olist {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.olist li + li {
  margin-top: 4px;
}

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

.ogroup__g {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sky-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.ogroup .prose {
  font-size: 14px;
}

/* ───────── Partecipanti ───────── */

.people {
  width: 100%;
  border-collapse: collapse;
}

.people th,
.people td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.people thead th {
  border-top: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card--danger {
  margin-top: 20px;
  border: 1px solid #efc9c3;
}

.card--danger .h-kicker {
  color: var(--danger);
}

/* ───────── Ingresso ───────── */

.entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: 32px;
  align-items: center;
  min-height: 100dvh;
  padding: 32px clamp(16px, 5vw, 72px);
  background: url(../img/stripes.jpg) right center / auto 100% no-repeat, var(--navy);
  color: #fff;
}

.entry__brand img {
  display: block;
  mix-blend-mode: lighten;
  width: min(440px, 100%);
  height: auto;
}

.entry__brand p {
  margin: 14px 0 0;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: rgb(255 255 255 / 0.85);
}

.entry__card {
  position: relative;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(480px, 100%);
  padding: 32px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-2);
}

.entry__choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.entry__choices .btn {
  flex: 1;
}

.lbl {
  font-weight: 700;
  color: var(--navy);
}

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

.sheet {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-2);
}

.sheet::backdrop {
  background: rgb(0 20 60 / 0.45);
}

.sheet__inner {
  padding: 24px 28px 28px;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.sheet__head h2 {
  margin: 4px 0 2px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet__body ul,
.sheet__body ol {
  margin: 0;
  padding-left: 22px;
}

.sheet__body .h-kicker {
  margin: 12px 0 0;
}

.step-t {
  margin: 4px 0 0;
  font-weight: 700;
}

.sheet__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.form-err {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

/* ───────── Schermi più stretti ───────── */

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px var(--gutter);
  }

  .tabs {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .topbar__meta {
    margin-left: auto;
  }

  .follow {
    top: 0;
    position: relative;
  }

  .phead {
    grid-template-columns: 1fr auto;
  }

  .phead__q {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .phead__info {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 1000px) {
  .board--f3 {
    grid-template-columns: 1fr;
  }

  .f2,
  .resti,
  .home-grid,
  .entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  .main {
    padding-top: 16px;
  }

  .sync span {
    display: none;
  }

  .chip--push span {
    display: none;
  }

  .tab {
    padding: 0 12px 0 8px;
    font-size: 14px;
  }

  .phead {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .phead__q {
    grid-auto-flow: row;
    grid-row: auto;
  }

  .phead__info {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .phead h1 {
    font-size: 21px;
  }

  .board__cols {
    grid-template-columns: 1fr;
  }

  .col {
    min-height: 0;
  }

  .card {
    padding: 18px 16px;
  }

  .hero__ab {
    position: static;
    border-radius: 0;
    background: var(--navy);
    font-size: 13px;
    text-align: center;
  }

  /* barra compatta: logo e profilo su una riga, sezioni sotto */
  .topbar {
    gap: 6px 10px;
    padding: 8px var(--gutter) 12px;
  }

  .brand__logo {
    height: 24px;
  }

  .brand__ab {
    font-size: 10px;
  }

  .chip {
    max-width: 170px;
    min-height: 34px;
  }

  .tab {
    min-height: 36px;
  }

  .entry {
    align-content: center;
    background: linear-gradient(180deg, rgb(4 32 46 / 0.85), rgb(4 32 46 / 0.55)), url(../img/stripes.jpg) center / cover no-repeat, var(--navy);
  }

  .entry__card {
    padding: 24px 20px;
  }

  /* sotto i 16px iOS ingrandisce la pagina quando si tocca un campo */
  .field,
  .field--motiv,
  .field--inline,
  .note__text {
    font-size: 16px;
  }

  .phead {
    margin-bottom: 14px;
  }

  .phead .steps {
    margin: 0 -18px;
    padding: 0 18px;
  }

  .agenda li {
    grid-template-columns: 1fr auto;
  }

  .agenda__time {
    grid-column: 1 / -1;
  }

  /* punteggio su una riga intera: bottoni più grandi da toccare */
  .dimrow .scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
  }

  .dimrow .scale__b {
    width: auto;
    height: 40px;
    border-radius: var(--radius-s);
  }

  /* su telefono ogni dimensione va in colonna: nome, punteggio, motivazione */
  .dimrow {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dimrow > :last-child {
    grid-column: 1 / -1;
  }

  .dimrow--head {
    display: none;
  }

  .card--sticky {
    position: static;
  }

  .orow {
    grid-template-columns: 1fr;
  }

  .ophase {
    padding: 8px;
  }

  .osub {
    grid-template-columns: 1fr;
  }

  .people thead {
    display: none;
  }

  .people tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
  }

  .people td {
    border: 0;
    padding: 0;
  }

  .sheet__inner {
    padding: 20px;
  }
}

/* ───────── Stampa (output) ───────── */

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  .topbar,
  .follow,
  .phead .btn {
    display: none !important;
  }

  .main {
    padding: 0;
    max-width: none;
  }

  .card,
  .otable,
  .col {
    box-shadow: none;
  }

  .orow {
    break-inside: avoid;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
