/* =====================================================================
   static/css/onboarding-tutorial.css
   Premium onboarding overlay — STRATUM CFO v3
   Refined backdrop, spotlight mask, tooltip card, smooth transitions
   No constant pulses — only micro entrance animations
   ===================================================================== */

/* ── Overlay backdrop ─────────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: auto;
}
.ob-overlay.ob-visible { opacity: 1; }
.ob-overlay--dim {
  background: rgba(8, 12, 20, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Spotlight mask (SVG-based cutout) ────────────────────── */
.ob-spotlight-mask {
  position: fixed;
  inset: 0;
  z-index: 9991;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.ob-spotlight-mask.ob-visible { opacity: 1; }
.ob-spotlight-mask svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Single entrance glow ring */
.ob-spotlight-ring {
  position: fixed;
  z-index: 9991;
  border-radius: 14px;
  pointer-events: none;
  opacity: 0;
  transition: top .4s cubic-bezier(.4,0,.2,1),
              left .4s cubic-bezier(.4,0,.2,1),
              width .4s cubic-bezier(.4,0,.2,1),
              height .4s cubic-bezier(.4,0,.2,1),
              opacity .35s ease;
  box-shadow:
    0 0 0 2px rgba(99,102,241,.30),
    0 0 20px 4px rgba(99,102,241,.10),
    0 4px 24px rgba(0,0,0,.15);
}
.ob-spotlight-ring.ob-visible {
  animation: ob-glow-once .7s ease-out forwards;
}
@keyframes ob-glow-once {
  0%   { opacity: 0; box-shadow: 0 0 0 2px rgba(99,102,241,.08), 0 0 8px 2px rgba(99,102,241,.04); }
  50%  { opacity: 1; box-shadow: 0 0 0 3px rgba(99,102,241,.35), 0 0 24px 5px rgba(99,102,241,.12), 0 4px 24px rgba(0,0,0,.15); }
  100% { opacity: 1; box-shadow: 0 0 0 2px rgba(99,102,241,.20), 0 0 14px 3px rgba(99,102,241,.06), 0 4px 24px rgba(0,0,0,.10); }
}

/* ── Tooltip / Panel card ─────────────────────────────────── */
.ob-panel {
  position: fixed;
  z-index: 9993;
  width: 460px;
  max-width: calc(100vw - 32px);
  background: var(--sp-bg-card, #151823);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  box-shadow:
    0 24px 80px rgba(0,0,0,.5),
    0 0 0 1px rgba(99,102,241,.06),
    0 0 40px rgba(99,102,241,.03);
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .2s ease, transform .28s cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
  overflow: hidden;
}
.ob-panel.ob-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.ob-panel--wide { width: 580px; }
.ob-panel--center {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) scale(.98);
}
.ob-panel--center.ob-visible {
  transform: translate(-50%, -50%) scale(1);
}

/* ── Panel header ─────────────────────────────────────────── */
.ob-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 8px;
}
.ob-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.ob-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--sp-text-primary, #f1f1f1);
  flex: 1;
  letter-spacing: -.02em;
}
.ob-close {
  background: none;
  border: none;
  color: var(--sp-text-muted, #666);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 8px;
  transition: all .2s;
}
.ob-close:hover {
  color: var(--sp-danger, #F87171);
  background: rgba(248,113,113,.08);
}

/* ── Panel body ───────────────────────────────────────────── */
.ob-body {
  padding: 4px 24px 18px;
}
.ob-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--sp-text-secondary, #99a3b5);
  margin: 0 0 4px;
}
.ob-text strong {
  color: var(--sp-text-primary, #f1f1f1);
  font-weight: 600;
}

/* Strategic detail block (educational) */
.ob-detail {
  font-size: 13px;
  line-height: 1.6;
  color: var(--sp-text-muted, #777);
  margin: 10px 0 6px;
  padding: 10px 14px;
  border-left: 2px solid rgba(99,102,241,.25);
  background: rgba(99,102,241,.03);
  border-radius: 0 10px 10px 0;
}
.ob-detail strong {
  color: var(--sp-text-secondary, #aab);
  font-weight: 600;
}

/* Impact callout */
.ob-impact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(16,185,129,.05);
  border: 1px solid rgba(16,185,129,.1);
  font-size: 12px;
  color: var(--sp-success, #10b981);
  line-height: 1.5;
}
.ob-impact-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }

/* ── Panel footer ─────────────────────────────────────────── */
.ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px 18px;
  border-top: 1px solid rgba(255,255,255,.04);
}

/* ── Step counter ─────────────────────────────────────────── */
.ob-step-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--sp-text-muted, #888);
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ── Progress dots ────────────────────────────────────────── */
.ob-progress {
  display: flex;
  gap: 5px;
  align-items: center;
}
.ob-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sp-text-muted, #444);
  opacity: .25;
  transition: all .3s ease;
}
.ob-dot--active {
  background: var(--sp-primary, #6366F1);
  opacity: 1; width: 20px; border-radius: 3px;
}
.ob-dot--done {
  background: var(--sp-success, #10b981);
  opacity: .6;
}

/* ── Buttons ──────────────────────────────────────────────── */
.ob-actions { display: flex; gap: 8px; align-items: center; }
.ob-btn {
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  padding: 9px 20px; cursor: pointer;
  transition: all .2s ease;
  font-family: inherit; letter-spacing: -.01em; white-space: nowrap;
}
.ob-btn:focus-visible { outline: 2px solid var(--sp-primary, #6366F1); outline-offset: 2px; }
.ob-btn-back { background: transparent; color: var(--sp-text-muted, #999); padding: 9px 14px; }
.ob-btn-back:hover { color: var(--sp-text-primary, #fff); background: rgba(255,255,255,.04); }
.ob-btn-skip { background: transparent; color: var(--sp-text-muted, #777); font-size: 12px; padding: 9px 14px; }
.ob-btn-skip:hover { color: var(--sp-text-primary, #fff); background: rgba(255,255,255,.04); }
.ob-btn-next { background: var(--sp-primary, #6366F1); color: #fff; }
.ob-btn-next:hover { background: #818cf8; box-shadow: 0 6px 18px rgba(99,102,241,.3); }
.ob-btn-next:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.ob-btn-secondary { background: rgba(255,255,255,.05); color: var(--sp-text-secondary, #aab); border: 1px solid rgba(255,255,255,.08); }
.ob-btn-secondary:hover { background: rgba(255,255,255,.08); color: var(--sp-text-primary, #f1f1f1); }

/* ── Form elements ────────────────────────────────────────── */
.ob-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.ob-form-grid--cols3 { grid-template-columns: 1fr 1fr 1fr; }
.ob-form-grid--cols1 { grid-template-columns: 1fr; }
.ob-field { display: flex; flex-direction: column; gap: 4px; }
.ob-field--full { grid-column: 1 / -1; }
.ob-label {
  font-size: 11px; font-weight: 600;
  color: var(--sp-text-muted, #888);
  text-transform: uppercase; letter-spacing: .04em;
}
.ob-select, .ob-input {
  width: 100%; padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: rgba(255,255,255,.03);
  color: var(--sp-text-primary, #f1f1f1);
  font-size: 14px; font-family: inherit;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.ob-select:focus, .ob-input:focus { border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.ob-select option { background: #1a1d2e; color: #f1f1f1; }
.ob-hint {
  font-size: 12px; color: var(--sp-text-muted, #666);
  margin: 10px 0 0; line-height: 1.5; font-style: italic;
}

/* ── Objective radio buttons ──────────────────────────────── */
.ob-radio-group { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ob-radio-label {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; cursor: pointer; font-size: 13px;
  color: var(--sp-text-secondary, #aab); transition: all .2s;
}
.ob-radio-label:hover { border-color: rgba(99,102,241,.3); background: rgba(99,102,241,.04); }
.ob-radio-label input[type="radio"] { accent-color: var(--sp-primary, #6366F1); margin: 0; }
.ob-radio-label input[type="radio"]:checked + span { color: var(--sp-text-primary, #f1f1f1); font-weight: 600; }

/* ── Configured badge ─────────────────────────────────────── */
.ob-configured {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.15);
  color: var(--sp-success, #10b981); font-size: 13px; font-weight: 600; margin-top: 8px;
}

/* ── Error ─────────────────────────────────────────────────── */
.ob-error {
  margin-top: 8px; padding: 8px 14px; border-radius: 10px;
  background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.15);
  color: #fca5a5; font-size: 13px; line-height: 1.5;
  animation: ob-shake .4s ease;
}
@keyframes ob-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-3px); }
  75%     { transform: translateX(3px); }
}

/* ── Spinners ─────────────────────────────────────────────── */
.ob-spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.2); border-top-color: #fff;
  border-radius: 50%; animation: ob-spin .6s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
@keyframes ob-spin { to { transform: rotate(360deg); } }

.ob-loader { text-align: center; padding: 32px 16px; }
.ob-loader-ring {
  width: 44px; height: 44px;
  border: 3px solid rgba(99,102,241,.12); border-top-color: var(--sp-primary, #6366F1);
  border-radius: 50%; animation: ob-spin .9s linear infinite; margin: 0 auto 16px;
}
.ob-loader-text { font-size: 15px; font-weight: 600; color: var(--sp-text-primary, #f1f1f1); margin: 0 0 4px; }
.ob-loader-sub { font-size: 13px; color: var(--sp-text-muted, #888); margin: 0; }

/* ── Step transitions ─────────────────────────────────────── */
.ob-panel--enter { animation: ob-slide-in .28s cubic-bezier(.4,0,.2,1) forwards; }
.ob-panel--exit  { animation: ob-slide-out .2s ease forwards; }
@keyframes ob-slide-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ob-slide-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-6px) scale(.98); }
}
.ob-panel--center.ob-panel--enter { animation: ob-center-in .28s cubic-bezier(.4,0,.2,1) forwards; }
.ob-panel--center.ob-panel--exit  { animation: ob-center-out .2s ease forwards; }
@keyframes ob-center-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes ob-center-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -48%) scale(.94); }
}

/* ── Body lock ────────────────────────────────────────────── */
body.ob-active { overflow: hidden; }

/* ── Floating panel (scrollable steps) ────────────────────── */
.ob-panel--floating {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 380px;
  max-width: calc(100vw - 48px);
  box-shadow:
    0 16px 48px rgba(0,0,0,.45),
    0 0 0 1px rgba(99,102,241,.12),
    0 0 24px rgba(99,102,241,.06);
  z-index: 9993;
  animation: ob-float-in .35s ease-out forwards;
}
.ob-panel--floating.ob-visible {
  opacity: 1;
  transform: none;
}
@keyframes ob-float-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Completion checklist (final step) ────────────────────── */
.ob-complete-checks { list-style: none; padding: 0; margin: 14px 0 0; }
.ob-complete-checks li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px;
  color: var(--sp-text-secondary, #aab);
  opacity: 0; animation: ob-check-in .35s ease forwards;
}
.ob-complete-checks li:nth-child(1) { animation-delay: .1s; }
.ob-complete-checks li:nth-child(2) { animation-delay: .2s; }
.ob-complete-checks li:nth-child(3) { animation-delay: .3s; }
.ob-complete-checks li:nth-child(4) { animation-delay: .4s; }
.ob-complete-checks li:nth-child(5) { animation-delay: .5s; }
.ob-complete-checks li:nth-child(6) { animation-delay: .6s; }
@keyframes ob-check-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ob-complete-checks li::before {
  content: '';
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--sp-success, #10b981); flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='12' height='12'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 12px;
  transform: scale(.8);
  animation: ob-check-pop .3s ease forwards;
  animation-delay: inherit;
}
@keyframes ob-check-pop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Final step — slightly brighter */
.ob-panel--final {
  background: var(--sp-bg-card, #171b28);
  border-color: rgba(99,102,241,.12);
}
.ob-final-actions {
  display: flex; gap: 10px; margin-top: 16px;
}
.ob-final-actions .ob-btn {
  flex: 1; text-align: center; justify-content: center; padding: 11px 18px;
}

/* ── Sidebar checklist ────────────────────────────────────── */
.ob-checklist {
  margin: 8px 12px; padding: 10px 14px;
  border: 1px solid rgba(99,102,241,.1); border-radius: 12px;
  background: rgba(99,102,241,.03); font-size: 12px;
}
.ob-checklist-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; color: var(--sp-text-muted, #888);
  font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; border: none; background: none; width: 100%; padding: 0;
}
.ob-checklist-toggle:hover { color: var(--sp-primary, #6366F1); }
.ob-checklist-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
.ob-checklist.ob-checklist--collapsed .ob-checklist-list { display: none; }
.ob-checklist.ob-checklist--collapsed .ob-checklist-toggle svg { transform: rotate(-90deg); }
.ob-checklist-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ob-checklist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; font-size: 12px;
  color: var(--sp-text-muted, #888); transition: color .2s;
}
.ob-checklist-item::before {
  content: ''; width: 12px; height: 12px;
  border: 1.5px solid rgba(255,255,255,.12); border-radius: 50%;
  flex-shrink: 0; transition: all .25s;
}
.ob-checklist--done { color: var(--sp-success, #10b981); }
.ob-checklist--done::before {
  background: var(--sp-success, #10b981); border-color: var(--sp-success, #10b981);
  box-shadow: inset 0 0 0 2px var(--sp-bg-card, #151823);
}
.ob-checklist--active { color: var(--sp-primary, #6366F1); font-weight: 600; }
.ob-checklist--active::before {
  border-color: var(--sp-primary, #6366F1);
  box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}

/* ── Sidebar replay button ────────────────────────────────── */
.tut-replay-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 7px 12px; margin-bottom: 4px;
  border: 1px dashed rgba(99,102,241,.18); border-radius: 8px;
  background: rgba(99,102,241,.03);
  color: var(--sp-text-muted, #888); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s ease;
  text-decoration: none; justify-content: center;
}
.tut-replay-btn:hover {
  background: rgba(99,102,241,.08); color: var(--sp-primary, #6366F1);
  border-color: rgba(99,102,241,.3);
}
.tut-replay-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Confirm skip dialog ─────────────────────────────────── */
.ob-confirm-overlay {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: ob-fade-in .2s ease;
}
@keyframes ob-fade-in { from { opacity: 0; } to { opacity: 1; } }
.ob-confirm-dialog {
  background: var(--sp-bg-card, #151823);
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
  padding: 28px; max-width: 360px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.ob-confirm-dialog h4 { margin: 0 0 8px; font-size: 17px; color: var(--sp-text-primary, #f1f1f1); }
.ob-confirm-dialog p { margin: 0 0 20px; font-size: 13px; color: var(--sp-text-muted, #999); line-height: 1.5; }
.ob-confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ── Light theme ──────────────────────────────────────────── */
html.light .ob-overlay--dim { background: rgba(240,242,248,.75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html.light .ob-panel { background: #fff; border-color: rgba(0,0,0,.06); box-shadow: 0 24px 80px rgba(0,0,0,.12), 0 0 0 1px rgba(99,102,241,.06); }
html.light .ob-panel--final { background: #fafbff; }
html.light .ob-title { color: #1a202c; }
html.light .ob-text { color: #4a5568; }
html.light .ob-text strong { color: #1a202c; }
html.light .ob-detail { background: rgba(99,102,241,.03); border-left-color: rgba(99,102,241,.2); color: #718096; }
html.light .ob-detail strong { color: #4a5568; }
html.light .ob-impact { background: rgba(16,185,129,.04); border-color: rgba(16,185,129,.1); }
html.light .ob-select, html.light .ob-input { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.1); color: #1a202c; }
html.light .ob-select option { background: #fff; color: #1a202c; }
html.light .ob-radio-label { border-color: rgba(0,0,0,.08); color: #4a5568; }
html.light .ob-checklist { background: rgba(99,102,241,.03); border-color: rgba(99,102,241,.08); }
html.light .ob-confirm-overlay { background: rgba(240,242,248,.6); }
html.light .ob-confirm-dialog { background: #fff; border-color: rgba(0,0,0,.08); }
html.light .ob-confirm-dialog h4 { color: #1a202c; }
html.light .ob-confirm-dialog p { color: #718096; }
html.light .ob-btn-secondary { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.08); color: #4a5568; }

/* =====================================================================
   ONBOARDING TIPS — first-session contextual callouts
   Server-guarded: only rendered when show_tips=True
   ===================================================================== */

.ob-tip {
  display: none;
  width: 280px;
  max-width: 100%;
  position: relative;
  margin: 12px 0 8px;
  background: #111827;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(16, 185, 129, 0.06);
}

/* Up-arrow connecting tip to the element above */
.ob-tip::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 18px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(16, 185, 129, 0.35);
}
.ob-tip::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 19px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #111827;
}

.ob-tip--visible {
  display: block;
  animation: ob-tip-in .2s ease;
}

@keyframes ob-tip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ob-tip-text {
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.55;
  margin: 0 0 12px;
}
.ob-tip-text strong { color: #10b981; }

.ob-tip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob-tip-dismiss {
  background: #10b981;
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.ob-tip-dismiss:hover { background: #059669; }

.ob-tip-skip {
  background: transparent;
  color: #6b7280;
  border: none;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: color .15s ease;
}
.ob-tip-skip:hover { color: #9ca3af; }

/* Light mode */
html.light .ob-tip { background: #fff; border-color: rgba(16,185,129,.25); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
html.light .ob-tip::after { border-bottom-color: #fff; }
html.light .ob-tip-text { color: #4a5568; }
html.light .ob-tip-skip { color: #9ca3af; }

@media (max-width: 640px) {
  .ob-tip { width: 100%; }
}

/* ── Mobile responsive ────────────────────────────────────── */
@media (max-width: 640px) {
  .ob-panel { width: calc(100vw - 24px); max-height: 80vh; overflow-y: auto; }
  .ob-panel--center { left: 12px !important; right: 12px; top: auto !important; bottom: 16px; transform: none !important; }
  .ob-panel--center.ob-visible { transform: none; }
  .ob-panel:not(.ob-panel--center) { left: 12px !important; right: 12px; }
  .ob-panel--floating { width: calc(100vw - 24px); bottom: 12px !important; right: 12px !important; left: 12px !important; }
  .ob-spotlight-ring { display: none !important; }
  .ob-form-grid { grid-template-columns: 1fr; }
  .ob-form-grid--cols3 { grid-template-columns: 1fr; }
  .ob-radio-group { gap: 4px; }
}

/* ============================================
   LIGHT MODE OVERRIDES — onboarding tutorial
   ============================================ */
html.light .ob-panel {
  background: var(--sp-bg-card);
  border: 1px solid var(--sp-border);
  box-shadow: var(--sp-shadow-lg);
}
html.light .ob-header {
  border-bottom: 1px solid var(--sp-border-light);
}
html.light .ob-footer {
  border-top: 1px solid var(--sp-border-light);
}
html.light .ob-select,
html.light .ob-input {
  background: var(--sp-bg-input);
  border: 1px solid var(--sp-border);
  color: var(--sp-text-primary);
}
html.light .ob-select:focus,
html.light .ob-input:focus {
  border-color: var(--sp-border-focus);
  background: var(--sp-bg-input-focus);
}
html.light .ob-select option {
  background: var(--sp-bg-card);
  color: var(--sp-text-primary);
}
html.light .ob-radio-label {
  border: 1px solid var(--sp-border);
  background: var(--sp-bg-input);
  color: var(--sp-text-primary);
}
html.light .ob-radio-label:hover {
  border-color: var(--sp-border-focus);
  background: var(--sp-bg-input-focus);
}
html.light .ob-radio-label.selected,
html.light .ob-radio-label:has(input:checked) {
  border-color: var(--sp-accent);
  background: var(--sp-accent-subtle);
}
html.light .ob-btn-back,
html.light .ob-btn-skip {
  color: var(--sp-text-muted);
  background: transparent;
  border: 1px solid var(--sp-border);
}
html.light .ob-btn-back:hover,
html.light .ob-btn-skip:hover {
  background: var(--sp-bg-input);
  color: var(--sp-text-secondary);
}
html.light .ob-step-indicator span {
  background: var(--sp-border);
}
html.light .ob-step-indicator span.active {
  background: var(--sp-accent);
}
html.light .ob-title,
html.light .ob-subtitle,
html.light .ob-label {
  color: var(--sp-text-primary);
}
html.light .ob-description,
html.light .ob-hint {
  color: var(--sp-text-muted);
}
  .ob-footer { flex-direction: column; gap: 10px; }
  .ob-actions { width: 100%; justify-content: flex-end; }
  .ob-final-actions { flex-direction: column; }
}

/* ── PULSE→RUNWAY→VERDICT sequence (welcome modal) ─────────── */
.ob-sequence {
  display: flex; flex-direction: column; gap: 4px;
  margin: 14px 0 0;
}
.ob-seq-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05);
}
.ob-seq-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.ob-seq-desc {
  font-size: 12px; color: var(--sp-text-muted, #888); margin-top: 2px; line-height: 1.4;
}
.ob-seq-arrow {
  text-align: center; color: var(--sp-text-muted, #555); font-size: 14px;
  line-height: 1; padding: 0 0 0 12px;
}

/* ── PULSE CTA button (modal final) ────────────────────────── */
.ob-btn-pulse {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-weight: 700;
  text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 10px; padding: 10px 18px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(245,158,11,.3);
}
.ob-btn-pulse:hover {
  box-shadow: 0 6px 20px rgba(245,158,11,.4);
}

/* ── Hover-transform fix ────────────────────────────────────────────────────
   Root cause: dashboard-premium.css POLISH v6 and v7 both define:
     *:not(.dropdown-menu):not(.dropdown-item):not([class*="collapse"]):hover
       { transform: none !important }
   Specificity = (0,4,0). dashboard-premium.css also loads AFTER this file
   (child templates inject it in their <head>), so equal-specificity rules
   in this file lose regardless. Previous fix selectors (.ob-panel--center:hover
   at (0,2,0) and .ob-panel--center.ob-visible:hover at (0,3,0)) both lost.
   Fix: prefix with html element selector →
     html .ob-panel.ob-panel--center.ob-visible:hover = specificity (0,4,1)
   Element selectors are compared last but tip the balance when b-column ties:
   (0,4,1) beats (0,4,0) unconditionally.
   ─────────────────────────────────────────────────────────────────────────── */

/* Restore centering transform — specificity (0,4,1) beats wildcard (0,4,0) */
html .ob-panel.ob-panel--center.ob-visible:hover {
  transform: translate(-50%, -50%) scale(1) !important;
  -webkit-transform: translate(-50%, -50%) scale(1) !important;
}

/* Neutralize any accidental hover transform on the inner step content */
.ob-seq-item:hover,
.ob-detail:hover,
.ob-impact:hover,
.ob-btn-secondary:hover {
  transform: none !important;
  box-shadow: none !important;
}
