/* ===================================================
   Portfolio Times — Design System
   Dark mode, glassmorphism, premium feel
   =================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-table-row: rgba(255, 255, 255, 0.02);
  --bg-table-row-hover: rgba(99, 102, 241, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0a0e17;

  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.3);
  --accent-hover: #818cf8;

  --color-profit: #22c55e;
  --color-profit-bg: rgba(34, 197, 94, 0.1);
  --color-profit-glow: rgba(34, 197, 94, 0.25);
  --color-loss: #ef4444;
  --color-loss-bg: rgba(239, 68, 68, 0.1);
  --color-loss-glow: rgba(239, 68, 68, 0.25);
  --color-neutral: #94a3b8;

  --color-warning: #f59e0b;
  --color-info: #3b82f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-primary-glow);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
  --fs-xs: 0.70rem;
  --fs-sm: 0.76rem;
  --fs-md: 0.82rem;
  --fs-body: 0.90rem;
  --fs-h3: 1.05rem;
  --fs-h2: 1.25rem;
  --fs-table-row: var(--fs-md);
  --fs-table-header: var(--fs-xs);
  --fs-ta-row: var(--fs-body);
  --fs-ta-header: var(--fs-sm);
  --fs-auth-title: 1.714rem;
  --fs-auth-input: 1.143rem;
  --fs-auth-meta: 0.929rem;
  --fs-18: 1.2857rem;
  --fs-16: 1.1429rem;
  --fs-14: 1rem;
  --fs-12: 0.8571rem;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
  width: 100% !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Ambient background gradients */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(34, 197, 94, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
  animation: ambientShift 30s ease-in-out infinite alternate;
}

@keyframes rowPulse {
  0% { background-color: var(--bg-table-row); }
  30% { background-color: rgba(99, 102, 241, 0.25); }
  100% { background-color: var(--bg-table-row); }
}

.row-pulse {
  animation: rowPulse 0.4s ease-out;
}


.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.background-status-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--accent-primary-glow);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 1000;
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.status-pulse {
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulseNeon 1.5s infinite;
}

@keyframes pulseNeon {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 4px;
}

.drag-handle:hover { opacity: 1; }

.chart-trigger {
  cursor: pointer;
  text-decoration: underline dotted var(--accent-primary-glow);
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.chart-trigger:hover, .chart-trigger-active {
  background: var(--accent-primary-glow);
  color: white;
}


@keyframes ambientShift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-5%, -5%);
  }
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  overflow: hidden;
}

.header-row {
  display: flex;
  align-items: center;
  padding: 0;
  min-height: 36px;
  width: 100%;
  overflow: hidden;
}

.header-brokers {
  border-bottom: 1px solid var(--border-subtle);
  min-height: 32px;
}

.header-tabs {
  min-height: 40px;
}

.header-scroll {
  display: flex;
  align-items: baseline;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  width: 100%;
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin-left: 0 !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  scroll-padding-left: 16px;
}

.header-scroll::-webkit-scrollbar {
  display: none;
}

.header-brokers .header-scroll {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  overflow: hidden !important;
  width: 100%;
}

/* ==========================================================================
   Header Financial Ticker Tape (TV News Band Style)
   ========================================================================== */
.header-ticker-tape-container {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  margin: 0 16px;
  display: flex;
  align-items: baseline;
}

.header-ticker-tape-container::before,
.header-ticker-tape-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
}

.header-ticker-tape-container::before {
  left: 0;
  background: linear-gradient(to right, rgba(10, 14, 23, 0.95), transparent);
}

.header-ticker-tape-container::after {
  right: 0;
  background: linear-gradient(to left, rgba(10, 14, 23, 0.95), transparent);
}

.ticker-tape-track {
  display: flex;
  flex-shrink: 0;
  align-items: baseline;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
  animation: tickerTapeScroll 38s linear infinite;
}

.header-ticker-tape-container:hover .ticker-tape-track {
  animation-play-state: paused;
}

@keyframes tickerTapeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  flex-shrink: 0;
  line-height: 1.2;
}

.ticker-label {
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}

.ticker-price {
  color: var(--text-primary);
  font-weight: 500;
}

.ticker-pill {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.ticker-pill.up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.ticker-pill.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.ticker-pill.flat {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .header-ticker-tape-container {
    margin: 0 8px;
  }
  .header-ticker-tape-container::before,
  .header-ticker-tape-container::after {
    width: 14px;
  }
  .ticker-item {
    padding: 0 8px;
    font-size: var(--fs-xs);
    gap: 4px;
  }
  .ticker-label {
    font-size: var(--fs-xs);
  }
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px var(--accent-primary-glow));
  animation: pulse-glow 3s ease-in-out infinite;
  transform: translateY(2px);
}

@keyframes pulse-glow {

  0%,
  100% {
    filter: drop-shadow(0 0 8px var(--accent-primary-glow));
  }

  50% {
    filter: drop-shadow(0 0 16px var(--accent-primary-glow));
  }
}

.logo-text {
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-tag {
  font-size: var(--fs-md);
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 10px;
  transform: translateY(1px);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.connection-status:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-card);
  transform: translateY(-1px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-warning);
  animation: blink 2s ease-in-out infinite;
}

.status-dot.connected {
  background: var(--color-profit);
  animation: none;
  box-shadow: 0 0 6px var(--color-profit-glow);
}

.status-dot.warning {
  background: var(--color-warning);
  animation: none;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.status-dot.error {
  background: var(--color-loss);
  animation: none;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

.status-text,
.saxo-label {
  color: var(--text-secondary);
}

.saxo-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  margin-left: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.saxo-status:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-card);
  transform: translateY(-1px);
}

.saxo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-warning);
}

.saxo-dot.valid,
.status-dot.connected {
  background: var(--color-profit);
  box-shadow: 0 0 6px var(--color-profit-glow);
}

.saxo-dot.expired,
.status-dot.error {
  background: var(--color-loss);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.saxo-dot.warning,
.status-dot.warning {
  background: var(--color-warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.saxo-label {
  color: var(--text-secondary);
}

/* ---------- Saxo Re-auth Banner ---------- */
.saxo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px 24px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.saxo-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ff8a8a;
  font-size: var(--fs-body);
  font-weight: 500;
}

.saxo-reauth-btn {
  background: var(--color-loss);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  text-decoration: none;
  font-size: var(--fs-md);
  font-weight: 600;
  margin-left: 12px;
  transition: all 0.2s ease;
}

.saxo-reauth-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.saxo-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-h2);
  cursor: pointer;
  padding: 4px;
}

.saxo-banner-close:hover {
  color: var(--text-primary);
}

.logout-link {
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  user-select: none;
}

.logout-link:hover {
  background: var(--color-loss-bg);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--color-loss);
  transform: translateY(-1px);
}

/* User Account Menu */
.user-menu-container {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-family: inherit;
}

.user-menu-btn:hover,
.user-menu-btn.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent-hover, #818cf8);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.user-nav-initial {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--accent-primary, #6366f1);
  line-height: 1;
  display: block;
}

.user-menu-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* ---------- User Account Menu Panel (IDEA-194) ---------- */
.user-dropdown-menu.um-panel {
  position: fixed;
  top: 40px;
  right: 12px;
  width: 288px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(99, 102, 241, 0.08);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dropdownFadeIn 0.15s ease-out;
  scrollbar-width: thin;
}

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

/* Close button (parity with Login/Signup .pt-landing-auth-close, BUG-226) */
.um-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.um-close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

/* Identity header */
.um-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 32px 0 2px;
}

.um-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.55);
  color: #a5b4fc;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: var(--fs-h2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.um-identity {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.um-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.um-name {
  font-weight: 700;
  color: #f8fafc;
  font-size: var(--fs-body);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.um-handle,
.um-email {
  font-size: var(--fs-sm);
  line-height: 1.35;
  color: var(--text-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-handle {
  color: var(--text-secondary, #94a3b8);
}

/* Public / Private pill (opens Edit Profile modal) */
.um-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}

.um-privacy-pill:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.um-privacy-pill.is-public {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.um-privacy-pill.is-private {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.28);
}

.um-privacy-icon {
  display: inline-flex;
  align-items: center;
}

.um-privacy-icon svg {
  display: block;
}

/* AUM stat chip */
.um-aum {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.um-aum-icon {
  font-size: var(--fs-h3);
  line-height: 1;
}

.um-aum-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #94a3b8);
}

.um-aum-val {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-md);
  font-weight: 700;
  color: #f8fafc;
}

/* Quick settings tiles */
.um-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.um-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.um-tile-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}

.um-tile-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-md);
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-currency-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.um-currency-select:hover,
.um-currency-select:focus-visible {
  border-color: var(--accent-hover, #818cf8);
}

/* Sections & items */
.um-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.um-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  padding: 0 8px 4px;
}

.um-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.um-item svg {
  flex-shrink: 0;
  color: var(--text-muted, #64748b);
  transition: color var(--transition-fast);
}

.um-item:hover,
.um-item:focus-visible {
  background: rgba(99, 102, 241, 0.1);
  color: #f8fafc;
  outline: none;
}

.um-item:hover svg,
.um-item:focus-visible svg {
  color: #a5b4fc;
}

.um-item:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.6);
}

.um-item-text {
  flex: 1;
  min-width: 0;
}

.um-item-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xs);
  color: var(--text-muted, #64748b);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

/* Footer */
.um-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.um-logout-form {
  margin: 0;
  flex: 1;
}

.um-item.um-logout:hover,
.um-item.um-logout:focus-visible {
  background: var(--color-loss-bg, rgba(239, 68, 68, 0.15));
  color: var(--color-loss, #ef4444);
}

.um-item.um-logout:hover svg,
.um-item.um-logout:focus-visible svg {
  color: var(--color-loss, #ef4444);
}

.um-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xs);
  color: var(--text-muted, #64748b);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .user-dropdown-menu.um-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }

  .um-item {
    padding: 9px 8px;
  }
}

/* Edit Profile Modal Inputs & Visibility Switch */
.profile-modal-input,
.profile-handle-input-wrap {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-modal-input:focus,
.profile-handle-input-wrap:focus-within {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
  outline: none;
}

.profile-handle-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.profile-visibility-card:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.profile-switch-ui {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 2px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.profile-switch-ui.is-active {
  background: #10b981;
}

.profile-switch-toggle {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.profile-switch-ui.is-active .profile-switch-toggle {
  transform: translateX(20px);
}

/* ---------- Navigation Tabs ---------- */
.header-nav {
  display: flex;
  gap: 8px;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-tab:hover:not(.disabled) {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.nav-tab.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
}

.nav-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.badge-coming {
  font-size: var(--fs-xs);
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: var(--fs-table-header);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: var(--fs-body);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-value.profit { color: var(--color-profit); }
.stat-value.loss { color: var(--color-loss); }

/* ---------- Summary Table Mobile Optimized ---------- */
@media (max-width: 768px) {
  .main-content {
    padding-top: 0 !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .user-menu-btn {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.25) !important;
  }

  .user-nav-initial {
    font-size: var(--fs-body) !important;
  }

  .header-nav {
    justify-content: flex-start !important;
    gap: 5px !important;
  }

  .header-scroll {
    padding-left: 4px !important;
    padding-right: 4px !important;
    gap: 4px !important;
  }

  .nav-tab {
    padding: 6px 6px !important;
    font-size: var(--fs-sm) !important;
    gap: 4px !important;
  }

  .nav-tab svg {
    width: 14px !important;
    height: 14px !important;
  }

  .btn-refresh {
    width: 26px !important;
    height: 26px !important;
  }

  .btn-refresh svg {
    width: 14px !important;
    height: 14px !important;
  }

  .btn-social-x {
    width: 26px !important;
    height: 26px !important;
  }

  .btn-social-x svg {
    width: 14px !important;
    height: 14px !important;
  }

  .summary-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
  }

  .trade-setup-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .setup-item {
    padding: 10px !important;
  }

  #summaryTab.active,
  #portfolioTab.active,
  #alertsTab.active,
  #optionsTab.active,
  #tradesTab.active {
    height: auto !important;
    min-height: 0 !important;
    flex: 1 0 auto;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    font-size: 0 !important; /* Kill whitespace nodes between stats and table */
  }

  #summaryTab.active > *,
  #portfolioTab.active > *,
  #alertsTab.active > *,
  #optionsTab.active > *,
  #tradesTab.active > * {
    font-size: 1rem; /* Restore font-size to children */
  }

  #summaryTab .summary-sticky-bar,
  #tradesTab .summary-sticky-bar,
  #alertsTab .summary-sticky-bar {
    flex-direction: column;
    gap: 6px !important;
    padding: 0px 6px !important;
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    margin: 0 !important;
    width: 100% !important;
    left: 0 !important;
    overflow-x: hidden !important;
    padding-bottom: 0 !important; /* Force bottom padding to zero */
  }

  #summaryCashSection:empty {
    display: none !important;
  }

  #summaryCashSection {
    margin: 0 !important;
    padding: 0 !important;
  }

  .chart-modal {
    width: 98% !important;
    max-width: 100% !important;
    max-height: 96vh !important;
    padding: 6px 8px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important; /* Enable unified scroll */
    background: #0f172a !important; /* Rich Slate-900 shell matching Portfolio Times atmosphere */
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .chart-modal .etrade-modal-header {
    position: relative !important;
    top: auto !important;
    padding: 0 0 2px 0 !important;
    margin-bottom: 2px !important;
    background: transparent !important;
    z-index: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .chart-main {
    height: 240px !important;
    min-height: 240px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }
  
  .chart-sub {
    height: 100px !important;
    min-height: 100px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    margin-top: 8px !important;
  }

  .chart-container-wrapper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
  }

  .chart-indicators-toolbar {
    gap: 4px !important;
    padding: 0 0 2px 0 !important;
  }

  .chart-indicator-pill {
    padding: 2px 6px !important;
    font-size: var(--fs-xs) !important;
  }
 
  .summary-card-row {
    grid-template-columns: 105px 105px 75px 75px !important;
    justify-content: flex-start !important;
    width: fit-content !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
  }
 
  .summary-stat {
    margin-right: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .stat-label {
    font-size: var(--fs-table-header) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .stat-value {
    font-size: var(--fs-md) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #summaryTab .table-container,
  #summaryTab .table-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border: none !important;
  }

  #summaryTable thead th,
  #tradesTable thead th,
  #cashTradesTable thead th,
  .alerts-table-section .positions-table thead th {
    padding: 3px 6px !important;
    font-size: var(--fs-table-header) !important;
    font-family: var(--font-sans) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
  }

  /* Keep table format with horizontal scroll on mobile */
  #summaryTab .table-wrapper,
  #alertsTab .table-wrapper {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #summaryTable td,
  #tradesTable td,
  #cashTradesTable td,
  .alerts-table-section .positions-table td {
    padding: 6px 6px !important;
    font-size: var(--fs-table-row) !important;
    white-space: nowrap;
  }

  #summaryTab .table-wrapper,
  #tradesTab .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #summaryTable,
  #tradesTable,
  #cashTradesTable,
  .alerts-table-section .positions-table {
    min-width: 900px;
  }
  .target-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
  }
}



.btn-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-refresh:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}

.btn-social-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  margin-left: 4px;
}

.btn-social-x:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-primary);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.btn-refresh.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.last-updated {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.version-label {
  font-size: var(--fs-sm);
  color: var(--accent-hover);
  font-family: var(--font-mono);
  font-weight: 600;
  padding-right: 8px;
  border-right: 1px solid var(--border-subtle);
  margin-right: 8px;
}

/* ---------- Main Content ---------- */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  overflow-x: hidden !important;
  width: 100%;
  box-sizing: border-box;
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
}

/* Remove padding for summary tab on all screens - NO, let's make it more general */
.tab-content.active {
  width: 100%;
}

/* Summary tab: edge-to-edge full-viewport layout */
#summaryTab {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
  padding: 0;
  margin: 0;
  width: 100%;
}

#summaryTab .table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  overflow: hidden;
}

#summaryTab .table-wrapper {
  flex: 1;
  overflow: auto;
  max-height: none;
}

/* ---------- Setup Banner ---------- */
.setup-banner {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  animation: fadeIn 0.5s ease;
}

.setup-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.setup-content h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  margin-bottom: 8px;
}

.setup-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: var(--fs-body);
}

.setup-content code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--fs-md);
  color: var(--accent-hover);
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-size: var(--fs-sm);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- Summary Cards ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
}
.stat-sub span {
  display: block;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.summary-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-primary-glow);
  transform: translateY(-2px);
}

.summary-card:hover::before {
  opacity: 1;
}

.card-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.card-value.profit {
  color: var(--color-profit);
  text-shadow: 0 0 12px var(--color-profit-glow);
}

.card-value.loss {
  color: var(--color-loss);
  text-shadow: 0 0 12px var(--color-loss-glow);
}

.card-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.card-sub.profit {
  color: var(--color-profit);
}

.card-sub.loss {
  color: var(--color-loss);
}

/* ---------- Table Container ---------- */
.table-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.table-title {
  font-size: var(--fs-h3);
  font-weight: 600;
}

.table-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  padding: 7px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  width: 200px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  padding: 7px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---------- Utilities ---------- */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* ---------- Positions Table ---------- */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  position: relative;
}

.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-table-row);
}

.summary-sticky-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--border-subtle);
  margin: 0 !important;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
  width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: hidden;
  box-sizing: border-box;
  left: 0 !important;
  position: relative;
}

.summary-sticky-bar::-webkit-scrollbar {
  display: none;
}

.summary-card-row {
  display: grid;
  grid-template-columns: 200px 200px 130px max-content;
  gap: 20px;
  align-items: baseline;
  white-space: nowrap;
  width: max-content;
}

.summary-card-row .summary-stat {
  flex-shrink: 0;
}

.table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 250px);
  position: relative;
  scrollbar-width: auto;
}

/* Frozen headers inside the scrollable wrapper */
.positions-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-secondary); /* Solid background for header */
  padding: 5px 2px 5px 0;
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-table-header);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}

/* Frozen First Column (Ticker) */
.positions-table th:first-child,
.positions-table td:first-child {
  position: sticky !important;
  left: 0;
  z-index: 5;
  background-color: #0a0e17 !important; /* Solid base background matching var(--bg-primary) */
  border-right: 1px solid var(--border-subtle);
}

.positions-table thead th:first-child {
  z-index: 30 !important;
  background-color: #111827 !important; /* Solid header background */
}

.positions-table tbody tr:nth-child(even) td:first-child {
  background-color: #111827 !important; /* Solid variant for zebra striping (Secondary) */
}

.positions-table tbody tr:hover td:first-child {
  background-color: #1e293b !important; /* Solid variant for hover state */
}

/* Summary specific: no extra sticky needed if wrapper scrolls */
#summaryTab .positions-table thead th {
  top: 0;
  background: var(--bg-secondary);
}

.positions-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.positions-table th.sortable:hover {
  color: var(--accent-hover);
}

.positions-table th.sortable.sorted-asc,
.positions-table th.sortable.sorted-desc {
  color: var(--accent-primary);
}

.sort-icon {
  opacity: 0.3;
  margin-left: 4px;
  font-size: var(--fs-xs);
}

.positions-table th.sortable.sorted-asc .sort-icon,
.positions-table th.sortable.sorted-desc .sort-icon {
  opacity: 1;
}

.positions-table td {
  padding: 5px 2px 5px 0;
  font-size: var(--fs-table-row);
  font-family: var(--font-mono);
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  transition: background var(--transition-fast);
}

.positions-table tbody tr {
  transition: background var(--transition-fast);
}

.positions-table tbody tr:hover {
  background: var(--bg-table-row-hover);
}

.positions-table tbody tr:nth-child(even) {
  background: var(--bg-table-row);
}

