@import url("./design-tokens.css");

*{box-sizing:border-box}
html{background:var(--ra-canvas);color:var(--ra-text-1);font-family:var(--ra-font-sans)}
body{margin:0;min-width:320px;background:var(--ra-canvas);color:var(--ra-text-1)}
button,input,select{font:inherit}
button{color:inherit}
button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--ra-primary);outline-offset:3px}
.ra-app{width:min(var(--ra-content-max),calc(100% - 28px));margin:0 auto;min-height:100vh}
.ra-header{min-height:74px;display:grid;grid-template-columns:minmax(270px,1fr) auto minmax(270px,1fr);align-items:center;gap:20px;border-bottom:1px solid var(--ra-border);position:sticky;top:0;z-index:50;background:color-mix(in srgb,var(--ra-canvas) 92%,transparent);backdrop-filter:blur(16px)}
.ra-brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none;min-width:0}
.ra-brand-mark{width:38px;height:38px;color:var(--ra-primary)}
.ra-brand-icon{display:block;width:100%;height:100%;object-fit:contain}
.ra-brand-mark svg{width:100%;height:100%}
.ra-brand-mark circle,.ra-brand-mark path{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.ra-brand-copy{display:flex;flex-direction:column;min-width:0}
.ra-brand-copy strong{font-size:20px;letter-spacing:-.035em;white-space:nowrap}
.ra-brand-copy em{font-style:normal;color:var(--ra-critical)}
.ra-brand-copy small{margin-top:2px;color:var(--ra-text-3);font-size:9px;letter-spacing:.12em;text-transform:uppercase}
.ra-nav{display:flex;align-self:stretch}
.ra-nav-tab{min-width:132px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--ra-text-3);font-weight:700;font-size:12px;cursor:pointer;transition:color var(--ra-duration-fast) var(--ra-ease-standard),border-color var(--ra-duration-fast) var(--ra-ease-standard)}
.ra-nav-tab:hover{color:var(--ra-text-1)}
.ra-nav-tab.is-active{color:var(--ra-text-1);border-bottom-color:var(--ra-primary)}
.ra-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px}
.ra-system-label{color:var(--ra-teal);font-size:9px;font-weight:800;letter-spacing:.1em}
.ra-theme-toggle{min-height:38px;display:flex;align-items:center;gap:7px;padding:0 10px;border:1px solid var(--ra-border);border-radius:999px;background:var(--ra-surface);cursor:pointer;color:var(--ra-text-3);font-size:9px;font-weight:700}
.ra-theme-toggle i{position:relative;width:34px;height:18px;border-radius:999px;background:var(--ra-surface-raised);box-shadow:inset 0 0 0 1px var(--ra-border-strong)}
.ra-theme-toggle i:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background:var(--ra-primary);transition:transform var(--ra-duration-base) var(--ra-ease-standard)}
[data-ra-theme="light"] .ra-theme-toggle i:after{transform:translateX(16px)}
.ra-main{padding:18px 0 28px}
.ra-view{display:none;min-height:calc(100vh - 132px)}
.ra-view.is-active{display:grid}
.ra-kicker{color:var(--ra-primary);font-size:10px;font-weight:850;letter-spacing:.14em}
.ra-view h1,.ra-view h2{margin:0;letter-spacing:-.045em}
.ra-view p{color:var(--ra-text-2);line-height:1.6}
#simulation{grid-template-columns:minmax(300px,var(--ra-rail-simulation)) minmax(0,1fr);gap:18px}
.ra-rail,.ra-controls,.ra-canvas-shell,.ra-lab-workspace,.ra-evidence-map,.ra-model-facts{border:1px solid var(--ra-border);background:var(--ra-surface);box-shadow:var(--ra-shadow-panel)}
.ra-rail{padding:30px 28px;display:flex;flex-direction:column;min-height:690px;border-radius:var(--ra-radius-md)}
.ra-rail h1{margin-top:14px;font-size:var(--ra-h1);line-height:1.05}
.ra-rail>p{margin:16px 0 24px}
.ra-rail-metrics{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--ra-border);border-bottom:1px solid var(--ra-border)}
.ra-rail-metrics>div{padding:14px 8px;border-right:1px solid var(--ra-border)}
.ra-rail-metrics>div:last-child{border-right:0}
.ra-rail-metrics span,.ra-outcome-strip span,.ra-compare-strip span{display:block;color:var(--ra-text-3);font-size:9px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.ra-rail-metrics b{display:block;margin-top:5px;font-size:18px}
.ra-primary-action{margin-top:26px;min-height:52px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;border:0;border-radius:var(--ra-radius-sm);background:var(--ra-primary);color:#fff;font-weight:800;cursor:pointer;box-shadow:0 12px 28px color-mix(in srgb,var(--ra-primary) 14%,transparent)}
.ra-scene-list{display:grid;margin-top:auto;border-top:1px solid var(--ra-border)}
.ra-scene-list button{display:grid;grid-template-columns:34px 1fr;align-items:center;min-height:44px;border:0;border-bottom:1px solid var(--ra-border);background:transparent;color:var(--ra-text-3);text-align:left;cursor:pointer}
.ra-scene-list button span{font-size:9px}
.ra-scene-list button b{font-size:11px;font-weight:700}
.ra-scene-list button.is-active{color:var(--ra-text-1)}
.ra-scene-list button.is-active span{color:var(--ra-primary)}
.ra-canvas-shell,.ra-lab-workspace{display:flex;flex-direction:column;min-width:0;border-radius:var(--ra-radius-md);overflow:hidden}
.ra-canvas-toolbar{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;border-bottom:1px solid var(--ra-border)}
.ra-canvas-toolbar>div:first-child{display:flex;flex-direction:column;gap:4px}
.ra-canvas-toolbar span{color:var(--ra-text-3);font-size:9px;font-weight:800;letter-spacing:.1em}
.ra-canvas-toolbar b{font-size:13px}
.ra-status-pills{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.ra-status-pills span{padding:6px 8px;border:1px solid var(--ra-border);border-radius:999px;color:var(--ra-text-2);font-size:9px;letter-spacing:0}
.ra-status-pills .stable{color:var(--ra-teal);border-color:color-mix(in srgb,var(--ra-teal) 28%,var(--ra-border))}
.ra-earth-mount{position:relative;flex:1;min-height:520px;display:grid;place-items:center;overflow:hidden;background:radial-gradient(circle at 54% 46%,color-mix(in srgb,var(--ra-primary) 7%,transparent),transparent 34%),linear-gradient(var(--ra-border) 1px,transparent 1px),linear-gradient(90deg,var(--ra-border) 1px,transparent 1px);background-size:auto,48px 48px,48px 48px}
.ra-earth-placeholder{position:absolute;width:min(460px,64%);aspect-ratio:1;border:1px solid color-mix(in srgb,var(--ra-primary) 35%,transparent);border-radius:50%;opacity:.44}
.ra-grid-globe{position:absolute;inset:9%;border-radius:50%;background:repeating-radial-gradient(circle at 50%,transparent 0 28px,color-mix(in srgb,var(--ra-primary) 14%,transparent) 29px 30px),repeating-linear-gradient(90deg,transparent 0 34px,color-mix(in srgb,var(--ra-primary) 11%,transparent) 35px 36px);box-shadow:inset 0 0 70px color-mix(in srgb,var(--ra-primary) 9%,transparent)}
.ra-orbit{position:absolute;inset:24%;border:1px solid color-mix(in srgb,var(--ra-teal) 34%,transparent);border-radius:50%;transform:scaleX(1.5) rotate(-18deg)}
.ra-provider-dot{position:absolute;width:12px;height:12px;border-radius:50%;box-shadow:0 0 16px currentColor}
.ra-provider-dot.blue{left:21%;top:44%;background:var(--ra-provider-blue);color:var(--ra-provider-blue)}
.ra-provider-dot.orange{right:27%;top:31%;background:var(--ra-provider-orange);color:var(--ra-provider-orange)}
.ra-provider-dot.green{right:15%;bottom:29%;background:var(--ra-provider-green);color:var(--ra-provider-green)}
.ra-earth-empty{position:relative;z-index:2;max-width:320px;padding:18px 20px;border:1px solid var(--ra-border);border-radius:var(--ra-radius-sm);background:color-mix(in srgb,var(--ra-surface) 88%,transparent);backdrop-filter:blur(8px);text-align:center}
.ra-earth-empty span{display:block;color:var(--ra-primary);font-size:9px;font-weight:850;letter-spacing:.12em}
.ra-earth-empty strong{display:block;margin-top:7px;font-size:18px}
.ra-earth-empty small{display:block;margin-top:8px;color:var(--ra-text-3);font-size:11px;line-height:1.45}
.ra-outcome-strip{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--ra-border)}
.ra-outcome-strip article{padding:16px 18px;border-right:1px solid var(--ra-border)}
.ra-outcome-strip article:last-child{border-right:0}
.ra-outcome-strip b{display:block;margin-top:5px;font-size:24px}
.ra-outcome-strip small{display:block;margin-top:4px;color:var(--ra-text-3);font-size:9px}
#lab{grid-template-columns:minmax(300px,var(--ra-rail-lab)) minmax(0,1fr);gap:18px}
.ra-controls{padding:28px 24px;border-radius:var(--ra-radius-md)}
.ra-controls h2{margin-top:12px;font-size:var(--ra-h2)}
.ra-controls label{display:block;margin-top:22px;color:var(--ra-text-2);font-size:12px}
.ra-controls label>span{display:flex;justify-content:space-between;gap:12px;margin-bottom:9px}
.ra-controls label b{color:var(--ra-primary)}
.ra-controls select{width:100%;min-height:44px;padding:0 12px;border:1px solid var(--ra-border-strong);border-radius:var(--ra-radius-xs);background:var(--ra-surface-raised);color:var(--ra-text-1)}
.ra-controls input[type="range"]{width:100%;accent-color:var(--ra-primary)}
.ra-control-note{margin-top:26px;padding:14px 0;border-top:1px solid var(--ra-border);border-bottom:1px solid var(--ra-border)}
.ra-control-note span{display:block;color:var(--ra-text-3);font-size:9px;letter-spacing:.1em}
.ra-control-note b{display:block;margin-top:5px}
.ra-control-note small{display:block;margin-top:5px;color:var(--ra-text-3);line-height:1.45}
.ra-earth-mount-lab{min-height:460px}
.ra-compare-strip{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--ra-border)}
.ra-compare-strip article{padding:14px 18px;border-right:1px solid var(--ra-border)}
.ra-compare-strip article:last-child{border-right:0}
.ra-compare-strip b{display:block;margin-top:4px;font-size:20px}
.ra-compare-strip .is-accent b{color:var(--ra-teal)}
#evidence{display:none}
#evidence.is-active{display:block}
.ra-evidence-head{padding:30px 4px 22px}
.ra-evidence-head h2{margin-top:10px;font-size:var(--ra-h2)}
.ra-evidence-head p{max-width:820px;margin-bottom:0}
.ra-evidence-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr);gap:18px}
.ra-evidence-map{border-radius:var(--ra-radius-md);overflow:hidden}
.ra-earth-mount-evidence{min-height:510px}
.ra-model-facts{border-radius:var(--ra-radius-md);overflow:hidden}
.ra-model-facts article{padding:18px;border-bottom:1px solid var(--ra-border)}
.ra-model-facts article:last-child{border-bottom:0}
.ra-model-facts span{display:block;color:var(--ra-text-3);font-size:9px;text-transform:uppercase;letter-spacing:.08em}
.ra-model-facts b{display:block;margin-top:5px;font-size:13px}
.ra-causal-chain{margin-top:18px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px;border:1px solid var(--ra-border);border-radius:var(--ra-radius-md);background:var(--ra-surface);overflow:auto}
.ra-causal-chain span{white-space:nowrap;color:var(--ra-text-2);font-size:11px;font-weight:700}
.ra-causal-chain i{color:var(--ra-primary);font-style:normal}
.ra-footer{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--ra-border);color:var(--ra-text-3);font-size:9px}

[data-ra-theme="light"] .ra-brand-copy em{color:var(--ra-critical)}
[data-ra-theme="light"] .ra-earth-mount{background:radial-gradient(circle at 54% 46%,rgba(22,119,232,.06),transparent 34%),linear-gradient(var(--ra-border) 1px,transparent 1px),linear-gradient(90deg,var(--ra-border) 1px,transparent 1px);background-size:auto,48px 48px,48px 48px}

@media(max-width:1199px){
  .ra-header{grid-template-columns:1fr auto;grid-template-areas:"brand actions" "nav nav";padding-top:8px}
  .ra-brand{grid-area:brand}.ra-header-actions{grid-area:actions}.ra-nav{grid-area:nav}
  .ra-nav-tab{flex:1;min-height:46px}
  #simulation,#lab{grid-template-columns:1fr}
  .ra-rail{min-height:auto}
  .ra-scene-list{grid-template-columns:repeat(6,1fr);margin-top:24px}
  .ra-scene-list button{grid-template-columns:1fr;justify-items:center;text-align:center;padding:8px 4px}
  .ra-scene-list button b{font-size:9px}
  .ra-evidence-grid{grid-template-columns:1fr}
}

@media(max-width:767px){
  .ra-app{width:min(100% - 16px,var(--ra-content-max))}
  .ra-header{position:relative;gap:6px}
  .ra-brand-mark{width:32px;height:32px}
  .ra-brand-copy strong{font-size:15px}
  .ra-brand-copy small,.ra-system-label{display:none}
  .ra-theme-toggle{padding-inline:8px}.ra-theme-toggle>span{display:none}
  .ra-nav{overflow:auto;scrollbar-width:none}.ra-nav::-webkit-scrollbar{display:none}
  .ra-nav-tab{min-width:120px;font-size:10px}
  .ra-main{padding-top:10px}
  .ra-rail,.ra-controls{padding:20px 16px}
  .ra-rail h1{font-size:32px}
  .ra-rail-metrics{grid-template-columns:repeat(3,1fr)}
  .ra-earth-mount{min-height:430px}
  .ra-earth-placeholder{width:88%}
  .ra-earth-empty{max-width:260px}
  .ra-outcome-strip{grid-template-columns:repeat(2,1fr)}
  .ra-outcome-strip article:nth-child(2){border-right:0}
  .ra-outcome-strip article:nth-child(-n+2){border-bottom:1px solid var(--ra-border)}
  .ra-scene-list{grid-template-columns:repeat(3,1fr)}
  .ra-compare-strip{grid-template-columns:1fr}
  .ra-compare-strip article{border-right:0;border-bottom:1px solid var(--ra-border)}
  .ra-compare-strip article:last-child{border-bottom:0}
  .ra-causal-chain{justify-content:flex-start}
  .ra-footer{flex-direction:column;align-items:flex-start;justify-content:center;padding:12px 0}
}

