/* Garage IA · layout editoriale 1:1 dark/light, legenda hero, 4 livelli, switch termini aziendali,
   confronto configurazioni, verifica pratica, card consenso e stampa a 5 sezioni. */

.gi {
  padding-top: clamp(82px, 7.5vw, 102px);
  padding-bottom: clamp(48px, 6vw, 84px);
}

.gi *:focus-visible {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 2px;
}

.gi-chiaro { display: none; }
.gi-scuro { display: block; }
html[data-theme="light"] .gi-chiaro { display: block; }
html[data-theme="light"] .gi-scuro { display: none; }

/* ── Intro & Hero Legend ── */
.gi-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding: clamp(20px, 3vw, 36px) 0 clamp(18px, 2.5vw, 28px);
}

.gi-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .85rem;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.gi-path a {
  color: var(--fg-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gi-kicker {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.gi-intro h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -.02em;
}
.gi-intro h1 em {
  font-style: normal;
  color: var(--accent-cyan);
}

.gi-lead {
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 12px;
}

.gi-note {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--fg-muted);
  padding: 10px 14px;
  border-left: 3px solid var(--accent-violet);
  background: var(--bg-subtle);
  border-radius: 0 10px 10px 0;
  margin: 0;
}

.gi-hero-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gi-photo--hero {
  position: relative;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-card);
}
.gi-photo--hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.gi-photo--hero figcaption {
  padding: 10px 14px;
  font-size: .86rem;
  line-height: 1.45;
  color: var(--fg-secondary);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}

.gi-callouts {
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 16 / 9;
  pointer-events: none;
}

.gi-pin {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(50% - 14px);
  padding: 4px 10px 4px 5px;
  border-radius: 16px;
  background: rgba(8, 12, 22, 0.88);
  color: #F8FAFC;
  border: 1px solid rgba(34, 211, 238, 0.55);
  font-size: .74rem;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}
html[data-theme="light"] .gi-pin {
  background: rgba(255, 255, 255, 0.94);
  color: #0F172A;
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}
.gi-pin b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #06121A;
  font-size: .72rem;
  font-weight: 800;
}
html[data-theme="light"] .gi-pin b {
  color: #FFFFFF;
}
.gi-pin > span {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  font-weight: 600;
  white-space: normal;
}
.gi-pin .twg-mp--inline {
  margin: 0;
  padding: 0.2em 0.44em;
  flex-shrink: 0;
  vertical-align: middle;
}
.gi-pin .twg-mp--inline .twg-pmark {
  font-size: 0.9em;
}
.gi-pin--tl { top: 10px; left: 10px; }
.gi-pin--bl { bottom: 10px; left: 10px; }
.gi-pin--tr { top: 10px; right: 10px; }
.gi-pin--br { bottom: 10px; right: 10px; }

.gi-hero-legend {
  list-style: none;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gi-hero-legend li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.gi-hero-legend li > div {
  min-width: 0;
  flex: 1 1 auto;
}
.gi-hl-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
.gi-hero-legend strong {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 4px;
  font-size: .84rem;
  line-height: 1.25;
}
.gi-hero-legend strong .twg-mp--inline {
  margin: 0;
  padding: 0.22em 0.46em;
  flex-shrink: 0;
  vertical-align: middle;
}
.gi-hero-legend strong .twg-mp--inline .twg-pmark {
  font-size: 0.92em;
}
.gi-hero-legend small {
  display: block;
  font-size: .76rem;
  line-height: 1.35;
  color: var(--fg-muted);
}

/* ── Topbar (Levels + Terminology Switch) ── */
.gi-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  margin-bottom: 14px;
}
.gi-topbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.gi-topbar-lbl {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.gi-lv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gi-lv-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  border-bottom: 3px solid transparent;
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.gi-lv-btn:hover {
  background: var(--bg-card-hover);
  color: var(--fg-primary);
}
.gi-lv-btn[aria-selected="true"] {
  background: var(--accent-cyan-soft);
  color: var(--fg-primary);
  border-color: var(--accent-cyan);
  border-bottom: 3px solid var(--accent-cyan);
}

.gi-term-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  gap: 4px;
}
.gi-term-btn {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.gi-term-btn[aria-pressed="true"] {
  background: var(--bg-card-solid);
  color: var(--fg-primary);
  border-color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}
.gi-term-btn[aria-pressed="true"]::before {
  content: "✓ ";
  color: var(--accent-cyan);
  font-weight: 800;
}

/* ── Level Panel ── */
.gi-level-panel {
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.gi-lv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.gi-lv-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-violet-soft);
  color: var(--accent-violet-bright);
  font-size: .78rem;
  font-weight: 700;
}
html[data-theme="light"] .gi-lv-tag {
  color: var(--accent-violet);
}
.gi-lv-sum {
  margin: 0;
  font-size: .95rem;
  color: var(--fg-secondary);
}
.gi-lv-list {
  margin: 8px 0 12px;
  padding-left: 20px;
  color: var(--fg-secondary);
  font-size: .92rem;
  line-height: 1.55;
}
.gi-lv-list li { margin: 4px 0; }
.gi-lv-actions, .gi-impara-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.gi-decide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.gi-decide-col {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
.gi-decide-col h4 {
  margin: 0 0 8px;
  font-size: .92rem;
  color: var(--accent-cyan);
}
.gi-decide-col ul, .gi-decide-col ol {
  margin: 0;
  padding-left: 18px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--fg-secondary);
}
.gi-decide-col li { margin: 5px 0; }

