/* ─── SOLAR SYSTEM — Onboarding (Phase 1) overlay styles ──────────────────────
 *
 * Scoped under .ob-* so nothing here touches production UI. All of this DOM is
 * created/destroyed by onboarding.js; when neither art-direction mode nor the
 * scaffold is running, none of these elements exist.
 */

:root {
  --ob-ink: #f4f7ff;
  --ob-ink-dim: rgba(244, 247, 255, 0.62);
  --ob-accent: #03ff74;
  --ob-panel-bg: rgba(14, 16, 22, 0.82);
  --ob-border: rgba(255, 255, 255, 0.14);
  --ob-dissolve-ms: 320ms; /* deliberate-but-not-slow; brief target 300–500ms */
}

/* Marks a real app panel currently parked in the onboarding stack. Position is
 * driven inline by onboarding.js (fixed left/top); this just adds affordance. */
.ob-stack-panel {
  transition: box-shadow 160ms ease, opacity var(--ob-dissolve-ms) ease;
}
.ob-stack-panel.ob-draggable {
  cursor: grab;
}
.ob-stack-panel.ob-dragging {
  cursor: grabbing;
}

/* While onboarding owns the screen, neutralize hit-testing inside each parked
 * panel so the whole surface becomes a drag/click target on its wrapper.
 * Cross-document iframe events never bubble to us, so without this the iframe
 * regions would swallow the drag. Position-only work needs no panel interaction. */
body.ob-active .ob-stack-panel iframe,
body.ob-active .ob-stack-panel canvas {
  pointer-events: none;
}

/* Fade used when a panel is dismissed during the scaffold (does NOT remove the
 * element — onboarding.js hides/closes it on transitionend). */
.ob-dissolving {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ─── Live x/y coordinate readout (art-direction mode) ─────────────────────── */
.ob-coord {
  position: fixed;
  z-index: 100020;
  font: 700 11px/1.2 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.04em;
  color: #04140b;
  background: var(--ob-accent);
  padding: 3px 7px;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ─── Stack-order side panel (art-direction mode) ──────────────────────────── */
.ob-sidepanel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100015;
  width: 212px;
  padding: 14px;
  background: var(--ob-panel-bg);
  backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--ob-border);
  border-radius: 12px;
  color: var(--ob-ink);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.ob-sidepanel-title {
  font: 700 10px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ob-ink-dim);
  margin-bottom: 4px;
}
.ob-sidepanel-sub {
  font: 500 10px/1.3 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ob-ink-dim);
  margin-bottom: 12px;
}
.ob-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: ob-order;
}
.ob-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ob-border);
  border-radius: 7px;
  font: 700 12px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.06em;
  cursor: grab;
}
.ob-list-item::before {
  counter-increment: ob-order;
  content: counter(ob-order);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ob-ink-dim);
  font-size: 10px;
}
.ob-list-item.ob-drag-over {
  border-color: var(--ob-accent);
  box-shadow: inset 0 0 0 1px var(--ob-accent);
}
.ob-list-item.ob-dragging-item {
  opacity: 0.4;
}

