/* ── Premium welcome onboarding — 5-step modal shown once after upgrade ─────── */

.po-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(13, 31, 60, 0.78);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.po-overlay.open {
  display: flex;
  animation: po-fade-in 0.28s ease;
}

@keyframes po-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.po-modal {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 720px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: po-rise-in 0.32s cubic-bezier(0.34,1.2,0.64,1);
}

@keyframes po-rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top bar — back link, step dots, close */
.po-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0;
  flex-shrink: 0;
  min-height: 30px;
}

.po-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  visibility: hidden;
  transition: color 0.15s;
}
.po-back.show { visibility: visible; }
.po-back:hover { color: var(--text-primary); }

.po-dots {
  display: flex;
  gap: 0.4rem;
}

.po-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}

.po-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.po-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.po-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* Step container */
.po-steps {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.75rem 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.po-steps::-webkit-scrollbar { width: 5px; }
.po-steps::-webkit-scrollbar-track { background: transparent; }
.po-steps::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.po-step { display: none; }
.po-step.active {
  display: block;
  animation: po-step-in 0.32s ease;
}

@keyframes po-step-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.po-hero-icon {
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 3;
}

.po-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  position: relative;
  z-index: 3;
}

.po-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 3;
}

/* Buttons */
.po-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.6rem;
}
.po-actions-split { justify-content: space-between; align-items: center; }

.po-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.78rem 1.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
.po-btn:active { transform: scale(0.98); }
.po-btn-primary { background: #000000; color: #fff; }
.po-btn-primary:hover { background: #000000; opacity: 0.85; }
.po-btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.po-btn-secondary:hover { border-color: var(--accent); }
.po-btn:disabled { opacity: 0.6; cursor: default; }
.po-btn-block { width: 100%; }

.po-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color 0.15s;
}
.po-link-btn:hover { color: var(--text-primary); }

/* Step 2 — notification toggles */
.po-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.po-toggle-row:last-of-type { border-bottom: none; }

.po-toggle-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.po-toggle-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.45; }

.po-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; margin-top: 0.1rem; }
.po-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.po-switch-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}
.po-switch-track::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: transform 0.2s;
  box-sizing: border-box;
}
.po-switch input:checked + .po-switch-track { background: var(--accent); }
.po-switch input:checked + .po-switch-track::before { transform: translateX(18px); }

.po-muted-note { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.9rem; line-height: 1.5; }

/* Step 3 — ticker grid */
.po-ticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.po-ticker-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.po-ticker-tile:hover { border-color: var(--accent); }
.po-ticker-tile.added {
  border-color: var(--positive);
  background: var(--positive-subtle);
  cursor: default;
}
.po-ticker-tile.po-pulse { animation: po-tile-pulse 0.35s ease; }
@keyframes po-tile-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.po-tile-info { min-width: 0; overflow: hidden; }
.po-tile-symbol { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.po-tile-name { font-size: 0.66rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.po-tile-icon {
  width: 22px; height: 22px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.po-ticker-tile.added .po-tile-icon {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
  transform: scale(1.08);
}

@media (max-width: 480px) {
  .po-ticker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile — full screen */
@media (max-width: 768px) {
  .po-overlay { padding: 0; }
  .po-modal {
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .po-heading { font-size: 1.15rem; }
  .po-actions-split { gap: 1rem; }
}
