:root {
  --bg: #0a0a0b;
  --bg2: #111113;
  --fg: #f4f4f2;
  --muted: rgba(244, 244, 242, .78);
  --dim: rgba(244, 244, 242, .58);
  --line: rgba(255, 255, 255, .12);
  --red: #e63c2e;
  --red-soft: rgba(230, 60, 46, .14);
  --red-bg: #c42f22;
  --red-bg-h: #a8281c;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, .8, .18, 1);
  --pad: clamp(20px, 5vw, 80px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; color: var(--red); }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); padding: 2px 7px; border-radius: 3px; color: var(--fg); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }

/* ───────── Deck engine ───────── */
.deck { position: fixed; inset: 0; }
.slide {
  position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(48px) scale(.985);
  transition: opacity .7s var(--ease), transform .9s var(--ease), visibility 0s linear .9s;
}
.deck[data-dir=back] .slide { transform: translateY(-48px) scale(.985); }
.slide.is-leaving { transform: translateY(-48px) scale(.985); }
.deck[data-dir=back] .slide.is-leaving { transform: translateY(48px) scale(.985); }
.deck .slide.is-active {
  opacity: 1; visibility: visible; transform: none; z-index: 2;
  transition: opacity .8s var(--ease) .12s, transform 1s var(--ease) .1s, visibility 0s;
}

[data-r] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform 1.1s var(--ease); }
.is-active [data-r] { opacity: 1; transform: none; transition-delay: calc(.28s + var(--d, 0) * .09s); }

.wrap { position: relative; z-index: 2; width: 100%; max-width: 1440px; margin: 0 auto; padding: var(--pad); padding-bottom: calc(var(--pad) + 44px); }
.grid2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 96px); align-items: center; }

.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--red); margin-bottom: clamp(14px, 2.4vh, 24px); }
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(46px, min(7.4vw, 13vh), 132px); line-height: .94; letter-spacing: -.01em; }
.title { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, min(5.2vw, 9vh), 88px); line-height: .96; letter-spacing: -.005em; }
.lead { color: var(--muted); font-size: clamp(15px, min(1.2vw, 2.2vh), 19px); line-height: 1.6; max-width: 32em; margin-top: clamp(16px, 3vh, 28px); }
.fine { color: var(--dim); font-size: 13px; line-height: 1.5; margin-top: 18px; max-width: 34em; }
.bignum { position: absolute; top: 6vh; right: var(--pad); font-family: var(--mono); font-size: clamp(120px, 17vw, 280px); line-height: 1; color: rgba(255, 255, 255, .03); pointer-events: none; user-select: none; }
.glow { position: absolute; border-radius: 50%; background: var(--red); filter: blur(120px); opacity: .13; pointer-events: none; }

/* Progress + bar */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; background: rgba(255, 255, 255, .05); }
.progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .8s var(--ease); }
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad) max(14px, env(safe-area-inset-bottom)); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--dim);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar-logo img { height: 18px; display: block; opacity: .9; transition: opacity .4s; }
.bar-logo:hover img { opacity: 1; }
.dots { display: flex; gap: 6px; }
.dots button { width: 18px; height: 18px; position: relative; }
.dots button::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: rgba(255, 255, 255, .2); transition: background .4s, transform .4s; }
.dots button:hover::after { background: rgba(255, 255, 255, .5); }
.dots button.on::after { background: var(--red); }
.bar-right { display: flex; align-items: center; gap: 6px; }
.bar-right span { margin-right: 10px; }
.bar-right button { width: 36px; height: 36px; border: 1px solid var(--line); color: var(--fg); transition: border-color .3s, background .3s; }
.bar-right button:hover { border-color: var(--red); background: var(--red-soft); }

/* Notes */
.notes {
  position: fixed; right: 16px; top: 16px; width: min(380px, calc(100vw - 32px)); z-index: 40; padding: 18px 20px;
  background: rgba(17, 17, 19, .94); border: 1px solid var(--line); backdrop-filter: blur(12px);
  font-size: 14px; line-height: 1.55; color: var(--muted); transform: translateX(calc(100% + 24px)); transition: transform .5s var(--ease);
}
.notes.open { transform: none; }
.notes-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
.notes-body p + p { margin-top: 8px; }
.notes-body b { color: var(--fg); font-weight: 500; }