/* Tour Banner */
.gi-tour-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent-cyan);
  background: var(--accent-cyan-soft);
}
.gi-tour-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.gi-tour-badge {
  font-size: .78rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gi-tour-banner h4 { margin: 0 0 4px; font-size: 1rem; }
.gi-tour-banner p { margin: 0 0 12px; font-size: .92rem; color: var(--fg-secondary); }
.gi-tour-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* Compare & Quiz (impara) */
.gi-compare, .gi-quiz {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.gi-compare h4, .gi-quiz h4 {
  margin: 0 0 6px;
  font-size: .98rem;
}
.gi-compare-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-top: 8px;
}
.gi-compare-tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: .86rem;
}
.gi-compare-tbl th, .gi-compare-tbl td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.gi-compare-tbl thead th {
  background: var(--bg-subtle);
  font-weight: 700;
}
.gi-compare-tbl tbody th {
  color: var(--fg-secondary);
  font-weight: 600;
}

.gi-quiz-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.gi-quiz-score {
  font-size: .82rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}
.gi-quiz-q {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
.gi-quiz-q legend {
  font-weight: 700;
  font-size: .92rem;
  padding: 0 4px;
}
.gi-quiz-opts {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.gi-quiz-opt {
  text-align: left;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.gi-quiz-opt.is-ok {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
  color: var(--fg-primary);
  font-weight: 600;
}
.gi-quiz-opt.is-ko {
  border-color: var(--accent-danger);
  background: var(--accent-danger-soft);
  color: var(--fg-primary);
}
.gi-quiz-fb {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .85rem;
  line-height: 1.45;
}
.gi-quiz-fb.is-ok { background: var(--accent-emerald-soft); color: var(--fg-primary); }
.gi-quiz-fb.is-ko { background: var(--accent-danger-soft); color: var(--fg-primary); }

/* ── Cruscotto Steps + Grid ── */
.gi-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.gi-step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--fg-secondary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.gi-step.is-on {
  border-color: var(--accent-cyan);
  border-bottom: 3px solid var(--accent-cyan);
  background: var(--accent-cyan-soft);
  color: var(--fg-primary);
}
.gi-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.gi-step.is-on .gi-step-n {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #06121A;
}
html[data-theme="light"] .gi-step.is-on .gi-step-n {
  color: #FFFFFF;
}
.gi-step-txt b {
  display: block;
  font-size: .84rem;
  line-height: 1.2;
}
.gi-step-txt small {
  display: block;
  font-size: .73rem;
  color: var(--fg-muted);
  line-height: 1.25;
}

.gi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, .92fr);
  gap: 20px;
  align-items: start;
}

.gi-station {
  border-radius: 16px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  padding: clamp(16px, 2.2vw, 24px);
}
.gi-st-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, .8fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.gi-st-kicker {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}
.gi-st-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
}
.gi-st-sub {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--fg-secondary);
}

.gi-why-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--accent-cyan);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}
.gi-why-btn.is-em {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
}
.gi-why-inline {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-cyan-soft);
  color: var(--fg-primary);
  font-size: .8rem;
  text-decoration: none;
}

