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

    :root {
      --blue:        #1a3a5c;
      --blue-light:  #2a5f9e;
      --blue-bg:     #e8f0f8;
      --blue-pale:   #f0f5fb;
      --accent:      #f5a623;
      --accent-less: #e05c5c;
      --white:       #ffffff;
      --grey-light:  #f4f6f9;
      --grey-border: #dce3ed;
      --text:        #1a2b3c;
      --text-muted:  #6b7f96;
      --radius:      12px;
      --radius-sm:   8px;
      --shadow:      0 2px 16px rgba(26,58,92,0.10);
      --shadow-card: 0 4px 24px rgba(26,58,92,0.13);
    }

    html, body {
      min-height: 100vh;
      font-family: 'Titillium Web', sans-serif;
      background: var(--blue-bg);
      color: var(--text);
    }

    /* ── HEADER ── */
    header {
      background: var(--white);
      border-bottom: 1px solid var(--grey-border);
      padding: 0 1.25rem;
      height: 64px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      box-shadow: 0 2px 8px rgba(26,58,92,0.07);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .logo {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--blue);
      text-decoration: none;
      letter-spacing: -0.5px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .logo sup { font-size: 0.6em; vertical-align: super; }
    .header-sub {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 300;
      letter-spacing: 0.3px;
      text-align: right;
      line-height: 1.4;
    }

    /* ── LAYOUT ── */
    main {
      max-width: 1100px;
      margin: 0 auto;
      padding: 2.5rem 1.5rem 4rem;
    }

    /* ── PROGRESS ── */
    .progress-section {
      margin-bottom: 2rem;
    }
    .progress-meta {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-bottom: 8px;
    }
    .progress-label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--blue-light);
      font-weight: 600;
    }
    .progress-counter {
      font-size: 0.85rem;
      color: var(--text-muted);
      font-weight: 400;
    }
    .progress-bar-track {
      height: 5px;
      background: var(--grey-border);
      border-radius: 99px;
      overflow: hidden;
    }
    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--blue-light), #4a90d9);
      border-radius: 99px;
      transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    }

    /* ── TWO-COLUMN LAYOUT ── */
    .scenario-layout {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2rem;
      align-items: start;
    }
    @media (max-width: 768px) {
      .scenario-layout { grid-template-columns: 1fr; }
    }

    /* ── SCENARIO CARD ── */
    .scenario-card {
      background: var(--white);
      border-radius: var(--radius);
      box-shadow: var(--shadow-card);
      overflow: hidden;
      border: 1px solid var(--grey-border);
    }
    .scenario-card-img {
      width: 100%;
      height: 320px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border-bottom: 1px solid var(--grey-border);
    }
    .scenario-card-img img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      padding: 12px 16px;
    }
    .scenario-card-body {
      padding: 1.5rem;
    }
    .scenario-card-body h3 {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--blue-light);
      text-transform: uppercase;
      letter-spacing: 1.2px;
      margin-bottom: 0.5rem;
    }
    .scenario-card-body p {
      font-size: 0.92rem;
      line-height: 1.7;
      color: var(--text);
      font-weight: 300;
    }

    /* ── ANSWER PANEL ── */
    .answer-panel h4 {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--blue);
      margin-bottom: 1.25rem;
      line-height: 1.5;
    }

    .answer-instruction {
      display: flex;
      gap: 0.75rem;
      margin-bottom: 1.25rem;
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .instruction-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 99px;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }
    .instruction-badge.best  { background: rgba(42,95,158,0.12); color: var(--blue-light); }
    .instruction-badge.worst { background: rgba(224,92,92,0.12);  color: var(--accent-less); }

    /* ── ANSWER BUTTONS ── */
    .answers-list {
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      margin-bottom: 1.5rem;
    }

    .answer-btn {
      position: relative;
      display: flex;
      align-items: flex-start;
      gap: 0.75rem;
      padding: 0.9rem 1rem;
      padding-right: 2.5rem;
      background: var(--white);
      border: 2px solid var(--grey-border);
      border-radius: var(--radius-sm);
      cursor: pointer;
      text-align: left;
      font-family: 'Titillium Web', sans-serif;
      font-size: 0.88rem;
      line-height: 1.5;
      color: var(--text);
      transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
      box-shadow: 0 1px 4px rgba(26,58,92,0.06);
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .answer-btn:hover:not(:disabled) {
      border-color: var(--blue-light);
      background: var(--blue-pale);
      transform: translateX(3px);
      box-shadow: 0 3px 10px rgba(26,58,92,0.10);
    }
    .answer-btn:disabled { cursor: default; }

    .answer-letter {
      font-weight: 700;
      color: var(--blue-light);
      font-size: 0.95rem;
      min-width: 20px;
      flex-shrink: 0;
      margin-top: 1px;
    }

    /* Stati selezione */
    .answer-btn.selected-best {
      border-color: var(--blue-light);
      background: linear-gradient(135deg, #e8f0fb 0%, #f0f5ff 100%);
      box-shadow: 0 3px 12px rgba(42,95,158,0.18);
    }
    .answer-btn.selected-best .answer-letter { color: var(--blue); }

    .answer-btn.selected-worst {
      border-color: var(--accent-less);
      background: linear-gradient(135deg, #fdf0f0 0%, #fff5f5 100%);
      box-shadow: 0 3px 12px rgba(224,92,92,0.15);
    }
    .answer-btn.selected-worst .answer-letter { color: var(--accent-less); }

    /* Badge floating */
    .answer-badge {
      position: absolute;
      top: -10px;
      right: -8px;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 3px 9px;
      border-radius: 99px;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      white-space: nowrap;
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
      opacity: 0;
      transform: scale(0.7) translateY(-4px);
      transition: opacity 0.2s, transform 0.2s;
      pointer-events: none;
    }
    .answer-badge.visible {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
    .answer-badge.best  { background: var(--blue-light); color: white; }
    .answer-badge.worst { background: var(--accent-less); color: white; }

    /* ── ACTION BUTTONS ── */
    .action-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }
    .btn {
      padding: 0.75rem 1rem;
      border-radius: var(--radius-sm);
      font-family: 'Titillium Web', sans-serif;
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: 0.3px;
      border: none;
      cursor: pointer;
      transition: all 0.18s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .btn-reset {
      background: var(--white);
      color: var(--blue);
      border: 2px solid var(--grey-border);
    }
    .btn-reset:hover:not(:disabled) {
      border-color: var(--blue-light);
      color: var(--blue-light);
    }
    .btn-confirm {
      background: var(--blue);
      color: var(--white);
      box-shadow: 0 3px 10px rgba(26,58,92,0.25);
    }
    .btn-confirm:hover:not(:disabled) {
      background: var(--blue-light);
      box-shadow: 0 4px 14px rgba(42,95,158,0.35);
      transform: translateY(-1px);
    }
    .btn-confirm:disabled, .btn-reset:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    /* ── SELECTION STATUS ── */
    .selection-status {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1rem;
      font-size: 0.8rem;
    }
    .status-pill {
      flex: 1;
      text-align: center;
      padding: 6px 8px;
      border-radius: var(--radius-sm);
      font-weight: 600;
      border: 1.5px dashed var(--grey-border);
      color: var(--text-muted);
      transition: all 0.2s;
    }
    .status-pill.done-best {
      border: 1.5px solid var(--blue-light);
      background: rgba(42,95,158,0.08);
      color: var(--blue-light);
    }
    .status-pill.done-worst {
      border: 1.5px solid var(--accent-less);
      background: rgba(224,92,92,0.08);
      color: var(--accent-less);
    }

    /* ── TRANSITION OVERLAY ── */
    .screen {
      display: none;
      animation: fadeIn 0.35s ease;
    }
    .screen.active { display: block; }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── COMPLETION ── */
    .completion-wrap {
      text-align: center;
      padding: 4rem 2rem;
    }
    .completion-icon {
      font-size: 4rem;
      margin-bottom: 1.5rem;
    }
    .completion-wrap h2 {
      font-size: 1.8rem;
      font-weight: 700;
      color: var(--blue);
      margin-bottom: 0.75rem;
    }
    .completion-wrap p {
      color: var(--text-muted);
      font-size: 1rem;
      font-weight: 300;
      max-width: 480px;
      margin: 0 auto 2rem;
      line-height: 1.7;
    }
    .answers-summary {
      max-width: 560px;
      margin: 0 auto 2rem;
      text-align: left;
    }
    .summary-scenario {
      background: var(--white);
      border-radius: var(--radius);
      padding: 1.25rem 1.5rem;
      margin-bottom: 1rem;
      border: 1px solid var(--grey-border);
      box-shadow: var(--shadow);
    }
    .summary-scenario h5 {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text-muted);
      margin-bottom: 0.75rem;
    }
    .summary-row {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      font-size: 0.88rem;
      margin-bottom: 0.4rem;
    }
    .summary-row:last-child { margin-bottom: 0; }
    .summary-badge {
      padding: 2px 8px;
      border-radius: 99px;
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      flex-shrink: 0;
    }
    .summary-badge.best  { background: var(--blue-light); color: white; }
    .summary-badge.worst { background: var(--accent-less); color: white; }
    .summary-text { color: var(--text); line-height: 1.4; }

    /* ── TIMER ── */
    .timer-bar-wrap {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.6rem 1rem;
      border-top: 1px solid var(--grey-border);
      background: var(--grey-light);
    }
    .timer-icon { font-size: 1.1rem; }
    .timer-digits {
      font-size: 1.4rem;
      font-weight: 700;
      color: var(--blue);
      min-width: 36px;
      font-variant-numeric: tabular-nums;
      transition: color 0.3s;
    }
    .timer-digits.warning { color: var(--accent); animation: timerPulse 0.6s infinite; }
    .timer-digits.danger  { color: var(--accent-less); animation: timerPulse 0.3s infinite; }
    @keyframes timerPulse {
      0%,100% { transform: scale(1); }
      50%      { transform: scale(1.08); }
    }
    .timer-track {
      flex: 1;
      height: 5px;
      background: var(--grey-border);
      border-radius: 99px;
      overflow: hidden;
    }
    .timer-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--blue-light), #4a90d9);
      border-radius: 99px;
      transition: width 1s linear, background 0.4s;
    }
    .timer-fill.warning { background: linear-gradient(90deg, var(--accent), #f7b731); }
    .timer-fill.danger  { background: linear-gradient(90deg, var(--accent-less), #ff7f7f); }
    .timer-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      white-space: nowrap;
    }

    /* ── STATUS BAR — Sessione protetta ── */
    #status-bar {
      position: fixed;
      bottom: 20px;
      right: 20px;
      background: var(--white);
      padding: 8px 14px;
      border-radius: 8px;
      box-shadow: 0 2px 12px rgba(26,58,92,0.12);
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
      z-index: 1000;
      border: 1px solid var(--grey-border);
    }
    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #10b981;
      animation: ledPulse 2s infinite;
      flex-shrink: 0;
    }
    @keyframes ledPulse {
      0%, 100% { opacity: 1; }
      50%       { opacity: 0.35; }
    }

    /* ── ANOMALY BADGE ── */
    #anomaly-badge {
      display: none;
      position: fixed;
      top: 70px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--accent-less);
      color: white;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      padding: 5px 14px;
      border-radius: 99px;
      z-index: 9000;
      box-shadow: 0 2px 10px rgba(224,92,92,0.35);
    }

    /* ── ETHICS NOTICE ── */
    .ethics-notice {
      font-size: 6.5px;
      color: rgba(100,120,140,0.7);
      line-height: 1.3;
      padding: 3px 6px;
      margin: 4px 0;
      text-align: left;
      user-select: none;
    }
    .ethics-notice-bar {
      font-size: 8px;
      color: rgba(100,120,140,0.65);
      line-height: 1.3;
      padding: 6px 1rem;
      border-top: 1px dashed var(--grey-border);
      user-select: none;
      background: var(--grey-light);
    }

    /* ── ANSWER TEXT TRUNCATION ── */
    .answer-text-preview { color: var(--text); }
    .answer-text-full { display: none; color: var(--text); }

    /* Selezionato (best o worst): testo sempre visibile */
    .answer-btn.selected-best  .answer-text-preview,
    .answer-btn.selected-worst .answer-text-preview { display: none; }
    .answer-btn.selected-best  .answer-text-full,
    .answer-btn.selected-worst .answer-text-full { display: inline; }


    /* ── INTRO SCREEN ── */
    .intro-wrap {
      max-width: 680px;
      margin: 0 auto;
      padding: 1.5rem 1.5rem 4rem;
    }
    .intro-title {
      font-size: 1.9rem;
      font-weight: 700;
      color: var(--blue);
      margin-bottom: 0.75rem;
      letter-spacing: -0.5px;
    }
    .intro-lead {
      font-size: 1rem;
      color: var(--text);
      font-weight: 300;
      line-height: 1.7;
      margin-bottom: 2rem;
    }
    .intro-card {
      background: var(--white);
      border-radius: var(--radius);
      border: 1px solid var(--grey-border);
      box-shadow: var(--shadow);
      padding: 1.5rem 1.75rem;
      margin-bottom: 1.75rem;
    }
    .intro-card-title {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--blue);
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 1rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .intro-list {
      list-style: none;
      padding: 0;
      margin: 0 0 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.55rem;
    }
    .intro-list li {
      font-size: 0.9rem;
      color: var(--text);
      line-height: 1.5;
      padding-left: 1.1rem;
      position: relative;
    }
    .intro-list li::before {
      content: "›";
      position: absolute;
      left: 0;
      color: var(--blue-light);
      font-weight: 700;
    }
    .best-label  { color: var(--blue-light); }
    .worst-label { color: var(--accent-less); }
    .intro-note {
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.6;
      font-style: italic;
      border-top: 1px solid var(--grey-border);
      padding-top: 0.85rem;
      margin: 0;
    }
    .intro-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
      margin-bottom: 1.5rem;
    }
    .intro-stat {
      background: var(--white);
      border: 1px solid var(--grey-border);
      border-radius: var(--radius-sm);
      padding: 0.75rem 1rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-size: 0.85rem;
      color: var(--text);
      font-weight: 400;
    }
    .intro-stat-icon { font-size: 1rem; color: var(--blue-light); width: 18px; text-align: center; flex-shrink: 0; }
    .intro-warning {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: #f0f5fb;
      border: 1px solid #c8d9ee;
      border-radius: var(--radius-sm);
      padding: 0.85rem 1rem;
      font-size: 0.85rem;
      color: var(--blue);
      margin-bottom: 2rem;
    }
    .intro-cta {
      width: 100%;
      padding: 1rem;
      font-size: 1rem;
      letter-spacing: 0.3px;
    }
    @media (max-width: 500px) {
      .intro-stats { grid-template-columns: 1fr; }
    }

    footer {
      text-align: center;
      padding: 2rem 1.5rem;
      font-size: 0.75rem;
      color: var(--text-muted);
      border-top: 1px solid var(--grey-border);
      margin-top: 2rem;
    }