.positions-table tbody tr:nth-child(even):hover {
  background: var(--bg-table-row-hover);
}

/* Symbol column styling */
.symbol-cell {
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-hover);
  font-size: var(--fs-table-row);
}

.symbol-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.description-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.value-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}

/* Desktop Table Gutter: 10px right padding on all columns across Summary, Ideas & Trades (BUG-202; 0px change on mobile <=768px) */
@media (min-width: 769px) {
  .positions-table thead th,
  .positions-table td {
    padding: 5px 10px 5px 0;
  }
}

.pnl-positive {
  color: var(--color-profit);
}

.pnl-negative {
  color: var(--color-loss);
}

.pnl-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: var(--fs-table-row);
  font-weight: 600;
  font-family: var(--font-mono);
}

.pnl-badge.positive {
  background: var(--color-profit-bg);
  color: var(--color-profit);
}

.pnl-badge.negative {
  background: var(--color-loss-bg);
  color: var(--color-loss);
}

.broker-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.currency-cell {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: var(--fs-table-row);
}

/* ---------- Table Footer ---------- */
.table-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ---------- Loading ---------- */
.loading-row td {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state .empty-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.empty-state h3 {
  font-size: var(--fs-h3);
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ---------- Placeholder Sections ---------- */
.placeholder-section {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

/* Legacy Trade Visualizer Styles Purged */
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  border: 2px solid var(--bg-card);
}

.vis-node.tp { background: var(--color-profit); box-shadow: 0 0 10px var(--color-profit-glow); }
.vis-node.price { background: #fff; cursor: default; }
.vis-node.sl { background: var(--color-loss); box-shadow: 0 0 10px var(--color-loss-glow); }

.vis-label {
  position: absolute;
  left: 15px;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vis-label .price-val { font-weight: 600; }
.vis-label .pct-val { font-size: var(--fs-xs); padding: 1px 4px; border-radius: 4px; }
.vis-label.tp .pct-val { color: var(--color-profit); background: var(--color-profit-bg); }
.vis-label.sl .pct-val { color: var(--color-loss); background: var(--color-loss-bg); }

.vis-svg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.vis-node-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: inherit;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: grayscale(0.5);
}

.placeholder-section h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.placeholder-section p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 8px;
}

.placeholder-phase {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  font-size: var(--fs-md);
  font-weight: 600;
}

/* ---------- Tab Content ---------- */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: block !important;
  animation: fadeIn 0.3s ease;
}

/* Override display:block with flex only for specific tabs when active */
#summaryTab.active,
#optionsTab.active,
#alertsTab.active,
#portfolioTab.active {
  display: flex !important;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100010;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-md);
  color: var(--text-primary);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s;
  max-width: 400px;
}

.toast.success {
  border-left: 3px solid var(--color-profit);
}

.toast.error {
  border-left: 3px solid var(--color-loss);
}

.toast.info {
  border-left: 3px solid var(--color-info);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Purged legacy Responsive block to resolve conflicts */

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------- Alert Count Badge ---------- */
.alert-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--color-loss);
  color: white;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
}

/* ---------- Alerts Header ---------- */
.alerts-header {
  margin-bottom: 20px;
}

.alerts-title {
  font-size: var(--fs-h2);
  font-weight: 600;
  margin-bottom: 4px;
}

.alerts-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

/* ---------- Alerts Loading ---------- */
.alerts-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  width: 100%;
  box-sizing: border-box;
  clear: both;
}

.alerts-loading .loading-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  display: block;
}

.alerts-loading p {
  margin-bottom: 4px;
}

.loading-sub {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

/* ---------- 4 Segmented Alerts Tables (Option A) ---------- */
.alerts-summary-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.alerts-summary-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: var(--fs-table-row);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alerts-summary-chip strong {
  color: var(--text-bright);
}

/* Alerts Page Typography & Font Normalization (Parity with Summary Table) */
#alertsTab,
#alertsTab *,
.alerts-table-section,
.alerts-table-section * {
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

.alerts-table-section {
  margin-bottom: 28px;
}

.table-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 6px;
}

.table-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-section-icon {
  font-size: var(--fs-body);
  line-height: 1;
}

.table-section-title {
  font-size: var(--fs-body) !important;
  font-weight: 600 !important;
  font-family: var(--font-sans) !important;
  color: var(--text-bright);
  margin: 0;
  display: flex;
  align-items: center;
}

.table-count-badge {
  font-size: var(--fs-table-header) !important;
  color: var(--text-muted);
  font-weight: 600 !important;
  font-family: var(--font-mono) !important;
  margin-left: 6px;
}

/* Interactive Table Section Header Filters */
.alerts-filter-title {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}

.alerts-filter-title:hover {
  opacity: 0.9;
}

.alerts-filter-item {
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  color: var(--text-muted);
  opacity: 0.8;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
}

.alerts-filter-item:hover {
  opacity: 1;
  color: var(--text-bright);
}

.alerts-filter-item.active {
  opacity: 1;
  font-weight: 600;
  color: var(--text-bright);
}

.alerts-filter-title.active.pill-positions,
.alerts-filter-item.active.pill-positions {
  color: #818cf8;
  border-bottom-color: #6366f1;
}

.alerts-filter-title.active.pill-opportunities,
.alerts-filter-item.active.pill-opportunities {
  color: #34d399;
  border-bottom-color: #10b981;
}

.alerts-table-section .positions-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: var(--fs-table-row) !important;
}

.alerts-table-section .positions-table thead th {
  font-size: var(--fs-table-header) !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

.alerts-table-section .positions-table tbody td {
  font-size: var(--fs-table-row) !important;
  font-family: var(--font-mono) !important;
  font-weight: 500;
  white-space: nowrap !important;
}

.alerts-table-section .positions-table tbody td.symbol-cell,
.alerts-table-section .positions-table tbody td.symbol-cell .symbol-text {
  font-size: var(--fs-table-row) !important;
  font-family: var(--font-mono) !important;
  font-weight: 600 !important;
}

.alerts-table-section .positions-table tbody td.value-cell {
  font-size: var(--fs-table-row) !important;
  font-family: var(--font-mono) !important;
  font-weight: 500;
}

.alerts-table-section .positions-table tbody td.target-cell,
.alerts-table-section .positions-table tbody td.target-cell span {
  font-size: var(--fs-table-row) !important;
  font-family: var(--font-mono) !important;
}

.alerts-table-section .positions-table th.sortable {
  font-size: var(--fs-table-header) !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
}

.alerts-table-section .sort-icon {
  font-size: var(--fs-xs) !important;
  font-family: var(--font-sans) !important;
}

.positions-table tbody td.order-cell {
  white-space: pre !important;
  vertical-align: top;
}

.side-pill-sell {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--fs-table-header);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.side-pill-buy {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--fs-table-header);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.side-pill-watch {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--fs-table-header);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.side-pill-hold {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: var(--fs-table-header);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.subrow-indicator {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-right: 4px;
}

.ticker-chart-hint {
  font-size: 0.85em;
  opacity: 0.70;
  margin-left: 5px;
  vertical-align: middle;
}

/* ---------- Alert Cards ---------- */
.alert-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: visible;
  transition: all var(--transition-normal);
  position: relative;
}

.alert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-card.alert-buy::before {
  background: var(--color-profit);
  box-shadow: 0 0 12px var(--color-profit-glow);
}

.alert-card.alert-sell::before {
  background: var(--color-loss);
  box-shadow: 0 0 12px var(--color-loss-glow);
}

.alert-card.alert-hold::before {
  background: var(--color-warning);
}

.alert-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* Alert Header */
.alert-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.alert-rank {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
}

.alert-symbol-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.alert-symbol {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--accent-hover);
}

.alert-desc {
  font-size: var(--fs-md);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strategy-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.strategy-badge.primary {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.strategy-badge.alternative {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.direction-badge.alert-buy {
  background: var(--color-profit-bg);
  color: var(--color-profit);
}

.direction-badge.alert-sell {
  background: var(--color-loss-bg);
  color: var(--color-loss);
}

.direction-badge.alert-hold {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.badge-aggregate {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 4px;
}

.alert-reasoning {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--border-subtle);
  border-radius: 4px;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text-secondary);
}

.reason-line {
    margin-bottom: 4px;
}

.alert-master-analysis {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.analysis-status {
  font-size: var(--fs-body);
  font-weight: 600;
  margin-bottom: 8px;
}

.analysis-status.bullish { color: var(--color-profit); }
.analysis-status.bearish { color: var(--color-loss); }
.analysis-status.neutral { color: var(--color-warning); }

.analysis-summary {
  font-size: var(--fs-md);
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.analysis-setup {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.alert-score {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.score-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-value {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-weight: 700;
}

.score-value-local {
  font-size: var(--fs-md);
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

.metric-value-local {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Alert Body */
.alert-body {
  padding: 16px 20px 16px 24px;
}

.alert-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-body);
}

/* Confidence Bar */
.confidence-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.confidence-fill.alert-buy {
  background: var(--color-profit);
  box-shadow: 0 0 6px var(--color-profit-glow);
}

.confidence-fill.alert-sell {
  background: var(--color-loss);
  box-shadow: 0 0 6px var(--color-loss-glow);
}

.confidence-fill.alert-hold {
  background: var(--color-warning);
}

/* Indicator Badges */
.alert-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.indicator-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: var(--font-mono);
}

.indicator-badge.ind-buy {
  background: var(--color-profit-bg);
  color: var(--color-profit);
}

.indicator-badge.ind-sell {
  background: var(--color-loss-bg);
  color: var(--color-loss);
}

.indicator-badge.ind-neutral {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

/* Signals */
.alert-signals h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.signal-item {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: var(--fs-md);
}

.signal-item.signal-buy {
  border-left-color: var(--color-profit);
}

.signal-item.signal-sell {
  border-left-color: var(--color-loss);
}

.signal-item.signal-neutral {
  border-left-color: var(--color-warning);
}

.signal-indicator {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.signal-desc {
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.4;
}

.strength-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
}

.strength-fill.signal-buy {
  background: var(--color-profit);
}

.strength-fill.signal-sell {
  background: var(--color-loss);
}

.strength-fill.signal-neutral {
  background: var(--color-warning);
}

/* Recommendation */
.alert-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
}

.rec-icon {
  flex-shrink: 0;
  font-size: var(--fs-h3);
}

.rec-text {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Alerts Responsive */
@media (max-width: 768px) {
  .alert-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .alert-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .signal-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .alert-desc {
    max-width: 120px;
  }
}

/* ---------- Hedge Cards ---------- */
.hedge-available {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hedge-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: var(--fs-md);
  font-weight: 700;
  width: fit-content;
}

.hedge-type-badge.hedge-sell {
  background: var(--color-profit-bg);
  color: var(--color-profit);
}

.hedge-type-badge.hedge-buy {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.hedge-action {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text-primary);
}

.hedge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.hedge-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hedge-metric-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hedge-metric-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-body);
}

.hedge-risk {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
}

.hedge-risk .rec-text {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.hedge-unavailable {
  padding: 24px 0;
}

.hedge-no-options {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.no-options-icon {
  font-size: var(--fs-h2);
  flex-shrink: 0;
}

.no-options-text {
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.5;
}

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

/* ---------- Potential Hedge Styles ---------- */
.potential-hedge {
  margin-top: 15px;
  padding: 15px;
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(99, 102, 241, 0.2);
}

.potential-heading {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--accent-hover);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.potential-hedge .hedge-grid {
  margin-top: 0;
  grid-template-columns: repeat(2, 1fr) !important;
}

/* Highlight Premium Metric */
.highlight-premium {
  background: rgba(34, 197, 94, 0.08) !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
  transform: scale(1.02);
  z-index: 1;
}

.highlight-premium .hedge-metric-label {
  color: var(--color-profit) !important;
  font-weight: 700 !important;
}

.highlight-premium .hedge-metric-value {
  font-size: var(--fs-h3) !important;
  font-weight: 800 !important;
}

/* Option Scenarios */
.hedge-scenarios {
  margin-top: 15px;
}

.scenario-trajectory {
  margin-bottom: 12px;
  font-size: var(--fs-body);
}

.trajectory-label {
  color: var(--color-text-muted);
  margin-right: 8px;
}

.trajectory-value {
  color: var(--color-warning);
  font-weight: 700;
}

.scenario-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.scenario-title {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.scenario-item {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.scenario-item:last-child {
  margin-bottom: 0;
}

.scenario-icon {
  flex-shrink: 0;
  font-size: var(--fs-h3);
}

.scenario-text {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-body);
  color: var(--color-text);
  line-height: 1.5;
}

/* ---------- Traffic Light Signal Indicator ---------- */
.traffic-lights {
  display: flex;
  gap: 4px;
  align-items: center;
}

.traffic-lights .light {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background-color: var(--border-light);
  transition: background-color 0.3s ease;
}

.traffic-lights.weak .box-1 {
  background-color: var(--color-loss);
  /* Red */
}

.traffic-lights.moderate .box-1,
.traffic-lights.moderate .box-2 {
  background-color: #f59e0b;
  /* Orange */
}

.traffic-lights.strong .box-1,
.traffic-lights.strong .box-2,
.traffic-lights.strong .box-3 {
  background-color: var(--color-profit);
  /* Green */
}

/* ---------- Hedge Alternatives Table ---------- */
.hedge-alternatives {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.alternatives-title {
  font-size: var(--fs-md);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.05rem;
}

.alternatives-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
  text-align: right;
}

.alternatives-table th {
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.alternatives-table th:first-child,
.alternatives-table td:first-child {
  text-align: left;
}

.alternatives-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  font-family: var(--font-mono);
}

.alternatives-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.alternatives-table tr:last-child td {
  border-bottom: none;
}

/* ---------- Tooltips ---------- */
.tooltip-container {
  position: relative;
  cursor: help;
}

.tooltip-container .tooltip-content {
  visibility: hidden;
  width: 250px;
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
  text-align: left;
  border-radius: 6px;
  padding: 12px;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  margin-left: -125px;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-size: var(--fs-md);
  font-weight: normal;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
}

.tooltip-container .tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--color-bg-elevated) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* ---------- E*TRADE Upload Modal ---------- */
.etrade-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999; /* Highest priority above all overlays and tickers */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 12px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
  pointer-events: auto;
  cursor: pointer;
}

.etrade-modal {
  cursor: default;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 96vw;
  max-height: calc(100dvh - 32px);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.1);
  animation: slideUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  position: relative;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.etrade-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.etrade-modal-header h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text-primary);
}

.etrade-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: var(--fs-h2);
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.etrade-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.etrade-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.etrade-drop-zone {
  margin: 24px;
  padding: 40px 24px;
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.etrade-drop-zone:hover,
.etrade-drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

.etrade-drop-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 20px var(--accent-primary-glow);
}

.etrade-upload-status,
.qnbtr-upload-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-body);
}

.etrade-upload-icon,
.qnbtr-upload-icon {
  font-size: var(--fs-h2);
}

.etrade-upload-text {
  color: var(--text-secondary);
}

.etrade-upload-text.success,
.qnbtr-upload-text.success {
  color: var(--color-profit);
}

.etrade-upload-text.error,
.qnbtr-upload-text.error {
  color: var(--color-loss);
}

@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    border-color: var(--accent-primary);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    border-color: var(--accent-hover);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    border-color: var(--border-subtle);
  }
}

.highlight-pulse {
  animation: highlightPulse 1s ease-out 2;
}

/* Chart Modal */
.chart-modal {
  max-width: 1000px;
  width: 90%;
  max-height: 95vh;
  padding: 16px 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chart-modal .etrade-modal-header {
  position: relative !important;
  top: auto !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 0 4px 0 !important;
  margin-bottom: 4px !important;
  z-index: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.chart-modal .chart-container-wrapper {
  margin-top: 4px !important;
  gap: 10px !important;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-subtitle {
  font-size: var(--fs-md);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.4;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-share-wrapper {
  position: relative;
}

.btn-chart-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--accent-hover, #818cf8);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-md);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-chart-share:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary, #6366f1);
  color: #fff;
  transform: translateY(-1px);
}

.options-share-btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* TA Chart Share Modal (IDEA-204; iPhone 393px friendly) */
.chart-share-modal-overlay {
  z-index: 100020;
}

.chart-share-modal {
  width: calc(100vw - 24px);
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chart-share-modal-title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.chart-share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-share-url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.chart-share-url-input {
  flex: 1;
  min-width: 0;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  outline: none;
  text-overflow: ellipsis;
}

.chart-share-url-input:focus {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.chart-share-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.chart-share-copy-btn:hover {
  background: rgba(99, 102, 241, 0.24);
  border-color: var(--accent-hover);
}

.chart-share-copy-btn.is-copied {
  background: var(--color-profit-bg);
  border-color: var(--color-profit-glow);
  color: var(--color-profit);
}

.chart-share-toggle-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 23, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 4px;
}

.chart-share-toggle-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.chart-share-toggle-btn:hover {
  color: var(--text-primary);
}

.chart-share-toggle-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.45);
  color: var(--text-primary);
}

.chart-share-preview-frame {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  background: #0a0e17;
}

.chart-share-preview-img {
  display: block;
  width: 100%;
  height: auto;
}

.chart-share-modal-footer {
  display: flex;
  justify-content: flex-end;
}

.chart-share-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent-primary);
  border: 1px solid var(--accent-hover);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}

.chart-share-download-btn:hover {
  filter: brightness(1.1);
}

.modal-currency {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  font-weight: normal;
  margin-left: 8px;
}

.chart-container-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.chart-main {
  height: 340px;
  width: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 10px;
}

.chart-sub {
  height: 155px;
  width: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 10px;
}

/* =========================================================================
   TA Chart Indicators Toolbar (IDEA-86)
   ========================================================================= */
.chart-indicators-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 2px 0 4px 0;
}

.chart-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}

.chart-indicator-pill:hover {
  background: rgba(51, 65, 85, 0.65);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f1f5f9;
}

