/* PTN visual layer — lit workflows, status matrix, orbit, aurora band. Pairs with ptn-flow.js. Scoped to body.v2.
   Default (no JS / reduced motion) = everything fully lit and still. Animation only where .fx-live / .v-on are set. */
body.v2{--fx-ok:#1f6b45;--fx-okbg:#e6f4ec;--fx-off:#8a5a00;--fx-offbg:#fff1cf;--fx-inv:#244a3f;--fx-invbg:#dfeadf;--fx-lit:#e7b65b}

/* ---------- lit workflow ---------- */
body.v2 .fx-flow{--fg:var(--navy);--dim:#8aa396;--tx:var(--ink2);--bd:#cfdccc;position:relative;margin:22px 0}
body.v2 .fx-dark{--fg:#fff;--dim:#6f8d80;--tx:#d4e3dc;--bd:rgba(255,255,255,.2)}
body.v2 .fx-track{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(var(--n),1fr);gap:6px;position:relative;z-index:1}
body.v2 .fx-line{position:absolute;z-index:0;top:22px;left:calc(50% / var(--n));right:calc(50% / var(--n));height:4px;margin-top:-2px;border-radius:4px;background:var(--bd);overflow:hidden}
body.v2 .fx-line i{display:block;height:100%;width:100%;background:linear-gradient(90deg,var(--teal),var(--fx-lit));box-shadow:0 0 12px var(--fx-lit)}
body.v2 .fx-n{text-align:center;min-width:0}
body.v2 .fx-a{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;padding:0 2px;border:0;background:none;font:inherit;color:inherit;text-decoration:none;cursor:default}
body.v2 a.fx-a,body.v2 button.fx-a{cursor:pointer}
body.v2 .fx-a:focus-visible{outline:3px solid var(--fx-lit);outline-offset:3px;border-radius:12px}
body.v2 .fx-b{position:relative;width:44px;height:44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#fff;color:var(--c,var(--navy));border:3px solid var(--c,var(--teal));box-shadow:0 0 0 0 rgba(231,182,91,0);transition:transform .35s,box-shadow .35s,background .35s,color .35s,border-color .35s}
body.v2 .fx-dark .fx-b{background:#17352c}
body.v2 .fx-b svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body.v2 .fx-b em{font:800 1rem Inter,sans-serif;font-style:normal}
body.v2 .fx-tx{display:grid;gap:3px;min-width:0}
body.v2 .fx-tx b{font:700 .9rem Inter,sans-serif;color:var(--fg);overflow-wrap:anywhere}
body.v2 .fx-d{font-size:.78rem;line-height:1.35;color:var(--tx);overflow-wrap:anywhere}
/* static state: every step lit */
body.v2 .fx-flow:not(.fx-live) .fx-b{background:var(--c,var(--navy));color:#fff;box-shadow:0 0 14px rgba(231,182,91,.55)}
body.v2 .fx-flow:not(.fx-live).fx-dark .fx-b{background:var(--c,var(--teal));border-color:var(--fx-lit)}
/* live state: dim until lit in sequence */
body.v2 .fx-live .fx-line i{width:calc(var(--p,0)*100%);transition:width .9s cubic-bezier(.3,.7,.2,1)}
body.v2 .fx-live .fx-n .fx-b{border-color:var(--dim);color:var(--dim)}
body.v2 .fx-live .fx-n .fx-tx b{opacity:.55;transition:opacity .4s}
body.v2 .fx-live .fx-n.done .fx-b,body.v2 .fx-live .fx-n.on .fx-b{background:var(--c,var(--navy));border-color:var(--fx-lit);color:#fff;box-shadow:0 0 16px rgba(231,182,91,.7)}
body.v2 .fx-live .fx-n.done .fx-tx b,body.v2 .fx-live .fx-n.on .fx-tx b{opacity:1}
body.v2 .fx-live .fx-n.on .fx-b{transform:scale(1.14);animation:fx-beat 1.4s ease-in-out infinite}
body.v2 .fx-n.sel .fx-b{outline:3px solid var(--fx-lit);outline-offset:2px}
body.v2 .fx-a:hover .fx-b{transform:scale(1.1)}
@keyframes fx-beat{0%,100%{box-shadow:0 0 14px rgba(231,182,91,.7),0 0 0 0 rgba(231,182,91,.55)}50%{box-shadow:0 0 22px rgba(231,182,91,.9),0 0 0 12px rgba(231,182,91,0)}}
/* compact (8-step per-condition flow) */
body.v2 .fx-compact .fx-tx b{font-size:.78rem}
body.v2 .fx-compact .fx-b{width:38px;height:38px}
body.v2 .fx-compact .fx-line{top:19px}
body.v2 .fx-compact .fx-b svg{width:19px;height:19px}

/* ---------- aurora band ---------- */
body.v2 .fx-band{position:relative;overflow:hidden;background:#17352c;color:#dbe9e2;padding:46px 0 38px}
body.v2 .fx-band .fx-in{position:relative;z-index:1}
body.v2 .fx-band h2,body.v2 .fx-band h3{color:#fff}
body.v2 .fx-band .eyebrow{color:var(--fx-lit)}
body.v2 .fx-aurora{position:absolute;inset:0;z-index:0;pointer-events:none}
body.v2 .fx-aurora i{position:absolute;width:46%;height:150%;top:-25%;border-radius:50%;filter:blur(70px);opacity:.5;animation:fx-drift 16s ease-in-out infinite alternate}
body.v2 .fx-aurora i:nth-child(1){left:-8%;background:#2e8b6f}
body.v2 .fx-aurora i:nth-child(2){left:30%;background:#c98b3a;opacity:.34;animation-duration:21s;animation-delay:-6s}
body.v2 .fx-aurora i:nth-child(3){right:-10%;background:#3e6fa0;opacity:.38;animation-duration:25s;animation-delay:-11s}
@keyframes fx-drift{0%{transform:translate3d(-6%,0,0) scale(1)}100%{transform:translate3d(10%,6%,0) scale(1.18)}}

/* ---------- count tiles ---------- */
body.v2 .fx-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:26px 0 0}
body.v2 .fx-st{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);border-radius:16px;padding:14px 16px;display:grid;gap:2px;backdrop-filter:blur(4px)}
body.v2 .fx-st b{font:700 2.3rem/1 "Source Serif 4",Georgia,serif;color:var(--fx-lit);text-shadow:0 0 18px rgba(231,182,91,.55)}
body.v2 .fx-st span{font-size:.84rem;color:#d4e3dc}

/* ---------- status matrix ---------- */
body.v2 .fx-mxw{overflow-x:auto;margin:16px 0 6px;padding:4px}
body.v2 .fx-mx{border-collapse:separate;border-spacing:8px;width:100%;min-width:640px}
body.v2 .fx-mx th{font:700 .86rem Inter,sans-serif;color:var(--navy);text-align:center;vertical-align:bottom;padding:2px 4px}
body.v2 .fx-mx thead th .s{display:none}
body.v2 .fx-mx th.rh{text-align:left;font-weight:600;color:var(--ink2)}
body.v2 .fx-mx tbody th{text-align:left;max-width:230px;vertical-align:middle}
body.v2 .fx-key{display:flex;flex-wrap:wrap;gap:8px 16px;margin:10px 0 0;padding:0;list-style:none}
body.v2 .fx-mx tbody th a{color:var(--navy);text-decoration:none;border-bottom:2px solid var(--fx-lit)}
body.v2 .fx-mx td{text-align:center;padding:0}
body.v2 .fx-e{color:#b9c8bf}
body.v2 .fx-c{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:6px 10px;border-radius:12px;text-decoration:none;font:700 .8rem Inter,sans-serif;border:2px solid transparent;transition:transform .25s,box-shadow .25s}
body.v2 .fx-c i{font-style:normal;font-size:1rem;line-height:1}
body.v2 .fx-c:hover,body.v2 .fx-c:focus-visible{transform:translateY(-3px) scale(1.04);box-shadow:0 8px 20px rgba(36,74,63,.25)}
body.v2 .fx-c:focus-visible{outline:3px solid var(--fx-lit);outline-offset:2px}
body.v2 .fx-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body.v2 .fx-s-approved{background:var(--fx-okbg);color:var(--fx-ok);border-color:#9fd3b5}
body.v2 .fx-s-off{background:var(--fx-offbg);color:var(--fx-off);border-color:#e7c777;border-style:dashed}
body.v2 .fx-s-inv{background:var(--fx-invbg);color:var(--fx-inv);border-color:#9bb9a7;border-style:dotted}
body.v2 .fx-mxw.in .fx-c{animation:fx-pop .55s cubic-bezier(.2,.9,.3,1.3) both;animation-delay:calc(var(--j)*80ms)}
body.v2 .fx-mxw.in .fx-c.fx-s-approved:after{content:"";position:absolute;inset:-2px;border-radius:12px;border:2px solid var(--fx-ok);opacity:0;animation:fx-ring 3.2s ease-out infinite;animation-delay:calc(var(--j)*80ms + .8s)}
@keyframes fx-pop{0%{opacity:0;transform:scale(.4)}100%{opacity:1;transform:none}}
@keyframes fx-ring{0%{opacity:.7;transform:scale(1)}70%,100%{opacity:0;transform:scale(1.18,1.5)}}

/* ---------- per-condition header: orbit + step flow ---------- */
body.v2 .mh-c header{display:grid;grid-template-columns:minmax(0,1fr) 170px;column-gap:24px;align-items:start}
body.v2 .mh-c header>*{grid-column:1}
body.v2 .mh-c header>.fx-orbit{grid-column:2;grid-row:1/span 4}
body.v2 .mh-c .fx-flow{margin:6px 0 14px;padding:14px 8px 10px;background:linear-gradient(180deg,#f2f7f0,#fff);border:1px solid #d6e0d2;border-radius:16px}
body.v2 .fx-orbit{position:relative;width:160px;height:160px;justify-self:center}
body.v2 .fx-ring{position:absolute;border-radius:50%;border:2px dashed #b9cdbf;inset:0;animation:fx-rot 40s linear infinite}
body.v2 .fx-ring.r2{inset:34px;border-style:solid;border-color:#d7e4da;animation-direction:reverse;animation-duration:26s}
body.v2 .fx-core{position:absolute;inset:55px;border-radius:50%;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 0 rgba(231,182,91,.6);animation:fx-core 2.8s ease-out infinite}
body.v2 .fx-core svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
body.v2 .fx-spin{position:absolute;inset:0;animation:fx-rot 32s linear infinite}
body.v2 .fx-sat{position:absolute;top:50%;left:50%;width:42px;height:42px;margin:-21px 0 0 -21px;transform:rotate(var(--a)) translateX(68px) rotate(calc(-1*var(--a)))}
body.v2 .fx-sat i{width:100%;height:100%;border-radius:50%;display:flex;align-items:center;justify-content:center;font:800 .68rem Inter,sans-serif;font-style:normal;border:2px solid;animation:fx-rot 32s linear infinite reverse;box-shadow:0 2px 8px rgba(36,74,63,.25)}
body.v2 .fx-sat.fx-s-inv i{box-shadow:0 0 12px rgba(46,107,88,.55)}
@keyframes fx-rot{to{transform:rotate(360deg)}}
@keyframes fx-core{0%{box-shadow:0 0 0 0 rgba(231,182,91,.65)}80%,100%{box-shadow:0 0 0 22px rgba(231,182,91,0)}}

/* ---------- small lit touches on existing blocks ---------- */
body.v2 .mh-review .mh-steps li{position:relative;overflow:hidden}
body.v2 .mh-review .mh-steps li:before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:var(--fx-lit)}
body.v2 .mh-pills li{transition:transform .25s,box-shadow .25s}
body.v2 .mh-pills li:hover{transform:translateY(-3px);box-shadow:0 6px 16px rgba(36,74,63,.22)}
body.v2 .mh-c .mh-d[open]{box-shadow:0 0 0 2px rgba(231,182,91,.6),0 8px 22px rgba(36,74,63,.12)}
body.v2 .mh-res{transition:transform .25s,box-shadow .25s}
body.v2 .mh-res:hover{box-shadow:0 10px 26px rgba(36,74,63,.2),0 0 0 2px rgba(231,182,91,.55)}

@media(prefers-reduced-motion:no-preference){
  body.v2 .mh-review .mh-steps li:before{animation:fx-bar 6s ease-in-out infinite;animation-delay:calc(var(--k,0)*1.2s)}
  body.v2 .mh-review .mh-steps li:nth-child(2):before{--k:1}
  body.v2 .mh-review .mh-steps li:nth-child(3):before{--k:2}
  body.v2 .mh-review .mh-steps li:nth-child(4):before{--k:3}
  body.v2 .mh-pills li{animation:fx-breathe 5s ease-in-out infinite}
  body.v2 .mh-pills li:nth-child(2n){animation-delay:-1.7s}
  body.v2 .mh-pills li:nth-child(3n){animation-delay:-3.1s}
  body.v2 .mh-c:not([hidden]) header{animation:fx-in .6s ease both}
  body.v2 .mh-c:not([hidden]) .mh-d{animation:fx-in .6s ease both}
  body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(2){animation-delay:.05s}body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(3){animation-delay:.1s}body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(4){animation-delay:.15s}
  body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(5){animation-delay:.2s}body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(6){animation-delay:.25s}body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(7){animation-delay:.3s}
  body.v2 .mh-c:not([hidden]) .mh-d:nth-of-type(8){animation-delay:.35s}
}
@keyframes fx-bar{0%,100%{box-shadow:0 0 0 0 rgba(231,182,91,0);opacity:.35}15%,40%{box-shadow:0 0 14px 3px rgba(231,182,91,.85);opacity:1}60%{opacity:.35}}
@keyframes fx-breathe{0%,100%{box-shadow:0 2px 8px rgba(36,74,63,.1)}50%{box-shadow:0 0 16px rgba(231,182,91,.6)}}
@keyframes fx-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ---------- responsive ---------- */
@media(max-width:980px){
  body.v2 .fx-stats{grid-template-columns:repeat(2,1fr)}
  body.v2 .fx-compact .fx-track{grid-template-columns:repeat(4,1fr);row-gap:14px}
  body.v2 .fx-compact .fx-line{display:none}
}
@media(max-width:700px){
  body.v2 .mh-c header{display:block}
  body.v2 .fx-orbit{margin:6px auto 10px}
  /* vertical rail */
  body.v2 .fx-flow:not(.fx-compact) .fx-track{grid-template-columns:1fr;row-gap:16px}
  body.v2 .fx-flow:not(.fx-compact) .fx-line{top:22px;bottom:22px;left:22px;right:auto;width:4px;height:auto;margin:0 0 0 -2px}
  body.v2 .fx-flow:not(.fx-compact) .fx-line i{width:100%;height:100%}
  body.v2 .fx-live:not(.fx-compact) .fx-line i{width:100%;height:calc(var(--p,0)*100%)}
  body.v2 .fx-flow:not(.fx-compact) .fx-a{flex-direction:row;text-align:left;gap:14px}
  body.v2 .fx-flow:not(.fx-compact) .fx-b{flex:none}
  body.v2 .fx-compact .fx-track{grid-template-columns:repeat(2,1fr)}
  body.v2 .fx-compact .fx-a{flex-direction:row;text-align:left;gap:8px}
  body.v2 .fx-compact .fx-b{flex:none}
  body.v2 .fx-mx thead th .l{display:none}body.v2 .fx-mx thead th .s{display:inline}
  body.v2 .fx-mx{min-width:0;border-spacing:4px}
  body.v2 .fx-c .fx-l{display:none}
  body.v2 .fx-mx tbody th{font-size:.78rem;max-width:130px}
}
@media(max-width:600px){body.v2 .fx-stats{grid-template-columns:1fr 1fr}body.v2 .fx-st b{font-size:1.9rem}}

/* ---------- reduced motion: fully lit, fully still ---------- */
@media(prefers-reduced-motion:reduce){
  body.v2 .fx-aurora i,body.v2 .fx-ring,body.v2 .fx-spin,body.v2 .fx-sat i,body.v2 .fx-core,body.v2 .fx-live .fx-n.on .fx-b,body.v2 .fx-mxw .fx-c,body.v2 .fx-mxw .fx-c:after,body.v2 .mh-pills li,body.v2 .mh-steps li:before,body.v2 .mh-c header,body.v2 .mh-c .mh-d{animation:none!important}
  body.v2 .fx-b,body.v2 .fx-c,body.v2 .fx-line i,body.v2 .mh-pills li,body.v2 .mh-res{transition:none!important}
  body.v2 .fx-c:hover,body.v2 .fx-a:hover .fx-b,body.v2 .mh-pills li:hover{transform:none}
}