/* ═══════════════════════════════════════════════════════════════
   TAP-TO-EXPAND LOGIC (v3.3)
   - 1° tap: espande il bottone (mostra testo completo)
   - 2° tap: seleziona come BEST o WORST
   - Tap su altro bottone: espande quello, collassa il precedente
   ═══════════════════════════════════════════════════════════════ */

/* Quando espanso (classe .expanded): mostra testo completo */
.answer-btn.expanded .answer-text-preview {
    display: none;
}

.answer-btn.expanded .answer-text-full {
    display: inline;
}

/* Indicatore visivo per bottone espanso (non ancora selezionato) */
.answer-btn.expanded:not(.selected-best):not(.selected-worst) {
    border-color: var(--blue-light);
    background: rgba(42, 95, 158, 0.06);
    box-shadow: 0 0 0 2px rgba(42, 95, 158, 0.12);
}

/* Hint "Tocca di nuovo per selezionare" per bottone espanso */
.answer-btn.expanded:not(.selected-best):not(.selected-worst)::after {
    content: '↑ Tocca di nuovo per selezionare';
    display: block;
    font-size: 0.72rem;
    color: var(--blue-light);
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.75;
}

/* Transizioni fluide */
.answer-btn .answer-text-full,
.answer-btn .answer-text-preview {
    transition: opacity 0.15s ease;
}
