.command-deck {
  position: absolute;
  z-index: 9;
  top: 38px;
  left: 34px;
  right: 34px;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(150px, auto) auto minmax(320px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 5px 7px;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(141, 226, 255, 0.07), transparent 30%),
    rgba(2, 8, 16, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px) saturate(1.25);
}

.horizon-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.horizon-breadcrumb button,
.horizon-breadcrumb span {
  flex: 0 0 auto;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.horizon-breadcrumb button:last-child {
  max-width: 120px;
  overflow: hidden;
  color: var(--cyan);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.view-tabs button {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  border-bottom: 1px solid transparent;
  color: rgba(130, 161, 182, 0.72);
  background: transparent;
  font-family: var(--mono);
  font-size: 7px;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.view-tabs button:hover,
.view-tabs button[aria-selected="true"] {
  border-bottom-color: var(--sage);
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(46, 242, 178, 0.08));
  text-shadow: 0 0 10px rgba(46, 242, 178, 0.6);
}

.deck-tools {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.deck-icon,
.zoom-readout,
.deck-button,
.bulk-bar button,
.bulk-bar select,
.intent-actions button {
  min-height: 28px;
  border: 1px solid rgba(141, 226, 255, 0.15);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(1, 6, 13, 0.66);
  font-family: var(--mono);
  font-size: 9px;
}

.deck-icon {
  width: 29px;
  padding: 0;
  font-size: 13px;
}

.deck-icon:hover,
.zoom-readout:hover,
.deck-button:hover,
.bulk-bar button:hover,
.intent-actions button:hover {
  border-color: rgba(141, 226, 255, 0.54);
  box-shadow: 0 0 16px rgba(141, 226, 255, 0.12);
}

.deck-icon:disabled {
  cursor: not-allowed;
  opacity: 0.25;
}

.zoom-readout {
  width: 48px;
  padding: 0 4px;
  color: var(--cyan);
  font-size: 8px;
}

.deck-button {
  padding: 0 9px;
  color: #d7d2ff;
  border-color: rgba(142, 125, 255, 0.34);
}

.deck-button span {
  color: #fff;
  text-shadow: 0 0 10px #8e7dff;
}

.guide-trigger {
  white-space: nowrap;
  border-color: rgba(255, 200, 87, 0.34);
  color: var(--gold);
  box-shadow: inset 0 0 12px rgba(255, 200, 87, 0.05);
}

.guide-trigger span {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 200, 87, 0.75);
}

.guide-trigger:hover {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.2);
}

.spiral-trigger {
  min-width: 78px;
  white-space: nowrap;
  color: var(--violet, #a79aff);
  border-color: rgba(142, 125, 255, 0.34);
}

.spiral-trigger span {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(141, 226, 255, 0.72);
}

.spiral-trigger[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(167, 154, 255, 0.82);
  background: rgba(142, 125, 255, 0.17);
  box-shadow: 0 0 18px rgba(142, 125, 255, 0.34), inset 0 0 12px rgba(141, 226, 255, 0.08);
}

.spiral-panel {
  position: absolute;
  z-index: 26;
  top: 47px;
  right: 7px;
  width: min(292px, calc(100vw - 34px));
  padding: 11px;
  border: 1px solid rgba(142, 125, 255, 0.36);
  border-radius: 5px;
  background: rgba(2, 8, 17, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52), inset 0 0 24px rgba(142, 125, 255, 0.05);
  backdrop-filter: blur(18px);
}

.spiral-panel[hidden] {
  display: none;
}

.spiral-navigator {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.12);
}

.spiral-step {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.24);
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(141, 226, 255, 0.055);
  font-size: 15px;
}

.spiral-step:hover {
  border-color: rgba(141, 226, 255, 0.7);
  background: rgba(141, 226, 255, 0.12);
  box-shadow: 0 0 15px rgba(141, 226, 255, 0.14);
}

.spiral-step:disabled {
  cursor: not-allowed;
  opacity: 0.25;
}

.spiral-current {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0 30px;
  text-align: center;
}

.spiral-current span {
  color: var(--sage);
  font-family: var(--mono);
  font-size: 7px;
}

.spiral-current strong {
  overflow: hidden;
  color: #f1f6ff;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spiral-open {
  position: absolute;
  top: 50%;
  right: 0;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(255, 200, 87, 0.34);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.06);
  font-size: 13px;
  transform: translateY(-50%);
}

