/* ============================================================================
   Prova senza accedere — /chiediadappli
   Layout come «Parla con il coach» di Evoluto: a sinistra la colonna dei 4 percorsi,
   a destra la chat a tutta altezza con il campo di scrittura in basso. Telefono: la
   colonna diventa una fila di chip che scorre, sotto la testata.

   Tutto il resto viene dal design system di Evoluto, caricato PRIMA di questo foglio
   (css/ds/appli-ds.css, che non si tocca: si genera con build:css): ds-chat (testata,
   messaggi, barra, invio), ds-card, ds-stepper, ds-progress, ds-alert, ds-badge, ds-tag,
   ds-stat, ds-chart-columns, ds-chart-meter, ds-chip, ds-btn. Qui solo la disposizione
   della pagina e i pochi pezzi che il design system non ha: la colonna dei percorsi, le
   card di scelta, le opzioni del quiz. Colori, font, raggi: variabili --ds-*.
   Testata, briciole e footer pubblici restano quelli di home.css (scope .hp-page).
   ============================================================================ */

.hp-page--chat .prelogin-overlay__page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 24px;
}

/* La schermata occupa l'altezza della finestra sotto testata e briciole; scorrono solo i messaggi. */
.pl-app {
  --pl-chrome: 212px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  height: max(560px, calc(100dvh - var(--pl-chrome)));
  min-height: 0;
}

/* ---------- colonna dei percorsi ---------- */

.pl-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
  margin: -4px;
}
.pl-rail nav {
  flex: none;
  padding: 0.5rem;
  border-radius: 1rem;
  background: var(--ds-surface);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
}
.pl-rail__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pl-rail__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ds-text);
  font-family: var(--ds-font-family);
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.pl-rail__item .icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}
.pl-rail__item:hover { background: var(--ds-surface-muted); }
.pl-rail__item[aria-current="true"] {
  background: var(--ds-surface-accent);
  color: var(--ds-heading);
  box-shadow: inset 0.25rem 0 var(--ds-accent);
}
.pl-rail__item:focus-visible {
  outline: 2px solid var(--ds-focus-ring);
  outline-offset: -2px;
}
.pl-rail__inside { flex: none; }
.pl-rail__inside .ds-card__title { font-size: 1rem; }
.pl-rail__inside .ds-btn { align-self: flex-start; }

/* ---------- la chat (ds-chat) ---------- */

.pl-chat {
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.pl-chat .ds-chat__head {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ds-border);
}
.pl-chat__title {
  margin: 0;
  color: var(--ds-heading);
  font-family: var(--ds-font-family);
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
}
.pl-chat__title:focus { outline: none; }
.pl-chat__sub {
  margin: 2px 0 0;
  color: var(--ds-text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}
.pl-chat .ds-chat__messages { padding: 1.5rem; gap: 1rem; }
.pl-chat .ds-chat__bar { padding: 0.75rem 1.5rem 0.5rem; }
.pl-chat .ds-chat__msg--coach,
.pl-chat .ds-chat__msg--note { max-width: 50rem; }
.pl-chat .ds-chat__text { white-space: normal; }
.pl-chat .ds-chat__input:disabled::placeholder { font-style: italic; }
.pl-battuta { margin: 0 0 0.5rem; }
.pl-tip .ds-chat__label { margin: 0 0 0.25rem; }

.pl-cta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-self: flex-start; }
.pl-chosen { align-self: flex-start; }
.pl-chat .prelogin-notice { max-width: 50rem; align-self: stretch; }

/* ---------- le quattro card grandi (scelta iniziale e «quattro modi» di studi) ---------- */

.pl-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-self: stretch;
}
.pl-pick {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pl-pick:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.pl-pick:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.pl-pick:disabled { cursor: default; box-shadow: none; }
.pl-pick:disabled:not(.is-chosen) { opacity: 0.6; }
.pl-pick.is-chosen { border-color: var(--ds-accent); box-shadow: inset 0 0 0 1px var(--ds-accent); }
.pl-pick__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--ds-surface-accent);
  color: var(--ds-blue-600);
}
.pl-pick__icon .icon { width: 1.5rem; height: 1.5rem; }
.pl-pick__copy { display: flex; flex: 1 1 auto; flex-direction: column; gap: 0.125rem; min-width: 0; }
.pl-pick__arrow { flex: none; color: var(--ds-accent); font-size: 1.5rem; line-height: 1; font-weight: 700; }
.pl-pick__go { flex: none; color: var(--ds-link); font-size: 0.875rem; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; }
.pl-pick--inline { align-self: stretch; max-width: 50rem; }

