/* Demo presentazione — massimo spazio al 3D, UI compatta */
body.presentazione-light.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.presentazione-mode {
  overflow: hidden;
}

body.presentazione-mode .bottom-tab-nav {
  display: none !important;
}

body.presentazione-light .main-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.presentazione-mode .panel-viewport {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.presentazione-mode #panel3D.panel.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.2rem;
  padding: 0.15rem 0.35rem 0.1rem;
}

body.presentazione-mode .baseline-viewport {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.presentazione-mode .baseline3d__canvas {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none;
}

/* ——— Tema chiaro, toni soft su bianco ——— */
body.presentazione-light {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e8ecf1;
  --text: #4b5563;
  --muted: #9ca3af;
  --label: #b0b8c4;
  --font-label: 0.72rem;
  --font-body: 0.8125rem;
  --font-value-sm: 0.875rem;
  --font-metric: 0.75rem;
  --font-ui-kicker: 0.72rem;
  background: var(--bg);
  color: var(--text);
}

/* Header compatto */
body.presentazione-light .app-header {
  padding: 0.35rem 0.75rem 0.3rem;
  border-bottom: 1px solid var(--border);
}

body.presentazione-light .app-header__title,
body.presentazione-light .header-title-unit {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
}

body.presentazione-light .presentazione-status {
  margin: 0.1rem 0 0;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

body.presentazione-light .toolbar {
  padding: 0.2rem 0.35rem 0;
  flex-shrink: 0;
}

/* Toolbar: riga stats + corridoio sotto */
body.presentazione-light .presentazione-acq-stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
}

body.presentazione-light .acq-stat-row {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  width: 100%;
}

body.presentazione-light .acq-stat {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.26rem 0.38rem;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border) !important;
}

body.presentazione-light .acq-stat--bin,
body.presentazione-light .acq-stat--cluster,
body.presentazione-light .acq-stat--ehs {
  border-top: 1px solid var(--border) !important;
}

body.presentazione-light .acq-stat__label {
  font-size: var(--font-ui-kicker);
  font-weight: 600;
  color: var(--label);
}

body.presentazione-light .acq-stat__value {
  font-size: var(--font-value-sm);
  font-weight: 600;
  color: var(--text);
}

body.presentazione-light .acq-stat--cluster.acq-stat--prov .acq-stat__value,
body.presentazione-light .acq-stat--ehs.acq-stat--pending .acq-stat__value,
body.presentazione-light .acq-stat--ehs.acq-stat--ehs-ok .acq-stat__value,
body.presentazione-light .acq-stat--ehs.acq-stat--ehs-warn .acq-stat__value,
body.presentazione-light .acq-stat--ehs.acq-stat--ehs-crit .acq-stat__value {
  color: var(--text);
}

body.presentazione-light .acq-corridor,
body.presentazione-light .acq-corridor--empty {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.24rem 0.5rem;
  background: #fafafa !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  font-size: 0.6rem;
  color: var(--label) !important;
  text-align: left;
}

body.presentazione-light .acq-corridor__label {
  flex: 0 0 auto;
  font-size: var(--font-ui-kicker);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--label) !important;
}

body.presentazione-light .acq-corridor__label::after {
  content: none;
}

