/* guide.css — guide engine styles (copied from research/v4/guide-engine/guide.css, themed for v4).
   Theme with the variables below; the hard-coded light surfaces were replaced with variables.
   All layers are position:fixed inside .gd-root and only the coach card,
   pill, notes and (in lock mode) the blockers take pointer events. */

:root {
  /* v4 theme: dark coach card (as in the entry-option mocks) over the sage NEST shell. */
  --guide-font: var(--sans, "Libre Franklin", system-ui, sans-serif);
  --guide-accent: #E0313F;              /* Umbrella red, lifted for contrast on the dark card */
  --guide-accent-ink: #ffffff;
  --guide-accent-soft: rgba(224, 49, 63, 0.18);
  --guide-bg: #1B1A19;                  /* dark coach card */
  --guide-ink: #F4F1EC;
  --guide-muted: #B9B2A9;
  --guide-line: #3A3632;
  --guide-ok: #8FB4E8;                  /* positive = blue, never green */
  --guide-dim: rgba(20, 18, 17, 0.30);
  --guide-scrim: rgba(20, 18, 17, 0.42);
  --guide-radius: 14px;
  --guide-spot-radius: 12px;
  --guide-shadow: 0 18px 50px rgba(20, 18, 17, 0.30), 0 2px 6px rgba(20, 18, 17, 0.16);
  --guide-coach-width: 340px;
  --guide-z: 2147483000;
  --guide-pulse-ms: 1600ms;
  --guide-ease: cubic-bezier(.2, .7, .2, 1);
  --guide-raise: #2A2826;               /* hover / raised surfaces inside the card */
}

.gd-root { position: fixed; inset: 0 auto auto 0; width: 0; height: 0; z-index: var(--guide-z); font-family: var(--guide-font); color: var(--guide-ink); }
.gd-root [hidden] { display: none !important; }
.gd-root *, .gd-root *::before, .gd-root *::after { box-sizing: border-box; }

/* ---------- dim + spotlight (never blocks clicks) ---------- */
.gd-scrim { position: fixed; inset: 0; width: 100vw; height: 100vh; background: var(--guide-scrim); pointer-events: none; animation: gd-fade .25s ease both; }
.gd-spot {
  position: fixed; left: 0; top: 0; pointer-events: none;
  border-radius: var(--guide-spot-radius);
  outline: 2px solid var(--guide-accent); outline-offset: 0;
  transition: transform .28s var(--guide-ease), width .28s var(--guide-ease), height .28s var(--guide-ease);
}
.gd-spot--dim { box-shadow: 0 0 0 200vmax var(--guide-dim); }
.gd-block { position: fixed; left: 0; top: 0; pointer-events: auto; background: transparent; cursor: not-allowed; }

/* ---------- beacon / hotspot ---------- */
.gd-beacon { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.gd-beacon__dot, .gd-beacon__ring { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; }
.gd-beacon__dot { background: var(--guide-accent); box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0,0,0,.25); }
.gd-beacon__ring { border: 2px solid var(--guide-accent); animation: gd-pulse var(--guide-pulse-ms) ease-out infinite; }
.gd-beacon__ring--2 { animation-delay: calc(var(--guide-pulse-ms) / 2); }
.gd-beacon--loud .gd-beacon__ring { animation-duration: 700ms; }
.gd-beacon--edge .gd-beacon__dot { width: 26px; height: 26px; left: -13px; top: -13px; }
.gd-beacon--edge .gd-beacon__dot::after { content: "↓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 14px/1 var(--guide-font); }
.gd-beacon--edge[data-dir="up"] .gd-beacon__dot::after { content: "↑"; }
.gd-beacon--edge[data-dir="left"] .gd-beacon__dot::after { content: "←"; }
.gd-beacon--edge[data-dir="right"] .gd-beacon__dot::after { content: "→"; }
@keyframes gd-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }

