/* ============================================================================
 * JR&CO Guide — shared onboarding / training styles
 * ----------------------------------------------------------------------------
 * Canonical source: design-system/jrco-guide.css
 * Sibling copies (deployed web roots — keep identical to this file):
 *   - gl-dashboard/jrco-guide.css
 *   - 13-Week-Forecast/dashboard/jrco-guide.css
 *
 * Consumes jrco-pitch-tokens.css custom properties (with safe fallbacks).
 * Brand invariants honored: squared corners, dark chrome bands with the
 * 3px red-gradient underline, red gradient (never flat red) on primary
 * controls, no blue chrome.
 * ==========================================================================*/

/* ── launcher ─────────────────────────────────────────────────────────── */

.jrco-guide-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-pill, 999px); /* pill/dot exception */
  border: 1px solid var(--charcoal-soft, #151515);
  background: var(--band-dark, linear-gradient(150deg, #242424 0%, #151515 50%, #0b0b0b 100%));
  color: var(--on-dark, #fff);
  cursor: pointer;
  z-index: 230;
  box-shadow: var(--shadow-2, 0 4px 12px rgba(20, 20, 20, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast, 120ms) var(--ease-standard, ease);
}
.jrco-guide-launcher:hover { transform: scale(1.06); }
.jrco-guide-launcher-q {
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}
.jrco-guide-launcher::after {
  /* red stripe motif chip on the badge */
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--red-gradient, linear-gradient(180deg, #e92a2c, #a71f23));
}
@keyframes jrco-guide-pulse-kf {
  0%   { box-shadow: 0 0 0 0 rgba(233, 42, 44, 0.45); }
  70%  { box-shadow: 0 0 0 14px rgba(233, 42, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(233, 42, 44, 0); }
}
.jrco-guide-pulse { animation: jrco-guide-pulse-kf 2s infinite; }

/* ── scrims / shields ─────────────────────────────────────────────────── */

.jrco-guide-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim, rgba(8, 8, 8, 0.62));
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.jrco-guide-shield {
  position: fixed;
  inset: 0;
  z-index: 236;
  background: transparent;
}
.jrco-guide-shield-dim { background: var(--scrim, rgba(8, 8, 8, 0.62)); }

/* spotlight ring — the giant box-shadow dims everything around the target */
.jrco-guide-spotlight {
  position: fixed;
  z-index: 237;
  pointer-events: none;
  border: 2px solid var(--red, #e92a2c);
  border-radius: var(--radius-1, 2px);
  box-shadow: 0 0 0 200vmax var(--scrim, rgba(8, 8, 8, 0.62));
  transition: all var(--dur-base, 200ms) var(--ease-standard, ease);
}

/* ── dark chrome band (modal + help header) ───────────────────────────── */

.jrco-guide-band {
  position: relative;
  background: var(--band-dark, linear-gradient(150deg, #242424 0%, #151515 50%, #0b0b0b 100%));
  color: var(--on-dark, #fff);
  padding: 16px 20px 14px;
  border-bottom: 3px solid transparent;
  border-image: var(--red-gradient-h, linear-gradient(90deg, #e92a2c, #a71f23)) 1;
}
.jrco-guide-band-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted, #9a9a9a);
}
.jrco-guide-band-title {
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  margin-top: 2px;
}
.jrco-guide-x {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: 0;
  color: var(--on-dark, #fff);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.jrco-guide-x:hover { color: var(--red, #e92a2c); }

/* ── welcome modal ────────────────────────────────────────────────────── */

.jrco-guide-modal {
  width: min(560px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  color: var(--charcoal, #202020);
  border-radius: var(--radius-1, 2px);
  box-shadow: var(--shadow-modal, 0 30px 80px rgba(0, 0, 0, 0.6));
  overflow: hidden;
  font-family: var(--font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
}
.jrco-guide-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}
.jrco-guide-welcome-intro {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--steel, #404040);
}
.jrco-guide-welcome-intro p { margin: 0 0 10px; }
.jrco-guide-welcome-intro strong { color: var(--charcoal, #202020); }
.jrco-guide-welcome-tours-label,
.jrco-guide-help-section-label {
  margin: 16px 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mid, #6b6b6b);
}
.jrco-guide-tour-list { display: flex; flex-direction: column; gap: 6px; }
.jrco-guide-tour-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface-alt, #f4f4f4);
  border: 1px solid var(--border, #e6e6e6);
  border-radius: var(--radius-1, 2px);
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
}
.jrco-guide-tour-item:hover { border-color: var(--red, #e92a2c); background: var(--red-bg-soft, rgba(233, 42, 44, 0.06)); }
.jrco-guide-tour-item-idx {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--red-gradient, linear-gradient(180deg, #e92a2c, #a71f23));
  color: var(--on-red, #fff);
  font-size: 0.72rem;
  font-weight: 800;
}
.jrco-guide-tour-item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jrco-guide-tour-item-title { font-weight: 700; font-size: 0.86rem; color: var(--charcoal, #202020); }
.jrco-guide-tour-item-desc { font-size: 0.78rem; color: var(--mid, #6b6b6b); line-height: 1.4; }
.jrco-guide-tour-item-go { font-size: 1.2rem; color: var(--muted, #9a9a9a); }
.jrco-guide-done-check { color: var(--green-ink, #1f7a44); font-size: 0.72rem; font-weight: 700; }

.jrco-guide-modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e6e6e6);
  background: var(--surface-alt-2, #fafafa);
}

/* ── buttons ──────────────────────────────────────────────────────────── */

.jrco-guide-btn-primary {
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  color: var(--on-red, #fff);
  background: var(--red-gradient, linear-gradient(180deg, #e92a2c, #a71f23));
  border: 0;
  border-radius: var(--radius-1, 2px);
  padding: 9px 18px;
  cursor: pointer;
}
.jrco-guide-btn-primary:hover { filter: brightness(1.08); }
.jrco-guide-btn-ghost,
.jrco-guide-btn-outline {
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--steel, #404040);
  background: transparent;
  border: 1px solid var(--border-strong, #d4d4d4);
  border-radius: var(--radius-1, 2px);
  padding: 8px 14px;
  cursor: pointer;
}
.jrco-guide-btn-ghost:hover,
.jrco-guide-btn-outline:hover { border-color: var(--charcoal, #202020); color: var(--charcoal, #202020); }
.jrco-guide-btn-ghost:disabled { opacity: 0.4; cursor: default; }

/* ── tour step card ───────────────────────────────────────────────────── */

.jrco-guide-card {
  position: fixed;
  z-index: 245;
  background: var(--surface, #fff);
  color: var(--charcoal, #202020);
  border-radius: var(--radius-1, 2px);
  border-top: 3px solid transparent;
  border-image: var(--red-gradient-h, linear-gradient(90deg, #e92a2c, #a71f23)) 1;
  box-shadow: var(--shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.22));
  padding: 12px 16px 14px;
  font-family: var(--font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
  transition: top var(--dur-base, 200ms) var(--ease-standard, ease),
              left var(--dur-base, 200ms) var(--ease-standard, ease);
}
.jrco-guide-card-centered {
  transform: translate(-50%, -50%);
  width: min(440px, 92vw) !important;
}
.jrco-guide-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.jrco-guide-card-count {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mid, #6b6b6b);
}
.jrco-guide-x-dark {
  position: static;
  color: var(--mid, #6b6b6b);
  font-size: 1.2rem;
  padding: 0 2px;
}
.jrco-guide-x-dark:hover { color: var(--red, #e92a2c); }
.jrco-guide-card-title {
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.jrco-guide-card-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--steel, #404040);
}
.jrco-guide-card-body p { margin: 0 0 8px; }
.jrco-guide-card-body p:last-child { margin-bottom: 0; }
.jrco-guide-card-body strong { color: var(--charcoal, #202020); }
.jrco-guide-card-body em { color: var(--charcoal, #202020); }
.jrco-guide-progress {
  height: 3px;
  background: var(--border, #e6e6e6);
  margin: 12px 0 10px;
  overflow: hidden;
}
.jrco-guide-progress span {
  display: block;
  height: 100%;
  background: var(--red-gradient-h, linear-gradient(90deg, #e92a2c, #a71f23));
  transition: width var(--dur-base, 200ms) var(--ease-standard, ease);
}
.jrco-guide-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ── help panel ───────────────────────────────────────────────────────── */

.jrco-guide-help-scrim {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
}
.jrco-guide-help {
  width: min(420px, 94vw);
  height: 100%;
  background: var(--surface, #fff);
  color: var(--charcoal, #202020);
  box-shadow: var(--shadow-modal, 0 30px 80px rgba(0, 0, 0, 0.6));
  display: flex;
  flex-direction: column;
  font-family: var(--font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
  animation: jrco-guide-slide-in var(--dur-base, 200ms) var(--ease-out, ease) both;
}
@keyframes jrco-guide-slide-in {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.jrco-guide-help-body {
  padding: 14px 18px 24px;
  overflow-y: auto;
}
.jrco-guide-help-tour {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft, #f0f0f0);
}
.jrco-guide-help-tour-text { flex: 1 1 auto; min-width: 0; }
.jrco-guide-help-tour-title { font-weight: 700; font-size: 0.86rem; }
.jrco-guide-help-tour-desc { font-size: 0.78rem; color: var(--mid, #6b6b6b); line-height: 1.4; margin-top: 1px; }
.jrco-guide-help-empty { font-size: 0.85rem; color: var(--mid, #6b6b6b); padding: 10px 0; }

.jrco-guide-topic {
  border: 1px solid var(--border, #e6e6e6);
  border-radius: var(--radius-1, 2px);
  margin-bottom: 6px;
  background: var(--surface-alt-2, #fafafa);
}
.jrco-guide-topic summary {
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  list-style: none;
}
.jrco-guide-topic summary::-webkit-details-marker { display: none; }
.jrco-guide-topic summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  color: var(--red, #e92a2c);
  font-weight: 800;
}
.jrco-guide-topic[open] summary::before { content: "\2212"; }
.jrco-guide-topic-body {
  padding: 0 12px 12px 28px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--steel, #404040);
}
.jrco-guide-topic-body p { margin: 0 0 8px; }
.jrco-guide-topic-body ul { margin: 0 0 8px; padding-left: 18px; }
.jrco-guide-topic-body li { margin-bottom: 4px; }
.jrco-guide-topic-body strong { color: var(--charcoal, #202020); }

.jrco-guide-help-replay-welcome {
  margin-top: 18px;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--mid, #6b6b6b);
  text-decoration: underline;
  cursor: pointer;
}
.jrco-guide-help-replay-welcome:hover { color: var(--red, #e92a2c); }

/* ── toast ────────────────────────────────────────────────────────────── */

.jrco-guide-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  opacity: 0;
  z-index: 250;
  background: var(--band-dark, linear-gradient(150deg, #242424 0%, #151515 50%, #0b0b0b 100%));
  color: var(--on-dark, #fff);
  border-bottom: 3px solid transparent;
  border-image: var(--red-gradient-h, linear-gradient(90deg, #e92a2c, #a71f23)) 1;
  padding: 11px 18px;
  font-family: var(--font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-size: 0.82rem;
  max-width: min(480px, 90vw);
  box-shadow: var(--shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.22));
  transition: opacity var(--dur-base, 200ms) var(--ease-standard, ease),
              transform var(--dur-base, 200ms) var(--ease-standard, ease);
}
.jrco-guide-toast-show { opacity: 1; transform: translate(-50%, 0); }

/* ── small screens ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .jrco-guide-launcher { right: 14px; bottom: 14px; }
  .jrco-guide-card { max-width: calc(100vw - 20px); }
}