@media(max-width:429px){
  .ra-app{width:100%}
  .ra-header,.ra-main,.ra-footer{padding-left:10px;padding-right:10px}
  .ra-brand-copy strong{font-size:14px}
  .ra-rail,.ra-controls,.ra-canvas-shell,.ra-lab-workspace,.ra-evidence-map,.ra-model-facts{border-radius:0}
  .ra-earth-mount{min-height:390px}
  .ra-earth-empty{max-width:230px;padding:14px}
  .ra-outcome-strip b{font-size:20px}
  .ra-scene-list button b{font-size:8px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}


/* =========================================================
   STAGE 3 — SHARED EARTH SYSTEM ENGINE
   One reusable map for Simulation / Lab / Model & Evidence.
   ========================================================= */

.ra-earth-system{
  --ra-earth-ocean-core:#0d2438;
  --ra-earth-ocean:#091927;
  --ra-earth-rim:#050d16;
  position:relative;
  isolation:isolate;
  padding:0!important;
  display:block!important;
  background:
    radial-gradient(circle at 50% 46%,rgba(53,167,255,.075),transparent 34%),
    linear-gradient(rgba(145,170,195,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(145,170,195,.06) 1px,transparent 1px),
    var(--ra-surface-soft)!important;
  background-size:auto,48px 48px,48px 48px!important;
}

.ra-earth-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  user-select:none;
}
.ra-earth-atmosphere{
  fill:none;
  stroke:color-mix(in srgb,var(--ra-primary) 26%,transparent);
  stroke-width:1.2;
  filter:drop-shadow(0 0 18px color-mix(in srgb,var(--ra-primary) 12%,transparent));
}
.ra-earth-ocean{
  stroke:color-mix(in srgb,var(--ra-primary) 20%,transparent);
  stroke-width:1;
}
.ra-earth-grid ellipse,
.ra-earth-grid path{
  fill:none;
  stroke:color-mix(in srgb,var(--ra-primary) 11%,transparent);
  stroke-width:.8;
  vector-effect:non-scaling-stroke;
}
.ra-earth-land path{
  fill:color-mix(in srgb,var(--ra-primary) 6%,var(--ra-surface-raised));
  stroke:color-mix(in srgb,var(--ra-primary) 18%,var(--ra-border));
  stroke-width:1;
  vector-effect:non-scaling-stroke;
}

.ra-earth-link,
.ra-request-flow,
.ra-recovery-flow{
  fill:none;
  vector-effect:non-scaling-stroke;
  transition:
    opacity var(--ra-duration-base) var(--ra-ease-standard),
    stroke var(--ra-duration-base) var(--ra-ease-standard),
    stroke-width var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-earth-link{
  stroke:var(--provider-color,var(--ra-primary));
  stroke-width:1.15;
  opacity:.22;
}
.provider-blue{--provider-color:var(--ra-provider-blue)}
.provider-orange{--provider-color:var(--ra-provider-orange)}
.provider-green{--provider-color:var(--ra-provider-green)}

.ra-earth-link.is-focus{
  opacity:.5;
  stroke-width:1.4;
}
.ra-earth-link.is-disrupted{
  stroke:var(--ra-critical);
  stroke-dasharray:3 8;
  opacity:.18;
}

.ra-earth-packet{
  fill:var(--provider-color,var(--ra-primary));
  opacity:.7;
  filter:drop-shadow(0 0 4px var(--provider-color,var(--ra-primary)));
  transition:opacity var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-earth-packet.is-hidden{opacity:0}

.ra-earth-provider{
  color:var(--provider-color,var(--ra-primary));
  transition:opacity var(--ra-duration-base) var(--ra-ease-standard),filter var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-provider-halo{
  fill:color-mix(in srgb,var(--provider-color) 7%,transparent);
  stroke:color-mix(in srgb,var(--provider-color) 28%,transparent);
  stroke-width:1;
}
.ra-provider-core{
  fill:var(--provider-color);
  filter:drop-shadow(0 0 6px var(--provider-color));
}
.ra-provider-cloud{
  fill:color-mix(in srgb,var(--ra-surface) 84%,transparent);
  stroke:var(--provider-color);
  stroke-width:1.6;
  vector-effect:non-scaling-stroke;
}
.ra-provider-label{
  fill:var(--ra-text-1);
  font-size:12px;
  font-weight:760;
}
.ra-provider-sub{
  fill:var(--ra-text-3);
  font-size:8px;
  letter-spacing:.04em;
}
.ra-earth-provider.is-focus .ra-provider-halo{
  stroke-width:1.6;
  fill:color-mix(in srgb,var(--provider-color) 13%,transparent);
}
.ra-earth-provider.is-outage{
  color:var(--ra-critical);
  --provider-color:var(--ra-critical);
  opacity:.74;
}
.ra-earth-provider.is-outage .ra-provider-core{
  animation:raProviderShock .7s var(--ra-ease-emphasis) 1;
}

.ra-earth-bank{
  --node-color:var(--ra-provider-blue);
  transition:opacity var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-earth-bank[data-provider="orange"]{--node-color:var(--ra-provider-orange)}
.ra-earth-bank[data-provider="green"]{--node-color:var(--ra-provider-green)}
.ra-bank-halo{
  fill:color-mix(in srgb,var(--node-color) 5%,transparent);
  stroke:transparent;
  stroke-width:1;
}
.ra-bank-node{
  fill:var(--ra-surface);
  stroke:var(--node-color);
  stroke-width:1.6;
  vector-effect:non-scaling-stroke;
  transition:fill var(--ra-duration-base) var(--ra-ease-standard),stroke var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-bank-label{
  fill:var(--ra-text-3);
  font-size:7px;
  font-weight:700;
  opacity:.72;
}
.ra-bank-reserve{
  fill:none;
  stroke:var(--ra-teal);
  stroke-width:1;
  stroke-dasharray:2 3;
  opacity:0;
  transform-origin:center;
}
.ra-earth-bank.show-reserve .ra-bank-reserve{
  opacity:.55;
}
.ra-earth-bank.is-affected .ra-bank-node,
.ra-earth-bank.is-critical .ra-bank-node{
  fill:var(--ra-critical);
  stroke:var(--ra-critical);
  filter:drop-shadow(0 0 5px color-mix(in srgb,var(--ra-critical) 72%,transparent));
}
.ra-earth-bank.is-affected .ra-bank-halo,
.ra-earth-bank.is-critical .ra-bank-halo{
  fill:color-mix(in srgb,var(--ra-critical) 11%,transparent);
  stroke:color-mix(in srgb,var(--ra-critical) 35%,transparent);
}
.ra-earth-bank.is-shortage .ra-bank-node,
.ra-earth-bank.is-stranded .ra-bank-node{
  fill:var(--ra-warning);
  stroke:var(--ra-warning);
}
.ra-earth-bank.is-shortage .ra-bank-halo,
.ra-earth-bank.is-stranded .ra-bank-halo{
  fill:color-mix(in srgb,var(--ra-warning) 10%,transparent);
  stroke:color-mix(in srgb,var(--ra-warning) 30%,transparent);
}
.ra-earth-bank.is-recovering .ra-bank-halo{
  fill:color-mix(in srgb,var(--ra-teal) 8%,transparent);
  stroke:color-mix(in srgb,var(--ra-teal) 27%,transparent);
}
.ra-earth-bank.is-recovered .ra-bank-node{
  fill:var(--ra-green);
  stroke:var(--ra-green);
  filter:drop-shadow(0 0 5px color-mix(in srgb,var(--ra-green) 55%,transparent));
}
.ra-earth-bank.is-partial .ra-bank-node{
  fill:var(--ra-warning);
  stroke:var(--ra-warning);
}

.ra-request-flow{
  stroke:var(--ra-warning);
  stroke-width:1.15;
  stroke-dasharray:2 7;
  opacity:0;
}
.ra-request-flow.is-visible{
  opacity:calc(.18 + var(--ra-market-strength,.4) * .42);
  animation:raFlowPackets 6s linear infinite;
}

.ra-recovery-flow{
  stroke:var(--ra-teal);
  stroke-width:calc(1px + var(--ra-flow-restored,.5) * 1.35px);
  stroke-dasharray:1 8;
  stroke-linecap:round;
  opacity:0;
}
.ra-recovery-flow.is-visible{
  opacity:calc(.2 + var(--ra-reserve-strength,.4) * .58);
  animation:raFlowPackets 7.8s linear infinite;
}

.ra-pool-node{
  opacity:0;
  transition:opacity var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-pool-node.is-visible{opacity:1}
.ra-pool-ring{
  fill:color-mix(in srgb,var(--ra-teal) 5%,transparent);
  stroke:color-mix(in srgb,var(--ra-teal) 45%,transparent);
  stroke-width:1;
  stroke-dasharray:3 4;
}
.ra-pool-core{
  fill:var(--ra-teal);
  filter:drop-shadow(0 0 6px color-mix(in srgb,var(--ra-teal) 65%,transparent));
}
.ra-pool-node text{
  text-anchor:middle;
  fill:var(--ra-teal);
  font-size:8px;
  font-weight:800;
  letter-spacing:.08em;
}
.ra-pool-node text.sub{
  fill:var(--ra-text-3);
  font-size:7px;
  font-weight:600;
}
.ra-pool-node.is-active .ra-pool-ring{
  animation:raPoolBreath 2.8s ease-in-out infinite;
}

.ra-earth-overlay{
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
}
.ra-earth-state{
  position:absolute;
  left:18px;
  top:16px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.ra-earth-state span,
.ra-earth-readout span{
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-earth-state b{
  color:var(--ra-text-1);
  font-size:12px;
}
.ra-earth-readout{
  position:absolute;
  top:14px;
  right:16px;
  display:flex;
  gap:0;
  border:1px solid var(--ra-border);
  background:color-mix(in srgb,var(--ra-surface) 78%,transparent);
  backdrop-filter:blur(8px);
  border-radius:var(--ra-radius-xs);
}
.ra-earth-readout>div{
  min-width:92px;
  padding:8px 10px;
  border-right:1px solid var(--ra-border);
}
.ra-earth-readout>div:last-child{border-right:0}
.ra-earth-readout b{
  display:block;
  margin-top:3px;
  color:var(--ra-text-1);
  font-size:13px;
}
.ra-earth-disclaimer{
  position:absolute;
  left:18px;
  bottom:14px;
  color:var(--ra-text-3);
  font-size:8px;
  letter-spacing:.035em;
}

.ra-earth-scale text{
  fill:var(--ra-text-3);
  font-size:7px;
}
.ra-earth-scale .normal{fill:var(--ra-primary)}
.ra-earth-scale .affected{fill:var(--ra-critical)}
.ra-earth-scale .recovering{fill:var(--ra-teal)}

.ra-earth-annotations path{
  fill:none;
  stroke:var(--ra-border-strong);
  stroke-width:1;
  vector-effect:non-scaling-stroke;
}
.ra-earth-annotations text{
  fill:var(--ra-text-1);
  font-size:9px;
  font-weight:800;
  letter-spacing:.05em;
}
.ra-earth-annotations text.sub{
  fill:var(--ra-text-3);
  font-size:7.5px;
  font-weight:600;
  letter-spacing:0;
}

.ra-earth-system.has-shock{
  background:
    radial-gradient(circle at 53% 46%,color-mix(in srgb,var(--ra-critical) 5%,transparent),transparent 24%),
    linear-gradient(rgba(145,170,195,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(145,170,195,.06) 1px,transparent 1px),
    var(--ra-surface-soft)!important;
  background-size:auto,48px 48px,48px 48px!important;
}
.ra-earth-system.has-recovery{
  background:
    radial-gradient(circle at 50% 48%,color-mix(in srgb,var(--ra-teal) 6%,transparent),transparent 25%),
    linear-gradient(rgba(145,170,195,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(145,170,195,.06) 1px,transparent 1px),
    var(--ra-surface-soft)!important;
  background-size:auto,48px 48px,48px 48px!important;
}

[data-ra-theme="light"] .ra-earth-system{
  --ra-earth-ocean-core:#d8efff;
  --ra-earth-ocean:#e9f6ff;
  --ra-earth-rim:#d3e6f5;
  background:
    radial-gradient(circle at 50% 46%,rgba(22,119,232,.045),transparent 34%),
    linear-gradient(rgba(120,150,180,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(120,150,180,.08) 1px,transparent 1px),
    #f8fbff!important;
  background-size:auto,48px 48px,48px 48px!important;
}
[data-ra-theme="light"] .ra-earth-land path{
  fill:#dceaf5;
  stroke:#b8cfdf;
}
[data-ra-theme="light"] .ra-earth-grid ellipse,
[data-ra-theme="light"] .ra-earth-grid path{
  stroke:rgba(22,119,232,.12);
}
[data-ra-theme="light"] .ra-bank-node{
  fill:#fff;
}
[data-ra-theme="light"] .ra-earth-readout{
  background:rgba(255,255,255,.82);
}
[data-ra-theme="light"] .ra-earth-system.has-shock{
  background:
    radial-gradient(circle at 53% 46%,rgba(229,72,91,.055),transparent 24%),
    linear-gradient(rgba(120,150,180,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(120,150,180,.08) 1px,transparent 1px),
    #f8fbff!important;
  background-size:auto,48px 48px,48px 48px!important;
}
[data-ra-theme="light"] .ra-earth-system.has-recovery{
  background:
    radial-gradient(circle at 50% 48%,rgba(19,184,154,.055),transparent 25%),
    linear-gradient(rgba(120,150,180,.08) 1px,transparent 1px),
    linear-gradient(90deg,rgba(120,150,180,.08) 1px,transparent 1px),
    #f8fbff!important;
  background-size:auto,48px 48px,48px 48px!important;
}

@keyframes raFlowPackets{
  to{stroke-dashoffset:-72}
}
@keyframes raProviderShock{
  0%{transform:scale(1);opacity:1}
  45%{transform:scale(1.65);opacity:.55}
  100%{transform:scale(1);opacity:1}
}
@keyframes raPoolBreath{
  50%{transform:scale(1.08);opacity:.72}
}

@media(max-width:1199px){
  .ra-earth-provider-label{font-size:10px}
  .ra-earth-readout>div{min-width:80px}
}

@media(max-width:767px){
  .ra-earth-svg{
    transform:scale(1.12);
    transform-origin:50% 48%;
  }
  .ra-earth-state{
    left:10px;
    top:10px;
  }
  .ra-earth-readout{
    top:9px;
    right:9px;
  }
  .ra-earth-readout>div{
    min-width:64px;
    padding:6px 7px;
  }
  .ra-earth-readout>div:nth-child(2){display:none}
  .ra-earth-readout span{font-size:6.5px}
  .ra-earth-readout b{font-size:11px}
  .ra-earth-disclaimer{
    left:10px;
    bottom:9px;
    max-width:170px;
  }
  .ra-provider-label{font-size:10px}
  .ra-provider-sub{font-size:6.5px}
  .ra-bank-label{display:none}
  .ra-earth-scale{display:none}
  .ra-earth-annotations{display:none}
}

@media(max-width:429px){
  .ra-earth-svg{
    transform:scale(1.28);
    transform-origin:50% 48%;
  }
  .ra-earth-state b{font-size:10px}
  .ra-earth-disclaimer{font-size:6.5px}
}

@media(prefers-reduced-motion:reduce){
  .ra-earth-packet{display:none}
  .ra-request-flow.is-visible,
  .ra-recovery-flow.is-visible,
  .ra-pool-node.is-active .ra-pool-ring,
  .ra-earth-provider.is-outage .ra-provider-core{
    animation:none!important;
  }
}


/* =========================================================
   STAGE 4 — GUIDED SIMULATION
   One Earth, six states, one continuous narrated story.
   ========================================================= */

.ra-story-rail{
  position:relative;
  overflow:hidden;
  transition:
    width var(--ra-duration-slow) var(--ra-ease-standard),
    opacity var(--ra-duration-base) var(--ra-ease-standard),
    border-color var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-story-rail:before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg,color-mix(in srgb,var(--ra-primary) 3%,transparent),transparent 36%);
}
.ra-story-head{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.ra-scene-counter{
  color:var(--ra-text-3);
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
}
.ra-story-copy{
  position:relative;
  z-index:1;
  margin-top:36px;
}
.ra-story-kicker{
  display:block;
  color:var(--ra-primary);
  font-size:9px;
  font-weight:850;
  letter-spacing:.12em;
}
.ra-story-copy h1{
  margin-top:10px!important;
  max-width:9.5ch;
  font-size:clamp(2.15rem,3.2vw,3.2rem)!important;
  line-height:.98!important;
}
.ra-story-copy p{
  max-width:36ch;
  margin:16px 0 0!important;
  font-size:13px;
  line-height:1.58!important;
}

.ra-story-stat{
  position:relative;
  z-index:1;
  margin-top:26px;
  padding:14px 0;
  border-top:1px solid var(--ra-border);
  border-bottom:1px solid var(--ra-border);
}
.ra-story-stat span{
  display:block;
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-story-stat b{
  display:block;
  margin-top:5px;
  color:var(--ra-text-1);
  font-size:18px;
  line-height:1.25;
}

.ra-sim-controls{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  margin-top:20px;
}
.ra-sim-controls .ra-primary-action{
  margin-top:0!important;
  min-width:0;
}
.ra-quiet-action{
  min-width:104px;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 12px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-raised);
  color:var(--ra-text-2);
  font-size:9px;
  font-weight:760;
  cursor:pointer;
}
.ra-quiet-action[aria-pressed="true"]{
  color:var(--ra-primary);
  border-color:color-mix(in srgb,var(--ra-primary) 26%,var(--ra-border));
}
.ra-speaker-icon{
  font-size:10px;
  letter-spacing:-.12em;
}

.ra-story-rail .ra-scene-list{
  position:relative;
  z-index:1;
  margin-top:22px;
}
.ra-story-note{
  position:relative;
  z-index:1;
  margin-top:auto;
  padding-top:18px;
  color:var(--ra-text-3);
  transition:opacity var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-story-note span{
  display:block;
  font-size:8px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-story-note p{
  margin:5px 0 0!important;
  font-size:10px!important;
  line-height:1.45!important;
}

/* Timeline / narration HUD visually sits on the Earth without replacing it. */
.ra-guided-hud{
  position:relative;
  z-index:12;
  width:calc(100% - 32px);
  min-height:96px;
  margin:-112px 16px 16px;
  border:1px solid var(--ra-border-strong);
  border-radius:var(--ra-radius-sm);
  background:color-mix(in srgb,var(--ra-surface) 84%,transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  box-shadow:0 16px 36px rgba(0,0,0,.18);
  overflow:hidden;
  transition:
    border-color var(--ra-duration-base) var(--ra-ease-standard),
    background var(--ra-duration-base) var(--ra-ease-standard),
    transform var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-guided-status{
  min-height:27px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
  padding:5px 12px;
  border-bottom:1px solid var(--ra-border);
}
.ra-guided-status b,
.ra-guided-status span{
  font-size:8px;
  letter-spacing:.08em;
}
.ra-guided-status b{
  color:var(--ra-text-2);
}
.ra-guided-status span:last-child{
  color:var(--ra-text-3);
}
.ra-guided-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--ra-text-3);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--ra-text-3) 35%,transparent);
}
.ra-guided-main{
  display:grid;
  grid-template-columns:92px minmax(0,1fr);
  gap:12px;
  align-items:center;
  min-height:61px;
  padding:8px 12px 11px;
}
.ra-waveform{
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding-right:12px;
  border-right:1px solid var(--ra-border);
}
.ra-waveform i{
  display:block;
  width:2px;
  height:7px;
  border-radius:99px;
  background:var(--ra-primary);
  opacity:.34;
}
.ra-guided-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.ra-guided-copy span{
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
  letter-spacing:.11em;
}
.ra-guided-copy strong{
  max-width:72ch;
  color:var(--ra-text-1);
  font-size:12px;
  line-height:1.35;
}
.ra-guided-progress{
  position:absolute;
  left:12px;
  right:12px;
  bottom:0;
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:4px;
  height:2px;
}
.ra-guided-progress i{
  background:var(--ra-border-strong);
}
.ra-guided-progress i.is-done{
  background:color-mix(in srgb,var(--ra-primary) 44%,var(--ra-border-strong));
}
.ra-guided-progress i.is-active{
  background:var(--ra-primary);
  box-shadow:0 0 8px color-mix(in srgb,var(--ra-primary) 58%,transparent);
}

/* Running mode: remove peripheral noise, not useful context. */
body.ra-guided-running .ra-story-rail{
  border-color:color-mix(in srgb,var(--ra-primary) 27%,var(--ra-border));
}
body.ra-guided-running .ra-story-note{
  opacity:.34;
}
body.ra-guided-running .ra-scene-list button:not(.is-active){
  opacity:.42;
}
body.ra-guided-running .ra-scene-list button{
  pointer-events:none;
}
body.ra-guided-running .ra-guided-hud{
  border-color:color-mix(in srgb,var(--ra-primary) 34%,var(--ra-border-strong));
  background:color-mix(in srgb,var(--ra-surface) 78%,transparent);
}
body.ra-guided-running .ra-guided-dot{
  background:var(--ra-teal);
  box-shadow:0 0 9px color-mix(in srgb,var(--ra-teal) 60%,transparent);
  animation:raGuidedDot 1.45s ease-in-out infinite;
}
body.ra-guided-running .ra-earth-system[data-earth-mode="simulation"]{
  box-shadow:inset 0 0 50px color-mix(in srgb,var(--ra-primary) 3%,transparent);
}

/* Waveform moves only while actual narration is speaking. */
.ra-guided-hud.is-speaking .ra-waveform i{
  opacity:.84;
  animation:raVoiceWave 780ms ease-in-out infinite alternate;
}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(2){animation-delay:-.09s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(3){animation-delay:-.21s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(4){animation-delay:-.34s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(5){animation-delay:-.14s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(6){animation-delay:-.27s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(7){animation-delay:-.41s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(8){animation-delay:-.18s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(9){animation-delay:-.31s}
.ra-guided-hud.is-speaking .ra-waveform i:nth-child(10){animation-delay:-.06s}

/* Semantic scene accents stay subtle and local. */
#simulation:has(#raEarthMount[data-scene="1"]) .ra-story-kicker,
#simulation:has(#raEarthMount[data-scene="1"]) .ra-guided-copy span{
  color:var(--ra-critical);
}
#simulation:has(#raEarthMount[data-scene="2"]) .ra-story-kicker,
#simulation:has(#raEarthMount[data-scene="2"]) .ra-guided-copy span,
#simulation:has(#raEarthMount[data-scene="3"]) .ra-story-kicker,
#simulation:has(#raEarthMount[data-scene="3"]) .ra-guided-copy span{
  color:var(--ra-warning);
}
#simulation:has(#raEarthMount[data-scene="4"]) .ra-story-kicker,
#simulation:has(#raEarthMount[data-scene="4"]) .ra-guided-copy span,
#simulation:has(#raEarthMount[data-scene="5"]) .ra-story-kicker,
#simulation:has(#raEarthMount[data-scene="5"]) .ra-guided-copy span{
  color:var(--ra-teal);
}

[data-ra-theme="light"] .ra-guided-hud{
  background:rgba(255,255,255,.86);
  box-shadow:0 14px 32px rgba(28,72,115,.11);
}
[data-ra-theme="light"] .ra-story-rail:before{
  background:linear-gradient(180deg,rgba(22,119,232,.035),transparent 36%);
}

@keyframes raVoiceWave{
  from{height:6px}
  to{height:29px}
}
@keyframes raGuidedDot{
  50%{opacity:.5;transform:scale(.78)}
}

@media(min-width:1200px){
  body.ra-guided-running #simulation{
    grid-template-columns:minmax(290px,22%) minmax(0,1fr);
  }
}

@media(max-width:1199px){
  .ra-story-copy h1{
    max-width:18ch;
  }
  .ra-story-note{
    margin-top:20px;
  }
}

@media(max-width:767px){
  .ra-story-rail{
    order:2;
  }
  .ra-canvas-shell{
    order:1;
  }
  #simulation{
    display:grid;
  }
  .ra-story-copy{
    margin-top:20px;
  }
  .ra-story-copy h1{
    max-width:none;
    font-size:30px!important;
  }
  .ra-sim-controls{
    grid-template-columns:1fr;
  }
  .ra-quiet-action{
    min-height:44px;
  }
  .ra-story-rail .ra-scene-list{
    grid-template-columns:repeat(6,minmax(84px,1fr));
    overflow-x:auto;
    scrollbar-width:none;
  }
  .ra-story-rail .ra-scene-list::-webkit-scrollbar{display:none}
  .ra-guided-hud{
    width:calc(100% - 16px);
    margin:-104px 8px 8px;
    min-height:88px;
  }
  .ra-guided-main{
    grid-template-columns:56px minmax(0,1fr);
    gap:8px;
    min-height:56px;
    padding-inline:9px;
  }
  .ra-waveform{
    gap:2px;
    padding-right:7px;
  }
  .ra-waveform i{
    width:2px;
  }
  .ra-guided-copy strong{
    font-size:10.5px;
    line-height:1.3;
  }
  .ra-guided-status{
    padding-inline:9px;
  }
}

@media(max-width:429px){
  .ra-guided-status span:last-child{
    display:none;
  }
  .ra-guided-status{
    grid-template-columns:auto 1fr;
  }
  .ra-guided-main{
    grid-template-columns:42px minmax(0,1fr);
  }
  .ra-waveform{
    gap:1.5px;
  }
  .ra-guided-copy span{
    font-size:7px;
  }
  .ra-guided-copy strong{
    font-size:9.5px;
  }
}

@media(prefers-reduced-motion:reduce){
  body.ra-guided-running .ra-guided-dot,
  .ra-guided-hud.is-speaking .ra-waveform i{
    animation:none!important;
  }
}


/* =========================================================
   STAGE 5 — SCENARIO LAB
   Controls -> live Earth -> outcomes -> recovery comparison.
   ========================================================= */

.ra-lab-console{
  padding:24px 20px!important;
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:690px;
}
.ra-lab-console-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.ra-lab-console-head h2{
  margin-top:9px!important;
  font-size:clamp(1.65rem,2.15vw,2.15rem)!important;
  line-height:1.04;
}
.ra-lab-intro{
  margin:0 0 2px!important;
  color:var(--ra-text-2);
  font-size:12px;
  line-height:1.55;
}
.ra-reset-action{
  min-height:36px;
  padding:0 12px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:transparent;
  color:var(--ra-text-3);
  font-size:10px;
  font-weight:750;
  cursor:pointer;
}
.ra-reset-action:hover{
  color:var(--ra-text-1);
  border-color:var(--ra-border-strong);
}

.ra-control-group{
  border-top:1px solid var(--ra-border);
  padding-top:15px;
}
.ra-control-group>header{
  display:grid;
  grid-template-columns:28px 1fr;
  align-items:start;
  gap:9px;
  margin-bottom:13px;
}
.ra-control-group>header>span{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border:1px solid color-mix(in srgb,var(--ra-primary) 26%,var(--ra-border));
  border-radius:50%;
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
}
.ra-control-group>header div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.ra-control-group>header b{
  font-size:12px;
}
.ra-control-group>header small{
  color:var(--ra-text-3);
  font-size:9px;
}
.ra-field{
  display:block;
  margin-top:12px!important;
}
.ra-field>span{
  margin-bottom:7px!important;
  color:var(--ra-text-2);
  font-size:11px;
}
.ra-range-field input{
  margin:1px 0 0;
}
.ra-range-field>small{
  display:flex;
  justify-content:space-between;
  margin-top:2px;
  color:var(--ra-text-3);
}
.ra-range-field>small i{
  font-style:normal;
  font-size:7px;
}
.ra-inline-readout{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 11px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-surface-soft);
}
.ra-inline-readout span{
  color:var(--ra-text-3);
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.ra-inline-readout b{
  font-size:11px;
}
.ra-lab-console .ra-control-note{
  margin-top:auto!important;
}

.ra-lab-toolbar{
  min-height:62px;
}
.ra-lab-scenario-summary{
  display:flex;
  align-items:center;
  gap:0;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  overflow:hidden;
}
.ra-lab-scenario-summary>span{
  display:flex!important;
  flex-direction:column;
  gap:2px;
  min-width:78px;
  padding:6px 9px;
  border-right:1px solid var(--ra-border);
}
.ra-lab-scenario-summary>span:last-child{border-right:0}
.ra-lab-scenario-summary i{
  color:var(--ra-text-3);
  font-style:normal;
  font-size:7px;
  letter-spacing:.08em;
}
.ra-lab-scenario-summary b{
  color:var(--ra-text-1);
  font-size:10px!important;
}

.ra-lab-modebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:58px;
  padding:9px 14px;
  border-bottom:1px solid var(--ra-border);
  background:color-mix(in srgb,var(--ra-surface-raised) 44%,transparent);
}
.ra-lab-modebar>div:first-child{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.ra-lab-modebar>div:first-child span{
  color:var(--ra-text-2);
  font-size:8px;
  font-weight:850;
  letter-spacing:.09em;
}
.ra-lab-modebar>div:first-child small{
  color:var(--ra-text-3);
  font-size:9px;
}

.ra-strategy-switch{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  min-width:330px;
  border:1px solid var(--ra-border);
  border-radius:999px;
  overflow:hidden;
  background:var(--ra-surface);
}
.ra-strategy-switch button{
  min-height:36px;
  border:0;
  border-right:1px solid var(--ra-border);
  background:transparent;
  color:var(--ra-text-3);
  font-size:9px;
  font-weight:780;
  cursor:pointer;
}
.ra-strategy-switch button:last-child{border-right:0}
.ra-strategy-switch button.is-active{
  color:#fff;
  background:var(--ra-primary);
}
.ra-strategy-switch button[data-ra-strategy="individual"].is-active{
  background:var(--ra-orange);
}
.ra-strategy-switch button[data-ra-strategy="scfr"].is-active{
  background:var(--ra-teal);
}

.ra-earth-mount-lab{
  min-height:500px!important;
  transition:box-shadow var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-earth-mount-lab[data-lab-strategy="market"]{
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--ra-warning) 12%,transparent);
}
.ra-earth-mount-lab[data-lab-strategy="individual"]{
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--ra-orange) 16%,transparent);
}
.ra-earth-mount-lab[data-lab-strategy="scfr"]{
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--ra-teal) 18%,transparent);
}

.ra-lab-outcomes{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  border-top:1px solid var(--ra-border);
  border-bottom:1px solid var(--ra-border);
}
.ra-lab-outcomes article{
  min-width:0;
  padding:15px 16px;
  border-right:1px solid var(--ra-border);
}
.ra-lab-outcomes article:last-child{border-right:0}
.ra-lab-outcomes span{
  display:block;
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.08em;
}
.ra-lab-outcomes b{
  display:block;
  margin-top:5px;
  color:var(--ra-text-1);
  font-size:23px;
  letter-spacing:-.025em;
}
.ra-lab-outcomes small{
  display:block;
  margin-top:3px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.3;
}

.ra-model-compare{
  padding:16px;
  background:color-mix(in srgb,var(--ra-surface-raised) 34%,transparent);
}
.ra-model-compare>header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}
.ra-model-compare>header>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.ra-model-compare>header span{
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-model-compare>header b{
  font-size:13px;
}
.ra-model-compare>header>small{
  color:var(--ra-text-3);
  font-size:9px;
}

.ra-model-compare-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.ra-model-card{
  min-width:0;
  padding:14px;
  text-align:left;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface);
  color:var(--ra-text-1);
  cursor:pointer;
  transition:
    border-color var(--ra-duration-fast) var(--ra-ease-standard),
    transform var(--ra-duration-fast) var(--ra-ease-standard),
    background var(--ra-duration-fast) var(--ra-ease-standard);
}
.ra-model-card:hover{
  transform:translateY(-1px);
  border-color:var(--ra-border-strong);
}
.ra-model-card.is-active{
  border-color:color-mix(in srgb,var(--ra-primary) 55%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-primary) 5%,var(--ra-surface));
}
.ra-model-card[data-ra-compare="individual"].is-active{
  border-color:color-mix(in srgb,var(--ra-orange) 55%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-orange) 5%,var(--ra-surface));
}
.ra-model-card[data-ra-compare="scfr"].is-active{
  border-color:color-mix(in srgb,var(--ra-teal) 55%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-teal) 5%,var(--ra-surface));
}
.ra-model-card>span{
  display:block;
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.07em;
}
.ra-model-card>strong{
  display:block;
  margin-top:6px;
  font-size:30px;
  line-height:1;
  letter-spacing:-.035em;
}
.ra-score-track{
  height:3px;
  margin:11px 0;
  border-radius:99px;
  background:var(--ra-border);
  overflow:hidden;
}
.ra-score-track i{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:var(--ra-primary);
  transition:width var(--ra-duration-base) var(--ra-ease-standard);
}
.ra-model-card[data-ra-compare="individual"] .ra-score-track i{background:var(--ra-orange)}
.ra-model-card[data-ra-compare="scfr"] .ra-score-track i{background:var(--ra-teal)}
.ra-model-card dl{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin:0;
}
.ra-model-card dl div{
  min-width:0;
  padding:7px 0;
  border-top:1px solid var(--ra-border);
}
.ra-model-card dt{
  color:var(--ra-text-3);
  font-size:7px;
}
.ra-model-card dd{
  margin:3px 0 0;
  color:var(--ra-text-2);
  font-size:10px;
  font-weight:760;
}
.ra-model-card>small{
  display:block;
  margin-top:7px;
  min-height:24px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.4;
}

.ra-mechanism-insight{
  display:grid;
  grid-template-columns:150px 1fr;
  gap:16px;
  align-items:start;
  margin-top:10px;
  padding:11px 12px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-surface);
}
.ra-mechanism-insight span{
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.08em;
}
.ra-mechanism-insight p{
  margin:0!important;
  color:var(--ra-text-2);
  font-size:10px!important;
  line-height:1.45!important;
}

[data-ra-theme="light"] .ra-model-card,
[data-ra-theme="light"] .ra-inline-readout,
[data-ra-theme="light"] .ra-mechanism-insight{
  background:#fff;
}

/* Tablet */
@media(max-width:1199px){
  .ra-lab-console{
    min-height:auto;
  }
  .ra-lab-console .ra-control-note{
    margin-top:8px!important;
  }
  .ra-lab-modebar{
    align-items:flex-start;
  }
}

/* Mobile keeps the Earth first; controls stay concise until the dedicated mobile stage. */
@media(max-width:767px){
  #lab.is-active{
    display:flex!important;
    flex-direction:column;
  }
  .ra-lab-workspace{
    order:1;
  }
  .ra-lab-console{
    order:2;
    padding:18px 14px!important;
  }
  .ra-lab-toolbar{
    align-items:flex-start;
  }
  .ra-lab-scenario-summary{
    display:none;
  }
  .ra-lab-modebar{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    padding:10px;
  }
  .ra-strategy-switch{
    width:100%;
    min-width:0;
  }
  .ra-earth-mount-lab{
    min-height:430px!important;
  }
  .ra-lab-outcomes{
    grid-template-columns:repeat(2,1fr);
  }
  .ra-lab-outcomes article:nth-child(2){
    border-right:0;
  }
  .ra-lab-outcomes article:nth-child(-n+2){
    border-bottom:1px solid var(--ra-border);
  }
  .ra-model-compare{
    padding:10px;
  }
  .ra-model-compare>header{
    align-items:flex-start;
    flex-direction:column;
    gap:5px;
  }
  .ra-model-compare-grid{
    grid-template-columns:1fr;
  }
  .ra-model-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    column-gap:12px;
  }
  .ra-model-card>span,
  .ra-model-card .ra-score-track,
  .ra-model-card dl,
  .ra-model-card>small{
    grid-column:1/-1;
  }
  .ra-model-card>strong{
    grid-column:2;
    grid-row:1;
    margin:0;
    font-size:25px;
  }
  .ra-mechanism-insight{
    grid-template-columns:1fr;
    gap:5px;
  }
}


/* =========================================================
   STAGE 6 — MODEL & EVIDENCE
   Research-grade explanation without turning the product
   into a wall of text.
   ========================================================= */

#evidence{
  gap:0;
}
.ra-evidence-hero{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(420px,.9fr);
  align-items:end;
  gap:28px;
  padding:34px 4px 24px;
}
.ra-evidence-hero h2{
  max-width:19ch;
  margin-top:10px!important;
  font-size:clamp(2.15rem,3.5vw,3.35rem)!important;
  line-height:1.02;
}
.ra-evidence-hero>div:first-child>p{
  max-width:760px;
  margin:14px 0 0;
  font-size:13px;
}
.ra-boundary-pair{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.ra-boundary-pair article{
  min-height:118px;
  padding:15px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface);
}
.ra-boundary-pair article:first-child{
  border-color:color-mix(in srgb,var(--ra-teal) 24%,var(--ra-border));
}
.ra-boundary-pair article:last-child{
  border-color:color-mix(in srgb,var(--ra-primary) 24%,var(--ra-border));
}
.ra-boundary-pair span,
.ra-section-head span,
.ra-evidence-map-head span,
.ra-live-model>header span,
.ra-equation-grid article>span,
.ra-experiment-grid article>span,
.ra-source-grid a>span,
.ra-evidence-boundary b,
.ra-repro-grid a>span,
.ra-repro-actions>div>span,
.ra-disclosure>span{
  display:block;
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.ra-boundary-pair b{
  display:block;
  margin-top:7px;
  font-size:12px;
  line-height:1.35;
}
.ra-boundary-pair small{
  display:block;
  margin-top:7px;
  color:var(--ra-text-3);
  font-size:9px;
  line-height:1.4;
}

.ra-evidence-top{
  align-items:stretch;
}
.ra-evidence-map{
  display:flex;
  flex-direction:column;
}
.ra-evidence-map-head{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 14px;
  border-bottom:1px solid var(--ra-border);
}
.ra-evidence-map-head>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.ra-evidence-map-head b{
  font-size:12px;
}
.ra-evidence-map-head small{
  color:var(--ra-text-3);
  font-size:8px;
}
.ra-earth-mount-evidence{
  min-height:530px!important;
}

.ra-live-model>header{
  padding:16px 18px;
  border-bottom:1px solid var(--ra-border);
  background:color-mix(in srgb,var(--ra-primary) 3%,transparent);
}
.ra-live-model>header b{
  display:block;
  margin-top:4px;
  font-size:14px;
}
.ra-live-model article{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:58px;
}
.ra-live-model article span{
  margin:0;
}
.ra-live-model article b{
  margin:0;
  text-align:right;
  font-size:12px;
}

.ra-method-block{
  margin-top:18px;
  padding:20px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-md);
  background:var(--ra-surface);
  box-shadow:var(--ra-shadow-panel);
}
.ra-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:16px;
}
.ra-section-head h3{
  margin:4px 0 0;
  font-size:clamp(1.25rem,1.8vw,1.55rem);
  letter-spacing:-.025em;
}
.ra-section-head p{
  max-width:540px;
  margin:0!important;
  text-align:right;
  font-size:10px!important;
}
.ra-section-head code{
  color:var(--ra-text-1);
  font-size:.95em;
}

.ra-causal-chain-rich{
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  overflow-x:auto;
}
.ra-causal-chain-rich article{
  min-width:145px;
  flex:1;
  min-height:112px;
  padding:14px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-causal-chain-rich article>span{
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
}
.ra-causal-chain-rich article>b{
  display:block;
  margin-top:12px;
  color:var(--ra-text-1);
  font-size:13px;
}
.ra-causal-chain-rich article>small{
  display:block;
  margin-top:6px;
  color:var(--ra-text-3);
  font-size:9px;
  line-height:1.4;
}
.ra-causal-chain-rich>i{
  flex:0 0 auto;
  color:var(--ra-primary);
  font-size:14px;
}

.ra-equation-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.ra-equation-grid article{
  min-width:0;
  padding:15px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-equation-grid article.ra-equation-wide{
  grid-column:1/-1;
}
.ra-equation-grid code{
  display:block;
  margin-top:11px;
  padding:10px 11px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-canvas);
  color:var(--ra-text-1);
  font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
  font-size:11px;
  line-height:1.5;
  overflow:auto;
}
.ra-equation-grid small{
  display:block;
  margin-top:9px;
  color:var(--ra-text-3);
  font-size:9px;
  line-height:1.45;
}

.ra-experiment-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.ra-experiment-grid article{
  padding:15px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-experiment-grid ul{
  margin:11px 0 0;
  padding-left:17px;
  color:var(--ra-text-2);
}
.ra-experiment-grid li{
  margin:7px 0;
  font-size:10px;
  line-height:1.4;
}
.ra-experiment-grid li::marker{
  color:var(--ra-primary);
}
.ra-experiment-grid b{
  color:var(--ra-text-1);
}

.ra-source-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.ra-source-grid a,
.ra-repro-grid a{
  display:flex;
  flex-direction:column;
  min-width:0;
  color:inherit;
  text-decoration:none;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
  transition:
    border-color var(--ra-duration-fast) var(--ra-ease-standard),
    transform var(--ra-duration-fast) var(--ra-ease-standard),
    background var(--ra-duration-fast) var(--ra-ease-standard);
}
.ra-source-grid a{
  min-height:180px;
  padding:15px;
}
.ra-source-grid a:hover,
.ra-repro-grid a:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb,var(--ra-primary) 35%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-primary) 3%,var(--ra-surface-soft));
}
.ra-source-grid a>b{
  margin-top:9px;
  font-size:13px;
}
.ra-source-grid a>p{
  margin:8px 0!important;
  color:var(--ra-text-2);
  font-size:10px!important;
  line-height:1.45!important;
}
.ra-source-grid a>small{
  margin-top:auto;
  color:var(--ra-primary);
  font-size:8px;
  font-weight:750;
}
.ra-evidence-boundary{
  display:grid;
  grid-template-columns:150px 1fr;
  gap:16px;
  align-items:start;
  margin-top:10px;
  padding:12px 13px;
  border:1px solid color-mix(in srgb,var(--ra-warning) 28%,var(--ra-border));
  border-radius:var(--ra-radius-xs);
  background:color-mix(in srgb,var(--ra-warning) 3%,var(--ra-surface));
}
.ra-evidence-boundary b{
  color:var(--ra-warning);
}
.ra-evidence-boundary p{
  margin:0!important;
  color:var(--ra-text-2);
  font-size:10px!important;
  line-height:1.45!important;
}