.chart-indicator-pill.active {
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.chart-indicator-pill.active.pill-sma50 {
  border-color: rgba(6, 182, 212, 0.60);
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
}

.chart-indicator-pill.active.pill-sma200 {
  border-color: rgba(192, 132, 252, 0.60);
  background: rgba(192, 132, 252, 0.15);
  color: #d8b4fe;
}

.chart-indicator-pill.active.pill-dots {
  border-color: rgba(250, 204, 21, 0.50);
  background: rgba(250, 204, 21, 0.10);
  color: #fef08a;
}

.chart-indicator-pill.active.pill-support {
  border-color: rgba(34, 197, 94, 0.50);
  background: rgba(34, 197, 94, 0.10);
  color: #86efac;
}

.chart-indicator-pill.active.pill-resistance {
  border-color: rgba(239, 68, 68, 0.50);
  background: rgba(239, 68, 68, 0.10);
  color: #fca5a5;
}

.chart-indicator-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.pill-pip-line {
  display: inline-block;
  width: 10px;
  height: 2px;
  border-radius: 1px;
}

.pill-pips-multi {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.pill-pips-multi span {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.chart-legend-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  font-size: var(--fs-md);
  color: var(--text-muted);
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.btn-view-chart {
  background: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.btn-view-chart:hover {
  background: var(--accent-primary);
  color: white;
}

/* Master Analysis Unified Card System */
.analysis-report-card {
  width: 100% !important;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0 0 12px 0; /* Flush with modal padding */
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.master-summary-box { display: contents; } 
.trade-setup-container { display: contents; } 
.rationale-box { display: contents; }

.summary-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--fs-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.summary-status.strong-bullish { color: #22c55e; }
.summary-status.strong-bullish .status-dot { background: #22c55e; box-shadow: 0 0 8px #22c55e; }

.summary-text {
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Unified Strategy Visualizer Labels */
.vis-label-unified {
  position: absolute;
  padding: 2px 0;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.vis-label-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 2px;
  opacity: 0.8;
}

.vis-label-price {
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 1.1;
}

.vis-label-pct {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 3px;
}

.vis-label-date {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.4);
  margin-top: 3px;
  font-weight: 400;
}

.rationale-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: var(--fs-md);
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.rationale-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.trade-setup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Gap Percentages */
.gap-percent {
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}
.gap-neg {
  color: var(--color-loss);
  background: var(--color-loss-bg);
}
.gap-pos {
  color: var(--color-profit);
  background: var(--color-profit-bg);
}

.setup-item {
  background: rgba(15, 23, 42, 0.4);
  padding: 12px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-subtle);
}

.setup-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.setup-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: var(--fs-h3);
}

.setup-value.stop-loss { color: #ef4444; }
.setup-value.take-profit { color: #22c55e; }

.chart-legend-items {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-md);
  color: var(--text-muted);
}
/* ---------- Ticker Autocomplete ---------- */
.ticker-autocomplete-wrapper {
  position: relative;
}

.ticker-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
}

.ticker-autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: var(--fs-body);
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.ticker-autocomplete-item:last-child {
  border-bottom: none;
}

.ticker-autocomplete-item:hover,
.ticker-autocomplete-item.active {
  background: rgba(99, 102, 241, 0.15);
}

.ticker-autocomplete-item .ticker-symbol {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-hover);
}

.ticker-autocomplete-item .ticker-name {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Candidate Review Modal ---------- */
.candidate-modal {
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.candidate-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.candidate-header-left h3 {
  margin: 0;
  white-space: nowrap;
}

.cand-copy-action-btn {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.cand-copy-action-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.cand-copy-action-btn.copied {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-profit);
  border-color: rgba(16, 185, 129, 0.35);
  cursor: default;
  pointer-events: none;
  opacity: 0.9;
}

.input-derived-readonly {
  background: rgba(15, 23, 42, 0.55) !important;
  color: var(--text-muted, #94a3b8) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  cursor: default !important;
}

.auto-calc-pill {
  display: inline-block;
  font-size: var(--fs-xs);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-left: 6px;
  font-weight: 500;
  vertical-align: middle;
}

.trade-action-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.trade-action-badge.badge-buy {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.trade-action-badge.badge-sell {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

@media (max-width: 480px) {
  .candidate-modal .etrade-modal-header {
    padding: 12px 14px;
  }
  .candidate-modal .etrade-modal-header h3 {
    font-size: var(--fs-body);
  }
  .candidate-header-left {
    gap: 8px;
  }
  .cand-copy-action-btn {
    font-size: var(--fs-xs);
    padding: 2px 8px;
  }
  .candidate-modal .etrade-modal-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: var(--fs-h3);
  }
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.candidate-form-scroll {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
}

.candidate-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 480px) {
  .candidate-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input, .form-group select {
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.candidate-actions {
  display: flex;
  justify-content: space-evenly;
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.4);
  backdrop-filter: blur(10px);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  width: 90px;
  padding: 12px 0;
}

.action-btn svg {
  transition: transform var(--transition-normal);
}

.action-btn span {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.browse-btn:hover { color: var(--color-info); }
.decline-btn:hover { color: var(--color-loss); }
.delete-btn:hover { color: var(--color-danger); background: rgba(220, 38, 38, 0.2) !important; }
.accept-btn:hover { color: var(--color-profit); }

.action-btn:hover svg {
  transform: translateY(-3px) scale(1.1);
}

.ocr-status-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--fs-md);
  color: var(--accent-hover);
}

.ocr-status-mini .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Summary Tab Full Scroll Override */
.table-wrapper.summary-full-scroll {
  max-height: none !important;
  overflow-y: visible !important;
}

/* SortableJS Styles */
.sortable-ghost {
  opacity: 0.4;
  background-color: var(--accent-primary) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.sortable-chosen {
  background-color: rgba(99, 102, 241, 0.1) !important;
  cursor: grabbing !important;
}

#summaryBody tr {
  cursor: default;
  transition: background-color 0.2s;
}

#summaryBody tr:active {
  cursor: grabbing;
}


/* ---------- Stats Modal & AI Popup (CAP-UX-03 TA Modal 2-Token Parity) ---------- */
.stats-modal,
.ai-popup-modal {
  --fs-ta-row: 0.92rem;
  --fs-ta-header: 0.78rem;
  max-width: 1000px;
  width: 90%;
  max-height: 95vh;
  padding: 16px 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.stats-modal .etrade-modal-header,
.ai-popup-header {
  position: relative !important;
  top: auto !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 0 0 6px 0 !important;
  margin-bottom: 8px !important;
  z-index: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.stats-modal .etrade-modal-header h3,
.ai-popup-header h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: #f8fafc;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 24px !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-modal .etrade-modal-close,
.ai-popup-modal .etrade-modal-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  font-size: var(--fs-sm);
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  box-sizing: border-box;
}

/* Tab Switcher matched 1:1 with .ta-author-tabs / .ta-author-tab */
.stats-modal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.stats-modal-tab {
  flex: 1;
  min-height: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  background: rgba(30, 41, 59, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.stats-modal-tab:hover {
  background: rgba(51, 65, 85, 0.70);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.stats-modal-tab.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.60);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.stats-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  width: 100%;
}

.stats-tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.stats-tab-content.active {
  display: flex;
}

.stats-table-section {
  width: 100%;
  box-sizing: border-box;
}

.stats-ai-analysis,
.family-office-report,
.stats-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

.stats-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stats-weight-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.stats-modal code,
.ai-popup-modal code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Unified Table System inside Stats & AI Modals */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 6px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.45);
  box-sizing: border-box;
}

.stats-breakdown-table,
.family-office-report table,
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
}

.stats-breakdown-table tr,
.family-office-report tr,
.audit-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-breakdown-table tr:last-child,
.family-office-report tr:last-child,
.audit-table tr:last-child {
  border-bottom: none;
}

.stats-breakdown-table th,
.family-office-report th,
.audit-table th {
  padding: 8px 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--fs-ta-header, 0.78rem);
  letter-spacing: 0.05em;
  line-height: 1.3;
  white-space: nowrap;
}

.stats-breakdown-table td,
.family-office-report td,
.audit-table td {
  padding: 7px 10px;
  vertical-align: middle;
  font-size: var(--fs-ta-row, 0.92rem);
  color: #cbd5e1;
  line-height: 1.4;
  text-align: left;
}

.stats-breakdown-table th.num-col,
.stats-breakdown-table td.num-col,
.stats-breakdown-table td.main-pct,
.stats-breakdown-table td.sub-pct,
.family-office-report th.num-col,
.family-office-report td.num-col {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.stats-breakdown-table td.mono-col {
  font-family: var(--font-mono);
  white-space: nowrap;
  color: #f1f5f9;
}

.stats-breakdown-table td.main-pct,
.stats-breakdown-table td.main-label {
  font-weight: 600;
  color: #f1f5f9;
}

.stats-breakdown-table tr.class-header {
  background: rgba(99, 102, 241, 0.07);
}

.stats-breakdown-table tr.stats-total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(99, 102, 241, 0.12);
}

.stats-breakdown-table tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Ultra-Mobile Gap Destroyer ---------- */
@media (max-width: 480px) {
  .positions-table {
    width: auto !important;
  }
  .positions-table td,
  .positions-table td.value-cell {
    font-size: var(--fs-table-row) !important;
    letter-spacing: -0.03em !important;
  }
}

/* Summary Table Row Interactions */
.row-chart-trigger {
  cursor: pointer !important;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.row-chart-trigger:active {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.row-pulse {
  animation: rowPulse 0.3s ease-out;
}

@keyframes rowPulse {
  0% { background-color: transparent; }
  50% { background-color: rgba(255, 255, 255, 0.1); }
  100% { background-color: transparent; }
}

@keyframes aiPopupIn {
  from { transform: scale(0.96) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.ai-popup-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-sparkle-icon {
  font-size: var(--fs-h3);
}

.ai-popup-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-ta-header, 0.78rem);
  color: #94a3b8;
}

.ai-cached-badge,
.ai-fresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 600;
}

.ai-cached-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.ai-fresh-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.ai-regen-btn {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.30);
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-hover);
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.ai-regen-btn:hover {
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(99, 102, 241, 0.55);
  color: #ffffff;
}

.ai-popup-body {
  flex: 1;
  padding: 0;
  background: transparent;
}

.ai-popup-body .family-office-report {
  padding: 0;
}

.ai-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  background: rgba(30, 41, 59, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  flex-shrink: 0;
}

.ai-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 500;
  color: #94a3b8;
}

.ai-footer-ts {
  font-size: var(--fs-ta-header, 0.78rem);
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* AI Popup Loading & Error States */
.ai-popup-loading,
.ai-popup-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  text-align: center;
}

.ai-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-hover);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ai-loading-text,
.ai-error-title {
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  color: #f1f5f9;
}

.ai-error-title {
  color: var(--color-loss);
}

.ai-loading-sub,
.ai-error-msg {
  font-size: var(--fs-ta-header, 0.78rem);
  color: #94a3b8;
  max-width: 380px;
  line-height: 1.5;
}

.ai-error-icon {
  font-size: 1.5rem;
}

.ai-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  background: rgba(99, 102, 241, 0.20);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 8px;
  color: #ffffff;
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ---------- AI Action Bar (Matched with TA Modal Controls) ---------- */
.try-ai-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.try-ai-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.try-ai-btn {
  flex: 1 1 0;
  min-height: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.38);
  border-radius: 8px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.try-ai-btn:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.60);
  color: #ffffff;
}

.try-ai-btn.xai-btn {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  margin-left: 0;
}

.try-ai-btn.xai-btn:hover {
  background: rgba(51, 65, 85, 0.80);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* ---------- AI Data Mode Radio Toggle ---------- */
.ai-data-mode-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0;
  margin: 0;
}

.ai-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 500;
  color: #94a3b8;
  transition: color 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.ai-radio-label:hover {
  color: #cbd5e1;
}

.ai-radio-label input[type="radio"] {
  display: none;
}

.ai-radio-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.20);
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary-glow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-radio-label input[type="radio"]:checked + .ai-radio-dot {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.15);
}

.ai-radio-label input[type="radio"]:checked + .ai-radio-dot::after {
  transform: translate(-50%, -50%) scale(1);
}

.ai-radio-label:has(input[type="radio"]:checked) {
  color: #f8fafc;
  font-weight: 600;
}

/* Mobile & iPhone Parity with .chart-modal */
@media (max-width: 768px) {
  .stats-modal,
  .ai-popup-modal {
    --fs-ta-row: 0.84rem;
    --fs-ta-header: 0.72rem;
    width: 98% !important;
    max-width: 100% !important;
    max-height: 96vh !important;
    padding: 6px 8px 14px !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .stats-modal .etrade-modal-header,
  .ai-popup-header {
    padding: 0 0 4px 0 !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .stats-modal .etrade-modal-header h3,
  .ai-popup-header h3 {
    font-size: var(--fs-body) !important;
    line-height: 22px !important;
  }

  .stats-modal .etrade-modal-close,
  .ai-popup-modal .etrade-modal-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    font-size: var(--fs-body) !important;
    line-height: 30px !important;
    border-radius: 6px !important;
  }

  .stats-modal-tabs {
    gap: 6px;
    padding: 6px 0;
    margin-bottom: 6px;
  }

  .stats-modal-tab {
    min-height: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: var(--fs-ta-row, 0.84rem);
  }

  .stats-tab-content,
  .stats-ai-analysis,
  .family-office-report,
  .stats-card-stack {
    gap: 10px;
  }

  .stats-modal .ta-strategy-card,
  .ai-popup-modal .ta-strategy-card {
    padding: 12px !important;
  }

  .stats-breakdown-table th,
  .family-office-report th,
  .audit-table th,
  .stats-breakdown-table td,
  .family-office-report td,
  .audit-table td {
    padding: 6px 6px;
  }

  .try-ai-bar {
    padding: 10px 12px !important;
    gap: 8px;
  }

  .try-ai-btn-group {
    width: 100%;
  }

  .ai-data-mode-row {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .ai-data-mode-row {
    gap: 12px;
    padding: 4px 0 0;
  }
  
  .ai-radio-label {
    font-size: var(--fs-xs);
  }
}

/* ---------- Minimalist Compliance & Education Footer ---------- */
.site-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-sans);
  padding: 36px 16px 48px;
  line-height: 1.8;
  background: transparent;
  clear: both;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--text-secondary);
}

.site-footer-disclaimer {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: #475569;
  letter-spacing: 0.02em;
}

/* ---------- Legal Policy Pages (Terms, Privacy, Refund) ---------- */
.legal-page-body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
  padding: 40px 20px 80px;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.legal-page-container {
  max-width: 860px;
  margin: 0 auto;
}

.legal-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
}

.legal-brand-link:hover {
  color: var(--accent-hover);
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-md);
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.legal-back-link:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
}

.legal-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.legal-meta-line {
  color: var(--text-muted);
  font-size: var(--fs-md);
  margin-bottom: 24px;
}

.legal-card h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
  letter-spacing: -0.01em;
}

.legal-card p,
.legal-card li {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.legal-card ul {
  padding-left: 22px;
  margin: 12px 0 18px;
}

.legal-card li {
  margin-bottom: 8px;
}

.legal-card hr {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 28px 0;
}

.legal-card a {
  color: var(--accent-hover);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.legal-card a:hover {
  color: var(--text-primary);
}

.legal-highlight-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: 1.6;
}

/* ============================================================================
   Zero-Trade Onboarding Experience
   ============================================================================ */
.onboarding-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 16px auto;
  width: 100%;
  box-sizing: border-box;
}

.onboarding-container--centered {
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.onboarding-card {
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

.onboarding-card--empty {
  width: 100%;
  max-width: 460px;
  margin: 28px auto;
  text-align: center;
}

.onboarding-card h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-auth-title);
  font-weight: 400;
  line-height: 1.333;
  color: #f8fafc;
  margin: 0 0 12px 0;
}

.onboarding-card p {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0 0 22px 0;
}

.onboarding-empty-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #6366f1;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-auth-input);
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.onboarding-empty-cta:hover {
  background: #4f46e5;
}

@media (max-width: 640px) {
  .onboarding-container {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 8px auto;
  }
  .onboarding-card {
    padding: 22px 18px 20px;
  }
  .onboarding-card--empty {
    margin: 16px auto;
  }
  .onboarding-card h3 {
    font-weight: 700;
  }
  .onboarding-empty-cta {
    min-height: 44px;
  }
}

/* ===================================================
   ChatAUM — Capital Tier Community Chat Channels
   =================================================== */
.community-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
  min-height: 520px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 860px) {
  .community-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 16px;
  }

  .community-chat-main {
    height: 75vh;
    height: 75dvh;
    min-height: 520px;
    max-height: 850px;
  }

  .community-messages-stream {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

.community-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.community-sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.community-sidebar-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.community-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.community-sidebar-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.community-sidebar-footer {
  height: 65px;
  min-height: 65px;
  max-height: 65px;
  padding: 8px 14px;
  border-top: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 3px;
  margin-top: auto;
  box-sizing: border-box;
}

.community-sidebar-brand-quote {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.25;
  font-style: normal;
  text-align: center;
  opacity: 0.88;
}

.community-sidebar-brand-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1;
}

.community-sidebar-brand-by strong {
  color: var(--text-primary);
  font-weight: 600;
}

.community-rooms-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-room-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.community-room-tile.unlocked:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.community-room-tile.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: none;
}

.community-room-tile.locked {
  opacity: 0.75;
  cursor: pointer;
}

.community-room-tile.locked:hover {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.community-room-tile.locked.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: none;
}

.room-tile-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.room-tile-details {
  flex: 1;
  min-width: 0;
}

.room-tile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.room-tile-name {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.room-lock-icon {
  font-size: var(--fs-sm);
  opacity: 0.70;
  flex-shrink: 0;
  margin-left: auto;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.room-visibility-tag {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  vertical-align: middle;
}

.room-visibility-tag.tag-public {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.room-visibility-tag.tag-private {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.room-tile-subline {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.25;
  text-transform: none;
}

.room-tile-aum-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-profit);
  background: var(--color-profit-bg);
  border: 1px solid var(--color-profit-glow);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.room-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-sm);
  margin-top: 5px;
}

.room-tile-snippet {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xs);
}

.room-tile-snippet strong {
  color: var(--text-secondary);
}

.room-tile-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* User Avatar Discs (WhatsApp-style community member presence) */
.room-member-avatars {
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.avatar-disc {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  margin-left: -6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
}

.avatar-disc:first-child {
  margin-left: 0;
}

.disc-mod, .avatar-disc.disc-mod, .avatar-coin.disc-mod {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
  color: #fff !important;
  border-color: rgba(99, 102, 241, 0.6) !important;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1;
}

.disc-gold, .avatar-disc.disc-gold, .avatar-coin.disc-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #fff !important;
}

.disc-emerald, .avatar-disc.disc-emerald, .avatar-coin.disc-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
}

.disc-cyan, .avatar-disc.disc-cyan, .avatar-coin.disc-cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%) !important;
  color: #fff !important;
}

.disc-purple, .avatar-disc.disc-purple, .avatar-coin.disc-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
  color: #fff !important;
}

.disc-rose, .avatar-disc.disc-rose, .avatar-coin.disc-rose {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
  color: #fff !important;
}

.disc-blue, .avatar-disc.disc-blue, .avatar-coin.disc-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  color: #fff !important;
}

.disc-amber, .avatar-disc.disc-amber, .avatar-coin.disc-amber {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #fff !important;
}

/* WhatsApp-style Unread Message & Mention Counter Discs */
.room-unread-disc {
  background: var(--color-profit);
  color: #052e16;
  font-size: var(--fs-xs);
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--color-profit-glow);
  line-height: 1;
}

.room-mention-disc {
  background: var(--color-profit);
  color: #052e16;
  font-size: var(--fs-xs);
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--color-profit-glow);
  line-height: 1;
}

/* Chat Tab Header Unread Badge */
.chat-tab-badge {
  background: var(--color-profit);
  color: #052e16;
  font-size: var(--fs-xs);
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  box-shadow: 0 0 10px var(--color-profit-glow);
  animation: pulseBadge 2s infinite ease-in-out;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.room-status-unlocked {
  color: var(--color-profit);
  font-weight: 600;
}

.room-status-locked {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.community-chat-main {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.community-chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  position: relative;
  z-index: 10;
}

.chat-room-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-room-info h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Marc Lou Style Channel Subtitle (public · overlapping coin avatar discs · +34) */
.chat-room-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: var(--fs-sm);
  line-height: 1;
}

.chat-room-visibility {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.chat-room-member-coins {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.chat-room-member-coins .avatar-coin {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 1.5px solid #0f172a;
  margin-left: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, z-index 0.15s ease;
  text-transform: uppercase;
}

.chat-room-member-coins .avatar-coin:first-child {
  margin-left: 0;
}

.chat-room-member-coins .avatar-coin:hover {
  transform: translateY(-2px) scale(1.1);
  z-index: 5;
}

.chat-room-member-count {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: 4px;
}

/* Marc Lou Style Header Far-Right Actions (...) */
.chat-header-actions-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-channel-more-options {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-muted);
  font-size: var(--fs-h2);
  font-weight: 900;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-channel-more-options:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.channel-options-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  padding: 6px;
  min-width: 190px;
  z-index: 50;
}

.channel-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary, #94a3b8);
  font-size: var(--fs-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.channel-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.channel-dropdown-item .dropdown-item-icon {
  font-size: var(--fs-body);
}

.community-messages-stream-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.community-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
  background: transparent;
}

/* Sponsored Chat Channel Background Image */
.chat-background-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-position: center top;
  background-repeat: repeat;
  background-size: 140px 140px;
  filter: grayscale(100%) sepia(20%) hue-rotate(185deg) brightness(0.85);
  mix-blend-mode: luminosity;
  opacity: 0.16;
  transition: opacity 0.3s ease;
}

.chat-welcome-card {
  position: relative;
  z-index: 2;
}

.chat-locked-channel-teaser {
  margin: 40px auto;
  max-width: 480px;
  padding: 28px 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 2;
}
.locked-teaser-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.locked-teaser-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin-bottom: 8px;
}
.locked-teaser-desc {
  font-size: var(--fs-body);
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  margin-bottom: 12px;
}
.locked-teaser-note {
  font-size: var(--fs-md);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  line-height: 1.45;
}

