:root {
  color-scheme: dark;
  --void: #01040a;
  --abyss: #040a13;
  --panel: rgba(5, 14, 26, 0.76);
  --panel-deep: rgba(3, 9, 18, 0.92);
  --panel-edge: rgba(148, 226, 255, 0.22);
  --ink: #f1fbff;
  --muted: #82a1b6;
  --cyan: #8de2ff;
  --sage: #2ef2b2;
  --rust: #ff7458;
  --gold: #ffc857;
  --rose: #ff4d8d;
  --smoke: #78d9f4;
  --focus: #8de2ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --display: "Avenir Next Condensed", "Hiragino Kaku Gothic ProN", sans-serif;
  --body: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body[data-view="decade"] .year-only,
body[data-view="year"] .decade-only {
  display: none !important;
}

html {
  background: var(--void);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 16% 14%, rgba(46, 242, 178, 0.1), transparent 34rem),
    radial-gradient(ellipse at 84% 26%, rgba(255, 77, 141, 0.085), transparent 30rem),
    linear-gradient(128deg, #01040a 0%, #05101c 52%, #060916 100%);
  font-family: var(--body);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(141, 226, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(46, 242, 178, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 86%);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

#neuralScene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
}

.scan-field,
.ambient-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scan-field {
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 0 22%, rgba(1, 4, 10, 0.1) 48%, rgba(1, 4, 10, 0.7) 92%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(141, 226, 255, 0.026) 7px);
}

.scan-field::before {
  content: "";
  position: absolute;
  inset: -20% 0 auto;
  height: 24%;
  background: linear-gradient(180deg, transparent, rgba(141, 226, 255, 0.08) 72%, rgba(255, 255, 255, 0.2), transparent);
  mix-blend-mode: screen;
  animation: fieldScan 8s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.ambient-noise {
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  padding: 16px;
  perspective: 1800px;
}

.topbar,
.brief-panel,
.inspector {
  position: relative;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  background:
    linear-gradient(128deg, rgba(141, 226, 255, 0.075), transparent 32%),
    linear-gradient(310deg, rgba(255, 77, 141, 0.035), transparent 38%),
    var(--panel);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(1.3);
}

.topbar::before,
.brief-panel::before,
.inspector::before,
.canvas-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.54);
  border-left: 1px solid rgba(255, 255, 255, 0.54);
  pointer-events: none;
}

.topbar::before,
.brief-panel::before,
.inspector::before {
  top: -1px;
  left: -1px;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 14px;
}

.brand {
  min-width: 310px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(141, 226, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(141, 226, 255, 0.14);
}

.brand-orbit::before,
.brand-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.brand-orbit::before {
  inset: -5px 7px;
  border-top: 1px solid var(--sage);
  border-bottom: 1px solid var(--rose);
  animation: orbitSpin 7s linear infinite;
}

.brand-orbit::after {
  width: 6px;
  height: 6px;
  top: -3px;
  background: #fff;
  box-shadow: 0 0 12px 3px var(--cyan);
  animation: orbitSpin 4.6s linear infinite reverse;
  transform-origin: 3px 31px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #020810;
  background:
    radial-gradient(circle at 34% 25%, #fff 0 9%, var(--cyan) 31%, var(--sage) 54%, #0c2230 56% 100%);
  box-shadow:
    0 0 30px rgba(141, 226, 255, 0.5),
    inset 0 0 17px rgba(1, 4, 10, 0.65);
  font-family: "Didot", "Bodoni 72", serif;
  font-size: 25px;
}

.brand h1 {
  margin: 1px 0 0;
  color: #fff;
  font-family: var(--display);
  font-size: 29px;
  font-stretch: condensed;
  line-height: 0.96;
  text-shadow: 0 0 22px rgba(141, 226, 255, 0.45);
}

.brand-context {
  display: inline-block;
  margin-left: 7px;
  color: #b9afff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
  text-shadow: 0 0 14px rgba(142, 125, 255, 0.72);
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.2;
  text-transform: uppercase;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.live-pip {
  width: 6px;
  height: 6px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 10px var(--sage);
  animation: livePulse 1.8s ease-in-out infinite;
}

.neural-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  align-self: stretch;
  margin-left: auto;
  border-left: 1px solid rgba(141, 226, 255, 0.16);
}

.neural-metrics > span {
  position: relative;
  min-width: 94px;
  display: grid;
  grid-template-columns: 7px 1fr;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0 8px;
  padding: 10px 14px;
  border-right: 1px solid rgba(141, 226, 255, 0.16);
  overflow: hidden;
}

.neural-metrics > span::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transform: translateX(-100%);
  animation: metricSweep 4.8s linear infinite;
}

.neural-metrics i {
  grid-row: 1 / 3;
  width: 3px;
  height: 70%;
  align-self: center;
  background: linear-gradient(to bottom, transparent, var(--sage), transparent);
  box-shadow: 0 0 8px var(--sage);
}

.neural-metrics b {
  align-self: end;
  color: #fff;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(141, 226, 255, 0.6);
}

.neural-metrics small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tool-button,
.icon-button,
.wide-button,
.node-actions button {
  min-height: 38px;
  border: 1px solid rgba(141, 226, 255, 0.2);
  border-radius: 5px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(141, 226, 255, 0.09), rgba(141, 226, 255, 0.025)),
    rgba(2, 8, 16, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
}

.tool-button span:first-child {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 226, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--mono);
}

