/* ==========================================================================
   anything.fexgo.net — Occult Observatory & Liminal Archive (v2)
   ========================================================================== */

:root {
  --bg: #050507;
  --bg-elevated: rgba(10, 10, 14, 0.9);
  --ink: #e8e4dc;
  --ink-muted: rgba(232, 228, 220, 0.56);
  --ink-faint: rgba(232, 228, 220, 0.24);
  --line: rgba(232, 228, 220, 0.12);
  --line-subtle: rgba(232, 228, 220, 0.06);
  --accent: hsl(38, 44%, 68%);
  --accent-soft: hsla(38, 44%, 68%, 0.28);
  --accent-glow: hsla(38, 44%, 56%, 0.18);
  --bg-tint: hsla(38, 28%, 14%, 0.26);

  --mx: 50vw;
  --my: 45vh;

  --font-serif: 'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Rare INVERTED Anomaly: Bone-on-Parchment Negative Plate */
body.anomaly-inverted {
  --bg: #e8e2d5;
  --bg-elevated: rgba(232, 226, 213, 0.94);
  --ink: #141318;
  --ink-muted: rgba(20, 19, 24, 0.62);
  --ink-faint: rgba(20, 19, 24, 0.34);
  --line: rgba(20, 19, 24, 0.16);
  --line-subtle: rgba(20, 19, 24, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.9s ease, color 0.9s ease;
}

body {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image:
    radial-gradient(circle at 50% 44%, var(--bg-tint) 0%, transparent 62%);
}

/* Ambient Canvas */
#dust-canvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* Hidden Architectural Drafting Grid revealed by Cursor Torchlight */
.drafting-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.42;
  background-image:
    linear-gradient(to right, var(--line-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle 340px at var(--mx) var(--my), rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.14) 55%, transparent 100%);
  mask-image: radial-gradient(circle 340px at var(--mx) var(--my), rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.14) 55%, transparent 100%);
}

/* Cursor Optical Torchlight */
.torchlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle 380px at var(--mx) var(--my), var(--accent-glow) 0%, transparent 72%);
  opacity: 0.55;
}

body.anomaly-inverted .torchlight {
  opacity: 0.22;
}

/* Analog Film Grain */
.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 3;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Vignette */
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  background: radial-gradient(circle at 50% 50%, transparent 48%, rgba(2, 2, 4, 0.78) 100%);
  transition: opacity 0.8s ease;
}

body.anomaly-inverted .vignette {
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(60, 52, 40, 0.18) 100%);
}

/* Corner Observatory Registration Marks */
.reg-mark {
  pointer-events: none;
  position: fixed;
  width: 14px;
  height: 14px;
  z-index: 5;
  opacity: 0.35;
}
.reg-tl { top: 10px; left: 10px; border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.reg-tr { top: 10px; right: 10px; border-top: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.reg-bl { bottom: 10px; left: 10px; border-bottom: 1px solid var(--ink); border-left: 1px solid var(--ink); }
.reg-br { bottom: 10px; right: 10px; border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.top-bar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.85rem;
  border-bottom: 1px solid var(--line-subtle);
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--ink-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.brand-mark:hover { color: var(--ink); }

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.top-sep {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.stratum-badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.anomaly-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  padding: 0.14rem 0.45rem;
}

/* Interactive Coordinate Bar */
.coord-form {
  flex: 1;
  max-width: 470px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.18rem 0.15rem;
  transition: border-color 0.3s ease;
}

.coord-form:focus-within {
  border-color: var(--accent);
}

.coord-prefix {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
  user-select: none;
  white-space: nowrap;
}

.coord-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.2rem;
  caret-color: var(--accent);
}

.coord-input::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.coord-icon-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 0.9rem;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease;
}

.coord-icon-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.coord-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 0.08rem 0.34rem;
  margin-left: 0.2rem;
  user-select: none;
}

.telemetry-top {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sig-label { color: var(--ink-faint); }

.schematic-pill {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.32rem 0.62rem;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.schematic-pill:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.schematic-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ==========================================================================
   THREE-ZONE OBSERVATORY STAGE
   ========================================================================== */

.chamber-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(320px, 1fr) minmax(210px, 260px);
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem 1.85rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.chamber-stage.manifested {
  opacity: 1;
  transform: translateY(0);
}

/* Side Margin Panels */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--ink);
}