.spiral-open:hover {
  border-color: rgba(255, 200, 87, 0.72);
  box-shadow: 0 0 14px rgba(255, 200, 87, 0.16);
}

.spiral-open[hidden] {
  display: none;
}

.spiral-panel-head,
.spiral-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spiral-panel-head {
  color: #d8d2ff;
  font-family: var(--mono);
  font-size: 8px;
}

.spiral-panel-head output {
  color: var(--gold);
}

.spiral-panel > input[type="range"] {
  width: 100%;
  margin: 12px 0 10px;
  accent-color: #8e7dff;
}

.spiral-panel-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.spiral-panel-actions input {
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  appearance: none;
  border: 1px solid rgba(141, 226, 255, 0.28);
  border-radius: 9px;
  background: rgba(141, 226, 255, 0.08);
  cursor: pointer;
}

.spiral-panel-actions input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 7px rgba(141, 226, 255, 0.24);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.spiral-panel-actions input:checked {
  border-color: rgba(46, 242, 178, 0.52);
  background: rgba(46, 242, 178, 0.13);
}

.spiral-panel-actions input:checked::after {
  background: var(--sage);
  box-shadow: 0 0 10px rgba(46, 242, 178, 0.6);
  transform: translateX(14px);
}

.spiral-panel-actions button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(141, 226, 255, 0.18);
  border-radius: 3px;
  color: var(--cyan);
  background: rgba(141, 226, 255, 0.05);
  font-family: var(--mono);
  font-size: 7px;
}

body.spiral-paused .spiral-panel {
  border-color: rgba(46, 242, 178, 0.48);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52), 0 0 22px rgba(46, 242, 178, 0.08), inset 0 0 24px rgba(46, 242, 178, 0.04);
}

body.spiral-paused #spiralMotionLabel {
  color: var(--sage);
}