.icon-button {
  width: 38px;
  padding: 0;
  font-family: var(--mono);
  font-size: 15px;
}

.tool-button:hover,
.icon-button:hover,
.wide-button:hover,
.node-actions button:hover {
  transform: translateY(-2px);
  border-color: rgba(141, 226, 255, 0.65);
  background:
    linear-gradient(180deg, rgba(141, 226, 255, 0.17), rgba(46, 242, 178, 0.05)),
    rgba(2, 8, 16, 0.9);
  box-shadow:
    0 0 24px rgba(141, 226, 255, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tool-button.primary {
  border-color: rgba(255, 255, 255, 0.3);
  color: #020810;
  background: linear-gradient(118deg, var(--gold), var(--sage) 52%, var(--cyan));
  box-shadow:
    0 0 26px rgba(46, 242, 178, 0.25),
    inset 0 0 14px rgba(255, 255, 255, 0.34);
}

.tool-button.primary span:first-child {
  border-color: rgba(2, 8, 16, 0.26);
  color: #020810;
}

.decade-button span:first-child {
  width: 27px;
  border-color: rgba(142, 125, 255, 0.5);
  color: #b9afff;
  font-size: 8px;
  box-shadow: 0 0 12px rgba(142, 125, 255, 0.15);
}

.day-button span:first-child {
  width: 27px;
  border-color: rgba(255, 77, 141, 0.48);
  color: #ff8ab5;
  font-size: 8px;
  box-shadow: 0 0 12px rgba(255, 77, 141, 0.14);
}

.danger {
  color: #ff9c88;
}

.brief-panel {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(250px, 390px) auto;
  align-items: center;
  gap: 20px;
  padding: 9px 14px;
}

.title-field,
.field {
  display: grid;
  gap: 7px;
}

.title-field {
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
}

.title-field > span,
.field > span,
.swatches legend {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(141, 226, 255, 0.18);
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: rgba(1, 6, 13, 0.68);
  box-shadow: inset 0 1px 10px rgba(0, 0, 0, 0.28);
}

input,
select {
  min-height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 114px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px rgba(141, 226, 255, 0.15),
    0 0 22px rgba(141, 226, 255, 0.12);
}

.progress-wrap {
  display: grid;
  gap: 6px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.progress-copy strong {
  color: var(--cyan);
  font-weight: 500;
}

.progress-track {
  position: relative;
  height: 5px;
  overflow: visible;
  border: 1px solid rgba(141, 226, 255, 0.2);
  background: rgba(1, 5, 11, 0.8);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-track::after {
  content: "";
  position: absolute;
  inset: -4px 0;
  opacity: 0.22;
  background: repeating-linear-gradient(90deg, transparent 0 28px, var(--cyan) 29px 30px);
}

#progressBar {
  position: relative;
  z-index: 1;
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--sage), var(--cyan));
  box-shadow: 0 0 14px rgba(46, 242, 178, 0.64);
  transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.save-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.save-status::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 8px var(--sage);
}

.save-status.is-saving::before {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: livePulse 0.8s ease-in-out infinite;
}

.workspace {
  min-height: calc(100vh - 176px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 10px;
}

.canvas-frame {
  position: relative;
  min-width: 0;
  min-height: 610px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(141, 226, 255, 0.18);
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(141, 226, 255, 0.075), transparent 30rem),
    linear-gradient(90deg, rgba(141, 226, 255, 0.034) 1px, transparent 1px),
    linear-gradient(rgba(46, 242, 178, 0.026) 1px, transparent 1px),
    rgba(1, 5, 12, 0.32);
  background-size: auto, 56px 56px, 56px 56px, auto;
  box-shadow:
    var(--shadow),
    inset 0 0 100px rgba(141, 226, 255, 0.04);
  backdrop-filter: blur(2px);
}

.canvas-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(46, 242, 178, 0.08), transparent 18%, transparent 82%, rgba(255, 77, 141, 0.07)),
    radial-gradient(circle at 50% 48%, transparent 0 240px, rgba(141, 226, 255, 0.06) 241px, transparent 243px),
    radial-gradient(circle at 50% 48%, transparent 0 338px, rgba(141, 226, 255, 0.035) 339px, transparent 341px);
}

