:root {
  --bg: #030912;
  --bg2: #06111d;
  --panel: rgba(7, 20, 33, .88);
  --panel2: rgba(10, 29, 44, .78);
  --line: #173b52;
  --line2: #245a75;
  --text: #edf8ff;
  --muted: #88a5b8;
  --cyan: #35ddff;
  --green: #39e7ac;
  --violet: #aa78ff;
  --gold: #ffc84e;
  --red: #ff5c7d;
  --shadow: 0 24px 80px rgba(0, 0, 0, .36);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, rgba(0, 178, 255, .16), transparent 34rem),
    radial-gradient(circle at 10% 90%, rgba(170, 120, 255, .11), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(3, 10, 18, .96);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 13px; padding: 0 7px 18px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--cyan), #5385ff 50%, var(--violet));
  padding: 2px; box-shadow: 0 0 30px rgba(53, 221, 255, .22);
}
.brand-mark span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 12px; background: #06111d; font-weight: 900; letter-spacing: -.08em; }
.brand strong { display: block; font-size: 18px; letter-spacing: .18em; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .18em; margin-top: 4px; }

.nav { display: grid; gap: 7px; }
.nav-item {
  border: 1px solid transparent; background: transparent; color: #9fb7c7;
  display: grid; grid-template-columns: 30px 1fr; align-items: center; text-align: left;
  padding: 12px 13px; border-radius: 11px; cursor: pointer; transition: .18s ease;
}
.nav-item span { font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; color: #4e768c; }
.nav-item:hover { color: white; background: rgba(53, 221, 255, .05); border-color: rgba(53, 221, 255, .16); }
.nav-item.active { color: white; border-color: #22536b; background: linear-gradient(90deg, rgba(53, 221, 255, .13), rgba(53, 221, 255, .025)); box-shadow: inset 3px 0 var(--cyan); }
.nav-item.active span { color: var(--cyan); }

.safety-card { margin-top: auto; border: 1px solid #28543f; background: rgba(33, 104, 73, .1); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.safety-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 15px var(--green); flex: none; }
.safety-card strong { display: block; color: var(--green); font-size: 10px; letter-spacing: .09em; }
.safety-card small { display: block; color: #789b8d; font-size: 9px; margin-top: 3px; }
.install-btn { border: 1px solid var(--violet); background: rgba(170, 120, 255, .11); color: #d8c5ff; border-radius: 10px; padding: 11px; cursor: pointer; }
.hidden { display: none !important; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 15; min-height: 84px; padding: 16px 26px;
  border-bottom: 1px solid var(--line); background: rgba(3, 10, 18, .88); backdrop-filter: blur(18px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #7da3b8; font: 700 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.topbar time { font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; color: #8eaaba; }
.health-pill { border: 1px solid #29495d; border-radius: 999px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; color: #9bb2c1; font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.health-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.health-pill.ok { border-color: #1f664f; color: var(--green); }
.health-pill.ok i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.health-pill.bad { border-color: #723046; color: var(--red); }
.health-pill.bad i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.mobile-menu { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 8px 10px; }

.view { display: none; padding: 26px; max-width: 1800px; margin: 0 auto; animation: rise .22s ease; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.panel { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(10, 28, 43, .94), rgba(5, 15, 26, .94)); box-shadow: var(--shadow); }
.hero { min-height: 330px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 30px; align-items: center; padding: 36px 42px; overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; inset: auto -15% -80% 20%; height: 140%; background: radial-gradient(ellipse, rgba(53, 221, 255, .09), transparent 65%); pointer-events: none; }
.hero h2 { margin: 12px 0 14px; font-size: clamp(34px, 4vw, 63px); line-height: .98; letter-spacing: -.055em; max-width: 780px; }
.hero h2 span { color: transparent; background: linear-gradient(90deg, var(--cyan), #7ba6ff, var(--violet)); background-clip: text; -webkit-background-clip: text; }
.hero p:not(.eyebrow) { color: #9eb5c4; max-width: 690px; font-size: 15px; line-height: 1.7; }
.hero-actions, .action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions { margin-top: 26px; }
button.primary, button.secondary, button.danger, .file-btn {
  border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: .17s ease; font-weight: 750; font-size: 12px;
}
button.primary { border: 1px solid var(--cyan); background: linear-gradient(130deg, rgba(53, 221, 255, .18), rgba(89, 114, 255, .15)); color: #dffaff; box-shadow: 0 0 22px rgba(53, 221, 255, .09); }
button.primary:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(53, 221, 255, .2); }
button.secondary, .file-btn { border: 1px solid #2b5268; background: #081724; color: #c5d7e2; }
button.secondary:hover, .file-btn:hover { border-color: #3c718e; color: white; }
button.danger { border: 1px solid #733044; background: rgba(255, 92, 125, .08); color: #ff9caf; }

.orbit-visual { position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: auto; }
.core-orb { position: absolute; inset: 29%; border-radius: 50%; display: grid; place-content: center; text-align: center; font-weight: 900; font-size: 34px; letter-spacing: .1em; background: radial-gradient(circle at 35% 28%, #54dfff, #2254a4 42%, #140e36 72%); box-shadow: 0 0 55px rgba(53, 221, 255, .38), inset -22px -25px 38px rgba(0,0,0,.42); border: 1px solid #86eaff; }
.core-orb small { font-size: 7px; color: #b9fbe6; letter-spacing: .15em; margin-top: 5px; }
.orbit { position: absolute; border: 1px solid rgba(111, 190, 225, .25); border-radius: 50%; inset: 10%; animation: spin 15s linear infinite; }
.orbit::before { content: ""; position: absolute; width: 42px; height: 42px; border-radius: 50%; top: 6%; left: 13%; background: linear-gradient(145deg, #f6cd58, #694210); box-shadow: 0 0 24px rgba(255, 200, 78, .28); }
.orbit b { position: absolute; top: 9%; left: 13%; width: 42px; text-align: center; z-index: 2; font-size: 8px; line-height: 42px; }
.orbit.o2 { inset: 2%; animation-duration: 21s; animation-direction: reverse; transform: rotate(120deg); }
.orbit.o2::before { background: linear-gradient(145deg, #a970ff, #371166); }
.orbit.o3 { inset: 18%; animation-duration: 11s; transform: rotate(240deg); }
.orbit.o3::before { background: linear-gradient(145deg, #35ddff, #0c5070); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Living overview — a procedural 3D operations core rather than a static hero. */
.living-core {
  position: relative;
  min-height: min(790px, calc(100svh - 112px));
  overflow: hidden;
  isolation: isolate;
  border-color: rgba(93, 190, 226, .35);
  background:
    radial-gradient(circle at 50% 47%, rgba(55, 175, 255, .13), transparent 17%),
    radial-gradient(ellipse at 50% 55%, rgba(123, 70, 255, .12), transparent 37%),
    linear-gradient(145deg, rgba(5, 17, 30, .98), rgba(2, 7, 15, .98));
  perspective: 1100px;
}
.living-core::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .25;
  background-image:
    linear-gradient(rgba(56, 135, 171, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 135, 171, .1) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(62deg) scale(1.35) translateY(18%);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, black, transparent 72%);
}
.living-core::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(1, 5, 12, .78) 100%);
}
#livingCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.core-vignette { position: absolute; inset: 17% 23%; border-radius: 50%; z-index: 0; background: radial-gradient(circle, rgba(84, 220, 255, .08), transparent 66%); filter: blur(12px); animation: core-breathe 4.8s ease-in-out infinite; }
.living-copy { position: absolute; z-index: 5; left: clamp(25px, 4vw, 58px); top: clamp(25px, 5vw, 55px); width: min(460px, 42%); }
.living-copy h2 { margin: 9px 0 12px; font-size: clamp(38px, 5vw, 76px); line-height: .92; letter-spacing: -.055em; }
.living-copy h2 span { color: transparent; background: linear-gradient(90deg, #f5fbff, var(--cyan) 43%, var(--violet)); background-clip: text; -webkit-background-clip: text; text-shadow: 0 0 34px rgba(53, 221, 255, .16); }
.living-copy > p:not(.eyebrow) { max-width: 430px; color: #8eabba; font-size: 13px; line-height: 1.65; }
.nexus-core {
  position: absolute;
  z-index: 4;
  left: 50%; top: 51%;
  width: clamp(152px, 15vw, 225px); aspect-ratio: 1;
  transform: translate(-50%, -50%) rotateX(-7deg);
  border: 0; border-radius: 50%; background: transparent;
  cursor: pointer; display: grid; place-content: center; color: white;
  filter: drop-shadow(0 0 28px rgba(53, 221, 255, .3));
  transform-style: preserve-3d;
}
.nexus-core::before, .nexus-core::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.nexus-core::before { inset: -30%; border: 1px solid rgba(109, 221, 255, .21); box-shadow: inset 0 0 42px rgba(53, 221, 255, .08); animation: core-breathe 4.8s ease-in-out infinite; }
.nexus-core::after { inset: -11%; border: 1px dashed rgba(179, 127, 255, .36); animation: spin 20s linear infinite reverse; }
.nexus-energy { position: absolute; inset: 17%; border-radius: 50%; background: radial-gradient(circle at 34% 25%, #e9fbff 0 3%, #4ce4ff 8%, #2863c8 35%, #381977 66%, #050713 84%); border: 1px solid rgba(174, 241, 255, .9); box-shadow: inset -26px -34px 46px rgba(0,0,0,.6), inset 12px 14px 22px rgba(255,255,255,.16), 0 0 20px #35ddff, 0 0 70px rgba(75, 91, 255, .65), 0 0 130px rgba(170, 120, 255, .25); animation: energy-shift 7s ease-in-out infinite; }
.nexus-shell { position: absolute; inset: 5%; border-radius: 50%; border: 1px solid rgba(104, 224, 255, .52); box-shadow: 0 0 16px rgba(53,221,255,.2); transform-style: preserve-3d; pointer-events: none; }
.shell-one { transform: rotateX(68deg) rotateZ(12deg); animation: shell-one 9s linear infinite; }
.shell-two { transform: rotateY(69deg) rotateZ(48deg); border-color: rgba(190,118,255,.55); animation: shell-two 12s linear infinite reverse; }
.shell-three { inset: -4%; transform: rotateX(74deg) rotateZ(118deg); border-style: dashed; opacity: .45; animation: shell-three 18s linear infinite; }
.nexus-core strong, .nexus-core small { position: relative; z-index: 4; text-shadow: 0 2px 17px #04101c; }
.nexus-core strong { font-size: clamp(31px, 4vw, 56px); letter-spacing: .16em; margin-left: .16em; }
.nexus-core small { margin-top: 5px; color: #bff5ff; font: 800 7px ui-monospace, Consolas, monospace; letter-spacing: .22em; }
.nexus-core:hover { filter: drop-shadow(0 0 46px rgba(53, 221, 255, .68)); }
.nexus-core:hover .nexus-energy { box-shadow: inset -26px -34px 46px rgba(0,0,0,.55), 0 0 28px #fff, 0 0 90px #35ddff, 0 0 170px rgba(170, 120, 255, .55); }
.system-node { position: absolute; z-index: 4; display: grid; grid-template-columns: 12px auto; gap: 2px 9px; min-width: 100px; color: #dbf7ff; pointer-events: none; animation: node-float 5.5s ease-in-out infinite; }
.system-node i { grid-row: 1 / 3; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--node); box-shadow: 0 0 9px var(--node), 0 0 25px var(--node); }
.system-node b { font-size: 12px; letter-spacing: .15em; }
.system-node span { color: #5d8092; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.node-portfolio { --node: #b66fff; left: 21%; top: 38%; animation-delay: -.7s; }
.node-accounts { --node: #ffc84e; left: 34%; top: 25%; animation-delay: -2.1s; }
.node-markets { --node: #35ddff; right: 28%; top: 29%; animation-delay: -4.4s; }
.node-control { --node: #ff725c; left: 24%; bottom: 29%; animation-delay: -3.2s; }
.node-diary { --node: #39e7ac; right: 22%; bottom: 27%; animation-delay: -1.4s; }
.living-status { position: absolute; z-index: 4; bottom: 37px; display: grid; gap: 5px; padding-left: 13px; border-left: 2px solid var(--cyan); }
.living-status span { color: #53798d; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .16em; }
.living-status strong { font: 800 10px ui-monospace, Consolas, monospace; letter-spacing: .09em; color: var(--green); }
.status-left { left: 34px; }
.status-right { right: 34px; text-align: right; padding-left: 0; padding-right: 13px; border-left: 0; border-right: 2px solid var(--violet); }
.living-actions { position: absolute; z-index: 6; left: 50%; bottom: 34px; transform: translateX(-50%); display: flex; gap: 8px; }
.glass-action { border: 1px solid rgba(96, 179, 211, .38); background: rgba(3, 14, 24, .58); backdrop-filter: blur(14px); color: #bcd3df; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-size: 11px; font-weight: 800; }
.glass-action:hover { border-color: var(--cyan); color: white; }
.scroll-cue { position: absolute; z-index: 5; left: 50%; bottom: 5px; transform: translateX(-50%); color: #476a7d; font: 700 6px ui-monospace, Consolas, monospace; letter-spacing: .18em; display: flex; gap: 7px; align-items: center; }
.scroll-cue i { width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1.5s ease-in-out infinite; }
@keyframes core-breathe { 50% { transform: scale(1.08); opacity: .72; } }
@keyframes energy-shift { 0%,100% { transform: rotate(-3deg) scale(.98); filter: hue-rotate(0deg); } 50% { transform: rotate(4deg) scale(1.04); filter: hue-rotate(22deg); } }
@keyframes shell-one { to { transform: rotateX(68deg) rotateZ(372deg); } }
@keyframes shell-two { to { transform: rotateY(69deg) rotateZ(408deg); } }
@keyframes shell-three { to { transform: rotateX(74deg) rotateZ(478deg); } }
@keyframes node-float { 50% { transform: translateY(-8px); } }
@keyframes blink { 50% { opacity: .25; transform: scale(.65); } }

/* Overview v3 — a menu-free living neural cathedral. */
body.overview-immersive { overflow: hidden; background: #010306; }
body.overview-immersive .app-shell { display: block; width: 100vw; height: 100svh; }
body.overview-immersive .sidebar,
body.overview-immersive .topbar { display: none; }
body.overview-immersive .main { width: 100vw; height: 100svh; }
body.overview-immersive #view-overview.active {
  display: block; position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100svh;
  max-width: none; margin: 0; padding: 0; overflow: hidden; animation: chamber-awaken .9s ease both;
}
body.overview-immersive #view-overview > :not(.living-core) { display: none !important; }
.return-to-chamber {
  position: fixed; z-index: 48; top: 17px; right: 24px; display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 14px; border: 1px solid rgba(53,221,255,.42); border-radius: 999px;
  color: #bff5ff; background: rgba(2,12,19,.88); backdrop-filter: blur(12px);
  font: 800 9px ui-monospace, Consolas, monospace; letter-spacing: .13em; cursor: pointer;
  box-shadow: 0 0 24px rgba(53,221,255,.08); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.return-to-chamber:hover, .return-to-chamber:focus-visible {
  transform: translateY(-2px); border-color: #35ddff; box-shadow: 0 0 30px rgba(53,221,255,.2); outline: none;
}
.return-to-chamber[hidden], body.overview-immersive .return-to-chamber, body.dashboard-focus .return-to-chamber { display: none !important; }
.neural-cathedral {
  width: 100%; height: 100svh; min-height: 0; border: 0; border-radius: 0;
  background-color: #010407;
  box-shadow: inset 0 0 160px #000, inset 0 -100px 130px rgba(0,0,0,.82);
  perspective: 1100px;
}
.neural-cathedral::before {
  inset: -6%; z-index: 1; opacity: .9; mask-image: none;
  background:
    linear-gradient(180deg, rgba(0,3,7,.03), rgba(0,3,8,.25) 62%, rgba(0,2,5,.62)),
    radial-gradient(circle at var(--pointer-x,50%) var(--pointer-y,50%), rgba(143,225,255,.14), transparent 18%),
    url('/lazarix-neural-cathedral.png') center / cover no-repeat;
  translate: var(--scene-x, 0px) var(--scene-y, 0px);
  transform-origin: 50% 54%;
  animation: cathedral-breathe 15s ease-in-out infinite alternate;
  will-change: transform, translate, filter;
}
.neural-cathedral::after {
  z-index: 2;
  background:
    radial-gradient(circle at var(--pointer-x,50%) var(--pointer-y,50%), rgba(113,222,255,.12), transparent 22%),
    linear-gradient(105deg, transparent 24%, rgba(82,215,255,.06) 47%, transparent 67%),
    radial-gradient(ellipse at 50% 52%, transparent 26%, rgba(0,3,7,.2) 58%, rgba(0,2,5,.86) 100%);
  animation: cathedral-haze 10s ease-in-out infinite alternate;
}
.neural-cathedral #livingCanvas { z-index: 3; mix-blend-mode: screen; }
.neural-cathedral .core-vignette { z-index: 3; inset: 30% 36%; background: radial-gradient(circle, rgba(103,230,255,.2), rgba(133,79,255,.08) 34%, transparent 70%); }
.neural-cathedral .living-copy {
  left: 50%; top: clamp(18px, 4vh, 42px); width: min(620px, 78vw); text-align: center;
  transform: translateX(-50%); z-index: 8; pointer-events: none;
}
.neural-cathedral .living-copy h2 { margin: 7px 0 5px; font-size: clamp(28px, 4vw, 58px); line-height: .92; letter-spacing: .08em; text-shadow: 0 3px 35px #000; }
.neural-cathedral .living-copy > p:not(.eyebrow) { margin: 0 auto; max-width: 520px; color: rgba(205,229,239,.62); font-size: clamp(9px, .9vw, 12px); }
.neural-cathedral .nexus-core { top: 54%; z-index: 9; width: clamp(158px, 16vw, 240px); }
.neural-cathedral .nexus-core::before { inset: -44%; border-color: rgba(140,228,255,.18); }
.neural-cathedral .nexus-energy { background: radial-gradient(circle at 34% 25%, #fff 0 2%, #6deaff 8%, #265a8e 34%, #351450 64%, #05070c 83%); }
.neural-cathedral .system-node {
  pointer-events: auto; cursor: pointer; border: 0; background: rgba(2,8,12,.16); padding: 7px 9px;
  border-radius: 12px; opacity: .68; transition: opacity .25s ease, transform .25s ease, background .25s ease, filter .25s ease;
  backdrop-filter: blur(2px);
}
.neural-cathedral .system-node:hover,
.neural-cathedral .system-node:focus-visible { opacity: 1; background: rgba(3,12,18,.7); transform: translateY(-5px) scale(1.05); filter: drop-shadow(0 0 16px var(--node)); outline: 1px solid color-mix(in srgb, var(--node) 60%, transparent); }
.neural-cathedral .node-portfolio { left: 18%; top: 37%; }
.neural-cathedral .node-accounts { left: 31%; top: 23%; }
.neural-cathedral .node-markets { right: 24%; top: 27%; }
.neural-cathedral .node-control { left: 20%; bottom: 25%; }
.neural-cathedral .node-diary { right: 18%; bottom: 23%; }
.neural-cathedral .living-status { z-index: 9; bottom: 24px; opacity: .65; }
.neural-cathedral .status-left { left: 28px; }
.neural-cathedral .status-right { right: 28px; }
.chamber-instruction {
  position: absolute; z-index: 9; left: 50%; bottom: 22px; transform: translateX(-50%);
  color: rgba(164,205,222,.42); font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .21em;
  animation: instruction-pulse 3s ease-in-out infinite;
}
@keyframes chamber-awaken { from { opacity: 0; filter: brightness(.25) blur(6px); transform: scale(1.025); } to { opacity: 1; filter: none; transform: none; } }
@keyframes cathedral-breathe {
  0% { transform: scale(1.035) rotateX(.35deg); filter: brightness(.82) saturate(.95); }
  48% { transform: scale(1.075) rotateX(-.25deg); filter: brightness(1.04) saturate(1.12); }
  100% { transform: scale(1.05) rotateX(.2deg); filter: brightness(.92) saturate(1.04); }
}
@keyframes cathedral-haze { 50% { transform: translate3d(1.5%, -.8%, 0) scale(1.035); opacity: .8; } }
@keyframes instruction-pulse { 50% { opacity: .3; } }

@media (max-width: 820px) {
  .return-to-chamber { top: 10px; right: 10px; padding: 9px 11px; font-size: 8px; }
  .neural-cathedral .living-copy { top: 19px; }
  .neural-cathedral .living-copy > p:not(.eyebrow) { display: none; }
  .neural-cathedral .nexus-core { top: 52%; width: 165px; }
  .neural-cathedral .node-portfolio { left: 14%; top: 34%; }
  .neural-cathedral .node-accounts { left: 29%; top: 27%; }
  .neural-cathedral .node-markets { right: 17%; top: 31%; }
  .neural-cathedral .node-control { left: 15%; bottom: 28%; }
  .neural-cathedral .node-diary { right: 13%; bottom: 27%; }
  .neural-cathedral .living-status { display: none; }
}

/* Live Dashboard focus mode removes every Command Center surface except the city. */
.dashboard-focus-controls { display: none; }
body.dashboard-focus { overflow: hidden; background: #000; }
body.dashboard-focus .app-shell { display: block; }
body.dashboard-focus .sidebar,
body.dashboard-focus .topbar { display: none; }
body.dashboard-focus .main { width: 100vw; height: 100vh; }
body.dashboard-focus .view { display: none; }
body.dashboard-focus #view-dashboard.active { display: block; position: fixed; z-index: 100; inset: 0; width: 100vw; height: 100vh; max-width: none; padding: 0; margin: 0; animation: focus-in .42s ease; }
body.dashboard-focus #view-dashboard .page-head,
body.dashboard-focus #view-dashboard .iframe-status { display: none; }
body.dashboard-focus #view-dashboard .iframe-shell { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
body.dashboard-focus #view-dashboard iframe { height: 100%; }
body.dashboard-focus .dashboard-focus-controls { display: flex; position: fixed; z-index: 120; top: 15px; right: 18px; gap: 7px; opacity: .16; transition: opacity .18s ease; }
body.dashboard-focus .dashboard-focus-controls:hover,
body.dashboard-focus .dashboard-focus-controls:focus-within { opacity: 1; }
.dashboard-focus-controls button { border: 1px solid rgba(53, 221, 255, .5); background: rgba(2, 10, 18, .8); backdrop-filter: blur(14px); color: #cdf6ff; border-radius: 9px; padding: 9px 12px; cursor: pointer; font: 800 9px ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-focus-controls button:last-child { width: 36px; padding: 7px; font-size: 18px; }
@keyframes focus-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

.metric-grid { display: grid; gap: 12px; margin: 16px 0; }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-height: 116px; border: 1px solid var(--line); background: rgba(7, 20, 32, .85); border-radius: 14px; padding: 18px; }
.metric label { display: block; color: #718fa2; font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.metric strong { display: block; margin: 10px 0 4px; font-size: 28px; letter-spacing: -.03em; }
.metric small { color: #6f899a; }
.metric.positive strong, .positive { color: var(--green) !important; }
.metric.negative strong, .negative { color: var(--red) !important; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.section-panel { padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-head h2, .section-head h3 { margin: 5px 0 0; }
.section-head h3 { font-size: 19px; }
.section-head > div > p:not(.eyebrow) { color: var(--muted); margin: 8px 0 0; }
.page-head { margin-bottom: 20px; align-items: flex-end; }
.page-head h2 { font-size: 36px; letter-spacing: -.04em; }
.text-btn { border: 0; background: transparent; color: var(--cyan); cursor: pointer; font-size: 11px; }
.compact-list { margin-top: 15px; display: grid; gap: 8px; }
.compact-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; align-items: center; gap: 12px; border: 1px solid #15364b; background: #071520; border-radius: 10px; padding: 11px 12px; }
.compact-row strong { display: block; }
.compact-row small { color: var(--muted); }
.empty-state { color: #6e8b9d; min-height: 84px; place-content: center; text-align: center; border: 1px dashed #1d4258; border-radius: 11px; padding: 18px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.quick-link { border: 1px solid #1b455c; background: #071724; border-radius: 12px; padding: 14px; text-decoration: none; cursor: pointer; transition: .17s ease; }
.quick-link:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.quick-link strong, .quick-link small { display: block; }
.quick-link small { color: var(--muted); margin-top: 5px; }

.iframe-shell { overflow: hidden; height: calc(100vh - 155px); min-height: 620px; }
.iframe-status { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--green); font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; }
.iframe-status small { color: #617f91; max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iframe-shell iframe { width: 100%; height: calc(100% - 38px); border: 0; background: #02070d; }

.market-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.market-card { min-height: 285px; border: 1px solid var(--accent); border-radius: 18px; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 12%, #07131f), #06101a 70%); padding: 20px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.market-card::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, white 35%, var(--accent)), var(--accent) 42%, #07121d 70%); opacity: .4; right: -55px; top: -45px; }
.market-card h3 { font-size: 30px; margin: 10px 0 2px; }
.market-card > small { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.market-card p { color: var(--muted); font-size: 12px; line-height: 1.55; position: relative; z-index: 2; }
.market-card .window { margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding-top: 12px; font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.market-actions { display: flex; gap: 7px; margin-top: 13px; position: relative; z-index: 2; }
.market-actions a { flex: 1; text-align: center; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 50%, #234); background: rgba(4,12,20,.72); padding: 9px 8px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.warning-panel { margin-top: 16px; padding: 18px 20px; border-color: #59491f; background: rgba(94, 69, 14, .12); }
.warning-panel strong { color: var(--gold); }
.warning-panel p { color: #a69570; margin: 6px 0 0; }

.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.account-card { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 18px; }
.account-card .card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.account-card h3 { margin: 4px 0; }
.account-card .firm { color: var(--cyan); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.status { border: 1px solid currentColor; border-radius: 99px; padding: 5px 8px; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; color: var(--green); }
.status.standby, .status.paused { color: var(--gold); }
.status.failed, .status.closed { color: var(--red); }
.account-balance { font-size: 31px; font-weight: 900; margin: 20px 0 14px; }
.account-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-stats div { border: 1px solid #14364b; border-radius: 9px; background: #06131e; padding: 10px; }
.account-stats small, .account-stats strong { display: block; }
.account-stats small { color: #6f8999; font-size: 8px; text-transform: uppercase; }
.account-stats strong { margin-top: 4px; }
.progress { height: 6px; border-radius: 9px; background: #102737; overflow: hidden; margin: 15px 0 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: inherit; }
.progress-label { display: flex; justify-content: space-between; color: #69889a; font-size: 9px; }
.card-actions { display: flex; gap: 7px; margin-top: 16px; }
.card-actions button, .card-actions a { border: 1px solid #244b61; background: transparent; padding: 7px 10px; border-radius: 8px; text-decoration: none; cursor: pointer; font-size: 10px; }
.card-actions .delete { margin-left: auto; color: var(--red); border-color: #623044; }

.diary-toolbar { padding: 12px; display: grid; grid-template-columns: 1fr 220px 220px; gap: 9px; margin-bottom: 14px; }
input, select, textarea { width: 100%; border: 1px solid #23495f; background: #06131f; color: var(--text); border-radius: 9px; padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53, 221, 255, .08); }
textarea { resize: vertical; }
.diary-list { display: grid; gap: 11px; }
.diary-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px 18px; display: grid; grid-template-columns: 125px minmax(0, 1fr) auto; gap: 18px; }
.diary-card time { color: var(--muted); font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.diary-card h3 { margin: 0 0 7px; }
.diary-card p { color: #9bb0be; margin: 7px 0; line-height: 1.55; white-space: pre-wrap; }
.diary-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.diary-tags span { border: 1px solid #25506a; border-radius: 99px; padding: 4px 7px; color: #8faebe; font-size: 8px; text-transform: uppercase; }
.diary-result { font-size: 20px; font-weight: 900; text-align: right; }

.portfolio-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.strategy-card { border: 1px solid var(--accent); background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 10%, #081722), #06101a); border-radius: 15px; padding: 17px; }
.strategy-card h3 { font-size: 25px; margin: 7px 0; }
.strategy-card .strategy-name { color: white; font-weight: 850; min-height: 40px; }
.strategy-card dl { margin: 14px 0 0; }
.strategy-card dl div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #16384b; padding: 8px 0; }
.strategy-card dt { color: #688798; font-size: 9px; text-transform: uppercase; }
.strategy-card dd { margin: 0; text-align: right; font-size: 10px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-panel { padding: 20px; }
.form-panel.wide { grid-column: 1 / -1; }
.form-panel label { display: grid; gap: 7px; color: #8ea8b7; font-size: 11px; margin-top: 14px; }
.muted { color: var(--muted); line-height: 1.65; }
.inline-status { margin-top: 12px; color: var(--muted); font-size: 11px; }
.stack-actions { display: grid; gap: 9px; margin-top: 18px; }
.file-btn { display: block; text-align: center; }
.file-btn input { display: none; }

.modal { width: min(850px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--line2); border-radius: 18px; padding: 0; background: #07131f; color: var(--text); box-shadow: 0 35px 120px #000; }
.modal::backdrop { background: rgba(0, 4, 9, .78); backdrop-filter: blur(8px); }
.modal form { padding: 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 5px 0 0; }
.icon-btn { border: 1px solid var(--line); background: #091b2a; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid label { display: grid; gap: 6px; color: #8ca6b6; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; background: #0b2332; border: 1px solid var(--cyan); color: white; border-radius: 11px; padding: 12px 15px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1250px) {
  .market-grid, .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .account-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -270px; transition: left .2s ease; width: 245px; }
  .sidebar.open { left: 0; box-shadow: 25px 0 80px #000; }
  .mobile-menu { display: block; }
  .topbar { justify-content: flex-start; }
  .topbar-actions { margin-left: auto; }
  .metric-grid.four, .split-grid, .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .orbit-visual { display: none; }
  .living-core { min-height: 720px; }
  .living-copy { width: calc(100% - 44px); left: 22px; top: 24px; }
  .living-copy h2 { font-size: clamp(36px, 9vw, 62px); }
  .nexus-core { top: 52%; width: 190px; }
  .node-mgc { left: 10%; top: 39%; }
  .node-mnq { left: 22%; top: 29%; }
  .node-es { right: 12%; top: 34%; }
  .node-mcl { left: 14%; bottom: 25%; }
  .node-mng { right: 10%; bottom: 25%; }
  .living-status { display: none; }
  .diary-toolbar { grid-template-columns: 1fr 1fr; }
  .diary-toolbar input { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  .view { padding: 18px 12px; }
  .topbar { padding: 12px; }
  .health-pill { display: none; }
  .hero { padding: 24px 20px; }
  .living-core { min-height: 650px; border-radius: 14px; }
  .living-copy { text-align: center; }
  .living-copy > p:not(.eyebrow) { margin-inline: auto; }
  .nexus-core { top: 53%; width: 170px; }
  .system-node span { display: none; }
  .node-mgc { left: 8%; top: 42%; }
  .node-mnq { left: 20%; top: 32%; }
  .node-es { right: 7%; top: 38%; }
  .node-mcl { left: 10%; bottom: 25%; }
  .node-mng { right: 7%; bottom: 25%; }
  .living-actions { bottom: 25px; width: calc(100% - 28px); justify-content: center; }
  .living-actions button { padding: 9px 10px; }
  .scroll-cue { display: none; }
  body.dashboard-focus .dashboard-focus-controls { top: 8px; right: 8px; opacity: .72; }
  .metric-grid.four, .split-grid, .settings-grid, .account-grid, .market-grid, .portfolio-grid, .quick-grid, .form-grid { grid-template-columns: 1fr; }
  .form-panel.wide, .form-grid .full { grid-column: auto; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h2 { font-size: 30px; }
  .diary-toolbar { grid-template-columns: 1fr; }
  .diary-toolbar input { grid-column: auto; }
  .diary-card { grid-template-columns: 1fr; }
  .diary-result { text-align: left; }
}

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

/* Keep the chamber viewport absolute even when compact-layout rules apply. */
body.overview-immersive .neural-cathedral { width: 100vw; height: 100svh; min-height: 0; border-radius: 0; }
body.overview-immersive .neural-cathedral .living-copy { left: 50%; transform: translateX(-50%); }

/* Operations Network facility interiors */
.autonomous-floor { margin: 0 0 20px; padding: 20px; overflow: hidden; border-color: rgba(182,111,255,.35); background: radial-gradient(circle at 50% 48%, rgba(87,42,137,.22), transparent 42%), linear-gradient(135deg, rgba(7,16,32,.96), rgba(3,9,16,.95)); }
.floor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.floor-head h3 { margin: 5px 0 6px; font-size: clamp(24px, 3vw, 38px); }
.floor-head p:not(.eyebrow) { margin: 0; color: var(--muted); }
.floor-lock { color: #ffc84e; border: 1px solid rgba(255,200,78,.45); border-radius: 999px; padding: 8px 11px; font: 700 8px ui-monospace, Consolas, monospace; letter-spacing: .11em; white-space: nowrap; }
.floor-scene { position: relative; min-height: 430px; overflow: hidden; border: 1px solid rgba(116,97,188,.3); border-radius: 16px; background: radial-gradient(circle at 50% 48%, rgba(53,200,255,.09), transparent 24%), #030913; }
.floor-grid-lines { position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(rgba(123,118,189,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(123,118,189,.18) 1px, transparent 1px); background-size: 42px 42px; transform: perspective(500px) rotateX(62deg) scale(1.7) translateY(35%); transform-origin: center bottom; }
.floor-cable { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, rgba(107,202,255,.72), transparent); transform-origin: left center; box-shadow: 0 0 9px rgba(107,202,255,.55); animation: cablePulse 3.2s ease-in-out infinite; }
.cable-one { width: 65%; left: 17%; top: 50%; transform: rotate(-21deg); }
.cable-two { width: 66%; left: 17%; top: 50%; transform: rotate(19deg); animation-delay: .8s; }
.cable-three { width: 57%; left: 21%; top: 54%; transform: rotate(90deg); animation-delay: 1.6s; }
@keyframes cablePulse { 0%,100% { opacity: .28; } 50% { opacity: .92; } }
.pixel-agent { position: absolute; z-index: 2; display: grid; justify-items: center; gap: 4px; min-width: 92px; padding: 10px 9px 8px; border: 1px solid color-mix(in srgb, var(--agent-color) 45%, transparent); border-radius: 10px; background: rgba(4,15,25,.9); box-shadow: 0 0 18px color-mix(in srgb, var(--agent-color) 12%, transparent); animation: deskBreath 3.4s ease-in-out infinite; }
.pixel-agent span { color: #e8f7ff; font-size: 11px; font-weight: 700; }
.pixel-agent small { color: var(--agent-color); font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.pixel-person { position: relative; display: block; width: 24px; height: 26px; image-rendering: pixelated; animation: operatorMove 2.8s steps(4,end) infinite; }
.pixel-person::before { content: ''; position: absolute; top: 0; left: 7px; width: 10px; height: 9px; background: var(--agent-color); box-shadow: 2px 2px 0 rgba(255,255,255,.5); }
.pixel-person b { position: absolute; left: 4px; top: 10px; width: 16px; height: 10px; background: #9b6bff; box-shadow: -3px 3px 0 #263d6d, 3px 3px 0 #263d6d; }
.pixel-person em { position: absolute; left: 6px; bottom: 0; width: 5px; height: 7px; background: #e7f2ff; box-shadow: 7px 0 #e7f2ff; }
@keyframes operatorMove { 0%,100% { transform: translate(0,0); } 35% { transform: translate(3px,-2px); } 65% { transform: translate(-2px,1px); } }
@keyframes deskBreath { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.agent-trend { --agent-color:#b66fff; left: 8%; top: 18%; }
.agent-flow { --agent-color:#35ddff; left: 33%; top: 8%; animation-delay: .5s; }
.agent-profile { --agent-color:#ffc84e; right: 31%; top: 10%; animation-delay: 1s; }
.agent-macro { --agent-color:#39e7ac; right: 7%; top: 22%; animation-delay: 1.5s; }
.agent-swing { --agent-color:#ff725c; left: 14%; bottom: 12%; animation-delay: 2s; }
.risk-console { position: absolute; z-index: 3; left: 50%; top: 50%; display: grid; justify-items: center; gap: 6px; width: 180px; padding: 20px 14px; transform: translate(-50%,-50%); border: 1px solid rgba(255,114,92,.65); border-radius: 14px; background: radial-gradient(circle, rgba(111,27,47,.45), rgba(5,13,23,.96) 66%); box-shadow: 0 0 36px rgba(255,114,92,.16); }
.risk-orb { width: 34px; height: 34px; border-radius: 50%; background: #ff725c; box-shadow: 0 0 16px #ff725c, inset 0 0 0 7px rgba(255,255,255,.18); animation: orbPulse 2.4s ease-in-out infinite; }
@keyframes orbPulse { 50% { transform: scale(1.12); box-shadow: 0 0 30px #ff725c, inset 0 0 0 7px rgba(255,255,255,.18); } }
.risk-console strong { color: #fff1f2; font-size: 12px; letter-spacing: .08em; }
.risk-console small { color: #ff9ba4; font: 700 8px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.floor-status { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); color: #9ec4d3; white-space: nowrap; font: 700 8px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #39e7ac; box-shadow: 0 0 12px #39e7ac; }
.floor-evidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.floor-evidence > div { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid rgba(96,163,190,.2); border-radius: 10px; background: rgba(2,9,15,.72); }
.floor-evidence > div > * { display: block; min-width: 0; }
.floor-evidence small { color: #6d8b9c; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .13em; }
.floor-evidence strong { margin-top: 2px; color: #39e7ac; font-size: 14px; line-height: 1.25; }
.floor-evidence strong.warning { color: #ffc84e; }
.floor-evidence strong.negative { color: #ff8290; }
.floor-evidence span { color: #9cb9c6; font-size: 11px; line-height: 1.35; }
.wing-control-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 12px; }
.wing-data-spine, .wing-agent-contracts { padding: 16px; border: 1px solid rgba(96,163,190,.2); border-radius: 12px; background: rgba(2,9,15,.66); }
.wing-subhead { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.wing-subhead h4 { margin: 5px 0 0; color: #e6f7ff; font-size: 15px; }
.source-badge { color:#a98cff; border:1px solid rgba(169,140,255,.35); border-radius:999px; padding:6px 8px; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.11em; white-space:nowrap; }
.spine-list, .contract-list { display:grid; gap:7px; }
.spine-row, .contract-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px; border:1px solid rgba(96,163,190,.14); border-radius:8px; background:rgba(3,13,22,.7); }
.spine-row > div, .contract-row > div { min-width:0; display:grid; gap:3px; }
.spine-row strong, .contract-row strong { color:#d8f2ff; font-size:11px; }
.spine-row small, .contract-row small { color:#7896a7; font-size:9px; line-height:1.3; }
.spine-row em, .contract-row em { flex:0 0 auto; color:#ffc84e; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.08em; font-style:normal; text-align:right; }
.contract-row em { max-width:120px; color:#ff9ba4; }
.spine-light { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:#ffc84e; box-shadow:0 0 12px #ffc84e; }
.shadow-board { margin-top: 12px; padding: 16px; border: 1px solid rgba(182,111,255,.25); border-radius: 12px; background: rgba(12,7,28,.55); }
.shadow-board-note { margin: -3px 0 12px; color: #9cb9c6; font-size: 11px; line-height: 1.45; }
.shadow-test-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.shadow-test-card { min-width: 0; padding: 12px; border: 1px solid rgba(139,107,196,.22); border-radius: 9px; background: rgba(3,10,20,.78); }
.shadow-test-top { display: grid; gap: 6px; min-height: 47px; }
.shadow-test-top strong { color: #e5f6ff; font-size: 11px; }
.shadow-test-top span { color: #b88cff; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.shadow-test-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 10px 0; }
.shadow-test-metrics div { display: grid; gap: 3px; }
.shadow-test-metrics small { color: #6d8b9c; font: 700 6px ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.shadow-test-metrics b { color: #39e7ac; font-size: 11px; }
.shadow-test-card p { margin: 0; color: #8ea8b5; font-size: 9px; line-height: 1.35; }
.risk-board { margin-top: 12px; padding: 16px; border: 1px solid rgba(255,114,92,.26); border-radius: 12px; background: rgba(30,8,18,.42); }
.risk-board-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.risk-board-grid > div { display: grid; gap: 5px; padding: 12px; border: 1px solid rgba(255,114,92,.16); border-radius: 8px; background: rgba(4,11,18,.72); }
.risk-board-grid small { color: #a4858c; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.risk-board-grid strong { color: #ffb2b7; font-size: 16px; }
.risk-board-grid .risk-safe { color: #39e7ac; }
.risk-board-grid span { color: #9cb9c6; font-size: 9px; line-height: 1.35; }
.outcome-board { margin-top: 12px; padding: 16px; border: 1px solid rgba(57,231,172,.25); border-radius: 12px; background: rgba(3,25,25,.38); }
.outcome-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.outcome-summary > div { display:grid; gap:5px; padding:11px; border:1px solid rgba(96,163,190,.16); border-radius:8px; background:rgba(3,13,22,.72); }
.outcome-summary small { color:#6d8b9c; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.1em; }
.outcome-summary strong { color:#39e7ac; font-size:15px; }
.outcome-summary strong.warning { color:#ffc84e; font-size:11px; }
.outcome-summary strong.negative, .outcome-table .negative { color:#ff8290; }
.outcome-table-wrap { overflow-x:auto; }
.outcome-table { width:100%; border-collapse:collapse; min-width:620px; }
.outcome-table th, .outcome-table td { padding:10px 9px; border-bottom:1px solid rgba(96,163,190,.14); text-align:left; font-size:10px; }
.outcome-table th { color:#6d8b9c; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.1em; }
.outcome-table td { color:#c8e1ea; }
.outcome-table td:nth-child(2), .outcome-table td:nth-child(3) { color:#9cb9c6; }
.outcome-table .positive { color:#39e7ac; }
.treasury-board { margin-top: 12px; padding: 16px; border: 1px solid rgba(255,200,78,.26); border-radius: 12px; background: rgba(29,23,5,.32); }
.treasury-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.treasury-summary > div { display:grid; gap:5px; padding:11px; border:1px solid rgba(96,163,190,.16); border-radius:8px; background:rgba(3,13,22,.72); }
.treasury-summary small { color:#6d8b9c; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.1em; }
.treasury-summary strong { color:#ffc84e; font-size:15px; }
.treasury-summary strong.positive { color:#39e7ac; }
.treasury-summary strong.negative { color:#ff8290; }
.treasury-table-wrap { overflow-x:auto; }
.treasury-table { width:100%; border-collapse:collapse; min-width:700px; }
.treasury-table th, .treasury-table td { padding:10px 9px; border-bottom:1px solid rgba(96,163,190,.14); text-align:left; font-size:10px; }
.treasury-table th { color:#6d8b9c; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.1em; }
.treasury-table td { color:#c8e1ea; }
.treasury-table td.positive { color:#39e7ac; }
.treasury-table td.negative { color:#ff8290; }
.treasury-empty { color:#8ea8b5 !important; text-align:center !important; padding:20px !important; }
.reliability-board { margin-top: 12px; padding: 16px; border: 1px solid rgba(53,221,255,.25); border-radius: 12px; background: rgba(3,19,29,.42); }
.reliability-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.reliability-card { display:flex; align-items:center; gap:9px; padding:11px; border:1px solid rgba(96,163,190,.16); border-radius:8px; background:rgba(3,13,22,.72); }
.reliability-card > div { min-width:0; display:grid; gap:4px; }
.reliability-card strong { color:#d8f2ff; font-size:10px; }
.reliability-card small { color:#7896a7; font-size:8px; }
.reliability-card em { margin-left:auto; color:#39e7ac; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.08em; font-style:normal; }
.reliability-light { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:#39e7ac; box-shadow:0 0 12px #39e7ac; }
.audit-strip { display:flex; align-items:center; gap:8px; margin-top:10px; padding:10px; color:#9cb9c6; border-top:1px solid rgba(96,163,190,.14); font-size:9px; }
.audit-strip strong { color:#c9e0e9; }
.decision-board { margin-top:12px; padding:16px; border:1px solid rgba(255,255,255,.22); border-radius:12px; background:rgba(12,16,24,.58); }
.decision-flow { display:grid; grid-template-columns:1fr auto 1fr auto 1fr auto 1fr; gap:9px; align-items:center; }
.decision-flow > div { display:grid; gap:4px; min-height:78px; padding:12px; border:1px solid rgba(96,163,190,.18); border-radius:8px; background:rgba(3,13,22,.76); }
.decision-flow b { color:#a98cff; font:700 8px ui-monospace,Consolas,monospace; }
.decision-flow strong { color:#e4f6ff; font-size:11px; }
.decision-flow small { color:#8ea8b5; font-size:9px; line-height:1.35; }
.decision-flow i { color:#39e7ac; font-size:20px; font-style:normal; }
.decision-notice { display:flex; gap:10px; align-items:center; margin-top:10px; padding:10px; border:1px solid rgba(255,200,78,.24); border-radius:8px; background:rgba(48,35,8,.22); }
.decision-notice strong { color:#ffc84e; font:700 8px ui-monospace,Consolas,monospace; letter-spacing:.08em; }
.decision-notice span { color:#a8c0cb; font-size:9px; }
.control-board { margin-top:12px; padding:16px; border:1px solid rgba(255,114,92,.24); border-radius:12px; background:rgba(22,8,14,.42); }
.control-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.control-check { display:flex; align-items:flex-start; gap:9px; min-height:74px; padding:11px; border:1px solid rgba(255,114,92,.16); border-radius:8px; background:rgba(3,13,22,.76); }
.control-check > div { min-width:0; display:grid; gap:4px; }
.control-check strong { color:#e5f6ff; font-size:10px; }
.control-check small { color:#8ea8b5; font-size:8px; line-height:1.35; }
.control-check em { margin-left:auto; color:#39e7ac; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.07em; font-style:normal; text-align:right; }
.control-check-light { width:7px; height:7px; flex:0 0 auto; margin-top:3px; border-radius:50%; background:#39e7ac; box-shadow:0 0 12px #39e7ac; }
.provider-board { margin-top:12px; padding:16px; border:1px solid rgba(53,221,255,.24); border-radius:12px; background:rgba(3,19,29,.42); }
.provider-note { margin:-3px 0 12px; color:#9cb9c6; font-size:10px; line-height:1.4; }
.provider-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.provider-card { display:flex; align-items:flex-start; gap:9px; min-height:92px; padding:11px; border:1px solid rgba(96,163,190,.16); border-radius:8px; background:rgba(3,13,22,.76); }
.provider-card > div { min-width:0; display:grid; gap:4px; }
.provider-card strong { color:#d8f2ff; font-size:10px; }
.provider-card small { color:#7896a7; font-size:8px; line-height:1.35; }
.provider-card em { margin-left:auto; color:#ffc84e; font:700 7px ui-monospace,Consolas,monospace; letter-spacing:.07em; font-style:normal; text-align:right; }
.provider-light { width:7px; height:7px; flex:0 0 auto; margin-top:3px; border-radius:50%; background:#ffc84e; box-shadow:0 0 12px #ffc84e; }
.facility-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.facility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.facility-card { display: grid; gap: 7px; min-height: 112px; padding: 15px; text-align: left; color: #dff8ff; background: linear-gradient(145deg, rgba(7,21,31,.9), rgba(3,10,16,.86)); border: 1px solid rgba(83,163,194,.24); border-radius: 14px; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.facility-card:hover, .facility-card:focus-visible, .facility-card.active { transform: translateY(-3px); border-color: color-mix(in srgb, var(--facility-accent) 70%, transparent); box-shadow: 0 12px 34px rgba(0,0,0,.25), 0 0 24px color-mix(in srgb, var(--facility-accent) 16%, transparent); outline: none; background: linear-gradient(145deg, color-mix(in srgb, var(--facility-accent) 10%, #07151f), rgba(3,10,16,.92)); }
.facility-card strong { font-size: 14px; letter-spacing: .02em; }
.facility-card small { color: var(--facility-accent); font: 700 8px ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.facility-kicker { color: #7191a2; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.facility-detail { position: sticky; top: 20px; min-height: 540px; padding: 26px; border-color: color-mix(in srgb, var(--facility-accent) 45%, rgba(74,144,174,.28)); background: radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--facility-accent) 13%, transparent), transparent 32%), rgba(4,14,23,.9); }
.facility-detail-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid rgba(104,171,197,.18); }
.facility-detail h3 { margin: 5px 0 8px; font-size: clamp(24px, 3vw, 38px); color: #f1fbff; }
.facility-detail-head p:not(.eyebrow) { max-width: 620px; color: #9cb9c6; line-height: 1.55; }
.facility-status { flex: 0 0 auto; padding: 8px 10px; color: var(--facility-accent); border: 1px solid color-mix(in srgb, var(--facility-accent) 50%, transparent); border-radius: 999px; font: 700 8px ui-monospace, Consolas, monospace; letter-spacing: .1em; }
.facility-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.facility-stat-row > div { padding: 13px; border: 1px solid rgba(96,163,190,.2); border-radius: 10px; background: rgba(2,9,15,.65); }
.facility-stat-row small { display: block; color: #6d8b9c; font: 700 7px ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.facility-stat-row strong { display: block; margin-top: 7px; color: var(--facility-accent); font-size: 18px; }
.facility-board { padding: 18px 0; }
.facility-board-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(96,163,190,.13); color: #c9e0e9; }
.facility-board-row i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--facility-accent); box-shadow: 0 0 14px var(--facility-accent); }
.facility-boundary { margin-top: 18px; padding: 16px; border: 1px solid rgba(255,160,120,.25); border-radius: 11px; background: rgba(70,30,24,.17); }
.facility-boundary p:last-child { margin: 5px 0 0; color: #d7b2a9; line-height: 1.5; }

@media (max-width: 980px) {
  .facility-layout { grid-template-columns: 1fr; }
  .facility-detail { position: static; min-height: 0; }
}
@media (max-width: 560px) {
  .floor-head { display: block; }
  .floor-lock { display: inline-block; margin-top: 10px; }
  .floor-scene { min-height: 560px; }
  .agent-trend { left: 4%; top: 18%; }
  .agent-flow { left: 4%; top: 38%; }
  .agent-profile { right: 4%; top: 40%; }
  .agent-macro { right: 4%; top: 19%; }
  .agent-swing { left: 4%; bottom: 12%; }
  .risk-console { top: 67%; }
  .floor-status { font-size: 7px; }
  .floor-evidence { grid-template-columns: 1fr; }
  .wing-control-grid { grid-template-columns: 1fr; }
  .shadow-test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outcome-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treasury-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reliability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-flow { grid-template-columns: 1fr; }
  .decision-flow i { transform: rotate(90deg); justify-self:center; }
  .decision-notice { display:grid; }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facility-grid { grid-template-columns: 1fr; }
  .facility-detail-head { display: block; }
  .facility-status { display: inline-block; margin-top: 10px; }
  .facility-stat-row { grid-template-columns: 1fr; }
}