body.spiral-mode .canvas {
  perspective: var(--spiral-perspective, 1200px);
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

body.spiral-mode .canvas-frame {
  height: clamp(610px, calc(100vh - 220px), 900px);
  min-height: 610px;
  align-self: start;
}

body.spiral-mode .canvas-scroller {
  height: 100%;
  min-height: 0;
}

body.spiral-mode .node-layer {
  perspective: var(--spiral-perspective, 1200px);
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

body.spiral-mode .node-layer::before,
body.spiral-mode .node-layer::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  pointer-events: none;
}

body.spiral-mode .node-layer::before {
  width: 1px;
  height: min(72%, 720px);
  border-left: 1px dashed rgba(141, 226, 255, 0.2);
  box-shadow: 0 0 16px rgba(141, 226, 255, 0.16);
  transform: translate3d(-50%, -50%, var(--spiral-axis-z, -344px));
}

body.spiral-mode .node-layer::after {
  width: min(62%, 760px);
  height: min(34%, 320px);
  border: 1px solid rgba(142, 125, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 32px rgba(142, 125, 255, 0.08), inset 0 0 32px rgba(141, 226, 255, 0.035);
  transform: translate3d(-50%, -50%, var(--spiral-ring-z, -262px)) rotateX(72deg);
}

body.spiral-mode .link-layer {
  opacity: 0;
  transition: opacity 220ms ease;
}

body.spiral-mode .mind-node {
  left: 50% !important;
  top: 50% !important;
  z-index: 2;
  opacity: var(--spiral-opacity, 1);
  filter: brightness(var(--spiral-brightness, 1)) saturate(1.08);
  transform:
    translate3d(
      calc(-50% + var(--spiral-x, 0px)),
      calc(-50% + var(--spiral-y, 0px)),
      var(--spiral-z, 0px)
    )
    rotateY(var(--spiral-yaw, 0deg))
    rotateX(var(--spiral-pitch, 0deg))
    scale(var(--spiral-scale, 1)) !important;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  touch-action: manipulation;
  will-change: transform, opacity, filter;
  transition:
    transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 240ms ease,
    filter 240ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body.spiral-mode.spiral-auto .mind-node {
  transition:
    transform 110ms linear,
    opacity 220ms ease,
    filter 220ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body.spiral-mode.spiral-paused .mind-node {
  transition:
    transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 220ms ease,
    filter 220ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body.spiral-mode .mind-node.is-selected {
  filter: brightness(1.18) saturate(1.15);
  border-color: color-mix(in srgb, var(--node-color) 84%, white 12%);
  box-shadow:
    0 24px 58px rgba(0, 0, 0, 0.52),
    0 0 46px color-mix(in srgb, var(--node-color) 38%, transparent),
    0 0 0 1px color-mix(in srgb, var(--node-color) 24%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.spiral-mode .mind-node[data-spiral-muted="true"] {
  pointer-events: none;
}

body.spiral-mode .mind-node::after {
  box-shadow: 0 0 18px var(--node-color);
}

.search-shell {
  position: relative;
  min-width: 118px;
  max-width: 180px;
  flex: 1 1 140px;
}

.search-shell > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 8px;
  color: var(--cyan);
  transform: translateY(-50%);
}

.search-shell input {
  min-height: 28px;
  padding: 0 8px 0 25px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
}

.search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  width: 250px;
  padding: 5px;
  border: 1px solid rgba(141, 226, 255, 0.2);
  border-radius: 5px;
  background: rgba(2, 8, 16, 0.98);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.54);
}

.search-results button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid rgba(141, 226, 255, 0.08);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.search-results button:hover {
  background: rgba(141, 226, 255, 0.08);
}

.search-results span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results small,
.search-results p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.bulk-bar {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-radius: 5px;
  background: rgba(5, 10, 18, 0.95);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.bulk-bar strong {
  padding: 0 7px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
}

.bulk-bar button,
.bulk-bar select {
  padding: 0 8px;
  font-size: 8px;
}

.minimap {
  position: absolute;
  z-index: 7;
  right: 15px;
  bottom: 15px;
  width: 178px;
  height: 112px;
  padding: 7px;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 4px;
  background: rgba(1, 6, 13, 0.78);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  cursor: crosshair;
}

.minimap-head {
  height: 17px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 6px;
}

.minimap-head b {
  color: var(--sage);
  font-weight: 500;
}

.minimap-head b.is-alert {
  color: var(--rose);
  text-shadow: 0 0 8px var(--rose);
}

.minimap svg {
  width: 100%;
  height: calc(100% - 17px);
  display: block;
  border: 1px solid rgba(141, 226, 255, 0.07);
  background: rgba(0, 3, 8, 0.42);
}

.minimap rect {
  fill: rgba(141, 226, 255, 0.08);
  stroke: var(--cyan);
  stroke-width: 8px;
  vector-effect: non-scaling-stroke;
}

.utility-view {
  position: absolute;
  z-index: 6;
  inset: 92px 0 0;
  overflow: auto;
  padding: 24px clamp(18px, 3vw, 44px) 50px;
  background:
    linear-gradient(120deg, rgba(141, 226, 255, 0.035), transparent 40%),
    rgba(1, 5, 12, 0.84);
  backdrop-filter: blur(18px);
}

.utility-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.14);
}

.utility-head span,
.utility-head p,
.band-head,
.analytics-summary span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.utility-head h2 {
  margin: 5px 0 0;
  color: #fff;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 54px);
  line-height: 0.9;
  text-shadow: 0 0 28px rgba(141, 226, 255, 0.32);
}

.utility-head p {
  margin: 0;
  color: var(--cyan);
}

.utility-content {
  padding-top: 22px;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.utility-band {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(141, 226, 255, 0.18);
}

.band-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
}

.band-head b {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 500;
}

.task-stream,
.log-list,
.review-list,
.analytics-bars,
.warning-list {
  display: grid;
  gap: 7px;
}

.task-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(141, 226, 255, 0.12);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(141, 226, 255, 0.07), transparent 44%), rgba(2, 8, 16, 0.72);
}

.task-item.is-complete {
  border-left-color: var(--sage);
  opacity: 0.64;
}

.task-check,
.task-open {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.22);
  border-radius: 50%;
  color: var(--sage);
  background: rgba(1, 6, 13, 0.72);
}

.task-open {
  border: 0;
  border-radius: 4px;
  color: var(--cyan);
}

.task-item small,
.task-item p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.task-item strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 13px;
}

.log-form,
.review-form,
.evidence-form,
.assistant-form {
  display: grid;
  gap: 9px;
}

.log-controls,
.form-row,
.form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.log-controls label,
.assistant-form label {
  flex: 1;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.log-controls button,
.review-form button,
.evidence-form button,
.assistant-form button,
.form-actions button,
.data-actions button,
.backup-list button,
.evidence-item button,
.backcast-item button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(141, 226, 255, 0.2);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(2, 8, 16, 0.76);
  font-size: 10px;
}

