/* ===========================================================================
   NOTQIN — Product landing page
   Design system extracted from the Asayl/NOTQIN pitch deck (v31):
   warm cream paper, near-black ink, single restrained teal accent,
   sparing amber on data bands, thin-line technical sketches, editorial sans.
   =========================================================================== */

:root {
  --paper:      #F4F1EA;   /* warm cream canvas */
  --paper-2:    #EEEAE0;   /* slightly deeper panel */
  --ink:        #1A1A1A;   /* near-black text */
  --ink-soft:   #3A3A36;
  --muted:      #6B6B63;   /* secondary text */
  --line:       #D8D3C7;   /* thin-line sketch / borders */
  --line-soft:  #E4DFD4;
  --teal:       #1B9E8F;   /* PRIMARY accent — the "contexte fiable" node */
  --teal-deep:  #157E72;
  --amber:      #D9A441;   /* SECONDARY accent — data/timeline bands only */
  --red:        #C0473D;   /* machine-state: stopped / danger only */
  --white:      #FCFBF7;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
}

/* paper grain / faint grid like the deck's engineering canvas */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }

/* ---------- Typography ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 500; letter-spacing: 0; line-height: 1.05; color: var(--ink); }
h1 { font-size: clamp(2.5rem, 4.4vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 42ch; }
.teal { color: var(--teal); }
.amber { color: var(--amber); }
.serif-accent { font-family: Georgia, 'Times New Roman', serif; font-style: italic; }

/* eyebrow micro-label + corner section number (deck pattern) */
.eyebrow {
  font-family: var(--font-display); font-size: .72rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: .55rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--teal); display: inline-block; }
.section-no {
  position: absolute; top: clamp(28px, 5vw, 56px); right: var(--gutter);
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .2em; color: var(--muted);
}

/* ---------- Interactive states ---------- */
a:focus-visible,
button:focus-visible,
.tnode:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-display); font-weight: 500; font-size: .95rem; letter-spacing: .01em;
  display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.4rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: all .25s var(--ease); }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-2px); box-shadow: 0 16px 34px -24px var(--teal-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); background: color-mix(in srgb, var(--white) 58%, transparent); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.nav.scrolled { border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.wordmark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); display: inline-block; margin-bottom: 2px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; transition: color .2s; position: relative; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.35rem; height: 1px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav-links a:hover { color: var(--teal); }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
.nav-links a.btn-primary { color: var(--white); }
.nav-links a.btn-primary:hover { color: var(--white); }
.lang { font-family: var(--font-display); font-size: .8rem; letter-spacing: .1em; color: var(--muted); cursor: pointer; background: none; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .6rem; }
.lang:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Sections ---------- */
section { position: relative; padding: clamp(72px, 9vw, 124px) 0; }
.section-head { max-width: 60ch; margin-bottom: clamp(40px, 5vw, 60px); }
.section-head h2 { margin-top: 1rem; }
.section-head p { color: var(--muted); margin-top: 1rem; max-width: 52ch; }
.divider { border-top: 1px solid var(--line); }

/* ---------- HERO ---------- */
.hero { padding-top: clamp(18px, 2.6vw, 40px); padding-bottom: clamp(36px, 5vw, 68px); text-align: center; }
.hero .eyebrow { justify-content: center; }
.hero h1 { margin: 1rem auto 1.1rem; max-width: 18ch; }
.hero .lead { margin: 0 auto; text-align: center; max-width: 52ch; color: var(--muted); }
.hero-proofline { margin: 1rem auto 0; max-width: 40ch; color: var(--ink-soft); font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.35; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-tagline { font-family: var(--font-display); margin-top: 2.6rem; color: var(--muted); font-size: .9rem; letter-spacing: .04em; }

/* convergence diagram (deck page-07) */
.converge { margin: clamp(30px,5vw,60px) auto 0; max-width: 980px; filter: drop-shadow(0 30px 36px rgba(26,26,26,.08)); }
.converge svg { width: 100%; height: auto; display: block; }
.hero-depth path,
.hero-depth rect { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.hero-depth rect { fill: color-mix(in srgb, var(--white) 42%, transparent); }
.flow-line { fill: none; stroke: var(--line); stroke-width: 1.2; }
.flow-line.active { stroke: var(--teal); stroke-width: 1.6; }
.node-label { font-family: var(--font-body); font-size: 12px; fill: var(--muted); }
.spine-node { fill: var(--paper); stroke: var(--teal); stroke-width: 2; }
.spine-core { fill: var(--teal); }
.node-aura { fill: color-mix(in srgb, var(--teal) 9%, transparent); stroke: none; transform-origin: 480px 150px; }
.src-dot { fill: var(--ink); }
.out-label { font-family: var(--font-display); font-size: 13px; fill: var(--ink); font-weight: 500; }
.pulse { animation: pulse 2.4s var(--ease) infinite; transform-origin: center; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.packet { fill: var(--teal); opacity: 0; }
.streaming .packet { opacity: .72; }
.packet-out { fill: var(--amber); opacity: .5; }
.cred-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.6rem auto 0; max-width: 880px; }
.cred-strip span { border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--white) 55%, transparent); padding: .38rem .7rem; font-family: var(--font-display); font-size: .72rem; color: var(--muted); }