.ra-limit-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
}
.ra-limit-grid span{
  min-height:54px;
  display:grid;
  place-items:center;
  padding:8px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-surface-soft);
  color:var(--ra-text-2);
  text-align:center;
  font-size:9px;
  line-height:1.3;
}

.ra-repro-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.ra-repro-grid a{
  min-height:112px;
  padding:14px;
}
.ra-repro-grid a>b{
  margin-top:7px;
  font-size:12px;
}
.ra-repro-grid a>small{
  margin-top:auto;
  color:var(--ra-primary);
  font-size:8px;
}
.ra-repro-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:18px;
  margin-top:10px;
  padding:13px 14px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-repro-actions>div>b{
  display:block;
  margin-top:5px;
  font-size:11px;
}
.ra-export-action{
  min-width:195px;
  min-height:44px!important;
  margin:0!important;
  box-shadow:none!important;
}
.ra-disclosure{
  margin-top:10px;
  padding:13px 14px;
  border-left:2px solid var(--ra-border-strong);
  background:color-mix(in srgb,var(--ra-surface-raised) 40%,transparent);
}
.ra-disclosure p{
  margin:6px 0 0!important;
  color:var(--ra-text-3);
  font-size:9px!important;
  line-height:1.5!important;
}

[data-ra-theme="light"] .ra-method-block,
[data-ra-theme="light"] .ra-boundary-pair article,
[data-ra-theme="light"] .ra-equation-grid article,
[data-ra-theme="light"] .ra-experiment-grid article,
[data-ra-theme="light"] .ra-source-grid a,
[data-ra-theme="light"] .ra-repro-grid a,
[data-ra-theme="light"] .ra-repro-actions{
  background:#fff;
}
[data-ra-theme="light"] .ra-equation-grid code{
  background:#f4f8fc;
}

@media(max-width:1199px){
  .ra-evidence-hero{
    grid-template-columns:1fr;
  }
  .ra-boundary-pair{
    max-width:760px;
  }
  .ra-source-grid{
    grid-template-columns:repeat(2,1fr);
  }
  .ra-limit-grid{
    grid-template-columns:repeat(3,1fr);
  }
}

@media(max-width:767px){
  .ra-evidence-hero{
    padding:24px 10px 16px;
  }
  .ra-evidence-hero h2{
    max-width:none;
    font-size:31px!important;
  }
  .ra-boundary-pair{
    grid-template-columns:1fr;
  }
  .ra-evidence-top{
    display:flex;
    flex-direction:column;
  }
  .ra-evidence-map{
    order:1;
  }
  .ra-live-model{
    order:2;
  }
  .ra-evidence-map-head{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }
  .ra-earth-mount-evidence{
    min-height:430px!important;
  }
  .ra-method-block{
    margin:10px;
    padding:14px;
    border-radius:var(--ra-radius-sm);
  }
  .ra-section-head{
    align-items:flex-start;
    flex-direction:column;
    gap:7px;
  }
  .ra-section-head p{
    text-align:left;
  }
  .ra-causal-chain-rich{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  .ra-causal-chain-rich article{
    min-height:0;
  }
  .ra-causal-chain-rich>i{
    display:none;
  }
  .ra-equation-grid,
  .ra-experiment-grid,
  .ra-source-grid,
  .ra-repro-grid{
    grid-template-columns:1fr;
  }
  .ra-equation-grid article.ra-equation-wide{
    grid-column:auto;
  }
  .ra-limit-grid{
    grid-template-columns:repeat(2,1fr);
  }
  .ra-evidence-boundary{
    grid-template-columns:1fr;
    gap:5px;
  }
  .ra-repro-actions{
    grid-template-columns:1fr;
  }
  .ra-export-action{
    width:100%;
  }
}

@media(max-width:429px){
  .ra-limit-grid{
    grid-template-columns:1fr;
  }
  .ra-boundary-pair article{
    min-height:auto;
  }
}


/* =========================================================
   STAGE 7 — LIGHT / ANALYSIS THEME
   A dedicated analytical presentation, not a dark-theme invert.
   ========================================================= */

html[data-ra-theme="light"]{
  color-scheme:light;
  background:var(--ra-canvas);
}
html[data-ra-theme="light"] body{
  background:
    linear-gradient(180deg,#f8fbfd 0,#f2f6fa 220px,#f2f6fa 100%);
  color:var(--ra-text-1);
}

/* Global shell */
[data-ra-theme="light"] .ra-header{
  background:rgba(248,251,253,.94);
  border-bottom-color:#d9e3eb;
  box-shadow:0 1px 0 rgba(41,72,102,.025);
  backdrop-filter:blur(14px);
}
[data-ra-theme="light"] .ra-brand-mark{
  color:var(--ra-primary);
}
[data-ra-theme="light"] .ra-brand-copy em{
  color:var(--ra-primary);
}
[data-ra-theme="light"] .ra-brand-copy small{
  color:#74879a;
}
[data-ra-theme="light"] .ra-nav-tab{
  color:#74879a;
}
[data-ra-theme="light"] .ra-nav-tab:hover{
  color:#314b66;
}
[data-ra-theme="light"] .ra-nav-tab.is-active{
  color:#183754;
  border-bottom-color:var(--ra-primary);
}
[data-ra-theme="light"] .ra-system-label{
  color:var(--ra-accent);
}
[data-ra-theme="light"] .ra-theme-toggle{
  background:#fff;
  border-color:#d0dce6;
  color:#71869a;
  box-shadow:0 2px 8px rgba(42,76,110,.04);
}
[data-ra-theme="light"] .ra-theme-toggle span:last-child{
  color:var(--ra-primary);
}
[data-ra-theme="light"] .ra-theme-toggle i{
  background:#e9f0f6;
  box-shadow:inset 0 0 0 1px #c9d7e2;
}
[data-ra-theme="light"] .ra-theme-toggle i:after{
  box-shadow:0 1px 4px rgba(31,86,137,.2);
}

[data-ra-theme="light"] .ra-rail,
[data-ra-theme="light"] .ra-controls,
[data-ra-theme="light"] .ra-canvas-shell,
[data-ra-theme="light"] .ra-lab-workspace,
[data-ra-theme="light"] .ra-evidence-map,
[data-ra-theme="light"] .ra-model-facts,
[data-ra-theme="light"] .ra-method-block{
  border-color:#d7e1e9;
  background:#fff;
  box-shadow:0 8px 24px rgba(44,75,105,.055);
}
[data-ra-theme="light"] .ra-canvas-toolbar,
[data-ra-theme="light"] .ra-lab-modebar{
  background:#fbfdfe;
}
[data-ra-theme="light"] .ra-status-pills span{
  background:#f8fbfd;
}
[data-ra-theme="light"] .ra-status-pills .stable{
  color:#177e73;
  border-color:#bcded8;
  background:#f0faf8;
}
[data-ra-theme="light"] .ra-primary-action{
  background:#246fbf;
  color:#fff;
  box-shadow:0 7px 16px rgba(36,111,191,.14);
}
[data-ra-theme="light"] .ra-primary-action:hover{
  background:#1f65af;
}
[data-ra-theme="light"] .ra-quiet-action,
[data-ra-theme="light"] .ra-reset-action{
  background:#f8fbfd;
  border-color:#d2dde6;
}
[data-ra-theme="light"] .ra-quiet-action[aria-pressed="true"]{
  background:#f2f7fc;
  border-color:#adc8e0;
}
[data-ra-theme="light"] .ra-scene-list button{
  color:#778a9d;
}
[data-ra-theme="light"] .ra-scene-list button.is-active{
  color:#1b3550;
  background:#f7fafc;
}

/* Earth becomes a scientific map rather than a luminous object. */
[data-ra-theme="light"] .ra-earth-system{
  --ra-earth-ocean-core:#edf7fb;
  --ra-earth-ocean:#e5f1f7;
  --ra-earth-rim:#d4e3ed;
  background:
    radial-gradient(circle at 50% 47%,rgba(64,132,184,.035),transparent 31%),
    linear-gradient(rgba(112,145,171,.075) 1px,transparent 1px),
    linear-gradient(90deg,rgba(112,145,171,.075) 1px,transparent 1px),
    #f8fbfd!important;
  background-size:auto,48px 48px,48px 48px!important;
}
[data-ra-theme="light"] .ra-earth-atmosphere{
  stroke:#bfd3e1;
  filter:none;
}
[data-ra-theme="light"] .ra-earth-ocean{
  stroke:#b7cedd;
}
[data-ra-theme="light"] .ra-earth-grid ellipse,
[data-ra-theme="light"] .ra-earth-grid path{
  stroke:rgba(79,119,150,.145);
}
[data-ra-theme="light"] .ra-earth-land path{
  fill:#fdfefe;
  stroke:#a9becd;
  stroke-width:1;
}
[data-ra-theme="light"] .ra-earth-link{
  opacity:.34;
  stroke-width:1.2;
}
[data-ra-theme="light"] .ra-earth-link.is-focus{
  opacity:.64;
  stroke-width:1.5;
}
[data-ra-theme="light"] .ra-earth-link.is-disrupted{
  opacity:.38;
  stroke:var(--ra-critical);
  stroke-dasharray:3 7;
}
[data-ra-theme="light"] .ra-earth-packet{
  opacity:.64;
  filter:none;
}
[data-ra-theme="light"] .ra-provider-halo{
  fill:color-mix(in srgb,var(--provider-color) 5%,transparent);
  stroke:color-mix(in srgb,var(--provider-color) 34%,transparent);
}
[data-ra-theme="light"] .ra-provider-core{
  filter:none;
}
[data-ra-theme="light"] .ra-provider-cloud{
  fill:#fff;
  stroke-width:1.45;
}
[data-ra-theme="light"] .ra-provider-label{
  fill:#21384f;
}
[data-ra-theme="light"] .ra-provider-sub{
  fill:#75889a;
}
[data-ra-theme="light"] .ra-bank-node{
  fill:#fff;
  stroke-width:1.45;
}
[data-ra-theme="light"] .ra-bank-label{
  fill:#6d8194;
  opacity:.86;
}
[data-ra-theme="light"] .ra-bank-halo{
  fill:color-mix(in srgb,var(--node-color) 4%,transparent);
}
[data-ra-theme="light"] .ra-earth-bank.is-affected .ra-bank-node,
[data-ra-theme="light"] .ra-earth-bank.is-critical .ra-bank-node,
[data-ra-theme="light"] .ra-earth-bank.is-recovered .ra-bank-node{
  filter:none;
}
[data-ra-theme="light"] .ra-request-flow{
  stroke-width:1.25;
}
[data-ra-theme="light"] .ra-recovery-flow{
  stroke-width:calc(1.1px + var(--ra-flow-restored,.5) * 1.2px);
}
[data-ra-theme="light"] .ra-pool-core{
  filter:none;
}
[data-ra-theme="light"] .ra-pool-ring{
  stroke-dasharray:2 4;
}
[data-ra-theme="light"] .ra-earth-state span,
[data-ra-theme="light"] .ra-earth-readout span{
  color:#6f8497;
}
[data-ra-theme="light"] .ra-earth-state b{
  color:#233b53;
}
[data-ra-theme="light"] .ra-earth-readout{
  background:rgba(255,255,255,.94);
  border-color:#d2dee7;
  box-shadow:0 4px 14px rgba(44,77,107,.07);
  backdrop-filter:none;
}
[data-ra-theme="light"] .ra-earth-readout b{
  color:#1f3850;
}
[data-ra-theme="light"] .ra-earth-disclaimer{
  color:#75889b;
}
[data-ra-theme="light"] .ra-earth-scale text{
  fill:#64798d;
}
[data-ra-theme="light"] .ra-earth-annotations path{
  stroke:#9fb3c3;
}
[data-ra-theme="light"] .ra-earth-annotations text{
  fill:#263f57;
}
[data-ra-theme="light"] .ra-earth-annotations text.sub{
  fill:#72879a;
}
[data-ra-theme="light"] .ra-earth-system.has-shock{
  background:
    radial-gradient(circle at 53% 46%,rgba(201,74,93,.045),transparent 23%),
    linear-gradient(rgba(112,145,171,.075) 1px,transparent 1px),
    linear-gradient(90deg,rgba(112,145,171,.075) 1px,transparent 1px),
    #f8fbfd!important;
  background-size:auto,48px 48px,48px 48px!important;
}
[data-ra-theme="light"] .ra-earth-system.has-recovery{
  background:
    radial-gradient(circle at 50% 48%,rgba(22,143,131,.045),transparent 24%),
    linear-gradient(rgba(112,145,171,.075) 1px,transparent 1px),
    linear-gradient(90deg,rgba(112,145,171,.075) 1px,transparent 1px),
    #f8fbfd!important;
  background-size:auto,48px 48px,48px 48px!important;
}

/* Guided Simulation: editorial research presentation rather than glass HUD. */
[data-ra-theme="light"] .ra-story-rail:before{
  background:linear-gradient(180deg,rgba(36,111,191,.035),transparent 34%);
}
[data-ra-theme="light"] .ra-story-stat{
  border-color:#d8e2ea;
}
[data-ra-theme="light"] .ra-guided-hud{
  background:rgba(255,255,255,.965);
  border-color:#cfdce6;
  box-shadow:0 7px 20px rgba(40,73,104,.09);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
[data-ra-theme="light"] .ra-guided-status{
  background:#f8fbfd;
}
[data-ra-theme="light"] .ra-guided-dot{
  background:#8da0b1;
  box-shadow:none;
}
[data-ra-theme="light"] .ra-waveform{
  border-right-color:#d7e1e9;
}
[data-ra-theme="light"] .ra-waveform i{
  background:#397ebb;
}
[data-ra-theme="light"] .ra-guided-progress i{
  background:#dbe4eb;
}
[data-ra-theme="light"] .ra-guided-progress i.is-done{
  background:#94badb;
}
[data-ra-theme="light"] .ra-guided-progress i.is-active{
  background:#246fbf;
  box-shadow:none;
}
[data-ra-theme="light"] body.ra-guided-running .ra-guided-hud{
  background:#fff;
  border-color:#b8cfe1;
}
[data-ra-theme="light"] body.ra-guided-running .ra-guided-dot{
  background:var(--ra-teal);
  box-shadow:none;
}
[data-ra-theme="light"] body.ra-guided-running .ra-earth-system[data-earth-mode="simulation"]{
  box-shadow:inset 0 0 0 1px rgba(36,111,191,.03);
}

/* Scenario Lab: denser analytical controls and clearer model comparison. */
[data-ra-theme="light"] .ra-control-group{
  border-top-color:#dce5ec;
}
[data-ra-theme="light"] .ra-control-group>header>span{
  background:#f4f8fb;
  border-color:#bfd3e3;
}
[data-ra-theme="light"] .ra-controls select{
  background:#fff;
  border-color:#c8d6e1;
  color:#20394f;
}
[data-ra-theme="light"] .ra-controls input[type="range"]{
  accent-color:#246fbf;
}
[data-ra-theme="light"] .ra-inline-readout{
  background:#f7fafc;
  border-color:#d6e1e9;
}
[data-ra-theme="light"] .ra-lab-modebar{
  background:#f8fbfd;
}
[data-ra-theme="light"] .ra-strategy-switch{
  background:#fff;
  border-color:#cedae4;
}
[data-ra-theme="light"] .ra-strategy-switch button{
  color:#677d91;
  border-right-color:#d6e1e9;
}
[data-ra-theme="light"] .ra-strategy-switch button.is-active{
  background:#327cc4;
  color:#fff;
}
[data-ra-theme="light"] .ra-strategy-switch button[data-ra-strategy="individual"].is-active{
  background:#c9772e;
}
[data-ra-theme="light"] .ra-strategy-switch button[data-ra-strategy="scfr"].is-active{
  background:#2d9478;
}
[data-ra-theme="light"] .ra-lab-outcomes{
  background:#fbfdfe;
}
[data-ra-theme="light"] .ra-lab-outcomes b{
  color:#183650;
}
[data-ra-theme="light"] .ra-model-compare{
  background:#f5f8fb;
}
[data-ra-theme="light"] .ra-model-card{
  background:#fff;
  border-color:#d5e0e8;
  box-shadow:0 2px 8px rgba(48,78,106,.035);
}
[data-ra-theme="light"] .ra-model-card:hover{
  border-color:#bdcedc;
  box-shadow:0 5px 14px rgba(48,78,106,.055);
}
[data-ra-theme="light"] .ra-model-card.is-active{
  background:#f2f7fc;
  border-color:#8fb7d8;
}
[data-ra-theme="light"] .ra-model-card[data-ra-compare="individual"].is-active{
  background:#fcf6ef;
  border-color:#dcb183;
}
[data-ra-theme="light"] .ra-model-card[data-ra-compare="scfr"].is-active{
  background:#f0f8f6;
  border-color:#94c6ba;
}
[data-ra-theme="light"] .ra-score-track{
  background:#e1e8ee;
}
[data-ra-theme="light"] .ra-mechanism-insight{
  background:#fff;
  border-color:#d7e1e9;
}

/* Model & Evidence: paper-like hierarchy, no dark code cards. */
[data-ra-theme="light"] .ra-evidence-hero{
  color:#16263a;
}
[data-ra-theme="light"] .ra-boundary-pair article{
  background:#fff;
}
[data-ra-theme="light"] .ra-boundary-pair article:first-child{
  border-color:#b8dbd3;
}
[data-ra-theme="light"] .ra-boundary-pair article:last-child{
  border-color:#bdd3e5;
}
[data-ra-theme="light"] .ra-evidence-map-head,
[data-ra-theme="light"] .ra-live-model>header{
  background:#f8fbfd;
}
[data-ra-theme="light"] .ra-causal-chain-rich article,
[data-ra-theme="light"] .ra-equation-grid article,
[data-ra-theme="light"] .ra-experiment-grid article,
[data-ra-theme="light"] .ra-source-grid a,
[data-ra-theme="light"] .ra-repro-grid a,
[data-ra-theme="light"] .ra-repro-actions{
  background:#fbfdfe;
  border-color:#d8e2ea;
}
[data-ra-theme="light"] .ra-causal-chain-rich article{
  box-shadow:inset 0 2px 0 rgba(36,111,191,.08);
}
[data-ra-theme="light"] .ra-equation-grid code{
  background:#f2f6f9;
  border-color:#d4e0e8;
  color:#20374d;
}
[data-ra-theme="light"] .ra-source-grid a:hover,
[data-ra-theme="light"] .ra-repro-grid a:hover{
  background:#f5f9fc;
  border-color:#b9ccdc;
}
[data-ra-theme="light"] .ra-evidence-boundary{
  background:#fffaf1;
  border-color:#e7d2a4;
}
[data-ra-theme="light"] .ra-evidence-boundary b{
  color:#9d6a18;
}
[data-ra-theme="light"] .ra-limit-grid span{
  background:#f7fafc;
  border-color:#d9e3ea;
}
[data-ra-theme="light"] .ra-disclosure{
  background:#f7fafc;
  border-left-color:#b9c9d6;
}

/* Semantic colors remain local and readable in Analysis mode. */
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="1"]) .ra-story-kicker,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="1"]) .ra-guided-copy span{
  color:#b94558;
}
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="2"]) .ra-story-kicker,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="2"]) .ra-guided-copy span,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="3"]) .ra-story-kicker,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="3"]) .ra-guided-copy span{
  color:#a66e19;
}
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="4"]) .ra-story-kicker,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="4"]) .ra-guided-copy span,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="5"]) .ra-story-kicker,
[data-ra-theme="light"] #simulation:has(#raEarthMount[data-scene="5"]) .ra-guided-copy span{
  color:#147d72;
}

/* Theme changes should feel deliberate but never distract. */
body,
.ra-header,
.ra-rail,
.ra-controls,
.ra-canvas-shell,
.ra-lab-workspace,
.ra-evidence-map,
.ra-model-facts,
.ra-method-block,
.ra-earth-system,
.ra-guided-hud{
  transition:
    background-color var(--ra-duration-base) var(--ra-ease-standard),
    border-color var(--ra-duration-base) var(--ra-ease-standard),
    color var(--ra-duration-base) var(--ra-ease-standard),
    box-shadow var(--ra-duration-base) var(--ra-ease-standard);
}

@media(max-width:767px){
  [data-ra-theme="light"] .ra-header{
    background:#f8fbfd;
  }
  [data-ra-theme="light"] .ra-guided-hud{
    box-shadow:0 4px 12px rgba(40,73,104,.075);
  }
  [data-ra-theme="light"] .ra-earth-system{
    background:
      radial-gradient(circle at 50% 47%,rgba(64,132,184,.03),transparent 31%),
      #f8fbfd!important;
  }
}

@media(prefers-reduced-motion:reduce){
  body,
  .ra-header,
  .ra-rail,
  .ra-controls,
  .ra-canvas-shell,
  .ra-lab-workspace,
  .ra-evidence-map,
  .ra-model-facts,
  .ra-method-block,
  .ra-earth-system,
  .ra-guided-hud{
    transition:none!important;
  }
}


/* =========================================================
   STAGE 8 — MOBILE UX
   Earth-first mobile product, not a scaled desktop layout.
   ========================================================= */

.ra-mobile-sheet-head,
.ra-mobile-lab-bar,
.ra-mobile-scene-nav,
.ra-mobile-sheet-backdrop{
  display:none;
}