/* Pinned & Sponsored Channel Banner (Marc Lou Style 2-Line Takeover Bar) */
.chat-pinned-banner {
  background: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
}

/* Far Left: Square Logo Element spanning two lines height */
.chat-pinned-logo-box {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.chat-pinned-logo-box:hover {
  border-color: #38bdf8;
}

.chat-pinned-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Middle: 2 Lines of Content */
.chat-pinned-text-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
}

.chat-pinned-line-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.35;
}

.chat-pinned-bold-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.chat-pinned-bold-title:hover {
  color: #38bdf8;
}

.chat-pinned-ext-link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.35;
  transition: all 0.15s ease;
}

.chat-pinned-ext-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.chat-pinned-line-bot {
  min-width: 0;
  width: 100%;
  line-height: 1.35;
}

.chat-pinned-desc {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
  line-height: 1.35;
}

.chat-pinned-outbid-wrap {
  flex-shrink: 0;
}

/* Rectangular Outbid / Advertise Button (unified 32px height) */
.btn-chat-outbid-rect {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.90);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-weight: 700;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-chat-outbid-rect:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #6ee7b7;
  transform: translateY(-1px);
}

.btn-chat-outbid-rect.btn-chat-outbid-rect--owner {
  background: rgba(30, 58, 138, 0.40);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #93c5fd;
}

.btn-chat-outbid-rect.btn-chat-outbid-rect--owner:hover {
  background: rgba(37, 99, 235, 0.35);
  border-color: #bfdbfe;
  color: #ffffff;
}

/* Responsive iPhone & Mobile adjustments for Pinned Banner */
@media (max-width: 640px) {
  .chat-pinned-banner {
    padding: 6px 8px;
    gap: 6px;
    min-height: 44px;
  }

  .chat-pinned-logo-box {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 6px;
  }

  .chat-pinned-bold-title {
    font-size: var(--fs-sm);
    line-height: 1.3;
  }

  /* On mobile screens, hide the word 'Visit' and keep only the ↗ arrow so title has full width */
  .chat-pinned-ext-link .ext-link-label {
    display: none;
  }

  .chat-pinned-ext-link {
    font-size: var(--fs-md);
    padding: 0 2px;
  }

  .chat-pinned-desc {
    font-size: var(--fs-xs);
    line-height: 1.3;
  }

  .btn-chat-outbid-rect {
    height: 32px;
    padding: 0 10px;
    font-size: var(--fs-xs);
    border-radius: 6px;
  }
}

.chat-welcome-card {
  text-align: center;
  padding: 40px 20px;
  margin: auto;
  max-width: 480px;
  position: relative;
  z-index: 2;
}

.chat-welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.chat-welcome-card h4 {
  margin: 0 0 6px 0;
  font-size: var(--fs-h3);
  font-weight: 700;
}

.chat-welcome-card p {
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.5;
  margin: 0;
}

.chat-messages-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.chat-messages-container > * {
  pointer-events: auto;
}

.chat-message-bubble {
  max-width: 78%;
  min-width: 220px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  z-index: 3;
}

.chat-message-bubble.msg-peer {
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  align-self: flex-start;
}