/* ---------- PIPELINE (deck page-09) ---------- */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; align-items: stretch; margin-top: 2rem; }
.pstep { text-align: center; padding: 1.4rem 1rem; position: relative; min-width: 0; }
.pstep:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 32px; color: var(--line); font-size: 1.3rem; line-height: 1; z-index: 2; }
.pstep .pico { width: 64px; height: 64px; margin: 0 auto .9rem; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: var(--white); }
.pstep.key .pico { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent); }
.pstep h3 { font-size: 1rem; }
.pstep p { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.pstep svg { stroke: var(--ink-soft); }
.pstep.key svg { stroke: var(--teal); }

/* ---------- STORYBOARD (Direction B — deck page-11) ---------- */
.story { background: var(--paper-2); }
.story .wrap { max-width: 1300px; }
.story-stage { display: grid; grid-template-columns: 4px minmax(240px, 280px) minmax(700px, 1fr); gap: clamp(18px,3vw,34px); align-items: stretch; }
.story-progress { width: 2px; min-height: 100%; background: var(--line); border-radius: 999px; overflow: hidden; align-self: stretch; }
.story-progress span { display: block; width: 100%; height: var(--story-progress, 8%); background: var(--teal); transition: height .35s var(--ease); }
.story-steps { position: relative; }
.story-step { padding: 1.15rem 0 1.15rem 1.65rem; border-left: 2px solid var(--line); position: relative; opacity: .35; transition: opacity .4s var(--ease); }
.story-step::before { content: ""; position: absolute; left: -7px; top: 1.9rem; width: 12px; height: 12px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--line); transition: all .4s var(--ease); }
.story-step.active { opacity: 1; }
.story-step.active { border-left-color: var(--teal); }
.story-step.active::before { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px color-mix(in srgb, var(--teal) 14%, transparent); }
.story-step .k { font-family: var(--font-display); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.story-step h3 { margin: .3rem 0 .4rem; }
.story-step p { color: var(--ink-soft); font-size: .88rem; max-width: 30ch; }
.story-viz { position: sticky; top: 120px; align-self: start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; overflow: hidden; }
.story-viz svg { width: 100%; height: auto; }
.legacy-viz,
.legacy-console-body { display: none !important; }

/* --- Enterprise factory dashboard --- */
.factory-dashboard { padding: 0; box-shadow: 0 34px 70px -52px rgba(26,26,26,.48); }
.factory-topbar { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto auto; gap: .8rem 1rem; align-items: center; padding: .95rem 1.05rem .8rem; background: linear-gradient(180deg, var(--white), #f7f4ec); border-bottom: 1px solid var(--line); }
.live-chip,
.oee-pill { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 999px; padding: .36rem .62rem; background: color-mix(in srgb, var(--white) 78%, transparent); font-family: var(--font-display); font-size: .72rem; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent); }
.factory-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.factory-title strong { font-family: var(--font-display); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factory-title span,
.crumb { color: var(--muted); font-size: .75rem; }
.oee-pill strong { color: var(--teal-deep); font-size: .95rem; }
.factory-dashboard[data-step="kpi"] .oee-pill,
.factory-dashboard[data-step="event"] .oee-pill { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); background: color-mix(in srgb, var(--amber) 11%, var(--white)); }
.factory-dashboard[data-step="kpi"] .oee-pill strong,
.factory-dashboard[data-step="event"] .oee-pill strong { color: #9a6a1e; }
.live-wave { grid-column: 1 / -1; height: 34px; width: 100%; border: 1px solid var(--line-soft); border-radius: 8px; background: color-mix(in srgb, var(--paper) 72%, var(--white)); overflow: hidden; }
.live-wave path { fill: none; stroke-width: 2; stroke-linecap: round; animation: liveWave 5.6s linear infinite; }
.live-wave .wave-teal { stroke: var(--teal); }
.live-wave .wave-amber { stroke: var(--amber); opacity: .72; animation-duration: 7s; }
@keyframes liveWave { from { transform: translateX(0); } to { transform: translateX(-88px); } }
.factory-line { display: grid; grid-template-columns: 96px 1fr 1fr 96px; grid-template-rows: auto auto; gap: .6rem; align-items: stretch; padding: 1rem; background: radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--teal) 5%, transparent), transparent 30%), var(--paper); border-bottom: 1px solid var(--line); }
.factory-line .stock-card.raw { grid-column: 1; grid-row: 1 / 3; }
.factory-line .station-card[data-station="op10"] { grid-column: 2; grid-row: 1; }
.factory-line .station-card[data-station="op20"] { grid-column: 3; grid-row: 1; }
.factory-line .station-card[data-station="op30"] { grid-column: 2; grid-row: 2; }
.factory-line .station-card[data-station="op40"] { grid-column: 3; grid-row: 2; }
.factory-line .stock-card.finished { grid-column: 4; grid-row: 1 / 3; }
.stock-card,
.station-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; min-width: 0; box-shadow: 0 18px 34px -30px rgba(26,26,26,.45); }
.stock-card { min-height: 154px; display: grid; place-items: center; align-content: center; gap: .35rem; text-align: center; color: var(--muted); }
.stock-card strong { font-family: var(--font-display); color: var(--ink); font-size: 1rem; line-height: 1; white-space: nowrap; }
.stock-card span:last-child { font-family: var(--font-display); font-size: .56rem; letter-spacing: .08em; overflow-wrap: anywhere; }
.stock-icon { width: 28px; height: 28px; color: var(--teal-deep); display: inline-grid; place-items: center; }
.stock-icon svg,
.station-icon svg,
.node-icon svg,
.tree-icon,
.chev svg { width: 100%; height: 100%; display: block; }
.finished .stock-icon { color: var(--amber); }
.line-arrow { display: none; height: 1px; background: var(--line); position: relative; }
.line-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid var(--line); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.station-card { min-height: 230px; padding: .95rem; border-top: 4px solid var(--teal); transition: border-color .35s var(--ease), background .35s var(--ease), transform .35s var(--ease); }
.station-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.station-icon { color: var(--teal-deep); width: 27px; height: 27px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.status-badge { border-radius: 999px; padding: .26rem .48rem; background: color-mix(in srgb, var(--teal) 10%, var(--white)); color: var(--teal-deep); border: 1px solid color-mix(in srgb, var(--teal) 32%, var(--line)); font-family: var(--font-display); font-size: .62rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.station-card h3 { margin-top: .95rem; font-size: 1rem; line-height: 1.1; }
.station-card p { color: var(--muted); font-size: .78rem; margin-top: .16rem; }
.station-card dl { display: grid; gap: .34rem; margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--line-soft); }
.station-card dl div { display: flex; justify-content: space-between; gap: .55rem; font-size: .76rem; }
.station-card dt { color: var(--muted); }
.station-card dd { color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.station-metrics { display: grid; grid-template-columns: repeat(2, minmax(72px, 1fr)); gap: .44rem .6rem; margin-top: .9rem; font-size: .68rem; color: var(--muted); }
.station-metrics span { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .4rem; min-width: 0; white-space: nowrap; }
.station-metrics b { color: var(--ink); }
.station-metrics .good { color: var(--teal-deep); }
.station-metrics .bad { color: var(--red); }
.station-card.status-warn { border-top-color: var(--amber); background: color-mix(in srgb, var(--amber) 6%, var(--white)); }
.station-card.status-warn .status-badge { background: color-mix(in srgb, var(--amber) 12%, var(--white)); color: #9a6a1e; border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.station-card.status-warn .station-icon { color: var(--amber); }
.station-card.status-bad { border-top-color: var(--red); background: color-mix(in srgb, var(--red) 6%, var(--white)); }
.station-card.status-bad .status-badge { background: color-mix(in srgb, var(--red) 10%, var(--white)); color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.station-card.status-bad .station-icon { color: var(--red); }
.station-card.status-idle { border-top-color: var(--muted); background: color-mix(in srgb, var(--line) 28%, var(--white)); }
.station-card.status-idle .status-badge { background: var(--paper-2); color: var(--muted); border-color: var(--line); }
.station-card.status-idle .station-icon { color: var(--muted); }
.factory-lower { min-height: 210px; padding: 1rem; display: grid; gap: .8rem; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--white); transition: opacity .25s var(--ease); }
.dash-panel { border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--white) 76%, var(--paper)); padding: .85rem; min-width: 0; }
.dash-panel.wide { grid-column: span 2; }
.dash-panel.full { grid-column: 1 / -1; }
.dash-k { font-family: var(--font-display); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dash-big { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1; margin-top: .45rem; }
.dash-big.good { color: var(--teal-deep); }
.dash-big.warn { color: #9a6a1e; }
.dash-big.bad { color: var(--red); }
.event-row,
.proof-row { display: grid; grid-template-columns: auto 1fr auto; gap: .65rem; align-items: center; padding: .55rem .65rem; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--white); margin-top: .55rem; font-size: .82rem; }
.event-code { font-family: var(--font-display); color: var(--red); font-weight: 700; }
.breakdown { display: grid; gap: .5rem; margin-top: .75rem; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; gap: .55rem; align-items: center; font-size: .78rem; color: var(--muted); }
.bar-track { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--teal); width: var(--v); }
.bar-fill.warn { background: var(--amber); }
.alert-chip { display: inline-flex; margin-top: .8rem; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 11%, var(--white)); color: #8b5f1b; border-radius: 999px; padding: .4rem .6rem; font-family: var(--font-display); font-size: .75rem; }
.decision-card { border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line)); background: color-mix(in srgb, var(--teal) 7%, var(--white)); border-radius: 8px; padding: 1rem; }
.decision-card h3 { font-size: 1.1rem; margin-top: .3rem; }
.ghost-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.ghost-actions button { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: .45rem .75rem; font-family: var(--font-display); color: var(--ink-soft); }
.proof-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.proof-tags span { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .55rem; background: var(--paper); font-family: var(--font-display); font-size: .7rem; }