@media(max-width:767px){
  html,body{
    min-width:320px;
    overflow-x:hidden;
  }
  body{
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  body.ra-mobile-sheet-open{
    overflow:hidden;
  }

  /* Compact two-row app header */
  .ra-app{
    width:100%!important;
  }
  .ra-header{
    position:sticky!important;
    top:0;
    z-index:80;
    min-height:0;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "brand actions"
      "nav nav"!important;
    gap:0!important;
    padding:
      calc(8px + env(safe-area-inset-top,0px))
      10px
      0!important;
    background:color-mix(in srgb,var(--ra-canvas) 94%,transparent);
    backdrop-filter:blur(18px);
  }
  .ra-brand{
    min-height:42px;
  }
  .ra-brand-mark{
    width:29px!important;
    height:29px!important;
    flex:0 0 29px;
  }
  .ra-brand-copy strong{
    font-size:14px!important;
    letter-spacing:-.025em;
  }
  .ra-brand-copy small{
    display:none!important;
  }
  .ra-header-actions{
    min-height:42px;
    gap:7px!important;
  }
  .ra-system-label{
    display:none!important;
  }
  .ra-theme-toggle{
    min-width:44px;
    min-height:34px;
    padding:0 6px!important;
  }
  .ra-theme-toggle>span{
    display:none!important;
  }

  .ra-nav{
    width:calc(100% + 20px);
    margin-left:-10px;
    display:grid!important;
    grid-template-columns:repeat(3,1fr);
    overflow:visible!important;
    border-top:1px solid var(--ra-border);
  }
  .ra-nav-tab{
    min-width:0!important;
    min-height:44px!important;
    padding:0 4px;
    white-space:nowrap;
    font-size:9px!important;
  }

  .ra-main{
    padding:8px 0 20px!important;
  }

  /* Simulation: Earth before narrative */
  #simulation.is-active{
    display:flex!important;
    flex-direction:column;
    gap:8px!important;
  }
  #simulation .ra-canvas-shell{
    order:1!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  #simulation .ra-story-rail{
    order:2!important;
    margin:0 8px;
    padding:18px 16px 16px!important;
    border-radius:var(--ra-radius-sm)!important;
  }
  #simulation .ra-canvas-toolbar{
    min-height:50px;
    padding:9px 12px!important;
  }
  #simulation .ra-canvas-toolbar>div:first-child span{
    font-size:7px!important;
  }
  #simulation .ra-canvas-toolbar>div:first-child b{
    max-width:58vw;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:11px!important;
  }
  #simulation .ra-status-pills{
    gap:4px;
  }
  #simulation .ra-status-pills span{
    padding:5px 6px;
    font-size:7px!important;
  }
  #simulation .ra-status-pills span:nth-child(n+2){
    display:none;
  }

  #simulation .ra-earth-mount{
    min-height:clamp(390px,66svh,560px)!important;
  }
  #simulation .ra-earth-svg{
    transform:scale(1.16)!important;
    transform-origin:50% 49%!important;
  }

  /* Guided HUD stays readable but leaves the map visible. */
  .ra-guided-hud{
    width:calc(100% - 16px)!important;
    min-height:82px!important;
    margin:-94px 8px 8px!important;
    border-radius:9px!important;
  }
  .ra-guided-status{
    min-height:24px!important;
    padding:4px 9px!important;
  }
  .ra-guided-main{
    grid-template-columns:38px minmax(0,1fr)!important;
    min-height:54px!important;
    padding:7px 9px 10px!important;
  }
  .ra-waveform{
    min-height:30px!important;
    gap:1.5px!important;
    padding-right:7px!important;
  }
  .ra-waveform i:nth-child(n+7){
    display:none;
  }
  .ra-guided-copy span{
    font-size:7px!important;
  }
  .ra-guided-copy strong{
    font-size:10px!important;
    line-height:1.3!important;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }

  /* Dedicated thumb-friendly scene rail */
  .ra-mobile-scene-nav{
    display:grid;
    grid-template-columns:repeat(6,minmax(68px,1fr));
    gap:5px;
    padding:8px 8px 10px;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
    border-top:1px solid var(--ra-border);
    background:var(--ra-surface);
  }
  .ra-mobile-scene-nav::-webkit-scrollbar{display:none}
  .ra-mobile-scene-nav button{
    min-height:48px;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:2px;
    padding:7px 8px;
    scroll-snap-align:start;
    border:1px solid var(--ra-border);
    border-radius:8px;
    background:var(--ra-surface-soft);
    color:var(--ra-text-3);
    text-align:left;
  }
  .ra-mobile-scene-nav button span{
    color:var(--ra-text-3);
    font-size:7px;
    font-weight:850;
    letter-spacing:.08em;
  }
  .ra-mobile-scene-nav button b{
    font-size:9px;
    font-weight:760;
  }
  .ra-mobile-scene-nav button.is-active{
    color:var(--ra-text-1);
    border-color:color-mix(in srgb,var(--ra-primary) 48%,var(--ra-border));
    background:color-mix(in srgb,var(--ra-primary) 7%,var(--ra-surface-soft));
  }
  .ra-mobile-scene-nav button.is-active span{
    color:var(--ra-primary);
  }

  .ra-outcome-strip{
    grid-template-columns:repeat(2,1fr)!important;
  }
  .ra-outcome-strip article{
    min-height:72px;
    padding:11px 12px!important;
  }
  .ra-outcome-strip article:nth-child(2){
    border-right:0!important;
  }
  .ra-outcome-strip article:nth-child(-n+2){
    border-bottom:1px solid var(--ra-border);
  }
  .ra-outcome-strip b{
    font-size:19px!important;
  }
  .ra-outcome-strip span,
  .ra-outcome-strip small{
    font-size:7px!important;
  }

  /* Narrative comes after the visualization, stripped to essentials. */
  .ra-story-copy{
    margin-top:14px!important;
  }
  .ra-story-copy h1{
    margin-top:7px!important;
    max-width:none!important;
    font-size:29px!important;
    line-height:1!important;
  }
  .ra-story-copy p{
    font-size:12px!important;
    line-height:1.5!important;
  }
  .ra-story-stat{
    margin-top:16px!important;
    padding:11px 0!important;
  }
  .ra-story-stat b{
    font-size:15px!important;
  }
  .ra-sim-controls{
    grid-template-columns:1fr auto!important;
    gap:7px!important;
    margin-top:14px!important;
  }
  .ra-sim-controls .ra-primary-action{
    min-height:48px!important;
  }
  .ra-sim-controls .ra-quiet-action{
    width:48px;
    min-width:48px!important;
    min-height:48px!important;
    padding:0!important;
  }
  .ra-sim-controls .ra-quiet-action #raNarrationLabel{
    display:none;
  }
  .ra-story-rail .ra-scene-list{
    display:none!important;
  }
  .ra-story-note{
    display:none!important;
  }

  /* Lab: the map stays on screen; controls are a sheet. */
  #lab.is-active{
    display:block!important;
  }
  #lab .ra-lab-workspace{
    width:100%;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  #lab .ra-lab-toolbar{
    min-height:48px!important;
    padding:8px 11px!important;
  }
  #lab .ra-lab-toolbar .ra-lab-scenario-summary{
    display:none!important;
  }
  #lab .ra-lab-modebar{
    grid-template-columns:1fr!important;
    gap:7px!important;
    padding:9px 10px!important;
  }
  #lab .ra-lab-modebar>div:first-child small{
    display:none;
  }
  #lab .ra-strategy-switch{
    width:100%!important;
    min-width:0!important;
  }
  #lab .ra-strategy-switch button{
    min-height:42px!important;
    font-size:9px!important;
  }

  .ra-mobile-lab-bar{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    border-bottom:1px solid var(--ra-border);
    background:var(--ra-surface);
  }
  .ra-mobile-lab-summary{
    min-width:0;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    border:1px solid var(--ra-border);
    border-radius:8px;
    overflow:hidden;
  }
  .ra-mobile-lab-summary span{
    min-width:0;
    padding:6px 7px;
    border-right:1px solid var(--ra-border);
  }
  .ra-mobile-lab-summary span:last-child{
    border-right:0;
  }
  .ra-mobile-lab-summary i,
  .ra-mobile-lab-summary b{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .ra-mobile-lab-summary i{
    color:var(--ra-text-3);
    font-style:normal;
    font-size:6px;
    text-transform:uppercase;
    letter-spacing:.06em;
  }
  .ra-mobile-lab-summary b{
    margin-top:2px;
    font-size:8px;
  }
  #raOpenLabSheet{
    min-height:44px;
    padding:0 11px;
    border:1px solid color-mix(in srgb,var(--ra-primary) 34%,var(--ra-border));
    border-radius:8px;
    background:color-mix(in srgb,var(--ra-primary) 7%,var(--ra-surface));
    color:var(--ra-primary);
    font-size:9px;
    font-weight:800;
    white-space:nowrap;
  }

  #lab .ra-earth-mount-lab{
    min-height:clamp(390px,58svh,520px)!important;
  }
  #lab .ra-earth-svg{
    transform:scale(1.17)!important;
  }

  .ra-lab-outcomes{
    grid-template-columns:repeat(2,1fr)!important;
  }
  .ra-lab-outcomes article{
    min-height:78px;
    padding:11px 12px!important;
  }
  .ra-lab-outcomes b{
    font-size:20px!important;
  }
  .ra-model-compare{
    padding:10px!important;
  }
  .ra-model-compare-grid{
    grid-template-columns:1fr!important;
  }
  .ra-model-card{
    min-height:112px;
    padding:12px!important;
  }
  .ra-model-card>strong{
    font-size:25px!important;
  }
  .ra-mechanism-insight{
    grid-template-columns:1fr!important;
    gap:4px!important;
  }

  /* Bottom sheet */
  .ra-lab-console{
    position:fixed!important;
    z-index:120;
    left:0;
    right:0;
    bottom:0;
    width:100%!important;
    max-height:min(82svh,720px);
    min-height:0!important;
    margin:0!important;
    padding:
      0
      14px
      calc(16px + env(safe-area-inset-bottom,0px))!important;
    display:block!important;
    overflow-y:auto;
    overscroll-behavior:contain;
    border:1px solid var(--ra-border-strong)!important;
    border-bottom:0!important;
    border-radius:18px 18px 0 0!important;
    background:var(--ra-surface)!important;
    box-shadow:0 -18px 50px rgba(0,0,0,.26)!important;
    transform:translateY(110%);
    visibility:hidden;
    transition:
      transform 260ms var(--ra-ease-standard),
      visibility 260ms;
  }
  .ra-lab-console.is-mobile-open{
    transform:translateY(0);
    visibility:visible;
  }
  .ra-mobile-sheet-head{
    position:sticky;
    top:0;
    z-index:2;
    display:grid;
    grid-template-columns:30px minmax(0,1fr) 44px;
    align-items:center;
    gap:8px;
    min-height:62px;
    margin:0 -14px 8px;
    padding:8px 10px;
    border-bottom:1px solid var(--ra-border);
    background:color-mix(in srgb,var(--ra-surface) 96%,transparent);
    backdrop-filter:blur(12px);
  }
  .ra-mobile-sheet-handle{
    align-self:start;
    justify-self:center;
    grid-column:1/-1;
    width:38px;
    height:4px;
    margin-bottom:-17px;
    border-radius:99px;
    background:var(--ra-border-strong);
  }
  .ra-mobile-sheet-head>div{
    grid-column:1/3;
    min-width:0;
    padding-top:9px;
  }
  .ra-mobile-sheet-head>div span{
    display:block;
    color:var(--ra-primary);
    font-size:7px;
    font-weight:850;
    letter-spacing:.1em;
  }
  .ra-mobile-sheet-head>div b{
    display:block;
    margin-top:2px;
    font-size:13px;
  }
  .ra-mobile-sheet-head button{
    grid-column:3;
    min-width:44px;
    min-height:44px;
    border:0;
    border-radius:50%;
    background:var(--ra-surface-raised);
    color:var(--ra-text-2);
    font-size:23px;
    line-height:1;
  }
  .ra-lab-console-head{
    margin-top:4px;
  }
  .ra-lab-console-head h2{
    font-size:26px!important;
  }
  .ra-lab-intro{
    font-size:11px!important;
  }
  .ra-control-group{
    padding-top:14px!important;
  }
  .ra-control-group>header{
    margin-bottom:9px!important;
  }
  .ra-field select{
    min-height:48px!important;
  }
  .ra-range-field input[type="range"]{
    min-height:38px;
  }
  .ra-reset-action{
    min-height:44px!important;
  }

  .ra-mobile-sheet-backdrop{
    position:fixed;
    z-index:110;
    inset:0;
    display:block;
    background:rgba(0,0,0,.48);
    backdrop-filter:blur(2px);
  }
  .ra-mobile-sheet-backdrop[hidden]{
    display:none!important;
  }

  /* Evidence is a reading experience on mobile. */
  #evidence.is-active{
    display:block!important;
  }
  .ra-evidence-hero{
    padding:20px 14px 14px!important;
  }
  .ra-evidence-hero h2{
    font-size:29px!important;
    line-height:1.02!important;
  }
  .ra-evidence-hero>div:first-child>p{
    font-size:12px!important;
  }
  .ra-boundary-pair{
    margin-top:16px;
  }
  .ra-evidence-map,
  .ra-live-model{
    margin:0 8px;
    border-radius:10px!important;
  }
  .ra-earth-mount-evidence{
    min-height:390px!important;
  }
  .ra-live-model article{
    min-height:52px!important;
  }
  .ra-method-block{
    margin:10px 8px!important;
    padding:13px!important;
  }
  .ra-section-head h3{
    font-size:20px!important;
  }
  .ra-equation-grid code{
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:10px!important;
  }
  .ra-source-grid a{
    min-height:142px!important;
  }
  .ra-repro-grid a{
    min-height:96px!important;
  }

  .ra-footer{
    margin-top:8px;
    padding:
      13px 10px
      calc(13px + env(safe-area-inset-bottom,0px))!important;
    font-size:7px!important;
  }

  /* Touch-size contract */
  button,
  select,
  input[type="range"],
  a.ra-brand{
    touch-action:manipulation;
  }
  .ra-nav-tab,
  .ra-primary-action,
  .ra-quiet-action,
  .ra-reset-action,
  .ra-strategy-switch button,
  .ra-mobile-scene-nav button,
  .ra-model-card,
  #raOpenLabSheet,
  #raCloseLabSheet{
    min-height:44px;
  }
}

@media(max-width:429px){
  .ra-header{
    padding-left:8px!important;
    padding-right:8px!important;
  }
  .ra-nav{
    width:calc(100% + 16px);
    margin-left:-8px;
  }
  .ra-brand-copy strong{
    font-size:13px!important;
  }
  #simulation .ra-earth-mount{
    min-height:430px!important;
  }
  #simulation .ra-earth-svg,
  #lab .ra-earth-svg{
    transform:scale(1.24)!important;
  }
  .ra-guided-hud{
    margin-top:-91px!important;
  }
  .ra-mobile-scene-nav{
    grid-template-columns:repeat(6,66px);
  }
  .ra-story-copy h1{
    font-size:27px!important;
  }
  .ra-mobile-lab-bar{
    grid-template-columns:1fr;
  }
  .ra-mobile-lab-summary{
    grid-row:1;
  }
  #raOpenLabSheet{
    width:100%;
  }
  #lab .ra-earth-mount-lab{
    min-height:420px!important;
  }
  .ra-lab-outcomes b{
    font-size:19px!important;
  }
  .ra-evidence-hero h2{
    font-size:27px!important;
  }
}

/* Larger phones can use the full globe comfortably. */
@media(min-width:430px) and (max-width:767px){
  #simulation .ra-earth-mount{
    min-height:min(68svh,590px)!important;
  }
  #lab .ra-earth-mount-lab{
    min-height:min(62svh,540px)!important;
  }
}

/* Safe-area polish for iOS standalone/browser chrome. */
@supports(padding:max(0px)){
  @media(max-width:767px){
    .ra-lab-console{
      padding-bottom:max(16px,env(safe-area-inset-bottom))!important;
    }
  }
}


/* =========================================================
   STAGE 9 — MOTION SYSTEM
   Motion explains routing, constraint and recovery.
   No ballistic paths, flashing alarms or decorative shake.
   ========================================================= */

.ra-earth-packet{
  opacity:.54;
}

/* State changes settle in rather than "hit" the interface. */
.ra-earth-system.ra-state-changing .ra-earth-network,
.ra-earth-system.ra-state-changing .ra-earth-bank-layer,
.ra-earth-system.ra-state-changing .ra-earth-provider-layer{
  animation:raStateSettle 760ms var(--ra-ease-emphasis) both;
}
.ra-earth-system.ra-state-changing .ra-earth-readout{
  animation:raReadoutSettle 620ms var(--ra-ease-standard) both;
}

/* Provider outage is one restrained local pulse. */
.ra-earth-provider.is-outage .ra-provider-core{
  animation:raProviderSignal 760ms var(--ra-ease-emphasis) 1;
}
.ra-earth-provider.is-outage .ra-provider-halo{
  animation:raProviderHalo 980ms var(--ra-ease-standard) 1;
}

/* Capacity requests move toward a neutral market hub. */
.ra-request-packet,
.ra-recovery-packet{
  opacity:0;
  pointer-events:none;
  transition:opacity 360ms var(--ra-ease-standard);
}
.ra-request-packet{
  fill:var(--ra-warning);
}
.ra-request-packet.is-visible{
  opacity:.68;
}
.ra-request-flow.is-visible{
  opacity:calc(.13 + var(--ra-market-strength,.4) * .28);
  animation:raDemandDrift 9s linear infinite;
}

/* Immediate market node appears only during the shortage phase. */
.ra-market-node{
  opacity:0;
  transition:opacity 360ms var(--ra-ease-standard);
}
.ra-market-node.is-visible{
  opacity:1;
}
.ra-market-ring{
  fill:color-mix(in srgb,var(--ra-warning) 4%,transparent);
  stroke:color-mix(in srgb,var(--ra-warning) 42%,transparent);
  stroke-width:1;
  stroke-dasharray:2 5;
}
.ra-market-core{
  fill:var(--ra-warning);
}
.ra-market-node text{
  text-anchor:middle;
  fill:var(--ra-warning);
  font-size:8px;
  font-weight:800;
  letter-spacing:.075em;
}
.ra-market-node text.sub{
  fill:var(--ra-text-3);
  font-size:7px;
  font-weight:600;
  letter-spacing:0;
}
.ra-market-node.is-active .ra-market-ring{
  animation:raMarketQueue 5.6s linear infinite;
}

/* Individual reserve: capacity is visible but stays local. */
.ra-earth-bank.show-reserve .ra-bank-reserve{
  animation:raReserveOrbit 10s linear infinite;
}
.ra-earth-bank.is-stranded .ra-bank-reserve{
  opacity:.78;
  stroke:var(--ra-orange);
}

/* Pooled recovery is a calmer outward routing flow. */
.ra-recovery-packet{
  fill:var(--ra-teal);
}
.ra-recovery-packet.is-visible{
  opacity:calc(.34 + var(--ra-flow-restored,.5) * .42);
}
.ra-recovery-flow.is-visible{
  opacity:calc(.14 + var(--ra-reserve-strength,.4) * .42);
  animation:raRecoveryDrift 11s linear infinite;
}
.ra-pool-node.is-active .ra-pool-ring{
  animation:raPoolSignal 4.8s ease-in-out infinite;
}

/* Recovered nodes settle rather than flash. */
.ra-earth-bank.is-recovering .ra-bank-node,
.ra-earth-bank.is-recovered .ra-bank-node,
.ra-earth-bank.is-partial .ra-bank-node{
  transition:
    fill 620ms var(--ra-ease-emphasis),
    stroke 620ms var(--ra-ease-emphasis),
    opacity 620ms var(--ra-ease-standard);
}
.ra-earth-bank.is-recovering .ra-bank-halo{
  animation:raRecoveryHalo 3.8s ease-in-out infinite;
}

/* Guided Simulation uses the same calm timing language. */
body.ra-guided-running .ra-guided-dot{
  animation:raGuidedDotCalm 2.1s ease-in-out infinite;
}
.ra-guided-hud.is-speaking .ra-waveform i{
  animation-duration:980ms;
}

/* Analysis theme removes luminous motion residue. */
[data-ra-theme="light"] .ra-request-packet,
[data-ra-theme="light"] .ra-recovery-packet{
  filter:none;
}
[data-ra-theme="light"] .ra-market-core,
[data-ra-theme="light"] .ra-pool-core{
  filter:none;
}
[data-ra-theme="light"] .ra-earth-provider.is-outage .ra-provider-halo,
[data-ra-theme="light"] .ra-earth-bank.is-recovering .ra-bank-halo{
  filter:none;
}

@keyframes raStateSettle{
  0%{opacity:.72;transform:translateY(2px)}
  100%{opacity:1;transform:translateY(0)}
}
@keyframes raReadoutSettle{
  0%{opacity:.68;transform:translateY(-3px)}
  100%{opacity:1;transform:translateY(0)}
}
@keyframes raProviderSignal{
  0%{transform:scale(1);opacity:1}
  48%{transform:scale(1.18);opacity:.78}
  100%{transform:scale(1);opacity:1}
}
@keyframes raProviderHalo{
  0%{opacity:.46;transform:scale(.92)}
  55%{opacity:.92;transform:scale(1.08)}
  100%{opacity:.58;transform:scale(1)}
}
@keyframes raDemandDrift{
  to{stroke-dashoffset:-42}
}
@keyframes raRecoveryDrift{
  to{stroke-dashoffset:-50}
}
@keyframes raMarketQueue{
  to{stroke-dashoffset:-28}
}
@keyframes raReserveOrbit{
  to{stroke-dashoffset:-24}
}
@keyframes raPoolSignal{
  0%,100%{opacity:.78;transform:scale(1)}
  50%{opacity:1;transform:scale(1.035)}
}
@keyframes raRecoveryHalo{
  0%,100%{opacity:.45}
  50%{opacity:.82}
}
@keyframes raGuidedDotCalm{
  0%,100%{opacity:.72;transform:scale(.9)}
  50%{opacity:1;transform:scale(1)}
}

/* Retire earlier, more aggressive motion definitions where overridden. */
@keyframes raProviderShock{
  0%,100%{transform:scale(1);opacity:1}
  50%{transform:scale(1.18);opacity:.8}
}
@keyframes raPoolBreath{
  0%,100%{transform:scale(1);opacity:.82}
  50%{transform:scale(1.035);opacity:1}
}

@media(max-width:767px){
  .ra-request-packet.is-visible,
  .ra-recovery-packet.is-visible{
    opacity:.62;
  }
  .ra-earth-system.ra-state-changing .ra-earth-network,
  .ra-earth-system.ra-state-changing .ra-earth-bank-layer,
  .ra-earth-system.ra-state-changing .ra-earth-provider-layer{
    animation-duration:620ms;
  }
}

@media(prefers-reduced-motion:reduce){
  /* Keep essential flow motion visible at reduced speed via the JS engine.
     Decorative CSS pulses are still removed. */
  .ra-earth-packet,
  .ra-request-packet,
  .ra-recovery-packet{
    transition:none!important;
  }
  .ra-earth-system.ra-state-changing .ra-earth-network,
  .ra-earth-system.ra-state-changing .ra-earth-bank-layer,
  .ra-earth-system.ra-state-changing .ra-earth-provider-layer,
  .ra-earth-system.ra-state-changing .ra-earth-readout,
  .ra-earth-provider.is-outage .ra-provider-core,
  .ra-earth-provider.is-outage .ra-provider-halo,
  .ra-market-node.is-active .ra-market-ring,
  .ra-earth-bank.show-reserve .ra-bank-reserve,
  .ra-recovery-flow.is-visible,
  .ra-request-flow.is-visible,
  .ra-pool-node.is-active .ra-pool-ring,
  .ra-earth-bank.is-recovering .ra-bank-halo,
  body.ra-guided-running .ra-guided-dot{
    animation:none!important;
  }
}


/* =========================================================
   STAGE 10 — FINAL QA / RUN-BEFORE-APPLY SCENARIOS
   ========================================================= */

.ra-provider-toggle-group{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}
.ra-provider-toggle-group label{
  position:relative;
  display:block;
  cursor:pointer;
}
.ra-provider-toggle-group input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.ra-provider-toggle-group label>span{
  min-height:46px;
  display:grid;
  grid-template-columns:12px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-surface-soft);
  color:var(--ra-text-2);
  transition:
    border-color var(--ra-duration-fast) var(--ra-ease-standard),
    background var(--ra-duration-fast) var(--ra-ease-standard),
    color var(--ra-duration-fast) var(--ra-ease-standard);
}
.ra-provider-toggle-group label>span>i{
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--provider-color,var(--ra-primary));
  box-shadow:0 0 0 3px color-mix(in srgb,var(--provider-color,var(--ra-primary)) 10%,transparent);
}
.ra-provider-toggle-group label>span>b{
  font-size:10px;
}
.ra-provider-toggle-group label>span>small{
  color:var(--ra-text-3);
  font-size:8px;
}
.ra-provider-toggle-group input:checked+span{
  color:var(--ra-text-1);
  border-color:color-mix(in srgb,var(--provider-color,var(--ra-primary)) 45%,var(--ra-border));
  background:color-mix(in srgb,var(--provider-color,var(--ra-primary)) 7%,var(--ra-surface-soft));
}
.ra-provider-toggle-group input:focus-visible+span{
  outline:2px solid var(--ra-primary);
  outline-offset:2px;
}
.ra-field-help{
  display:block;
  margin-top:7px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.4;
}
.ra-field-help.is-error{
  color:var(--ra-critical);
}

.ra-lab-run-block{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  margin-top:16px;
  padding:12px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-lab-run-block>div{
  min-width:0;
}
.ra-lab-run-block>div>span{
  display:block;
  color:var(--ra-text-3);
  font-size:8px;
  font-weight:850;
  letter-spacing:.09em;
}
.ra-lab-run-block>div>small{
  display:block;
  margin-top:4px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.4;
}
.ra-lab-run-block.has-pending{
  border-color:color-mix(in srgb,var(--ra-primary) 34%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-primary) 4%,var(--ra-surface-soft));
}
.ra-lab-run-block.has-pending>div>span{
  color:var(--ra-primary);
}
.ra-run-scenario{
  min-width:144px;
  min-height:46px!important;
  margin:0!important;
  box-shadow:none!important;
}
.ra-run-scenario:disabled{
  cursor:not-allowed;
  opacity:.42;
  box-shadow:none!important;
}