/* ---------- card dei blocchi in chat ---------- */

.pl-vis {
  align-self: stretch;
  width: 100%;
  max-width: 50rem;
  gap: 0.75rem;
}
.pl-vis .ds-card__title { font-size: 1.125rem; }
.pl-vis .ds-card__meta.pl-sub { margin: -0.375rem 0 0; }
.pl-eyebrow {
  margin: 0;
  color: var(--ds-blue-600);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pl-lbl {
  margin: 0.25rem 0 -0.25rem;
  color: var(--ds-text-muted);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pl-src { margin: 0; color: var(--ds-text-muted); font-size: 0.8125rem; line-height: 1.25rem; }
.pl-note { padding: 0.75rem 1rem; font-size: 0.9375rem; line-height: 1.45; }
.pl-note__t { display: block; margin-bottom: 0.125rem; font-weight: 700; }
.pl-note__p { margin: 0; }
.pl-fb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.pl-fb__wide { grid-column: 1 / -1; }
.pl-tags .ds-tag { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; }

/* Grafico: colonne (ds-chart-columns) con valori sopra e etichette sotto. */
.pl-chart { gap: 0.25rem; }
.pl-chart__vals strong { color: var(--ds-heading); font-size: 1.125rem; line-height: 1.5; font-variant-numeric: tabular-nums; text-align: center; }
.pl-chart__bars {
  height: 9rem;
  grid-template-rows: minmax(0, 1fr);
  border-bottom: 1px solid var(--ds-border-strong, var(--ds-gray-400));
  padding: 0 0.5rem;
}
.pl-chart__bars .ds-chart-columns__bar { width: min(4rem, 80%); justify-self: center; border-radius: 0.375rem 0.375rem 0 0; }
.pl-chart__labs .ds-chart-columns__label { white-space: normal; font-weight: 600; color: var(--ds-text); }

/* Scheda professionale: numeri (ds-stat) con la barra della quota (ds-chart-meter). */
.pl-scheda__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pl-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.pl-kpi { padding: 0.75rem; gap: 0.125rem; }
.pl-kpi .ds-stat__label { font-size: 0.6875rem; line-height: 1rem; }
.pl-kpi .ds-stat__value { font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.pl-kpi .ds-chart-meter__track { height: 0.5rem; margin-top: 0.25rem; }

/* Feedback del colloquio: le tre sezioni, poi la vetrina «Dentro AppLI» in blu notte del DS. */
.pl-fbwrap { display: flex; flex-direction: column; gap: 0.875rem; align-self: stretch; max-width: 50rem; width: 100%; }
.pl-fbwrap .pl-vis { max-width: none; }
.pl-showcase {
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--ds-surface-strong, var(--ds-primary));
  color: var(--ds-text-inverse, #fff);
  box-shadow: 0 12px 30px rgba(5, 44, 101, 0.22);
}
.hp-page .pl-showcase__title { margin: 0 0 1rem; color: inherit; font-size: 1.5rem; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.pl-showcase__points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; margin: 0; padding: 0; list-style: none; }
.pl-showcase__pt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
}
.pl-showcase__pt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pl-showcase__ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--ds-blue-200);
}
.pl-showcase__ic .icon { width: 1.25rem; height: 1.25rem; }
.pl-showcase__copy { min-width: 0; }
.hp-page .pl-showcase__pt-t { display: block; margin: 0 0 0.125rem; color: inherit; font-size: 0.9375rem; line-height: 1.35; font-weight: 700; }
.hp-page .pl-showcase__pt-p { margin: 0; color: rgba(255, 255, 255, 0.82); font-size: 0.875rem; line-height: 1.45; }
.pl-showcase__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }
.pl-showcase__go { font-size: 1.0625rem; }
.pl-showcase__alt {
  --_fg: #fff;
  --_bd: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  border: 2px solid var(--_bd);
}
.pl-showcase__alt:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pl-showcase__alt:focus-visible, .pl-showcase__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .pl-showcase { animation: pl-rise 0.26s ease-out both; }
}
@keyframes pl-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .pl-showcase { padding: 1.125rem; }
  .hp-page .pl-showcase__title { font-size: 1.25rem; }
  .pl-showcase__points { grid-template-columns: minmax(0, 1fr); }
  .pl-showcase__cta { flex-direction: column; align-items: stretch; }
  .pl-showcase__cta .ds-btn { width: 100%; }
}