.chat-message-bubble.msg-self {
  background: rgba(30, 27, 75, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(129, 140, 248, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  align-self: flex-end;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: var(--fs-sm);
  flex-wrap: nowrap;
  min-width: 0;
}

.msg-author {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.msg-tier-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #c7d2fe;
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 4px;
  line-height: 1;
}

.msg-footer .msg-time {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.85;
}

.msg-text {
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.chat-lock-bubble .msg-text {
  white-space: normal;
}

.msg-text strong {
  font-weight: 700;
  color: #ffffff;
}

.chat-inline-link {
  color: var(--accent-primary, #10b981);
  text-decoration: underline;
}

.community-composer-wrap {
  padding: 12px 16px;
  border-top: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.01);
  box-sizing: border-box;
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-bottom: 8px;
  max-width: 100%;
}

.attachment-preview-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--fs-h2);
}

.attachment-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.attachment-preview-name {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-preview-size {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.btn-remove-attachment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-attachment:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.community-composer-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.btn-chat-attach {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-chat-attach:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.btn-chat-attach:active {
  transform: scale(0.95);
}

.community-composer-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-overflow: ellipsis;
}

.community-composer-input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-send-message {
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-send-message:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-send-message:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Chat Attachment Display Inside Messages */
.chat-msg-attachment {
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
}

.chat-msg-image-wrap {
  max-width: 340px;
  max-height: 320px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.chat-msg-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-msg-image:hover {
  transform: scale(1.02);
}

.chat-msg-file-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  max-width: 100%;
  transition: all 0.2s ease;
}

.chat-msg-file-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.chat-file-icon {
  font-size: var(--fs-h2);
  flex-shrink: 0;
}

.chat-file-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-file-name {
  font-size: var(--fs-md);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #c7d2fe;
}

.chat-file-size {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* =========================================================================
   Chat Header Badges & Ambient Sponsor Pill
   ========================================================================= */
.chat-header-badges-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-sponsor-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.chat-sponsor-pill:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fef08a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.sponsor-pill-dot {
  font-size: var(--fs-xs);
  color: #f59e0b;
  animation: pulseAmber 2s infinite;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.sponsor-pill-info-icon {
  font-size: var(--fs-xs);
  opacity: 0.8;
  margin-left: 2px;
}

/* User dropdown item for sponsorship link */
.user-sponsorship-link {
  color: #fbbf24 !important;
  font-weight: 600;
}

.user-sponsorship-link svg {
  color: #f59e0b;
}

.user-sponsorship-link:hover {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fef08a !important;
}

/* =========================================================================
   Sponsorship & Paid Content Spaces Modal Portal
   ========================================================================= */
.sponsorship-modal {
  width: 860px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.sponsorship-modal-header {
  padding: 20px 26px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.4) 0%, rgba(13, 19, 31, 0.6) 100%);
}

.sponsorship-modal-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.eyebrow-pill {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-family: var(--font-mono);
}

.eyebrow-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-family: var(--font-mono);
}

.sponsorship-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 26px;
}

.sponsorship-tabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.sponsorship-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 8px;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sponsorship-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.sponsorship-tab-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.sponsorship-intro-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.sponsorship-intro-text {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

.sponsorship-intro-text strong {
  color: #fbbf24;
}

.btn-sponsorship-action {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
  border: none;
  font-weight: 700;
  font-size: var(--fs-md);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-sponsorship-action:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Grouped Sponsorship Option Sections */
.sponsorship-type-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.sponsorship-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sponsorship-type-header .type-icon {
  font-size: var(--fs-h2);
}

.sponsorship-type-header .type-header-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.sponsorship-type-header .type-title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.sponsorship-type-header .type-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.sponsorship-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* Grid of Spaces */
.sponsorship-spaces-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sponsorship-space-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.sponsorship-space-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.space-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.space-card-channel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.space-room-icon {
  font-size: 1.4rem;
}

.space-room-name {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
}

.space-audience-tier {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.space-type-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.badge-type-bg {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-type-pinned {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.space-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.space-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  flex-wrap: wrap;
  gap: 6px;
}

.space-status-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.status-avail-now {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.status-active-sponsor {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.space-next-avail {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.space-next-avail.avail-instant {
  color: #4ade80;
  font-weight: 600;
}

.space-pricing-matrix {
  display: flex;
  gap: 8px;
}

.price-tier-box {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-tier-box.featured {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.tier-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.tier-price {
  font-size: var(--fs-body);
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.price-tier-box.featured .tier-price {
  color: #fbbf24;
}

.space-reqs-snippet {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.35;
}

.req-title {
  color: var(--text-secondary);
  font-weight: 600;
}

.space-card-footer {
  margin-top: auto;
  padding-top: 6px;
}

.btn-select-space {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 7px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-select-space:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

/* Reservation Form */
.sponsorship-reserve-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sponsorship-form-row {
  display: flex;
  gap: 14px;
}

.sponsorship-form-row > div {
  flex: 1;
}

.sponsorship-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sponsorship-field-group label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.sponsorship-input,
.sponsorship-textarea,
.sponsorship-input-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  padding: 8px 12px;
  outline: none;
  transition: all 0.2s ease;
}

.sponsorship-input:focus,
.sponsorship-textarea:focus,
.sponsorship-input-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.field-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

.sponsorship-logo-upload-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sponsorship-logo-upload-wrap .sponsorship-input {
  flex: 1;
}

.btn-sponsorship-browse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  height: 38px;
  box-sizing: border-box;
}

.btn-sponsorship-browse:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  color: #fff;
  transform: translateY(-1px);
}

.upload-progress-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: #38bdf8;
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* Live Sandbox Preview Stage */
.sponsorship-preview-wrapper {
  margin-top: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: #090d16;
}

.sponsorship-preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fbbf24;
}

.preview-space-badge {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sponsorship-preview-stage {
  position: relative;
  min-height: 220px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.preview-background-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-position: center top;
  background-repeat: repeat;
  background-size: 140px 140px;
  filter: grayscale(100%) sepia(20%) hue-rotate(185deg) brightness(0.85);
  mix-blend-mode: luminosity;
  opacity: 0.16;
}

.preview-pinned-banner {
  position: relative;
  z-index: 1;
  border-radius: 8px;
}

.preview-sample-bubbles {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-msg-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.preview-msg-bubble.incoming {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.preview-msg-bubble.outgoing {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #fff;
}

.preview-msg-author {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 2px;
}

.sponsorship-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}

.sponsorship-price-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.price-val {
  font-size: var(--fs-h2);
  font-weight: 800;
  color: #fbbf24;
  font-family: var(--font-mono);
}

.price-note {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.btn-confirm-sponsorship {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
  border: none;
  font-weight: 700;
  font-size: var(--fs-body);
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-confirm-sponsorship:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

/* Guidelines Box */
.sponsorship-guidelines-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sponsorship-guidelines-box h4 {
  margin: 0;
  font-size: var(--fs-h3);
  color: #fbbf24;
}

.sponsorship-guidelines-box p {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: 1.45;
}

.guideline-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.guideline-card h5 {
  margin: 0 0 8px 0;
  font-size: var(--fs-body);
  font-weight: 700;
}

.guideline-card ul {
  margin: 0;
  padding-left: 20px;
  font-size: var(--fs-md);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guideline-card.warning-card {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.25);
}

.guideline-card.warning-card h5 {
  color: #ef4444;
}

.guideline-card.policy-card {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guideline-card.policy-card h5 {
  color: #a5b4fc;
}

/* =========================================================================
   Ambient Background Click Layer & Floating Hover Story Card
   ========================================================================= */
.chat-ambient-click-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
  z-index: 1;
  cursor: pointer;
}

/* Floating Rectangular Green Outbid Button for Chat Background Image (Placed directly above Send Button, along emoji row) */
.chat-bg-outbid-btn {
  position: absolute;
  bottom: 14px;
  right: 16px;
  z-index: 15;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-weight: 700;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.15s ease;
}

.chat-bg-outbid-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #6ee7b7;
  transform: translateY(-1px);
}

/* Floating Jump to Top & Recent Messages Stack — Native Chat Conversation Styling */
.chat-scroll-nav-stack {
  position: absolute;
  bottom: 56px;
  right: 18px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.chat-scroll-nav-stack .chat-scroll-bottom-btn {
  position: relative;
  bottom: auto;
  right: auto;
  pointer-events: auto;
}

.chat-scroll-nav-stack .chat-scroll-top-btn:hover .scroll-bottom-icon {
  transform: translateY(-1.5px);
}

/* Trades Table Frame & In-Frame Scroll Navigation Stack (Parity with Chat Frame) */
.trades-table-frame {
  position: relative;
  width: 100%;
}

.trades-scroll-nav-stack {
  position: absolute;
  bottom: 22px;
  right: 22px;
  z-index: 35;
}

.chat-scroll-bottom-btn {
  position: absolute;
  bottom: 56px;
  right: 18px;
  z-index: 25;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-scroll-bottom-btn:hover {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(255, 255, 255, 0.08);
}

.chat-scroll-bottom-btn:active {
  transform: translateY(0) scale(0.96);
  background: rgba(15, 23, 42, 0.98);
}

.chat-scroll-bottom-btn .scroll-bottom-icon {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.chat-scroll-bottom-btn:hover .scroll-bottom-icon {
  transform: translateY(1.5px);
}

.chat-scroll-bottom-btn .scroll-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f172a;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

/* Floating Jump-to-Top & Jump-to-Bottom Stack for Long Pages (Options & Alerts) */
.page-scroll-nav {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.page-scroll-nav .page-scroll-btn {
  position: relative;
  bottom: auto;
  right: auto;
  pointer-events: auto;
}

.page-scroll-nav .page-scroll-top-btn:hover .scroll-bottom-icon {
  transform: translateY(-1.5px);
}

.page-scroll-nav .page-scroll-bottom-btn:hover .scroll-bottom-icon {
  transform: translateY(1.5px);
}

/* Floating Background Image Ad Card (Identical structure and contents to Pinned Channel Banner) */
.chat-bg-ad-card {
  position: absolute;
  bottom: 56px;
  left: 14px;
  right: 14px;
  width: calc(100% - 28px);
  max-width: 640px;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(16, 185, 129, 0.15);
  z-index: 25;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 12px;
  padding-right: 32px;
  box-sizing: border-box;
}

.chat-bg-ad-card .bg-ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  z-index: 2;
}

.chat-bg-ad-card .bg-ad-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .chat-bg-outbid-btn {
    bottom: 10px;
    right: 12px;
    height: 32px;
    padding: 0 10px;
    font-size: var(--fs-xs);
  }

  .chat-scroll-nav-stack {
    bottom: 50px;
    right: 14px;
    gap: 6px;
  }

  .trades-scroll-nav-stack {
    bottom: 18px;
    right: 14px;
  }

  .chat-scroll-nav-stack .chat-scroll-bottom-btn {
    bottom: auto;
    right: auto;
    width: 36px;
    height: 36px;
  }

  .chat-scroll-bottom-btn {
    bottom: 48px;
    right: 14px;
    width: 36px;
    height: 36px;
  }

  .page-scroll-nav {
    bottom: 18px;
    right: 14px;
    gap: 8px;
  }

  .page-scroll-nav .page-scroll-btn {
    bottom: auto;
    right: auto;
  }

  .chat-bg-ad-card {
    left: 8px;
    right: 8px;
    bottom: 48px;
    width: calc(100% - 16px);
    padding: 6px 8px;
    padding-right: 26px;
  }
}

.ambient-hover-text-wrap {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.15s ease;
}

.ambient-hover-text-wrap:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.ambient-hover-text-wrap:active {
  transform: scale(0.99);
}

.ambient-hover-sponsor-name {
  font-size: var(--fs-body);
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.ambient-hover-text-wrap:hover .ambient-hover-sponsor-name {
  color: #38bdf8;
}

.ambient-hover-body {
  font-size: var(--fs-sm);
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

/* Space Traffic Metrics in Portal */
.space-traffic-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  color: #bae6fd;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.space-traffic-metric .traffic-count {
  font-weight: 800;
  color: #38bdf8;
}

.space-traffic-metric .traffic-tag {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.space-url-snippet {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
  color: #38bdf8;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}

/* ==========================================================================
   ChatAUM Enhancements: Grouping, Date Dividers, Replies, Reactions, Outbid
   ========================================================================== */

/* 1. Consecutive Message Grouping */
.chat-message-bubble.grouped {
  margin-top: -6px;
  border-top-left-radius: 4px;
}
.chat-message-bubble.msg-self.grouped {
  border-top-right-radius: 4px;
}

/* 2. Date Dividers */
.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 10px 0;
  position: relative;
  z-index: 2;
}
.chat-date-divider-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 3. In-Bubble Quote / Reply Block */
.chat-quote-block {
  border-left: 3px solid #818cf8;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 6px 6px 0;
  padding: 5px 10px;
  margin-bottom: 8px;
  font-size: var(--fs-sm);
}
.chat-quote-author {
  font-weight: 700;
  color: #a5b4fc;
  display: block;
  margin-bottom: 2px;
}
.chat-quote-snippet {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* 4. Hover Actions on Message Bubbles */
.chat-msg-actions {
  position: absolute;
  top: -12px;
  right: 12px;
  display: none;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
  gap: 4px;
}
.chat-message-bubble:hover .chat-msg-actions,
.chat-message-bubble.active-actions .chat-msg-actions {
  display: flex;
}
.btn-msg-action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--fs-md);
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s, transform 0.1s;
}
.btn-msg-action:hover {
  color: #fff;
  transform: scale(1.15);
}
.btn-msg-share-x {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 1px 6px;
  border-radius: 4px;
}
.btn-msg-share-x:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.btn-msg-share-x.is-mod-action {
  color: #818cf8;
}
.btn-msg-share-x.is-mod-action:hover {
  color: #fff;
  background: rgba(99, 102, 241, 0.3);
}

/* 5. Emoji Reactions Row Below Bubble */
.chat-reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.chat-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.chat-reaction-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.chat-reaction-pill.has-reacted {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(129, 140, 248, 0.6);
  color: #c7d2fe;
}

/* 6. Composer Reply Bar */
.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.14);
  border-left: 3px solid #6366f1;
  border-radius: 0 6px 6px 0;
  padding: 6px 12px;
  margin-bottom: 8px;
  font-size: var(--fs-md);
}
.chat-reply-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-bar-icon {
  color: #818cf8;
  font-weight: bold;
}
.chat-reply-bar-text {
  color: var(--text-muted);
}
.btn-cancel-reply {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--fs-md);
  padding: 2px 6px;
}
.btn-cancel-reply:hover {
  color: #ef4444;
}

/* 7. Real-Time Typing Indicator */
.chat-typing-indicator {
  padding: 4px 18px 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-style: italic;
  position: relative;
  z-index: 3;
}
.typing-bubble-dots {
  display: inline-flex;
  gap: 3px;
}
.typing-bubble-dots span {
  width: 4px;
  height: 4px;
  background: #a5b4fc;
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out;
}
.typing-bubble-dots span:nth-child(1) { animation-delay: 0s; }
.typing-bubble-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* 8. Pinned Banner Outbid Button (Financial Achievement Green, dark-glass empty background) */
button.btn-chat-outbid {
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(15, 23, 42, 0.90);
  color: #34d399;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}
button.btn-chat-outbid:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #6ee7b7;
  transform: translateY(-1px);
}
/* ==========================================================================
   Chat Outbid Modal (Sponsor Ad Space Takeover)
   ========================================================================== */
.chat-outbid-modal {
  width: 520px;
  max-width: 96vw;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  margin: auto;
}

/* Header */
.ob-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.ob-header-text { min-width: 0; }
.ob-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}
.ob-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.ob-sep { color: #475569; }
.ob-title {
  margin: 6px 0 2px;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-subtitle {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.35;
  color: #94a3b8;
}
.ob-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: var(--fs-body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ob-close:hover { background: rgba(255, 255, 255, 0.06); color: #f8fafc; }

/* Form layout: scrollable body + fixed footer */
.ob-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.ob-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ob-section { display: flex; flex-direction: column; gap: 8px; }
.ob-section-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.chat-outbid-modal,
.chat-outbid-modal input,
.chat-outbid-modal textarea,
.chat-outbid-modal button,
.chat-outbid-modal label {
  font-family: var(--font-sans);
}

/* Live preview (mirrors the pinned banner atop the tiled chat background) */
.ob-preview {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.10);
  min-height: 74px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: min-height 0.2s ease, border-color 0.2s ease;
}
.ob-preview.is-bg-mode {
  min-height: 96px;
  cursor: pointer;
}
.ob-preview.is-bg-mode:hover {
  border-color: rgba(56, 189, 248, 0.35);
}
.ob-preview-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-repeat: repeat;
  background-position: center top;
  background-size: 72px 72px;
  filter: grayscale(100%) sepia(20%) hue-rotate(185deg) brightness(0.85);
  mix-blend-mode: luminosity;
  opacity: 0.18;
  z-index: 0;
  transition: opacity 0.25s ease;
}
.ob-preview-tap-hint {
  position: relative;
  z-index: 2;
  pointer-events: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(13, 19, 31, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: all 0.2s ease;
}
.ob-preview-card {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(13, 19, 31, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ob-preview-logo {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}
.ob-preview-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ob-preview-line1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.ob-preview-title,
.ob-preview-body {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ob-preview-title { font-size: var(--fs-md); font-weight: 700; color: #f8fafc; }
.ob-preview-link { font-size: var(--fs-xs); font-weight: 600; color: #38bdf8; flex-shrink: 0; }
.ob-preview-body { font-size: var(--fs-sm); color: #94a3b8; }

/* Fields */
.ob-fields { gap: 12px; }
.ob-field { display: flex; flex-direction: column; gap: 5px; }
.ob-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.ob-label { font-size: var(--fs-md); font-weight: 600; color: #cbd5e1; letter-spacing: -0.01em; }
.ob-count { font-size: var(--fs-xs); color: #64748b; font-variant-numeric: tabular-nums; }
.ob-hint { font-size: var(--fs-xs); color: #64748b; line-height: 1.35; }
.ob-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.35;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ob-input::placeholder { color: #475569; }
.ob-input:focus {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.ob-textarea { resize: none; min-height: 52px; }

/* Logo upload row */
.ob-logo-row { display: flex; align-items: center; gap: 12px; }
.ob-logo-tile {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease;
}
.ob-logo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ob-logo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.ob-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease;
}
.ob-logo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ob-logo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  font-size: var(--fs-xs);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.ob-logo-tile:hover { border-color: #38bdf8; }
.ob-logo-tile:hover .ob-logo-overlay { opacity: 1; }
.ob-logo-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ob-upload-btn {
  font-size: var(--fs-md);
  font-weight: 600;
  color: #38bdf8;
  cursor: pointer;
}
.ob-upload-btn:hover { text-decoration: underline; }

/* Price */
.ob-price {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ob-price-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-price-cell--ask { align-items: flex-end; text-align: right; }
.ob-price-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.ob-price-val {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: #cbd5e1;
}
.ob-price-val--ask { font-size: var(--fs-h2); color: #34d399; }
.ob-price-holder {
  font-size: var(--fs-xs);
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ob-price-arrow { color: #475569; font-size: var(--fs-h3); }
.ob-ladder { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: #64748b; }

/* Footer */
.ob-footer {
  flex-shrink: 0;
  padding: 14px 22px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #0d131f;
}
.ob-actions { display: flex; gap: 10px; }
.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.ob-btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}
.ob-btn--ghost:hover { background: rgba(255, 255, 255, 0.05); }
.ob-btn--primary {
  flex: 1;
  border: none;
  background: #10b981;
  color: #04120c;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}
.ob-btn--primary:hover:not(:disabled) { background: #34d399; transform: translateY(-1px); }
.ob-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.ob-legal {
  margin: 10px 0 0;
  text-align: center;
  font-size: var(--fs-sm);
  color: #64748b;
}
.ob-legal a {
  color: #cbd5e1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ob-legal a:hover { color: #f8fafc; }

/* Visually Hidden Utility for Accessible File Inputs */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

/* Mobile */
@media (max-width: 640px) {
  .chat-outbid-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 14px;
  }
  .ob-header { padding: 12px 14px 10px; }
  .ob-title { font-size: var(--fs-h3); }
  .ob-subtitle { font-size: var(--fs-sm); }
  .ob-body { padding: 12px 14px; gap: 12px; }
  .ob-footer { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .ob-preview { padding: 8px 10px; }
  .ob-input {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    padding: 8px 10px;
    line-height: 1.35;
  }
  .ob-price { padding: 10px 12px; }
  .ob-price-val--ask { font-size: var(--fs-h2); }
}

/* =========================================================================
   IDEA-24: Owner Direct Edit & Unified Sponsorship Hub Styles
   ========================================================================= */
.btn-chat-owner-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 6px;
  text-decoration: none;
}
.btn-chat-owner-edit:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #93c5fd;
  color: #fff;
}
.chat-bg-owner-edit-btn {
  position: absolute;
  bottom: 84px;
  right: 140px;
  z-index: 25;
  height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
/* =========================================================================
   IDEA-40: ShipFast-Style Single-Screen User Portal Modal (Desktop + iPhone 15)
   ========================================================================= */
.user-portal-modal {
  width: 92% !important;
  max-width: 500px !important;
  max-height: calc(100dvh - 32px) !important;
  background: #0d121d !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.78) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}
.up-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.up-title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.up-body {
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.up-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.up-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.up-section-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.up-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.up-count-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* 1. Account & Billing Card */
.up-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.up-account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.up-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: var(--fs-body);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.up-account-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.up-account-handle {
  font-size: var(--fs-body);
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-account-email {
  font-size: var(--fs-sm);
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Unified Portal Buttons */
.up-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.up-btn--billing {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}
.up-btn--billing:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.up-btn--billing.is-inactive {
  opacity: 0.68;
  color: #94a3b8;
  border-style: dashed;
}
.up-btn--cta {
  background: #10b981;
  border: 1px solid #059669;
  color: #04120c;
  font-weight: 700;
  height: 38px;
  padding: 0 18px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.22);
}
.up-btn--cta:hover {
  background: #34d399;
  color: #022c22;
  transform: translateY(-1px);
}
.up-btn--edit {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  height: 32px;
  padding: 0 12px;
}
.up-btn--edit:hover {
  background: rgba(59, 130, 246, 0.32);
  color: #fff;
}
.up-btn--takeover {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #4ade80;
  height: 32px;
  padding: 0 12px;
}
.up-btn--takeover:hover {
  background: rgba(34, 197, 94, 0.32);
  color: #fff;
}

/* 2. Sponsorships & Bids Cards */
.up-campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.up-loading-state {
  padding: 20px;
  text-align: center;
  font-size: var(--fs-md);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.up-empty-card {
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.up-empty-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.up-empty-text {
  font-size: var(--fs-md);
  color: #94a3b8;
  line-height: 1.45;
  max-width: 380px;
  margin-bottom: 4px;
}
.up-empty-pitch {
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.up-empty-pitch .up-empty-text {
  max-width: 100%;
  margin-bottom: 0;
  font-size: var(--fs-sm);
}
.up-spaces-catalog {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.up-space-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.up-space-row:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}
.up-space-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.up-campaign-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.up-campaign-card.is-live {
  border-color: rgba(34, 197, 94, 0.38);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, rgba(255, 255, 255, 0.025) 100%);
}
.up-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.up-card-channel {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: var(--fs-sm);
  color: #cbd5e1;
}
.up-room-name {
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-space-sep {
  color: #64748b;
}
.up-space-type {
  color: #94a3b8;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.up-status-pill {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.up-status-pill.status-live {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.up-status-pill.status-auction {
  background: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}
.up-status-pill.status-outbid {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.up-card-creative {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.up-card-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.up-card-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.up-card-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-card-domain {
  font-size: var(--fs-xs);
  color: #818cf8;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-card-domain:hover {
  text-decoration: underline;
}
.up-card-desc {
  font-size: var(--fs-xs);
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.up-card-telemetry {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #94a3b8;
  min-width: 0;
  line-height: 1.35;
}

/* Mobile-First Responsive Fit for iPhone 15 (393 x 852 px) */
@media (max-width: 640px) {
  .user-portal-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 14px !important;
  }
  .up-header {
    padding: 13px 15px;
  }
  .up-body {
    padding: 14px 15px calc(14px + env(safe-area-inset-bottom));
    gap: 16px;
  }
  .up-account-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .up-account-card .up-btn {
    width: 100%;
    height: 38px;
  }
  .up-card-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .up-card-action,
  .up-card-action .up-btn,
  .up-empty-card .up-btn--cta {
    width: 100%;
    height: 38px;
  }
  .up-space-row .up-card-action,
  .up-space-row .up-card-action .up-btn {
    width: auto;
    height: 32px;
  }
}

/* =========================================================================
   TA 3-Author Switchboard & Consensus Engine (PT / Gemini / Grok — IDEA-45)
   ========================================================================= */
.ta-author-switchboard {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(30, 41, 59, 0.40);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  width: 100%;
}

.ta-author-tab {
  flex: 1;
  min-height: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  background: rgba(30, 41, 59, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.ta-author-tab:hover {
  background: rgba(51, 65, 85, 0.70);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.ta-author-tab.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.60);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.ta-author-cta-card {
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 16px 18px;
  background: rgba(30, 41, 59, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  margin: 0;
}

.ta-author-cta-title {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px 0;
  text-align: left;
}

.ta-author-cta-desc {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  line-height: 1.5;
  color: #cbd5e1;
  margin: 0;
  text-align: left;
}

.ta-author-cta-btn-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.btn-ta-author-ask {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  height: 38px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  margin: 0 auto;
}

.btn-ta-author-ask:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}

.btn-ta-author-ask:active {
  transform: scale(0.98);
}

.ta-author-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin: 0;
  background: rgba(30, 41, 59, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  font-size: var(--fs-ta-header, 0.78rem);
  color: #94a3b8;
}

.btn-ta-author-regen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: var(--fs-ta-header, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ta-author-regen:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text-primary);
}

/* ---------- TA Modal Typography & Card System (CAP-UX-03 Summary 2-Token Standard) ---------- */
.chart-modal {
  --fs-ta-row: 0.92rem;
  --fs-ta-header: 0.78rem;
}

.chart-modal #chartLegend.chart-legend-custom {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 14px;
  width: 100%;
}

.chart-modal .modal-title-group {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
}

.chart-modal #chartModalTitle {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 24px !important;
  flex: 1 1 auto !important;
}

.chart-modal .modal-symbol-text {
  color: #f8fafc;
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 24px;
}

.chart-modal .modal-desc-inline {
  color: #94a3b8;
  font-size: var(--fs-md);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  line-height: 24px;
}

.chart-modal #chartModalSubtitle {
  display: none !important;
}

.chart-modal .modal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chart-modal .btn-chart-share {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.30);
  color: var(--accent-hover);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.chart-modal .btn-chart-share svg {
  width: 11px;
  height: 11px;
}

.chart-modal .btn-chart-help {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #10b981;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  box-sizing: border-box;
}

.chart-modal .btn-chart-help:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

.chart-modal .btn-chart-help svg {
  width: 11px;
  height: 11px;
}

.chart-modal .etrade-modal-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  font-size: var(--fs-sm);
  line-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  box-sizing: border-box;
}

.ta-analysis-block {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  position: relative;
}

.ta-analysis-block .summary-status {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  font-weight: 700;
  color: #f1f5f9;
  text-align: left;
  margin-bottom: 0;
}

.ta-analysis-block .summary-status .status-dot {
  display: none !important;
}

.ta-summary-body {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  line-height: 1.55;
  color: #cbd5e1; /* Slate-300 soft off-white, 85% luminance */
  margin: 10px 0 14px 0;
}

.ta-setup-card,
.ta-strategy-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 41, 59, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  margin: 0;
}

.ta-setup-row {
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 12px;
}

.ta-setup-row:last-child {
  margin-bottom: 0;
}

.ta-setup-tag,
.ta-strategy-header {
  font-family: var(--font-sans);
  font-weight: 600;
  color: #94a3b8; /* Slate-400 crisp uppercase */
  font-size: var(--fs-ta-header, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
  text-align: left;
}

.ta-strategy-header svg {
  display: none !important;
}

.ta-setup-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-ta-row, 0.92rem);
  line-height: 1.4;
}

.ta-setup-val.entry {
  color: var(--text-primary); /* White (#f1f5f9) matching chart spot price */
}

.ta-setup-val.exit {
  color: var(--color-loss);
}

.ta-setup-val.neutral {
  color: var(--text-primary);
}

.ta-setup-desc {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  color: #cbd5e1; /* Slate-300 soft off-white */
  line-height: 1.5;
  margin-top: 4px;
}

.ta-strategy-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ta-strategy-row {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  color: #cbd5e1; /* Slate-300 soft off-white */
  line-height: 1.5;
}

.ta-strategy-row strong {
  color: #f1f5f9;
  font-weight: 600;
}

/* TA Visualizer Mobile Ergonomics */
.hedge-visualizer-xy {
  position: relative;
  padding: 15px 45px 25px 45px;
  background: rgba(0, 0, 0, 0.2); /* Translucent canvas matching .chart-main & .chart-sub */
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  box-shadow: none;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .chart-modal {
    padding: 6px 8px 12px !important;
  }
  .chart-modal .etrade-modal-header {
    padding: 0 0 2px 0 !important;
    margin: 0 0 2px 0 !important;
  }
  .chart-modal #chartModalTitle {
    font-size: var(--fs-body);
    gap: 6px;
    line-height: 22px;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }
  .chart-modal .modal-symbol-text {
    font-size: var(--fs-body);
    line-height: 22px;
  }
  .chart-modal .modal-desc-inline {
    font-size: var(--fs-sm);
    max-width: 130px;
    line-height: 22px;
  }
  .chart-modal .btn-chart-share {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 10px !important;
    font-size: var(--fs-sm) !important;
    line-height: 30px !important;
    border-radius: 6px !important;
  }
  .chart-modal .btn-chart-share svg {
    width: 13px !important;
    height: 13px !important;
  }
  .chart-modal .etrade-modal-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    font-size: var(--fs-body) !important;
    line-height: 30px !important;
    border-radius: 6px !important;
  }
  .hedge-visualizer-xy {
    padding: 12px 8px 24px 34px;
  }
  .btn-ta-guide,
  .btn-ta-refresh {
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    padding: 0 6px;
    font-size: var(--fs-xs);
    line-height: 20px;
  }
}

/* ---------- TA Modal Alerts Section & Report Footer ---------- */
.ta-alerts-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 41, 59, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 14px 16px;
  margin-top: 14px;
}

.ta-alerts-header {
  font-family: var(--font-sans);
  font-weight: 600;
  color: #94a3b8; /* Slate-400 crisp uppercase */
  font-size: var(--fs-ta-header, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: block;
  text-align: left;
}

.ta-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ta-alert-item {
  display: flex;
  flex-direction: column;
}

.ta-alert-order {
  font-family: var(--font-mono), monospace;
  font-weight: 700;
  font-size: var(--fs-ta-row, 0.92rem);
  color: #f1f5f9; /* White text matching chart spot price and entry guidance */
  line-height: 1.4;
  word-break: break-word;
}

.ta-alert-reason {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-row, 0.92rem);
  color: #cbd5e1; /* Slate-300 soft off-white matching .ta-strategy-row */
  line-height: 1.5;
  margin-top: 3px;
}

.ta-report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.40);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

.ta-report-footer-text {
  font-family: var(--font-sans);
  font-size: var(--fs-ta-header, 0.78rem);
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.ta-report-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-ta-guide,
.btn-ta-refresh {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 0 8px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-sizing: border-box;
  text-decoration: none;
}

.btn-ta-guide {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #10b981;
}

.btn-ta-guide:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10b981;
  color: #ffffff;
}

.btn-ta-refresh {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.30);
  color: var(--accent-hover);
}

.btn-ta-refresh:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.50);
  color: #ffffff;
}

.btn-ta-refresh:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-ta-guide svg,
.btn-ta-refresh svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

/* ============================================================
   App Store-Style Public Landing Page (Unauthenticated Gate)
   ============================================================ */
.pt-landing-body {
  background: #0a0e17;
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  min-height: 100vh;
}

.pt-landing-shell {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  padding: 20px 20px 48px;
  box-sizing: border-box;
}

.pt-landing-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pt-landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 8px 0 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.pt-landing-auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pt-landing-btn-login,
.pt-landing-btn-signup {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.pt-landing-btn-login {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
}

.pt-landing-btn-login:hover {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.55);
}

.pt-landing-btn-signup {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #f8fafc;
}

.pt-landing-btn-signup:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
}

.pt-landing-tagline-ticker {
  margin: 0 12px;
  align-items: center;
}

.pt-landing-tagline-track {
  animation-duration: 72s;
  align-items: center;
}

.pt-landing-tagline-item {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-right: 10px;
}

.pt-landing-tagline-sep {
  color: var(--text-muted);
  padding-right: 10px;
}

.pt-landing-hero-centered {
  display: flex;
  justify-content: center;
  padding: 36px 0 28px;
}

.pt-landing-hero-centered .pt-landing-auth-card {
  width: 100%;
  max-width: 400px;
}

.pt-landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
  font-weight: 700;
  font-size: var(--fs-h3);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.pt-landing-logo-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.pt-landing-nav-links {
  display: flex;
  gap: 18px;
}

.pt-landing-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: var(--fs-body);
  font-weight: 500;
}

.pt-landing-nav-link:hover {
  color: #f8fafc;
}

.pt-landing-hero,
.pt-landing-hero.pt-landing-hero-centered {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 36px 0 28px;
}

.pt-landing-hero.pt-landing-hero-centered .pt-landing-auth-card {
  width: 100%;
  max-width: 400px;
  min-width: 0;
  margin: 0 auto;
}

.pt-landing-app-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.pt-landing-app-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.pt-landing-app-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: #818cf8;
  margin-bottom: 6px;
}

.pt-landing-title {
  margin: 0 0 6px;
  font-size: 2rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.pt-landing-subtitle {
  margin: 0;
  font-size: var(--fs-h3);
  line-height: 1.5;
  color: #94a3b8;
}

.pt-landing-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pt-landing-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pt-meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xs);
  color: #64748b;
  letter-spacing: 0.05em;
}

.pt-meta-val {
  font-size: var(--fs-md);
  font-weight: 600;
  color: #cbd5e1;
}

.pt-landing-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100020;
}

.pt-landing-auth-overlay.is-hidden {
  display: none;
}

.pt-landing-auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 26px 24px 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  text-align: center;
  box-sizing: border-box;
  min-width: 0;
}

.pt-landing-sheet-grabber {
  display: none;
}

.pt-landing-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.pt-landing-auth-close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

@keyframes ptSheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pt-auth-heading {
  margin: 0 0 6px;
  font-family: var(--font-sans);
  font-size: var(--fs-auth-title);
  font-weight: 400;
  line-height: 1.333;
  color: #f8fafc;
  text-align: center;
}

#ptEmailStep .pt-auth-heading {
  margin-bottom: 20px;
}

.pt-auth-desc {
  margin: 0 0 20px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.45;
  text-align: center;
}

.pt-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-auth-input);
  line-height: 1.25;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: transform 0.12s ease, background 0.15s ease;
  box-sizing: border-box;
}

.pt-btn-google:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.pt-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #64748b;
  font-size: var(--fs-sm);
}

.pt-auth-divider::before,
.pt-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
}

.pt-magic-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pt-magic-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #0b1120;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: var(--fs-auth-input);
  line-height: 1.25;
  box-sizing: border-box;
}

.pt-magic-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.pt-magic-input:disabled,
.pt-auth-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pt-btn-magic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #6366f1;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-auth-input);
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.pt-btn-magic:hover {
  background: #4f46e5;
}

.pt-btn-magic:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pt-magic-hint {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.45;
  text-align: center;
}

.pt-auth-legal-note {
  margin: 12px 0 0;
  font-size: var(--fs-sm);
  color: #64748b;
  line-height: 1.45;
  text-align: center;
}

.pt-auth-legal-note a {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pt-auth-legal-note a:hover {
  color: #cbd5e1;
}

.pt-otp-gray-box {
  margin: 14px 0 12px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  font-size: var(--fs-auth-meta);
  color: #cbd5e1;
  line-height: 1.45;
  text-align: center;
}

.pt-otp-sent-line {
  margin: 0 0 16px;
  font-size: var(--fs-auth-meta);
  color: #94a3b8;
  line-height: 1.45;
  text-align: center;
}

.pt-otp-label {
  display: block;
  text-align: left;
  font-size: var(--fs-auth-meta);
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: -4px;
}

.pt-otp-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-auth-title);
  letter-spacing: 0.3em;
  text-align: center;
}

.pt-otp-resend-line {
  margin: 14px 0 4px;
  font-size: var(--fs-auth-meta);
  color: #94a3b8;
  text-align: center;
}

.pt-otp-resend-link,
.pt-otp-back-link {
  background: none;
  border: none;
  padding: 0;
  color: #818cf8;
  font-size: var(--fs-auth-meta);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pt-otp-back-line {
  margin: 6px 0 0;
  text-align: center;
}

.pt-otp-back-link {
  color: #64748b;
  font-weight: 500;
  text-decoration: none;
}

.pt-otp-back-link:hover {
  color: #94a3b8;
}

.pt-auth-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: var(--fs-md);
  line-height: 1.4;
}

.pt-auth-alert-success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.pt-auth-alert-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  margin-bottom: 12px;
}

.pt-landing-screenshots,
.pt-landing-whats-new {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pt-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pt-section-header h2 {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 700;
  color: #f8fafc;
}

.pt-section-hint {
  font-size: var(--fs-md);
  color: #64748b;
}

.pt-screenshots-rail {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.pt-screenshot-card {
  margin: 0;
  flex: 0 0 202px;
  scroll-snap-align: start;
  background: #0d1320;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.pt-screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 786 / 1704;
  object-fit: cover;
  object-position: top center;
}

.pt-screenshot-card figcaption {
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: #cbd5e1;
  font-weight: 500;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pt-whats-new-header {
  margin-bottom: 6px;
}

.pt-version-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: var(--fs-md);
  color: #94a3b8;
}

.pt-version-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-md);
  color: #94a3b8;
}

.pt-version-age {
  font-size: var(--fs-md);
  color: #64748b;
}

.pt-whats-new-card {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 16px 20px;
}

.pt-whats-new-lead {
  margin: 0 0 12px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: #f8fafc;
  line-height: 1.5;
}

.pt-whats-new-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--fs-body);
  color: #cbd5e1;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .pt-landing-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 0 20px;
  }
  .pt-landing-title {
    font-size: 1.6rem;
  }
  .pt-landing-app-icon {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }
  .pt-screenshots-rail {
    justify-content: flex-start;
  }
  .pt-screenshot-card {
    flex: 0 0 66vw;
    max-width: 260px;
  }
}
/* Landing Community Chat Teaser Frame (IDEA-222) */
.pt-landing-teaser-section {
  padding: 20px 0 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.pt-teaser-nav-tabs {
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pt-landing-community-teaser {
  height: 520px;
  min-height: 460px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.pt-teaser-room-btn {
  width: 100%;
  text-align: left;
  background: transparent;
}
.pt-teaser-bg-image {
  display: block;
}
.pt-teaser-bg-outbid {
  display: inline-flex;
}
.pt-teaser-mod-disc {
  width: 18px;
  height: 18px;
  font-size: var(--fs-xs);
  margin-right: 2px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .pt-landing-community-teaser {
    height: auto;
    min-height: 0;
  }
  .pt-landing-community-teaser .community-messages-stream-wrap {
    max-height: 360px;
  }
}

@media (max-width: 640px) {
  .pt-landing-shell {
    padding: 16px 14px 40px;
  }
  .pt-landing-nav {
    flex-wrap: nowrap;
    align-items: center;
  }
  .pt-landing-btn-signup {
    display: none;
  }
  .pt-landing-auth-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .pt-landing-auth-card {
    max-width: 100%;
    width: 100%;
    max-height: 85dvh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
    animation: ptSheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .pt-auth-heading {
    font-weight: 700;
  }
  .pt-btn-google,
  .pt-magic-input,
  .pt-btn-magic {
    min-height: 44px;
  }
  .pt-landing-sheet-grabber {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    margin: 0 auto 10px;
  }
}
/* Standalone Scroll Navigation (includes/scroll-nav.php) */
.page-scroll-nav { position: fixed; bottom: 24px; right: 20px; z-index: 900; display: none; flex-direction: column; gap: 10px; pointer-events: none; }
.page-scroll-nav .page-scroll-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; background: rgba(17,24,39,0.94); border: 1px solid rgba(255,255,255,0.16); color: #e2e8f0; box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; pointer-events: auto; transition: all 0.2s cubic-bezier(0.16,1,0.3,1); }
.page-scroll-nav .page-scroll-btn:hover { background: rgba(30,41,59,0.98); border-color: rgba(255,255,255,0.28); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.55), 0 2px 6px rgba(255,255,255,0.08); }
.page-scroll-nav .page-scroll-btn:active { transform: translateY(0) scale(0.96); background: rgba(15,23,42,0.98); }
.page-scroll-nav .scroll-bottom-icon { width: 18px; height: 18px; display: block; stroke: currentColor; flex-shrink: 0; transition: transform 0.15s ease; }
.page-scroll-nav .page-scroll-top-btn:hover .scroll-bottom-icon { transform: translateY(-1.5px); }
.page-scroll-nav .page-scroll-bottom-btn:hover .scroll-bottom-icon { transform: translateY(1.5px); }
@media (max-width: 640px) { .page-scroll-nav { bottom: 18px; right: 14px; gap: 8px; } .page-scroll-nav .page-scroll-btn { width: 36px; height: 36px; } }

/* Shell Layout extracted from index.php (IDEA-188) */
    /* Option B: Natural shell layout with sticky footer */
    html, body {
      min-height: 100vh;
    }
    body {
      display: flex;
      flex-direction: column;
    }
    .main-content {
      flex: 1 0 auto;
      display: flex;
      flex-direction: column;
      min-height: calc(100vh - 76px);
      position: relative;
    }
    .site-footer {
      margin-top: auto !important;
      flex-shrink: 0;
    }


/* Static pre-hydration rules for data-pt-style (IDEA-188) */
[data-pt-style="display: none;"] { display: none; }
[data-pt-style="cursor:pointer; transition: transform 0.2s ease;"] { cursor:pointer; transition: transform 0.2s ease; }
[data-pt-style="color: var(--accent-hover); text-decoration: underline dotted; display: flex; align-items: center; gap: 4px;"] { color: var(--accent-hover); text-decoration: underline dotted; display: flex; align-items: center; gap: 4px; }
[data-pt-style="color: var(--text-muted); text-decoration: underline dotted; display: flex; align-items: center; gap: 4px;"] { color: var(--text-muted); text-decoration: underline dotted; display: flex; align-items: center; gap: 4px; }
[data-pt-style="display: none; padding: 12px 16px;"] { display: none; padding: 12px 16px; }
[data-pt-style="padding: 60px 20px;"] { padding: 60px 20px; }
[data-pt-style="width: 32px; height: 32px; margin: 0 auto 14px; display: block;"] { width: 32px; height: 32px; margin: 0 auto 14px; display: block; }
[data-pt-style="color: var(--text-secondary); font-size: var(--fs-h3); font-weight: 600; margin-bottom: 6px;"] { color: var(--text-secondary); font-size: var(--fs-h3); font-weight: 600; margin-bottom: 6px; }
[data-pt-style="color: var(--text-muted); font-size: var(--fs-md);"] { color: var(--text-muted); font-size: var(--fs-md); }
[data-pt-style="padding: 8px 2px 4px; margin-bottom: 0;"] { padding: 8px 2px 4px; margin-bottom: 0; }
[data-pt-style="margin: 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5;"] { margin: 0; font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; }
[data-pt-style="color: var(--text-secondary); font-weight: 500;"] { color: var(--text-secondary); font-weight: 500; }
[data-pt-style="display: flex; align-items: center; gap: 8px; flex-wrap: wrap;"] { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
[data-pt-style="cursor: pointer; text-decoration: underline dotted; color: var(--accent-hover); display: inline-flex; align-items: center; gap: 4px; font-weight: 500;"] { cursor: pointer; text-decoration: underline dotted; color: var(--accent-hover); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
[data-pt-style="text-align:center; padding: 60px 20px; color: var(--text-muted);"] { text-align:center; padding: 60px 20px; color: var(--text-muted); }
[data-pt-style="display:none; overflow-x: auto; -webkit-overflow-scrolling: touch;"] { display:none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
[data-pt-style="margin-bottom: 32px;"] { margin-bottom: 32px; }
[data-pt-style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 4px;"] { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 4px; }
[data-pt-style="font-size: var(--fs-h3); color: var(--text-bright); font-weight: 700;"] { font-size: var(--fs-h3); color: var(--text-bright); font-weight: 700; }
[data-pt-style="background: rgba(239, 68, 68, 0.1); color: var(--color-loss); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 6px; padding: 6px 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s;"] { background: rgba(239, 68, 68, 0.1); color: var(--color-loss); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 6px; padding: 6px 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
[data-pt-style="min-width: 1800px; border-bottom: 3px solid var(--border-color);"] { min-width: 1800px; border-bottom: 3px solid var(--border-color); }
[data-pt-style="min-width: 1800px;"] { min-width: 1800px; }
[data-pt-style="margin-top: 10px; margin-bottom: 14px; font-size: var(--fs-sm); color: var(--text-muted); text-align: left; padding-left: 2px;"] { margin-top: 10px; margin-bottom: 14px; font-size: var(--fs-sm); color: var(--text-muted); text-align: left; padding-left: 2px; }
[data-pt-style="color: var(--text-muted);"] { color: var(--text-muted); }
[data-pt-style="padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-md);"] { padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--fs-md); }
[data-pt-style="display:none"] { display:none }
[data-pt-style="display:none;"] { display:none; }
[data-pt-style="display: block;"] { display: block; }
[data-pt-style="display:none; background: rgba(220, 38, 38, 0.1); color: #ef4444; border-color: rgba(220, 38, 38, 0.2);"] { display:none; background: rgba(220, 38, 38, 0.1); color: #ef4444; border-color: rgba(220, 38, 38, 0.2); }
[data-pt-style="margin: 0;"] { margin: 0; }
[data-pt-style="padding: 14px; color: var(--text-muted);"] { padding: 14px; color: var(--text-muted); }
[data-pt-style="margin-top: 12px; display: flex; gap: 8px; align-items: center;"] { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
[data-pt-style="flex: 1; text-transform: uppercase; font-family: monospace; font-size: var(--fs-md); padding: 7px 10px; border-radius: 6px; background: rgba(15,23,42,0.6); border: 1px solid rgba(255,255,255,0.12); color: #fff;"] { flex: 1; text-transform: uppercase; font-family: monospace; font-size: var(--fs-md); padding: 7px 10px; border-radius: 6px; background: rgba(15,23,42,0.6); border: 1px solid rgba(255,255,255,0.12); color: #fff; }
[data-pt-style="padding: 7px 14px; font-size: var(--fs-md); white-space: nowrap; border-radius: 6px;"] { padding: 7px 14px; font-size: var(--fs-md); white-space: nowrap; border-radius: 6px; }
[data-pt-style="font-size: var(--fs-sm); margin-top: 5px; display: none;"] { font-size: var(--fs-sm); margin-top: 5px; display: none; }
[data-pt-style="max-width: 440px; width: 92%;"] { max-width: 440px; width: 92%; }
[data-pt-style="padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center;"] { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; }
[data-pt-style="margin: 0; font-size: var(--fs-h3); font-weight: 700; color: #f8fafc; display: flex; align-items: center; gap: 8px;"] { margin: 0; font-size: var(--fs-h3); font-weight: 700; color: #f8fafc; display: flex; align-items: center; gap: 8px; }
[data-pt-style="color: var(--accent-hover, #818cf8);"] { color: var(--accent-hover, #818cf8); }
[data-pt-style="font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px;"] { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; }
[data-pt-style="background: none; border: none; font-size: var(--fs-h2); color: var(--text-muted); cursor: pointer; padding: 4px;"] { background: none; border: none; font-size: var(--fs-h2); color: var(--text-muted); cursor: pointer; padding: 4px; }
[data-pt-style="padding: 20px;"] { padding: 20px; }
[data-pt-style="margin-bottom: 16px;"] { margin-bottom: 16px; }
[data-pt-style="display: block; font-size: var(--fs-md); font-weight: 600; color: #cbd5e1; margin-bottom: 6px;"] { display: block; font-size: var(--fs-md); font-weight: 600; color: #cbd5e1; margin-bottom: 6px; }
[data-pt-style="width: 100%; box-sizing: border-box; background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #fff; padding: 10px 12px; border-radius: 8px; font-size: var(--fs-body);"] { width: 100%; box-sizing: border-box; background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #fff; padding: 10px 12px; border-radius: 8px; font-size: var(--fs-body); }
[data-pt-style="margin-bottom: 18px;"] { margin-bottom: 18px; }
[data-pt-style="display: flex; align-items: center; background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 0 12px;"] { display: flex; align-items: center; background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 0 12px; }
[data-pt-style="color: var(--accent-hover, #818cf8); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-body);"] { color: var(--accent-hover, #818cf8); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-body); }
[data-pt-style="width: 100%; background: transparent; border: none; outline: none; color: #fff; padding: 10px 8px; font-size: var(--fs-body); font-family: 'JetBrains Mono', monospace;"] { width: 100%; background: transparent; border: none; outline: none; color: #fff; padding: 10px 8px; font-size: var(--fs-body); font-family: 'JetBrains Mono', monospace; }
[data-pt-style="color: var(--text-muted); font-size: var(--fs-sm); display: block; margin-top: 4px;"] { color: var(--text-muted); font-size: var(--fs-sm); display: block; margin-top: 4px; }
[data-pt-style="margin-bottom: 20px;"] { margin-bottom: 20px; }
[data-pt-style="display: block; font-size: var(--fs-md); font-weight: 600; color: #cbd5e1; margin-bottom: 8px;"] { display: block; font-size: var(--fs-md); font-weight: 600; color: #cbd5e1; margin-bottom: 8px; }
[data-pt-style="display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: all 0.15s ease;"] { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: all 0.15s ease; }
[data-pt-style="display: flex; align-items: center; gap: 10px;"] { display: flex; align-items: center; gap: 10px; }
[data-pt-style="width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06);"] { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); }
[data-pt-style="font-weight: 600; font-size: var(--fs-body); color: #f8fafc;"] { font-weight: 600; font-size: var(--fs-body); color: #f8fafc; }
[data-pt-style="font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px;"] { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
[data-pt-style="font-size: var(--fs-sm); color: #818cf8; text-decoration: none; display: flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace;"] { font-size: var(--fs-sm); color: #818cf8; text-decoration: none; display: flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; }
[data-pt-style="font-size: var(--fs-xs); color: var(--color-profit); font-weight: 600;"] { font-size: var(--fs-xs); color: var(--color-profit); font-weight: 600; }
[data-pt-style="display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08);"] { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
[data-pt-style="background: none; border: 1px solid var(--border-color); color: var(--text-muted); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: var(--fs-md);"] { background: none; border: 1px solid var(--border-color); color: var(--text-muted); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: var(--fs-md); }
[data-pt-style="background: var(--accent-primary, #6366f1); color: #fff; border: none; padding: 9px 20px; font-weight: 600; border-radius: 8px; cursor: pointer; font-size: var(--fs-md);"] { background: var(--accent-primary, #6366f1); color: #fff; border: none; padding: 9px 20px; font-weight: 600; border-radius: 8px; cursor: pointer; font-size: var(--fs-md); }
[data-pt-style="max-width: 520px; width: 94%;"] { max-width: 520px; width: 94%; }
[data-pt-style="margin: 0; font-size: var(--fs-h3); font-weight: 700; color: #f8fafc; display: flex; align-items: center; gap: 8px;"] { margin: 0; font-size: var(--fs-h3); font-weight: 700; color: #f8fafc; display: flex; align-items: center; gap: 8px; }
[data-pt-style="display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 12px;"] { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 12px; }
[data-pt-style="background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #fff; padding: 9px 11px; border-radius: 8px; font-size: var(--fs-md); min-width: 0;"] { background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #fff; padding: 9px 11px; border-radius: 8px; font-size: var(--fs-md); min-width: 0; }
[data-pt-style="background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #cbd5e1; padding: 9px 10px; border-radius: 8px; font-size: var(--fs-md);"] { background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.12); color: #cbd5e1; padding: 9px 10px; border-radius: 8px; font-size: var(--fs-md); }
[data-pt-style="background: var(--accent-primary, #6366f1); color: #fff; border: none; padding: 9px 14px; font-weight: 600; border-radius: 8px; cursor: pointer; font-size: var(--fs-md); white-space: nowrap;"] { background: var(--accent-primary, #6366f1); color: #fff; border: none; padding: 9px 14px; font-weight: 600; border-radius: 8px; cursor: pointer; font-size: var(--fs-md); white-space: nowrap; }
[data-pt-style="font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 14px;"] { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 14px; }
[data-pt-style="display: none; background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.35); border-radius: 10px; padding: 12px; margin-bottom: 16px;"] { display: none; background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.35); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
[data-pt-style="font-size: var(--fs-sm); font-weight: 600; color: #86efac; margin-bottom: 6px;"] { font-size: var(--fs-sm); font-weight: 600; color: #86efac; margin-bottom: 6px; }
[data-pt-style="display: flex; gap: 8px; align-items: center;"] { display: flex; gap: 8px; align-items: center; }
[data-pt-style="flex: 1; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-sm); color: #f8fafc; background: rgba(15,23,42,0.8); padding: 7px 9px; border-radius: 6px; overflow-x: auto; user-select: all;"] { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: var(--fs-sm); color: #f8fafc; background: rgba(15,23,42,0.8); padding: 7px 9px; border-radius: 6px; overflow-x: auto; user-select: all; }
[data-pt-style="background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 7px 11px; border-radius: 6px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600;"] { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); color: #fff; padding: 7px 11px; border-radius: 6px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
[data-pt-style="display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto;"] { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
[data-pt-style="font-weight: 700; color: #f8fafc; font-size: var(--fs-body); line-height: 1.3;"] { font-weight: 700; color: #f8fafc; font-size: var(--fs-body); line-height: 1.3; }
[data-pt-style="display:none; margin-left:auto; font-size:var(--fs-xs); padding:1px 6px; border-radius:10px; background:rgba(34,197,94,0.2); color:#22c55e;"] { display:none; margin-left:auto; font-size:var(--fs-xs); padding:1px 6px; border-radius:10px; background:rgba(34,197,94,0.2); color:#22c55e; }
[data-pt-style="margin:0;"] { margin:0; }
[data-pt-style="width:100%;background:none;border:none;cursor:pointer;text-align:left;font-family:inherit;"] { width:100%;background:none;border:none;cursor:pointer;text-align:left;font-family:inherit; }
[data-pt-style="color: var(--text-muted); margin: 12px 0 24px 0;"] { color: var(--text-muted); margin: 12px 0 24px 0; }
[data-pt-style="text-align: right;"] { text-align: right; }
[data-pt-style="color: var(--text-secondary);"] { color: var(--text-secondary); }
[data-pt-style="color: var(--text-muted); font-family: var(--font-mono);"] { color: var(--text-muted); font-family: var(--font-mono); }
[data-pt-style="font-family: var(--font-mono); font-weight: 600;"] { font-family: var(--font-mono); font-weight: 600; }
[data-pt-style="justify-content: flex-end;"] { justify-content: flex-end; }
[data-pt-style="margin-top: 8px;"] { margin-top: 8px; }
[data-pt-style="display: block; width: 100%; max-width: 1440px; margin: 40px auto 0; margin-top: auto; text-align: center; font-size: var(--fs-xs); color: #64748b; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.8; background: transparent; clear: both; box-sizing: border-box;"] { display: block; width: 100%; max-width: 1440px; margin: 40px auto 0; margin-top: auto; text-align: center; font-size: var(--fs-xs); color: #64748b; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; line-height: 1.8; background: transparent; clear: both; box-sizing: border-box; }
[data-pt-style="text-align: center;"] { text-align: center; }
[data-pt-style="color: #64748b; text-decoration: underline;"] { color: #64748b; text-decoration: underline; }
[data-pt-style="text-align: center; margin-top: 4px;"] { text-align: center; margin-top: 4px; }
[data-pt-style="text-align: center; margin-top: 6px; font-size: var(--fs-xs); color: #475569; letter-spacing: 0.02em;"] { text-align: center; margin-top: 6px; font-size: var(--fs-xs); color: #475569; letter-spacing: 0.02em; }
[data-pt-style="max-width:100%; height:auto; border-radius:16px; box-shadow:0 12px 32px rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.08);"] { max-width:100%; height:auto; border-radius:16px; box-shadow:0 12px 32px rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.08); }
[data-pt-style="text-decoration: none;"] { text-decoration: none; }
[data-pt-style="max-width: 100%; height: auto; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08);"] { max-width: 100%; height: auto; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08); }
[data-pt-style="background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); border-radius: 12px; max-width: 500px; margin: 0 auto; padding: 24px; text-align: center;"] { background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); border-radius: 12px; max-width: 500px; margin: 0 auto; padding: 24px; text-align: center; }
[data-pt-style="color: #ef4444; font-size: var(--fs-h3); font-weight: 700; margin-bottom: 8px;"] { color: #ef4444; font-size: var(--fs-h3); font-weight: 700; margin-bottom: 8px; }
[data-pt-style="color: var(--text-muted); font-size: var(--fs-md); margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; word-break: break-all;"] { color: var(--text-muted); font-size: var(--fs-md); margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; word-break: break-all; }
[data-pt-style="background: var(--accent-primary); color: white; border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: var(--fs-md);"] { background: var(--accent-primary); color: white; border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: var(--fs-md); }
[data-pt-style="justify-content: center;"] { justify-content: center; }
[data-pt-style="text-align: center; max-width: 520px; margin: 30px auto;"] { text-align: center; max-width: 520px; margin: 30px auto; }
[data-pt-style="margin-top: 14px; margin-bottom: 8px;"] { margin-top: 14px; margin-bottom: 8px; }
[data-pt-style="color: var(--text-muted); font-size: var(--fs-body); line-height: 1.5; margin-bottom: 20px;"] { color: var(--text-muted); font-size: var(--fs-body); line-height: 1.5; margin-bottom: 20px; }
[data-pt-style="background: var(--accent-primary); color: white; border: none; padding: 10px 24px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: var(--fs-body);"] { background: var(--accent-primary); color: white; border: none; padding: 10px 24px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: var(--fs-body); }
[data-pt-style="opacity: 0.85;"] { opacity: 0.85; }
[data-pt-style="text-align:center; padding: 20px;"] { text-align:center; padding: 20px; }
[data-pt-style="text-align:center; color: var(--color-loss);"] { text-align:center; color: var(--color-loss); }
[data-pt-style="margin-top:10px;"] { margin-top:10px; }
[data-pt-style="margin:6px 0 0;"] { margin:6px 0 0; }
[data-pt-style="opacity:0.6;"] { opacity:0.6; }
[data-pt-style="margin: 6px 0 0;"] { margin: 6px 0 0; }
[data-pt-style="margin-top:8px; opacity:0.85;"] { margin-top:8px; opacity:0.85; }
[data-pt-style="color:var(--accent-hover); text-decoration:underline;"] { color:var(--accent-hover); text-decoration:underline; }
[data-pt-style="opacity:0.7;"] { opacity:0.7; }
[data-pt-style="margin-bottom:0;"] { margin-bottom:0; }
[data-pt-style="font-size:var(--fs-md); color:var(--text-muted); padding:8px 0;"] { font-size:var(--fs-md); color:var(--text-muted); padding:8px 0; }
[data-pt-style="font-size:var(--fs-md); color:#fca5a5;"] { font-size:var(--fs-md); color:#fca5a5; }
[data-pt-style="font-size:var(--fs-md); color:var(--text-muted); padding:10px 0;"] { font-size:var(--fs-md); color:var(--text-muted); padding:10px 0; }
[data-pt-style="display:flex; align-items:center; justify-content:space-between; gap:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px; padding:10px 12px;"] { display:flex; align-items:center; justify-content:space-between; gap:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px; padding:10px 12px; }
[data-pt-style="min-width:0;"] { min-width:0; }
[data-pt-style="display:flex; align-items:center; gap:8px; flex-wrap:wrap;"] { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
[data-pt-style="font-weight:600; font-size:var(--fs-body); color:#f8fafc;"] { font-weight:600; font-size:var(--fs-body); color:#f8fafc; }
[data-pt-style="font-family:'JetBrains Mono',monospace; font-size:var(--fs-sm); color:#94a3b8; margin-top:3px;"] { font-family:'JetBrains Mono',monospace; font-size:var(--fs-sm); color:#94a3b8; margin-top:3px; }
[data-pt-style="background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.3); color:#fca5a5; padding:5px 10px; border-radius:7px; font-size:var(--fs-sm); font-weight:600; cursor:pointer; flex-shrink:0;"] { background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.3); color:#fca5a5; padding:5px 10px; border-radius:7px; font-size:var(--fs-sm); font-weight:600; cursor:pointer; flex-shrink:0; }
[data-pt-style="color: #f87171;"] { color: #f87171; }
[data-pt-style="margin-top: 32px;"] { margin-top: 32px; }
[data-pt-style="display: flex; flex-direction: column; gap: 32px;"] { display: flex; flex-direction: column; gap: 32px; }
[data-pt-style="padding: 16px; margin-bottom: 16px; border: 1px solid var(--color-border); background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: center; gap: 16px; border-radius: 8px; flex-direction: row;"] { padding: 16px; margin-bottom: 16px; border: 1px solid var(--color-border); background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: center; gap: 16px; border-radius: 8px; flex-direction: row; }
[data-pt-style="width: 20px; height: 20px; border-width: 2px; margin: 0;"] { width: 20px; height: 20px; border-width: 2px; margin: 0; }
[data-pt-style="margin: 0; font-size: var(--fs-body);"] { margin: 0; font-size: var(--fs-body); }
[data-pt-style="display: flex; flex-wrap: wrap; gap: 24px; align-items: center;"] { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
[data-pt-style="min-width: 140px;"] { min-width: 140px; }
[data-pt-style="display: flex; flex-direction: column; gap: 4px;"] { display: flex; flex-direction: column; gap: 4px; }
[data-pt-style="font-size: var(--fs-xs);"] { font-size: var(--fs-xs); }
[data-pt-style="font-size: var(--fs-h3); color: var(--color-text);"] { font-size: var(--fs-h3); color: var(--color-text); }
[data-pt-style="display: flex; flex-direction: row; gap: 24px; margin-left: auto;"] { display: flex; flex-direction: row; gap: 24px; margin-left: auto; }
[data-pt-style="display: flex; flex-direction: column; align-items: flex-start; gap: 4px;"] { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
[data-pt-style="margin-top: 2px;"] { margin-top: 2px; }
[data-pt-style="display: flex; flex-direction: column; align-items: flex-end; gap: 4px;"] { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
[data-pt-style="margin-left: 24px;"] { margin-left: 24px; }
[data-pt-style="background: rgba(0,0,0,0.2); border: 1px solid var(--color-border); border-radius: 8px; padding: 20px;"] { background: rgba(0,0,0,0.2); border: 1px solid var(--color-border); border-radius: 8px; padding: 20px; }
[data-pt-style="display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap;"] { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
[data-pt-style="margin: 0; color: var(--color-text); font-size: var(--fs-h3); display: flex; align-items: center;"] { margin: 0; color: var(--color-text); font-size: var(--fs-h3); display: flex; align-items: center; }
[data-pt-style="display: inline-flex; align-items: center; gap: 8px;"] { display: inline-flex; align-items: center; gap: 8px; }
[data-pt-style="font-size: var(--fs-body); color: var(--color-text-muted); line-height: 1.5;"] { font-size: var(--fs-body); color: var(--color-text-muted); line-height: 1.5; }
[data-pt-style="color: var(--color-text);"] { color: var(--color-text); }
[data-pt-style="display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;"] { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
[data-pt-style="margin-left: 8px; color: var(--color-primary); text-decoration: none; font-size: 0.85em; opacity: 0.8; transition: opacity 0.2s;"] { margin-left: 8px; color: var(--color-primary); text-decoration: none; font-size: 0.85em; opacity: 0.8; transition: opacity 0.2s; }
[data-pt-style="font-size: 0.8em"] { font-size: 0.8em }
[data-pt-style="padding: 4px 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; border-left: 3px solid var(--color-primary);"] { padding: 4px 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; border-left: 3px solid var(--color-primary); }
[data-pt-style="font-size: 0.9em; color: var(--color-text-muted);"] { font-size: 0.9em; color: var(--color-text-muted); }
[data-pt-style="margin-bottom: 20px; padding: 16px; background: rgba(255, 255, 255, 0.02); border-radius: 8px; border: 1px solid var(--border-subtle);"] { margin-bottom: 20px; padding: 16px; background: rgba(255, 255, 255, 0.02); border-radius: 8px; border: 1px solid var(--border-subtle); }
[data-pt-style="margin-bottom: 12px; font-weight: 600;"] { margin-bottom: 12px; font-weight: 600; }
[data-pt-style="display: flex; flex-direction: column; gap: 8px;"] { display: flex; flex-direction: column; gap: 8px; }
[data-pt-style="display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-md);"] { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-md); }
[data-pt-style="color: var(--color-primary); text-decoration: none;"] { color: var(--color-primary); text-decoration: none; }
[data-pt-style="margin-top: 16px;"] { margin-top: 16px; }
[data-pt-style="margin-bottom: 16px; padding: 12px 16px; background: rgba(255, 68, 68, 0.1); border: 1px solid rgba(255, 68, 68, 0.2); border-radius: 8px; display: flex; align-items: flex-start; gap: 12px;"] { margin-bottom: 16px; padding: 12px 16px; background: rgba(255, 68, 68, 0.1); border: 1px solid rgba(255, 68, 68, 0.2); border-radius: 8px; display: flex; align-items: flex-start; gap: 12px; }
[data-pt-style="font-size: var(--fs-h2); margin-top: 2px;"] { font-size: var(--fs-h2); margin-top: 2px; }
[data-pt-style="color: var(--color-text); font-size: var(--fs-body); line-height: 1.4;"] { color: var(--color-text); font-size: var(--fs-body); line-height: 1.4; }
[data-pt-style="max-width: 50%; min-width: 220px; margin: 24px 0 40px 0;"] { max-width: 50%; min-width: 220px; margin: 24px 0 40px 0; }
[data-pt-style="position: relative; padding: 8px 36px 20px 46px;"] { position: relative; padding: 8px 36px 20px 46px; }
[data-pt-style="position: absolute; left: 46px; top: 8px; bottom: 20px; width: 1px; background: rgba(255,255,255,0.08);"] { position: absolute; left: 46px; top: 8px; bottom: 20px; width: 1px; background: rgba(255,255,255,0.08); }
[data-pt-style="position: absolute; left: 46px; right: 36px; bottom: 20px; height: 1px; background: rgba(255,255,255,0.08);"] { position: absolute; left: 46px; right: 36px; bottom: 20px; height: 1px; background: rgba(255,255,255,0.08); }
[data-pt-style="position: absolute; left: 0; top: 4px; font-size: var(--fs-xs); color: #666; width: 38px; text-align: right;"] { position: absolute; left: 0; top: 4px; font-size: var(--fs-xs); color: #666; width: 38px; text-align: right; }
[data-pt-style="position: absolute; left: 0; bottom: 14px; font-size: var(--fs-xs); color: #666; width: 38px; text-align: right;"] { position: absolute; left: 0; bottom: 14px; font-size: var(--fs-xs); color: #666; width: 38px; text-align: right; }
[data-pt-style="overflow: visible;"] { overflow: visible; }
[data-pt-style="position: absolute; left: 0; bottom: -20px; transform: translateX(-50%); font-size: var(--fs-xs); color: #666; white-space: nowrap;"] { position: absolute; left: 0; bottom: -20px; transform: translateX(-50%); font-size: var(--fs-xs); color: #666; white-space: nowrap; }
[data-pt-style="background:#f8fafc;"] { background:#f8fafc; }
[data-pt-style="background:#06b6d4;"] { background:#06b6d4; }
[data-pt-style="background:#c084fc;"] { background:#c084fc; }
[data-pt-style="background:#facc15;"] { background:#facc15; }
[data-pt-style="background:#3b82f6;"] { background:#3b82f6; }
[data-pt-style="background:#ef4444;"] { background:#ef4444; }
[data-pt-style="background:#22c55e; border-top: 1px dashed #22c55e;"] { background:#22c55e; border-top: 1px dashed #22c55e; }
[data-pt-style="background:#ef4444; border-top: 1px dashed #ef4444;"] { background:#ef4444; border-top: 1px dashed #ef4444; }
[data-pt-style="margin-left: auto; cursor: default; opacity: 0.85; font-size: var(--fs-xs); padding: 2px 7px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; color: #94a3b8; font-family: var(--font-mono); font-weight: 600; line-height: 1.4;"] { margin-left: auto; cursor: default; opacity: 0.85; font-size: var(--fs-xs); padding: 2px 7px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; color: #94a3b8; font-family: var(--font-mono); font-weight: 600; line-height: 1.4; }
[data-pt-style="color:var(--color-loss)"] { color:var(--color-loss) }
[data-pt-style="color:var(--color-info, #60a5fa)"] { color:var(--color-info, #60a5fa) }
[data-pt-style="color: var(--color-profit); font-weight: 700;"] { color: var(--color-profit); font-weight: 700; }
[data-pt-style="color: var(--color-profit); font-weight: 600;"] { color: var(--color-profit); font-weight: 600; }
[data-pt-style="color: var(--color-loss); font-weight: 700;"] { color: var(--color-loss); font-weight: 700; }
[data-pt-style="color: #ffffff; font-weight: 600;"] { color: #ffffff; font-weight: 600; }
[data-pt-style="margin-top: 3px; font-size: var(--fs-sm); font-weight: 500; font-family: var(--font-mono); color: #cbd5e1; word-break: break-word; white-space: pre-wrap;"] { margin-top: 3px; font-size: var(--fs-sm); font-weight: 500; font-family: var(--font-mono); color: #cbd5e1; word-break: break-word; white-space: pre-wrap; }
[data-pt-style="margin-top: 8px; padding: 8px 10px; background: rgba(0, 0, 0, 0.28); border-radius: 4px; border-left: 2px solid #3b82f6;"] { margin-top: 8px; padding: 8px 10px; background: rgba(0, 0, 0, 0.28); border-radius: 4px; border-left: 2px solid #3b82f6; }
[data-pt-style="font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-family: var(--font-sans); font-weight: 700; margin-bottom: 2px;"] { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; font-family: var(--font-sans); font-weight: 700; margin-bottom: 2px; }
[data-pt-style="margin-bottom: 6px;"] { margin-bottom: 6px; }
[data-pt-style="font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-md); color: #f1f5f9; line-height: 1.45; word-break: break-word;"] { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-md); color: #f1f5f9; line-height: 1.45; word-break: break-word; }
[data-pt-style="font-family: var(--font-sans); font-size: var(--fs-sm); color: #94a3b8; margin-top: 4px; line-height: 1.5;"] { font-family: var(--font-sans); font-size: var(--fs-sm); color: #94a3b8; margin-top: 4px; line-height: 1.5; }
[data-pt-style="margin-top: 10px; padding: 8px 12px; background: rgba(59, 130, 246, 0.08); border-left: 3px solid #3b82f6; border-radius: 4px; font-size: var(--fs-table-row); color: var(--text-secondary); line-height: 1.4;"] { margin-top: 10px; padding: 8px 12px; background: rgba(59, 130, 246, 0.08); border-left: 3px solid #3b82f6; border-radius: 4px; font-size: var(--fs-table-row); color: var(--text-secondary); line-height: 1.4; }
[data-pt-style="padding: 24px; text-align: center;"] { padding: 24px; text-align: center; }
[data-pt-style="margin: 0 auto 12px;"] { margin: 0 auto 12px; }
[data-pt-style="font-size: var(--fs-ta-row, 0.92rem); color: var(--text-secondary);"] { font-size: var(--fs-ta-row, 0.92rem); color: var(--text-secondary); }
[data-pt-style="margin-top: 14px;"] { margin-top: 14px; }
[data-pt-style="display: flex; justify-content: center; width: 100%; margin-top: 12px;"] { display: flex; justify-content: center; width: 100%; margin-top: 12px; }
[data-pt-style="padding: 32px 20px; text-align: center;"] { padding: 32px 20px; text-align: center; }
[data-pt-style="margin: 0 auto 16px;"] { margin: 0 auto 16px; }
[data-pt-style="font-size: var(--fs-ta-row, 0.92rem); font-weight: 700; color: var(--text-primary); margin-bottom: 6px;"] { font-size: var(--fs-ta-row, 0.92rem); font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
[data-pt-style="font-size: var(--fs-ta-row, 0.92rem); color: var(--text-secondary); line-height: 1.5;"] { font-size: var(--fs-ta-row, 0.92rem); color: var(--text-secondary); line-height: 1.5; }
[data-pt-style="color: var(--text-muted); font-size: var(--fs-ta-header, 0.78rem);"] { color: var(--text-muted); font-size: var(--fs-ta-header, 0.78rem); }
[data-pt-style="color: var(--color-loss);"] { color: var(--color-loss); }
[data-pt-style="margin-top: 8px; margin-bottom: 6px; padding: 7px 10px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 6px; font-size: var(--fs-sm); color: #fbbf24; font-family: var(--font-mono); display: flex; align-items: center; gap: 6px;"] { margin-top: 8px; margin-bottom: 6px; padding: 7px 10px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 6px; font-size: var(--fs-sm); color: #fbbf24; font-family: var(--font-mono); display: flex; align-items: center; gap: 6px; }
[data-pt-style="font-size: var(--fs-body);"] { font-size: var(--fs-body); }
[data-pt-style="font-family: var(--font-mono); color: #f59e0b; font-weight: 700;"] { font-family: var(--font-mono); color: #f59e0b; font-weight: 700; }
[data-pt-style="font-family: var(--font-mono); color: #3b82f6; font-weight: 700;"] { font-family: var(--font-mono); color: #3b82f6; font-weight: 700; }
[data-pt-style="font-family: var(--font-mono); color: var(--color-profit); font-weight: 700;"] { font-family: var(--font-mono); color: var(--color-profit); font-weight: 700; }
[data-pt-style="font-family: var(--font-mono); color: var(--color-loss); font-weight: 700;"] { font-family: var(--font-mono); color: var(--color-loss); font-weight: 700; }
[data-pt-style="margin-bottom: 1px;"] { margin-bottom: 1px; }
[data-pt-style="width: 100%; margin: 14px 0;"] { width: 100%; margin: 14px 0; }
[data-pt-style="position: absolute; left: 45px; top: 15px; bottom: 25px; width: 1px; background: var(--border-subtle);"] { position: absolute; left: 45px; top: 15px; bottom: 25px; width: 1px; background: var(--border-subtle); }
[data-pt-style="position: absolute; left: 45px; right: 35px; bottom: 25px; height: 1px; background: var(--border-subtle);"] { position: absolute; left: 45px; right: 35px; bottom: 25px; height: 1px; background: var(--border-subtle); }
[data-pt-style="position: absolute; left: 6px; top: 10px; font-size: var(--fs-table-header); color: var(--text-muted); width: 36px; text-align: right; font-family: var(--font-mono);"] { position: absolute; left: 6px; top: 10px; font-size: var(--fs-table-header); color: var(--text-muted); width: 36px; text-align: right; font-family: var(--font-mono); }
[data-pt-style="position: absolute; left: 6px; bottom: 20px; font-size: var(--fs-table-header); color: var(--text-muted); width: 36px; text-align: right; font-family: var(--font-mono);"] { position: absolute; left: 6px; bottom: 20px; font-size: var(--fs-table-header); color: var(--text-muted); width: 36px; text-align: right; font-family: var(--font-mono); }
[data-pt-style="font-weight: 700;"] { font-weight: 700; }
[data-pt-style="margin-left: 3px; opacity: 0.9;"] { margin-left: 3px; opacity: 0.9; }
[data-pt-style="color: var(--text-muted); text-transform: uppercase; margin-top: 1px; font-family: var(--font-sans); font-weight: 600;"] { color: var(--text-muted); text-transform: uppercase; margin-top: 1px; font-family: var(--font-sans); font-weight: 600; }
[data-pt-style="margin-top: 24px;"] { margin-top: 24px; }
[data-pt-style="font-size: var(--fs-md); color: var(--text-muted); font-family: var(--font-sans); font-weight: 500; margin-left: 12px; display: inline-flex; align-items: baseline; gap: 14px;"] { font-size: var(--fs-md); color: var(--text-muted); font-family: var(--font-sans); font-weight: 500; margin-left: 12px; display: inline-flex; align-items: baseline; gap: 14px; }
[data-pt-style="display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px;"] { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
[data-pt-style="margin: 0; display: inline-flex; align-items: baseline;"] { margin: 0; display: inline-flex; align-items: baseline; }
[data-pt-style="overflow-x: auto; -webkit-overflow-scrolling: touch;"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
[data-pt-style="color: var(--text-primary); font-size: var(--fs-table-row); font-family: var(--font-mono); font-weight: 500;"] { color: var(--text-primary); font-size: var(--fs-table-row); font-family: var(--font-mono); font-weight: 500; }
[data-pt-style="font-size: var(--fs-table-row); font-family: var(--font-mono); font-weight: 500;"] { font-size: var(--fs-table-row); font-family: var(--font-mono); font-weight: 500; }
[data-pt-style="text-align: center; padding: 24px 16px; color: var(--text-secondary); font-size: var(--fs-table-row); font-family: var(--font-sans); font-weight: 500;"] { text-align: center; padding: 24px 16px; color: var(--text-secondary); font-size: var(--fs-table-row); font-family: var(--font-sans); font-weight: 500; }
[data-pt-style="text-align: center; padding: 0;"] { text-align: center; padding: 0; }
[data-pt-style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px;"] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px; }
[data-pt-style="color: var(--text-secondary); font-size: var(--fs-table-row); font-family: var(--font-sans); font-weight: 500;"] { color: var(--text-secondary); font-size: var(--fs-table-row); font-family: var(--font-sans); font-weight: 500; }
[data-pt-style="display: inline-flex; align-items: center; gap: 6px; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); color: #10b981; padding: 6px 14px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease;"] { display: inline-flex; align-items: center; gap: 6px; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); color: #10b981; padding: 6px 14px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease; }
[data-pt-style="color: #22c55e;"] { color: #22c55e; }
[data-pt-style="color: #ef4444;"] { color: #ef4444; }
[data-pt-style="opacity:0.85;"] { opacity:0.85; }
[data-pt-style="border-left: 3px solid var(--accent, #6366f1); margin-top: 10px; max-width: 82%;"] { border-left: 3px solid var(--accent, #6366f1); margin-top: 10px; max-width: 82%; }
[data-pt-style="width: 18px; height: 18px; font-size: var(--fs-xs); margin-right: 2px; flex-shrink: 0;"] { width: 18px; height: 18px; font-size: var(--fs-xs); margin-right: 2px; flex-shrink: 0; }
[data-pt-style="font-weight: 600; margin-bottom: 6px;"] { font-weight: 600; margin-bottom: 6px; }
[data-pt-style="font-size: var(--fs-md); color: var(--text-muted, #94a3b8); line-height: 1.45;"] { font-size: var(--fs-md); color: var(--text-muted, #94a3b8); line-height: 1.45; }
[data-pt-style="opacity:0.5"] { opacity:0.5 }
[data-pt-style="opacity: 0;"] { opacity: 0; }
[data-pt-style="margin:6px 0;"] { margin:6px 0; }


/* ===================================================
   TrustMRR-Style Impulse Sponsorship Modals (IDEA-236)
   =================================================== */
body.pt-sponsor-modal-open {
  overflow: hidden;
}

.pt-sponsor-overlay {
  position: fixed;
  inset: 0;
  z-index: 100020;
  background: rgba(5, 8, 16, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pt-sponsor-overlay.is-hidden,
.pt-sponsor-card .is-hidden {
  display: none !important;
}

.pt-sponsor-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
  padding: 24px 22px 20px;
  color: #f8fafc;
  font-family: var(--font-sans);
  box-sizing: border-box;
}

.pt-sponsor-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: var(--fs-18);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pt-sponsor-close:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

.pt-sponsor-heading {
  margin: 0 24px 4px;
  font-size: var(--fs-18);
  font-weight: 500;
  line-height: 1.3;
  color: #f8fafc;
  text-align: center;
}

.pt-sponsor-sub {
  margin: 0 0 14px;
  font-size: var(--fs-14);
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.4;
  text-align: center;
}

.pt-sponsor-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pt-sponsor-stat-box {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}

.pt-sponsor-stat-box.is-highlight {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.42);
}

.pt-sponsor-stat-val {
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: 1.25;
  color: #f8fafc;
}

.pt-sponsor-stat-lbl {
  font-size: var(--fs-12);
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.25;
}

.pt-sponsor-preview-wrap {
  margin-bottom: 12px;
}

.pt-sponsor-preview-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pt-sponsor-preview-stage.is-bg-stage {
  background: #0a0e17;
  border: 1px solid var(--border-card);
  padding: 14px 12px 12px;
}

.pt-sponsor-bg-tile {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 56px 56px;
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.pt-sponsor-bg-tile.is-hidden,
.pt-sponsor-bg-mock-chat.is-hidden {
  display: none;
}

.pt-sponsor-bg-mock-chat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.pt-sponsor-mock-bubble {
  height: 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.pt-sponsor-mock-bubble.is-short {
  width: 48%;
}

.pt-sponsor-mock-bubble.is-long {
  width: 74%;
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.32);
}

.pt-sponsor-preview-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
}

.pt-sponsor-preview-card.is-bg-preview {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.45);
}

.pt-sponsor-preview-card.is-sidebar-preview {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 14px;
  gap: 8px;
}

.pt-sponsor-preview-card.is-sidebar-preview .pt-sponsor-preview-top {
  justify-content: center;
}

.pt-sponsor-preview-card.is-sidebar-preview .pt-sponsor-preview-link {
  display: none;
}

.pt-sponsor-preview-logo-box {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pt-sponsor-preview-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pt-sponsor-preview-text {
  min-width: 0;
  flex: 1;
}

.pt-sponsor-preview-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pt-sponsor-preview-brand {
  font-size: var(--fs-14);
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-sponsor-preview-link {
  font-size: var(--fs-12);
  font-weight: 400;
  color: #818cf8;
  flex-shrink: 0;
}

.pt-sponsor-preview-tagline {
  margin-top: 2px;
  font-size: var(--fs-12);
  font-weight: 400;
  color: #cbd5e1;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pt-sponsor-field-group {
  margin-bottom: 8px;
}

.pt-sponsor-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-sponsor-attach-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #0b1120;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pt-sponsor-attach-btn:hover {
  color: #f8fafc;
  border-color: #6366f1;
}

.pt-sponsor-attach-btn.has-logo {
  color: var(--color-profit);
  border-color: var(--color-profit);
}

.pt-sponsor-input {
  width: 100%;
  height: 44px;
  background: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  color: #f8fafc;
  padding: 0 16px;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  font-weight: 400;
  line-height: 1.25;
  box-sizing: border-box;
}

.pt-sponsor-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.pt-sponsor-how {
  margin: 10px 0;
}

.pt-sponsor-how-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 3px;
}

.pt-sponsor-how-text {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 400;
  color: #cbd5e1;
  line-height: 1.4;
}

.pt-sponsor-pricing-box {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.pt-sponsor-pricing-title {
  font-size: var(--fs-14);
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 4px;
}

.pt-sponsor-price-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 6px;
}

.pt-sponsor-price-label,
.pt-sponsor-price-val {
  font-size: var(--fs-14);
  font-weight: 400;
  color: #cbd5e1;
  line-height: 1.4;
}

.pt-sponsor-avail-note {
  margin-top: 2px;
  font-size: var(--fs-14);
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.4;
}

.pt-sponsor-promo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pt-sponsor-promo-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #0b1120;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pt-sponsor-promo-btn:hover {
  border-color: #6366f1;
}

.pt-sponsor-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #6366f1;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.pt-sponsor-cta-btn:hover:not(:disabled) {
  background: #4f46e5;
}

.pt-sponsor-cta-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pt-sponsor-feedback {
  margin-top: 6px;
  font-size: var(--fs-12);
  line-height: 1.35;
}

.pt-sponsor-feedback.is-error {
  color: var(--color-loss);
}

.pt-sponsor-feedback.is-success {
  color: var(--color-profit);
}

.pt-sponsor-legal {
  margin: 10px 0 0;
  font-size: var(--fs-12);
  font-weight: 400;
  color: #64748b;
  line-height: 1.4;
  text-align: center;
}

.pt-sponsor-legal a {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .pt-sponsor-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .pt-sponsor-card {
    max-width: 100%;
    width: 100%;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
    animation: ptSheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .pt-sponsor-card .pt-landing-sheet-grabber {
    margin: 0 auto 6px;
  }

  .pt-sponsor-close {
    top: 8px;
    right: 10px;
  }

  .pt-sponsor-heading {
    margin: 0 28px 2px;
    font-weight: 600;
  }

  .pt-sponsor-sub {
    margin-bottom: 8px;
  }

  .pt-sponsor-stats-grid {
    gap: 6px;
    margin-bottom: 8px;
  }

  .pt-sponsor-stat-box {
    padding: 6px 4px;
  }

  .pt-sponsor-preview-wrap {
    margin-bottom: 8px;
  }

  .pt-sponsor-preview-stage.is-bg-stage {
    padding: 8px 10px;
  }

  .pt-sponsor-bg-mock-chat {
    margin-bottom: 6px;
  }

  .pt-sponsor-mock-bubble.is-short {
    display: none;
  }

  .pt-sponsor-preview-card {
    padding: 8px 10px;
    gap: 10px;
  }

  .pt-sponsor-preview-card.is-sidebar-preview {
    padding: 10px 12px;
    gap: 4px;
  }

  .pt-sponsor-preview-logo-box {
    width: 34px;
    height: 34px;
  }

  .pt-sponsor-field-group {
    margin-bottom: 6px;
  }

  .pt-sponsor-attach-btn {
    width: 38px;
    height: 38px;
  }

  .pt-sponsor-input {
    height: 38px;
    padding: 0 14px;
  }

  .pt-sponsor-tint-swatch {
    width: 22px;
    height: 22px;
  }

  .pt-sponsor-how {
    margin: 6px 0 8px;
  }

  .pt-sponsor-how-title {
    margin-bottom: 2px;
  }

  .pt-sponsor-how-text {
    line-height: 1.35;
  }

  .pt-sponsor-pricing-box {
    padding: 8px 12px;
    margin-bottom: 8px;
  }

  .pt-sponsor-pricing-title {
    margin-bottom: 2px;
  }

  .pt-sponsor-promo-row {
    margin-bottom: 8px;
  }

  .pt-sponsor-promo-btn {
    height: 38px;
    padding: 0 14px;
  }

  .pt-sponsor-cta-btn {
    height: 42px;
  }

  .pt-sponsor-legal {
    margin-top: 6px;
    line-height: 1.3;
  }
}

.pt-sponsor-tint-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pt-sponsor-tint-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.pt-sponsor-tint-swatch:hover {
  transform: scale(1.08);
}

.pt-sponsor-tint-swatch.is-active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.55);
}

.pt-sc-tint-indigo,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-indigo {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.34), rgba(30, 27, 75, 0.78));
  border-color: rgba(129, 140, 248, 0.45);
}

.pt-sc-tint-sky,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-sky {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.34), rgba(12, 74, 110, 0.78));
  border-color: rgba(56, 189, 248, 0.45);
}

.pt-sc-tint-emerald,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-emerald {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.34), rgba(6, 78, 59, 0.78));
  border-color: rgba(52, 211, 153, 0.45);
}

.pt-sc-tint-violet,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-violet {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(46, 16, 101, 0.78));
  border-color: rgba(167, 139, 250, 0.45);
}

.pt-sc-tint-teal,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-teal {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.34), rgba(19, 78, 74, 0.78));
  border-color: rgba(45, 212, 191, 0.45);
}

.pt-sc-tint-amber,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-amber {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.34), rgba(120, 53, 15, 0.78));
  border-color: rgba(251, 191, 36, 0.45);
}

.pt-sc-tint-rose,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-rose {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.34), rgba(136, 19, 55, 0.78));
  border-color: rgba(251, 113, 133, 0.45);
}

.pt-sc-tint-slate,
.pt-sponsor-preview-card.is-sidebar-preview.pt-sc-tint-slate {
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.38), rgba(15, 23, 42, 0.84));
  border-color: rgba(148, 163, 184, 0.45);
}

.pt-sc-logo-plate {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 3px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pt-sc-logo-plate.is-sm {
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: 5px;
}

.pt-sc-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.pt-sponsor-rail {
  display: none;
}

.pt-sponsor-mobile-strip {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: transparent;
  border: none;
  pointer-events: auto;
  touch-action: pan-y;
}

.pt-sponsor-mobile-strip.is-top {
  top: 0;
  padding: max(6px, env(safe-area-inset-top)) 0 6px;
}

.pt-sponsor-mobile-strip.is-bottom {
  bottom: 0;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
}

.pt-sponsor-marquee-track {
  display: inline-flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.pt-sponsor-marquee-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  flex-shrink: 0;
}

.pt-sponsor-mobile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 5px 10px 5px 6px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
}

.pt-sponsor-mobile-pill-adv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 5px 10px 5px 6px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px dashed rgba(148, 163, 184, 0.85);
  background: #0f172a;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.pt-sponsor-mobile-pill.pt-sc-tint-indigo {
  background: #26235c;
  border-color: rgba(129, 140, 248, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-sky {
  background: #103b59;
  border-color: rgba(56, 189, 248, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-emerald {
  background: #0e4436;
  border-color: rgba(52, 211, 153, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-violet {
  background: #361e63;
  border-color: rgba(167, 139, 250, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-teal {
  background: #114543;
  border-color: rgba(45, 212, 191, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-amber {
  background: #523010;
  border-color: rgba(251, 191, 36, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-rose {
  background: #59182e;
  border-color: rgba(251, 113, 133, 0.72);
}

.pt-sponsor-mobile-pill.pt-sc-tint-slate {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.72);
}

.pt-sponsor-mobile-adv-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.pt-sc-mobile-brand {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.pt-teaser-locked-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  max-width: 380px;
  margin: 48px auto;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-card);
  position: relative;
  z-index: 2;
}

.pt-teaser-locked-card.is-hidden,
#ptTeaserMessagesList.is-hidden,
#ptTeaserPinnedLink.is-hidden {
  display: none;
}

.pt-teaser-locked-icon {
  font-size: var(--fs-h2);
  line-height: 1;
}

.pt-teaser-locked-title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.pt-teaser-locked-desc {
  margin: 0 0 4px;
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .pt-landing-nav {
    gap: 8px;
    padding: 4px 0 10px;
  }

  .pt-landing-tagline-ticker {
    margin: 0 6px;
  }

  .pt-landing-tagline-item {
    font-size: var(--fs-md);
  }

  .pt-landing-teaser-section {
    padding: 8px 0 20px;
  }
}

@media (max-width: 1439px) {
  body.pt-has-sponsor-rails {
    padding-top: 36px;
    padding-bottom: 46px;
  }

  body.pt-has-sponsor-rails .pt-landing-shell {
    padding-top: 6px;
  }

  body.pt-has-sponsor-rails .pt-landing-nav {
    padding-top: 2px;
  }
}

@media (min-width: 1440px) {
  body.pt-has-sponsor-rails {
    padding-left: 268px;
    padding-right: 268px;
    box-sizing: border-box;
  }

  .pt-sponsor-mobile-strip {
    display: none;
  }

  .pt-sponsor-rail {
    position: fixed;
    top: 16px;
    bottom: 16px;
    width: 236px;
    display: grid;
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 14px;
    z-index: 25;
    overflow: hidden;
  }

  .pt-sponsor-rail.is-left {
    left: 16px;
  }

  .pt-sponsor-rail.is-right {
    right: 16px;
  }

  .pt-sponsor-rail-slots {
    display: contents;
  }

  .pt-sc-flip-slot {
    width: 100%;
    height: 100%;
    min-height: 0;
    perspective: 1000px;
  }

  .pt-sc-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.95s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .pt-sc-flip-inner.is-flipped {
    transform: rotateY(180deg);
  }

  .pt-sponsor-rail-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 16px 14px;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    text-decoration: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  .pt-sponsor-rail-card.pt-sc-face-back {
    transform: rotateY(180deg);
  }

  .pt-sponsor-rail-card:hover {
    border-color: rgba(255, 255, 255, 0.36);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  }

  .pt-sponsor-rail-card .pt-sc-logo-plate {
    width: 36px;
    height: 36px;
    padding: 4px;
    border-radius: 9px;
  }

  .pt-sc-text-wrap {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .pt-sc-brand {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pt-sc-tagline {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pt-sponsor-card-static {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1.5px dashed rgba(148, 163, 184, 0.55);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), background var(--transition-fast);
  }

  .pt-sponsor-card-static:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
  }

  .pt-sponsor-static-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 9px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
  }

  .pt-sponsor-static-text {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .pt-sponsor-static-brand {
    font-size: var(--fs-body);
    font-weight: 700;
    color: var(--text-primary);
  }

  .pt-sponsor-static-tagline {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
  }
}