.log-item,
.review-item,
.evidence-item {
  padding: 11px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.1);
  color: var(--ink);
}

.log-item span,
.log-item time,
.review-item header,
.evidence-item span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.log-item p,
.review-item p,
.evidence-item p {
  margin: 6px 0;
  line-height: 1.5;
}

.review-item header {
  display: flex;
  justify-content: space-between;
}

.review-item strong {
  color: var(--sage);
  font-size: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 4px;
  background: #020811;
  text-align: left;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  display: block;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.08);
  transition: transform 260ms ease, filter 260ms ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
  filter: saturate(1.05) contrast(1.08);
}

.gallery-item > span {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 3px;
  padding: 28px 12px 12px;
  color: #fff;
  background: linear-gradient(transparent, rgba(1, 5, 12, 0.94));
}

.gallery-item small {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.evidence-form {
  grid-template-columns: 1fr 150px auto;
}

.evidence-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.evidence-item {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 200, 87, 0.14);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.07), transparent), rgba(2, 8, 16, 0.7);
}

.evidence-item button {
  min-height: 28px;
  margin-top: auto;
  align-self: start;
  color: var(--gold);
  font-size: 8px;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 26px;
  border-top: 1px solid rgba(141, 226, 255, 0.16);
  border-bottom: 1px solid rgba(141, 226, 255, 0.16);
}

.analytics-summary > div {
  min-height: 90px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  border-right: 1px solid rgba(141, 226, 255, 0.12);
}

.analytics-summary strong {
  color: #fff;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
}

.analytics-row {
  display: grid;
  grid-template-columns: 95px 1fr 38px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}

.analytics-row i {
  height: 5px;
  overflow: hidden;
  background: rgba(141, 226, 255, 0.08);
}

.analytics-row b {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--sage));
  box-shadow: 0 0 10px var(--sage);
}

.analytics-row strong {
  color: var(--cyan);
  font-weight: 500;
}

.energy-chart {
  width: 100%;
  height: 190px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.12);
  background: repeating-linear-gradient(0deg, transparent 0 34px, rgba(141, 226, 255, 0.04) 35px);
}

.energy-chart polyline {
  fill: none;
  stroke: var(--sage);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px var(--sage));
}

.warning-list p {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 77, 141, 0.12);
  color: #ff9aba;
  font-size: 10px;
}

.backcast-line {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
}

.backcast-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 27px;
  width: 1px;
  background: linear-gradient(var(--rose), var(--gold), var(--sage), var(--cyan));
  box-shadow: 0 0 12px rgba(141, 226, 255, 0.34);
}

.backcast-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 36px;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(141, 226, 255, 0.1);
}

.backcast-item > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  z-index: 1;
  border: 1px solid rgba(141, 226, 255, 0.3);
  border-radius: 50%;
  color: var(--cyan);
  background: #020811;
  font-family: var(--mono);
  font-size: 9px;
}

.backcast-item small {
  color: var(--rose);
  font-family: var(--mono);
  font-size: 8px;
}

.backcast-item strong {
  display: block;
  margin: 4px 0;
  color: #fff;
  font-family: var(--display);
  font-size: 21px;
}

.backcast-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-signal {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.empty-signal i {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(141, 226, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(141, 226, 255, 0.14);
}

.intent-matrix {
  display: grid;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid rgba(141, 226, 255, 0.15);
}

.intent-matrix textarea {
  min-height: 58px;
}

.intent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.intent-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.intent-actions button {
  padding: 0 5px;
  font-size: 7px;
}

.inspector-toggle {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.18);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(1, 6, 13, 0.72);
}

.mind-node.is-multi-selected {
  outline: 2px dashed var(--gold);
  outline-offset: 4px;
  box-shadow: 0 0 34px rgba(255, 200, 87, 0.24);
}

.mind-node.is-collapsed::after {
  background: var(--gold);
  border-color: #fff;
  box-shadow: 0 0 14px var(--gold);
}

.node-hero {
  width: 100%;
  height: 56px;
  display: block;
  border: 1px solid rgba(141, 226, 255, 0.14);
  border-radius: 3px;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.08);
}

.year-node-progress {
  position: relative;
  height: 4px;
  margin-top: 2px;
  background: rgba(141, 226, 255, 0.08);
}