/* Il reset di home.css azzera i margini di p e h*: qui li rimettiamo con la stessa specificita'. */
.hp-page .pl-vtext__h { margin: 0 0 0.5rem; }
.hp-page .pl-vtext__p { margin: 0 0 1rem; }
.hp-page .pl-more__h { margin: 0 0 0.5rem; }
.hp-page .pl-qbig__n { margin: 0.5rem 0 0; }
.hp-page .pl-qbig__intro { margin: 0.75rem 0 0; }
.hp-page .pl-qbig__q { margin: 0.75rem 0 1.25rem; }
.hp-page .pl-tabs { margin-bottom: 0.75rem; }
.pl-profs .pl-prof--lock { grid-column: span 2; }
.pl-prof--lock .pl-prof__go { align-self: flex-start; }

/* ---------- telefono e tablet stretto ---------- */

@media (max-width: 900px) {
  .pl-app {
    --pl-chrome: 190px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    height: max(480px, calc(100dvh - var(--pl-chrome)));
  }
  .hp-page--chat .prelogin-overlay__page { gap: 12px; padding-top: 16px; padding-bottom: 16px; }

  /* La colonna diventa una fila di chip che scorre in orizzontale (la pagina no). */
  .pl-rail { overflow: visible; padding: 0; margin: 0; gap: 0; min-width: 0; }
  .pl-rail nav { padding: 0; border-radius: 0; background: transparent; box-shadow: none; min-width: 0; }
  .pl-rail__list { flex-direction: row; gap: 0.5rem; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; }
  .pl-rail__list::-webkit-scrollbar { display: none; }
  .pl-rail__item {
    width: auto;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--ds-primary);
    border-radius: 2rem;
    background: var(--ds-surface);
    font-size: 0.875rem;
    white-space: nowrap;
  }
  .pl-rail__item .icon { width: 1.125rem; height: 1.125rem; color: var(--ds-primary); }
  .pl-rail__item:hover { background: var(--ds-blue-100); }
  .pl-rail__item[aria-current="true"] { box-shadow: none; border-color: var(--ds-blue-700); background: var(--ds-blue-700); color: var(--ds-text-inverse, #fff); }
  .pl-rail__item[aria-current="true"] .icon { color: currentColor; }
  .pl-rail__inside { display: none; }

  .pl-chat .ds-chat__head { padding: 0.75rem 1rem; }
  .pl-chat__title { font-size: 1.25rem; }
  .pl-chat__sub { display: none; }
  .pl-chat .ds-chat__messages { padding: 1rem; gap: 0.75rem; }
  .pl-chat .ds-chat__bar { padding: 0.5rem 0.75rem 0.25rem; }
  .pl-picks, .pl-fb, .pl-kpis { grid-template-columns: minmax(0, 1fr); }
  .pl-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-kpi .ds-stat__label { font-size: 0.625rem; }
  .pl-kpi .ds-stat__value { font-size: 1.125rem; }
  .pl-vis { padding: 0.75rem; }
}

/* ============================================================================
   Pannello a forme diverse (la chat solo dove serve)
   ============================================================================ */

/* Schede di studi: ds-segmented, compatte, sopra il pannello. */
.pl-tabs {
  flex: none;
  align-self: stretch;
  margin: 0.75rem 1.5rem 0;
  max-width: calc(100% - 3rem);
}
.pl-tabs .ds-segmented__item { white-space: nowrap; font-size: 0.8125rem; padding: 0.4rem 0.7rem; }

/* Contenuto che non e' chat: stesso scroll e stessa spaziatura dei messaggi. */
.pl-stage { gap: 1.25rem; }
.pl-stage__wait { margin: 0; color: var(--ds-text-muted); }
.pl-stage__hint { margin: 0; color: var(--ds-text-muted); font-size: 0.875rem; line-height: 1.4; }
.pl-stage__err { align-self: flex-start; align-items: center; flex-wrap: wrap; }

/* 1. Il video: telefono verticale a sinistra, testo e capitoli a destra. */
.pl-vid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.pl-phone {
  width: min(280px, 78vw);
  aspect-ratio: 9 / 16;
  border: 6px solid #0b1b33;
  border-radius: 28px;
  background: #000;
  box-shadow: 0 18px 40px rgba(5, 44, 101, 0.25);
  overflow: hidden;
}
.pl-phone__video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A schermo intero il reel si vede tutto (cover lo tagliava ai lati o sopra e sotto). */
.pl-phone__video:fullscreen { object-fit: contain; background: #000; }
.pl-phone__video:-webkit-full-screen { object-fit: contain; background: #000; }
.pl-vtext__h { margin: 0 0 0.5rem; color: var(--ds-heading); font-size: 1.5rem; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.pl-vtext__p { margin: 0 0 1rem; max-width: 52ch; color: var(--ds-text-muted); }
.pl-chap { display: flex; flex-direction: column; gap: 0.375rem; margin: 0 0 1.125rem; padding: 0; list-style: none; }
.pl-chap__btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ds-border);
  border-radius: 0.625rem;
  background: var(--ds-surface);
  color: var(--ds-text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.pl-chap__btn:hover { border-color: var(--ds-accent); }
.pl-chap__btn:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.pl-chap__t { min-width: 2.4rem; color: var(--ds-blue-600); font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pl-more { margin-top: 1.25rem; padding-top: 0.875rem; border-top: 1px solid var(--ds-border); }
.pl-more__h { margin: 0 0 0.5rem; color: var(--ds-text-muted); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pl-reels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.pl-soon { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border: 1px dashed var(--ds-gray-400); border-radius: 0.75rem; background: var(--ds-surface-muted); }
.pl-soon__thumb {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 4rem;
  border-radius: 0.5rem;
  background: linear-gradient(160deg, var(--ds-blue-800), var(--ds-blue-500));
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
}
.pl-soon__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; min-width: 0; font-size: 0.8125rem; color: var(--ds-text-muted); }
.pl-soon__copy b { color: var(--ds-heading); font-size: 0.875rem; line-height: 1.3; }
.pl-soon__badge { margin-top: 0.125rem; }

/* 2. Colloquio: la griglia delle professioni (blocco `professioni`). */
.pl-profs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.625rem; align-self: stretch; }
.pl-prof {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 6.5rem;
  width: 100%;
  padding: 0.875rem;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: var(--ds-text);
  cursor: pointer;
}
.pl-prof:hover { box-shadow: 0 6px 16px rgba(5, 44, 101, 0.08); color: var(--ds-text); }
.pl-prof:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.pl-prof:disabled { cursor: default; box-shadow: none; }
.pl-prof:disabled:not(.is-chosen) { opacity: 0.6; }
.pl-prof.is-chosen { border-color: var(--ds-accent); box-shadow: inset 0 0 0 1px var(--ds-accent); }
.pl-prof__icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--ds-surface-accent); color: var(--ds-blue-600); }
.pl-prof__icon svg { width: 1.2rem; height: 1.2rem; }
.pl-prof__t { color: var(--ds-heading); font-size: 0.9rem; line-height: 1.3; }
.pl-prof__s { color: var(--ds-text-muted); font-size: 0.78rem; line-height: 1.35; }
.pl-prof--lock { border-style: dashed; background: var(--ds-surface-muted); }
.pl-prof--lock .pl-prof__icon { background: var(--ds-gray-200); color: var(--ds-text-muted); }
.pl-prof--lock:hover { border-color: var(--ds-accent); }
.pl-prof__go { margin-top: auto; pointer-events: none; }
.pl-accedi { align-self: stretch; max-width: 50rem; }
.pl-accedi__body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem; }
.pl-accedi__t { margin: 0; }

/* 3. Studi: ricerca con chip di esempio, questionario a domanda grande, dati. */
.pl-search { display: flex; gap: 0.5rem; max-width: 36rem; }
.pl-search__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: calc(0.5rem + 1px) 1rem;
  border: 1px solid var(--ds-gray-600);
  border-radius: 0.5rem;
  background: var(--ds-surface);
  color: var(--ds-text);
  font-family: var(--ds-font-family);
  font-size: 1rem;
}
.pl-search__input:focus { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 0.25rem var(--ds-focus-ring); }
.pl-chips { margin-top: -0.25rem; }
.pl-qbig { max-width: 42rem; width: 100%; margin: 0 auto; }
.pl-dots { display: flex; gap: 5px; }
.pl-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--ds-gray-300); }
.pl-dots i.is-on { background: var(--ds-accent); }
.pl-qbig__n { margin: 0.5rem 0 0; color: var(--ds-text-muted); font-size: 0.8125rem; }
.pl-qbig__intro { margin: 0.75rem 0 0; color: var(--ds-text-muted); }
.pl-qbig__q { margin: 0.625rem 0 1rem; color: var(--ds-heading); font-size: 1.375rem; line-height: 1.3; font-weight: 700; text-wrap: balance; }
.pl-qcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
.pl-qcard {
  display: flex;
  gap: 0.625rem;
  min-height: 4.75rem;
  padding: 0.875rem;
  border: 1px solid var(--ds-gray-400);
  border-radius: 0.875rem;
  background: var(--ds-surface);
  color: var(--ds-text);
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}
.pl-qcard:hover:not(:disabled) { border-color: var(--ds-accent); }
.pl-qcard:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.pl-qcard:disabled { cursor: default; }
.pl-qcard.is-chosen { border-color: var(--ds-accent); box-shadow: inset 0 0 0 1px var(--ds-accent); background: var(--ds-surface-accent); }
.pl-qcard__l { color: var(--ds-blue-600); }
.pl-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.pl-seg { align-self: auto; }
.pl-seg .ds-segmented__item[aria-pressed="true"] { background: var(--ds-surface); box-shadow: 0 0 3.5px rgba(0, 0, 0, 0.15); color: var(--ds-heading); }
.pl-dati { display: flex; flex-direction: column; gap: 0.875rem; }
.pl-dgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0.875rem; align-items: start; }
.pl-dbox { max-width: none; }
.pl-line__svg { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .pl-tabs { margin: 0.5rem 0.75rem 0; max-width: calc(100% - 1.5rem); }
  .pl-vid { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 1.25rem; }
  .pl-vtext { width: 100%; }
  .pl-reels, .pl-dgrid, .pl-qcards { grid-template-columns: minmax(0, 1fr); }
  .pl-profs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-qbig__q { font-size: 1.1875rem; }
  .pl-search { flex-direction: column; }
}