.panel-left {
  border-left: 1px solid var(--line);
  padding-left: 1rem;
  text-align: left;
}

.panel-right {
  border-right: 1px solid var(--line);
  padding-right: 1rem;
  align-items: flex-end;
  text-align: right;
}

.panel-kicker {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

.survey-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.survey-row {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.survey-row dt {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.survey-row dd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
}

.observation-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line-subtle);
}

.observation-text {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.48;
  color: var(--ink-muted);
}

/* Hover-to-reveal Redaction Bars */
.redacted {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  padding: 0 0.3rem;
  background: var(--ink);
  color: transparent;
  border-radius: 1px;
  cursor: help;
  transition: background 0.35s ease, color 0.35s ease;
  user-select: none;
}

.redacted:hover,
.redacted.revealed {
  background: var(--accent-soft);
  color: var(--ink);
}

/* Center Chamber */
.center-chamber {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chamber-epithet {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.88;
  margin-bottom: 0.35rem;
}

/* Interactive 3D-Tilt Sigil Container */
.sigil-stage {
  position: relative;
  width: min(68vw, 46dvh, 400px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin: 0.15rem auto 0.85rem;
  perspective: 900px;
}

.sigil-stage::before {
  content: '';
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 72%);
  filter: blur(22px);
  pointer-events: none;
}

.sigil-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.layer-orbit-slow {
  transform-origin: 280px 280px;
  animation: slowOrbit 160s linear infinite;
}

.layer-petals {
  transform-origin: 280px 280px;
  animation: slowOrbitReverse 220s linear infinite;
}

/* Schematic Blueprint Layer */
.layer-schematic {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

body.schematic-mode .layer-schematic {
  opacity: 1;
}

/* Interactive Vertex Nodes & Core */
.vertex-hit,
.core-hit {
  cursor: pointer;
}

.vertex-chord {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sigil-vertex-node.resonating .vertex-chord {
  opacity: 0.65;
}

.sigil-vertex-node.resonating circle,
.sigil-vertex-node.resonating path {
  filter: drop-shadow(0 0 6px var(--accent));
}

.interactive-core {
  transition: transform 0.25s ease;
  transform-origin: 280px 280px;
}

.interactive-core:hover {
  transform: scale(1.04);
}

@keyframes slowOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes slowOrbitReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

/* Clickable 5-7-5 Haiku */
.haiku-box {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-height: 4.8rem;
}

.haiku-line {
  font-family: var(--font-serif);
  font-size: clamp(1.18rem, 2.15vw, 1.52rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.025em;
  line-height: 1.42;
  color: var(--ink);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.chamber-stage.manifested .haiku-line {
  opacity: 0.94;
  transform: translateY(0);
}

.haiku-word {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0 0.05em;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.haiku-word:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}

/* Right Margin: Interactive Constellation Map */
.constellation-stage {
  width: 216px;
  height: 216px;
}

.constellation-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.constellation-node {
  cursor: pointer;
}

.constellation-node .node-halo {
  transition: stroke-opacity 0.25s ease;
}

.constellation-node.hovered .node-halo {
  stroke-opacity: 0.75;
}

.constellation-node.hovered .constellation-label {
  fill: var(--accent);
  fill-opacity: 1;
}

.constellation-pulse {
  transform-origin: 108px 108px;
  animation: radarPulse 3.6s ease-in-out infinite;
}

@keyframes radarPulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50%      { transform: scale(1.45); opacity: 0.12; }
}

.constellation-readout {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.micro-hint {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  line-height: 1.5;
  max-width: 210px;
}

/* ==========================================================================
   BOTTOM INSTRUMENT BAR
   ========================================================================== */

.bottom-bar {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.9rem 1.85rem 1.05rem;
  border-top: 1px solid var(--line-subtle);
}

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.void-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.44rem 0.78rem;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.void-btn:hover:not(:disabled) {
  border-color: var(--ink-muted);
  color: var(--ink);
  background: rgba(232, 228, 220, 0.04);
}

.void-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.void-btn.accent-btn {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.void-btn.accent-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.void-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.void-btn .badge {
  font-size: 0.62rem;
  color: var(--accent);
}

.void-btn:focus:not(:focus-visible),
.schematic-pill:focus:not(:focus-visible),
.haiku-word:focus:not(:focus-visible) {
  outline: none;
}

.void-btn:focus-visible,
.schematic-pill:focus-visible,
.haiku-word:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.telemetry-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.telemetry-sep { opacity: 0.45; }

/* ==========================================================================
   CONJURE RITUAL MODAL (ASTROLABE DIAL + INK SUMMONING PAD)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 3, 6, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(680px, 95vw);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 1.1rem;
}

.modal-tabs {
  display: flex;
  gap: 0.25rem;
}

.modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.95rem 0.85rem;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
}

.modal-close:hover { color: var(--ink); }

.modal-panel {
  display: none;
  padding: 1.5rem;
}

.modal-panel.active {
  display: block;
}

.dial-layout,
.ink-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: center;
}

.ink-layout {
  grid-template-columns: 1fr 220px;
}

.dial-preview-col,
.ink-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.mini-sigil-preview {
  width: 196px;
  height: 196px;
  border: 1px solid var(--line-subtle);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
}

.mini-sigil-preview svg {
  width: 92%;
  height: 92%;
}

.conjure-path {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-align: center;
  word-break: break-all;
}

.dial-rings-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dial-ring-row {
  display: grid;
  grid-template-columns: 58px 32px 1fr 32px;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
}

.ring-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.ring-btn {
  background: transparent;
  border: 1px solid var(--line-subtle);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  height: 28px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ring-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ring-window {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: center;
  text-align: center;
  font-family: var(--font-mono);
  user-select: none;
}

.ring-prev,
.ring-next {
  font-size: 0.62rem;
  color: var(--ink-faint);
}

.ring-curr {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.dial-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

/* Ink Pad */
.ink-pad-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ink-canvas {
  width: 100%;
  height: 250px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  cursor: crosshair;
  touch-action: none;
}

.ink-pad-caption {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-align: center;
}

/* ==========================================================================
   PERSONAL ATLAS & FUSION DRAWER
   ========================================================================== */

.journal-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(370px, 92vw);
  z-index: 50;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.journal-drawer.open { transform: translateX(0); }

.journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.journal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.journal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fuse-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.fuse-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.fuse-banner {
  padding: 0.65rem 1.35rem;
  background: var(--accent-glow);
  border-bottom: 1px solid var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.journal-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.journal-close:hover { color: var(--ink); }

.journal-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

.journal-row {
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.journal-row:hover { background: rgba(232, 228, 220, 0.04); }
.journal-row.active { border-left-color: var(--accent); }
.journal-row.fuse-selected { background: var(--accent-glow); border-left-color: var(--accent); }

.journal-item {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0.72rem 0.6rem 0.72rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.journal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.journal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.journal-path {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-epithet {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.pin-btn {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.pin-btn:hover,
.pin-btn.pinned {
  color: var(--accent);
}

/* ==========================================================================
   TOAST
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 70;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.05rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1020px) {
  .chamber-stage {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: 1rem 1.25rem 1.5rem;
  }

  .panel-left,
  .panel-right {
    border: none;
    border-top: 1px solid var(--line-subtle);
    padding: 1rem 0 0;
    align-items: center;
    text-align: center;
  }

  .survey-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.4rem;
  }

  .observation-text {
    max-width: 480px;
  }
}

@media (max-width: 760px) {
  .top-bar {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }

  .stratum-badge,
  .top-sep,
  .telemetry-top,
  .coord-hint {
    display: none;
  }

  .coord-form {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .dial-layout,
  .ink-layout {
    grid-template-columns: 1fr;
  }

  .bottom-bar {
    padding: 0.85rem 1rem 1rem;
    justify-content: center;
  }

  .controls {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer-orbit-slow,
  .layer-petals,
  .constellation-pulse {
    animation: none;
  }
}