.ra-secondary-action{
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 14px;
  border:1px solid var(--ra-border-strong);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-raised);
  color:var(--ra-text-2);
  font-weight:760;
  cursor:pointer;
}
.ra-export-actions{
  display:grid;
  grid-template-columns:minmax(190px,1fr) minmax(140px,.7fr);
  gap:8px;
}
.ra-export-json{
  min-width:140px;
}
.ra-export-json b{
  color:var(--ra-primary);
  font-family:"SFMono-Regular",Consolas,monospace;
  font-size:9px;
}

[data-ra-theme="light"] .ra-provider-toggle-group label>span,
[data-ra-theme="light"] .ra-lab-run-block,
[data-ra-theme="light"] .ra-secondary-action{
  background:#f8fbfd;
}
[data-ra-theme="light"] .ra-provider-toggle-group input:checked+span{
  background:color-mix(in srgb,var(--provider-color,var(--ra-primary)) 6%,#fff);
}

@media(max-width:767px){
  .ra-provider-toggle-group{
    gap:6px;
  }
  .ra-provider-toggle-group label>span{
    min-height:50px;
  }
  .ra-lab-run-block{
    position:sticky;
    bottom:0;
    z-index:3;
    grid-template-columns:1fr;
    margin:14px -14px 0;
    padding:
      10px 14px
      max(10px,env(safe-area-inset-bottom,0px));
    border-left:0;
    border-right:0;
    border-bottom:0;
    border-radius:0;
    background:color-mix(in srgb,var(--ra-surface) 96%,transparent);
    backdrop-filter:blur(12px);
  }
  .ra-run-scenario{
    width:100%;
    min-height:50px!important;
  }
  .ra-export-actions{
    grid-template-columns:1fr;
    width:100%;
  }
  .ra-export-json{
    width:100%;
  }
}


/* =========================================================
   SCENARIO PLAYBACK — RUN -> EXPLAIN -> CONCLUDE
   ========================================================= */

.ra-lab-earth-stage{
  position:relative;
  min-height:0;
}

.ra-scenario-playback{
  position:absolute;
  z-index:18;
  left:16px;
  bottom:16px;
  width:min(390px,calc(100% - 32px));
  overflow:hidden;
  border:1px solid var(--ra-border-strong);
  border-radius:var(--ra-radius-sm);
  background:color-mix(in srgb,var(--ra-surface) 90%,transparent);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  box-shadow:0 18px 42px rgba(0,0,0,.22);
  transform:translateY(0);
  opacity:1;
  transition:
    opacity 260ms var(--ra-ease-standard),
    transform 260ms var(--ra-ease-standard),
    border-color 260ms var(--ra-ease-standard);
}
.ra-scenario-playback.is-finishing{
  opacity:0;
  transform:translateY(8px);
}
.ra-playback-head{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 11px;
  border-bottom:1px solid var(--ra-border);
}
.ra-playback-head>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.ra-playback-head>div>span{
  color:var(--ra-text-3);
  font-size:7px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-playback-head>div>b{
  color:var(--ra-text-2);
  font-size:9px;
}
.ra-playback-live{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--ra-teal);
  font-size:7px;
  font-weight:850;
  letter-spacing:.08em;
  white-space:nowrap;
}
.ra-playback-live i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 10px color-mix(in srgb,currentColor 55%,transparent);
  animation:raPlaybackLive 1.8s ease-in-out infinite;
}
.ra-playback-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px 14px;
  align-items:end;
  padding:12px 11px 14px;
}
.ra-playback-body>span{
  grid-column:1/-1;
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
  letter-spacing:.09em;
}
.ra-playback-body>strong{
  max-width:29ch;
  color:var(--ra-text-1);
  font-size:12px;
  line-height:1.35;
}
.ra-playback-metric{
  min-width:110px;
  padding-left:12px;
  border-left:1px solid var(--ra-border);
  text-align:right;
}
.ra-playback-metric span{
  display:block;
  color:var(--ra-text-3);
  font-size:7px;
  font-weight:800;
  letter-spacing:.07em;
}
.ra-playback-metric b{
  display:block;
  margin-top:4px;
  color:var(--ra-text-1);
  font-size:17px;
  letter-spacing:-.025em;
}
.ra-playback-progress{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:3px;
  height:3px;
  padding:0 11px 10px;
}
.ra-playback-progress i{
  height:3px;
  border-radius:99px;
  background:var(--ra-border-strong);
}
.ra-playback-progress i.is-done{
  background:color-mix(in srgb,var(--ra-primary) 42%,var(--ra-border-strong));
}
.ra-playback-progress i.is-active{
  background:var(--ra-primary);
  animation:raPlaybackProgress 1.05s ease-in-out infinite;
}

/* Phase semantics */
.ra-scenario-playback[data-phase="shock"]{
  border-color:color-mix(in srgb,var(--ra-critical) 44%,var(--ra-border));
}
.ra-scenario-playback[data-phase="shock"] .ra-playback-body>span,
.ra-scenario-playback[data-phase="shock"] .ra-playback-progress i.is-active{
  color:var(--ra-critical);
  background:var(--ra-critical);
}
.ra-scenario-playback[data-phase="demand"] .ra-playback-body>span,
.ra-scenario-playback[data-phase="market"] .ra-playback-body>span{
  color:var(--ra-warning);
}
.ra-scenario-playback[data-phase="demand"] .ra-playback-progress i.is-active,
.ra-scenario-playback[data-phase="market"] .ra-playback-progress i.is-active{
  background:var(--ra-warning);
}
.ra-scenario-playback[data-phase="individual"] .ra-playback-body>span{
  color:var(--ra-orange);
}
.ra-scenario-playback[data-phase="individual"] .ra-playback-progress i.is-active{
  background:var(--ra-orange);
}
.ra-scenario-playback[data-phase="scfr"] .ra-playback-body>span,
.ra-scenario-playback[data-phase="outcome"] .ra-playback-body>span{
  color:var(--ra-teal);
}
.ra-scenario-playback[data-phase="scfr"] .ra-playback-progress i.is-active,
.ra-scenario-playback[data-phase="outcome"] .ra-playback-progress i.is-active{
  background:var(--ra-teal);
}

/* The result panels remain present, but visually wait for playback to finish. */
#lab.is-scenario-running .ra-lab-outcomes,
#lab.is-scenario-running .ra-model-compare{
  opacity:.38;
  transition:opacity 300ms var(--ra-ease-standard);
}
#lab:not(.is-scenario-running) .ra-lab-outcomes,
#lab:not(.is-scenario-running) .ra-model-compare{
  opacity:1;
  transition:opacity 300ms var(--ra-ease-standard);
}
#lab.is-scenario-running .ra-strategy-switch,
#lab.is-scenario-running .ra-model-card{
  pointer-events:none;
}

/* Generated on-site conclusion */
.ra-scenario-conclusion{
  margin-top:10px;
  padding:18px;
  border:1px solid color-mix(in srgb,var(--ra-teal) 25%,var(--ra-border));
  border-radius:var(--ra-radius-md);
  background:
    linear-gradient(180deg,color-mix(in srgb,var(--ra-teal) 3%,transparent),transparent 44%),
    var(--ra-surface);
  box-shadow:var(--ra-shadow-panel);
  opacity:0;
  transform:translateY(10px);
}
.ra-scenario-conclusion.is-visible{
  animation:raConclusionIn 520ms var(--ra-ease-emphasis) forwards;
}
.ra-scenario-conclusion>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
.ra-scenario-conclusion>header>div>span{
  display:block;
  color:var(--ra-teal);
  font-size:8px;
  font-weight:850;
  letter-spacing:.1em;
}
.ra-scenario-conclusion h3{
  margin:5px 0 0;
  max-width:820px;
  color:var(--ra-text-1);
  font-size:clamp(1.25rem,1.9vw,1.65rem);
  line-height:1.08;
  letter-spacing:-.025em;
}
.ra-conclusion-badge{
  flex:0 0 auto;
  padding:6px 8px;
  border:1px solid color-mix(in srgb,var(--ra-teal) 28%,var(--ra-border));
  border-radius:999px;
  color:var(--ra-teal);
  font-size:7px;
  font-weight:850;
  letter-spacing:.08em;
}
.ra-conclusion-summary{
  max-width:980px;
  margin:12px 0 0!important;
  color:var(--ra-text-2);
  font-size:11px!important;
  line-height:1.55!important;
}
.ra-conclusion-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:14px;
}
.ra-conclusion-grid article{
  min-width:0;
  min-height:105px;
  padding:13px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-soft);
}
.ra-conclusion-grid article>span{
  display:block;
  color:var(--ra-text-3);
  font-size:7px;
  font-weight:850;
  letter-spacing:.08em;
}
.ra-conclusion-grid article>b{
  display:block;
  margin-top:8px;
  color:var(--ra-text-1);
  font-size:19px;
  line-height:1.1;
  letter-spacing:-.025em;
}
.ra-conclusion-grid article>small{
  display:block;
  margin-top:6px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.4;
}
.ra-conclusion-grid article:nth-child(2)>b{
  color:var(--ra-warning);
}
.ra-conclusion-grid article:nth-child(3)>b{
  color:var(--ra-teal);
}
.ra-conclusion-interpretation{
  display:grid;
  grid-template-columns:170px 1fr;
  gap:16px;
  margin-top:10px;
  padding:12px 13px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-xs);
  background:var(--ra-surface-soft);
}
.ra-conclusion-interpretation span{
  color:var(--ra-primary);
  font-size:8px;
  font-weight:850;
  letter-spacing:.08em;
}
.ra-conclusion-interpretation p{
  margin:0!important;
  color:var(--ra-text-2);
  font-size:10px!important;
  line-height:1.5!important;
}
.ra-conclusion-boundary{
  display:block;
  margin-top:10px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.45;
}

[data-ra-theme="light"] .ra-scenario-playback{
  background:rgba(255,255,255,.96);
  box-shadow:0 12px 28px rgba(43,74,103,.12);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
[data-ra-theme="light"] .ra-playback-live i{
  box-shadow:none;
}
[data-ra-theme="light"] .ra-scenario-conclusion{
  background:
    linear-gradient(180deg,rgba(22,143,131,.035),transparent 44%),
    #fff;
}
[data-ra-theme="light"] .ra-conclusion-grid article,
[data-ra-theme="light"] .ra-conclusion-interpretation{
  background:#f8fbfd;
}

@keyframes raPlaybackLive{
  0%,100%{opacity:.48;transform:scale(.88)}
  50%{opacity:1;transform:scale(1)}
}
@keyframes raPlaybackProgress{
  0%,100%{opacity:.56}
  50%{opacity:1}
}
@keyframes raConclusionIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

@media(max-width:767px){
  .ra-scenario-playback{
    left:8px;
    bottom:8px;
    width:calc(100% - 16px);
    border-radius:9px;
  }
  .ra-playback-head{
    padding-inline:9px;
  }
  .ra-playback-body{
    grid-template-columns:minmax(0,1fr) auto;
    padding:10px 9px 12px;
    gap:6px 9px;
  }
  .ra-playback-body>strong{
    font-size:10px;
    line-height:1.3;
  }
  .ra-playback-metric{
    min-width:92px;
    padding-left:8px;
  }
  .ra-playback-metric b{
    font-size:15px;
  }
  .ra-playback-progress{
    padding:0 9px 8px;
  }
  .ra-scenario-conclusion{
    margin:10px 8px 0;
    padding:14px;
    border-radius:10px;
  }
  .ra-scenario-conclusion>header{
    flex-direction:column;
    gap:8px;
  }
  .ra-scenario-conclusion h3{
    font-size:21px;
  }
  .ra-conclusion-grid{
    grid-template-columns:1fr;
  }
  .ra-conclusion-grid article{
    min-height:0;
  }
  .ra-conclusion-interpretation{
    grid-template-columns:1fr;
    gap:5px;
  }
}

@media(prefers-reduced-motion:reduce){
  .ra-playback-live i,
  .ra-playback-progress i.is-active,
  .ra-scenario-conclusion.is-visible{
    animation:none!important;
  }
  .ra-scenario-conclusion{
    opacity:1;
    transform:none;
  }
}


/* =========================================================
   EARTH + IDENTITY POLISH
   Shared geography and viewport for Simulation / Scenario Lab.
   ========================================================= */

.ra-brand-mark{
  border-radius:11px;
  overflow:hidden;
  box-shadow:0 4px 14px rgba(0,0,0,.16);
}
[data-ra-theme="light"] .ra-brand-mark{
  box-shadow:0 3px 10px rgba(37,71,104,.12);
}

/* More Earth-like sphere treatment. */
.ra-earth-system{
  --ra-earth-ocean-core:#17354a;
  --ra-earth-ocean:#0a2132;
  --ra-earth-rim:#03101a;
  --ra-earth-land-fill:#183246;
  --ra-earth-land-stroke:#4d6f83;
}
.ra-earth-atmosphere{
  stroke:rgba(78,166,220,.32);
  stroke-width:1.35;
  filter:drop-shadow(0 0 14px rgba(53,167,255,.12));
}
.ra-earth-land path{
  fill:var(--ra-earth-land-fill);
  stroke:var(--ra-earth-land-stroke);
  stroke-width:.9;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.ra-earth-sphere-light{
  pointer-events:none;
  mix-blend-mode:screen;
}
.ra-earth-grid ellipse,
.ra-earth-grid path{
  stroke:rgba(117,171,205,.105);
  stroke-width:.72;
}
.ra-earth-network{
  opacity:.95;
}
.ra-provider-halo{
  stroke-width:.9;
}
.ra-provider-cloud{
  fill:color-mix(in srgb,var(--ra-surface) 92%,transparent);
}
.ra-bank-node{
  stroke-width:1.4;
}

/* Same globe viewport on page 1 and page 2. Only system state may differ. */
#raEarthMount,
#raLabEarthMount{
  min-height:540px!important;
}
#raEarthMount .ra-earth-svg,
#raLabEarthMount .ra-earth-svg{
  transform:none!important;
  transform-origin:50% 50%!important;
}

/* Keep map labels and globe geometry visually aligned across both pages. */
.ra-earth-system[data-earth-mode="simulation"] .ra-earth-state,
.ra-earth-system[data-earth-mode="lab"] .ra-earth-state{
  top:16px;
  left:18px;
}
.ra-earth-system[data-earth-mode="simulation"] .ra-earth-readout,
.ra-earth-system[data-earth-mode="lab"] .ra-earth-readout{
  top:14px;
  right:16px;
}

[data-ra-theme="light"] .ra-earth-system{
  --ra-earth-ocean-core:#e3f3f9;
  --ra-earth-ocean:#d5e9f3;
  --ra-earth-rim:#bfd4e1;
  --ra-earth-land-fill:#f7fbfd;
  --ra-earth-land-stroke:#8ea9ba;
}
[data-ra-theme="light"] .ra-earth-atmosphere{
  stroke:#acc8d9;
  filter:none;
}
[data-ra-theme="light"] .ra-earth-land path{
  fill:var(--ra-earth-land-fill);
  stroke:var(--ra-earth-land-stroke);
}
[data-ra-theme="light"] .ra-earth-sphere-light{
  opacity:.45;
  mix-blend-mode:normal;
}
[data-ra-theme="light"] .ra-earth-grid ellipse,
[data-ra-theme="light"] .ra-earth-grid path{
  stroke:rgba(60,106,139,.13);
}

@media(max-width:767px){
  #raEarthMount,
  #raLabEarthMount{
    min-height:450px!important;
  }
  #raEarthMount .ra-earth-svg,
  #raLabEarthMount .ra-earth-svg{
    transform:scale(1.18)!important;
    transform-origin:50% 49%!important;
  }
}

@media(max-width:429px){
  #raEarthMount,
  #raLabEarthMount{
    min-height:430px!important;
  }
  #raEarthMount .ra-earth-svg,
  #raLabEarthMount .ra-earth-svg{
    transform:scale(1.23)!important;
    transform-origin:50% 49%!important;
  }
}


/* =========================================================
   FINAL POLISH — EARTH DEPTH / NATURAL VOICE / MOBILE APP NAV
   ========================================================= */

/* Planet depth: keep the map analytical, but read unmistakably as a sphere. */
.ra-earth-ocean{
  filter:drop-shadow(0 16px 24px rgba(0,0,0,.24));
}
.ra-earth-land path{
  paint-order:stroke fill;
  filter:drop-shadow(0 1px 0 rgba(255,255,255,.035));
}
.ra-earth-gloss,
.ra-earth-night-shade,
.ra-earth-sphere-light{
  pointer-events:none;
}
.ra-earth-gloss{
  opacity:.78;
  mix-blend-mode:screen;
}
.ra-earth-night-shade{
  opacity:.92;
  mix-blend-mode:multiply;
}
.ra-earth-sphere-light{
  opacity:.72;
}
.ra-earth-atmosphere{
  filter:
    drop-shadow(0 0 12px rgba(53,167,255,.12))
    drop-shadow(0 0 28px rgba(53,167,255,.055));
}
.ra-earth-provider-layer,
.ra-earth-bank-layer,
.ra-earth-network{
  isolation:isolate;
}
.ra-provider-label{
  paint-order:stroke;
  stroke:color-mix(in srgb,var(--ra-surface) 92%,transparent);
  stroke-width:2.2px;
  stroke-linejoin:round;
}
.ra-provider-sub{
  paint-order:stroke;
  stroke:color-mix(in srgb,var(--ra-surface) 90%,transparent);
  stroke-width:1.7px;
}

/* Narration control quietly communicates whether a high-quality system voice was found. */
.ra-quiet-action[data-voice-quality="natural"] .ra-speaker-icon{
  color:var(--ra-teal);
}
.ra-quiet-action[data-voice-quality="natural"]{
  border-color:color-mix(in srgb,var(--ra-teal) 24%,var(--ra-border));
}

/* Mobile navigation becomes a thumb-reachable app bar. */
@media(max-width:767px){
  .ra-header{
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:"brand actions"!important;
    min-height:58px!important;
    padding:
      calc(7px + env(safe-area-inset-top,0px))
      10px
      7px!important;
    border-bottom:1px solid var(--ra-border)!important;
  }

  .ra-nav{
    position:fixed!important;
    z-index:105;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom,0px));
    width:auto!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:repeat(3,1fr);
    gap:4px;
    padding:4px;
    border:1px solid var(--ra-border-strong);
    border-radius:15px;
    background:color-mix(in srgb,var(--ra-surface) 94%,transparent);
    box-shadow:0 12px 34px rgba(0,0,0,.24);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
  }
  .ra-nav-tab{
    min-width:0!important;
    min-height:48px!important;
    padding:0 5px!important;
    border:0!important;
    border-radius:11px;
    font-size:9px!important;
    white-space:nowrap;
  }
  .ra-nav-tab.is-active{
    background:color-mix(in srgb,var(--ra-primary) 13%,var(--ra-surface));
    color:var(--ra-text-1);
    box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ra-primary) 24%,transparent);
  }

  .ra-main{
    padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
  }
  .ra-footer{
    padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;
  }

  /* Less map clutter on small screens. */
  .ra-provider-sub{
    display:none!important;
  }
  .ra-provider-label{
    font-size:9px!important;
    stroke-width:2.8px;
  }
  .ra-earth-link{
    opacity:.17;
  }
  .ra-earth-link.is-focus{
    opacity:.42;
  }
  .ra-earth-packets .ra-earth-packet:nth-child(even){
    display:none;
  }
  .ra-earth-ocean{
    filter:drop-shadow(0 10px 17px rgba(0,0,0,.18));
  }
  .ra-earth-gloss{
    opacity:.68;
  }
  .ra-earth-night-shade{
    opacity:.82;
  }
  .ra-earth-atmosphere{
    filter:drop-shadow(0 0 10px rgba(53,167,255,.1));
  }

  /* Readouts are compact enough not to fight the globe. */
  .ra-earth-state{
    left:9px!important;
    top:9px!important;
  }
  .ra-earth-state span{
    font-size:6.5px!important;
  }
  .ra-earth-state b{
    max-width:128px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:10px!important;
  }
  .ra-earth-readout{
    top:8px!important;
    right:8px!important;
    background:color-mix(in srgb,var(--ra-surface) 90%,transparent);
  }
  .ra-earth-readout>div{
    min-width:58px!important;
    padding:5px 6px!important;
  }
  .ra-earth-readout>div:nth-child(2){
    display:none!important;
  }
  .ra-earth-readout span{
    font-size:6px!important;
  }
  .ra-earth-readout b{
    font-size:10px!important;
  }
  .ra-earth-disclaimer{
    display:none!important;
  }

  /* The control sheet feels like a native bottom sheet rather than a desktop panel. */
  .ra-lab-console{
    touch-action:pan-y;
    -webkit-overflow-scrolling:touch;
    max-height:min(88svh,760px)!important;
    border-radius:20px 20px 0 0!important;
  }
  .ra-mobile-sheet-head{
    min-height:58px!important;
  }
  .ra-mobile-sheet-handle{
    width:44px!important;
  }
  .ra-provider-toggle-group label>span{
    min-height:52px!important;
  }
  .ra-range-field input[type="range"]{
    min-height:44px!important;
  }

  /* Scenario results stay scannable instead of becoming one long wall. */
  .ra-model-card{
    min-height:104px!important;
  }
  .ra-conclusion-grid{
    gap:7px!important;
  }
  .ra-conclusion-grid article{
    padding:11px 12px!important;
  }
}

@media(max-width:429px){
  .ra-nav{
    left:6px;
    right:6px;
    bottom:max(6px,env(safe-area-inset-bottom,0px));
  }
  .ra-nav-tab{
    font-size:8.5px!important;
  }
  .ra-brand-copy strong{
    max-width:185px;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .ra-earth-readout>div{
    min-width:54px!important;
  }
}

/* Analysis mode keeps depth without looking glossy. */
[data-ra-theme="light"] .ra-earth-ocean{
  filter:drop-shadow(0 10px 18px rgba(46,85,114,.1));
}
[data-ra-theme="light"] .ra-earth-gloss{
  opacity:.38;
  mix-blend-mode:normal;
}
[data-ra-theme="light"] .ra-earth-night-shade{
  opacity:.22;
  mix-blend-mode:multiply;
}
[data-ra-theme="light"] .ra-earth-sphere-light{
  opacity:.34;
}
[data-ra-theme="light"] .ra-provider-label,
[data-ra-theme="light"] .ra-provider-sub{
  stroke:#f8fbfd;
}

@media(prefers-reduced-motion:reduce){
  .ra-earth-gloss,
  .ra-earth-night-shade,
  .ra-earth-sphere-light{
    transition:none!important;
  }
}


/* =========================================================
   MOBILE INTERACTION FIX — INDEPENDENT BOTTOM NAV + SAFARI LAB
   ========================================================= */

.ra-mobile-app-nav{
  display:none;
}

@media(max-width:767px){
  /* Do not keep the fixed mobile nav inside the sticky/backdrop-filter header.
     Safari can create an unexpected containing/hit-test layer there. */
  .ra-header .ra-nav{
    display:none!important;
  }

  .ra-mobile-app-nav{
    position:fixed;
    z-index:100;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom,0px));
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:4px;
    padding:4px;
    border:1px solid var(--ra-border-strong);
    border-radius:15px;
    background:color-mix(in srgb,var(--ra-surface) 95%,transparent);
    box-shadow:0 14px 38px rgba(0,0,0,.25);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    transition:
      opacity 180ms var(--ra-ease-standard),
      transform 180ms var(--ra-ease-standard);
  }

  .ra-mobile-tab{
    min-width:0;
    min-height:50px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:5px 4px;
    border:0;
    border-radius:11px;
    background:transparent;
    color:var(--ra-text-3);
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  .ra-mobile-tab span{
    font-size:6.5px;
    font-weight:850;
    letter-spacing:.08em;
  }
  .ra-mobile-tab b{
    font-size:9px;
    font-weight:780;
    white-space:nowrap;
  }
  .ra-mobile-tab.is-active{
    color:var(--ra-text-1);
    background:color-mix(in srgb,var(--ra-primary) 13%,var(--ra-surface));
    box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ra-primary) 26%,transparent);
  }
  .ra-mobile-tab.is-active span{
    color:var(--ra-primary);
  }

  body.ra-mobile-sheet-open .ra-mobile-app-nav{
    opacity:0;
    transform:translateY(8px);
    pointer-events:none;
  }

  /* Strategy controls must remain real touch targets after scenario playback. */
  .ra-strategy-switch button,
  .ra-model-card,
  #raRunScenario,
  #raOpenLabSheet,
  #raResetLab{
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  #lab:not(.is-scenario-running) .ra-strategy-switch button:not(:disabled),
  #lab:not(.is-scenario-running) .ra-model-card:not(:disabled){
    pointer-events:auto;
  }

  /* Give Safari room to paint playback after the controls sheet closes. */
  .ra-lab-earth-stage{
    isolation:isolate;
    contain:paint;
  }
  .ra-scenario-playback{
    z-index:24!important;
    pointer-events:none;
  }

  .ra-main{
    padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;
  }
  .ra-footer{
    padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;
  }
}

@media(max-width:429px){
  .ra-mobile-app-nav{
    left:6px;
    right:6px;
    bottom:max(6px,env(safe-area-inset-bottom,0px));
  }
  .ra-mobile-tab b{
    font-size:8.5px;
  }
}


/* =========================================================
   IOS-SAFE PACKET MOTION
   Packet positions are driven by requestAnimationFrame in JS.
   ========================================================= */

.ra-earth-packet,
.ra-request-packet,
.ra-recovery-packet{
  will-change:transform;
  vector-effect:non-scaling-stroke;
}

@media(max-width:767px){
  .ra-earth-packet{
    opacity:.66;
  }
  .ra-request-packet.is-visible{
    opacity:.82;
  }
  .ra-recovery-packet.is-visible{
    opacity:.84;
  }
}

@media(prefers-reduced-motion:reduce){
  .ra-earth-packet{
    opacity:.34!important;
  }
  .ra-request-packet.is-visible,
  .ra-recovery-packet.is-visible{
    opacity:.46!important;
  }
}