/* ---------- ghost cursor ---------- */
.gd-cursor { position: fixed; left: -4px; top: -3px; pointer-events: none; transition: transform .62s var(--guide-ease), opacity .2s; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.gd-cursor--instant { transition: none; }
.gd-cursor__tap { position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -10px 0 0 -10px; border-radius: 50%; border: 2px solid var(--guide-accent); opacity: 0; }
.gd-cursor--tap .gd-cursor__tap { animation: gd-tap .5s ease-out; }
.gd-cursor--tap svg { animation: gd-press .25s ease-out; }
@keyframes gd-tap { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes gd-press { 50% { transform: scale(.86); } }

/* ---------- coach card ---------- */
.gd-coach {
  position: fixed; left: 0; top: 0; width: min(var(--guide-coach-width), calc(100vw - 24px));
  background: var(--guide-bg); color: var(--guide-ink); border: 1px solid var(--guide-line);
  border-radius: var(--guide-radius); box-shadow: var(--guide-shadow);
  pointer-events: auto; font-size: 14px; line-height: 1.45; outline: none;
  transition: left .25s var(--guide-ease), top .25s var(--guide-ease);
  animation: gd-pop .22s var(--guide-ease) both;
}
.gd-coach[data-side="dock"] { transition: none; }
.gd-coach--center, .gd-coach--complete { width: min(440px, calc(100vw - 24px)); }
.gd-coach--drift, .gd-coach--lost { border-color: var(--guide-accent); }
.gd-coach:focus-visible { box-shadow: var(--guide-shadow), 0 0 0 3px var(--guide-accent-soft); }
.gd-coach__head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 0 14px; }
.gd-head__spacer { flex: 1; }
.gd-coach__body { padding: 8px 16px 4px; }
.gd-coach--complete .gd-coach__body { padding-top: 20px; }
.gd-coach__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px 12px 16px; }
.gd-coach__foot { flex-wrap: wrap; }
.gd-coach__foot:has(.gd-btn:nth-of-type(3)) .gd-kbd { display: none; }
.gd-kbd { white-space: nowrap; margin-right: auto; color: var(--guide-muted); font-size: 11px; letter-spacing: .04em; }
.gd-eyebrow { margin: 0 0 2px; font-family: var(--mono, ui-monospace, monospace); color: #F08A8F; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.gd-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; line-height: 1.3; }
.gd-text { margin: 0 0 8px; color: var(--guide-ink); }
.gd-text code, .gd-notes code { font: 12px/1.2 ui-monospace, Menlo, monospace; background: var(--guide-raise); padding: 1px 4px; border-radius: 4px; }
.gd-busy { display: flex; align-items: center; gap: 8px; color: var(--guide-muted); }
.gd-ok { margin: 4px 0 6px; color: var(--guide-ok); font-weight: 600; }
.gd-nudge { margin: 6px 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--guide-accent-soft); color: var(--guide-ink); font-size: 13px; }
.gd-typebox { margin: 4px 0 8px; }
.gd-label { display: block; font-size: 11px; color: var(--guide-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.gd-chip { display: block; width: 100%; text-align: left; font: italic 13px/1.4 var(--guide-font); color: var(--guide-ink); background: transparent; border: 1px dashed var(--guide-accent); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.gd-chip:hover { background: var(--guide-accent-soft); }

/* arrow */
.gd-arrow { position: absolute; width: 12px; height: 12px; background: var(--guide-bg); border: 1px solid var(--guide-line); transform: rotate(45deg); display: none; }
.gd-coach[data-side="bottom"] .gd-arrow { display: block; top: -7px; margin-left: -6px; border-right: 0; border-bottom: 0; }
.gd-coach[data-side="top"] .gd-arrow { display: block; bottom: -7px; top: auto !important; margin-left: -6px; border-left: 0; border-top: 0; }
.gd-coach[data-side="right"] .gd-arrow { display: block; left: -7px !important; margin-top: -6px; border-right: 0; border-top: 0; }
.gd-coach[data-side="left"] .gd-arrow { display: block; right: -7px; left: auto !important; margin-top: -6px; border-left: 0; border-bottom: 0; }

/* step counter + progress */
.gd-step { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 2px 4px; border-radius: 6px; cursor: pointer; font: 600 12px/1 var(--guide-font); color: var(--guide-muted); }
.gd-step:hover, .gd-step[aria-expanded="true"] { background: var(--guide-raise); color: var(--guide-ink); }
.gd-progress { display: inline-block; width: 64px; height: 4px; border-radius: 2px; background: var(--guide-line); overflow: hidden; }
.gd-progress__fill { display: block; height: 100%; background: var(--guide-accent); }

/* buttons */
.gd-btn { white-space: nowrap; font: 600 13px/1 var(--guide-font); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--guide-line); background: transparent; color: var(--guide-ink); cursor: pointer; }
.gd-btn:hover { border-color: var(--guide-muted); }
.gd-btn--primary { background: var(--guide-accent); border-color: var(--guide-accent); color: var(--guide-accent-ink); }
.gd-btn--primary:hover { filter: brightness(1.06); border-color: var(--guide-accent); }
.gd-btn--ghost { background: transparent; border-color: transparent; color: var(--guide-muted); }
.gd-btn--sm { padding: 6px 10px; font-size: 12px; }
.gd-btn:focus-visible, .gd-icon:focus-visible, .gd-step:focus-visible, .gd-chip:focus-visible, .gd-link:focus-visible, .gd-menu__item:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 2px; }
.gd-icon { border: 0; background: transparent; color: var(--guide-muted); font: 600 12px/1 var(--guide-font); padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.gd-icon:hover, .gd-icon[aria-pressed="true"] { background: var(--guide-raise); color: var(--guide-ink); }
.gd-icon--x { font-size: 18px; line-height: 14px; }
.gd-link { border: 0; background: none; padding: 0; color: var(--guide-accent); font: 600 13px/1.3 var(--guide-font); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* step menu */
.gd-menu { list-style: none; margin: 8px 10px 0; padding: 6px; border: 1px solid var(--guide-line); border-radius: 10px; background: var(--guide-bg); max-height: 260px; overflow: auto; }
.gd-menu__item { display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: 13px/1.3 var(--guide-font); color: var(--guide-ink); cursor: pointer; }
.gd-menu__item:hover { background: var(--guide-raise); }
.gd-menu__item.is-current { background: var(--guide-accent-soft); font-weight: 700; }
.gd-menu__item.is-done .gd-menu__n { background: var(--guide-ink); color: var(--guide-bg); }
.gd-menu__n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--guide-line); font-size: 11px; font-weight: 700; }
.gd-menu__sep { border-top: 1px solid var(--guide-line); margin-top: 4px; padding-top: 4px; }

/* spinner */
.gd-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--guide-line); border-top-color: var(--guide-accent); animation: gd-spin .8s linear infinite; flex: none; }
@keyframes gd-spin { to { transform: rotate(360deg); } }