.year-node-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--sage));
  box-shadow: 0 0 9px rgba(46, 242, 178, 0.52);
}

.year-node-progress b {
  position: absolute;
  right: 0;
  bottom: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
}

.advanced-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 38px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.28);
  border-radius: 6px;
  color: var(--ink);
  background:
    linear-gradient(125deg, rgba(141, 226, 255, 0.1), transparent 35%),
    rgba(3, 10, 20, 0.98);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72);
}

.advanced-dialog::backdrop {
  background: rgba(0, 3, 8, 0.76);
  backdrop-filter: blur(9px);
}

.dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.14);
  background: rgba(3, 10, 20, 0.95);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8px;
}

.dialog-head button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(141, 226, 255, 0.16);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
}

#dialogContent {
  padding: 18px;
}

.assistant-form > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.guide-intro {
  padding: 4px 0 20px;
  border-bottom: 1px solid rgba(141, 226, 255, 0.14);
}

.guide-intro > span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 7px;
}

.guide-intro h2 {
  margin: 7px 0;
  color: #fff;
  font-family: var(--display);
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(141, 226, 255, 0.32);
}

.guide-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.guide-flow {
  position: relative;
  display: grid;
  gap: 0;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.guide-flow::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 1px;
  background: linear-gradient(var(--rose), var(--gold), var(--sage), var(--cyan));
  box-shadow: 0 0 10px rgba(141, 226, 255, 0.24);
}

.guide-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 11px 0;
}

.guide-flow li > b {
  width: 38px;
  height: 38px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 226, 255, 0.26);
  border-radius: 50%;
  color: var(--cyan);
  background: #020811;
  font-family: var(--mono);
  font-size: 8px;
}

.guide-flow small,
.guide-reference span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
}

.guide-flow strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 13px;
}

.guide-flow p,
.guide-reference p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.guide-reference {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(141, 226, 255, 0.14);
  border-left: 1px solid rgba(141, 226, 255, 0.1);
}

.guide-reference > div {
  min-height: 92px;
  padding: 12px;
  border-right: 1px solid rgba(141, 226, 255, 0.1);
  border-bottom: 1px solid rgba(141, 226, 255, 0.1);
}

.guide-reference p {
  margin-top: 7px;
}

.guide-reference b {
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 500;
}

.guide-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.guide-actions button {
  min-height: 40px;
  border: 1px solid rgba(141, 226, 255, 0.2);
  border-radius: 4px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(141, 226, 255, 0.1), transparent), rgba(2, 8, 16, 0.8);
  font-size: 10px;
}

.guide-actions button:last-child {
  border-color: rgba(142, 125, 255, 0.38);
  color: #d7d2ff;
}

.guide-actions .guide-tour-button {
  border-color: rgba(255, 200, 87, 0.46);
  color: #fff2c6;
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.16), transparent), rgba(2, 8, 16, 0.92);
  box-shadow: inset 0 0 18px rgba(255, 200, 87, 0.06);
}

.tutorial-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  overflow: hidden;
  background: transparent;
}

.tutorial-overlay[hidden] {
  display: none;
}

.tutorial-spotlight {
  position: fixed;
  z-index: 1;
  border: 1px solid rgba(255, 213, 114, 0.92);
  border-radius: 6px;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(0, 3, 8, 0.82),
    0 0 20px rgba(255, 200, 87, 0.62),
    inset 0 0 12px rgba(255, 200, 87, 0.12);
  pointer-events: none;
  transition: top 240ms ease, left 240ms ease, width 240ms ease, height 240ms ease;
}

.tutorial-spotlight::before,
.tutorial-spotlight::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: #fff0b8;
}

.tutorial-spotlight::before {
  top: -4px;
  left: -4px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.tutorial-spotlight::after {
  right: -4px;
  bottom: -4px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.tutorial-card {
  position: fixed;
  z-index: 2;
  right: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(430px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(141, 226, 255, 0.3);
  border-radius: 6px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(141, 226, 255, 0.07), transparent 38%),
    rgba(2, 8, 17, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.56), inset 0 0 32px rgba(141, 226, 255, 0.04);
  transform: translateX(50%);
}

.tutorial-card.is-top {
  top: max(24px, env(safe-area-inset-top));
  bottom: auto;
}

.tutorial-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0;
}

.tutorial-meta b {
  color: var(--gold);
  font-weight: 500;
}

.tutorial-card h2 {
  margin: 10px 0 7px;
  color: #fff;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.tutorial-card p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.tutorial-dots {
  display: flex;
  gap: 5px;
  margin: 15px 0;
}

.tutorial-dots i {
  width: 18px;
  height: 2px;
  background: rgba(141, 226, 255, 0.18);
}

.tutorial-dots i.is-active {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 200, 87, 0.6);
}