.gi-box-fig {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.gi-box-fig img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Questions & Chips */
.gi-q {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.gi-q legend {
  font-size: .98rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.gi-q-help, .gi-help-sm {
  margin: 0 0 8px;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--fg-muted);
}
.gi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gi-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: .86rem;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.gi-chip.is-on {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  color: var(--fg-primary);
  font-weight: 600;
}
.gi-chip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1px solid var(--border-medium);
  font-size: .72rem;
  font-weight: 800;
}
.gi-chip.is-on .gi-chip-mark {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #06121A;
}
html[data-theme="light"] .gi-chip.is-on .gi-chip-mark {
  color: #FFFFFF;
}

/* Cases & Custom Boxes */
.gi-cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.gi-case-btn {
  width: 100%;
  height: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.gi-case.is-on .gi-case-btn {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  color: var(--fg-primary);
}
.gi-case-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.gi-case-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
}
.gi-case.is-on .gi-case-check {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #06121A;
}
html[data-theme="light"] .gi-case.is-on .gi-case-check { color: #FFFFFF; }
.gi-case-badge, .gi-case-rec, .gi-pill-ok, .gi-pill-warn, .gi-pill-ai {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.gi-case-badge { background: var(--accent-violet-soft); color: var(--accent-violet-bright); }
html[data-theme="light"] .gi-case-badge { color: var(--accent-violet); }
.gi-case-rec, .gi-pill-ok { background: var(--accent-emerald-soft); color: var(--accent-emerald); }
.gi-pill-warn { background: var(--accent-amber-soft); color: var(--accent-amber); }
.gi-pill-ai { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.gi-case-btn strong { font-size: .92rem; color: var(--fg-primary); }
.gi-case-txt { font-size: .82rem; line-height: 1.4; }

.gi-custom-box, .gi-prereq, .gi-alerts {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  margin-top: 14px;
}
.gi-custom-box h4, .gi-prereq h4, .gi-alerts h4 {
  margin: 0 0 6px;
  font-size: .94rem;
}
.gi-field-lbl {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.gi-ta {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--fg-primary);
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
}
.gi-warn-txt {
  margin: 6px 0 8px;
  font-size: .8rem;
  color: var(--accent-amber);
}
.gi-custom-acts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.gi-my-list { margin-top: 12px; display: grid; gap: 10px; }
.gi-my-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
}
.gi-my-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.gi-ai-draft {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--accent-cyan-soft);
  font-size: .85rem;
}

/* Arch, Taglia, Fasi */
.gi-flow-card {
  margin: 12px 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px dashed var(--accent-cyan);
  background: var(--accent-cyan-soft);
  font-size: .86rem;
}
.gi-pezzi-grid, .gi-hw-grid, .gi-fasi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.gi-pezzo, .gi-hw-card, .gi-fase {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
.gi-hw-card.is-on, .gi-pezzo.is-on {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
}
.gi-pezzo-top, .gi-hw-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: .88rem;
}
.gi-pezzo p, .gi-hw-card p { margin: 0 0 8px; font-size: .82rem; color: var(--fg-secondary); }
.gi-hw-dl { margin: 0; font-size: .8rem; }
.gi-hw-dl dt { font-weight: 700; margin-top: 6px; }
.gi-hw-dl dd { margin: 2px 0 0; color: var(--fg-secondary); }
.gi-hw-dl a { color: var(--accent-cyan); }

.gi-taglia-rec {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--accent-violet-soft);
  margin-bottom: 10px;
}
.gi-taglia-rec p { margin: 4px 0 0; font-size: .85rem; color: var(--fg-secondary); }
.gi-taglia-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.gi-alerts { border-color: var(--accent-amber); background: var(--accent-amber-soft); }
.gi-alerts.is-ok { border-color: var(--accent-emerald); background: var(--accent-emerald-soft); }
.gi-alerts ul, .gi-prereq ul, .gi-fase ul { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; line-height: 1.45; }
.gi-fase-when { font-size: .74rem; font-weight: 700; color: var(--accent-cyan); text-transform: uppercase; }
.gi-fase h4 { margin: 3px 0 6px; font-size: .92rem; }
.gi-fase-gate { margin: 8px 0 0; font-size: .8rem; font-weight: 700; color: var(--accent-emerald); }
.gi-fase-link { display: inline-block; margin-top: 8px; font-size: .82rem; font-weight: 700; color: var(--accent-cyan); }

/* ── Right Sheet ── */
.gi-sheet {
  position: sticky;
  top: 96px;
}
.gi-sheet-card {
  border-radius: 16px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.gi-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 14px;
}
.gi-sheet-kicker {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-cyan);
}
.gi-sheet-head h3 { margin: 2px 0 0; font-size: 1.08rem; }
.gi-sheet-tag {
  font-size: .76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.gi-inds { display: grid; gap: 10px; }
.gi-ind-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.gi-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}
.gi-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
}
.gi-bar i.w-1 { width: 20%; }
.gi-bar i.w-2 { width: 40%; }
.gi-bar i.w-3 { width: 60%; }
.gi-bar i.w-4 { width: 80%; }
.gi-bar i.w-5 { width: 100%; }
.gi-ind-note { margin: 10px 0 12px; font-size: .78rem; color: var(--fg-muted); }