/* Essential state feedback remains visible when the OS requests reduced
   motion. Movement is smaller and slower, rather than disappearing. */
@keyframes raReducedEssentialState{
  from{opacity:.58}
  to{opacity:1}
}
@media(prefers-reduced-motion:reduce){
  .ra-earth-system.ra-state-changing .ra-earth-network,
  .ra-earth-system.ra-state-changing .ra-earth-bank-layer,
  .ra-earth-system.ra-state-changing .ra-earth-provider-layer,
  .ra-earth-system.ra-state-changing .ra-earth-readout{
    animation:raReducedEssentialState 340ms ease-out both!important;
  }
  .ra-earth-provider.is-outage .ra-provider-core,
  .ra-earth-provider.is-outage .ra-provider-halo{
    animation:raReducedEssentialState 440ms ease-out both!important;
  }
}


/* =========================================================
   SYNCED GUIDED CONTROLS — RUN / NARRATION / PAUSE
   ========================================================= */

.ra-sim-controls{
  grid-template-columns:minmax(0,1fr) auto auto;
}
.ra-pause-action{
  min-width:116px;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 12px;
  border:1px solid var(--ra-border);
  border-radius:var(--ra-radius-sm);
  background:var(--ra-surface-raised);
  color:var(--ra-text-2);
  font-size:9px;
  font-weight:760;
  cursor:pointer;
}
.ra-pause-action[aria-pressed="true"]{
  color:var(--ra-warning);
  border-color:color-mix(in srgb,var(--ra-warning) 38%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-warning) 6%,var(--ra-surface-raised));
}
.ra-pause-action:disabled{
  cursor:not-allowed;
  opacity:.42;
}
body.ra-guided-paused .ra-guided-hud{
  border-color:color-mix(in srgb,var(--ra-warning) 42%,var(--ra-border-strong));
}
body.ra-guided-paused .ra-guided-dot{
  background:var(--ra-warning)!important;
  box-shadow:none!important;
}
body.ra-guided-paused #raEarthMount *,
body.ra-guided-paused .ra-guided-hud.is-speaking .ra-waveform i,
body.ra-guided-paused .ra-guided-dot{
  animation-play-state:paused!important;
}
body.ra-guided-paused .ra-guided-progress i.is-active{
  background:var(--ra-warning);
  box-shadow:none;
}

[data-ra-theme="light"] .ra-pause-action{
  background:#f8fbfd;
}

@media(max-width:767px){
  .ra-sim-controls{
    grid-template-columns:1fr 1fr!important;
  }
  .ra-sim-controls .ra-primary-action{
    grid-column:1/-1;
    min-height:50px!important;
  }
  .ra-sim-controls .ra-quiet-action,
  .ra-sim-controls .ra-pause-action{
    width:100%;
    min-width:0!important;
    min-height:46px!important;
  }
}

@media(max-width:429px){
  .ra-sim-controls{
    gap:6px!important;
  }
  .ra-sim-controls .ra-quiet-action,
  .ra-sim-controls .ra-pause-action{
    padding-inline:8px;
    font-size:8.5px;
  }
}


/* =========================================================
   MOBILE RUN FOCUS — BUTTON FIT + IN-ANIMATION CONTROLS
   ========================================================= */

.ra-guided-actions{
  display:none;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
}
.ra-guided-actions button{
  min-height:28px;
  padding:0 9px;
  border:1px solid var(--ra-border);
  border-radius:7px;
  background:var(--ra-surface-soft);
  color:var(--ra-text-2);
  font-size:8px;
  font-weight:800;
  cursor:pointer;
}
.ra-guided-actions button[aria-pressed="true"]{
  color:var(--ra-warning);
  border-color:color-mix(in srgb,var(--ra-warning) 38%,var(--ra-border));
}
.ra-guided-actions button:disabled{
  opacity:.38;
}
body.ra-guided-running .ra-guided-actions{
  display:flex;
}

@media(max-width:767px){
  /* Primary run actions must fit without truncating on narrow iPhones. */
  #raRunPreview,
  #raRunScenario{
    width:100%!important;
    min-width:0!important;
    min-height:56px!important;
    padding:9px 14px!important;
    gap:10px!important;
    font-size:10.5px!important;
    line-height:1.2!important;
  }
  #raRunPreview>span,
  #raRunScenario>span{
    min-width:0;
    white-space:normal!important;
    overflow-wrap:anywhere;
    text-align:left;
  }
  #raRunPreview>b,
  #raRunScenario>b{
    flex:0 0 auto;
  }

  .ra-lab-run-block{
    gap:9px!important;
  }
  .ra-run-scenario{
    min-height:56px!important;
  }

  /* Once Run is tapped, controls remain available where the animation is. */
  .ra-guided-status{
    grid-template-columns:auto minmax(0,1fr) auto!important;
    gap:6px!important;
  }
  .ra-guided-status>#raGuidedScene{
    display:none!important;
  }
  .ra-guided-actions{
    min-width:0;
  }
  .ra-guided-actions button{
    min-width:54px;
    min-height:36px;
    padding:0 8px;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }

  body.ra-guided-running .ra-guided-hud{
    position:relative;
    z-index:30;
  }

  /* The lower rail keeps the large controls readable if the user scrolls back. */
  .ra-sim-controls{
    grid-template-columns:1fr 1fr!important;
  }
  .ra-sim-controls .ra-primary-action{
    grid-column:1/-1!important;
    min-height:56px!important;
  }
  .ra-sim-controls .ra-quiet-action,
  .ra-sim-controls .ra-pause-action{
    min-height:48px!important;
  }
}

@media(max-width:390px){
  #raRunPreview,
  #raRunScenario{
    font-size:10px!important;
    padding-inline:12px!important;
  }
  .ra-guided-actions button{
    min-width:50px;
    padding-inline:6px;
    font-size:7.5px;
  }
}


/* =========================================================
   NEURAL VOICEOVER + ROBUST MOBILE CONTROL STACK
   ========================================================= */

.ra-sim-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}
.ra-sim-secondary{
  display:flex;
  align-items:stretch;
  gap:8px;
}
.ra-sim-secondary .ra-quiet-action,
.ra-sim-secondary .ra-pause-action{
  min-height:52px;
}
.ra-quiet-action[data-voice-quality="neural"]{
  color:var(--ra-teal);
  border-color:color-mix(in srgb,var(--ra-teal) 32%,var(--ra-border));
}

@media(max-width:767px){
  .ra-sim-controls{
    display:flex!important;
    flex-direction:column!important;
    width:100%;
    gap:8px!important;
  }
  .ra-sim-controls>#raRunPreview{
    flex:0 0 auto;
    width:100%!important;
    min-width:100%!important;
    max-width:none!important;
    min-height:58px!important;
    padding:10px 16px!important;
    justify-content:space-between!important;
  }
  .ra-sim-controls>#raRunPreview>span{
    display:block;
    flex:1 1 auto;
    min-width:0;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    text-align:left;
    line-height:1.15!important;
  }
  .ra-sim-secondary{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .ra-sim-secondary .ra-quiet-action,
  .ra-sim-secondary .ra-pause-action{
    width:100%!important;
    min-width:0!important;
    min-height:48px!important;
    padding:0 10px!important;
  }

  #raRunScenario{
    display:flex!important;
    width:100%!important;
    min-width:100%!important;
    max-width:none!important;
    min-height:58px!important;
    padding:10px 16px!important;
    justify-content:space-between!important;
  }
  #raRunScenario>span{
    flex:1 1 auto;
    min-width:0;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    text-align:left;
    line-height:1.15!important;
  }
}

@media(max-width:390px){
  .ra-sim-secondary{
    grid-template-columns:1fr 1fr;
  }
  .ra-sim-secondary .ra-quiet-action,
  .ra-sim-secondary .ra-pause-action{
    padding-inline:7px!important;
    font-size:8px!important;
  }
}


/* =========================================================
   TOUCH / LANDSCAPE PHONE FIX
   Mobile behavior follows interaction mode, not only 767px width.
   ========================================================= */

/* Prevent the primary run action from being squeezed at tablet / narrow desktop widths. */
@media(max-width:1180px){
  .ra-sim-controls{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    gap:8px!important;
  }
  .ra-sim-controls>#raRunPreview{
    width:100%!important;
    min-width:100%!important;
    max-width:none!important;
    min-height:58px!important;
    padding:10px 16px!important;
    justify-content:space-between!important;
  }
  .ra-sim-controls>#raRunPreview>span{
    flex:1 1 auto!important;
    min-width:0!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    line-height:1.15!important;
    text-align:left!important;
  }
  .ra-sim-secondary{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .ra-sim-secondary .ra-quiet-action,
  .ra-sim-secondary .ra-pause-action{
    width:100%!important;
    min-width:0!important;
  }
}

/* Phone portrait, phone landscape and compact touch browsers. */
@media (max-width:960px), (pointer:coarse) and (max-width:1180px){
  html,body{
    min-width:320px;
    overflow-x:hidden!important;
  }

  .ra-header .ra-nav{
    display:none!important;
  }
  .ra-mobile-app-nav{
    position:fixed!important;
    z-index:100!important;
    left:8px!important;
    right:8px!important;
    bottom:max(8px,env(safe-area-inset-bottom,0px))!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    padding:4px!important;
    border:1px solid var(--ra-border-strong)!important;
    border-radius:15px!important;
    background:color-mix(in srgb,var(--ra-surface) 95%,transparent)!important;
    box-shadow:0 14px 38px rgba(0,0,0,.25)!important;
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
  }

  .ra-main{
    padding:8px 0 calc(92px + env(safe-area-inset-bottom,0px))!important;
  }

  /* Earth first, regardless of iPhone orientation. */
  #simulation.is-active{
    display:flex!important;
    flex-direction:column!important;
    gap:8px!important;
  }
  #simulation .ra-canvas-shell{
    order:1!important;
    width:100%!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  #simulation .ra-story-rail{
    order:2!important;
    width:auto!important;
    margin:0 8px!important;
  }
  #simulation .ra-earth-mount{
    min-height:max(390px,62svh)!important;
    scroll-margin-top:68px!important;
  }
  #simulation .ra-earth-svg{
    transform:scale(1.13)!important;
    transform-origin:50% 49%!important;
  }
  .ra-mobile-scene-nav{
    display:grid!important;
  }
  .ra-scene-list{
    display:none!important;
  }

  /* Once the run starts, make the animation the actual screen. */
  body.ra-guided-running #simulation .ra-story-rail{
    display:none!important;
  }
  body.ra-guided-running #simulation .ra-canvas-shell{
    min-height:calc(100svh - 72px)!important;
  }
  body.ra-guided-running #raEarthMount{
    min-height:calc(100svh - 150px)!important;
  }
  body.ra-guided-running .ra-guided-hud{
    position:relative!important;
    z-index:30!important;
    width:calc(100% - 16px)!important;
    margin:-96px 8px 8px!important;
  }

  /* Scenario Lab becomes a true touch workspace. */
  #lab.is-active{
    display:flex!important;
    flex-direction:column!important;
  }
  .ra-lab-workspace{
    width:100%!important;
  }
  .ra-mobile-lab-bar{
    display:grid!important;
  }
  .ra-mobile-sheet-head{
    display:grid!important;
  }
  .ra-lab-earth-stage,
  #raLabEarthMount{
    scroll-margin-top:68px!important;
  }

  .ra-lab-console{
    position:fixed!important;
    z-index:120!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    width:100%!important;
    max-height:min(88svh,760px)!important;
    min-height:0!important;
    margin:0!important;
    padding:0 14px calc(16px + env(safe-area-inset-bottom,0px))!important;
    display:block!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--ra-border-strong)!important;
    border-bottom:0!important;
    border-radius:18px 18px 0 0!important;
    background:var(--ra-surface)!important;
    box-shadow:0 -18px 50px rgba(0,0,0,.26)!important;
    transform:translateY(110%)!important;
    visibility:hidden!important;
    transition:transform 260ms var(--ra-ease-standard),visibility 260ms!important;
  }
  .ra-lab-console.is-mobile-open{
    transform:translateY(0)!important;
    visibility:visible!important;
  }
  .ra-mobile-sheet-backdrop{
    position:fixed!important;
    z-index:110!important;
    inset:0!important;
    display:block!important;
    background:rgba(0,0,0,.48)!important;
    backdrop-filter:blur(2px);
  }
  .ra-mobile-sheet-backdrop[hidden]{
    display:none!important;
  }

  #raRunScenario{
    width:100%!important;
    min-width:100%!important;
    max-width:none!important;
    min-height:58px!important;
    padding:10px 16px!important;
    justify-content:space-between!important;
  }
  #raRunScenario>span{
    flex:1 1 auto!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    line-height:1.15!important;
    text-align:left!important;
  }

  #lab.is-scenario-running .ra-lab-console{
    transform:translateY(110%)!important;
    visibility:hidden!important;
  }
  #lab.is-scenario-running .ra-lab-workspace{
    width:100%!important;
  }
  #lab.is-scenario-running .ra-scenario-playback{
    z-index:30!important;
    pointer-events:none!important;
  }

  .ra-earth-packet{
    opacity:.66!important;
  }
  .ra-request-packet.is-visible{
    opacity:.82!important;
  }
  .ra-recovery-packet.is-visible{
    opacity:.84!important;
  }
}

@media (pointer:coarse) and (orientation:landscape) and (max-height:720px){
  #simulation .ra-earth-mount,
  #raLabEarthMount{
    min-height:calc(100svh - 92px)!important;
  }
  body.ra-guided-running #raEarthMount{
    min-height:calc(100svh - 80px)!important;
  }
  .ra-guided-hud{
    margin-top:-88px!important;
  }
}


/* =========================================================
   RUN BUTTON FIT — PRIMARY ACTION ALWAYS GETS ITS OWN ROW
   ========================================================= */

.ra-sim-controls{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  gap:8px!important;
}

.ra-sim-controls>#raRunPreview{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:64px!important;
  height:auto!important;
  padding:12px 16px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  font-size:13px!important;
  line-height:1.15!important;
  text-align:left!important;
}

.ra-sim-controls>#raRunPreview>#raRunLabel{
  display:block!important;
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:calc(100% - 28px)!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
}

.ra-sim-controls>#raRunPreview>b{
  flex:0 0 auto!important;
  align-self:center!important;
}

.ra-sim-secondary{
  width:100%!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:8px!important;
}

.ra-sim-secondary .ra-quiet-action,
.ra-sim-secondary .ra-pause-action{
  width:100%!important;
  min-width:0!important;
}

@media(max-width:520px){
  .ra-sim-controls>#raRunPreview{
    min-height:68px!important;
    padding:12px 14px!important;
    font-size:12px!important;
  }

  .ra-sim-controls>#raRunPreview>#raRunLabel{
    max-width:calc(100% - 24px)!important;
  }
}


/* =========================================================
   GUIDED INTRO — BUILD THE SHARED DEPENDENCY MAP ON SCENE 01
   ========================================================= */

#raEarthMount.ra-guided-intro .ra-earth-atmosphere{
  animation:raIntroAtmosphere 1.15s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-guided-intro .ra-earth-grid,
#raEarthMount.ra-guided-intro .ra-earth-land{
  animation:raIntroWorld 1.05s var(--ra-ease-standard) both;
}
#raEarthMount.ra-guided-intro .ra-earth-provider{
  opacity:0;
  animation:raIntroProvider .72s var(--ra-ease-emphasis) both;
  animation-delay:calc(.42s + var(--ra-intro-index,0) * .28s);
}
#raEarthMount.ra-guided-intro .ra-earth-provider .ra-provider-halo{
  animation:raIntroProviderHalo 1.25s ease-out both;
  animation-delay:calc(.58s + var(--ra-intro-index,0) * .28s);
}
#raEarthMount.ra-guided-intro .ra-earth-bank{
  opacity:0;
  animation:raIntroBank .52s var(--ra-ease-standard) both;
  animation-delay:calc(1.18s + var(--ra-intro-index,0) * .055s);
}
#raEarthMount.ra-guided-intro .ra-earth-link{
  opacity:0;
  stroke-dasharray:1;
  stroke-dashoffset:1;
  animation:raIntroDependency 1.05s var(--ra-ease-standard) both;
  animation-delay:calc(1.42s + var(--ra-intro-index,0) * .045s);
}
#raEarthMount.ra-guided-intro .ra-earth-packet{
  opacity:0!important;
  animation:raIntroPackets .48s ease-out both;
  animation-delay:calc(2.85s + var(--ra-intro-index,0) * .018s);
}
#raEarthMount.ra-guided-intro .ra-earth-readout{
  animation:raIntroReadout .55s ease-out both;
  animation-delay:2.95s;
}
#raEarthMount.ra-guided-intro .ra-earth-state b::after{
  content:" · MAPPING DEPENDENCIES";
  color:var(--ra-primary);
  font-size:.72em;
  letter-spacing:.05em;
}

@keyframes raIntroAtmosphere{
  0%{opacity:.15;stroke-width:.55}
  55%{opacity:.72;stroke-width:2.1}
  100%{opacity:1;stroke-width:1.35}
}
@keyframes raIntroWorld{
  from{opacity:.18}
  to{opacity:1}
}
@keyframes raIntroProvider{
  0%{opacity:0}
  55%{opacity:1}
  100%{opacity:1}
}
@keyframes raIntroProviderHalo{
  0%{opacity:0;transform:scale(.55)}
  52%{opacity:1;transform:scale(1.22)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes raIntroBank{
  from{opacity:0}
  to{opacity:1}
}
@keyframes raIntroDependency{
  0%{opacity:0;stroke-dashoffset:1}
  20%{opacity:.12}
  100%{opacity:.28;stroke-dashoffset:0}
}
@keyframes raIntroPackets{
  from{opacity:0}
  to{opacity:.7}
}
@keyframes raIntroReadout{
  from{opacity:0;transform:translateY(-5px)}
  to{opacity:1;transform:translateY(0)}
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount.ra-guided-intro .ra-earth-atmosphere,
  #raEarthMount.ra-guided-intro .ra-earth-grid,
  #raEarthMount.ra-guided-intro .ra-earth-land,
  #raEarthMount.ra-guided-intro .ra-earth-provider,
  #raEarthMount.ra-guided-intro .ra-earth-provider .ra-provider-halo,
  #raEarthMount.ra-guided-intro .ra-earth-bank,
  #raEarthMount.ra-guided-intro .ra-earth-link,
  #raEarthMount.ra-guided-intro .ra-earth-packet,
  #raEarthMount.ra-guided-intro .ra-earth-readout{
    animation-duration:.3s!important;
    animation-delay:0s!important;
  }
}


/* =========================================================
   GUIDED INTRO V2 — EXPLICIT FIVE-PHASE SYSTEM BUILD
   Strong enough to read clearly on iPhone and desktop.
   ========================================================= */

#raEarthMount.ra-guided-intro{
  overflow:hidden;
}
#raEarthMount.ra-guided-intro .ra-earth-atmosphere,
#raEarthMount.ra-guided-intro .ra-earth-grid,
#raEarthMount.ra-guided-intro .ra-earth-land,
#raEarthMount.ra-guided-intro .ra-earth-provider,
#raEarthMount.ra-guided-intro .ra-earth-provider .ra-provider-halo,
#raEarthMount.ra-guided-intro .ra-earth-bank,
#raEarthMount.ra-guided-intro .ra-earth-link,
#raEarthMount.ra-guided-intro .ra-earth-packet,
#raEarthMount.ra-guided-intro .ra-earth-readout{
  animation:none!important;
}
#raEarthMount.ra-guided-intro::after{
  content:attr(data-intro-phase);
  position:absolute;
  z-index:40;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  max-width:calc(100% - 32px);
  padding:8px 13px;
  border:1px solid color-mix(in srgb,var(--ra-primary) 45%,var(--ra-border));
  border-radius:999px;
  background:color-mix(in srgb,var(--ra-surface) 92%,transparent);
  color:var(--ra-text-1);
  box-shadow:0 8px 28px rgba(0,0,0,.24);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  font-size:9px;
  font-weight:850;
  letter-spacing:.09em;
  white-space:nowrap;
  pointer-events:none;
}
#raEarthMount.ra-guided-intro::before{
  content:"";
  position:absolute;
  z-index:3;
  left:50%;
  top:50%;
  width:min(54vw,520px);
  aspect-ratio:1;
  border:1px solid color-mix(in srgb,var(--ra-primary) 55%,transparent);
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.72);
  opacity:0;
  box-shadow:
    0 0 0 1px color-mix(in srgb,var(--ra-primary) 14%,transparent),
    0 0 34px color-mix(in srgb,var(--ra-primary) 18%,transparent);
  pointer-events:none;
}
#raEarthMount.ra-guided-intro.ra-intro-world::before{
  animation:raIntroScanRing 1.4s var(--ra-ease-emphasis) both;
}

/* Start with a deliberately incomplete, muted system. */
#raEarthMount.ra-guided-intro .ra-earth-ocean{
  opacity:.42!important;
  filter:brightness(.62) saturate(.72)!important;
  transition:opacity .55s ease,filter .7s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-atmosphere{
  opacity:.18!important;
  transition:opacity .65s ease,stroke-width .65s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-grid,
#raEarthMount.ra-guided-intro .ra-earth-land{
  opacity:.1!important;
  transition:opacity .7s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-provider{
  opacity:0!important;
  transition:
    opacity .45s ease,
    filter .55s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-provider .ra-provider-halo{
  opacity:.15!important;
  transform:scale(.55);
  transform-box:fill-box;
  transform-origin:center;
  transition:transform .62s var(--ra-ease-emphasis),opacity .5s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-bank{
  opacity:0!important;
  transition:opacity .35s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-link{
  opacity:0!important;
  stroke-width:1.8!important;
  stroke-dasharray:1!important;
  stroke-dashoffset:1!important;
  transition:
    opacity .35s ease,
    stroke-dashoffset .95s var(--ra-ease-standard),
    stroke-width .55s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-packet{
  opacity:0!important;
  transition:opacity .35s ease!important;
}
#raEarthMount.ra-guided-intro .ra-earth-readout{
  opacity:.18!important;
  transition:opacity .45s ease!important;
}

/* 1. Earth powers on. */
#raEarthMount.ra-guided-intro.ra-intro-world .ra-earth-ocean{
  opacity:1!important;
  filter:brightness(1) saturate(1)!important;
}
#raEarthMount.ra-guided-intro.ra-intro-world .ra-earth-atmosphere{
  opacity:1!important;
  stroke-width:2!important;
}
#raEarthMount.ra-guided-intro.ra-intro-world .ra-earth-grid,
#raEarthMount.ra-guided-intro.ra-intro-world .ra-earth-land{
  opacity:.82!important;
}

/* 2. The three shared providers activate visibly. */
#raEarthMount.ra-guided-intro.ra-intro-providers .ra-earth-provider{
  opacity:1!important;
  filter:drop-shadow(0 0 12px var(--provider-color))!important;
}
#raEarthMount.ra-guided-intro.ra-intro-providers .ra-earth-provider .ra-provider-halo{
  opacity:1!important;
  transform:scale(1.18);
}
#raEarthMount.ra-guided-intro.ra-intro-providers .ra-earth-provider:nth-child(2){
  transition-delay:.16s!important;
}
#raEarthMount.ra-guided-intro.ra-intro-providers .ra-earth-provider:nth-child(3){
  transition-delay:.32s!important;
}

/* 3. Banks populate the system in a cascade. */
#raEarthMount.ra-guided-intro.ra-intro-banks .ra-earth-bank{
  opacity:1!important;
  transition-delay:calc(var(--ra-intro-index,0) * .035s)!important;
}
#raEarthMount.ra-guided-intro.ra-intro-banks .ra-bank-node{
  filter:drop-shadow(0 0 5px var(--node-color));
}

/* 4. Shared dependency paths visibly draw from providers to banks. */
#raEarthMount.ra-guided-intro.ra-intro-links .ra-earth-link{
  opacity:.78!important;
  stroke-dashoffset:0!important;
  stroke-width:1.75!important;
  transition-delay:calc(var(--ra-intro-index,0) * .028s)!important;
}

/* 5. Live traffic turns on and the network settles into operation. */
#raEarthMount.ra-guided-intro.ra-intro-flow .ra-earth-packet{
  opacity:.95!important;
  transition-delay:calc(var(--ra-intro-index,0) * .018s)!important;
}
#raEarthMount.ra-guided-intro.ra-intro-flow .ra-earth-link{
  opacity:.36!important;
  stroke-width:1.2!important;
}
#raEarthMount.ra-guided-intro.ra-intro-flow .ra-earth-readout{
  opacity:1!important;
}

@keyframes raIntroScanRing{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.58)}
  30%{opacity:.72}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.08)}
}

@media(max-width:767px), (pointer:coarse) and (max-width:1180px){
  #raEarthMount.ra-guided-intro::after{
    bottom:74px;
    max-width:calc(100% - 24px);
    padding:7px 10px;
    font-size:7.5px;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #raEarthMount.ra-guided-intro::before{
    width:min(78vw,480px);
  }
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount.ra-guided-intro::before{
    animation:none!important;
    opacity:.25!important;
    transform:translate(-50%,-50%) scale(1)!important;
  }
  #raEarthMount.ra-guided-intro .ra-earth-ocean,
  #raEarthMount.ra-guided-intro .ra-earth-atmosphere,
  #raEarthMount.ra-guided-intro .ra-earth-grid,
  #raEarthMount.ra-guided-intro .ra-earth-land,
  #raEarthMount.ra-guided-intro .ra-earth-provider,
  #raEarthMount.ra-guided-intro .ra-earth-provider .ra-provider-halo,
  #raEarthMount.ra-guided-intro .ra-earth-bank,
  #raEarthMount.ra-guided-intro .ra-earth-link,
  #raEarthMount.ra-guided-intro .ra-earth-packet,
  #raEarthMount.ra-guided-intro .ra-earth-readout{
    transition-duration:.16s!important;
    transition-delay:0s!important;
  }
}


/* =========================================================
   WORD-SYNCED GUIDED TIMELINE
   Visual cues are driven by guidedAudio.currentTime timestamps.
   ========================================================= */

#raEarthMount.ra-guided-sync{
  --ra-sync-accent:var(--ra-primary);
  overflow:hidden;
}