.canvas-frame::after {
  top: auto;
  right: -1px;
  bottom: -1px;
  transform: rotate(180deg);
}

.stage-hud {
  position: absolute;
  z-index: 4;
  display: flex;
  color: rgba(141, 226, 255, 0.62);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.hud-top {
  top: 14px;
  left: 16px;
  right: 16px;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.1);
}

.hud-side {
  top: 54px;
  bottom: 18px;
  left: 12px;
  flex-direction: row-reverse;
  justify-content: space-between;
  writing-mode: vertical-rl;
}

.reticle {
  position: absolute;
  z-index: 0;
  top: 48%;
  left: 50%;
  width: 460px;
  aspect-ratio: 1;
  border: 1px solid rgba(141, 226, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: reticleBreath 5s ease-in-out infinite;
}

.reticle::before,
.reticle::after,
.reticle span::before,
.reticle span::after {
  content: "";
  position: absolute;
  background: rgba(141, 226, 255, 0.2);
}

.reticle::before {
  top: 50%;
  left: -34px;
  width: calc(100% + 68px);
  height: 1px;
}

.reticle::after {
  top: -34px;
  left: 50%;
  width: 1px;
  height: calc(100% + 68px);
}

.reticle span::before {
  inset: 48px;
  border: 1px dashed rgba(46, 242, 178, 0.12);
  border-radius: 50%;
  background: transparent;
  animation: orbitSpin 24s linear infinite;
}

.reticle span::after {
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 18px var(--cyan);
  transform: translate(-50%, -50%);
}

.depth-scale {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 14px;
  display: flex;
  gap: 5px;
  pointer-events: none;
}

.depth-scale i {
  width: 18px;
  height: 2px;
  background: rgba(141, 226, 255, 0.15);
}

.depth-scale i:nth-child(-n + 3) {
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
}

.canvas-scroller {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 610px;
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-color: rgba(141, 226, 255, 0.24) transparent;
  scrollbar-width: thin;
}

.canvas {
  position: relative;
  min-width: 1420px;
  min-height: 920px;
}

.link-layer,
.node-layer {
  position: absolute;
  inset: 0;
}

.link-layer {
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(141, 226, 255, 0.25));
}

.synapse-link {
  stroke-dasharray: 3 12 18 12;
  animation: synapseFlow 6s linear infinite;
}

.synapse-link.is-fired {
  stroke-dasharray: 2 7;
  animation-duration: 1.35s;
  filter: drop-shadow(0 0 9px rgba(46, 242, 178, 0.9));
}

.temporal-spine {
  opacity: 0.5;
  stroke-dasharray: 2 9 24 9;
  filter: drop-shadow(0 0 10px rgba(142, 125, 255, 0.76));
  animation: temporalFlow 8s linear infinite;
}

.mind-node {
  --node-color: var(--cyan);
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: absolute;
  width: 214px;
  min-height: 122px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  padding: 12px 13px;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--node-color) 36%, transparent);
  border-left: 2px solid var(--node-color);
  border-radius: 4px;
  color: var(--ink);
  background:
    linear-gradient(116deg, color-mix(in srgb, var(--node-color) 12%, transparent), transparent 42%),
    linear-gradient(180deg, rgba(10, 24, 40, 0.84), rgba(2, 8, 16, 0.88));
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.42),
    0 0 24px color-mix(in srgb, var(--node-color) 9%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  outline: none;
  user-select: none;
  touch-action: none;
  transform: perspective(800px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) translateZ(0);
  transform-style: preserve-3d;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.mind-node::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, var(--node-color), transparent);
  box-shadow: 0 0 9px var(--node-color);
}