.gi-sheet-lists details {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 9px 11px;
  margin-bottom: 12px;
}
.gi-sheet-lists summary {
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
}
.gi-sheet-sub { margin-top: 8px; font-size: .8rem; color: var(--fg-secondary); }
.gi-sheet-sub ul { margin: 4px 0 8px; padding-left: 16px; }

.gi-sheet-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.gi-copy-fb { font-size: .78rem; color: var(--accent-emerald); }

.gi-consent-box {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  margin-bottom: 12px;
}
.gi-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.gi-consent-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}
.gi-consent-row label {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.gi-consent-note {
  margin: 6px 0 0 28px;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--fg-muted);
}

.gi-uscite { display: grid; gap: 8px; }
.gi-go {
  display: block;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--fg-primary);
  text-decoration: none;
}
.gi-go.is-pri {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-color: var(--cta-bg);
}
.gi-go > strong,
.gi-go-row strong { display: block; font-size: .88rem; }
.gi-go > span:not(.gi-go-row) { display: block; font-size: .77rem; opacity: .88; margin-top: 2px; }

.gi-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.gi-dock-mid { font-size: .84rem; color: var(--fg-muted); font-weight: 600; }

/* Buttons */
.gi-btn, .gi-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  color: var(--fg-primary);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.gi-btn--pri {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-color: var(--cta-bg);
}
.gi-btn--sm { min-height: 36px; padding: 6px 12px; font-size: .82rem; }
.gi-btn-ghost { background: transparent; border-color: transparent; color: var(--fg-secondary); }
.gi-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 3D Section Wrapper */
.gi-pista {
  margin-top: clamp(32px, 4.5vw, 56px);
  padding-top: clamp(22px, 3vw, 32px);
  border-top: 1px solid var(--border-subtle);
}
.gi-pista h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}
.gi-pista h2 em { font-style: normal; color: var(--accent-cyan); }
.gi-pista-3d { margin-top: 16px; }

.gi-nojs {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
}

.gi-print { display: none; }

@media (max-width: 980px) {
  .gi-intro,
  .gi-grid,
  .gi-st-head,
  .gi-decide-grid,
  .gi-cases,
  .gi-pezzi-grid,
  .gi-hw-grid,
  .gi-fasi {
    grid-template-columns: 1fr;
  }
  .gi-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gi-hero-legend {
    grid-template-columns: 1fr;
  }
  .gi-sheet {
    position: static;
  }
  .gi-pin {
    max-width: calc(50% - 12px);
    font-size: .68rem;
    padding: 3px 8px 3px 4px;
  }
}

@media (max-width: 560px) {
  .gi-pin {
    padding: 2px;
    gap: 0;
  }
  .gi-pin span {
    display: none;
  }
}

/* ── REGOLA VISIVA: Frosted Glass (fallback opaco -> @supports blur), icone vere, SVG animato, Leggi di più, hover & scroll reveal ── */
.gi-hero-legend,
.gi-topbar,
.gi-level-panel,
.gi-station,
.gi-sheet-card,
.gi-dock {
  background: var(--bg-card-solid);
  border-color: rgba(168, 85, 247, 0.24);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

html[data-theme="light"] .gi-hero-legend,
html[data-theme="light"] .gi-topbar,
html[data-theme="light"] .gi-level-panel,
html[data-theme="light"] .gi-station,
html[data-theme="light"] .gi-sheet-card,
html[data-theme="light"] .gi-dock {
  background: #FFFFFF;
  border-color: rgba(14, 116, 144, 0.22);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gi-hero-legend,
  .gi-topbar,
  .gi-level-panel,
  .gi-station,
  .gi-sheet-card,
  .gi-dock {
    background: rgba(17, 12, 28, 0.68);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
  html[data-theme="light"] .gi-hero-legend,
  html[data-theme="light"] .gi-topbar,
  html[data-theme="light"] .gi-level-panel,
  html[data-theme="light"] .gi-station,
  html[data-theme="light"] .gi-sheet-card,
  html[data-theme="light"] .gi-dock {
    background: rgba(255, 255, 255, 0.78);
  }
}

/* Brand stroke icons (zero pallini) */
.gi-ico {
  flex-shrink: 0;
  color: var(--accent-cyan);
  vertical-align: middle;
}
.gi-btn--pri .gi-ico,
.gi-go.is-pri .gi-ico {
  color: currentColor;
}
.gi-ico-list {
  list-style: none;
  margin: 8px 0 10px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.gi-ico-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--fg-secondary);
}
.gi-ico-list li .gi-ico { margin-top: 3px; }
.gi-num-list {
  margin: 8px 0 6px;
  padding-left: 18px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--fg-secondary);
}
.gi-num-list li { margin: 5px 0; }