#raEarthMount.ra-guided-sync::after{
  content:attr(data-guided-caption);
  position:absolute;
  z-index:42;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  max-width:calc(100% - 36px);
  padding:8px 14px;
  border:1px solid color-mix(in srgb,var(--ra-sync-accent) 48%,var(--ra-border));
  border-radius:999px;
  background:color-mix(in srgb,var(--ra-surface) 94%,transparent);
  color:var(--ra-text-1);
  box-shadow:
    0 8px 28px rgba(0,0,0,.22),
    0 0 24px color-mix(in srgb,var(--ra-sync-accent) 9%,transparent);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  font-size:9px;
  font-weight:860;
  letter-spacing:.09em;
  white-space:nowrap;
  pointer-events:none;
}

#raEarthMount.ra-guided-sync .ra-earth-provider,
#raEarthMount.ra-guided-sync .ra-earth-bank,
#raEarthMount.ra-guided-sync .ra-earth-link,
#raEarthMount.ra-guided-sync .ra-earth-packet,
#raEarthMount.ra-guided-sync .ra-request-flow,
#raEarthMount.ra-guided-sync .ra-request-packet,
#raEarthMount.ra-guided-sync .ra-recovery-flow,
#raEarthMount.ra-guided-sync .ra-recovery-packet,
#raEarthMount.ra-guided-sync .ra-pool-node,
#raEarthMount.ra-guided-sync .ra-market-node{
  transition:
    opacity .42s var(--ra-ease-standard),
    filter .42s var(--ra-ease-standard),
    stroke .42s var(--ra-ease-standard),
    fill .42s var(--ra-ease-standard),
    stroke-width .42s var(--ra-ease-standard),
    stroke-dashoffset .8s var(--ra-ease-standard)!important;
}

/* Scene 1 — words build the dependency network. */
#raEarthMount.ra-sync-s1-world .ra-earth-provider,
#raEarthMount.ra-sync-s1-world .ra-earth-bank,
#raEarthMount.ra-sync-s1-world .ra-earth-link,
#raEarthMount.ra-sync-s1-world .ra-earth-packet{
  opacity:0!important;
}
#raEarthMount.ra-sync-s1-world .ra-earth-ocean{
  filter:brightness(.78) saturate(.75);
}
#raEarthMount.ra-sync-s1-world .ra-earth-atmosphere{
  animation:raSyncWorldWake 1.6s var(--ra-ease-emphasis) both;
}

#raEarthMount.ra-sync-s1-providers .ra-earth-provider{
  opacity:1!important;
  filter:drop-shadow(0 0 12px color-mix(in srgb,var(--provider-color) 60%,transparent));
}
#raEarthMount.ra-sync-s1-providers .ra-earth-bank,
#raEarthMount.ra-sync-s1-providers .ra-earth-link,
#raEarthMount.ra-sync-s1-providers .ra-earth-packet{
  opacity:0!important;
}
#raEarthMount.ra-sync-s1-providers .ra-provider-halo{
  animation:raSyncProviderArrival 1.25s var(--ra-ease-emphasis) both;
}

#raEarthMount.ra-sync-s1-banks .ra-earth-provider,
#raEarthMount.ra-sync-s1-banks .ra-earth-bank{
  opacity:1!important;
}
#raEarthMount.ra-sync-s1-banks .ra-earth-bank{
  transition-delay:calc(var(--ra-intro-index,0) * .025s)!important;
}
#raEarthMount.ra-sync-s1-banks .ra-earth-link{
  opacity:0!important;
  stroke-dasharray:1!important;
  stroke-dashoffset:1!important;
}
#raEarthMount.ra-sync-s1-banks .ra-earth-packet{
  opacity:0!important;
}

#raEarthMount.ra-sync-s1-links .ra-earth-link{
  opacity:.78!important;
  stroke-dasharray:1!important;
  stroke-dashoffset:0!important;
  stroke-width:1.55!important;
  transition-delay:calc(var(--ra-intro-index,0) * .022s)!important;
}
#raEarthMount.ra-sync-s1-links .ra-earth-packet{
  opacity:0!important;
}

#raEarthMount.ra-sync-s1-flow .ra-earth-link{
  opacity:.31!important;
}
#raEarthMount.ra-sync-s1-flow .ra-earth-packet{
  opacity:.95!important;
}

#raEarthMount.ra-sync-s1-cluster{
  --ra-sync-accent:var(--ra-provider-blue);
}
#raEarthMount.ra-sync-s1-cluster .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s1-cluster .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s1-cluster .ra-earth-link:not(.provider-blue){
  opacity:.22!important;
}
#raEarthMount.ra-sync-s1-cluster .provider-blue,
#raEarthMount.ra-sync-s1-cluster .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s1-cluster .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:color-mix(in srgb,var(--ra-provider-blue) 55%,transparent);
  fill:color-mix(in srgb,var(--ra-provider-blue) 13%,transparent);
}

#raEarthMount.ra-sync-s1-risk{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s1-risk .provider-blue .ra-provider-halo{
  stroke:var(--ra-warning)!important;
  fill:color-mix(in srgb,var(--ra-warning) 13%,transparent)!important;
  animation:raSyncRiskPulse 1.4s ease-in-out infinite;
}
#raEarthMount.ra-sync-s1-risk .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:color-mix(in srgb,var(--ra-warning) 58%,transparent)!important;
  fill:color-mix(in srgb,var(--ra-warning) 10%,transparent)!important;
}

/* Scene 2 — failure happens on the spoken word "fails". */
#raEarthMount.ra-sync-s2-target{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s2-target .provider-blue .ra-provider-halo{
  stroke:var(--ra-warning)!important;
  stroke-width:2!important;
  animation:raSyncRiskPulse 1.05s ease-in-out infinite;
}
#raEarthMount.ra-sync-s2-target .ra-earth-provider:not(.provider-blue){
  opacity:.48!important;
}

#raEarthMount.ra-sync-s2-fail,
#raEarthMount.ra-sync-s2-affected,
#raEarthMount.ra-sync-s2-capacity-lost,
#raEarthMount.ra-sync-s2-shared,
#raEarthMount.ra-sync-s2-systemic{
  --ra-sync-accent:var(--ra-critical);
}
#raEarthMount.ra-sync-s2-fail .provider-blue .ra-provider-halo{
  animation:raSyncFailureRing .9s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s2-affected .ra-earth-bank[data-provider="blue"] .ra-bank-halo,
#raEarthMount.ra-sync-s2-shared .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:color-mix(in srgb,var(--ra-critical) 70%,transparent)!important;
  stroke-width:1.8!important;
  animation:raSyncAffectedPulse 1.4s ease-in-out infinite;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-link.provider-blue{
  opacity:.58!important;
  stroke-width:1.8!important;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-packet.provider-blue{
  opacity:0!important;
}
#raEarthMount.ra-sync-s2-systemic{
  background:
    radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--ra-critical) 11%,transparent),transparent 34%),
    var(--ra-surface-soft)!important;
}

/* Scene 3 — requests start exactly when narrator says "request backup capacity". */
#raEarthMount.ra-sync-s3-recover{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s3-recover .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  animation:raSyncDemandPulse 1.15s ease-in-out infinite;
  stroke:color-mix(in srgb,var(--ra-warning) 58%,transparent)!important;
}
#raEarthMount.ra-sync-s3-request,
#raEarthMount.ra-sync-s3-market,
#raEarthMount.ra-sync-s3-queue,
#raEarthMount.ra-sync-s3-gap{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s3-request .ra-request-flow.is-visible,
#raEarthMount.ra-sync-s3-market .ra-request-flow.is-visible,
#raEarthMount.ra-sync-s3-queue .ra-request-flow.is-visible,
#raEarthMount.ra-sync-s3-gap .ra-request-flow.is-visible{
  opacity:.72!important;
  stroke-width:1.6!important;
}
#raEarthMount.ra-sync-s3-request .ra-request-packet.is-visible,
#raEarthMount.ra-sync-s3-market .ra-request-packet.is-visible,
#raEarthMount.ra-sync-s3-queue .ra-request-packet.is-visible,
#raEarthMount.ra-sync-s3-gap .ra-request-packet.is-visible{
  opacity:1!important;
  filter:drop-shadow(0 0 5px var(--ra-warning));
}
#raEarthMount.ra-sync-s3-market .ra-market-ring,
#raEarthMount.ra-sync-s3-queue .ra-market-ring{
  stroke-width:2!important;
  animation:raSyncMarketPulse 1.25s ease-in-out infinite!important;
}
#raEarthMount.ra-sync-s3-queue .ra-market-core{
  filter:drop-shadow(0 0 10px var(--ra-warning));
}
#raEarthMount.ra-sync-s3-gap .ra-earth-readout>div:nth-child(2){
  background:color-mix(in srgb,var(--ra-warning) 14%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ra-warning) 45%,transparent);
}
#raEarthMount.ra-sync-s3-gap .ra-earth-readout>div:nth-child(2) b{
  color:var(--ra-warning);
  transform:scale(1.08);
}

/* Scene 4 — local reserves appear, then the ring-fence becomes obvious. */
#raEarthMount.ra-sync-s4-reserves,
#raEarthMount.ra-sync-s4-ringfenced,
#raEarthMount.ra-sync-s4-unused,
#raEarthMount.ra-sync-s4-blocked,
#raEarthMount.ra-sync-s4-stranded,
#raEarthMount.ra-sync-s4-shortage{
  --ra-sync-accent:var(--ra-orange);
}
#raEarthMount.ra-sync-s4-reserves .ra-bank-reserve,
#raEarthMount.ra-sync-s4-ringfenced .ra-bank-reserve,
#raEarthMount.ra-sync-s4-unused .ra-bank-reserve,
#raEarthMount.ra-sync-s4-blocked .ra-bank-reserve,
#raEarthMount.ra-sync-s4-stranded .ra-bank-reserve,
#raEarthMount.ra-sync-s4-shortage .ra-bank-reserve{
  opacity:.82!important;
}
#raEarthMount.ra-sync-s4-ringfenced .ra-bank-reserve{
  stroke:var(--ra-orange)!important;
  stroke-width:1.7!important;
  animation:raSyncReserveLock 1.4s ease-in-out infinite;
}
#raEarthMount.ra-sync-s4-unused .ra-earth-bank:not([data-provider="blue"]) .ra-bank-reserve{
  stroke:var(--ra-teal)!important;
  filter:drop-shadow(0 0 5px color-mix(in srgb,var(--ra-teal) 55%,transparent));
}
#raEarthMount.ra-sync-s4-blocked .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s4-blocked .ra-earth-bank:not([data-provider="blue"]) .ra-bank-reserve{
  stroke:var(--ra-teal)!important;
}
#raEarthMount.ra-sync-s4-stranded .ra-earth-bank[data-provider="blue"] .ra-bank-halo,
#raEarthMount.ra-sync-s4-shortage .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:color-mix(in srgb,var(--ra-warning) 70%,transparent)!important;
  animation:raSyncAffectedPulse 1.5s ease-in-out infinite;
}

/* Scene 5 — pool appears before routing; routing only starts on "pooled and redirected". */
#raEarthMount.ra-sync-s5-pool,
#raEarthMount.ra-sync-s5-samebudget,
#raEarthMount.ra-sync-s5-coordinate,
#raEarthMount.ra-sync-s5-ready,
#raEarthMount.ra-sync-s5-redirect,
#raEarthMount.ra-sync-s5-recover{
  --ra-sync-accent:var(--ra-teal);
}
#raEarthMount.ra-sync-s5-pool .ra-pool-node,
#raEarthMount.ra-sync-s5-samebudget .ra-pool-node,
#raEarthMount.ra-sync-s5-coordinate .ra-pool-node{
  opacity:1!important;
}
#raEarthMount.ra-sync-s5-pool .ra-pool-ring{
  animation:raSyncPoolArrive 1.25s var(--ra-ease-emphasis) both!important;
}
#raEarthMount.ra-sync-s5-samebudget .ra-bank-reserve{
  opacity:.72!important;
}
#raEarthMount.ra-sync-s5-coordinate .ra-pool-ring{
  stroke-width:2!important;
  animation:raPoolSignal 2s ease-in-out infinite!important;
}
#raEarthMount.ra-sync-s5-ready .ra-recovery-flow.is-visible{
  opacity:.2!important;
  stroke-width:1.2!important;
}
#raEarthMount.ra-sync-s5-ready .ra-recovery-packet.is-visible{
  opacity:0!important;
}
#raEarthMount.ra-sync-s5-ready .ra-earth-bank.is-recovered .ra-bank-node,
#raEarthMount.ra-sync-s5-ready .ra-earth-bank.is-partial .ra-bank-node{
  fill:var(--ra-warning)!important;
  stroke:var(--ra-warning)!important;
  filter:none!important;
}
#raEarthMount.ra-sync-s5-redirect .ra-recovery-flow.is-visible{
  opacity:.9!important;
  stroke-width:2.2!important;
}
#raEarthMount.ra-sync-s5-redirect .ra-recovery-packet.is-visible{
  opacity:1!important;
  filter:drop-shadow(0 0 6px var(--ra-teal));
}
#raEarthMount.ra-sync-s5-redirect .ra-earth-bank.is-recovered .ra-bank-node,
#raEarthMount.ra-sync-s5-redirect .ra-earth-bank.is-partial .ra-bank-node{
  fill:var(--ra-teal)!important;
  stroke:var(--ra-teal)!important;
}
#raEarthMount.ra-sync-s5-recover .ra-earth-bank.is-recovered .ra-bank-halo,
#raEarthMount.ra-sync-s5-recover .ra-earth-bank.is-partial .ra-bank-halo{
  animation:raSyncRecoverySettle 1.45s ease-in-out infinite;
}

/* Scene 6 — each mechanism gets its own spoken beat. */
#raEarthMount.ra-sync-s6-market{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s6-individual{
  --ra-sync-accent:var(--ra-orange);
}
#raEarthMount.ra-sync-s6-scfr,
#raEarthMount.ra-sync-s6-outcome{
  --ra-sync-accent:var(--ra-teal);
}
#raEarthMount.ra-sync-s6-boundary{
  --ra-sync-accent:var(--ra-text-3);
}
#raEarthMount.ra-sync-s6-market .ra-earth-readout,
#raEarthMount.ra-sync-s6-individual .ra-earth-readout,
#raEarthMount.ra-sync-s6-scfr .ra-earth-readout{
  box-shadow:0 0 0 1px color-mix(in srgb,var(--ra-sync-accent) 45%,transparent);
}
#raEarthMount.ra-sync-s6-scfr .ra-earth-bank.is-recovered .ra-bank-node{
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--ra-teal) 72%,transparent));
}
#raEarthMount.ra-sync-s6-boundary .ra-earth-svg{
  opacity:.72;
  filter:saturate(.68);
}

/* Phrase-level motion grammar. */
@keyframes raSyncWorldWake{
  0%{opacity:.28;stroke-width:.5}
  55%{opacity:1;stroke-width:2.2}
  100%{opacity:1;stroke-width:1.35}
}
@keyframes raSyncProviderArrival{
  0%{opacity:.1;transform:scale(.45)}
  60%{opacity:1;transform:scale(1.22)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes raSyncRiskPulse{
  0%,100%{opacity:.55;transform:scale(1)}
  50%{opacity:1;transform:scale(1.18)}
}
@keyframes raSyncFailureRing{
  0%{opacity:1;transform:scale(.75)}
  42%{opacity:1;transform:scale(1.35)}
  100%{opacity:.5;transform:scale(1)}
}
@keyframes raSyncAffectedPulse{
  0%,100%{opacity:.45}
  50%{opacity:1}
}
@keyframes raSyncDemandPulse{
  0%,100%{opacity:.35;transform:scale(.92)}
  50%{opacity:1;transform:scale(1.12)}
}
@keyframes raSyncMarketPulse{
  0%,100%{opacity:.45}
  50%{opacity:1}
}
@keyframes raSyncReserveLock{
  0%,100%{stroke-dashoffset:0;opacity:.58}
  50%{stroke-dashoffset:5;opacity:1}
}
@keyframes raSyncPoolArrive{
  0%{opacity:0;transform:scale(.55)}
  58%{opacity:1;transform:scale(1.2)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes raSyncRecoverySettle{
  0%,100%{opacity:.35}
  50%{opacity:.95}
}

@media(max-width:767px), (pointer:coarse) and (max-width:1180px){
  #raEarthMount.ra-guided-sync::after{
    bottom:74px;
    max-width:calc(100% - 24px);
    padding:7px 10px;
    font-size:7.4px;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount.ra-guided-sync .ra-provider-halo,
  #raEarthMount.ra-guided-sync .ra-bank-halo,
  #raEarthMount.ra-guided-sync .ra-market-ring,
  #raEarthMount.ra-guided-sync .ra-pool-ring{
    animation-duration:.9s!important;
  }
}


/* =========================================================
   STORYBOARD STAGE 1 — VIDEO HUD + SCENE 01 MASTER
   Canonical final override: the HUD never covers the Earth.
   ========================================================= */

#simulation .ra-video-hud{
  position:relative!important;
  inset:auto!important;
  z-index:20!important;
  width:100%!important;
  min-height:0!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  grid-template-areas:
    "status copy actions"
    "progress progress progress"!important;
  align-items:center!important;
  gap:8px 12px!important;
  padding:7px 12px 5px!important;
  border:0!important;
  border-top:1px solid var(--ra-border-strong)!important;
  border-bottom:1px solid var(--ra-border)!important;
  border-radius:0!important;
  background:color-mix(in srgb,var(--ra-surface) 97%,transparent)!important;
  box-shadow:none!important;
  backdrop-filter:blur(12px)!important;
  -webkit-backdrop-filter:blur(12px)!important;
  overflow:visible!important;
  transform:none!important;
}

#simulation .ra-video-hud .ra-guided-status{
  grid-area:status!important;
  min-height:32px!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  white-space:nowrap;
}

#simulation .ra-video-hud .ra-guided-status b,
#simulation .ra-video-hud .ra-guided-status span{
  font-size:7.5px!important;
  letter-spacing:.08em!important;
}

#simulation .ra-video-hud .ra-guided-copy{
  grid-area:copy!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
}

#simulation .ra-video-hud .ra-guided-copy span{
  color:var(--ra-primary)!important;
  font-size:7px!important;
  font-weight:850!important;
  letter-spacing:.1em!important;
  white-space:nowrap!important;
}

#simulation .ra-video-hud .ra-guided-copy strong{
  min-width:0!important;
  max-width:none!important;
  color:var(--ra-text-2)!important;
  font-size:9px!important;
  line-height:1.25!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

#simulation .ra-video-hud .ra-guided-actions{
  grid-area:actions!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:5px!important;
}

#simulation .ra-video-hud .ra-guided-actions button{
  min-width:52px!important;
  min-height:30px!important;
  padding:0 9px!important;
  border-radius:7px!important;
  font-size:7.5px!important;
}

#simulation .ra-video-hud .ra-guided-progress{
  grid-area:progress!important;
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  width:100%!important;
  height:2px!important;
  margin-top:0!important;
  display:grid!important;
  grid-template-columns:repeat(6,1fr)!important;
  gap:4px!important;
}

/* While Guided Simulation runs, the Earth keeps its full height.
   Nothing is pulled upward over the globe. */
body.ra-guided-running #simulation .ra-video-hud{
  position:relative!important;
  margin:0!important;
  transform:none!important;
}
body.ra-guided-running #simulation .ra-canvas-shell{
  min-height:0!important;
}
body.ra-guided-running #simulation #raEarthMount{
  margin-bottom:0!important;
}

/* Scene 01 master choreography.
   Cue timestamps are driven by narrator audio.currentTime. */
#raEarthMount.ra-sync-s1-world{
  --ra-sync-accent:var(--ra-primary);
}
#raEarthMount.ra-sync-s1-world .ra-earth-ocean{
  opacity:.56!important;
  filter:brightness(.7) saturate(.68)!important;
}
#raEarthMount.ra-sync-s1-world .ra-earth-land{
  opacity:.2!important;
}
#raEarthMount.ra-sync-s1-world .ra-earth-grid{
  opacity:.34!important;
}
#raEarthMount.ra-sync-s1-world .ra-earth-provider,
#raEarthMount.ra-sync-s1-world .ra-earth-bank,
#raEarthMount.ra-sync-s1-world .ra-earth-link,
#raEarthMount.ra-sync-s1-world .ra-earth-packet{
  opacity:0!important;
}
#raEarthMount.ra-sync-s1-world::before{
  content:"";
  position:absolute;
  z-index:4;
  left:50%;
  top:50%;
  width:min(54%,430px);
  aspect-ratio:1;
  border:1px solid color-mix(in srgb,var(--ra-primary) 54%,transparent);
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.62);
  opacity:0;
  box-shadow:0 0 36px color-mix(in srgb,var(--ra-primary) 18%,transparent);
  animation:raStage1EarthBoot 1.55s var(--ra-ease-emphasis) both;
  pointer-events:none;
}

#raEarthMount.ra-sync-s1-providers .ra-earth-provider{
  opacity:1!important;
}
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(1){
  animation:raStage1NodeOn .72s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(2){
  animation:raStage1NodeOn .72s .14s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(3){
  animation:raStage1NodeOn .72s .28s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s1-providers .ra-earth-bank,
#raEarthMount.ra-sync-s1-providers .ra-earth-link,
#raEarthMount.ra-sync-s1-providers .ra-earth-packet{
  opacity:0!important;
}

#raEarthMount.ra-sync-s1-banks .ra-earth-bank{
  opacity:1!important;
  animation:raStage1BankOn .42s var(--ra-ease-standard) both;
  animation-delay:calc(var(--ra-intro-index,0) * .028s);
}
#raEarthMount.ra-sync-s1-banks .ra-earth-link,
#raEarthMount.ra-sync-s1-banks .ra-earth-packet{
  opacity:0!important;
}

#raEarthMount.ra-sync-s1-links .ra-earth-link{
  opacity:.82!important;
  stroke-dasharray:1!important;
  stroke-dashoffset:0!important;
  stroke-width:1.65!important;
  transition:
    stroke-dashoffset .72s var(--ra-ease-standard),
    opacity .36s ease!important;
  transition-delay:calc(var(--ra-intro-index,0) * .018s)!important;
}
#raEarthMount.ra-sync-s1-links .ra-earth-packet{
  opacity:0!important;
}

#raEarthMount.ra-sync-s1-flow .ra-earth-link{
  opacity:.3!important;
  stroke-width:1.05!important;
}
#raEarthMount.ra-sync-s1-flow .ra-earth-packet{
  opacity:.98!important;
  filter:drop-shadow(0 0 4px currentColor);
}

#raEarthMount.ra-sync-s1-cluster .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s1-cluster .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s1-cluster .ra-earth-link:not(.provider-blue),
#raEarthMount.ra-sync-s1-cluster .ra-earth-packet:not(.provider-blue){
  opacity:.12!important;
}
#raEarthMount.ra-sync-s1-cluster .provider-blue,
#raEarthMount.ra-sync-s1-cluster .ra-earth-bank[data-provider="blue"],
#raEarthMount.ra-sync-s1-cluster .ra-earth-link.provider-blue,
#raEarthMount.ra-sync-s1-cluster .ra-earth-packet.provider-blue{
  opacity:1!important;
}
#raEarthMount.ra-sync-s1-cluster .provider-blue .ra-provider-halo{
  stroke-width:2!important;
  animation:raStage1ClusterPulse 1.5s ease-in-out infinite;
}

#raEarthMount.ra-sync-s1-risk{
  --ra-sync-accent:var(--ra-warning);
}
#raEarthMount.ra-sync-s1-risk .provider-blue .ra-provider-halo{
  stroke:var(--ra-warning)!important;
  stroke-width:2.3!important;
  animation:raStage1RiskPulse 1.12s ease-in-out infinite;
}
#raEarthMount.ra-sync-s1-risk .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:color-mix(in srgb,var(--ra-warning) 72%,transparent)!important;
  opacity:.88!important;
}
#raEarthMount.ra-sync-s1-risk .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s1-risk .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s1-risk .ra-earth-link:not(.provider-blue){
  opacity:.18!important;
}

@keyframes raStage1EarthBoot{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.58)}
  35%{opacity:.9}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.08)}
}
@keyframes raStage1NodeOn{
  0%{opacity:0;transform:scale(.48)}
  60%{opacity:1;transform:scale(1.2)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes raStage1BankOn{
  from{opacity:0}
  to{opacity:1}
}
@keyframes raStage1ClusterPulse{
  0%,100%{opacity:.48}
  50%{opacity:1}
}
@keyframes raStage1RiskPulse{
  0%,100%{opacity:.5;transform:scale(1)}
  50%{opacity:1;transform:scale(1.16)}
}

@media(max-width:767px), (pointer:coarse) and (max-width:1180px){
  #simulation .ra-video-hud{
    width:100%!important;
    margin:0!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "status actions"
      "copy copy"
      "progress progress"!important;
    gap:5px 8px!important;
    padding:6px 8px 5px!important;
  }
  #simulation .ra-video-hud .ra-guided-status{
    min-height:30px!important;
  }
  #simulation .ra-video-hud .ra-guided-status>#raGuidedScene{
    display:inline!important;
  }
  #simulation .ra-video-hud .ra-guided-copy{
    grid-template-columns:auto minmax(0,1fr)!important;
  }
  #simulation .ra-video-hud .ra-guided-copy strong{
    font-size:8.5px!important;
  }
  #simulation .ra-video-hud .ra-guided-actions button{
    min-width:50px!important;
    min-height:32px!important;
    touch-action:manipulation;
  }
  body.ra-guided-running #simulation .ra-video-hud{
    position:relative!important;
    margin:0!important;
  }
}

@media(max-width:430px){
  #simulation .ra-video-hud .ra-guided-copy span{
    display:none!important;
  }
  #simulation .ra-video-hud .ra-guided-copy{
    grid-template-columns:1fr!important;
  }
  #simulation .ra-video-hud .ra-guided-copy strong{
    font-size:8px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount.ra-sync-s1-world::before,
  #raEarthMount.ra-sync-s1-providers .ra-earth-provider,
  #raEarthMount.ra-sync-s1-banks .ra-earth-bank,
  #raEarthMount.ra-sync-s1-cluster .provider-blue .ra-provider-halo,
  #raEarthMount.ra-sync-s1-risk .provider-blue .ra-provider-halo{
    animation-duration:.28s!important;
    animation-iteration-count:1!important;
  }
}