body.presentazione-light .acq-corridor__val {
  flex: 1 1 auto;
  text-align: right;
  font-size: var(--font-value-sm);
  font-weight: 600;
  color: var(--text) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HUD minimale — una riga */
body.presentazione-light .baseline3d__hud {
  flex-shrink: 0;
  gap: 0;
  margin-bottom: 0.1rem;
}

body.presentazione-light .baseline3d__progress-row {
  gap: 0.35rem;
}

body.presentazione-light .baseline3d__phase,
body.presentazione-light .baseline3d__phase--label,
body.presentazione-light .baseline3d__phase--learn,
body.presentazione-light .baseline3d__phase--prov,
body.presentazione-light .baseline3d__phase--op,
body.presentazione-light .baseline3d__phase--learning,
body.presentazione-light .baseline3d__phase--provisional,
body.presentazione-light .baseline3d__phase--operational-healthy,
body.presentazione-light .baseline3d__phase--operational-drift,
body.presentazione-light .baseline3d__phase--operational-hero {
  font-size: var(--font-ui-kicker);
  font-weight: 600;
  padding: 0.18rem 0.48rem;
}

body.presentazione-light .baseline3d__progress-track {
  height: 0.2rem;
  background: #f0f2f5;
  border: none;
}

body.presentazione-light .baseline3d__progress-fill {
  background: #c5cdd8;
  transition: width 0.35s ease, background 0.35s ease;
}

body.presentazione-light .baseline3d__progress-fill--learning {
  background: #94a3b8;
}

body.presentazione-light .baseline3d__progress-fill--provisional {
  background: #64748b;
}

body.presentazione-light .baseline3d__progress-fill--operational-healthy {
  background: #22c55e;
}

body.presentazione-light .baseline3d__progress-fill--operational-drift {
  background: #f97316;
}

body.presentazione-light .baseline3d__progress-fill--operational-hero {
  background: #9ca3af;
}

body.presentazione-light .baseline3d__progress-track--learning {
  background: #f1f5f9;
}

body.presentazione-light .baseline3d__progress-track--provisional {
  background: #f1f5f9;
}

body.presentazione-light .baseline3d__progress-track--operational-healthy {
  background: #ecfdf3;
}

body.presentazione-light .baseline3d__progress-track--operational-drift {
  background: #fff7ed;
}

body.presentazione-light .baseline3d__progress-track--operational-hero {
  background: #f3f4f6;
}

body.presentazione-light .baseline3d__phase--learning {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

body.presentazione-light .baseline3d__phase--provisional {
  color: #475569;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

body.presentazione-light .baseline3d__phase--operational-healthy {
  color: #15803d;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

body.presentazione-light .baseline3d__phase--operational-drift {
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

body.presentazione-light .baseline3d__phase--operational-hero {
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid var(--border);
}

body.presentazione-light .baseline3d__progress-hint {
  display: none;
}

/* Canvas 3D — bianco (override styles.css scuro) */
body.presentazione-light .baseline3d__canvas,
body.presentazione-light.panel-3d-active .baseline3d__canvas {
  background: #ffffff !important;
  border: 1px solid var(--border);
  border-radius: 6px;
}

body.presentazione-light .baseline3d__canvas canvas {
  background: #ffffff !important;
}

/* Legenda compatta sotto il 3D */
body.presentazione-light .baseline3d__legend--bar {
  flex-shrink: 0;
  margin: 0;
  padding: 0.22rem 0.4rem;
  font-size: 0.58rem;
  color: var(--muted);
  background: transparent;
  border: none;
  gap: 0.25rem 0.55rem;
}

/* P · I · cos φ — chip piccoli in basso al canvas, toni soft */
body.presentazione-mode .baseline3d__overlay {
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0.3rem 0.4rem;
}

body.presentazione-mode .baseline3d__axes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  width: auto;
  max-width: 100%;
  margin: 0;
}

body.presentazione-mode .baseline3d__ax,
body.presentazione-mode .baseline3d__ax--p,
body.presentazione-mode .baseline3d__ax--i,
body.presentazione-mode .baseline3d__ax--cos,
body.presentazione-light .baseline3d__ax,
body.presentazione-light .baseline3d__ax--p,
body.presentazione-light .baseline3d__ax--i,
body.presentazione-light .baseline3d__ax--cos {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: baseline;
  gap: 0.28rem;
  width: auto;
  min-width: 0;
  padding: 0.18rem 0.42rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

body.presentazione-mode .baseline3d__ax-label,
body.presentazione-light .baseline3d__ax-label {
  font-size: var(--font-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label);
}

body.presentazione-mode .baseline3d__ax-val,
body.presentazione-light .baseline3d__ax-val {
  font-size: var(--font-metric);
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0;
}

/* Overlay fine demo */
.presentazione-end .hero-screen__content {
  text-align: center;
}

.presentazione-restart {
  margin-top: 1rem;
}

body.presentazione-light .hero-screen.presentazione-end {
  background: rgba(255, 255, 255, 0.92);
  align-items: center;
  padding-top: 0;
}

body.presentazione-light .hero-screen.presentazione-end.is-visible {
  pointer-events: auto;
}

body.presentazione-light .hero-screen__eyebrow,
body.presentazione-light .hero-screen__title,
body.presentazione-light .hero-screen__subtitle {
  color: #6b7280;
}

body.presentazione-light .hero-screen__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #4b5563;
}

body.presentazione-light .hero-screen__title::after {
  background: #c5cdd8;
}

body.presentazione-light .btn-primary {
  background: #6b7280;
  color: #fff;
  font-size: var(--font-body);
}

/* Transport: play, stop, rewind, frame */
.presentazione-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  flex-shrink: 0;
}

.presentazione-transport__btn {
  min-width: 2.35rem;
  min-height: 2.1rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.95rem;
  line-height: 1;
  color: #4b5563;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.presentazione-transport__btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.presentazione-transport__btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.presentazione-transport__btn--primary {
  min-width: 2.65rem;
  font-weight: 600;
  color: #374151;
  background: #ffffff;
  border-color: #c5cdd8;
}

.presentazione-transport__frame {
  margin-left: 0.35rem;
  font-size: var(--font-ui-kicker);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  body.presentazione-light {
    --font-metric: 0.8125rem;
  }
}