/* paused pill */
.gd-pill { position: fixed; right: 16px; bottom: 16px; left: auto; top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--guide-bg); border: 1px solid var(--guide-line); border-radius: 999px; box-shadow: var(--guide-shadow); pointer-events: auto; font-size: 13px; animation: gd-pop .2s var(--guide-ease) both; }
.gd-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--guide-accent); }

/* presenter notes */
.gd-notes { position: fixed; left: 16px; bottom: 16px; top: auto; width: min(360px, calc(100vw - 32px)); max-height: 40vh; overflow: auto; padding: 10px 14px 12px; background: #1f1a17; color: #f6efe6; border-radius: var(--guide-radius); box-shadow: var(--guide-shadow); pointer-events: auto; font-size: 13px; line-height: 1.5; }
.gd-notes__head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #c9bfb3; margin-bottom: 4px; }
.gd-notes .gd-icon { color: #c9bfb3; }
.gd-notes p { margin: 0; }

.gd-live { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* feedback */
.gd-shake { animation: gd-shake .4s ease; }
@keyframes gd-shake { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
@keyframes gd-pop { from { opacity: 0; scale: .97; } to { opacity: 1; scale: 1; } }
@keyframes gd-fade { from { opacity: 0; } to { opacity: 1; } }

/* narrow screens: coach becomes a sheet */
@media (max-width: 639px) {
  .gd-coach { width: calc(100vw - 24px); }
  .gd-coach .gd-arrow { display: none !important; }
  .gd-kbd { display: none; }
}

/* reduced motion: no pulse, no glide, no shake */
@media (prefers-reduced-motion: reduce) {
  .gd-beacon__ring, .gd-scrim, .gd-coach, .gd-pill, .gd-shake, .gd-cursor--tap .gd-cursor__tap, .gd-cursor--tap svg { animation: none !important; }
  .gd-beacon__ring { opacity: .55; transform: scale(1.8); }
  .gd-beacon__ring--2 { display: none; }
  .gd-spot, .gd-coach, .gd-cursor { transition: none !important; }
  .gd-spinner { animation-duration: 2.4s; }
}

/* v4: mono step counter like the mocks; keep pill/notes above the NEST footer and any bottom inset (console) */
.gd-step { font-family: var(--mono, ui-monospace, monospace); letter-spacing: .06em; }
.gd-btn--primary { box-shadow: 0 6px 18px rgba(224, 49, 63, .28); }
.gd-pill { bottom: calc(44px + var(--app-inset-bottom, 0px)); }
.gd-notes { bottom: calc(44px + var(--app-inset-bottom, 0px)); }