.gi-decide-col h4,
.gi-prereq h4,
.gi-alerts h4,
.gi-fase-top,
.gi-go-row,
.gi-ok-line,
.gi-flow-cap,
.gi-step-txt b,
.gi-fase-gate,
.gi-pezzo-top b {
  display: flex;
  align-items: center;
  gap: 7px;
}
.gi-fase-top { margin-bottom: 4px; }
.gi-ok-line { margin: 0; font-size: .88rem; }
.gi-btn { gap: 7px; }
.gi-flow-cap {
  font-size: .84rem;
  font-weight: 700;
  color: var(--fg-primary);
  margin-bottom: 8px;
}

/* Details «Leggi di più» */
.gi-more {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 7px 11px;
}
.gi-more summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  list-style: none;
}
.gi-more summary::-webkit-details-marker { display: none; }
.gi-more summary::before { content: "+ "; font-weight: 800; }
.gi-more[open] summary::before { content: "− "; }

/* SVG animated trace schematic */
.gi-arch-svg {
  width: 100%;
  height: auto;
  display: block;
}
.gi-flow-path {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 2.2;
  stroke-dasharray: 8 6;
  animation: giFlowDash 2.2s linear infinite;
}
.gi-flow-path.is-ro { stroke: var(--accent-violet-bright); }
.gi-flow-path.is-proxy { stroke: var(--accent-emerald); }
.gi-flow-idle {
  fill: none;
  stroke: var(--border-medium);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}
.gi-svg-arr { fill: var(--accent-cyan); }
.gi-svg-node rect {
  fill: var(--bg-card-solid);
  stroke: var(--border-medium);
  stroke-width: 1.4;
}
.gi-svg-node.is-core rect { stroke: var(--accent-cyan); stroke-width: 2; }
.gi-svg-node.is-gpu rect { stroke: var(--accent-violet); stroke-width: 1.8; }
.gi-svg-node.is-proxy rect { stroke: var(--accent-emerald); stroke-width: 1.8; }
.gi-svg-node.is-dim rect { opacity: .65; stroke-dasharray: 4 4; }
.gi-svg-t { fill: var(--fg-primary); font: 700 12.5px var(--font-sans, system-ui, sans-serif); }
.gi-svg-s { fill: var(--fg-muted); font: 500 10.5px var(--font-sans, system-ui, sans-serif); }

@keyframes giFlowDash {
  to { stroke-dashoffset: -28; }
}

/* Micro-interazioni & Scroll reveal progressivo */
.gi-step,
.gi-chip,
.gi-case-btn,
.gi-go,
.gi-btn,
.gi-hero-legend li,
.gi-fase {
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), border-color .18s ease, background-color .18s ease, box-shadow .22s ease;
}
.gi-step:hover,
.gi-chip:hover,
.gi-case-btn:hover,
.gi-go:hover,
.gi-btn:hover:not(:disabled),
.gi-fase:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}
.gi-bar i { transition: width .38s cubic-bezier(.22, 1, .36, 1); }

html.gi-anim .gi-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1);
}
html.gi-anim .gi-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .gi *,
  .gi-flow-path,
  html.gi-anim .gi-reveal {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  header, footer, .gi-intro, .gi-topbar, .gi-level-panel, .gi-app, .gi-pista, .twg-crumbbar {
    display: none !important;
  }
  .gi-print {
    display: block !important;
    color: #111827 !important;
    background: #ffffff !important;
    padding: 0;
  }
  .gi-pr-head h1, .gi-pr-head h2 { font-size: 18pt; margin: 0 0 4pt; }
  .gi-pr-head p { font-size: 10pt; color: #374151; margin: 0 0 12pt; }
  .gi-pr-blk { margin-bottom: 10pt; padding: 8pt; border: 1px solid #cbd5e1; break-inside: avoid; }
  .gi-pr-blk h2 { font-size: 12pt; margin: 0 0 4pt; }
  .gi-pr-blk ul { margin: 0; padding-left: 14pt; font-size: 9.5pt; }
  .gi-pr-foot { font-size: 8.5pt; color: #4b5563; margin-top: 10pt; }
}

/* ── P1-1EBIS-3 · Guscio Carte Vive attorno a .gi-level-panel (riempito via JS) ── */
.gi-level-shell {
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.24);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  margin-bottom: 22px;
}
html[data-theme="light"] .gi-level-shell {
  background: #FFFFFF;
  border-color: rgba(14, 116, 144, 0.22);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.gi-level-shell > .gi-level-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}