/* --- Storyboard viz scene --- */
#vizSvg text { font-family: var(--font-body); }
.vz-cap { font-family: var(--font-display); font-size: 11px; fill: var(--muted); letter-spacing: .02em; }
.vz-belt { stroke: var(--line); stroke-width: 1.4; fill: none; }
.vz-machine rect { fill: var(--white); stroke: var(--line); stroke-width: 1.4; }
.vz-tool { stroke: var(--ink-soft); stroke-width: 1.4; fill: none; }
.vz-machine .vz-cap { fill: var(--muted); }
.vz-dot { fill: var(--teal); transition: fill .45s var(--ease); }
#vizSvg[data-step="event"] .vz-machine[data-st="op20"] .vz-dot,
#vizSvg[data-step="kpi"]   .vz-machine[data-st="op20"] .vz-dot,
#vizSvg[data-step="cause"] .vz-machine[data-st="op20"] .vz-dot { fill: var(--amber); }
.vz-badge { opacity: 0; transition: opacity .4s var(--ease); }
.vz-badge circle, .vz-badge path { fill: none; stroke: var(--amber); stroke-width: 1.4; }
#vizSvg[data-step="event"] .vz-badge { opacity: 1; }

.vz-frame { fill: color-mix(in srgb, var(--white) 70%, transparent); stroke: var(--line); stroke-width: 1.2; }
.vz-wave { fill: none; stroke: var(--amber); stroke-width: 1.6; animation: vzWave 7s linear infinite; }
@keyframes vzWave { from { transform: translateX(0); } to { transform: translateX(-216px); } }
.vz-stops line { stroke: var(--amber); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: 0; transition: opacity .4s var(--ease); }
#vizSvg[data-step="event"] .vz-stops line,
#vizSvg[data-step="kpi"]   .vz-stops line { opacity: .9; }