/* Grouped composer (Solar Panels / Dock Tools) */
.ob-group { margin-bottom: 10px; }
.ob-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 5px;
  font: 700 10px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ob-ink-dim);
}
.ob-group-acts { display: flex; gap: 6px; }
.ob-group-acts button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ob-border);
  color: var(--ob-ink-dim);
  border-radius: 5px;
  font: 600 9px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 6px;
  cursor: pointer;
}
.ob-group-acts button:hover { color: var(--ob-ink); border-color: var(--ob-accent); }
.ob-eye {
  background: none;
  border: none;
  color: var(--ob-ink-dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.ob-item-name { flex: 1; }
.ob-list-item.ob-shown {
  border-color: rgba(3, 255, 116, 0.55);
}
.ob-list-item.ob-shown .ob-eye { color: var(--ob-accent); }
.ob-export-btn {
  width: 100%;
  padding: 10px;
  background: var(--ob-accent);
  color: #04140b;
  border: none;
  border-radius: 8px;
  font: 700 11px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.ob-export-btn:hover {
  filter: brightness(1.08);
}
.ob-hint {
  margin-top: 10px;
  font: 500 10px/1.4 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ob-ink-dim);
}

/* ─── Copy blocks — frosted glass (borrowed from the NOVA panel material) ────
 * Shared look for the scaffold tooltip and the art-direction preview pills:
 * translucent, blurred, theme-aware. Subtle — they read as part of the scene,
 * not solid cards. */
.ob-tooltip,
.ob-copy-pill {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;            /* one solid line — title | description · arrow */
  background: rgba(242, 240, 239, 0.82);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;           /* pill / capsule */
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #1a1a1a;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
/* White frosted glass in every mode (including eclipse) — these blocks stay
 * light against the dark scene rather than going dark-on-dark. */

/* MAGIC PATCH copy block — black with light text (it appears over the light,
 * eclipse-off scene, so it reads as a solid dark capsule instead of blending). */
.ob-tooltip.ob-dark,
.ob-copy-pill.ob-dark {
  background: rgba(8, 8, 8, 0.92);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #f3f0ea;
}
.ob-tooltip.ob-dark .ob-tooltip-body,
.ob-copy-pill.ob-dark .ob-copy-pill-body { color: rgba(255, 255, 255, 0.62); }

/* Scaffold tooltip (the walkthrough) */
.ob-tooltip {
  z-index: 100018;
  padding: 9px 11px 9px 16px; /* tighter right pad — snug to the arrow */
  opacity: 1;
  cursor: pointer;              /* whole tooltip advances on click */
  transition: opacity var(--ob-dissolve-ms) ease;
}
.ob-tooltip-title {
  font: 300 22px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: inherit;
}
.ob-tooltip-body {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 300 11px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.005em;
  color: rgba(0, 0, 0, 0.55);
}

/* ECLIPSE "click to toggle" prompt — same size/height as the other blocks,
 * just no arrow (the eclipse dock button is the action). Symmetric padding
 * since there's no arrow to hug. */
.ob-tooltip.ob-tooltip--small {
  padding: 9px 16px;
}
.ob-tooltip.ob-tooltip--small .ob-arrow { display: none; }

/* Art-direction copy preview — a long horizontal strip, not a card. */
.ob-copy-pill {
  z-index: 100010;
  padding: 7px 11px 7px 15px; /* tighter right pad — snug to the arrow */
  pointer-events: auto;       /* whole block is a NEXT button */
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.ob-copy-pill-title {
  font: 300 16px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: inherit;
}
.ob-copy-pill-body {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 300 10px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.005em;
  color: rgba(0, 0, 0, 0.55);
}

/* ECLIPSE copy preview ("ECLIPSE | Click to toggle") — same size/height as the
 * other pills, just no arrow. Symmetric padding since there's no arrow to hug. */
.ob-copy-pill.ob-copy-pill--small { padding: 7px 15px; }
.ob-copy-pill.ob-copy-pill--small .ob-arrow { display: none; }

/* Attention glow — fires when a copy block becomes the active beat, so the eye
 * follows the hand-off after dismissing the previous one. A soft white glow
 * (reads on the dark eclipse scene) whose intensity ramps smoothly up and back
 * down — no scale, no flicker. Settles once it's done; not a persistent loop. */
@keyframes ob-attention {
  0%   { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
  50%  { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.75)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
}
.ob-attention { animation: ob-attention 0.9s ease-in-out 1; }
@media (prefers-reduced-motion: reduce) { .ob-attention { animation: none; } }

/* Vertical divider between the title and the description ( | ) */
.ob-sep {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  margin: 4px 0;
  background: currentColor;
  opacity: 0.22;
}

/* Advance affordance — a subtle arrow at the end of the description, contained
 * inside the pill (inherits the body's dim ink). The whole block is the click
 * target now (NEXT); the arrow is just the visual cue. */
.ob-arrow {
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  opacity: 0.85;
  cursor: pointer;
}
.ob-arrow svg { display: block; }
.ob-copy-pill:hover .ob-arrow,
.ob-tooltip:hover .ob-arrow { opacity: 1; } /* brighten the cue on block hover */
.ob-no-arrow .ob-arrow { display: none; } /* KEYBOARD + MAGIC PATCH carry no arrow */

/* Orange vertical line on the left of a dock-anchored copy block (ECLIPSE /
 * MAGIC PATCH), pointing down at the centre of its button. The block is
 * left-justified to its ~50px button, so x ≈ 25px hits the button centre. */
.ob-pointer {
  position: absolute;
  left: 24px;
  top: calc(100% + 2px);  /* starts just BELOW the pill — never overlaps it */
  width: 2px;
  height: 22px;           /* down toward the button */
  background: #555;       /* neutral gray (MAGIC PATCH shows after eclipse-off → light scene) */
  border-radius: 2px;     /* round caps */
  pointer-events: none;
}
/* ECLIPSE shows while eclipse is still on (dark scene), so its line is white. */
.ob-tooltip--small .ob-pointer,
.ob-copy-pill--small .ob-pointer { background: #fff; }

/* Composer copy/coords toggle */
.ob-toggle-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 10px;
  font: 600 10px/1 'Helvetica Neue', Helvetica, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ob-ink-dim);
  cursor: pointer;
}
.ob-toggle-row input { accent-color: var(--ob-accent); cursor: pointer; }
