/* ============================================================================
   Onboarding's panel half (panel-tour.js, D68): a black layer over the panel
   where every answer, click and use of the tour happens. Black in either
   theme, with the dark theme's tokens restated (as panel-intro.css does for
   the welcome in space), so it is one picture with the tab beside it.
   ============================================================================ */

.px-tour {
  position: fixed; inset: 0; z-index: calc(var(--z-modal, 10000) + 1);
  display: flex; flex-direction: column;
  background: #000;
  color-scheme: dark;
  --ink:  #000000;
  --bone: #EAEEF0;
  --rim:  #9EB6C4;
  --rim-rgb:  158,182,196;
  --bone-rgb: 234,238,240;
  --warm-rgb:   220,228,232;
  --ink-rgb:    0,0,0;
  --panel-rgb:  16,20,22;
  --panel-hi-rgb: 24,30,33;
  --lit-rgb:    255,255,255;
  --litrim-rgb: 200,225,235;
  --s-card:  rgba(var(--warm-rgb),.05);
  --s-inter: rgba(var(--warm-rgb),.10);
  --s-quiet: rgba(var(--warm-rgb),.04);
  --lit-card: inset 0 0 0 1px rgba(var(--lit-rgb),calc(.16 * var(--edge-k)));
  --lit-pill: inset 0 0 0 1px rgba(var(--lit-rgb),calc(.20 * var(--edge-k)));
  --t-primary:   var(--bone);
  --t-strong:    rgba(var(--bone-rgb),.84);
  --t-body:      rgba(var(--bone-rgb),.74);
  --t-secondary: rgba(var(--bone-rgb),.64);
  --t-meta:      rgba(var(--bone-rgb),.57);
  --t-faint:     rgba(var(--bone-rgb),.52);
  color: var(--t-body);
}


/* The scene behind: the panel's own intro, already in flight (panel-tour.js). */
.px-tour-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

.px-tour-body {
  position: relative; z-index: 1;
  flex: 1; padding: 18px 18px 28px; gap: 12px;
  display: flex; flex-direction: column; justify-content: center;
}

.px-tour .wel-primary { margin-top: 6px; }
.px-tour .wel-primary.px-btn { color: var(--t-primary); }
.px-tour .wel-quiet {
  align-self: center; margin-top: 6px; background: none; border: none; padding: 4px; cursor: pointer;
  font: 400 var(--fs-base)/1 var(--sans); color: rgba(234, 238, 240, .62);
  text-decoration: underline; text-underline-offset: 3px;
}
.px-tour .wel-quiet:hover { color: #fff; }

.px-tour .wel-input {
  width: 100%; box-sizing: border-box; height: var(--ctl-h-lg); margin: 0;
  border: none; border-radius: var(--r-ctl); padding: 0 14px;
  font: 400 var(--fs-body)/1.4 var(--sans); color: var(--bone);
  background: rgba(var(--warm-rgb),.10); box-shadow: var(--lit-card); outline: none;
}
.px-tour .wel-input::placeholder { color: var(--t-faint); }
.px-tour .wel-input:focus { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb),.34); }
.px-tour .px-tour-area { height: auto; min-height: 96px; padding: 10px 14px; line-height: 1.5; resize: none; }

.px-tour-form { display: flex; flex-direction: column; gap: 10px; }
.px-tour-form[hidden] { display: none; }
.px-tour-actions { display: flex; flex-direction: column; align-items: stretch; }
.px-tour-note { margin: 0; text-align: center; font: 400 var(--fs-lg)/1.5 var(--sans); color: var(--t-secondary); }
.px-tour-err { margin: 0; font-size: var(--fs-base); color: rgb(232,96,92); }
.px-tour-err[hidden] { display: none; }

.px-tour-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.px-tour-chip[aria-pressed="true"] { color: var(--bone); outline: 1px solid rgba(var(--rim-rgb),.85); outline-offset: -1px; }

.px-tour .chat-bubble { max-width: 100%; margin: 0; }

.px-tour-think { display: flex; align-items: center; gap: 8px; height: 28px; color: var(--t-meta); font-size: var(--fs-base); }
.px-tour-think canvas { width: 24px; height: 24px; }


:where(.px-tour) :is(button, a, input, textarea):focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

@media (prefers-reduced-motion: no-preference) {
  :where(.px-tour-body > *) { animation: px-tour-in var(--dur-4, 320ms) ease-out both; }
}
@keyframes px-tour-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Onboarding running (tour-boot.js): black from the first frame, and nothing of
   the panel's own shows until the layer lifts. Visibility, not display, so the
   home still lays out and its mark can be measured for the finale. */
html.px-touring, html.px-touring body { background: #000 !important; }
html.px-touring body > :not(#pxTour) { visibility: hidden !important; }
/* The finale: the layer fades as the mark comes in. */
.px-tour.px-tour-lifting { opacity: 0; transition: opacity 900ms ease; pointer-events: none; }