.mind-node::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--node-color);
  border-radius: 50%;
  background: #020810;
  box-shadow: 0 0 12px var(--node-color);
  transform: translateY(-50%);
}

.mind-node:hover {
  transform: perspective(800px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) translate3d(0, -3px, 12px);
  border-color: color-mix(in srgb, var(--node-color) 72%, white 8%);
  box-shadow:
    0 26px 58px rgba(0, 0, 0, 0.5),
    0 0 32px color-mix(in srgb, var(--node-color) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.mind-node[data-kind="root"] {
  width: 248px;
  min-height: 156px;
  border-left-width: 3px;
  background:
    radial-gradient(circle at 28% 15%, rgba(141, 226, 255, 0.27), transparent 36%),
    linear-gradient(135deg, rgba(255, 77, 141, 0.12), transparent 52%),
    rgba(2, 7, 15, 0.93);
  box-shadow:
    0 0 0 1px rgba(141, 226, 255, 0.1),
    0 0 52px rgba(141, 226, 255, 0.26),
    0 0 110px rgba(46, 242, 178, 0.1),
    inset 0 0 32px rgba(141, 226, 255, 0.1);
}

.mind-node[data-kind="root"]::after {
  width: 11px;
  height: 11px;
  left: -8px;
  background: var(--cyan);
  animation: portPulse 1.8s ease-in-out infinite;
}

.mind-node[data-kind="week"] {
  width: 166px;
  min-height: 118px;
  background:
    linear-gradient(135deg, rgba(46, 242, 178, 0.09), transparent 48%),
    rgba(3, 11, 20, 0.9);
}

.mind-node[data-kind="year"] {
  min-height: 132px;
  border-color: color-mix(in srgb, var(--node-color) 48%, #8e7dff 24%);
  background:
    linear-gradient(120deg, rgba(142, 125, 255, 0.2), transparent 44%),
    radial-gradient(circle at 82% 18%, rgba(141, 226, 255, 0.14), transparent 34%),
    rgba(3, 10, 22, 0.94);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.46),
    0 0 28px rgba(142, 125, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.mind-node[data-kind="year"] .node-title {
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mind-node[data-kind="year"] .node-chip::before {
  content: "HORIZON ";
  color: #a99fff;
}

.mind-node.is-year-portal {
  cursor: pointer;
}

.mind-node.is-year-portal:hover {
  border-color: #b9afff;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(142, 125, 255, 0.26),
    inset 0 0 24px rgba(142, 125, 255, 0.09);
}

.year-open {
  margin-left: auto;
  color: #c8c1ff;
  font-family: var(--mono);
  font-size: 7px;
  white-space: nowrap;
}

.year-open b {
  margin-left: 3px;
  color: #fff;
  font-size: 10px;
  text-shadow: 0 0 10px #8e7dff;
}

.mind-node[data-kind="day"] {
  width: 148px;
  min-height: 112px;
  padding: 10px;
  gap: 7px;
  border-color: color-mix(in srgb, var(--node-color) 42%, var(--rose) 12%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--node-color) 12%, transparent), transparent 48%),
    rgba(3, 10, 19, 0.94);
}

.mind-node[data-kind="day"] .node-title {
  font-size: 15px;
}

.mind-node[data-kind="day"] .node-body {
  font-size: 10px;
  line-height: 1.4;
}

.mind-node[data-kind="day"] .node-chip::before {
  content: "DAY ";
  color: var(--rose);
}

.mind-node[data-kind="day"][data-day-index="6"],
.mind-node[data-kind="day"][data-day-index="7"] {
  background:
    linear-gradient(135deg, rgba(255, 77, 141, 0.18), transparent 52%),
    rgba(8, 9, 21, 0.94);
}

.mind-node[data-kind="visual"] {
  width: 190px;
  padding: 8px;
}

.mind-node.is-selected {
  border-color: var(--cyan);
  background:
    linear-gradient(128deg, rgba(141, 226, 255, 0.2), transparent 45%),
    rgba(3, 11, 21, 0.94);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 38px rgba(141, 226, 255, 0.28),
    0 24px 54px rgba(0, 0, 0, 0.48),
    inset 0 0 26px rgba(141, 226, 255, 0.08);
}

.mind-node.is-selected::before {
  width: 100%;
  animation: nodeScan 2.4s ease-in-out infinite;
}

.mind-node.is-done {
  background:
    linear-gradient(135deg, rgba(46, 242, 178, 0.24), transparent 52%),
    rgba(3, 16, 23, 0.94);
}

.node-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: color-mix(in srgb, var(--node-color) 62%, #8da5b6);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.node-meta span:last-child::before {
  content: "// ";
  opacity: 0.45;
}

.node-title {
  position: relative;
  margin: 0;
  color: #fff;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.08;
  text-shadow: 0 0 17px color-mix(in srgb, var(--node-color) 28%, transparent);
  overflow-wrap: anywhere;
}

.mind-node[data-kind="root"] .node-title {
  font-size: 22px;
}

.mind-node[data-kind="week"] .node-title {
  font-size: 16px;
}

.node-body {
  margin: 0;
  color: rgba(230, 245, 252, 0.72);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.node-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 3px;
  border-top: 1px solid rgba(141, 226, 255, 0.08);
}

.node-chip {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.node-chip::before {
  content: "SIG ";
  color: var(--node-color);
}

.done-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #021017;
  background: var(--sage);
  box-shadow: 0 0 18px rgba(46, 242, 178, 0.7);
  font-size: 11px;
}

.node-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border: 1px solid rgba(141, 226, 255, 0.15);
  border-radius: 3px;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.1) hue-rotate(4deg);
}

.inspector {
  align-self: start;
  display: grid;
  gap: 15px;
  padding: 15px 14px 12px;
  color: var(--ink);
}

.inspector-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.16);
}