/* Telefono: la testata pubblica (barra del Ministero e barra AppLI) lascia lo schermo alla chat.
   Resta una riga compatta: «‹ Home» e «Accedi». Decisione PO 13/11. */
@media (max-width: 600px) {
  .hp-page--chat .hp-topbar,
  .hp-page--chat .hp-navbar { display: none; }
  .hp-page--chat .prelogin-overlay__page { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .hp-page--chat .hp-chat__top { align-items: center; }
  .hp-page--chat .hp-chat__top nav { padding-top: 0; }
  .hp-page--chat .hp-breadcrumb li:not(:first-child) { display: none; }
  .hp-page--chat .hp-breadcrumb li:first-child a::before { content: "‹ "; }
  .hp-page--chat #preloginLoginBtn { padding: 0.375rem 0.875rem; font-size: 0.9375rem; min-height: 0; }
  .pl-app { --pl-chrome: 108px; }
}

/* Le tre card di scelta stanno in colonna (icona sopra, testo sotto), sul telefono in riga. */
.pl-picks .pl-pick { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1.125rem; }
.pl-picks .pl-pick__arrow { display: none; }
.pl-picks .pl-pick__copy { flex: 0 0 auto; gap: 0.25rem; }
@media (max-width: 600px) {
  .pl-picks .pl-pick { flex-direction: row; align-items: center; padding: 1rem; }
  .pl-picks .pl-pick__arrow { display: block; }
  .pl-picks .pl-pick__copy { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-pick { transition: none; }
}

/* ---------- Telefono: un'app di chat a schermo intero (PO 14/11: «come la chat di Claude») ----------
   Niente riquadri, niente footer: in alto una riga sottile («‹ Home», Accedi) e le chip dei percorsi,
   poi i messaggi a tutta larghezza (il coach senza bolla, la persona in bolla grigia a destra),
   in basso il campo grande attaccato al bordo, sopra la barra di sistema. */
@media (max-width: 600px) {
  html:has(body.hp-page--chat), body.hp-page--chat { height: 100%; overflow: hidden; background: var(--ds-surface); }
  .hp-page--chat .hp-footer { display: none; }
  /* Fisso e grande quanto la parte visibile: --pl-vvh / --pl-vvt li scrive seguiTastiera() (iOS con la tastiera). */
  .hp-page--chat .prelogin-overlay--page {
    position: fixed; left: 0; right: 0; top: 0;
    height: var(--pl-vvh, 100dvh);
    transform: translateY(var(--pl-vvt, 0px));
  }
  .hp-page--chat .prelogin-overlay__page {
    display: flex; flex-direction: column; gap: 0;
    height: 100%; max-width: none; margin: 0; padding: 0;
  }
  .hp-page--chat .hp-chat__top {
    flex: none; align-items: center;
    padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }
  .pl-app { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0; height: auto; min-height: 0; }
  .pl-rail { flex: none; padding: 4px 0 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--ds-border); }
  .pl-rail__list { padding-right: 16px; }

  .pl-chat.ds-chat { flex: 1 1 auto; min-height: 0; border-radius: 0; box-shadow: none; background: var(--ds-surface); }
  .pl-chat .ds-chat__head { display: none; }
  .pl-tabs { margin: 10px 16px 0; }
  .pl-chat .ds-chat__messages { padding: 16px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); gap: 1rem; }

  /* Il coach parla a tutta larghezza, senza bolla; la persona in bolla grigia a destra. */
  .pl-chat .ds-chat__msg--coach:not(.ds-chat__msg--note) { background: transparent; padding: 0; border-radius: 0; max-width: 100%; }
  .pl-chat .ds-chat__msg--user { padding: 0.625rem 0.9375rem; border-radius: 1.25rem; max-width: 85%; }
  .pl-chat .ds-chat__msg { font-size: 1rem; line-height: 1.55; }

  /* Il campo: grande, tondo, attaccato in basso; 16px per non far zoomare iOS. */
  .pl-chat .ds-chat__bar {
    flex: none; gap: 8px; border-top: 0; background: var(--ds-surface);
    padding: 6px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  }
  .pl-chat .ds-chat__input { min-height: 48px; border-radius: 24px; font-size: 16px; padding-left: 18px; }
  .pl-chat .ds-chat__send { width: 44px; height: 44px; flex: none; }
  .pl-chat .ds-chat__disclaimer {
    flex: none; margin: 0; font-size: 10.5px; line-height: 1.35;
    padding: 0 16px max(8px, env(safe-area-inset-bottom));
  }
}