/* =========================================================
   STORYBOARD STAGE 2 — SCENE 02 PROVIDER FAILURE MASTER
   Narration drives every failure beat through word-level cues.
   ========================================================= */

#raEarthMount.ra-sync-s2-stable{
  --ra-sync-accent:var(--ra-primary);
}
#raEarthMount.ra-sync-s2-stable .ra-earth-provider,
#raEarthMount.ra-sync-s2-stable .ra-earth-bank,
#raEarthMount.ra-sync-s2-stable .ra-earth-link,
#raEarthMount.ra-sync-s2-stable .ra-earth-packet{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-stable .ra-earth-link{
  opacity:.34!important;
}
#raEarthMount.ra-sync-s2-stable .ra-earth-packet{
  opacity:.9!important;
}

#raEarthMount.ra-sync-s2-target .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-target .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-target .ra-earth-link:not(.provider-blue),
#raEarthMount.ra-sync-s2-target .ra-earth-packet:not(.provider-blue){
  opacity:.14!important;
}
#raEarthMount.ra-sync-s2-target .ra-earth-provider.provider-blue,
#raEarthMount.ra-sync-s2-target .ra-earth-bank[data-provider="blue"],
#raEarthMount.ra-sync-s2-target .ra-earth-link.provider-blue,
#raEarthMount.ra-sync-s2-target .ra-earth-packet.provider-blue{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-target .ra-earth-provider.provider-blue .ra-provider-halo{
  stroke:var(--ra-warning)!important;
  stroke-width:2.4!important;
  animation:raStage2Target 1.1s ease-in-out infinite;
}

#raEarthMount.ra-sync-s2-fail{
  --ra-sync-accent:var(--ra-danger,#ff3d4f);
}
#raEarthMount.ra-sync-s2-fail .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-fail .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-fail .ra-earth-link:not(.provider-blue){
  opacity:.18!important;
}
#raEarthMount.ra-sync-s2-fail .ra-earth-provider.provider-blue{
  opacity:1!important;
  animation:raStage2ProviderDrop .78s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s2-fail .ra-earth-provider.provider-blue .ra-provider-halo,
#raEarthMount.ra-sync-s2-fail .ra-earth-provider.provider-blue .ra-provider-core,
#raEarthMount.ra-sync-s2-fail .ra-earth-provider.provider-blue .ra-provider-cloud{
  stroke:var(--ra-danger,#ff3d4f)!important;
  fill:color-mix(in srgb,var(--ra-danger,#ff3d4f) 26%,transparent)!important;
}
#raEarthMount.ra-sync-s2-fail .ra-earth-link.provider-blue{
  stroke:var(--ra-danger,#ff3d4f)!important;
  stroke-width:2!important;
  stroke-dasharray:.07 .035!important;
  animation:raStage2LinkBreak .86s var(--ra-ease-emphasis) both;
}
#raEarthMount.ra-sync-s2-fail .ra-earth-packet.provider-blue{
  opacity:0!important;
}
#raEarthMount.ra-sync-s2-fail::after{
  content:"";
  position:absolute;
  z-index:5;
  left:35.2%;
  top:33.1%;
  width:90px;
  aspect-ratio:1;
  border:1px solid color-mix(in srgb,var(--ra-danger,#ff3d4f) 72%,transparent);
  border-radius:50%;
  transform:translate(-50%,-50%);
  opacity:0;
  box-shadow:0 0 34px color-mix(in srgb,var(--ra-danger,#ff3d4f) 24%,transparent);
  animation:raStage2Shockwave 1.05s var(--ra-ease-emphasis) both;
  pointer-events:none;
}

#raEarthMount.ra-sync-s2-affected .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-affected .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-affected .ra-earth-link:not(.provider-blue){
  opacity:.12!important;
}
#raEarthMount.ra-sync-s2-affected .ra-earth-provider.provider-blue{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-affected .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-affected .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:var(--ra-danger,#ff3d4f)!important;
  stroke-width:1.8!important;
  opacity:1!important;
  animation:raStage2AffectedBanks 1s ease-in-out infinite;
}
#raEarthMount.ra-sync-s2-affected .ra-earth-link.provider-blue{
  stroke:var(--ra-danger,#ff3d4f)!important;
  opacity:.34!important;
}

#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-link:not(.provider-blue){
  opacity:.08!important;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-provider.provider-blue,
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-link.provider-blue{
  stroke:var(--ra-danger,#ff3d4f)!important;
  opacity:.12!important;
  stroke-dasharray:.035 .055!important;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-packet.provider-blue{
  opacity:0!important;
}
#raEarthMount.ra-sync-s2-capacity-lost .ra-earth-bank[data-provider="blue"] .ra-bank-node{
  fill:var(--ra-danger,#ff3d4f)!important;
  filter:drop-shadow(0 0 5px color-mix(in srgb,var(--ra-danger,#ff3d4f) 72%,transparent));
}

#raEarthMount.ra-sync-s2-shared .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-shared .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-shared .ra-earth-link:not(.provider-blue){
  opacity:.1!important;
}
#raEarthMount.ra-sync-s2-shared .ra-earth-provider.provider-blue,
#raEarthMount.ra-sync-s2-shared .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-shared .ra-earth-bank[data-provider="blue"]{
  animation:raStage2SharedShock 1.15s ease-in-out infinite;
}
#raEarthMount.ra-sync-s2-shared .ra-earth-bank[data-provider="blue"] .ra-bank-halo{
  stroke:var(--ra-danger,#ff3d4f)!important;
  opacity:.95!important;
}
#raEarthMount.ra-sync-s2-shared .ra-earth-provider.provider-blue .ra-provider-halo{
  stroke:var(--ra-danger,#ff3d4f)!important;
  animation:raStage2SharedShock 1.15s ease-in-out infinite;
}

#raEarthMount.ra-sync-s2-systemic{
  --ra-sync-accent:var(--ra-danger,#ff3d4f);
}
#raEarthMount.ra-sync-s2-systemic .ra-earth-provider:not(.provider-blue),
#raEarthMount.ra-sync-s2-systemic .ra-earth-bank:not([data-provider="blue"]),
#raEarthMount.ra-sync-s2-systemic .ra-earth-link:not(.provider-blue){
  opacity:.2!important;
}
#raEarthMount.ra-sync-s2-systemic .ra-earth-provider.provider-blue,
#raEarthMount.ra-sync-s2-systemic .ra-earth-bank[data-provider="blue"]{
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-systemic .ra-earth-atmosphere{
  stroke:color-mix(in srgb,var(--ra-danger,#ff3d4f) 70%,transparent)!important;
  filter:drop-shadow(0 0 12px color-mix(in srgb,var(--ra-danger,#ff3d4f) 32%,transparent));
  animation:raStage2SystemicRing 1.4s ease-in-out infinite;
}
#raEarthMount.ra-sync-s2-systemic .ra-earth-bank[data-provider="blue"] .ra-bank-halo,
#raEarthMount.ra-sync-s2-systemic .ra-earth-provider.provider-blue .ra-provider-halo{
  stroke:var(--ra-danger,#ff3d4f)!important;
  opacity:1!important;
}
#raEarthMount.ra-sync-s2-systemic .ra-earth-link.provider-blue{
  stroke:var(--ra-danger,#ff3d4f)!important;
  opacity:.3!important;
}

@keyframes raStage2Target{
  0%,100%{opacity:.48;transform:scale(1)}
  50%{opacity:1;transform:scale(1.14)}
}
@keyframes raStage2ProviderDrop{
  0%{opacity:1;filter:none}
  38%{opacity:.3;filter:brightness(2.1)}
  54%{opacity:1;filter:brightness(.65)}
  72%{opacity:.34}
  100%{opacity:1;filter:drop-shadow(0 0 10px color-mix(in srgb,var(--ra-danger,#ff3d4f) 65%,transparent))}
}
@keyframes raStage2LinkBreak{
  from{opacity:.85;stroke-dashoffset:0}
  to{opacity:.16;stroke-dashoffset:1}
}
@keyframes raStage2Shockwave{
  0%{opacity:.95;transform:translate(-50%,-50%) scale(.38)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(2.5)}
}
@keyframes raStage2AffectedBanks{
  0%,100%{opacity:.48;transform:scale(1)}
  50%{opacity:1;transform:scale(1.22)}
}
@keyframes raStage2SharedShock{
  0%,100%{opacity:.62}
  50%{opacity:1}
}
@keyframes raStage2SystemicRing{
  0%,100%{opacity:.44}
  50%{opacity:1}
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount.ra-sync-s2-target .ra-earth-provider.provider-blue .ra-provider-halo,
  #raEarthMount.ra-sync-s2-fail .ra-earth-provider.provider-blue,
  #raEarthMount.ra-sync-s2-fail::after,
  #raEarthMount.ra-sync-s2-affected .ra-earth-bank[data-provider="blue"] .ra-bank-halo,
  #raEarthMount.ra-sync-s2-shared .ra-earth-bank[data-provider="blue"],
  #raEarthMount.ra-sync-s2-systemic .ra-earth-atmosphere{
    animation-duration:.28s!important;
    animation-iteration-count:1!important;
  }
}


/* =========================================================
   GUIDED CINEMATIC BLEND — continuous cue transitions
   Every visual state now eases into the next one instead of
   snapping on the same animation frame as the narration cue.
   ========================================================= */

#raEarthMount.ra-guided-sync .ra-earth-ocean,
#raEarthMount.ra-guided-sync .ra-earth-land,
#raEarthMount.ra-guided-sync .ra-earth-grid,
#raEarthMount.ra-guided-sync .ra-earth-atmosphere,
#raEarthMount.ra-guided-sync .ra-earth-provider,
#raEarthMount.ra-guided-sync .ra-earth-bank,
#raEarthMount.ra-guided-sync .ra-earth-link,
#raEarthMount.ra-guided-sync .ra-earth-packet,
#raEarthMount.ra-guided-sync .ra-provider-halo,
#raEarthMount.ra-guided-sync .ra-provider-core,
#raEarthMount.ra-guided-sync .ra-provider-cloud,
#raEarthMount.ra-guided-sync .ra-bank-halo,
#raEarthMount.ra-guided-sync .ra-bank-node{
  transition:
    opacity .72s cubic-bezier(.22,.61,.36,1),
    filter .72s cubic-bezier(.22,.61,.36,1),
    stroke .72s cubic-bezier(.22,.61,.36,1),
    stroke-width .72s cubic-bezier(.22,.61,.36,1),
    fill .72s cubic-bezier(.22,.61,.36,1)!important;
}

#simulation .ra-video-hud .ra-guided-copy,
#raCanvasTitle{
  will-change:opacity,transform,filter;
}
#simulation .ra-video-hud .ra-guided-copy.is-cue-entering,
#raCanvasTitle.is-cue-entering{
  animation:raGuidedCopyBlend .46s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes raGuidedCopyBlend{
  0%{opacity:.18;transform:translateY(4px);filter:blur(2.5px)}
  42%{opacity:.74}
  100%{opacity:1;transform:translateY(0);filter:blur(0)}
}

/* Richer opening: the first seconds build the system continuously. */
#raEarthMount.ra-sync-s1-world .ra-earth-ocean{
  animation:raStage1OceanReveal 1.45s cubic-bezier(.22,.61,.36,1) both;
}
#raEarthMount.ra-sync-s1-world .ra-earth-land{
  animation:raStage1LandReveal 1.28s .16s cubic-bezier(.22,.61,.36,1) both;
}
#raEarthMount.ra-sync-s1-world .ra-earth-grid{
  animation:raStage1GridReveal 1.18s .34s cubic-bezier(.22,.61,.36,1) both;
}
#raEarthMount.ra-sync-s1-world .ra-earth-atmosphere{
  animation:raStage1AtmosphereReveal 1.55s .08s ease-out both;
}

#raEarthMount.ra-sync-s1-providers .ra-provider-halo{
  animation:raStage1ProviderHalo .9s cubic-bezier(.22,.61,.36,1) both;
}
#raEarthMount.ra-sync-s1-providers .ra-provider-label,
#raEarthMount.ra-sync-s1-providers .ra-provider-sub{
  animation:raStage1LabelReveal .62s .18s ease-out both;
}

#raEarthMount.ra-sync-s1-banks .ra-bank-halo{
  animation:raStage1BankPulse .7s cubic-bezier(.22,.61,.36,1) both;
  animation-delay:calc(var(--ra-intro-index,0) * .028s);
}
#raEarthMount.ra-sync-s1-banks .ra-bank-label{
  animation:raStage1LabelReveal .52s ease-out both;
  animation-delay:calc(.08s + var(--ra-intro-index,0) * .022s);
}

#raEarthMount.ra-sync-s1-links .ra-earth-link{
  stroke-dasharray:1!important;
  stroke-dashoffset:1!important;
  animation:raStage1LinkDraw .94s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay:calc(var(--ra-intro-index,0) * .018s);
}

#raEarthMount.ra-sync-s1-flow .ra-earth-packet{
  animation:raStage1FlowIgnite .72s ease-out both;
  animation-delay:calc(var(--ra-intro-index,0) * .012s);
}
#raEarthMount.ra-sync-s1-flow .ra-earth-link{
  transition-duration:.82s!important;
}

@keyframes raStage1OceanReveal{
  0%{opacity:.08;filter:brightness(.28) saturate(.35)}
  100%{opacity:.56;filter:brightness(.7) saturate(.68)}
}
@keyframes raStage1LandReveal{
  0%{opacity:0;filter:blur(4px)}
  100%{opacity:.2;filter:blur(0)}
}
@keyframes raStage1GridReveal{
  0%{opacity:0;stroke-dasharray:.03 .1;stroke-dashoffset:1}
  100%{opacity:.34;stroke-dasharray:initial;stroke-dashoffset:0}
}
@keyframes raStage1AtmosphereReveal{
  0%{opacity:0;filter:blur(7px)}
  55%{opacity:.95}
  100%{opacity:1;filter:blur(0)}
}
@keyframes raStage1ProviderHalo{
  0%{opacity:0;stroke-width:.5}
  55%{opacity:1;stroke-width:3.2}
  100%{opacity:.7;stroke-width:1.5}
}
@keyframes raStage1LabelReveal{
  from{opacity:0;transform:translateY(4px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes raStage1BankPulse{
  0%{opacity:0;stroke-width:.4}
  55%{opacity:1;stroke-width:2.3}
  100%{opacity:.7;stroke-width:1}
}
@keyframes raStage1LinkDraw{
  from{stroke-dashoffset:1;opacity:.08}
  to{stroke-dashoffset:0;opacity:.82}
}
@keyframes raStage1FlowIgnite{
  0%{opacity:0;filter:drop-shadow(0 0 0 transparent)}
  100%{opacity:.98;filter:drop-shadow(0 0 4px currentColor)}
}

@media(prefers-reduced-motion:reduce){
  #simulation .ra-video-hud .ra-guided-copy.is-cue-entering,
  #raCanvasTitle.is-cue-entering,
  #raEarthMount.ra-sync-s1-world .ra-earth-ocean,
  #raEarthMount.ra-sync-s1-world .ra-earth-land,
  #raEarthMount.ra-sync-s1-world .ra-earth-grid,
  #raEarthMount.ra-sync-s1-world .ra-earth-atmosphere,
  #raEarthMount.ra-sync-s1-links .ra-earth-link,
  #raEarthMount.ra-sync-s1-flow .ra-earth-packet{
    animation-duration:.2s!important;
    animation-delay:0s!important;
  }
}


/* =========================================================
   GUIDED CONTINUITY ENGINE — no hard resets between cues
   Parent-level bridge masks SVG state swaps while child nodes
   interpolate toward their next visual state.
   ========================================================= */

#raEarthMount .ra-earth-svg{
  transform-origin:50% 50%;
  transition:
    opacity .22s cubic-bezier(.22,.61,.36,1),
    filter .22s cubic-bezier(.22,.61,.36,1),
    transform .58s cubic-bezier(.22,.61,.36,1);
  will-change:opacity,filter,transform;
}

#raEarthMount.ra-cue-transitioning .ra-earth-svg{
  opacity:.82!important;
  filter:blur(.75px) saturate(.9) brightness(.94)!important;
  transform:scale(.997);
}

#raEarthMount.ra-guided-preroll .ra-earth-svg{
  opacity:.76!important;
  filter:blur(1px) saturate(.86) brightness(.9)!important;
  transform:scale(.996);
}

#simulation .ra-video-hud .ra-guided-copy{
  transition:
    opacity .24s cubic-bezier(.22,.61,.36,1),
    transform .42s cubic-bezier(.22,.61,.36,1),
    filter .24s cubic-bezier(.22,.61,.36,1);
}
#simulation .ra-video-hud.is-cue-transitioning .ra-guided-copy{
  opacity:.28!important;
  transform:translateY(2px);
  filter:blur(1.6px);
}
#raCanvasTitle{
  transition:
    opacity .24s cubic-bezier(.22,.61,.36,1),
    transform .42s cubic-bezier(.22,.61,.36,1),
    filter .24s cubic-bezier(.22,.61,.36,1);
}
#raCanvasTitle.is-cue-transitioning{
  opacity:.26!important;
  transform:translateY(2px);
  filter:blur(1.3px);
}

/* Slow the node interpolation enough to be visibly continuous, but keep
   failure events responsive to the narrator. */
#raEarthMount.ra-guided-sync .ra-earth-provider,
#raEarthMount.ra-guided-sync .ra-earth-bank,
#raEarthMount.ra-guided-sync .ra-earth-link,
#raEarthMount.ra-guided-sync .ra-earth-packet,
#raEarthMount.ra-guided-sync .ra-earth-ocean,
#raEarthMount.ra-guided-sync .ra-earth-land,
#raEarthMount.ra-guided-sync .ra-earth-grid,
#raEarthMount.ra-guided-sync .ra-earth-atmosphere,
#raEarthMount.ra-guided-sync .ra-provider-halo,
#raEarthMount.ra-guided-sync .ra-provider-core,
#raEarthMount.ra-guided-sync .ra-provider-cloud,
#raEarthMount.ra-guided-sync .ra-bank-halo,
#raEarthMount.ra-guided-sync .ra-bank-node{
  transition-duration:.88s!important;
  transition-timing-function:cubic-bezier(.22,.61,.36,1)!important;
}

/* Remove the old Stage-1 pop. Nodes now rise from the previous visual state
   instead of overshooting to 120% scale. */
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(1),
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(2),
#raEarthMount.ra-sync-s1-providers .ra-earth-provider:nth-child(3){
  animation-name:raStage1NodeSmooth!important;
  animation-duration:.88s!important;
}
#raEarthMount.ra-sync-s1-banks .ra-earth-bank{
  animation-name:raStage1BankSmooth!important;
  animation-duration:.72s!important;
}

@keyframes raStage1NodeSmooth{
  0%{opacity:0;filter:blur(2px)}
  45%{opacity:.58;filter:blur(.7px)}
  100%{opacity:1;filter:blur(0)}
}
@keyframes raStage1BankSmooth{
  0%{opacity:0;filter:blur(1.2px)}
  100%{opacity:1;filter:blur(0)}
}

@media(prefers-reduced-motion:reduce){
  #raEarthMount .ra-earth-svg,
  #simulation .ra-video-hud .ra-guided-copy,
  #raCanvasTitle{
    transition-duration:.12s!important;
  }
}


/* =========================================================
   MOBILE TAP RELIABILITY — iOS HIT TEST + TRUE HIDDEN SHEETS
   ========================================================= */
@media (max-width:960px), (pointer:coarse) and (max-width:1180px){
  .ra-lab-console:not(.is-mobile-open){
    pointer-events:none!important;
  }
  .ra-lab-console.is-mobile-open{
    pointer-events:auto!important;
  }
  .ra-mobile-sheet-backdrop[hidden]{
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  .ra-mobile-app-nav{
    pointer-events:auto!important;
    isolation:isolate;
  }
  .ra-mobile-tab{
    position:relative;
    z-index:2;
    pointer-events:auto!important;
    cursor:pointer;
    touch-action:manipulation!important;
    -webkit-user-select:none;
    user-select:none;
  }

  #raRunPreview,
  .ra-mobile-scene-nav button{
    position:relative;
    z-index:2;
    pointer-events:auto!important;
    touch-action:manipulation!important;
    -webkit-user-select:none;
    user-select:none;
  }

  .ra-earth-overlay,
  #raEarthMount::before,
  #raEarthMount::after{
    pointer-events:none!important;
  }
}


/* =========================================================
   JUDGE FLOW — controlled comparison + audience framing
   ========================================================= */

.ra-compare-principle{
  margin:0 12px 12px;
  padding:10px 12px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  grid-template-areas:
    "label statement"
    "label note";
  gap:2px 12px;
  align-items:center;
  border:1px solid color-mix(in srgb,var(--ra-primary) 28%,var(--ra-border));
  border-radius:var(--ra-radius-xs);
  background:color-mix(in srgb,var(--ra-primary) 4%,var(--ra-surface-soft));
}
.ra-compare-principle>span{
  grid-area:label;
  color:var(--ra-primary);
  font-size:7px;
  font-weight:900;
  letter-spacing:.11em;
  white-space:nowrap;
}
.ra-compare-principle>b{
  grid-area:statement;
  color:var(--ra-text-1);
  font-size:10px;
  line-height:1.3;
}
.ra-compare-principle>small{
  grid-area:note;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.35;
}

.ra-audience-strip{
  grid-column:1/-1;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--ra-border);
}
.ra-audience-strip>span{
  display:block;
  margin-bottom:8px;
  color:var(--ra-primary);
  font-size:7px;
  font-weight:900;
  letter-spacing:.12em;
}
.ra-audience-strip>div{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.ra-audience-strip article{
  min-width:0;
  padding:9px 10px;
  border-left:2px solid color-mix(in srgb,var(--ra-primary) 55%,var(--ra-border));
  background:color-mix(in srgb,var(--ra-primary) 3%,transparent);
}
.ra-audience-strip b{
  display:block;
  color:var(--ra-text-1);
  font-size:9px;
}
.ra-audience-strip small{
  display:block;
  margin-top:3px;
  color:var(--ra-text-3);
  font-size:7.5px;
  line-height:1.4;
}

@media(max-width:767px){
  .ra-compare-principle{
    margin:0 8px 10px;
    grid-template-columns:1fr;
    grid-template-areas:
      "label"
      "statement"
      "note";
    gap:4px;
  }
  .ra-audience-strip>div{
    grid-template-columns:1fr;
    gap:5px;
  }
  .ra-audience-strip article{
    padding:8px 9px;
  }
}


/* =========================================================
   ROBUSTNESS SWEEP — local sensitivity around current scenario
   ========================================================= */
.ra-robustness-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:12px 0;
}
.ra-robustness-summary article{
  padding:11px 12px;
  border:1px solid var(--ra-border);
  background:var(--ra-surface-soft);
}
.ra-robustness-summary span{
  display:block;
  color:var(--ra-text-3);
  font-size:7px;
  font-weight:900;
  letter-spacing:.1em;
}
.ra-robustness-summary b{
  display:block;
  margin-top:5px;
  color:var(--ra-text-1);
  font-size:20px;
  letter-spacing:-.03em;
}
.ra-robustness-summary small{
  display:block;
  margin-top:3px;
  color:var(--ra-text-3);
  font-size:7.5px;
}
.ra-robustness-matrix{
  display:grid;
  grid-template-columns:minmax(92px,1.25fr) repeat(3,minmax(64px,1fr));
  gap:5px;
  align-items:stretch;
}
.ra-matrix-head,
.ra-matrix-corner,
.ra-matrix-cell{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:7px 8px;
  border:1px solid var(--ra-border);
  border-radius:6px;
}
.ra-matrix-head,
.ra-matrix-corner{
  color:var(--ra-text-3);
  background:var(--ra-surface-soft);
  font-size:7px;
  font-weight:850;
  letter-spacing:.07em;
  text-align:center;
}
.ra-matrix-cell{
  color:var(--ra-text-2);
  background:var(--ra-surface);
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
.ra-matrix-cell.soft{
  background:color-mix(in srgb,var(--ra-teal) 5%,var(--ra-surface));
}
.ra-matrix-cell.positive{
  color:var(--ra-teal);
  background:color-mix(in srgb,var(--ra-teal) 9%,var(--ra-surface));
  border-color:color-mix(in srgb,var(--ra-teal) 26%,var(--ra-border));
}
.ra-matrix-cell.strong{
  color:var(--ra-teal);
  background:color-mix(in srgb,var(--ra-teal) 15%,var(--ra-surface));
  border-color:color-mix(in srgb,var(--ra-teal) 40%,var(--ra-border));
}
.ra-matrix-cell.is-current{
  box-shadow:inset 0 0 0 1px var(--ra-primary);
}
.ra-robustness-boundary{
  display:block;
  margin-top:10px;
  color:var(--ra-text-3);
  font-size:8px;
  line-height:1.45;
}

@media(max-width:767px){
  .ra-robustness-summary{
    grid-template-columns:1fr 1fr;
  }
  .ra-robustness-summary article:last-child{
    grid-column:1/-1;
  }
  .ra-robustness-matrix{
    overflow-x:auto;
    grid-template-columns:96px repeat(3,72px);
    padding-bottom:4px;
  }
  .ra-matrix-head,
  .ra-matrix-corner,
  .ra-matrix-cell{
    min-height:44px;
  }
}


/* FINAL COMPETITION QA — stable judge capture framing */
.ra-robustness-matrix{
  max-width:760px;
}
.ra-matrix-cell.is-current{
  position:relative;
  border-color:color-mix(in srgb,var(--ra-primary) 70%,var(--ra-border));
}
.ra-matrix-cell.is-current::after{
  content:"CURRENT";
  position:absolute;
  right:5px;
  bottom:3px;
  color:var(--ra-primary);
  font-size:5.5px;
  font-weight:900;
  letter-spacing:.08em;
}
@media(max-width:767px){
  .ra-robustness-matrix{
    max-width:none;
  }
  .ra-matrix-cell.is-current::after{
    font-size:5px;
  }
}