.tutorial-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 6px;
}

.tutorial-actions button {
  min-width: 66px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(141, 226, 255, 0.2);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(1, 6, 13, 0.78);
  font-family: var(--mono);
  font-size: 9px;
}

.tutorial-actions button:disabled {
  opacity: 0.3;
}

.tutorial-actions .tutorial-next {
  border-color: rgba(255, 200, 87, 0.52);
  color: #fff1be;
  background: rgba(255, 200, 87, 0.1);
}

body.tutorial-active {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-spotlight {
    transition: none;
  }

  body.spiral-mode .mind-node,
  body.spiral-mode .node-layer {
    transition: none;
  }
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.data-actions button {
  min-height: 46px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8px;
}

.backup-list {
  display: grid;
  gap: 5px;
  margin-top: 20px;
}

.backup-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  text-align: left;
}

.backup-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.signal-toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  padding: 10px 13px;
  border: 1px solid rgba(46, 242, 178, 0.28);
  border-radius: 4px;
  color: var(--sage);
  background: rgba(2, 10, 16, 0.95);
  box-shadow: 0 0 24px rgba(46, 242, 178, 0.16);
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.signal-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.focus-mode .topbar,
body.focus-mode .brief-panel,
body.focus-mode .inspector {
  display: none;
}

body.focus-mode .app-shell {
  display: block;
  padding: 0;
}

body.focus-mode .workspace,
body.focus-mode .canvas-frame {
  width: 100vw;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

body.focus-mode .workspace {
  display: block;
}

body.inspector-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr) 42px;
}

body.inspector-collapsed .inspector {
  min-height: 64px;
  padding: 0;
  overflow: hidden;
}

body.inspector-collapsed .inspector > :not(.inspector-toggle) {
  display: none;
}

body.inspector-collapsed .inspector-toggle {
  right: 8px;
  transform: rotate(180deg);
}

@media (max-width: 1280px) {
  .command-deck {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .horizon-breadcrumb {
    display: none;
  }

  .view-tabs {
    overflow-x: auto;
  }

  .deck-tools {
    justify-content: flex-start;
  }

  .utility-view {
    top: 132px;
  }
}

@media (max-width: 720px) {
  .command-deck {
    top: 38px;
    right: 10px;
    left: 10px;
    padding: 5px;
  }

  .view-tabs button {
    min-width: 62px;
  }

  .deck-tools {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .search-shell {
    min-width: 128px;
  }

  .deck-button {
    white-space: nowrap;
  }

  .minimap {
    width: 130px;
    height: 84px;
    right: 8px;
    bottom: 8px;
  }

  .utility-view {
    inset: 122px 0 0;
    padding: 18px 12px 40px;
  }

  .utility-grid,
  .analytics-grid,
  .today-grid,
  .review-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .utility-head {
    align-items: start;
    flex-direction: column;
  }

  .utility-head h2 {
    font-size: 34px;
  }

  .analytics-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .evidence-form {
    grid-template-columns: 1fr;
  }

  .guide-reference,
  .guide-actions {
    grid-template-columns: 1fr;
  }

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

  body.inspector-collapsed .inspector {
    display: none;
  }

  body.mobile-timeline .canvas-scroller {
    overflow-x: hidden;
  }

  body.mobile-timeline .canvas {
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    min-height: 600px;
    zoom: 1 !important;
  }

  body.mobile-timeline .node-layer {
    position: relative;
    width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 150px 12px 120px;
  }

  body.mobile-timeline .mind-node {
    position: relative;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-height: 106px;
    transform: none !important;
  }

  body.mobile-timeline .link-layer,
  body.mobile-timeline .reticle,
  body.mobile-timeline .minimap {
    display: none;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  #neuralScene,
  .scan-field,
  .ambient-noise,
  .topbar,
  .brief-panel,
  .inspector,
  .command-deck,
  .minimap,
  .depth-scale,
  .stage-hud {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .canvas-frame,
  .canvas-scroller {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .canvas {
    zoom: 0.65 !important;
  }

  .mind-node {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