/* ---------- PO 14/11: partenza del colloquio a due strade, vetrina compatta con l'accesso in alto ---------- */
.pl-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem; }
.pl-start__opt { display: flex; flex-direction: column; gap: 0.625rem; padding: 1.25rem; max-width: none; }
.hp-page .pl-start__k { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ds-blue-600); }
.hp-page .pl-start__t { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 700; color: var(--ds-heading); text-wrap: balance; }
.hp-page .pl-start__p { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: inherit; opacity: 0.9; }
.pl-start__sel {
  width: 100%; min-height: 48px; padding: 0 2.5rem 0 1rem; border: 1px solid var(--ds-border-strong); border-radius: 0.625rem;
  background: var(--ds-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23052c65' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
  -webkit-appearance: none; appearance: none; font: inherit; font-size: 16px; color: var(--ds-text);
}
.pl-start__sel:focus-visible { outline: 3px solid var(--ds-focus-ring); outline-offset: 1px; }
.pl-start__go { margin-top: auto; align-self: flex-start; min-height: 44px; }
.pl-start__go:disabled { opacity: 0.45; cursor: not-allowed; }
.pl-start__opt--in { background: var(--ds-surface-strong, var(--ds-primary)); color: var(--ds-text-inverse, #fff); border-color: transparent; }
.hp-page .pl-start__opt--in .pl-start__k { color: var(--ds-blue-200); }
.hp-page .pl-start__opt--in .pl-start__t { color: #fff; }

.hp-page .pl-showcase__title { margin-bottom: 0.875rem; }
.pl-showcase__cta { margin: 0 0 1.125rem; }
.pl-showcase__points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.pl-showcase__pt { padding: 0.625rem 0; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.16); border-radius: 0; background: none; gap: 0.625rem; }
.pl-showcase__pt:last-child:nth-child(odd) { grid-column: auto; }
.pl-showcase__ic { width: 1.5rem; height: 1.5rem; background: none; color: #9ec5fe; }
.pl-showcase__ic .icon { width: 1.125rem; height: 1.125rem; }

@media (max-width: 600px) {
  .pl-start { grid-template-columns: minmax(0, 1fr); }
  .pl-start__opt { padding: 1rem; }
  .pl-start__go { align-self: stretch; width: 100%; }
  .pl-showcase__points { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- PO 14/11: lo scaffale dei reel (cinque video nello stesso telefono) ---------- */
.pl-vlist { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 1.125rem; padding: 0; list-style: none; }
.pl-vlist__btn {
  display: flex; align-items: center; gap: 0.875rem; width: 100%; padding: 0.5rem; text-align: left;
  border: 1px solid var(--ds-border); border-radius: 0.875rem; background: var(--ds-surface); color: var(--ds-text); cursor: pointer;
}
.pl-vlist__btn:hover { border-color: var(--ds-accent); }
.pl-vlist__btn:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }
.pl-vlist__btn[aria-current="true"] { border-color: var(--ds-primary); background: var(--ds-surface-accent); box-shadow: inset 3px 0 0 var(--ds-accent); }
.pl-vlist__thumb { position: relative; flex: none; width: 3.5rem; height: 6.2rem; border-radius: 0.5rem; overflow: hidden; background: var(--ds-surface-inverse); }
.pl-vlist__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pl-vlist__dur { position: absolute; right: 3px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: rgba(5, 44, 101, 0.85); color: #fff; font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-vlist__copy { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.hp-page .pl-vlist__t { color: var(--ds-heading); font-size: 1rem; line-height: 1.3; font-weight: 700; }
.pl-vlist__s { color: var(--ds-text-muted); font-size: 0.875rem; line-height: 1.4; }

/* ---------- Tre ingressi al coach: fine del reel, grafici dei dati, card video in chat ---------- */

/* Colonna del telefono: il telefono e, sotto, l'invito che compare a fine video. */
.pl-vcol { display: flex; flex-direction: column; gap: 0.875rem; width: min(280px, 78vw); }
.pl-vend {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--ds-accent);
  border-radius: 0.875rem;
  background: var(--ds-surface-accent);
}
.pl-vend[hidden] { display: none; }
.hp-page .pl-vend__q { margin: 0; color: var(--ds-heading); font-size: 1.0625rem; line-height: 1.35; font-weight: 700; text-wrap: balance; }
.pl-vend__btn { align-self: stretch; }
@media (prefers-reduced-motion: no-preference) {
  .pl-vend:not([hidden]) { animation: pl-rise 0.26s ease-out both; }
}

/* «Chiedi al coach su questi numeri», in fondo a ogni card grafico dei dati. */
.pl-coach-link { align-self: flex-start; font-size: 0.9375rem; }

/* Card video in chat: miniatura del poster con la durata, titolo, descrizione, «Guarda il video». */
.pl-vcard { flex-direction: row; align-items: flex-start; gap: 0.875rem; }
.pl-vcard__thumb { position: relative; flex: none; width: 4.5rem; aspect-ratio: 9 / 16; border-radius: 0.625rem; overflow: hidden; background: var(--ds-surface-inverse, #052c65); }
.pl-vcard__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pl-vcard__copy { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: 0.375rem; min-width: 0; }
.hp-page .pl-vcard__d { margin: 0 0 0.25rem; }
@media (max-width: 900px) {
  .pl-vcol { width: 100%; align-items: center; }
  .pl-vcol .pl-phone { width: min(280px, 78vw); }
  .pl-vend { width: min(280px, 78vw); }
}

/* Telefono: il segnaposto lungo («Hai dubbi sul feedback? Chiedi al coach») deve stare intero nel campo. */
@media (max-width: 600px) {
  .pl-chat .ds-chat__input::placeholder { font-size: 0.875rem; }
}

/* ---------- «Guarda i dati» per area di studio: selettore, viste con due barre, note di lettura ---------- */
.pl-area { display: flex; flex-direction: column; gap: 0.75rem; }
.hp-page .pl-area__label { margin: 0; color: var(--ds-heading); font-size: 0.8125rem; font-weight: 700; }
.pl-area__sel {
  width: 100%;
  max-width: 28rem;
  min-height: 3rem;
  padding: 0 0.875rem;
  border: 1px solid var(--ds-gray-600);
  border-radius: 0.625rem;
  background: var(--ds-surface);
  color: var(--ds-text);
  font-family: var(--ds-font-family);
  font-size: 1rem;
}
.pl-area__sel:focus { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 0.25rem var(--ds-focus-ring); }
.pl-area__invito[hidden] { display: none; }
.pl-viste { display: flex; flex-direction: column; gap: 0.875rem; }
.hp-page .pl-dati__h { margin: 0.5rem 0 0; color: var(--ds-heading); font-size: 1.125rem; font-weight: 700; }
.pl-vista { max-width: none; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--ds-text-muted); font-size: 0.8125rem; }
.pl-legend__i { display: inline-flex; align-items: center; gap: 0.375rem; }
.pl-legend__k { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; }
.pl-legend__k--area { background: var(--ds-accent); }
.pl-legend__k--tot { background: #adb5bd; }
.pl-rows { display: flex; flex-direction: column; gap: 1rem; }
.hp-page .pl-row2__h { margin: 0 0 0.375rem; color: var(--ds-heading); font-size: 0.875rem; font-weight: 700; }
.pl-bar2 { display: grid; grid-template-columns: minmax(0, 1fr) 4rem; grid-template-areas: "t v"; gap: 0 0.625rem; align-items: center; margin-bottom: 0.5rem; }
.pl-bar2__track { grid-area: t; height: 1.375rem; border-radius: 6px; background: var(--ds-gray-200); overflow: hidden; }
.pl-bar2__fill { height: 100%; border-radius: 6px; background: var(--ds-accent); }
.pl-bar2__fill--tot { background: #adb5bd; }
.pl-bar2__v { grid-area: v; color: var(--ds-heading); font-size: 0.9375rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pl-bar2__v--tot { color: var(--ds-text-muted); font-weight: 600; }
.pl-bar2__na { grid-column: 1 / -1; color: var(--ds-text-muted); font-size: 0.8125rem; font-style: italic; }
.pl-read { padding: 0.875rem 1rem; border-radius: 0.75rem; background: var(--ds-surface-accent); }
.hp-page .pl-read__h { margin: 0 0 0.375rem; color: var(--ds-heading); font-size: 0.9375rem; font-weight: 700; }
.hp-page .pl-read__l { margin: 0; padding-left: 1.125rem; list-style: disc; font-size: 0.875rem; line-height: 1.5; }
.pl-read__l li + li { margin-top: 0.375rem; }

/* Tabelle markdown nei messaggi del coach: ds-table in un contenitore che scorre di lato (la pagina no). */
.pl-md-table { margin: 0.5rem 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pl-md-table .ds-table { width: max-content; min-width: 100%; font-size: 0.875rem; }
.pl-md-table th, .pl-md-table td { overflow-wrap: normal; word-break: normal; }
.pl-md-table .pl-r { text-align: right; font-variant-numeric: tabular-nums; }
.pl-md-table .pl-c { text-align: center; }
.pl-chat .ds-chat__text { min-width: 0; }
.pl-chat .ds-chat__msg { min-width: 0; max-width: 100%; }

/* ---------- 16/11: ritocchi dal primo giro di prova ----------
   Percorsi sul telefono: griglia 2x2, tutti visibili (la fila che scorreva non si vedeva).
   Studi: cinque card all'ingresso, «Torna alla scelta» dentro un modo.
   «Nuova chat» nella riga in alto sul telefono. Testo dei video. */
.pl-top-actions { display: flex; align-items: center; gap: 8px; }
.pl-top-restart { display: none; }
@media (max-width: 900px) {
  .pl-rail__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 0.5rem; }
  .pl-rail__item { width: 100%; white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.25; border-radius: 0.75rem; min-height: 2.75rem; }
}
@media (max-width: 600px) {
  .pl-rail { padding: 6px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .pl-rail__list { padding-right: 0; }
  .pl-rail__item { font-size: 0.8125rem; padding: 0.375rem 0.625rem; }
  .pl-top-restart {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--ds-border); border-radius: 50%; background: var(--ds-surface); color: var(--ds-primary); cursor: pointer;
  }
  .pl-top-restart .icon { width: 1.125rem; height: 1.125rem; }
}
.pl-tabs:empty { display: none; }
.pl-tabs__back { display: inline-flex; align-items: center; gap: 0.25rem; }
.pl-tabs__back .icon { width: 1rem; height: 1rem; }
.hp-page .pl-smenu__intro { margin: 0 0 0.875rem; }
.pl-vtrans { margin-top: 0.75rem; width: 100%; max-width: 22rem; font-size: 0.9375rem; }
.pl-vtrans__sum { cursor: pointer; font-weight: 600; color: var(--ds-primary); }
.hp-page .pl-vtrans__nota { margin: 0.5rem 0 0; font-size: 0.875rem; opacity: 0.8; }
.pl-vtrans__list { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; line-height: 1.5; }

/* Questionario: dopo il tocco, spinner sulla risposta scelta e «Prossima domanda…» sotto le risposte. */
.pl-spin {
  display: inline-block; flex: none; width: 1rem; height: 1rem; margin-left: auto;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  color: var(--ds-accent); animation: pl-spin 0.7s linear infinite;
}
.hp-page .pl-qbig__wait { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0; font-size: 0.9375rem; color: var(--ds-text-muted, inherit); }
.pl-qbig__wait .pl-spin { margin-left: 0; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pl-spin { animation-duration: 2s; } }