.fz { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
#vizSvg[data-step="signal"]   .fz-gauge,
#vizSvg[data-step="event"]    .fz-gauge,
#vizSvg[data-step="kpi"]      .fz-gauge,
#vizSvg[data-step="cause"]    .fz-tree,
#vizSvg[data-step="decision"] .fz-decision,
#vizSvg[data-step="proof"]    .fz-proof { opacity: 1; transform: none; }

.gauge-track { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--teal); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 163.4; stroke-dashoffset: 45.8; transition: stroke-dashoffset .8s var(--ease), stroke .4s var(--ease); }
.gauge-val { font-family: var(--font-display); font-size: 22px; fill: var(--ink); font-weight: 500; }
#vizSvg[data-step="kpi"] .gauge-fill { stroke-dashoffset: 58.8; stroke: var(--amber); }
#vizSvg[data-step="kpi"] .gauge-val { fill: #B0792A; }
.vz-state { font-family: var(--font-display); font-size: 11px; fill: var(--muted); }
.fz-order { opacity: 0; transition: opacity .45s var(--ease); }
#vizSvg[data-step="kpi"] .fz-order { opacity: 1; }
.fz-order rect { fill: color-mix(in srgb, var(--amber) 12%, var(--white)); stroke: var(--amber); stroke-width: 1.2; }
.order-t { fill: var(--ink); }
.order-r { font-size: 11px; fill: #9a6a1e; }

.tree-link { stroke: var(--line); stroke-width: 1.3; fill: none; }
.tree-node { fill: var(--white); stroke: var(--line); stroke-width: 1.4; }
.tree-node.on { fill: var(--teal); stroke: var(--teal); }
.tree-label text { font-size: 11px; fill: var(--muted); }
.tree-label .on-t { fill: var(--teal-deep); font-weight: 600; }

.dc-box { fill: color-mix(in srgb, var(--teal) 6%, var(--white)); stroke: var(--teal); stroke-width: 1.3; }
.dc-ic { fill: none; stroke: var(--teal); stroke-width: 1.6; }
.dc-chk { fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dc-k { fill: var(--teal-deep); }
.dc-t { font-family: var(--font-display); font-size: 14px; fill: var(--ink); font-weight: 500; }
.dc-s { font-size: 11px; fill: var(--muted); }

.pf-doc rect { fill: var(--white); stroke: var(--line); stroke-width: 1.4; }
.pf-doc path { fill: none; stroke: var(--line); stroke-width: 1.6; }
.pf-seal { fill: none; stroke: var(--teal); stroke-width: 1.6; }
.pf-chk { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-tags text { font-family: var(--font-display); font-size: 12px; fill: var(--ink); }
.pf-sign { fill: var(--muted); }
@media (prefers-reduced-motion: reduce) { .vz-wave { animation: none; } }

/* ---------- CONSOLE (Direction C) ---------- */
.walkthrough { border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--white) 62%, transparent); padding: clamp(14px, 2vw, 22px); box-shadow: 0 34px 70px -56px rgba(26,26,26,.42); }
.walk-tabs { display: flex; gap: .5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.walk-tab { font-family: var(--font-display); border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .55rem .9rem; color: var(--ink-soft); cursor: pointer; transition: all .25s var(--ease); }
.walk-tab:hover { border-color: var(--ink); transform: translateY(-1px); }
.walk-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.workflow-line { font-family: var(--font-display); color: var(--muted); margin: 1rem 0; font-size: .9rem; }
.walk-copy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.walk-copy { background: var(--paper); padding: 1rem; opacity: .54; transition: opacity .25s var(--ease), background .25s var(--ease); }
.walk-copy.active { opacity: 1; background: var(--white); }
.walk-copy .k { font-family: var(--font-display); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.walk-copy h3 { font-size: 1.05rem; margin-top: .35rem; }
.walk-copy p { color: var(--muted); font-size: .86rem; margin-top: .35rem; }
.walk-panel[hidden] { display: none !important; }
.console-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); box-shadow: 0 30px 60px -40px rgba(20,20,20,.3); }
.console-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.console-bar .dotc { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.console-bar .curl { margin-left: .8rem; font-family: var(--font-display); font-size: .8rem; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-body { display: grid; grid-template-columns: 260px 1fr; min-height: 420px; }
.console-tree { border-right: 1px solid var(--line); padding: 1rem; font-size: .86rem; overflow: auto; }
.tnode { padding: .28rem .4rem; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: .4rem; color: var(--ink-soft); white-space: nowrap; font: inherit; }
.tree-icon { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; }
button.tnode { width: 100%; border: 0; background: transparent; text-align: left; }
.tnode:hover { background: var(--paper-2); }
.tnode.leaf { color: var(--ink); }
.tnode.leaf::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--teal); display: inline-block; }
.tnode.sel { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal-deep); font-weight: 600; }
.tnode .ind { display: inline-block; }
.console-main { padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.cm-empty { margin: auto; text-align: center; color: var(--muted); max-width: 30ch; }
.cm-topic { font-family: var(--font-display); font-size: .85rem; color: var(--muted); }
.cm-value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 500; }
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cm-card { border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.cm-card .lbl { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cm-card .big { font-family: var(--font-display); font-size: 1.6rem; margin-top: .3rem; }
.cm-decision { border: 1px solid var(--teal); background: color-mix(in srgb, var(--teal) 7%, transparent); border-radius: 10px; padding: 1rem 1.2rem; }
.cm-decision .lbl { color: var(--teal-deep); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.spark { width: 100%; height: 46px; }
.spark path { fill: none; stroke: var(--amber); stroke-width: 2; }
.mini-console { position: relative; min-height: 320px; padding: 1.4rem; display: grid; grid-template-columns: 180px 1fr; gap: 1rem; align-items: center; }
.edge-console { position: relative; min-height: 430px; padding: 1.25rem; display: grid; grid-template-columns: minmax(250px, .85fr) minmax(160px, .45fr) minmax(280px, 1fr); gap: 1rem; align-items: stretch; background: linear-gradient(180deg, var(--white), var(--paper)); }
.driver-stack { display: grid; gap: .75rem; align-content: center; }
.driver-card { border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; background: var(--paper); margin-bottom: 0; min-width: 0; }
.driver-card span { display: block; font-family: var(--font-display); font-size: .72rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.driver-card strong { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.driver-card p { color: var(--muted); font-size: .82rem; margin-top: .35rem; }
.driver-card.on { border-color: color-mix(in srgb, var(--teal) 36%, var(--line)); background: color-mix(in srgb, var(--teal) 7%, var(--white)); }
.driver-top { display: grid; grid-template-columns: auto auto 1fr; gap: .48rem; align-items: center; }
.health-bar { display: block; height: 8px; border-radius: 999px; background: var(--paper-2); margin-top: .7rem; overflow: hidden; }
.health-bar::before { content: ""; display: block; height: 100%; width: var(--v); border-radius: inherit; background: var(--teal); }
.health-bar.amber::before { background: var(--amber); }
.driver-flow { width: 100%; height: 100%; align-self: center; }
.driver-flow path { fill: none; stroke: var(--line); stroke-width: 1.7; }
.driver-flow circle { fill: var(--teal); }
.edge-node { border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--line)); background: var(--white); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: .9rem; box-shadow: 0 22px 44px -38px rgba(26,26,26,.45); }
.edge-node-head { display: flex; align-items: center; gap: .75rem; }
.node-icon { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--teal-deep); background: var(--paper); }
.edge-node-head strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.edge-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.edge-stats div { border: 1px solid var(--line-soft); border-radius: 8px; padding: .7rem; background: var(--paper); }
.edge-stats span { display: block; color: var(--muted); font-size: .72rem; }
.edge-stats strong { font-family: var(--font-display); font-size: 1.28rem; }
.edge-badges { display: flex; flex-wrap: wrap; gap: .45rem; }
.edge-badges span { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .55rem; font-family: var(--font-display); font-size: .72rem; background: var(--paper); color: var(--ink-soft); }
.birth-ticker { margin-top: auto; display: flex; gap: .35rem; overflow: hidden; border-top: 1px solid var(--line-soft); padding-top: .75rem; }
.birth-ticker span { flex: 0 0 auto; border: 1px solid color-mix(in srgb, var(--teal) 32%, var(--line)); border-radius: 999px; padding: .32rem .5rem; font-family: var(--font-display); font-size: .68rem; color: var(--teal-deep); background: color-mix(in srgb, var(--teal) 7%, var(--white)); animation: ticker 5.8s linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-92px); } }
.decision-console { padding: 1.4rem; display: grid; grid-template-columns: .8fr 1.4fr; gap: 1rem; align-items: stretch; }
.audit-console { grid-template-columns: minmax(240px, .75fr) minmax(320px, 1fr); background: linear-gradient(180deg, var(--white), var(--paper)); }
.evidence-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem; }
.evidence-list span { border: 1px solid var(--line); border-radius: 999px; padding: .45rem .75rem; font-family: var(--font-display); font-size: .8rem; color: var(--muted); background: var(--paper); }
.condition-record,
.recommend-record,
.audit-record { border: 1px solid var(--line); border-radius: 9px; padding: 1rem; background: var(--white); }
.condition-record .lbl,
.recommend-record .lbl { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.condition-record .big { font-family: var(--font-display); font-size: 2rem; margin-top: .35rem; color: #9a6a1e; }
.condition-record p { color: var(--ink-soft); font-size: .9rem; margin-top: .55rem; }
.condition-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.condition-meta span { border: 1px solid var(--line-soft); border-radius: 999px; padding: .3rem .48rem; font-family: var(--font-display); color: var(--muted); font-size: .68rem; background: var(--paper); }
.recommend-record { border-color: color-mix(in srgb, var(--teal) 38%, var(--line)); background: color-mix(in srgb, var(--teal) 6%, var(--white)); }
.recommend-record strong { display: block; margin-top: .45rem; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.25; }
.confidence { display: grid; grid-template-columns: auto auto 1fr; gap: .55rem; align-items: center; margin-top: .9rem; font-family: var(--font-display); font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.confidence b { color: var(--teal-deep); font-size: .9rem; }
.confidence-track { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.confidence-track span { display: block; height: 100%; width: var(--v); background: var(--teal); border-radius: inherit; }
.decision-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1rem; }
.decision-actions button { border: 1px solid var(--ink); border-radius: 999px; padding: .55rem .9rem; background: var(--ink); color: var(--paper); font-family: var(--font-display); cursor: pointer; }
.decision-actions button + button { background: var(--white); color: var(--ink); border-color: var(--line); }
.audit-record { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.audit-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.audit-head strong { display: block; font-family: var(--font-display); margin-top: .2rem; }
.ok-pill { border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--line)); border-radius: 999px; padding: .32rem .55rem; font-family: var(--font-display); color: var(--teal-deep); background: color-mix(in srgb, var(--teal) 8%, var(--white)); }
.audit-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.audit-table th,
.audit-table td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.audit-table th { font-family: var(--font-display); color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: var(--paper); }
.audit-table td:first-child { font-family: var(--font-display); color: var(--teal-deep); }
.audit-record footer { display: flex; align-items: center; gap: .45rem; padding: .8rem 1rem; color: var(--muted); font-family: var(--font-display); font-size: .78rem; background: var(--paper); }

/* --- Per-asset UNS dashboard --- */
.asset-console-body { grid-template-columns: 280px minmax(0, 1fr); min-height: 560px; }
.asset-tree { background: linear-gradient(180deg, var(--white), var(--paper)); }
.uns-tree { overflow: auto; }
.tree-root,
.tree-branch { font-family: var(--font-display); font-size: .78rem; color: var(--muted); padding: .35rem .45rem; }
.tree-branch { margin-left: .75rem; color: var(--ink-soft); }
.asset-node { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; margin-top: .3rem; border: 1px solid transparent; }
.asset-node small { color: var(--muted); font-size: .72rem; }
.asset-node.sel { border-color: color-mix(in srgb, var(--teal) 32%, var(--line)); background: color-mix(in srgb, var(--teal) 8%, var(--white)); }
.uns-node {
  grid-template-columns: 14px 10px minmax(0, 1fr) auto;
  padding-left: calc(.35rem + (var(--depth) * .9rem));
  min-height: 31px;
}
.uns-node .chev { color: var(--muted); width: 14px; height: 14px; display: inline-grid; place-items: center; }
.uns-node .node-label { overflow: hidden; text-overflow: ellipsis; }
.uns-node .node-spacer { width: 9px; height: 9px; display: inline-block; }
.uns-node[data-level="tag"] .node-spacer {
  border: 1px solid color-mix(in srgb, var(--teal) 65%, var(--line));
  border-radius: 3px;
  background: color-mix(in srgb, var(--teal) 8%, var(--white));
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-dot.good { background: var(--teal); }
.status-dot.warn { background: var(--amber); }
.status-dot.bad { background: var(--red); }
.signal-leaves { display: grid; gap: .25rem; margin: .28rem 0 .55rem 1.8rem; color: var(--muted); font-size: .74rem; }
.signal-leaves span { position: relative; padding-left: .75rem; }
.signal-leaves span::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 2px; background: color-mix(in srgb, var(--teal) 65%, var(--line)); }
.asset-main { background: var(--white); }
.uns-main { min-width: 0; }
.uns-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: .78rem;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: .65rem;
}
.uns-breadcrumb span { color: color-mix(in srgb, var(--muted) 62%, var(--line)); }
.asset-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .9rem; }
.asset-head h3 { font-size: 1.35rem; }
.asset-head p { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.asset-status { border-radius: 999px; border: 1px solid var(--line); padding: .42rem .7rem; font-family: var(--font-display); font-size: .76rem; white-space: nowrap; }
.asset-status.good { color: var(--teal-deep); background: color-mix(in srgb, var(--teal) 8%, var(--white)); border-color: color-mix(in srgb, var(--teal) 32%, var(--line)); }
.asset-status.warn { color: #9a6a1e; background: color-mix(in srgb, var(--amber) 11%, var(--white)); border-color: color-mix(in srgb, var(--amber) 42%, var(--line)); }
.asset-status.bad { color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--white)); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: .95rem; }
.asset-card { border: 1px solid var(--line); border-radius: 8px; padding: .95rem; background: color-mix(in srgb, var(--white) 78%, var(--paper)); min-width: 0; }
.asset-card h4 { font-family: var(--font-display); font-size: .9rem; margin-bottom: .65rem; }
.trend { width: 100%; height: 74px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--white); }
.trend path { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend.warn path { stroke: var(--amber); }
.trend.bad path { stroke: var(--red); }
.asset-main.animating .trend path { stroke-dasharray: var(--path-len, 360); stroke-dashoffset: var(--path-len, 360); animation: drawTrend .78s var(--ease) forwards; }
@keyframes drawTrend { to { stroke-dashoffset: 0; } }
.asset-metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: .7rem; }
.asset-metric { border-top: 1px solid var(--line-soft); padding-top: .55rem; }
.asset-metric span { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.asset-metric strong { font-family: var(--font-display); font-size: 1.25rem; }
.radial { width: 112px; height: 112px; margin: .2rem auto .7rem; display: block; }
.radial circle { fill: none; stroke-width: 10; }
.radial .track { stroke: var(--paper-2); }
.radial .value { stroke: var(--teal); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 283; stroke-dashoffset: calc(283 - (283 * var(--p)) / 100); transition: stroke-dashoffset .5s var(--ease), stroke .35s var(--ease); }
.asset-main.animating .radial .value { animation: fillDonut .78s var(--ease) forwards; }
@keyframes fillDonut { from { stroke-dashoffset: 283; } to { stroke-dashoffset: calc(283 - (283 * var(--p)) / 100); } }
.radial text { font-family: var(--font-display); fill: var(--ink); font-size: 20px; font-weight: 600; }
.asset-card.warn .radial .value { stroke: var(--amber); }
.asset-card.bad .radial .value { stroke: var(--red); }
.energy-stack { display: grid; gap: .6rem; }
.energy-kpi { display: flex; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--line-soft); padding-bottom: .45rem; font-size: .82rem; color: var(--muted); }
.energy-kpi strong { font-family: var(--font-display); color: var(--ink); }
.exposure { margin-top: .35rem; }
.exposure .bar-track { height: 10px; }
.asset-decision { margin-top: .85rem; border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line)); background: color-mix(in srgb, var(--teal) 6%, var(--white)); border-radius: 8px; padding: .9rem; }
.asset-decision.warn { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, var(--white)); }
.asset-decision.bad { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: color-mix(in srgb, var(--red) 7%, var(--white)); }
.asset-decision .dash-k { margin-bottom: .35rem; }
.uns-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .72rem; margin-top: .95rem; }
.uns-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .85rem;
  background: color-mix(in srgb, var(--white) 82%, var(--paper));
}
.uns-kpi span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.uns-kpi strong { display: block; margin-top: .35rem; font-family: var(--font-display); font-size: 1.28rem; }
.uns-kpi.warn strong { color: #9a6a1e; }
.uns-rollup-card { margin-top: .85rem; }
.uns-bar .bar-track { height: 11px; }
.line-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .95rem;
}
.station-mini {
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 8px;
  padding: .85rem;
  background: color-mix(in srgb, var(--white) 80%, var(--paper));
  min-width: 0;
}
.station-mini.warn { border-top-color: var(--amber); }
.station-mini.bad { border-top-color: var(--red); }
.station-mini span,
.station-mini em { display: block; color: var(--muted); font-size: .72rem; font-style: normal; font-family: var(--font-display); }
.station-mini strong { display: block; margin: .45rem 0; font-family: var(--font-display); }
.tag-read {
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
  border-radius: 8px;
  padding: 1rem;
  background: color-mix(in srgb, var(--teal) 5%, var(--white));
  margin-top: .95rem;
}
.tag-read.warn { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 8%, var(--white)); }
.tag-read.bad { border-color: color-mix(in srgb, var(--red) 36%, var(--line)); background: color-mix(in srgb, var(--red) 6%, var(--white)); }
.tag-value { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .8rem; }
.tag-value strong { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: .95; }
.tag-value span { color: var(--muted); font-family: var(--font-display); }
.tag-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .75rem; }
.tag-meta span {
  border-top: 1px solid var(--line-soft);
  padding-top: .55rem;
  color: var(--ink);
  font-family: var(--font-display);
}
.tag-meta b { display: block; color: var(--muted); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .2rem; }
.topic-path {
  display: grid;
  gap: .35rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: .75rem;
  background: var(--paper);
}
.topic-path span { color: var(--muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-display); }
.topic-path code { white-space: normal; word-break: break-word; color: var(--teal-deep); }