.inspector-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.inspector-head .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-head strong {
  overflow: hidden;
  color: #fff;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-shadow: 0 0 18px rgba(141, 226, 255, 0.42);
  white-space: nowrap;
}

.focus-id {
  align-self: start;
  padding: 4px 5px;
  border: 1px solid rgba(141, 226, 255, 0.18);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.brainwave {
  grid-column: 1 / -1;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  opacity: 0.76;
}

.brainwave::before,
.brainwave::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(141, 226, 255, 0.28));
}

.brainwave::after {
  background: linear-gradient(90deg, rgba(141, 226, 255, 0.28), transparent);
}

.brainwave i {
  width: 2px;
  height: 5px;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
  animation: waveBeat 1.2s ease-in-out infinite alternate;
}

.brainwave i:nth-child(2n) { animation-delay: -0.3s; }
.brainwave i:nth-child(3n) { animation-delay: -0.7s; }
.brainwave i:nth-child(4n) { animation-delay: -0.95s; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.swatches legend {
  width: 100%;
  margin-bottom: 2px;
}

.swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(141, 226, 255, 0.18);
}

.swatch::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(2, 8, 16, 0.42);
  border-radius: 50%;
}

.swatch.ink { background: #ecf8ff; }
.swatch.sage { background: var(--sage); }
.swatch.rust { background: var(--rust); }
.swatch.gold { background: var(--gold); }
.swatch.rose { background: var(--rose); }
.swatch.smoke { background: var(--smoke); }

.swatch.is-active {
  box-shadow:
    0 0 0 2px #020810,
    0 0 0 4px #fff,
    0 0 19px rgba(141, 226, 255, 0.5);
}

.decade-panel,
.day-panel,
.week-panel {
  display: grid;
  gap: 10px;
  padding: 13px 0 0;
  border-top: 1px solid rgba(141, 226, 255, 0.15);
}

.day-sequence {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day-sequence i {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(1, 6, 13, 0.62);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.day-sequence i:nth-last-child(-n + 2) {
  border-color: rgba(255, 77, 141, 0.25);
  color: #ff8ab5;
}

.day-action {
  border-color: rgba(255, 77, 141, 0.28);
  background:
    linear-gradient(105deg, rgba(255, 77, 141, 0.14), rgba(141, 226, 255, 0.06)),
    rgba(2, 8, 16, 0.84);
}

.decade-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: end;
  gap: 10px;
}

.compact-field input {
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.horizon-readout {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-left: 1px solid rgba(142, 125, 255, 0.5);
  color: #b9afff;
  background: linear-gradient(90deg, rgba(142, 125, 255, 0.12), transparent);
}

.horizon-readout b {
  color: #fff;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(142, 125, 255, 0.7);
}

.horizon-readout span {
  font-family: var(--mono);
  font-size: 6px;
  line-height: 1.3;
}

.decade-action {
  border-color: rgba(142, 125, 255, 0.32);
  background:
    linear-gradient(105deg, rgba(142, 125, 255, 0.2), rgba(141, 226, 255, 0.08)),
    rgba(2, 8, 16, 0.84);
}

.section-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.segment-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.segment-control label {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(1, 6, 13, 0.66);
  font-family: var(--mono);
  font-size: 11px;
}

.segment-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.segment-control label:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.36);
  color: #020810;
  background: linear-gradient(125deg, var(--gold), var(--sage) 58%, var(--cyan));
  box-shadow: 0 0 17px rgba(46, 242, 178, 0.24);
}

.wide-button {
  width: 100%;
  padding: 0 12px;
  font-size: 12px;
}

.node-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.node-actions button {
  padding: 0 10px;
  font-size: 12px;
}

.node-actions button:last-child {
  color: #ff9c88;
}

.node-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.tool-button:disabled,
.wide-button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.34;
  transform: none;
}