/* ───────── 00 Hero ───────── */
.g-stage { position: absolute; inset: 0; }
.g-stage canvas { width: 100%; height: 100%; display: block; }
.s-close .g-stage { opacity: .4; }
.g-hero { width: 55vw; height: 55vw; right: -12vw; top: -10vw; }
.s-hero .wrap { pointer-events: none; }
.hero-logo { height: clamp(34px, 4.4vw, 60px); display: block; margin-bottom: clamp(28px, 7vh, 72px); }
.s-hero .display { max-width: 12.5em; }
.hint { margin-top: clamp(28px, 6vh, 64px); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.hint kbd { margin-right: 8px; }

/* ───────── 01 Cosa facciamo ───────── */
.areas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: clamp(24px, 5vh, 48px); }
.area { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: clamp(18px, 2.2vw, 30px); background: var(--bg); cursor: pointer; transition: background .4s; }
.area::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--red); transition: width .6s var(--ease); }
.area .mono { font-size: 10px; color: var(--dim); transition: color .4s; }
.area h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.4vw, 38px); line-height: 1; }
.area p { flex: 1; font-size: clamp(13.5px, 1vw, 15px); line-height: 1.55; color: var(--muted); }
.area-link { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); transition: color .3s; }
.area:hover, .area.on { background: #141416; }
.area:hover::before, .area.on::before { width: 100%; }
.area.on .mono, .area:hover .area-link, .area.on .area-link { color: var(--red); }
.chain { margin-top: clamp(26px, 5vh, 48px); }
.chain-k { display: block; margin-bottom: 20px; color: var(--red); }
.chain-track { position: relative; height: 1px; margin: 0 calc(100% / 6); background: var(--line); }
.chain-fill { position: absolute; left: 0; top: 0; height: 1px; width: calc(var(--p, 0) * 100%); background: var(--red); transition: width 1s var(--ease), opacity .4s; }
.chain-fill::after { content: ""; position: absolute; right: -6px; top: -6px; width: 13px; height: 13px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 7px var(--red-soft); }
.chain-track.idle .chain-fill { opacity: 0; }
.chain ol { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: -5px; }
.chain li { padding: 0 14px; text-align: center; font-size: clamp(14px, 1.1vw, 16px); line-height: 1.5; color: var(--dim); transition: color .4s; }
.chain li i { display: block; width: 9px; height: 9px; margin: 0 auto 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: var(--bg); transition: background .4s, border-color .4s; }
.chain li b { font-weight: 500; color: var(--muted); transition: color .4s; }
.chain li.done { color: var(--muted); }
.chain li.on { color: var(--fg); }
.chain li.on b { color: var(--red); }
.chain li.on i, .chain li.done i { background: var(--red); border-color: var(--red); }

/* ───────── 02 Ops — mock gestionale ───────── */
.psr { margin-top: clamp(18px, 3.5vh, 32px); }
.psr div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: clamp(9px, 1.6vh, 14px) 0; border-top: 1px solid var(--line); }
.psr div:last-child { border-bottom: 1px solid var(--line); }
.psr dt { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); padding-top: 4px; }
.psr dd { font-size: clamp(13.5px, 1vw, 15px); line-height: 1.5; color: var(--muted); }
.psr dd b { color: var(--fg); font-weight: 500; }
.grid-app { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); }
.grid-app .title { font-size: clamp(36px, min(4vw, 7.5vh), 68px); }
.dots { display: flex; gap: 6px; flex: none; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.app {
  position: relative; display: flex; flex-direction: column; overflow: hidden; height: clamp(440px, 66vh, 620px);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; background: #101012; font-size: 12px; user-select: none;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .65), 0 0 80px rgba(230, 60, 46, .06);
}
.app-bar { display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #0c0c0e; flex: none; }
.app-url { flex: 1; max-width: 320px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); background: rgba(255, 255, 255, .04); padding: 5px 10px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-url b { color: var(--muted); font-weight: 400; }
.app-demo { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.app-body { flex: 1; display: grid; grid-template-columns: 176px 1fr; min-height: 0; }
.app-side { display: flex; flex-direction: column; gap: 16px; padding: 14px 10px; border-right: 1px solid var(--line); background: #0d0d0f; }
.app-brand { display: flex; gap: 9px; align-items: center; padding: 0 6px; }
.app-logo { width: 26px; height: 26px; flex: none; display: grid; place-items: center; background: var(--red-bg); color: #fff; font-weight: 600; border-radius: 5px; }
.app-brand b { display: block; font-size: 11.5px; font-weight: 500; }
.app-brand small { color: var(--dim); font-size: 10px; }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav button {
  display: flex; align-items: center; gap: 8px; max-height: 40px; overflow: hidden; padding: 8px 9px; border-radius: 5px; text-align: left; font-size: 12px; color: var(--muted);
  transition: background .25s, color .25s, opacity .4s, max-height .45s var(--ease), padding .45s var(--ease);
}
.app-nav button::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 2px; border: 1px solid currentColor; opacity: .6; }
.app-nav button:hover { background: rgba(255, 255, 255, .04); color: var(--fg); }
.app-nav button.on { background: rgba(230, 60, 46, .13); color: var(--fg); }
.app-nav button.on::before { background: var(--red); border-color: var(--red); opacity: 1; }
.app-nav button[hidden] { display: flex; max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; pointer-events: none; }
.badge { margin-left: auto; font-family: var(--mono); font-size: 9.5px; background: var(--red-bg); color: #fff; border-radius: 8px; padding: 1px 6px; }
.badge:empty { display: none; }
.app-role { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.app-role small { display: block; margin-bottom: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.role-btn { width: 100%; display: flex; justify-content: space-between; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; font-size: 11.5px; transition: border-color .3s; }
.role-btn:hover { border-color: rgba(255, 255, 255, .3); }
.app-main { position: relative; min-width: 0; overflow: hidden; }
.view {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s, transform .45s var(--ease), visibility 0s .45s;
}
.view.on { opacity: 1; visibility: visible; transform: none; transition: opacity .4s .05s, transform .5s var(--ease) .05s, visibility 0s; }
.v-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.v-head h4 { font-size: 15px; font-weight: 500; }
.v-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi, .card { background: #16161a; border: 1px solid rgba(255, 255, 255, .07); border-radius: 7px; }
.kpi { padding: 11px 12px; }
.kpi small { display: block; margin-bottom: 6px; font-size: 10.5px; color: var(--dim); }
.kpi b { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi b.red { color: var(--red); }
.kpi em { margin-left: 3px; font-style: normal; font-size: 11px; color: var(--dim); }
.dash-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 12px 14px; }
.card-h { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 11px; color: var(--muted); }
.card-h .live { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; }
.bars { flex: 1; min-height: 90px; display: flex; align-items: flex-end; gap: 6px; }
.bars div { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.bars span { width: 100%; height: calc(var(--h, 0) * 1%); border-radius: 3px 3px 0 0; background: linear-gradient(to top, rgba(230, 60, 46, .3), var(--red)); transition: height 1.1s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.bars em { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; }
.bars small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 9px; color: var(--dim); white-space: nowrap; }
.feed { display: flex; flex-direction: column; gap: 6px; }
.feed li > span:nth-child(2) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 4px; background: rgba(255, 255, 255, .03); font-size: 11px; animation: feedIn .5s var(--ease) both; }
.feed time { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.feed small { color: var(--dim); }
.feed .tag { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.feed .tag.in { border-color: rgba(230, 60, 46, .5); color: var(--red); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-8px); } }
.shifts { width: 100%; border-collapse: separate; border-spacing: 0 5px; font-size: 11px; }
.shifts th { padding-bottom: 2px; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); text-align: center; }
.shifts th:first-child, .shifts td:first-child { text-align: left; }
.shifts td { padding: 0 2px; text-align: center; }
.shifts td:first-child b { display: block; font-size: 11.5px; font-weight: 500; }
.shifts td:first-child small { font-size: 10px; color: var(--dim); }
.shifts tbody tr { transition: opacity .5s, filter .5s; }
.chip {
  display: inline-block; min-width: 44px; padding: 5px 4px; border-radius: 4px; font-family: var(--mono); font-size: 10px; background: rgba(255, 255, 255, .07);
  opacity: 0; transform: scale(.8); transition: opacity .3s, transform .4s var(--ease); transition-delay: calc(var(--i) * 16ms);
}
.chip.off { background: transparent; color: var(--dim); border: 1px dashed rgba(255, 255, 255, .12); }
.chip.anom { background: var(--red-bg); color: #fff; }
.shifts.in .chip { opacity: 1; transform: none; }
.shifts.in .chip.anom { animation: anom 1.3s ease-in-out 1s infinite; }
@keyframes anom { 50% { box-shadow: 0 0 0 5px rgba(230, 60, 46, .25); } }
.anom-tip { align-self: flex-start; padding: 7px 10px; border-radius: 4px; border: 1px solid rgba(230, 60, 46, .5); background: rgba(230, 60, 46, .08); font-family: var(--mono); font-size: 10.5px; color: var(--red); opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease); }
.anom-tip.show { opacity: 1; transform: none; }
.role-note { display: none; padding: 7px 10px; border-left: 2px solid var(--red); border-radius: 4px; background: rgba(255, 255, 255, .04); font-family: var(--mono); font-size: 10px; color: var(--muted); }
.app[data-role="2"] .role-note { display: block; }
.app[data-role="2"] .shifts tbody tr:not(.me) { opacity: .1; filter: blur(2px); }
.app[data-role="2"] .anom-tip { display: none; }
.leave { display: flex; flex-direction: column; gap: 8px; }
.leave li { display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; background: #16161a; border: 1px solid rgba(255, 255, 255, .07); border-radius: 7px; transition: border-color .4s, background .4s, opacity .4s; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 10.5px; font-weight: 500; }
.leave b { font-size: 12px; font-weight: 500; }
.leave small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--dim); }
.pill { padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: all .3s; }
.acts { display: flex; gap: 6px; transition: opacity .3s; }
.acts button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; transition: background .25s, border-color .25s; }
.acts .ok { background: var(--red-bg); border-color: var(--red-bg); color: #fff; }
.acts .ok:hover { background: var(--red-bg-h); }
.acts .no:hover { border-color: rgba(255, 255, 255, .35); }
.leave li[data-st] .acts { opacity: 0; pointer-events: none; }
.leave li[data-st=ok] { border-color: rgba(230, 60, 46, .45); background: rgba(230, 60, 46, .06); }
.leave li[data-st=ok] .pill { background: var(--red-bg); border-color: var(--red-bg); color: #fff; }
.leave li[data-st=no] { opacity: .5; }
.sim { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sim-in, .sim-out { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: #16161a; border: 1px solid rgba(255, 255, 255, .07); border-radius: 7px; }
.sim-in label { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; color: var(--dim); }
.sim-in label b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; color: var(--muted); transition: all .25s; }
.chips button.on { border-color: var(--red); background: rgba(230, 60, 46, .13); color: var(--fg); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 8px 0; border-radius: 2px; outline: none; cursor: pointer; background: linear-gradient(to right, var(--red) var(--p, 50%), rgba(255, 255, 255, .12) var(--p, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--red); }
.range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--red); }
.sim-out small { display: block; font-size: 10.5px; color: var(--dim); }
.sim-out b { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sim-out .big b { font-size: 26px; color: var(--red); }
.stack { display: flex; gap: 2px; height: 8px; margin-top: 10px; border-radius: 4px; overflow: hidden; }
.stack span { transition: flex-basis .3s; }
.s1 { background: var(--fg); }
.s2 { background: var(--red); }
.s3 { background: rgba(255, 255, 255, .3); }
.legend { display: flex; gap: 12px; font-size: 10px; color: var(--dim); }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; }
.sim-foot { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.kanban { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kanban > div { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 7px; background: rgba(255, 255, 255, .02); }
.kanban h5 { display: flex; justify-content: space-between; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.kanban p { padding: 9px 10px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 5px; background: #18181c; font-size: 11px; line-height: 1.4; }
.kanban p small { display: block; margin-top: 4px; font-size: 10px; color: var(--dim); }
.app-cursor {
  position: absolute; left: 0; top: 0; z-index: 5; width: 18px; height: 18px; margin: -2px 0 0 -3px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M3 2l11 6.5-5 1.2-2.3 4.8z' fill='%23fff' stroke='%230a0a0b' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.app-cursor.on { opacity: 1; }
.app-cursor::after { content: ""; position: absolute; left: 3px; top: 2px; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid var(--red); opacity: 0; }
.app-cursor.click::after { animation: clk .45s var(--ease); }
@keyframes clk { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.4); } }
.app-toast { position: absolute; right: 16px; bottom: 16px; z-index: 4; max-width: 72%; padding: 10px 14px; border-radius: 6px; background: #fff; color: #0a0a0b; font-size: 11.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .4s var(--ease); pointer-events: none; }
.app-toast.show { opacity: 1; transform: none; }
.app-toast b { color: var(--red); }

/* ───────── 03 Twin ───────── */
.s-3d { display: block; }
.twin-stage { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; }
.twin-stage:active { cursor: grabbing; }
.twin-canvas { width: 100%; height: 100%; display: block; }
.twin-fallback { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.twin-stage.no3d .twin-fallback { display: block; }
.twin-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tl {
  position: absolute; left: 0; top: 0; padding: 5px 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; white-space: nowrap;
  background: rgba(10, 10, 11, .82); border: 1px solid rgba(255, 255, 255, .16); color: var(--fg); transition: background .3s, border-color .3s, opacity .3s;
}
.tl b { font-weight: 500; color: var(--red); margin-right: 8px; }
.tl small { color: var(--dim); margin-left: 4px; font-size: 10px; }
.tl.alert { background: var(--red-bg); border-color: var(--red-bg); }
.tl.alert b, .tl.alert small { color: #fff; }
.tl.focus { border-color: var(--fg); }
.twin-ui {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr auto;
  gap: 20px; padding: var(--pad); padding-bottom: calc(var(--pad) * .6 + 44px);
}
.twin-ui > * { pointer-events: auto; }
.twin-head { grid-column: 1; grid-row: 1; max-width: 520px; pointer-events: none; }
.twin-head .title { font-size: clamp(36px, min(4.4vw, 8vh), 72px); }
.twin-head .lead { max-width: 26em; font-size: clamp(14px, 1.05vw, 17px); }
.seg { display: inline-flex; margin-top: 22px; border: 1px solid var(--line); pointer-events: auto; background: rgba(10, 10, 11, .6); }
.seg button { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; padding: 10px 14px; color: var(--muted); transition: background .3s, color .3s; }
.seg button.on { background: var(--red-bg); color: #fff; }
.twin-panel { grid-column: 2; grid-row: 1 / 3; align-self: start; background: rgba(13, 13, 15, .82); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.panel-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.live { color: var(--red); display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.sensor-list li { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); cursor: pointer; transition: background .3s; }
.sensor-list li:hover { background: rgba(255, 255, 255, .03); }
.sensor-list .nm { font-size: 12px; color: var(--muted); }
.sensor-list .nm b { font-family: var(--mono); font-weight: 500; font-size: 10px; color: var(--fg); margin-right: 6px; letter-spacing: .08em; }
.sensor-list .val { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--fg); }
.sensor-list .val small { color: var(--dim); font-size: 10px; margin-left: 3px; }
.sensor-list canvas { grid-column: 1 / 3; width: 100%; height: 22px; margin-top: 6px; display: block; }
.sensor-list li.alert { background: rgba(230, 60, 46, .12); }
.sensor-list li.alert .val { color: var(--red); }
.sensor-list li.focus { background: rgba(255, 255, 255, .06); }
.panel-foot { padding: 10px 14px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.twin-bottom { grid-column: 1 / 3; grid-row: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; pointer-events: none; }
.twin-alert {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 9px 12px; background: var(--red-bg); color: #fff;
  opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s var(--ease);
}
.twin-alert.show { opacity: 1; transform: none; }
.flow { display: flex; flex-wrap: wrap; gap: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); pointer-events: auto; }
.flow li { padding: 8px 0; transition: color .4s; }
.flow li + li::before { content: "→"; margin: 0 14px; color: rgba(255, 255, 255, .2); }
.flow li.on { color: var(--fg); }
.flow li.on::after { content: ""; display: block; height: 1px; background: var(--red); margin-top: 6px; }
.flow li + li.on::after { margin-left: 38px; }

/* ───────── 04 RAG (3D) + Network ───────── */
.s-rag .twin-ui { grid-template-columns: minmax(0, 1fr) 380px; }
.s-rag .twin-panel, .s-net .twin-panel { background: #0f0f11; position: relative; z-index: 3; }
.psr.sm { max-width: 470px; margin-top: 18px; }
.psr.sm div { grid-template-columns: 84px 1fr; padding: 8px 0; }
.psr.sm dd { font-size: 13px; }
.rag-stat { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rag-stat b { margin-left: 8px; color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.chat { padding: 16px; min-height: 250px; border-bottom: 1px solid var(--line); }
.q { font-size: 14.5px; line-height: 1.45; display: flex; gap: 10px; align-items: baseline; }
.q .mono { color: var(--red); font-size: 14px; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--red); margin-left: 2px; animation: blink 1s steps(1) infinite; vertical-align: -2px; }
.src { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; min-height: 26px; }
.src li { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); animation: pop .5s var(--ease) both; }
.src li b { color: var(--red); font-weight: 500; margin-right: 6px; }
.src li.think { border: 0; color: var(--dim); letter-spacing: .2em; text-transform: uppercase; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.a { font-size: 13.5px; line-height: 1.6; color: var(--fg); }
.a sup { font-family: var(--mono); font-size: 9px; color: var(--red); margin: 0 1px; }
.tl-core { border-color: var(--red); }
.net-list li { display: grid; grid-template-columns: 28px 1fr; gap: 4px; padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 12.5px; color: var(--muted); cursor: pointer; transition: background .3s, color .3s; }
.net-list li:hover { background: rgba(255, 255, 255, .03); }
.net-list .mono { font-size: 10px; letter-spacing: .08em; color: var(--dim); padding-top: 2px; }
.net-list small { display: block; max-height: 0; overflow: hidden; font-size: 11px; line-height: 1.4; color: var(--dim); transition: max-height .4s var(--ease), margin .4s; }
.net-list li.on { color: var(--fg); background: rgba(230, 60, 46, .1); }
.net-list li.on .mono, .net-list li.core .mono { color: var(--red); }
.net-list li.core { color: var(--fg); cursor: default; }
.net-list li.focus small, .net-list li.core small { max-height: 40px; margin-top: 3px; }
.net-bar b { font-weight: 500; margin-right: 12px; }
.net-bar span { margin: 0 10px; opacity: .7; }

/* ───────── 05 Process ───────── *//* ───────── 05 Process ───────── */
.steps { position: relative; margin-top: clamp(36px, 8vh, 80px); }
.steps ol { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 12px; position: relative; }
.track { position: absolute; top: 5px; left: calc(50% / var(--n, 6)); right: calc(50% / var(--n, 6)); height: 1px; background: var(--line); }
.track .fill { position: absolute; left: 0; top: 0; height: 1px; width: calc(var(--p, 0) * 100%); background: var(--red); transition: width .9s var(--ease); }
.steps li { text-align: center; cursor: pointer; padding: 0 4px; }
.steps li i { display: block; width: 11px; height: 11px; margin: 0 auto 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: var(--bg); position: relative; z-index: 1; transition: background .4s, border-color .4s, transform .4s var(--ease); }
.steps li .mono { color: var(--dim); }
.steps h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 1.9vw, 30px); margin: 8px 0 8px; color: var(--muted); transition: color .4s; }
.steps p { font-size: 13px; line-height: 1.5; color: var(--dim); transition: color .4s; }
.steps li.done i { background: var(--red); border-color: var(--red); }
.steps li.on i { transform: scale(1.5); box-shadow: 0 0 0 6px var(--red-soft); }
.steps li.on h3 { color: var(--fg); }
.steps li.on p { color: var(--muted); }
.steps li.on .mono { color: var(--red); }
.steps li.first h3 { color: var(--fg); }
.steps li.first .mono { color: var(--red); }
.steps li.first i { border-color: var(--red); }

/* ───────── 06 Together ───────── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: clamp(24px, 5vh, 48px); }
.tiles li {
  position: relative; background: var(--bg); padding: clamp(16px, 2.2vw, 26px); min-height: clamp(120px, 19vh, 190px); cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; transition: background .4s;
}
.tiles li::before { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--red); transition: width .5s var(--ease); }
.tiles .mono { color: var(--dim); font-size: 10px; }
.tiles li::after { content: "+"; position: absolute; top: clamp(12px, 1.8vw, 22px); right: clamp(14px, 2vw, 24px); font-family: var(--mono); font-size: 16px; color: var(--dim); transition: transform .4s var(--ease), color .4s; }
.tiles li:hover::after, .tiles li.open::after { transform: rotate(45deg); color: var(--red); }
.tiles h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 1.8vw, 28px); line-height: 1.05; transition: transform .5s var(--ease); }
.tiles p { position: absolute; left: clamp(16px, 2.2vw, 26px); right: clamp(16px, 2.2vw, 26px); bottom: clamp(16px, 2.2vw, 26px); font-size: 13.5px; line-height: 1.45; color: var(--muted); opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease); }
.tiles li:hover, .tiles li.open { background: #121214; }
.tiles li:hover::before, .tiles li.open::before { width: 100%; }
.tiles li:hover h3, .tiles li.open h3 { transform: translateY(calc(-1 * var(--lift, 64px))); }
.tiles li:hover p, .tiles li.open p { opacity: 1; transform: none; }
.tiles li:hover .mono, .tiles li.open .mono { color: var(--red); }
.tg-foot { margin-top: clamp(18px, 3vh, 28px); font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.6vw, 24px); color: var(--muted); }

/* ───────── Custom client slide ───────── */
.points { margin-top: clamp(24px, 5vh, 48px); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.points li { background: var(--bg); padding: 22px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.points li .mono { display: block; color: var(--red); margin-bottom: 10px; }

/* ───────── 07 Close ───────── */
.s-close .wrap { text-align: center; display: flex; flex-direction: column; align-items: center; }
.g-close { width: 60vw; height: 60vw; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .12; }
.close-logo { height: clamp(30px, 3.4vw, 48px); margin-bottom: clamp(28px, 6vh, 60px); }
.s-close .lead { margin-left: auto; margin-right: auto; }
.close-row { display: flex; align-items: center; gap: clamp(24px, 5vw, 64px); margin-top: clamp(32px, 6vh, 64px); text-align: left; }
.contacts { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.contacts .mono { color: var(--muted); transition: color .3s; }
.contacts a.mono:hover { color: var(--red); }
.cta { display: inline-flex; align-items: center; gap: 14px; padding: 16px 26px; background: var(--red-bg); color: #fff; font-size: clamp(15px, 1.2vw, 18px); font-weight: 500; transition: background .3s; }
.cta span { transition: transform .3s var(--ease); }
.cta:hover { background: var(--red-bg-h); }
.cta:hover span { transform: translateX(4px); }
.qr { display: block; background: #fff; padding: 10px; width: 132px; height: 132px; }
.qr:empty { display: none; }
.qr svg { width: 100%; height: 100%; display: block; }

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .grid2 { grid-template-columns: 1fr; }
  .slide { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .wrap { padding-top: calc(var(--pad) + 24px); padding-bottom: 96px; }
  .bignum { font-size: 110px; top: 3vh; }
  .steps ol { grid-template-columns: 1fr; gap: 0; }
  .track { left: 5px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; }
  .track .fill { width: 1px; height: calc(var(--p, 0) * 100%); transition: height .9s var(--ease); }
  .steps li { display: grid; grid-template-columns: 28px 40px 1fr; grid-template-rows: auto auto; text-align: left; align-items: baseline; padding: 0 0 18px; }
  .steps li i { margin: 0; grid-row: 1 / 3; align-self: start; margin-top: 2px; }
  .steps h3 { margin: 0; font-size: 22px; }
  .steps p { grid-column: 3; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tiles li { min-height: 0; gap: 10px; }
  .tiles p { position: static; opacity: 1; transform: none; margin-top: 10px; }
  .tiles li:hover h3, .tiles li.open h3 { transform: none; }
  .close-row { flex-direction: column; text-align: center; }
  .contacts { align-items: center; }

  .s-3d { display: flex; flex-direction: column; }
  .s-hero .g-stage { opacity: .5; }
  .s-rag .twin-ui { grid-template-columns: 1fr; }
  .twin-ui { display: contents; }
  .twin-head { order: 1; padding: calc(var(--pad) + 24px) var(--pad) 0; max-width: none; }
  .twin-stage { position: relative; inset: auto; height: 56vh; min-height: 320px; flex: none; order: 2; }
  .twin-panel { order: 3; margin: 0 var(--pad); align-self: stretch; }
  .twin-bottom { order: 4; padding: 20px var(--pad) 96px; }
}

/* ───────── Deck Controllo di gestione ───────── */
.ask { margin-top: clamp(20px, 4vh, 36px); }
.ask li { position: relative; padding: 12px 0 12px 26px; border-top: 1px solid var(--line); font-size: clamp(14px, 1.05vw, 16px); color: var(--muted); }
.ask li:last-child { border-bottom: 1px solid var(--line); }
.ask li::before { content: "?"; position: absolute; left: 0; top: 12px; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1; color: var(--red); }
.split { cursor: pointer; user-select: none; }
.split-total small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.split-total b { display: block; margin-top: 6px; font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 4.4vw, 68px); line-height: 1; transition: opacity .6s; }
.split-chart { position: relative; height: clamp(250px, 42vh, 400px); margin-top: 22px; }
.split-axis { position: absolute; left: 0; right: 0; top: 70%; height: 1px; background: rgba(255, 255, 255, .25); }
.split-cols { position: absolute; inset: 0; display: flex; }
.sc { position: relative; flex: 1; }
.sc .scb { position: absolute; left: 0; right: 0; bottom: 30%; height: var(--h, 0); background: rgba(244, 244, 242, .82); transition: height 1.2s var(--ease), left .9s var(--ease), right .9s var(--ease), background .6s, bottom 0s; }
.sc.neg .scb { bottom: auto; top: 70%; background: var(--red); transition: height 1.2s var(--ease), left .9s var(--ease), right .9s var(--ease), background .6s; }
.split-chart.go .sc .scb { left: 14%; right: 14%; }
.sc em, .sc small { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--mono); white-space: nowrap; opacity: 0; transition: opacity .5s .7s; }
.sc em { bottom: calc(30% + var(--h, 0) + 8px); font-style: normal; font-size: 12px; color: var(--fg); }
.sc.neg em { bottom: auto; top: calc(70% + var(--h, 0) + 8px); color: var(--red); }
.sc small { top: calc(70% + 10px); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sc.neg small { top: calc(70% - 22px); color: var(--red); }
.split-chart.go .sc em, .split-chart.go .sc small { opacity: 1; }
.split-chart.go .sc.neg .scb { animation: anom 1.4s ease-in-out 1.4s infinite; }
.split-cap { margin-top: 18px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.tl-pool { border-color: rgba(255, 255, 255, .1); background: rgba(10, 10, 11, .7); color: var(--muted); }
.tl-pool b { color: var(--fg); }
.tl span { margin-left: 2px; }
.s-alloc .twin-panel { background: #0f0f11; position: relative; z-index: 3; }
.mg-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); cursor: pointer; transition: background .3s; animation: feedIn .5s var(--ease) both; }
.mg-list li:hover, .mg-list li.focus { background: rgba(255, 255, 255, .05); }
.mg-list .nm { font-size: 13px; }
.mg-list .mv { font-family: var(--mono); font-size: 13px; text-align: right; }
.mg-list .mb { grid-column: 1 / 3; height: 3px; background: rgba(255, 255, 255, .06); }
.mg-list .mb i { display: block; height: 100%; background: rgba(244, 244, 242, .7); transition: width .8s var(--ease); }
.mg-list small { grid-column: 1 / 3; font-size: 10.5px; color: var(--dim); }
.mg-list li.neg { background: rgba(230, 60, 46, .1); }
.mg-list li.neg .mv { color: var(--red); }
.mg-list li.neg .mb i { background: var(--red); }
.mg-tot { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.mg-tot b { color: var(--fg); font-weight: 500; }
.ce-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ce-tbl th { padding: 0 6px 8px; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); text-align: right; }
.ce-tbl th:first-child, .ce-tbl td:first-child { text-align: left; }
.ce-tbl td { padding: 8px 6px; border-top: 1px solid rgba(255, 255, 255, .06); text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.ce-tbl tr.tot td { color: var(--fg); font-weight: 500; }
.ce-tbl td:last-child { width: 38%; }
.var { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.var i { display: block; height: 6px; width: 0; border-radius: 2px; background: rgba(244, 244, 242, .6); transition: width .9s var(--ease) .2s; }
.var.bad i { background: var(--red); }
.var em { min-width: 64px; font-style: normal; font-family: var(--mono); font-size: 10.5px; }
.var.bad em { color: var(--red); }
.view.in .var i { width: var(--w); }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbars li { display: grid; grid-template-columns: 150px 1fr 54px; align-items: center; gap: 12px; font-size: 11.5px; }
.hbars small { display: block; font-size: 10px; color: var(--dim); }
.hb { position: relative; height: 16px; }
.hb::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: rgba(255, 255, 255, .2); }
.hb i { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; border-radius: 0 3px 3px 0; background: rgba(244, 244, 242, .75); transition: width 1s var(--ease); }
.hbars li.neg .hb i { left: auto; right: 50%; border-radius: 3px 0 0 3px; background: var(--red); }
.hbars b { font-family: var(--mono); font-weight: 400; font-size: 11px; text-align: right; }
.hbars li.neg b, .hbars li.neg span { color: var(--red); }
.view.in .hb i { width: var(--w); }
.view.in .hbars li:nth-child(n) .hb i { transition-delay: calc(var(--i, 0) * 60ms); }
.wf { flex: 1; min-height: 160px; display: flex; gap: 8px; padding-bottom: 22px; }
.wfc { position: relative; flex: 1; }
.wfc span { position: absolute; left: 8%; right: 8%; bottom: var(--b); height: 0; background: rgba(244, 244, 242, .25); transition: height .7s var(--ease); }
.wfc.tot span { background: rgba(244, 244, 242, .85); }
.wfc.neg span { background: var(--red); }
.wfc.pos span { background: rgba(244, 244, 242, .55); }
.view.in .wfc span { height: var(--h); }
.wfc:nth-child(2) span { transition-delay: .25s; } .wfc:nth-child(3) span { transition-delay: .5s; } .wfc:nth-child(4) span { transition-delay: .75s; }
.wfc:nth-child(5) span { transition-delay: 1s; } .wfc:nth-child(6) span { transition-delay: 1.25s; } .wfc:nth-child(7) span { transition-delay: 1.5s; } .wfc:nth-child(8) span { transition-delay: 1.75s; }
.wfc em { position: absolute; left: 0; right: 0; top: 0; text-align: center; font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.wfc.neg em { color: var(--red); }
.wfc small { position: absolute; left: -4px; right: -4px; bottom: -20px; text-align: center; font-family: var(--mono); font-size: 9px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-svg { flex: 1; min-height: 0; width: 100%; }
.fc-svg .gl { stroke: rgba(255, 255, 255, .06); }
.fc-svg .ax { font-family: var(--mono); font-size: 9px; fill: var(--dim); }
.fc-svg .ln { fill: none; stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.fc-svg .bud { stroke: rgba(255, 255, 255, .3); stroke-width: 1.5; }
.fc-svg .act { stroke: var(--fg); }
.fc-svg .fcl { stroke: var(--red); }
.view.in .fc-svg .bud { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease); }
.view.in .fc-svg .act { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.view.in .fc-svg .fcl { stroke-dashoffset: 0; transition: stroke-dashoffset .9s var(--ease) 1.8s; }
.fc-svg .pt { fill: rgba(255, 255, 255, .6); }
.fc-svg .pt.red { fill: var(--red); }
.fc-svg .lb { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.fc-svg .lb.red { fill: var(--red); }
.fc-svg .today { stroke: rgba(255, 255, 255, .2); stroke-dasharray: 3 3; }
.fc-svg .pt, .fc-svg .lb { opacity: 0; transition: opacity .5s; }
.view.in .fc-svg .pt, .view.in .fc-svg .lb { opacity: 1; transition-delay: 2.4s; }
.s-cruscotto .app-toast b { color: var(--red); }
@media (max-width: 640px) { .hbars li { grid-template-columns: 96px 1fr 48px; } .ce-tbl th:nth-child(2), .ce-tbl td:nth-child(2) { display: none; } }

/* ───────── Tema Controllo: carta millimetrata + ticker ───────── */
.theme-cdg .slide::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 35% 45%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse at 35% 45%, #000 10%, transparent 75%);
}
.theme-cdg .s-3d::before { display: none; }
.embed .bar, .embed .progress, .embed .notes, .embed .hint, .embed .ticker { display: none !important; }
.ticker { position: absolute; left: 0; right: 0; bottom: 74px; z-index: 2; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(10, 10, 11, .6); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker div { display: flex; width: max-content; animation: tick 40s linear infinite; }
.ticker span { padding: 10px 28px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; border-right: 1px solid var(--line); }
.ticker span.neg { color: var(--red); }
@keyframes tick { to { transform: translateX(-50%); } }
@media (max-height: 760px) { .ticker { display: none; } }

@media (max-width: 980px) {
  .areas, .chain ol { grid-template-columns: 1fr; }
  .chain-track { display: none; }
  .chain ol { margin-top: 0; gap: 12px; }
  .chain li { display: flex; gap: 12px; padding: 0; text-align: left; }
  .chain li i { flex: none; margin: 7px 0 0; }
  .grid-app { grid-template-columns: 1fr; }
  .app { height: 560px; }
}
@media (max-width: 640px) {
  .app-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .app-side { flex-direction: row; align-items: center; gap: 8px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .app-brand, .app-role small, .app-demo { display: none; }
  .app-nav { flex-direction: row; }
  .app-nav button { white-space: nowrap; }
  .app-role { margin: 0; padding: 0; border: 0; }
  .role-btn { white-space: nowrap; gap: 8px; }
  .view { overflow-y: auto; padding: 14px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .sim, .kanban { grid-template-columns: 1fr; }
  .shifts td:first-child small { display: none; }
  .chip { min-width: 0; width: 100%; padding: 6px 0; font-size: 9px; white-space: nowrap; letter-spacing: -.02em; }
  .shifts td { padding: 0 1px; }
  .app { height: 500px; }
  .leave li { grid-template-columns: 30px 1fr auto; }
  .leave .pill { display: none; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .dots { display: none; }
  .flow li + li::before { margin: 0 8px; }
}
@media (max-height: 720px) and (min-width: 981px) {
  .steps { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}

/* ───────── Mobile ───────── */
.hint .t-touch { display: none; }
@media (hover: none), (max-width: 980px) { .hint .t-key { display: none; } .hint .t-touch { display: inline; } }
@media (max-width: 980px) {
  .bar { background: linear-gradient(to top, var(--bg) 62%, rgba(10, 10, 11, 0)); padding-top: 22px; }
  .bar-right button { width: 44px; height: 44px; }
  .bar-right span { margin-right: 6px; }
  .slide { overscroll-behavior: contain; }
  .wrap { padding-bottom: 120px; }
  .s-hero { align-items: flex-start; }
  .s-hero .g-stage { top: 42%; opacity: .9 !important; }
  .s-hero::after { background: linear-gradient(to bottom, rgba(10, 10, 11, .95) 0%, rgba(10, 10, 11, .85) 48%, rgba(10, 10, 11, 0) 72%) !important; }
  .s-close .g-stage { opacity: .25; }
  .kicker { font-size: 11px; letter-spacing: .2em; line-height: 1.6; }
  .app-cursor { display: none; }
  .twin-stage { height: 62vh; min-height: 360px; }
  .s-3d .twin-ui > .twin-panel, .s-3d .twin-panel { margin-bottom: 8px; }
  .twin-bottom { padding-bottom: 130px !important; }
  .flow { font-size: 10px; }
  .ticker { bottom: 84px; }
  .tl { font-size: 10px; padding: 4px 6px; }
}
.swipe-hint { display: none; }
@media (max-width: 980px) {
  .slide.scrolls .swipe-hint { display: flex; }
  .s-3d .swipe-hint { order: 5; margin-top: -100px; margin-bottom: 130px; }
  .swipe-hint { justify-content: center; gap: 8px; margin: 28px var(--pad) 0; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
  .swipe-hint::before { content: "↑"; color: var(--red); animation: nudge 1.6s ease-in-out infinite; }
}
@keyframes nudge { 50% { transform: translateY(-5px); } }

/* ───────── Accessibilità ───────── */
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.s-hero .wrap, .s-close .wrap { text-shadow: 0 2px 24px rgba(10, 10, 11, .9); }
.s-hero::after, .s-3d::after, .s-close::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.s-hero::after { background: linear-gradient(90deg, rgba(10, 10, 11, .96) 0%, rgba(10, 10, 11, .88) 38%, rgba(10, 10, 11, .35) 62%, rgba(10, 10, 11, 0) 78%); }
.s-close::after { background: radial-gradient(ellipse 52% 60% at 50% 52%, rgba(10, 10, 11, .9), rgba(10, 10, 11, .55) 60%, rgba(10, 10, 11, 0)); }
.s-3d::after { background: linear-gradient(90deg, rgba(10, 10, 11, .9) 0%, rgba(10, 10, 11, .6) 30%, rgba(10, 10, 11, 0) 50%); }
.s-3d .twin-ui { z-index: 3; }
.s-hero .wrap, .s-close .wrap { z-index: 2; }
.panel-foot, .flow, .tl, .hint, .bar, .tags li, .split-cap, .rag-stat, .sim-foot, .app-demo { font-size: 11px; }
.tl small, .sensor-list .val small { font-size: 11px; }
.lead { font-size: clamp(16px, min(1.25vw, 2.3vh), 20px); }
@media (max-width: 980px) { .s-3d::after { background: none; } .s-hero::after { background: rgba(10, 10, 11, .55); } }
