:root {
  color-scheme: light;
  --forest: #284832;
  --ink: #23332a;
  --muted: #485745;
  --terra: #854235;
  --canvas: #f1f3e9;
  --paper: #fffefa;
  --line: #c7d1c0;
  --sage: #e5eedc;
  font-family: Manrope, system-ui, sans-serif;
  line-height: 1.55;
  background: var(--canvas);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, p, dl { margin: 0; }
a { color: var(--forest); text-underline-offset: .2em; }
button, select { font: inherit; }
button, select, .navigation a, .back { min-height: 44px; }
button, select {
  padding: .6rem .95rem;
  border: 1px solid #8c9e86;
  border-radius: .7rem;
  background: var(--paper);
  color: var(--forest);
}
button:not(:disabled), select { cursor: pointer; }
button:hover:not(:disabled), select:hover { background: var(--sage); }
button:disabled { cursor: default; color: #505b4c; background: #e8ebe1; }
button.primary { color: #fff; background: var(--forest); border-color: var(--forest); }
button.primary:hover:not(:disabled) { background: #365e42; }
button.primary:disabled { color: #505b4c; background: #e8ebe1; border-color: #8c9e86; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; }
:where(main, legend, h2)[tabindex="-1"]:focus { outline: 2px solid var(--terra); outline-offset: 4px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 3; padding: .6rem; left: 1rem; top: .5rem; background: var(--paper); }
.shell { width: min(66rem, calc(100% - 2 * clamp(.85rem, 3vw, 2rem))); margin-inline: auto; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: .65rem 1rem; flex-wrap: wrap; padding-block: .65rem; }
.brand { display: inline-block; font: 550 clamp(1.45rem, 4vw, 2rem)/1.2 Fraunces, Georgia, serif; padding-block: .35rem; text-decoration: none; }
.brand span { font-style: italic; color: var(--terra); font-size: .8em; }
.top-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.navigation { position: relative; }
.navigation nav {
  position: absolute; z-index: 2; inset-inline-end: 0; top: calc(100% + .45rem);
  min-width: max-content; max-width: calc(100vw - 2rem); padding: .4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: .75rem;
  box-shadow: 0 7px 24px #243c2824;
}
.navigation a { display: flex; align-items: center; padding-inline: .75rem; max-width: 70vw; }
.main { padding-block: 1rem 3rem; }
.back { display: inline-flex; align-items: center; gap: .45rem; font-weight: 650; }
.back::before { content: '←'; }
h1 { font: 550 clamp(2rem, 5vw, 3.55rem)/1.1 Fraunces, Georgia, serif; color: var(--forest); margin: .55rem 0 1.2rem; overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem); align-items: start; gap: clamp(.85rem, 2.6vw, 1.5rem); }
.layout:has(.memory[hidden]) .practice { grid-column: 1 / -1; max-width: 46rem; width: 100%; }
.panel { min-width: 0; padding: clamp(1rem, 3.6vw, 2rem); border: 1px solid var(--line); background: var(--paper); border-radius: 1.25rem; }
.practice { box-shadow: 0 12px 35px #29462c12; }
.memory { background: #f9faef; font-size: .94rem; }
.memory .actions { flex-direction: column; align-items: stretch; }
.memory p + p { margin-top: .85rem; }
.memory-state { color: var(--forest); font-weight: 700; }
.memory .notice + .actions { margin-top: .75rem; }
.layout:has(.module-intro) { grid-template-columns: minmax(0, 1fr); }
.layout:has(.module-intro) .practice { max-width: none; }
.module-intro { display: grid; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.session-length { margin-top: .6rem; font-weight: 650; }
.temporary-note { margin-top: .75rem; color: var(--muted); font-size: .94rem; }
.intro-photo { display: block; width: 100%; height: auto; border-radius: .8rem; }
/* PAL-A1-CUM-INT-01 §11: foto verticale intera, proporzionata su fondo neutro; altezza limitata per non allontanare «Inizia». */
.intro-photo-portrait { height: min(30rem, 62vh); object-fit: contain; background: var(--sage); }
.memory-offer summary { min-height: 44px; padding-block: .6rem; color: var(--forest); font-weight: 650; cursor: pointer; }
.memory-offer p { margin-top: .65rem; }
.memory-offer .actions { flex-direction: row; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.1rem; align-items: center; }
.actions button { overflow-wrap: anywhere; }
.progress { color: var(--muted); font-weight: 650; display: block; }
progress { display: block; width: 100%; height: .6rem; margin: .4rem 0 1.35rem; accent-color: var(--forest); }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { float: unset; max-width: 100%; padding: 0; font: 650 clamp(1.1rem, 2.5vw, 1.35rem)/1.35 Manrope, system-ui, sans-serif; }
.stimulus { margin-top: .8rem; font: 500 clamp(1.25rem, 3vw, 1.65rem)/1.35 Fraunces, Georgia, serif; }
.options { display: grid; gap: .65rem; margin-top: .9rem; }
.option {
  display: flex; align-items: center; gap: .7rem; min-height: 3rem; min-width: 0;
  padding: .55rem .8rem; border: 1px solid #8c9e86; border-radius: .75rem;
}
.option:has(:checked) { background: var(--sage); border-color: var(--forest); }
.option:has(:focus-visible) { outline: 3px solid var(--terra); outline-offset: 2px; }
.option:has(:enabled) { cursor: pointer; }
.option input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--forest); }
.option span { min-width: 0; overflow-wrap: anywhere; }
.option-letter { font-weight: 700; color: var(--forest); }
.result { padding: .9rem 1rem; margin-top: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--sage); overflow-wrap: anywhere; }
.result.error, .notice { background: #f7ede7; color: #602d23; border-color: #d2a398; }
.notice { border-radius: .65rem; padding: .65rem .75rem; }
.result p + p { margin-top: .5rem; }
.result .feedback { white-space: pre-line; }
h2 { color: var(--forest); font: 550 1.6rem/1.2 Fraunces, Georgia, serif; }
.summary-list { margin-top: 1rem; }
.summary-list div { display: flex; justify-content: space-between; gap: .6rem; border-top: 1px solid var(--line); padding: .65rem 0; }
.summary-list dd { margin: 0; font-weight: 750; }
dialog { max-width: min(29rem, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: 1rem; padding: 1.3rem; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #192c20a6; }
@media (max-width: 700px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 701px) { .module-intro { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
/* A1-05 — testi su più righe (dialoghi, messaggi), forma completata, risposta libera. */
.stimulus { white-space: pre-line; }
.stimulus .filled { font-weight: 700; color: var(--forest); text-decoration: underline; text-underline-offset: .2em; }
/* A-04 (FIX-01) — consultazione A1-05: campo in sola lettura e barra disabilitata, stili circoscritti a questa pagina. */
#l5-review .l5-text-entry { display: grid; gap: .45rem; margin: 0 0 1rem; }
#l5-review .l5-text-entry input[readonly] {
  font: inherit; font-size: 1.1rem; min-height: 44px; width: min(100%, 18rem);
  padding: .5rem .75rem; border: 2px dashed #8c9e86; border-radius: .5rem; background: var(--sage); color: var(--ink);
}
#l5-review .l5-text-entry input[readonly]:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
#l5-review .l5-accent-bar { display: flex; flex-wrap: wrap; gap: .4rem; }
#l5-review .l5-accent-bar button:disabled {
  min-width: 44px; min-height: 44px; padding: 0 .5rem; font: inherit; font-size: 1.1rem; line-height: 1;
  border: 1px solid #8c9e86; border-radius: .5rem; background: #e8ebe1; color: #505b4c; cursor: default;
}