/* ---------- SECTOR PACKS (modal-style cards) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card { background: var(--paper); padding: 1.6rem; min-height: 170px; transition: background .25s, transform .25s var(--ease), box-shadow .25s var(--ease); display: flex; flex-direction: column; gap: .6rem; position: relative; overflow: hidden; }
.card:hover { background: var(--white); transform: translateY(-4px); box-shadow: 0 22px 48px -38px rgba(26,26,26,.55); z-index: 2; }
.card .motif { position: absolute; right: 1rem; top: 1rem; width: 72px; height: 48px; opacity: .28; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 16px 16px; transform: skewY(-12deg); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.card:hover .motif { opacity: .55; transform: skewY(-12deg) translateY(-3px); }
.card .cico { color: var(--ink); }
.card:hover .cico { color: var(--teal); }
.card h3 { font-size: 1.15rem; }
.card p { font-size: .86rem; color: var(--muted); }
.card .tag { margin-top: auto; font-family: var(--font-display); font-size: .72rem; letter-spacing: .08em; color: var(--teal-deep); }

/* ---------- SOVEREIGNTY (isometric-ish secure env, appliedcompute-style) ---------- */
.sov { background: var(--ink); color: var(--paper); }
.sov h2, .sov h3 { color: var(--white); }
.sov .eyebrow { color: #B8B3A6; }
.sov .eyebrow::before { background: var(--teal); }
.sov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,4vw,60px); align-items: center; }
.sov p { color: #D8D3C7; }
.sov-box { border: 1px solid #3a3a36; border-radius: var(--radius); padding: 1.6rem; background: #1f1f1c; }
.sov-box svg { width: 100%; height: auto; }
.sov-line { stroke: #4a4a44; stroke-width: 1.2; fill: none; }
.sov-node { fill: #1f1f1c; stroke: var(--teal); stroke-width: 1.6; }
.sov-label { fill: #D8D3C7; font-size: 12px; font-family: var(--font-body); }
.iso-grid path { fill: none; stroke: #34342f; stroke-width: 1; }
.iso-card path { fill: #22221f; stroke: #5A5952; stroke-width: 1.2; }
.iso-card.key path { stroke: var(--teal); fill: #202a28; }
.sov-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.chip { border: 1px solid #5A5952; border-radius: 999px; padding: .4rem .9rem; font-size: .82rem; color: var(--paper); font-family: var(--font-display); }

/* ---------- NUMBERS band ---------- */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px,3vw,40px); }
.stat { border-top: 2px solid var(--teal); padding-top: 1rem; background: linear-gradient(180deg, color-mix(in srgb, var(--white) 44%, transparent), transparent); padding-inline: .2rem; }
.stat .n { font-family: var(--font-display); font-size: clamp(2.2rem,4vw,3.2rem); font-weight: 500; line-height: 1; }
.stat .l { color: var(--muted); font-size: .9rem; margin-top: .5rem; }
.stat .src { color: var(--muted); font-size: .72rem; margin-top: .3rem; font-style: italic; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18ch; margin: 0 auto 1rem; }
.cta-band p { color: var(--muted); max-width: 46ch; margin: 0 auto 2rem; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; color: var(--muted); }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.foot-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.foot-col h4 { font-family: var(--font-display); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: .7rem; font-weight: 500; }
.foot-col a { display: block; color: var(--muted); text-decoration: none; font-size: .9rem; padding: .2rem 0; }
.foot-col a:hover { color: var(--teal); }
.foot-legal { font-size: .8rem; color: var(--muted); max-width: 30ch; }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .nav-links a:not(.btn) { display: none; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pstep:not(:last-child)::after { display: none; }
  .story-stage { grid-template-columns: 1fr; }
  .story-progress { display: none; }
  .story-viz { position: relative; top: 0; }
  .factory-line { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .factory-line .station-card[data-station] { grid-column: auto; grid-row: auto; }
  .factory-line .stock-card,
  .factory-line .line-arrow { display: none; }
  .factory-lower,
  .asset-grid { grid-template-columns: 1fr; }
  .dash-panel.wide,
  .dash-panel.full { grid-column: auto; }
  .console-body { grid-template-columns: 1fr; }
  .console-tree { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  .asset-console-body { grid-template-columns: 1fr; }
  .uns-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .walk-copy-grid { grid-template-columns: 1fr; }
  .mini-console,
  .edge-console,
  .decision-console { grid-template-columns: 1fr; }
  .edge-console { min-height: 0; }
  .driver-flow { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .sov-grid { grid-template-columns: 1fr; }
  .numbers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1180px) and (min-width: 881px) {
  .story-stage { grid-template-columns: 4px minmax(220px, 250px) minmax(560px, 1fr); gap: 24px; }
  .factory-line { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .stock-card,
  .line-arrow { display: none; }
  .factory-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .nav-inner { height: auto; min-height: 64px; padding-top: .7rem; padding-bottom: .7rem; align-items: flex-start; }
  .nav-links { gap: .55rem; justify-content: flex-end; flex-wrap: wrap; }
  .nav-links .btn { padding: .65rem .9rem; font-size: .82rem; }
  .lang { padding: .28rem .5rem; }
  .section-no { display: none; }
  .hero h1 { font-size: 2.6rem; }
  .cred-strip { justify-content: flex-start; }
  .cards { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pstep { padding: 1.15rem .8rem; }
  .numbers { grid-template-columns: 1fr; }
  .walk-tabs { gap: .4rem; }
  .walk-tab { flex: 1 1 auto; padding: .52rem .6rem; font-size: .84rem; }
  .console-bar .curl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .console-main { padding: 1rem; }
  .cm-value { font-size: 2.05rem; }
  .cm-row { grid-template-columns: 1fr; }
  .story-step { padding-left: 1.5rem; }
  .story-viz { min-height: 0; padding: 1rem; }
  .factory-dashboard { padding: 0; }
  .factory-topbar { grid-template-columns: 1fr; }
  .factory-line,
  .factory-lower,
  .asset-grid,
  .uns-kpi-grid,
  .line-strip,
  .tag-meta { grid-template-columns: 1fr; }
  .factory-line { overflow-x: visible; }
  .audit-table { display: block; overflow-x: auto; }
  .dash-panel.wide,
  .dash-panel.full { grid-column: auto; }
  .bar-row { grid-template-columns: 88px 1fr 42px; }
  .asset-head { flex-direction: column; }
  .sov-box { padding: 1rem; }
}
[lang-hide] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .pulse { animation: none; }
  .packet { display: none; }
  .live-wave path,
  .birth-ticker span,
  .asset-main.animating .trend path,
  .asset-main.animating .radial .value { animation: none !important; }
}

/* ---------- Asayl brand logo ---------- */
.svg-defs { width: 0; height: 0; position: absolute; }
.brand-logo { width: 70px; height: 23px; color: var(--ink); display: block; transition: color .2s var(--ease); }
.wordmark { gap: 0; }
.wordmark:hover .brand-logo { color: var(--teal); }
footer .brand-logo { width: 60px; height: 20px; }

/* ---------- Bottleneck: ERP → blind-spot gap → machines ---------- */
.bottleneck-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.bottleneck-grid .section-head { margin-bottom: 0; max-width: none; }
.erp-gap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--teal) 6%, transparent), transparent 28%),
    linear-gradient(180deg, var(--white), var(--paper));
  padding: clamp(14px, 2vw, 22px);
  box-shadow: 0 34px 70px -52px rgba(26,26,26,.48);
}
.erp-gap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--teal), color-mix(in srgb, var(--amber) 70%, var(--teal)), var(--red));
}
.erp-top,
.erp-bottom {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--white) 82%, var(--paper));
  padding: clamp(.85rem, 1.6vw, 1.05rem);
  box-shadow: 0 18px 34px -30px rgba(26,26,26,.45);
}
.erp-divider { position: relative; z-index: 1; }
.erp-tag {
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: .8rem;
}
.erp-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
}
.erp-system-card {
  display: grid;
  gap: .35rem;
  align-content: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-top: 4px solid color-mix(in srgb, var(--teal) 72%, var(--line));
  border-radius: 8px;
  background: var(--white);
  padding: .72rem;
  color: var(--ink-soft);
  box-shadow: 0 18px 34px -30px rgba(26,26,26,.45);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}
.erp-system-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--teal) 38%, var(--line));
  background: color-mix(in srgb, var(--teal) 4%, var(--white));
  box-shadow: 0 22px 42px -32px rgba(26,26,26,.55);
}
.erp-system-card small { display: none; }
.erp-logo-card {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  transition: color .22s var(--ease);
}
.erp-logo-card:hover {
  color: var(--ink);
}
.erp-logo-card.real svg {
  width: auto;
  height: 22px;
  max-width: 82px;
  display: block;
}
.erp-logo-card.wordmark {
  font-family: var(--font-display);
  font-size: clamp(.56rem, .78vw, .72rem);
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: visible;
}
.erp-logo-card.oracle { letter-spacing: .1em; }
.erp-logo-card.dynamics { letter-spacing: 0; }
.erp-logo-card.jde { letter-spacing: 0; }
.erp-logo-card.divalto { font-weight: 700; letter-spacing: .02em; text-transform: lowercase; }
.erp-line-txt {
  margin-top: .85rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
}
.erp-line-txt.warn {
  color: #8b5f1b;
  font-weight: 600;
}
.erp-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  margin: .85rem 0;
  padding: .52rem .7rem;
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--red) 5%, var(--white));
}
.erp-gap-svg {
  width: 100%;
  height: auto;
  color: var(--ink-soft);
  overflow: visible;
}
.flow-spine {
  fill: none;
  stroke: url(#blindFade);
  stroke-width: 1.2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.blind-veil {
  fill: none;
  stroke: color-mix(in srgb, var(--red) 52%, var(--line));
  stroke-width: 1.3;
  stroke-dasharray: 3 7;
  opacity: .62;
}
.drop {
  fill: var(--ink-soft);
  opacity: .4;
  animation: erpDrop 2.8s var(--ease) infinite;
}
.drop.d2 { animation-delay: .18s; }
.drop.d3 { animation-delay: .38s; }
.drop.d4 { animation-delay: .58s; }
.drop.d5 { animation-delay: .78s; }
.gap-dash {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 9 8;
}
.gap-dash.left { stroke-dashoffset: 2; }
.gap-dash.right { stroke-dashoffset: 11; }
.gap-x path {
  stroke: var(--red);
  stroke-width: 2.6;
  stroke-linecap: round;
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--red) 24%, transparent));
}
.erp-gap-label {
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--red) 34%, var(--line));
  border-radius: 999px;
  padding: .38rem .58rem;
  background: color-mix(in srgb, var(--red) 7%, var(--white));
}
.erp-machine-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}
.erp-machine-line::before {
  content: "";
  position: absolute;
  left: .6rem;
  right: .6rem;
  top: 50%;
  height: 1px;
  background: var(--line);
}
.erp-machine-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--white);
  padding: .62rem .6rem;
  display: grid;
  gap: .18rem;
  box-shadow: 0 18px 34px -30px rgba(26,26,26,.45);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease);
}
.erp-machine-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 42px -32px rgba(26,26,26,.55);
}
.erp-machine-card.status-warn {
  border-top-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 6%, var(--white));
}
.erp-machine-icon {
  width: 28px;
  height: 28px;
  color: var(--teal-deep);
  margin-bottom: .38rem;
}
.erp-machine-card.status-warn .erp-machine-icon { color: var(--amber); }
.erp-machine-icon svg { width: 100%; height: 100%; display: block; }
.erp-machine-card strong {
  font-family: var(--font-display);
  font-size: .86rem;
  line-height: 1.1;
  white-space: nowrap;
}
.erp-machine-card small {
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes erpDrop {
  0% { transform: translateY(-10px); opacity: 0; }
  34% { opacity: .42; }
  72% { transform: translateY(34px); opacity: .34; }
  100% { transform: translateY(34px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .drop { animation: none; opacity: .34; }
}
@media (max-width: 900px) {
  .bottleneck-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .erp-gap { max-width: 640px; }
}
@media (max-width: 560px) {
  .erp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-system-card { min-height: 88px; padding: .62rem; }
  .erp-divider { grid-template-columns: 1fr; gap: .55rem; }
  .erp-gap-label { justify-self: center; }
  .erp-machine-line { grid-template-columns: 1fr; }
  .erp-machine-line::before { display: none; }
}

/* ---------- Souveraineté: rendered isometric image ---------- */
.sov-box--img { padding: 0; overflow: hidden; background: transparent; border-color: #3a3a36; }
.sov-img { width: 100%; height: auto; display: block; border-radius: calc(var(--radius) - 1px); }

/* ---------- Un cas réel: smooth dashboard transitions ---------- */
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.factory-lower > * { animation: panelIn .45s var(--ease) both; }
.factory-dashboard { transition: box-shadow .4s var(--ease); }
.factory-dashboard .status-badge,
.factory-dashboard .dash-big,
#factoryOee { transition: color .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease); }
@media (prefers-reduced-motion: reduce) { .factory-lower > * { animation: none; } }