.inspector-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(141, 226, 255, 0.1);
  color: rgba(130, 161, 182, 0.6);
  font-family: var(--mono);
  font-size: 7px;
}

@keyframes fieldScan {
  from { transform: translateY(-100%); }
  to { transform: translateY(520%); }
}

@keyframes orbitSpin {
  to { transform: rotate(1turn); }
}

@keyframes livePulse {
  0%, 100% { opacity: 0.55; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes portPulse {
  0%, 100% { opacity: 0.55; transform: translateY(-50%) scale(0.78); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.18); }
}

@keyframes metricSweep {
  0%, 58% { transform: translateX(-100%); }
  82%, 100% { transform: translateX(100%); }
}

@keyframes reticleBreath {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.96); }
  50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes synapseFlow {
  to { stroke-dashoffset: -90; }
}

@keyframes temporalFlow {
  to { stroke-dashoffset: -140; }
}

@keyframes nodeScan {
  0%, 100% { opacity: 0.35; transform: scaleX(0.4); transform-origin: left; }
  50% { opacity: 1; transform: scaleX(1); transform-origin: left; }
}

@keyframes waveBeat {
  0% { height: 3px; background: var(--cyan); }
  100% { height: 16px; background: var(--sage); }
}

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
  }

  .brand {
    min-width: min(310px, 52vw);
  }

  .neural-metrics {
    flex: 1;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(141, 226, 255, 0.1);
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 10px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .inspector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspector-head,
  .decade-panel,
  .day-panel,
  .week-panel,
  .node-actions,
  .inspector-foot {
    grid-column: 1 / -1;
  }

  .swatches {
    align-content: start;
  }
}

@media (max-width: 720px) {
  .app-shell {
    gap: 8px;
    padding: 8px;
  }

  .topbar {
    gap: 13px;
    padding: 12px;
  }

  .brand {
    min-width: 0;
    width: 100%;
  }

  .brand-orbit {
    width: 50px;
    height: 50px;
  }

  .brand h1 {
    font-size: 25px;
  }

  .neural-metrics {
    width: 100%;
    margin: 0;
    border-left: 0;
    border-top: 1px solid rgba(141, 226, 255, 0.16);
  }

  .neural-metrics > span {
    min-width: 0;
    padding: 9px 8px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
  }

  .tool-button {
    grid-column: span 2;
    justify-content: center;
    padding: 0 7px;
  }

  .icon-button {
    width: 100%;
  }

  .brief-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .title-field {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: 0;
  }

  .canvas-frame,
  .canvas-scroller {
    min-height: 560px;
  }

  .reticle {
    width: 330px;
  }

  .hud-side {
    display: none;
  }

  .inspector {
    grid-template-columns: 1fr;
  }

  .inspector-head,
  .decade-panel,
  .day-panel,
  .week-panel,
  .node-actions,
  .inspector-foot {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .toolbar {
    grid-template-columns: repeat(4, 1fr);
  }

  .tool-button {
    grid-column: span 2;
  }

  .neural-metrics b {
    font-size: 17px;
  }

  .neural-metrics small {
    font-size: 7px;
  }

  .canvas-frame,
  .canvas-scroller {
    min-height: 520px;
  }
}

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