/* ═══════════════════════════════════════════════════════════
   Cassandra Design System
   Dark Academia × Financial Precision
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap");

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Background */
  --bg-primary: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
  --bg-solid: #0f0f0f;

  /* Accent — Gold */
  --accent: #c5a059;
  --accent-light: #d4b36e;
  --accent-dark: #a88840;
  --accent-glow: 0 0 20px rgba(197, 160, 89, 0.35);
  --accent-glow-strong: 0 0 30px rgba(197, 160, 89, 0.5);

  /* Taiwan Color Logic */
  --up: #ef4444;
  --up-bg: rgba(239, 68, 68, 0.12);
  --down: #10b981;
  --down-bg: rgba(16, 185, 129, 0.12);

  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.08);

  /* Borders */
  --border: rgba(197, 160, 89, 0.15);
  --border-strong: rgba(197, 160, 89, 0.3);

  /* Text */
  --text: #e8e4de;
  --text-dim: #8a8275;
  --text-muted: #5a554d;

  /* Signal Colors */
  --signal-strong: #10b981;
  --signal-warning: #f59e0b;
  --signal-danger: #ef4444;
  --signal-info: #6366f1;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-heading: "Playfair Display", "Georgia", serif;
  --font-body: "Noto Sans TC", "Inter", sans-serif;
  --font-mono: "SF Mono", "Menlo", monospace;

  /* Transition */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding: var(--space-lg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Container ───────────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.header-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-md);
  border: 2px solid var(--accent);
  box-shadow: var(--accent-glow);
  transition: box-shadow var(--transition);
}

.header-avatar:hover {
  box-shadow: var(--accent-glow-strong);
}

.header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}

.pro-badge {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 6px;
  background: linear-gradient(135deg, #c5a059, #e8c97a, #c5a059);
  background-size: 200% 100%;
  color: #0a0a0a;
  vertical-align: middle;
  position: relative;
  top: -2px;
  box-shadow:
    0 0 12px rgba(197, 160, 89, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: proShimmer 3s ease-in-out infinite;
}

@keyframes proShimmer {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* Admin Tier Badge */
.pro-badge.admin-tier-badge {
  background: linear-gradient(135deg, #e74c3c, #ff6b6b, #e74c3c);
  background-size: 200% 100%;
  color: #fff;
  box-shadow: 0 0 12px rgba(231, 76, 60, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: proShimmer 3s ease-in-out infinite;
}

/* ── Simulate Bar ───────────────────────────────────────── */
.sim-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(231, 76, 60, .06);
  border: 1px solid rgba(231, 76, 60, .15);
  border-radius: 10px;
  margin: 4px var(--space-md) 0;
}

.sim-bar-label {
  font-size: .7rem;
  color: #e74c3c;
  font-weight: 600;
  margin-right: 4px;
}

.sim-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  color: #888;
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.sim-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sim-btn.active {
  color: #fff;
}

.sim-btn.active[data-sim="admin"] {
  background: linear-gradient(135deg, #e74c3c, #ff6b6b);
  border-color: #e74c3c;
}

.sim-btn.active[data-sim="ultra"] {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  border-color: #6366f1;
}

.sim-btn.active[data-sim="pro"] {
  background: linear-gradient(135deg, #c5a059, #e8c97a);
  border-color: #c5a059;
  color: #0a0a0a;
}

.header .subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.header .version {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: var(--space-xs);
}

/* ── Input Section ───────────────────────────────────────── */
.input-section {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  align-items: stretch;
}

.stock-input {
  flex: 1;
  padding: 0.85rem 1.2rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.stock-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

.stock-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-body);
  letter-spacing: 0;
}

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrap {
  flex: 1;
  position: relative;
}

.autocomplete-wrap .stock-input {
  width: 100%;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  background: rgba(26, 26, 26, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.autocomplete-list.open {
  display: block;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.active {
  background: var(--surface-hover);
}

.ac-item .ac-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-light);
  min-width: 4.5em;
  letter-spacing: 1px;
}

.ac-item .ac-name {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.ac-item .ac-match {
  color: var(--accent);
  font-weight: 600;
}

.btn-go {
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border: none;
  border-radius: var(--radius);
  color: #0a0a0a;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    opacity var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.btn-go:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.btn-go:active {
  transform: translateY(0);
}

.btn-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Loading ─────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-dim);
}

.loading .spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.95rem;
}

/* ── Error ───────────────────────────────────────────────── */
.error {
  text-align: center;
  padding: var(--space-lg);
  color: var(--signal-danger);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Result ──────────────────────────────────────────────── */
.result {
  display: none;
}

.result.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Stock Info Bar ──────────────────────────────────────── */
.stock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.stock-bar .code {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stock-bar .name {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.stock-bar .price {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
}

.stock-bar .date {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
}

/* ── Score Section ───────────────────────────────────────── */
.score-section {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.score-trio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.score-mini {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  position: relative;
}

.score-mini.buy {
  border-color: var(--up);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.score-mini.sell {
  border-color: var(--down);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.mini-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.score-mini.buy .mini-value {
  color: var(--up);
}

.score-mini.sell .mini-value {
  color: var(--down);
}

.mini-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* ── Prediction Section ─────────────────────────────────── */
.prediction-section {
  margin-bottom: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
}

.prediction-section h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 0.95rem;
}

.prediction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.prediction-outlook {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.prediction-outlook.accelerating {
  color: var(--up);
  background: rgba(239, 68, 68, 0.08);
}

.prediction-outlook.decelerating {
  color: var(--down);
  background: rgba(16, 185, 129, 0.08);
}

.prediction-outlook.stable {
  color: var(--accent);
  background: rgba(197, 160, 89, 0.08);
}

.prediction-signals {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pred-signal {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px var(--space-sm);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
}

.pred-icon {
  font-size: 1rem;
}

.pred-label {
  flex: 1;
  color: var(--text-secondary);
}

.pred-dir {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pred-dir.bullish {
  color: var(--up);
}

.pred-dir.bearish {
  color: var(--down);
}

.pred-dir.warning,
.pred-dir.recovering {
  color: var(--accent);
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  margin-bottom: var(--space-sm);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  position: relative;
}

.score-circle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color var(--transition);
  pointer-events: none;
}

.score-circle.bullish {
  border-color: var(--up);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.score-circle.bullish::after {
  border-color: rgba(239, 68, 68, 0.1);
}

.score-circle.bearish {
  border-color: var(--down);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.score-circle.bearish::after {
  border-color: rgba(16, 185, 129, 0.1);
}

.score-circle.neutral {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.score-circle.neutral::after {
  border-color: rgba(197, 160, 89, 0.1);
}

.score-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.score-outlook {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.score-outlook.bullish {
  color: var(--up);
}

.score-outlook.bearish {
  color: var(--down);
}

.score-outlook.neutral {
  color: var(--accent);
}

/* ── Multi-Timeframe Section ────────────────────────────── */
.tf-section {
  margin-bottom: var(--space-lg);
}

.tf-section h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.tf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.tf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-xs);
  text-align: center;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.tf-card:hover {
  border-color: var(--border-strong);
}

.tf-card .tf-icon {
  display: none;
}

.tf-card .tf-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.tf-card .tf-score {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}

.tf-card .tf-outlook {
  font-size: 0.65rem;
  font-weight: 600;
}

.tf-card.bullish {
  border-color: rgba(239, 68, 68, 0.3);
}

.tf-card.bullish .tf-score {
  color: var(--up);
}

.tf-card.bullish .tf-outlook {
  color: var(--up);
}

.tf-card.bearish {
  border-color: rgba(16, 185, 129, 0.3);
}

.tf-card.bearish .tf-score {
  color: var(--down);
}

.tf-card.bearish .tf-outlook {
  color: var(--down);
}

.tf-card.neutral {
  border-color: rgba(197, 160, 89, 0.3);
}

.tf-card.neutral .tf-score {
  color: var(--accent);
}

.tf-card.neutral .tf-outlook {
  color: var(--accent);
}

.tf-card.no-data {
  opacity: 0.4;
}

.tf-card.no-data .tf-score {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.tf-resonance {
  background: rgba(197, 160, 89, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

.tf-resonance .tf-res-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.tf-resonance .tf-res-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.tf-resonance .tf-composite {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── PARM Dimension Bar ──────────────────────────────────── */
.parm-section {
  margin-bottom: var(--space-lg);
}

.parm-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.parm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.parm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.parm-card:hover {
  border-color: var(--border-strong);
}

.parm-card .parm-letter {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.parm-card .parm-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.parm-card .parm-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

.parm-card .parm-max {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
}

.parm-card .parm-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: var(--space-sm);
  background: var(--border);
  overflow: hidden;
}

.parm-card .parm-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease-out;
}

.parm-card .parm-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  letter-spacing: 0.04em;
}

/* ── Signal Alerts ───────────────────────────────────────── */
.alerts {
  margin-bottom: var(--space-lg);
}

.alerts h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.alert-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  transition:
    border-color var(--transition),
    background var(--transition);
}

.alert-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-label {
  font-weight: 600;
  flex: 1;
  font-size: 0.9rem;
}

.alert-level {
  font-size: 0.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alert-level.strong {
  background: rgba(239, 68, 68, 0.12);
  color: var(--up);
}

.alert-level.medium,
.alert-level.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--signal-warning);
}

.alert-level.high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--signal-danger);
}

.alert-level.opportunity {
  background: rgba(99, 102, 241, 0.12);
  color: var(--signal-info);
}

.no-alert {
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-sm) 0;
  font-family: var(--font-heading);
}

/* ── Chart Table ─────────────────────────────────────────── */
.chart-section {
  margin-bottom: var(--space-xl);
}

.chart-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--space-md);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.chart-toggle:hover {
  opacity: 0.8;
}

.chart-toggle .toggle-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.chart-section.collapsed .chart-toggle .toggle-arrow {
  transform: rotate(-90deg);
}

.chart-section .chart-wrap {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 600px;
  opacity: 1;
  overflow: auto;
}

.chart-section.collapsed .chart-wrap {
  max-height: 0;
  opacity: 0;
  border: none;
}

.chart-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.chart-table th {
  background: rgba(14, 14, 26, 0.97);
  color: var(--accent);
  padding: 0.6rem 0.7rem;
  text-align: right;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 2;
}

.chart-table th:first-child {
  text-align: left;
}

.chart-table td {
  padding: 0.45rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.chart-table td:first-child {
  text-align: left;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.chart-table tr:hover td {
  background: var(--surface-hover);
}

.chart-table tr:last-child td {
  border-bottom: none;
}

.price-up {
  color: var(--up);
  font-weight: 600;
}

.price-down {
  color: var(--down);
  font-weight: 600;
}

/* ── Mini Candlestick ────────────────────────────────────── */
.candle-cell {
  width: 36px;
  padding: 4px 0 !important;
  text-align: center !important;
}

.candle-wrap {
  position: relative;
  width: 18px;
  height: 48px;
  margin: 0 auto;
}

.candle-wick {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--text-dim);
}

.candle-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  min-height: 2px;
  border-radius: 1.5px;
}

.candle-body.up {
  background: var(--up);
}

.candle-body.down {
  background: var(--down);
}

.candle-body.doji {
  background: var(--text-dim);
}

/* ── Footer ──────────────────────────────────────────────── */
/* ── Pivot Section ───────────────────────────────────────── */
.pivot-section {
  margin-top: var(--space-xl);
}

.pivot-section h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.pivot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

.pivot-item {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.pivot-item:hover {
  background: var(--surface-hover);
}

.pivot-item .pivot-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.pivot-item .pivot-price {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pivot-item.resistance .pivot-label {
  color: var(--up);
}

.pivot-item.support .pivot-label {
  color: var(--down);
}

.pivot-item.center .pivot-label {
  color: var(--accent);
}

.pivot-item.center {
  border-color: var(--accent-dark);
  background: rgba(197, 160, 89, 0.06);
}

.pivot-current {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.pivot-current span {
  color: var(--accent-light);
  font-weight: 600;
}

/* ── Auth Gate ───────────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  background: var(--bg-primary);
}

.gate-message {
  text-align: center;
  color: var(--text-secondary);
}

.gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.gate-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.25);
}

.gate-logo h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.gate-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-google-login:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.google-icon {
  flex-shrink: 0;
}

/* Gate status screens */
.gate-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.gate-status h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
}

.gate-status p {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 300px;
  text-align: center;
  line-height: 1.6;
}

.gate-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.btn-gate-logout {
  margin-top: var(--space-md);
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gate-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.gate-error {
  color: var(--red);
  font-size: 0.85rem;
}

/* ── User bar (header 右上) ──────────────────────────────── */
.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.user-name {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.btn-logout {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.footer {
  text-align: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}

/* ── Admin Button & Badge ────────────────────────────────── */
.btn-admin {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.admin-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
}

/* ── Admin Modal ─────────────────────────────────────────── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  backdrop-filter: blur(6px);
}

.admin-modal-content {
  background: #1a1f2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.admin-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0;
}

.admin-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.admin-modal-close:hover {
  color: var(--red);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Admin User List ─────────────────────────────────────── */
.admin-user-list {
  overflow-y: auto;
  padding: var(--space-sm);
}

.admin-loading,
.admin-empty,
.admin-error {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-xl);
  font-size: 0.85rem;
}

/* Toolbar: search + sort */
.admin-toolbar {
  padding: 8px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-search-wrap {
  width: 100%;
}

.admin-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: .82rem;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}

.admin-search:focus {
  border-color: var(--accent);
}

.admin-search::placeholder {
  color: #555;
}

.admin-sort-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-sort-label {
  font-size: .7rem;
  color: #666;
  margin-right: 2px;
}

.admin-sort-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: transparent;
  color: #888;
  font-size: .68rem;
  cursor: pointer;
  transition: all .2s;
}

.admin-sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-sort-btn.active {
  background: rgba(201, 164, 74, .12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.admin-stats {
  font-size: .68rem;
  color: #555;
  text-align: right;
}

/* Card: two-row layout */
.admin-user-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.admin-user-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-user-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.admin-user-detail {
  min-width: 0;
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.admin-user-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-left: 46px;
}

.admin-user-meta {
  display: flex;
  gap: 10px;
  font-size: .65rem;
  color: #555;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.admin-status-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-status-tag.pending {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
}

.admin-status-tag.approved {
  background: rgba(0, 200, 83, 0.12);
  color: #4caf50;
}

.admin-status-tag.blocked {
  background: rgba(244, 67, 54, 0.12);
  color: var(--red);
}

.admin-role-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(156, 39, 176, 0.15);
  color: #ba68c8;
  font-weight: 600;
}

.admin-tier-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-tier-tag.pro {
  background: rgba(201, 164, 74, .15);
  color: #e8c97a;
}

.admin-tier-tag.ultra {
  background: rgba(239, 68, 68, .15);
  color: #f59e0b;
}

.btn-approve,
.btn-block {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.btn-approve:hover {
  background: rgba(0, 200, 83, 0.12);
  border-color: #4caf50;
  color: #4caf50;
}

.btn-block:hover {
  background: rgba(244, 67, 54, 0.12);
  border-color: var(--red);
  color: var(--red);
}

.btn-upgrade,
.btn-downgrade {
  padding: 3px 8px;
  border-radius: var(--radius);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all .2s;
}

.btn-upgrade {
  border-color: rgba(99, 102, 241, .3);
  background: rgba(99, 102, 241, .08);
  color: #a78bfa;
}

.btn-upgrade:hover {
  background: rgba(99, 102, 241, .2);
}

.btn-downgrade {
  border-color: rgba(201, 164, 74, .3);
  background: rgba(201, 164, 74, .08);
  color: var(--accent);
}

.btn-downgrade:hover {
  background: rgba(201, 164, 74, .2);
}

/* ── Admin Toast Notification ────────────────────────────── */
.admin-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  pointer-events: none;
}

.admin-toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(120%);
  opacity: 0;
  animation: toastIn 0.4s ease forwards;
  pointer-events: auto;
  max-width: 320px;
}

.admin-toast-item.fade-out {
  animation: toastOut 0.4s ease forwards;
}

.admin-toast-item .toast-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.admin-toast-item .toast-body {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.toast-highlight {
  color: var(--accent);
  font-weight: 700;
}

.toast-pending {
  color: var(--red);
  font-weight: 700;
}

@keyframes toastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ── In-App Browser Guidance ─────────────────────────────── */
.gate-status.inapp h2 {
  color: var(--accent);
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--space-md);
}

.btn-copy-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.gate-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: var(--space-md);
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header-avatar {
    width: 72px;
    height: 72px;
  }

  .input-section {
    flex-direction: column;
  }

  .score-trio {
    gap: var(--space-sm);
  }

  .score-mini {
    width: 90px;
    height: 90px;
  }

  .mini-value {
    font-size: 1.5rem;
  }

  .mini-label {
    font-size: 0.55rem;
  }

  .score-circle {
    width: 130px;
    height: 130px;
  }

  .score-value {
    font-size: 2.2rem;
  }

  .prediction-section {
    padding: var(--space-md);
  }

  .prediction-outlook {
    font-size: 1.1rem;
  }

  .parm-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .parm-card {
    padding: var(--space-sm) 2px;
  }

  .parm-card .parm-letter {
    font-size: 1rem;
  }

  .parm-card .parm-name {
    font-size: 0.55rem;
  }

  .parm-card .parm-value {
    font-size: 0.82rem;
  }

  .parm-card .parm-desc {
    font-size: 0.5rem;
  }

  .pivot-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .pivot-item {
    padding: var(--space-sm) 2px;
  }

  .pivot-item .pivot-label {
    font-size: 0.62rem;
  }

  .pivot-item .pivot-price {
    font-size: 0.78rem;
  }

  .chart-table {
    font-size: 0.72rem;
  }

  .chart-table th,
  .chart-table td {
    padding: 0.35rem 0.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   Scanner — 批量潛力股掃描
   ═══════════════════════════════════════════════════════════ */

/* ── Scan Button ────────────────────────────────────────── */
.btn-scan {
  padding: 0.85rem 1.4rem;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-scan:hover {
  background: rgba(197, 160, 89, 0.12);
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.btn-scan:active {
  transform: translateY(0);
}

.btn-scan:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Scanner Section ────────────────────────────────────── */
.scanner-section {
  margin-bottom: var(--space-xl);
  animation: fadeIn 0.4s ease;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.scanner-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.scanner-header h2 {
  margin: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.scanner-header h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
}

.scanner-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-rescan {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-dim);
}

.btn-rescan:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

/* ── Scanner Tabs ───────────────────────────────────────── */
.scanner-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  padding: var(--space-xs) 0;
}

.scanner-tab {
  flex: 1;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.scanner-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.scanner-tab.active {
  background: rgba(197, 160, 89, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.15);
}

.scanner-tab .tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.scanner-tab.active .tab-count {
  background: rgba(197, 160, 89, 0.25);
}

/* ── Scanner List ───────────────────────────────────────── */
.scanner-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* scanner-list 捲軸美化 */
.scanner-list::-webkit-scrollbar {
  width: 5px;
}

.scanner-list::-webkit-scrollbar-track {
  background: transparent;
}

.scanner-list::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.25);
  border-radius: 4px;
}

.scanner-list::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 160, 89, 0.45);
}

.scanner-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-style: italic;
}

/* ── Stock Card ─────────────────────────────────────────── */
.scan-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.75rem var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.scan-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.scan-card .scan-rank {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
}

.scan-card .scan-score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid;
}

.scan-card .scan-score.tier-A {
  color: var(--up);
  border-color: var(--up);
  background: var(--up-bg);
}

.scan-card .scan-score.tier-B {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(197, 160, 89, 0.1);
}

.scan-card .scan-score.tier-C {
  color: var(--signal-info);
  border-color: var(--signal-info);
  background: rgba(99, 102, 241, 0.1);
}

.scan-card .scan-info {
  flex: 1;
  min-width: 0;
}

.scan-card .scan-code {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-light);
}

.scan-card .scan-name {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-card .scan-resonance {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ── Scanner Loading ────────────────────────────────────── */
.scanner-loading {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.scanner-loading .scan-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

.scanner-loading p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.scanner-loading .scan-progress {
  margin-top: var(--space-md);
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.scan-progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.scan-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #f0c060, var(--accent));
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
  animation: scanBarShimmer 2s ease-in-out infinite;
}

@keyframes scanBarShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.scan-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.scan-progress-pct {
  color: var(--accent);
  font-weight: 600;
}

.scan-progress-msg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: var(--space-xs);
  min-height: 1.2em;
  transition: opacity 0.3s ease;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .btn-scan {
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
  }

  .scanner-header h2 {
    font-size: 1.1rem;
  }

  .scanner-tab {
    padding: 0.55rem 0.5rem;
    font-size: 0.78rem;
  }

  .scan-card {
    padding: 0.6rem var(--space-sm);
    gap: var(--space-sm);
  }

  .scan-card .scan-score {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .scan-card .scan-code {
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   Ultra Tier Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Ultra Badge (header) ────────────────────────────────── */
.pro-badge.ultra-badge {
  background: linear-gradient(135deg, #6366f1, #a78bfa, #ec4899, #6366f1);
  background-size: 300% 100%;
  box-shadow:
    0 0 16px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: ultraShimmer 3s ease-in-out infinite;
  color: #fff;
}

@keyframes ultraShimmer {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* ── Ultra Section ───────────────────────────────────────── */
.ultra-section {
  margin-bottom: var(--space-lg);
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.ultra-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #ec4899);
}

/* ── 收合功能 ── */
.ultra-section[data-collapsible]>*:not(.ultra-header) {
  transition: opacity 0.2s ease, max-height 0.3s ease;
  overflow: hidden;
}

.ultra-section.collapsed>*:not(.ultra-header) {
  display: none;
}

.ultra-section.collapsed {
  padding-bottom: 8px;
}

.ultra-section.collapsed .ultra-header {
  margin-bottom: 0;
}

.collapse-chevron {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  margin-left: 8px;
  user-select: none;
}

.ultra-section.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

/* ── 🔒 蓄能中狀態 ── */
.section-collecting .collapse-chevron {
  display: none;
}

.section-collecting .ultra-header {
  cursor: default;
}

.section-collecting.collapsed>*:not(.ultra-header) {
  display: block;
}

.section-collecting .ultra-tag::after {
  content: ' · 蓄能中';
  font-size: 0.7rem;
  opacity: 0.7;
}

.collecting-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.collecting-icon {
  font-size: 1.6rem;
  opacity: 0.5;
}

.collecting-info {
  flex: 1;
}

.collecting-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 4px;
}

.collecting-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.collecting-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collecting-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.collecting-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.5s ease;
}

.collecting-pct {
  font-size: 0.72rem;
  color: var(--text-dim);
  width: 32px;
  text-align: right;
}

.collecting-countdown {
  font-size: 0.75rem;
  color: #a78bfa;
  margin-top: 6px;
}

.collecting-countdown strong {
  color: #c4b5fd;
}

/* ── 🔱 Trident 三叉戟 ── */
.trident-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  margin-bottom: 12px;
}

.trident-verdict.trident-buy {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.trident-verdict.trident-sell {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.trident-verdict-emoji {
  font-size: 2rem;
}

.trident-verdict-info {
  flex: 1;
}

.trident-verdict-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.trident-verdict-action {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.trident-confidence-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.trident-confidence-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.trident-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

.trident-ring-fg {
  fill: none;
  stroke: #6366f1;
  stroke-width: 3;
  stroke-linecap: round;
}

.trident-buy .trident-ring-fg {
  stroke: #10b981;
}

.trident-sell .trident-ring-fg {
  stroke: #ef4444;
}

.trident-confidence-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Trident Hold Info（hold 狀態顯示收斂 + 天數）── */
.trident-hold-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.trident-hold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trident-hold-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 500;
}

.trident-hold-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}


.trident-arm-grid {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.trident-arm-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.trident-arm-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.trident-arm-row:last-child {
  border-bottom: none;
}

.trident-arm-frame {
  color: var(--text-dim);
  font-weight: 500;
}

.trident-arm-cell {
  text-align: center;
}

.guard-pass {
  color: #10b981;
  font-size: 0.78rem;
}

.guard-warn {
  color: #f59e0b;
  font-size: 0.78rem;
}

.guard-block {
  color: #ef4444;
  font-size: 0.78rem;
}

.trident-proximity {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.trident-prox-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.trident-prox-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trident-prox-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trident-prox-side-label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.trident-prox-side-label.buy-label {
  color: #ef4444;
}

.trident-prox-side-label.sell-label {
  color: #22c55e;
}

.trident-prox-label {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.trident-prox-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trident-prox-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trident-prox-name {
  width: 14px;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.trident-prox-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.trident-prox-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.trident-prox-fill.buy {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.trident-prox-fill.sell {
  background: linear-gradient(90deg, #22c55e, #6ee7b7);
}

.trident-prox-val {
  width: 36px;
  text-align: right;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.trident-prox-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0.7;
}

/* ── Resonance 共振判讀 ── */
.trident-resonance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.resonance-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.resonance-tag.bull {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.resonance-tag.bear {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.resonance-tag.neutral {
  background: rgba(250, 204, 21, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.prox-status {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 4px;
}

.trident-followthru {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trident-followthru.ft-good {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
}

.trident-followthru.ft-bad {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.15);
}

.trident-followthru.ft-neutral {
  background: rgba(99, 102, 241, 0.04);
}

.trident-ft-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.trident-ft-verdict {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.trident-ft-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.trident-ft-reason {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.ultra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.ultra-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: #a78bfa;
  font-size: 0.95rem;
}

.ultra-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
}

/* ── Strategy Simulation ────────────────────────────────── */
.strategy-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

/* Timeframe toggle row */
.strat-tf-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.strat-tf-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: #777;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.strat-tf-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: #bbb;
}

.strat-tf-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(167, 139, 250, .10));
  border-color: rgba(99, 102, 241, .35);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(99, 102, 241, .08);
}

.strat-tf-sub {
  font-size: .6rem;
  font-weight: 400;
  opacity: .65;
}

.strat-tab {
  flex: 1;
  padding: 7px 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: #888;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.strat-tab.active {
  background: rgba(99, 102, 241, .15);
  border-color: rgba(99, 102, 241, .4);
  color: #c4b5fd;
  box-shadow: 0 0 8px rgba(99, 102, 241, .25);
}

/* 布倉策略 active = 綠色調（台股紅漲綠跌，綠=進場=安全） */
.strat-tab.active[data-tab="entry"] {
  background: rgba(39, 174, 96, .15);
  border-color: rgba(39, 174, 96, .5);
  color: #6ee7a0;
  box-shadow: 0 0 10px rgba(39, 174, 96, .2);
}

/* 出場策略 active = 紅色調（出場=警覺） */
.strat-tab.active[data-tab="exit"] {
  background: rgba(231, 76, 60, .15);
  border-color: rgba(231, 76, 60, .5);
  color: #f87171;
  box-shadow: 0 0 10px rgba(231, 76, 60, .2);
}

.strat-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.strat-type-emoji {
  font-size: 1.1rem;
}

.strat-type-name {
  font-size: .9rem;
  font-weight: 800;
  color: #ddd;
}

.strat-desc {
  font-size: .75rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 12px;
}

.strat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.strat-row:last-of-type {
  border-bottom: none;
}

.strat-label {
  font-size: .75rem;
  color: #888;
  font-weight: 500;
}

.strat-value {
  font-size: .8rem;
  color: #ddd;
  font-weight: 700;
  font-family: var(--font-heading);
}

.strat-zone-val {
  color: #a78bfa;
}

.strat-target {
  color: #27ae60;
}

.strat-stop {
  color: #e74c3c;
}

.strat-confidence-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.strat-confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

.strat-triggers-title {
  font-size: .72rem;
  color: #888;
  font-weight: 600;
  margin: 12px 0 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.strat-triggers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strat-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .72rem;
  background: rgba(255, 255, 255, .03);
}

.strat-trigger-critical {
  background: rgba(231, 76, 60, .08);
  color: #e74c3c;
}

.strat-trigger-warning {
  background: rgba(243, 156, 18, .08);
  color: #f39c12;
}

.strat-trigger-info {
  background: rgba(52, 152, 219, .08);
  color: #6aa3d6;
}

.strategy-disclaimer {
  font-size: .65rem;
  color: #555;
  text-align: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .04);
}

/* ── Strategy: Personalization ──────────────────────────── */
.strat-personal {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(99, 102, 241, .2);
}

.strat-personal-title {
  font-size: .78rem;
  color: #a78bfa;
  font-weight: 700;
  margin-bottom: 10px;
}

.strat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.strat-input-label {
  font-size: .72rem;
  color: #888;
  min-width: 60px;
  white-space: nowrap;
}

.strat-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: 0 8px;
  transition: border-color .2s;
}

.strat-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, .4);
}

.strat-input-prefix,
.strat-input-suffix {
  font-size: .68rem;
  color: #666;
  white-space: nowrap;
}

.strat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ddd;
  font-size: .78rem;
  font-family: var(--font-heading);
  padding: 6px 4px;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.strat-input::-webkit-outer-spin-button,
.strat-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.strat-input::placeholder {
  color: #555;
}

.strat-calc-result {
  margin-top: 8px;
}

.strat-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: .72rem;
  color: #888;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
}

.strat-calc-row:last-child {
  border-bottom: none;
}

.strat-calc-val {
  font-weight: 700;
  font-family: var(--font-heading);
  color: #ddd;
}

.strat-calc-highlight {
  background: rgba(255, 255, 255, .03);
  border-radius: 6px;
  padding: 8px 10px !important;
  margin-bottom: 4px;
  border-left: 3px solid;
}

.strat-calc-warn {
  color: #f39c12;
  font-size: .72rem;
  padding: 6px 0;
}

/* ── Pattern Card ────────────────────────────────────────── */
.pattern-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}

.pattern-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

.pattern-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.pattern-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Volume Grid ─────────────────────────────────────────── */
.vol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.vol-stat {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

.vol-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.vol-stat-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.vol-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vol-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
}

.vol-signal.strong {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--up);
}

.vol-signal.warning {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--signal-warning);
}

.vol-signal.info {
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--signal-info);
}

.vol-signal.caution {
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--signal-warning);
}

/* ── PARM History Canvas ─────────────────────────────────── */
#parmHistoryCanvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ── Ultra Locked Teaser ─────────────────────────────────── */
.ultra-locked {
  margin-bottom: var(--space-lg);
  background: rgba(99, 102, 241, 0.03);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.ultra-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(99, 102, 241, 0.02),
      rgba(167, 139, 250, 0.04),
      rgba(236, 72, 153, 0.02));
  pointer-events: none;
}

.ultra-locked-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
}

.ultra-locked-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: var(--space-xs);
}

.ultra-locked-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.ultra-locked-cta {
  margin-top: 14px;
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 2px 12px rgba(99, 102, 241, .3);
}

.ultra-locked-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, .45);
}

/* ── Upgrade Modal ──────────────────────────────────────── */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(10px);
  padding: 16px;
}

.upgrade-modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(165deg, #1c1520 0%, #1a1125 30%, #18101e 60%, #1a0f14 100%);
  border: 1px solid rgba(245, 158, 11, .12);
  border-radius: 24px;
  padding: 32px 24px 28px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .55),
    0 0 60px rgba(245, 158, 11, .06),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: upgradeSlideIn .4s cubic-bezier(.16, 1, .3, 1);
}

@keyframes upgradeSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Glow orbs */
.upgrade-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.upgrade-glow-1 {
  width: 180px;
  height: 180px;
  top: -40px;
  right: -40px;
  background: radial-gradient(circle, rgba(245, 158, 11, .12), transparent 70%);
  animation: orbFloat1 6s ease-in-out infinite;
}

.upgrade-glow-2 {
  width: 140px;
  height: 140px;
  bottom: 30px;
  left: -30px;
  background: radial-gradient(circle, rgba(239, 68, 68, .1), transparent 70%);
  animation: orbFloat2 8s ease-in-out infinite;
}

@keyframes orbFloat1 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-15px, 15px);
  }
}

@keyframes orbFloat2 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(12px, -12px);
  }
}

.upgrade-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #555;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all .2s;
  z-index: 2;
}

.upgrade-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

/* Header */
.upgrade-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.upgrade-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}

.upgrade-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, #f59e0b, #ef4444, #f59e0b) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: ringRotate 4s linear infinite;
}

@keyframes ringRotate {
  to {
    transform: rotate(360deg);
  }
}

.upgrade-icon {
  font-size: 1.8rem;
  position: relative;
  z-index: 1;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.upgrade-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 6px;
  animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.upgrade-subtitle {
  font-size: .8rem;
  color: #888;
  margin: 0;
  letter-spacing: .02em;
}

/* Pricing Cards */
.upgrade-pricing {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.pricing-card {
  flex: 1;
  position: relative;
  padding: 18px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1.5px solid rgba(255, 255, 255, .06);
  text-align: center;
  cursor: pointer;
  transition: all .3s cubic-bezier(.16, 1, .3, 1);
}

.pricing-card:hover {
  background: rgba(255, 255, 255, .05);
  transform: translateY(-2px);
}

.pricing-card.active {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .06);
  box-shadow: 0 4px 24px rgba(245, 158, 11, .12);
}

.pricing-card.best-value .pricing-badge {
  display: block;
}

.pricing-badge {
  display: none;
  position: absolute;
  top: -9px;
  right: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(239, 68, 68, .3);
}

.pricing-label {
  font-size: .7rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 6px;
}

.pricing-amount {
  font-size: .85rem;
  color: #aaa;
  font-weight: 600;
}

.pricing-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: #e8e0d8;
}

.pricing-card.active .pricing-number {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-period {
  font-size: .66rem;
  color: #666;
  margin-top: 3px;
}

/* Divider */
.upgrade-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.upgrade-divider::before,
.upgrade-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, .15), transparent);
}

.upgrade-divider-text {
  font-size: .68rem;
  font-weight: 600;
  color: #777;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Feature Table */
.upgrade-features {
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.feature-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .75rem;
  transition: background .15s;
}

.feature-row:hover {
  background: rgba(255, 255, 255, .03);
}

.feature-row:nth-child(even) {
  background: rgba(255, 255, 255, .015);
}

.feature-row.header-row {
  font-weight: 700;
  color: #888;
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.feature-row.ultra-only {
  background: rgba(245, 158, 11, .03);
}

.feature-row.ultra-only:hover {
  background: rgba(245, 158, 11, .06);
}

.feature-section-label {
  font-size: .62rem;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 10px 4px;
  opacity: .7;
}

.feature-name {
  flex: 1;
  color: #bbb;
}

.feature-pro,
.feature-ultra {
  width: 52px;
  text-align: center;
  font-size: .8rem;
}

.feature-pro {
  color: #666;
}

.feature-ultra {
  color: #f59e0b;
}

/* Tier Badge Labels in header */
.tier-label-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tier-label-badge.pro-label {
  background: linear-gradient(135deg, #c5a059, #e8c97a);
  color: #0a0a0a;
}

.tier-label-badge.ultra-label {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

/* CTA Area */
.upgrade-cta-area {
  text-align: center;
  position: relative;
  z-index: 1;
}

.upgrade-cta-btn {
  position: relative;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  overflow: hidden;
  transition: all .3s cubic-bezier(.16, 1, .3, 1);
  box-shadow: 0 6px 24px rgba(239, 68, 68, .3);
}

.upgrade-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(239, 68, 68, .4);
}

.upgrade-cta-btn:active {
  transform: translateY(0);
}

.cta-text {
  position: relative;
  z-index: 1;
}

.cta-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
  animation: ctaShine 3s ease-in-out infinite;
}

@keyframes ctaShine {
  0% {
    left: -100%;
  }

  50% {
    left: 150%;
  }

  100% {
    left: 150%;
  }
}

.upgrade-note {
  font-size: .66rem;
  color: #666;
  margin: 12px 0 0;
  line-height: 1.6;
}

/* ── Admin Tier Tags ─────────────────────────────────────── */
.admin-tier-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.admin-tier-tag.pro {
  background: rgba(197, 160, 89, 0.12);
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.admin-tier-tag.ultra {
  background: rgba(99, 102, 241, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-upgrade {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.1);
  color: #a78bfa;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-upgrade:hover {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.btn-downgrade {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 6px;
  background: rgba(197, 160, 89, 0.1);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-downgrade:hover {
  background: rgba(197, 160, 89, 0.2);
}

/* ── Ultra Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
  .vol-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pattern-card {
    gap: var(--space-sm);
  }

  .pattern-emoji {
    font-size: 1.5rem;
  }

  .pattern-name {
    font-size: 0.95rem;
  }

  .ultra-section {
    padding: var(--space-sm) var(--space-md);
  }
}

/* ── 淨力道指標 ──────────────────────────────────────────── */
.net-strength-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.8rem;
}

.net-strength-label {
  color: var(--text-muted);
}

.net-strength-value {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.net-strength-value.bullish {
  color: var(--up);
  background: rgba(39, 174, 96, 0.1);
}

.net-strength-value.bearish {
  color: var(--down);
  background: rgba(231, 76, 60, 0.1);
}

.net-strength-value.neutral {
  color: var(--accent);
  background: rgba(201, 164, 74, 0.1);
}

/* ── 法律免責聲明 ────────────────────────────────────────── */
.legal-footer {
  max-width: 600px;
  margin: var(--space-xl) auto var(--space-md);
  padding: 0 var(--space-md);
}

.legal-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-md);
  text-align: center;
}

.legal-disclaimer p {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.6;
  margin: 0 0 var(--space-xs);
  opacity: 0.7;
}

.legal-disclaimer strong {
  color: #f39c12;
  opacity: 1;
}

.legal-sub {
  font-size: 0.65rem !important;
  opacity: 0.5 !important;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   Help Tooltip — Bottom Sheet
   ═══════════════════════════════════════════════════════════ */

/* ── Help Icon (ⓘ) ──────────────────────────────────────── */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.help-icon:hover {
  background: rgba(197, 160, 89, 0.3);
  transform: scale(1.15);
}

.help-icon:active {
  transform: scale(0.95);
}

/* ── Help Overlay ────────────────────────────────────────── */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.help-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Help Bottom Sheet ───────────────────────────────────── */
.help-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20001;
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem 2rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.help-sheet.open {
  transform: translateY(0);
}

.help-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.help-sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
}

.help-sheet-title .help-emoji {
  font-size: 1.3rem;
}

.help-sheet-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}

.help-sheet-body p {
  margin-bottom: 0.7rem;
}

.help-sheet-body strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Help Body Tags ──────────────────────────────────────── */
.help-sheet-body .help-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0.15rem;
}

.help-tag.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--up);
}

.help-tag.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--down);
}

.help-tag.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.help-tag.gold {
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent);
}

/* ── Help Scale Bar ──────────────────────────────────────── */
.help-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.8rem 0;
}

.help-scale-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--down), #f59e0b, var(--up));
}

/* ── Help Sheet Responsive ───────────────────────────────── */
@media (min-width: 601px) {
  .help-sheet {
    max-width: 480px;
    left: 50%;
    transform: translate(-50%, 100%);
    border-radius: 20px 20px 0 0;
  }

  .help-sheet.open {
    transform: translate(-50%, 0);
  }
}

/* ═══════════════════════════════════════════════════════════
   Donation Banner & Query Prompt
   ═══════════════════════════════════════════════════════════ */

/* ── Donation Footer Banner ──────────────────────────────── */
.donate-banner {
  max-width: 480px;
  margin: var(--space-xl) auto var(--space-md);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.donate-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(197, 160, 89, 0.03),
      rgba(197, 160, 89, 0.08),
      rgba(197, 160, 89, 0.03));
  pointer-events: none;
}

.donate-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.donate-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.donate-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.donate-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-donate.primary {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.2), rgba(197, 160, 89, 0.35));
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.4);
}

.btn-donate.primary:hover {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.3), rgba(197, 160, 89, 0.5));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(197, 160, 89, 0.2);
}

.btn-donate.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-donate.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Donate Modal ─────────────────────────────────────── */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px);
  padding: 16px
}

.donate-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(35, 35, 38, .95);
  border-radius: 16px;
  border: 1px solid rgba(201, 164, 74, .2);
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5)
}

.donate-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1
}

.donate-modal-close:hover {
  color: #e8e0d0
}

.donate-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c9a44a;
  margin-bottom: 16px;
  text-align: center
}

.donate-bank-info {
  background: rgba(201, 164, 74, .06);
  border: 1px solid rgba(201, 164, 74, .15);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px
}

.donate-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: .85rem
}

.donate-bank-row span {
  color: #888
}

.donate-bank-row strong {
  color: #e8e0d0;
  font-family: var(--font-mono);
  letter-spacing: .04em
}

.donate-form-divider {
  text-align: center;
  font-size: .75rem;
  color: #888;
  margin-bottom: 14px;
  position: relative
}

.donate-form-divider::before,
.donate-form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: rgba(255, 255, 255, .08)
}

.donate-form-divider::before {
  left: 0
}

.donate-form-divider::after {
  right: 0
}

.donate-field {
  margin-bottom: 12px
}

.donate-field label {
  display: block;
  font-size: .75rem;
  color: #999;
  margin-bottom: 4px
}

.donate-field input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #e8e0d0;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box
}

.donate-field input:focus {
  border-color: rgba(201, 164, 74, .4)
}

.donate-field input::placeholder {
  color: #555
}

.donate-submit-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c9a44a, #b8933f);
  color: #1a1a1d;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  margin-top: 4px
}

.donate-submit-btn:hover {
  box-shadow: 0 0 12px rgba(201, 164, 74, .3)
}

.donate-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed
}

.donate-footer-note {
  text-align: center;
  font-size: .75rem;
  color: #666;
  margin-top: 14px
}

/* ── Gentle Query Prompt ─────────────────────────────────── */
.query-prompt {
  margin: var(--space-md) 0;
  padding: var(--space-md) var(--space-lg);
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: promptSlide 0.4s ease;
  position: relative;
}

@keyframes promptSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.query-prompt-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

.query-prompt-text strong {
  color: var(--accent);
}

.query-prompt .btn-donate {
  flex-shrink: 0;
}

.btn-prompt-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.btn-prompt-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Supporter Badge ─────────────────────────────────────── */
.supporter-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.12);
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-left: 6px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════
   ⚡ ACTION SIGNAL
   ═══════════════════════════════════════════════════════ */
.action-signal-card {
  background: rgba(45, 45, 48, .85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  border-left: 5px solid var(--accent);
  position: relative
}

.action-signal-card.bullish {
  border-left-color: #e74c3c
}

.action-signal-card.bearish {
  border-left-color: #27ae60
}

.action-signal-card.neutral {
  border-left-color: #f39c12
}

.action-signal-card.breakout {
  border-left-color: #c9a44a;
  background: rgba(201, 164, 74, .08)
}

.action-signal-card.risk {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, .06)
}

.action-signal-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px
}

.action-signal-emoji {
  font-size: 1.6rem
}

.action-signal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8e0d0
}

.action-signal-card.bullish .action-signal-title {
  color: #e74c3c
}

.action-signal-card.bearish .action-signal-title {
  color: #27ae60
}

.action-signal-card.neutral .action-signal-title {
  color: #f39c12
}

.action-signal-card.breakout .action-signal-title {
  color: #c9a44a
}

.action-signal-factors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding-left: 4px
}

.action-signal-factor {
  font-size: .82rem;
  color: #b8b0a0;
  line-height: 1.4
}

.action-signal-factor::before {
  content: '• ';
  color: #605848
}

.action-confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px
}

.action-confidence-label {
  font-size: .78rem;
  color: #9a9a9a;
  min-width: 72px
}

.action-confidence-bar {
  flex: 1;
  height: 6px;
  background: rgba(80, 80, 82, .5);
  border-radius: 3px;
  overflow: hidden
}

.action-confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease
}

.action-confidence-fill.high {
  background: linear-gradient(90deg, #27ae60, #2ecc71)
}

.action-confidence-fill.mid {
  background: linear-gradient(90deg, #f39c12, #e67e22)
}

.action-confidence-fill.low {
  background: linear-gradient(90deg, #e74c3c, #c0392b)
}

.action-confidence-value {
  font-size: .85rem;
  font-weight: 700;
  color: #e8e0d0;
  min-width: 36px;
  text-align: right
}

.action-signal-disclaimer {
  font-size: .7rem;
  color: #666;
  margin-top: 6px;
  text-align: center
}

/* ═══════════════════════════════════════════════════════
   🏆 BACKTEST
   ═══════════════════════════════════════════════════════ */
.backtest-card {
  background: rgba(45, 45, 48, .7);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px
}

.backtest-title {
  font-size: .9rem;
  font-weight: 700;
  color: #c9a44a;
  margin-bottom: 10px
}

.backtest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.backtest-stat {
  text-align: center;
  padding: 10px;
  background: rgba(60, 60, 62, .5);
  border-radius: 10px
}

.backtest-stat-label {
  font-size: .7rem;
  color: #9a9a9a;
  margin-bottom: 4px
}

.backtest-stat-value {
  font-size: 1.1rem;
  font-weight: 700
}

.backtest-stat-value.positive {
  color: #e74c3c
}

.backtest-stat-value.negative {
  color: #27ae60
}

.backtest-stat-value.neutral {
  color: #f39c12
}

.backtest-disclaimer {
  font-size: .65rem;
  color: #555;
  margin-top: 8px;
  text-align: center
}

/* ═══════════════════════════════════════════════════════
   📋 WATCHLIST
   ═══════════════════════════════════════════════════════ */
.watchlist-section {
  margin-top: 16px
}

.watchlist-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(45, 45, 48, .6);
  border-radius: 12px;
  border: 1px solid rgba(201, 164, 74, .15);
  color: #e8e0d0;
  font-size: .9rem;
  font-weight: 600;
  width: 100%;
  text-align: left;
  transition: all .2s
}

.watchlist-toggle:hover {
  background: rgba(201, 164, 74, .1)
}

.watchlist-toggle .wl-count {
  margin-left: auto;
  font-size: .75rem;
  color: #9a9a9a
}

.watchlist-panel {
  display: none;
  margin-top: 8px;
  background: rgba(35, 35, 38, .8);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(201, 164, 74, .1)
}

.watchlist-panel.open {
  display: block
}

.watchlist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 20px
}

.watchlist-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: rgba(201, 164, 74, .1);
  border: 1px solid rgba(201, 164, 74, .2);
  border-radius: 20px;
  font-size: .78rem;
  color: #e8e0d0;
  cursor: pointer;
  transition: all .15s
}

.watchlist-chip:hover {
  background: rgba(201, 164, 74, .2)
}

.watchlist-chip .wl-remove {
  font-size: .65rem;
  color: #999;
  margin-left: 2px;
  cursor: pointer
}

.watchlist-chip .wl-remove:hover {
  color: #e74c3c
}

.watchlist-empty {
  font-size: .78rem;
  color: #666;
  text-align: center;
  padding: 8px
}

.watchlist-actions {
  display: flex;
  gap: 8px
}

.btn-watchlist-add {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(201, 164, 74, .3);
  background: transparent;
  color: var(--accent);
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s
}

.btn-watchlist-add:hover {
  background: rgba(201, 164, 74, .08)
}

.btn-watchlist-report {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c9a44a, #b8933f);
  color: #1a1a1d;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.btn-watchlist-report:hover {
  transform: scale(1.02)
}

.wl-report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 900;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  overflow-y: auto
}

.wl-report-overlay.open {
  display: flex
}

.wl-report {
  background: rgba(35, 35, 38, .95);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 20px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid rgba(201, 164, 74, .15)
}

.wl-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px
}

.wl-report-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a44a
}

.wl-report-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer
}

.wl-report-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(60, 60, 62, .4);
  border-radius: 10px;
  margin-bottom: 6px
}

.wl-report-score {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0
}

.wl-report-score.bullish {
  background: rgba(231, 76, 60, .15);
  color: #e74c3c
}

.wl-report-score.bearish {
  background: rgba(39, 174, 96, .15);
  color: #27ae60
}

.wl-report-score.neutral {
  background: rgba(243, 156, 18, .15);
  color: #f39c12
}

.wl-report-info {
  flex: 1
}

.wl-report-name {
  font-size: .85rem;
  font-weight: 600;
  color: #e8e0d0
}

.wl-report-meta {
  font-size: .72rem;
  color: #9a9a9a
}

.wl-report-loading {
  text-align: center;
  padding: 30px;
  color: #9a9a9a;
  font-size: .85rem
}

.btn-star {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: transform .2s;
  filter: grayscale(1) opacity(.5)
}

.btn-star:hover {
  transform: scale(1.2);
  filter: grayscale(.5) opacity(.7);
}

.btn-star.active,
.btn-star.active:hover {
  filter: none;
}

.btn-star:active {
  transform: scale(.8);
}

/* ═══════════════════════════════════════════════════════
   🔔 ALERT PANEL
   ═══════════════════════════════════════════════════════ */
.alert-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  filter: opacity(.7);
  transition: all .2s
}

.alert-bell:hover {
  filter: opacity(1);
  transform: scale(1.1)
}

.alert-bell-badge {
  position: absolute;
  top: 0;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #e74c3c;
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px
}

.alert-bell-badge:empty {
  display: none
}

.alert-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 310px;
  height: 100vh;
  background: rgba(30, 30, 32, .96);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(201, 164, 74, .12);
  z-index: 950;
  transition: right .3s ease;
  display: flex;
  flex-direction: column
}

.alert-panel.open {
  right: 0
}

.alert-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(201, 164, 74, .1)
}

.alert-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a44a
}

.alert-panel-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer
}

.alert-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px
}

.alert-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(60, 60, 62, .3);
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid transparent
}

.alert-item.bullish {
  border-left-color: #e74c3c
}

.alert-item.bearish {
  border-left-color: #27ae60
}

.alert-item.warning {
  border-left-color: #f39c12
}

.alert-item.info {
  border-left-color: #3498db
}

.alert-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0
}

.alert-item-content {
  flex: 1
}

.alert-item-text {
  font-size: .8rem;
  color: #e8e0d0;
  line-height: 1.3
}

.alert-item-time {
  font-size: .65rem;
  color: #666;
  margin-top: 3px
}

.alert-empty {
  text-align: center;
  color: #555;
  font-size: .82rem;
  padding: 40px 20px
}

.alert-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 940;
  display: none
}

.alert-panel-overlay.open {
  display: block
}

.alert-clear-btn {
  background: none;
  border: none;
  color: #999;
  font-size: .72rem;
  cursor: pointer;
  padding: 2px 6px
}

.alert-clear-btn:hover {
  color: #e74c3c
}

/* ═══════════════════════════════════════════════════════
   🔬 DISCOVERY RADAR v2
   ═══════════════════════════════════════════════════════ */
.discovery-section {
  margin-top: 16px
}

.discovery-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(99, 102, 241, .08);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, .2);
  color: #a78bfa;
  font-size: .9rem;
  font-weight: 600;
  width: 100%;
  text-align: left;
  transition: all .2s
}

.discovery-toggle:hover {
  background: rgba(99, 102, 241, .15)
}

.discovery-toggle .discovery-count {
  margin-left: auto;
  font-size: .75rem;
  color: #9a9a9a
}

.discovery-panel {
  display: none;
  margin-top: 8px;
  background: rgba(35, 35, 38, .8);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(99, 102, 241, .12)
}

.discovery-panel.open {
  display: block
}

.discovery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px
}

.btn-discovery-trigger {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, .3);
  background: rgba(99, 102, 241, .1);
  color: #a78bfa;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s
}

.btn-discovery-trigger:hover {
  background: rgba(99, 102, 241, .2);
  box-shadow: 0 0 8px rgba(99, 102, 241, .2)
}

.btn-discovery-trigger:disabled {
  opacity: .4;
  cursor: not-allowed
}

.btn-discovery-clear {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(231, 76, 60, .25);
  background: rgba(231, 76, 60, .08);
  color: #e74c3c;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s
}

.btn-discovery-clear:hover {
  background: rgba(231, 76, 60, .18);
  box-shadow: 0 0 8px rgba(231, 76, 60, .15)
}

.disc-ultra-tag {
  display: inline-block;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.discovery-last-update {
  font-size: .7rem;
  color: #666;
  margin-left: auto
}

.csv-file-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, .12);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 700;
  color: #a78bfa;
  white-space: nowrap;
}

.discovery-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 130vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 4px
}

.discovery-cards::-webkit-scrollbar {
  width: 4px
}

.discovery-cards::-webkit-scrollbar-track {
  background: transparent
}

.discovery-cards::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .25);
  border-radius: 4px
}

.discovery-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, .45)
}

.discovery-empty {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: .82rem
}

/* ── Signal Badge ────────────────────────────────── */
.disc-signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  letter-spacing: .02em;
  flex-shrink: 0
}

.disc-signal-badge.signal-hot {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, .3)
}

.disc-signal-badge.signal-up {
  background: rgba(99, 102, 241, .10);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, .25)
}

.disc-signal-badge.signal-new {
  background: rgba(59, 130, 246, .10);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, .25)
}

.disc-signal-badge.signal-warn {
  background: rgba(245, 158, 11, .08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, .25)
}

.disc-signal-badge.signal-default {
  background: rgba(255, 255, 255, .04);
  color: #888;
  border: 1px solid rgba(255, 255, 255, .08)
}

/* ── Discovery Card ──────────────────────────────── */
.disc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(60, 60, 62, .4);
  border-radius: 12px;
  border-left: 4px solid rgba(99, 102, 241, .4);
  transition: all .2s;
  position: relative
}

.disc-card:hover {
  background: rgba(60, 60, 62, .55)
}

.disc-card.suggest-remove {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, .04)
}

.disc-card.dismissed {
  opacity: .4;
  border-left-color: #555
}

.disc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.disc-id {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background .2s;
}

.disc-id:hover {
  background: rgba(255, 255, 255, .08);
}

.disc-id:hover .disc-code {
  color: #ffcc00;
}

.disc-query-icon {
  font-size: .7rem;
  color: #666;
  transition: color .2s, transform .2s;
  flex-shrink: 0;
}

.disc-id:hover .disc-query-icon {
  color: #ffcc00;
  transform: translate(1px, -1px);
}

.disc-code {
  font-size: 1.05rem;
  font-weight: 800;
  color: #e8e0d0;
  font-family: var(--font-mono);
  letter-spacing: .03em;
  flex-shrink: 0
}

.disc-name {
  font-size: .88rem;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.disc-market {
  font-size: .6rem;
  color: #777;
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05)
}

/* ── Rank Info ────────────────────────────────────── */
.disc-rank-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0
}

.disc-rank {
  font-size: 1rem;
  font-weight: 800;
  color: #e8e0d0;
  font-family: var(--font-mono)
}

.disc-rank-trend {
  font-size: .85rem
}

.rank-up {
  font-size: .72rem;
  font-weight: 700;
  color: #ef4444;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(239, 68, 68, .08)
}

.rank-down {
  font-size: .72rem;
  font-weight: 700;
  color: #27ae60;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(39, 174, 96, .08)
}

/* ── Discovery Score Bar ─────────────────────────── */
.disc-score-bar {
  position: relative;
  height: 14px;
  background: rgba(255, 255, 255, .05);
  border-radius: 7px;
  overflow: hidden
}

.disc-score-fill {
  height: 100%;
  border-radius: 8px;
  transition: width .4s ease
}

.disc-score-fill.bullish {
  background: linear-gradient(90deg, rgba(239, 68, 68, .2), rgba(239, 68, 68, .4))
}

.disc-score-fill.bearish {
  background: linear-gradient(90deg, rgba(39, 174, 96, .2), rgba(39, 174, 96, .4))
}

.disc-score-fill.neutral {
  background: linear-gradient(90deg, rgba(99, 102, 241, .2), rgba(99, 102, 241, .4))
}

.disc-score-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 700;
  color: #d4d0c8;
  letter-spacing: .03em
}

/* ── Metrics Row ─────────────────────────────────── */
.disc-metrics {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center
}

.disc-metric {
  font-size: .72rem;
  font-weight: 600;
  color: #999;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .03)
}

.disc-metric.up {
  color: #ef4444;
  background: rgba(239, 68, 68, .06)
}

.disc-metric.down {
  color: #27ae60;
  background: rgba(39, 174, 96, .06)
}

.disc-metric.parm {
  color: #a78bfa;
  background: rgba(99, 102, 241, .08);
  font-weight: 700
}



.disc-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  min-width: 0
}

.disc-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #b8b0a0
}

.disc-tag.reason {
  border-color: rgba(99, 102, 241, .2);
  color: #a78bfa
}

.disc-tag.trend {
  border-color: rgba(197, 160, 89, .2);
  color: var(--accent)
}

.disc-tag.warning {
  border-color: rgba(245, 158, 11, .3);
  color: #f59e0b;
  background: rgba(245, 158, 11, .06)
}

.disc-tag.days {
  color: #888
}

.disc-price {
  font-size: .78rem;
  font-weight: 600;
  color: #b8b0a0;
  flex-shrink: 0
}

.disc-sparkline {
  width: 100%;
  height: 22px;
  margin: 0
}

.disc-card-footer {
  display: flex;
  gap: 4px;
  align-items: center
}

.disc-remove-reason {
  flex: 1;
  font-size: .7rem;
  color: #f59e0b;
  line-height: 1.3
}

.btn-disc-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: none
}

.btn-disc-dismiss {
  background: rgba(231, 76, 60, .1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, .2)
}

.btn-disc-dismiss:hover {
  background: rgba(231, 76, 60, .2)
}

.btn-disc-restore {
  background: rgba(39, 174, 96, .1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, .2)
}

.btn-disc-restore:hover {
  background: rgba(39, 174, 96, .2)
}

.btn-disc-query {
  background: rgba(99, 102, 241, .1);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, .2)
}

.btn-disc-query:hover {
  background: rgba(99, 102, 241, .2)
}

/* ── Discovery Filter Tabs ──────────────────────── */
.disc-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center
}

.disc-filter-btn {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .08);
  background: transparent;
  color: #888;
  transition: all .2s
}

.disc-filter-btn.active {
  background: rgba(99, 102, 241, .12);
  color: #a78bfa;
  border-color: rgba(99, 102, 241, .3)
}

.disc-filter-btn:hover {
  border-color: rgba(99, 102, 241, .2);
  color: #a78bfa
}

.disc-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(231, 76, 60, .2);
  background: rgba(231, 76, 60, .08);
  color: #e74c3c;
  font-size: .72rem;
  cursor: pointer;
  transition: all .2s;
  margin-left: 2px
}

.disc-filter-clear:hover {
  background: rgba(231, 76, 60, .18);
  border-color: rgba(231, 76, 60, .4)
}

/* ── Responsive ─────────────────────────────────── */
@media(max-width:480px) {
  .disc-card-header {
    flex-wrap: wrap
  }

  .disc-name {
    max-width: 100px
  }

  .disc-card-footer {
    flex-wrap: wrap
  }

  .disc-metrics {
    gap: 4px
  }

  .disc-metric {
    font-size: .62rem;
    padding: 1px 5px
  }
}

/* ── Market Pulse ───────────────────────────────── */
.pulse-section {
  margin: 12px 0;
}

.pulse-toggle {
  width: 100%;
  padding: 14px 18px;
  background: rgba(20, 20, 35, .7);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  color: #d0d0dc;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .25s;
}

.pulse-toggle:hover {
  background: rgba(30, 30, 50, .85);
  border-color: rgba(255, 255, 255, .12);
}

.pulse-sentiment {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 700;
}

.pulse-panel {
  padding: 14px 0;
}

.pulse-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 0;
  color: #888;
  font-size: .85rem;
}

/* Gauge Section */
.pulse-gauge-section {
  text-align: center;
  margin-bottom: 18px;
}

.pulse-gauge-wrap {
  position: relative;
  width: 200px;
  height: 110px;
  margin: 0 auto;
  overflow: hidden;
}

.pulse-gauge-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(from 180deg,
      rgba(39, 174, 96, .3) 0deg,
      rgba(245, 158, 11, .3) 90deg,
      rgba(239, 68, 68, .3) 180deg);
  mask: radial-gradient(circle at center, transparent 60%, black 61%);
  -webkit-mask: radial-gradient(circle at center, transparent 60%, black 61%);
}

.pulse-gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 68px;
  background: linear-gradient(to top, #e8e0d0, transparent);
  transform-origin: bottom center;
  border-radius: 2px;
  transition: transform .8s cubic-bezier(.4, 0, .2, 1);
}

.pulse-gauge-center {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8e0d0;
  border: 2px solid rgba(20, 20, 35, .8);
}

.pulse-gauge-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #e8e0d0;
  margin-top: 8px;
}

.pulse-gauge-label {
  font-size: .85rem;
  font-weight: 700;
  margin-top: 2px;
}

.pulse-gauge-sub {
  font-size: .7rem;
  color: #888;
  margin-top: 4px;
}

/* Grid Layout */
.pulse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pulse-box {
  background: rgba(30, 30, 50, .6);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 12px 14px;
}

.pulse-box-title {
  font-size: .72rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 8px;
  letter-spacing: .04em;
}

/* Bull/Bear Bar */
.pulse-bullbear-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pulse-bull-fill {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width .6s;
}

.pulse-neutral-fill {
  background: rgba(255, 255, 255, .1);
}

.pulse-bear-fill {
  background: linear-gradient(90deg, #10b981, #27ae60);
  transition: width .6s;
}

.pulse-bullbear-labels {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  font-weight: 600;
}

.pulse-bull-label {
  color: #ef4444;
}

.pulse-neutral-label {
  color: #888;
}

.pulse-bear-label {
  color: #27ae60;
}

/* PARM Bars */
.pulse-parm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pulse-parm-label {
  font-size: .78rem;
  font-weight: 800;
  width: 18px;
  text-align: center;
  color: #a78bfa;
}

.pulse-parm-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, .06);
  border-radius: 3px;
  overflow: hidden;
}

.pulse-parm-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
  background: linear-gradient(90deg, rgba(99, 102, 241, .4), rgba(167, 139, 250, .6));
}

.pulse-parm-val {
  font-size: .72rem;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
  color: #ccc;
  font-family: var(--font-mono);
}

/* Distribution */
.pulse-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pulse-dist-tier {
  font-size: .78rem;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
}

.pulse-dist-tier.tier-a {
  color: #ef4444;
}

.pulse-dist-tier.tier-b {
  color: #f59e0b;
}

.pulse-dist-tier.tier-c {
  color: #9ca3af;
}

.pulse-dist-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  overflow: hidden;
}

.pulse-dist-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s;
}

.pulse-dist-fill.tier-a {
  background: rgba(239, 68, 68, .4);
}

.pulse-dist-fill.tier-b {
  background: rgba(245, 158, 11, .4);
}

.pulse-dist-fill.tier-c {
  background: rgba(156, 163, 175, .4);
}

.pulse-dist-count {
  font-size: .7rem;
  font-weight: 600;
  color: #999;
  min-width: 30px;
  text-align: right;
}

/* Extremes */
.pulse-extremes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pulse-extreme-box {
  background: rgba(30, 30, 50, .6);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 10px 12px;
}

.pulse-extreme-title {
  font-size: .72rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 6px;
}

.pulse-extreme-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: .75rem;
  cursor: pointer;
  transition: color .2s;
}

.pulse-extreme-item:hover {
  color: #ffcc00;
}

.pulse-extreme-code {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #e8e0d0;
  min-width: 44px;
}

.pulse-extreme-name {
  color: #999;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-extreme-score {
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 24px;
  text-align: right;
}

.pulse-extreme-tier {
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.pulse-extreme-tier.tier-a {
  background: rgba(239, 68, 68, .2);
  color: #ef4444;
}

.pulse-extreme-tier.tier-b {
  background: rgba(245, 158, 11, .2);
  color: #f59e0b;
}

.pulse-extreme-tier.tier-c {
  background: rgba(107, 114, 128, .2);
  color: #9ca3af;
}

@media(max-width:480px) {
  .pulse-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pulse-extremes {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pulse-extreme-box {
    padding: 8px 8px;
  }

  .pulse-extreme-item {
    gap: 4px;
    font-size: .68rem;
    padding: 3px 0;
  }

  .pulse-extreme-code {
    min-width: 36px;
    font-size: .68rem;
  }

  .pulse-extreme-tier {
    display: none;
  }

  .pulse-extreme-score {
    min-width: 20px;
    font-size: .7rem;
  }

  .pulse-gauge-wrap {
    width: 160px;
    height: 90px;
  }

  .pulse-gauge-bg {
    width: 160px;
    height: 160px;
  }

  .pulse-gauge-needle {
    height: 54px;
  }

  .pulse-gauge-value {
    font-size: 1.6rem;
  }
}

/* ── Discovery Tab Bar ──────────────────────────── */
.disc-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, .03);
  border-radius: 10px;
  padding: 3px;
}

.disc-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: #888;
  background: transparent;
  transition: all .2s;
}

.disc-tab.active {
  background: rgba(99, 102, 241, .15);
  color: #a78bfa;
}

.disc-tab:hover:not(.active) {
  color: #bbb;
  background: rgba(255, 255, 255, .04);
}

/* ── Performance Dashboard ──────────────────────── */
.perf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: #888;
  font-size: .85rem;
}

/* Summary Cards */
.perf-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.perf-card {
  background: rgba(30, 30, 50, .6);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: all .2s;
}

.perf-card:hover {
  border-color: rgba(99, 102, 241, .2);
  background: rgba(30, 30, 50, .8);
}

.perf-card-label {
  font-size: .68rem;
  color: #888;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.perf-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #e8e0d0;
}

.perf-card-value.positive {
  color: #ef4444;
}

.perf-card-value.negative {
  color: #27ae60;
}

.perf-card-value.hit-high {
  color: #f59e0b;
}

.perf-card-sub {
  font-size: .65rem;
  color: #666;
  margin-top: 4px;
}

/* Signal Section */
.perf-signal-section {
  margin-bottom: 16px;
}

.perf-signal-title {
  font-size: .78rem;
  font-weight: 700;
  color: #b8b0a0;
  margin-bottom: 8px;
}

.perf-signal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perf-signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .03);
  border-radius: 10px;
}

.perf-signal-label {
  font-size: .78rem;
  font-weight: 700;
  min-width: 100px;
  flex-shrink: 0;
}

.perf-signal-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  overflow: hidden;
}

.perf-signal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

.perf-signal-bar-fill.high {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.perf-signal-bar-fill.medium {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}

.perf-signal-bar-fill.low {
  background: linear-gradient(90deg, #27ae60, #10b981);
}

.perf-signal-stats {
  display: flex;
  gap: 8px;
  font-size: .7rem;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 120px;
  justify-content: flex-end;
}

.perf-signal-hit {
  color: #f59e0b;
}

.perf-signal-return {
  color: #a78bfa;
}

/* Table Section */
.perf-table-section {
  margin-top: 4px;
}

.perf-table-title {
  font-size: .78rem;
  font-weight: 700;
  color: #b8b0a0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perf-table-count {
  font-size: .68rem;
  color: #666;
  font-weight: 500;
}

.perf-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(20, 20, 35, .4);
  border: 1px solid rgba(255, 255, 255, .04);
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.perf-table th {
  padding: 10px 10px;
  text-align: center;
  font-size: .65rem;
  font-weight: 700;
  color: #888;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  white-space: nowrap;
}

.perf-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  color: #ccc;
}

.perf-table tr:hover td {
  background: rgba(255, 255, 255, .03);
}

.perf-table .perf-stock-id {
  text-align: left;
  font-weight: 700;
  color: #e8e0d0;
  cursor: pointer;
}

.perf-table .perf-stock-id:hover {
  color: #ffcc00;
}

.perf-return-positive {
  color: #ef4444;
  font-weight: 700;
}

.perf-return-negative {
  color: #27ae60;
  font-weight: 700;
}

.perf-return-zero {
  color: #888;
}

/* Responsive */
@media(max-width:480px) {
  .perf-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .perf-signal-row {
    flex-wrap: wrap;
  }

  .perf-signal-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .perf-table {
    font-size: .68rem;
  }

  .perf-table th,
  .perf-table td {
    padding: 6px 6px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* ⚖️ COMPARE MODE                                       */
/* ═══════════════════════════════════════════════════════ */

.btn-compare {
  background: none;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-compare:hover {
  background: rgba(167, 139, 250, .15);
  border-color: rgba(167, 139, 250, .3);
}

.btn-compare.active {
  background: rgba(167, 139, 250, .25);
  border-color: rgba(167, 139, 250, .5);
  box-shadow: 0 0 8px rgba(167, 139, 250, .3);
}

.btn-compare:active {
  transform: scale(.85);
}

/* Floating bottom bar */
.compare-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  transition: bottom .35s cubic-bezier(.4, 0, .2, 1);
  width: min(500px, 92vw);
}

.compare-bar.visible {
  bottom: 16px;
}

.compare-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(20, 20, 35, .92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(167, 139, 250, .2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 20px;
  font-size: .72rem;
  color: #ccc;
  background: rgba(255, 255, 255, .04);
}

.compare-chip-x {
  cursor: pointer;
  opacity: .5;
  font-size: .6rem;
}

.compare-chip-x:hover {
  opacity: 1;
}

.compare-go-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}

.compare-go-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.compare-go-btn:not(:disabled):hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(99, 102, 241, .3);
}

/* Overlay & Modal */
.compare-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.compare-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.compare-modal {
  background: rgba(22, 22, 38, .96);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  width: min(560px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.compare-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8e8f0;
  margin: 0;
}

.compare-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.compare-close:hover {
  color: #fff;
}

.compare-body {
  padding: 20px 24px;
}

/* Radar */
.compare-radar-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.compare-radar-wrap canvas {
  display: block;
  margin: 0 auto;
}

.compare-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: .78rem;
  font-weight: 600;
}

/* Table */
.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

.compare-table th,
.compare-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.compare-table th {
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compare-table .compare-label {
  text-align: left;
  color: #999;
  font-weight: 600;
}

.compare-table td:not(.compare-label) {
  color: #e0e0e8;
  font-weight: 600;
}

/* Toast */
.compare-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 22px;
  background: rgba(30, 30, 50, .95);
  border: 1px solid rgba(167, 139, 250, .25);
  border-radius: 12px;
  color: #e0e0e8;
  font-size: .8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 1100;
}

.compare-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .compare-bar {
    width: 96vw;
  }

  .compare-bar-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .compare-chip {
    font-size: .65rem;
    padding: 3px 8px;
  }

  .compare-go-btn {
    padding: 7px 14px;
    font-size: .72rem;
  }

  .compare-modal {
    border-radius: 16px;
  }

  .compare-body {
    padding: 16px;
  }

  .compare-radar-wrap canvas {
    width: 280px;
    height: 280px;
  }

  .compare-legend {
    gap: 10px;
    font-size: .7rem;
  }
}


/* ═══════════════════════════════════════════════════════ */
/* 📊 WATCHLIST DASHBOARD                                  */
/* ═══════════════════════════════════════════════════════ */

.btn-watchlist-dash {
  padding: 6px 14px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.btn-watchlist-dash:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.wl-dash-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.wl-dash-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.wl-dash-modal {
  background: rgba(16, 16, 30, .96);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 20px;
  width: min(800px, 96vw);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.wl-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.wl-dash-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8e8f0;
}

.wl-dash-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-dash-timer {
  font-size: .68rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.wl-dash-refresh,
.wl-dash-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.wl-dash-refresh:hover,
.wl-dash-close:hover {
  color: #fff;
}

.wl-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px 20px 24px;
}

.wl-dash-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: .85rem;
}

/* Dashboard Card */
.wl-dash-card {
  background: rgba(22, 22, 40, .7);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
}

.wl-dash-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.wl-dash-card.bullish {
  border-left: 3px solid rgba(231, 76, 60, .4);
}

.wl-dash-card.bearish {
  border-left: 3px solid rgba(39, 174, 96, .4);
}

.wl-dash-card.neutral {
  border-left: 3px solid rgba(136, 136, 136, .3);
}

.dash-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.dash-score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #e8e8f0;
}

.dash-stock-info {
  min-width: 0;
}

.dash-code {
  font-weight: 800;
  font-size: .85rem;
  color: #e0e0e8;
}

.dash-name {
  font-size: .68rem;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-outlook {
  font-size: .7rem;
  margin-top: 2px;
}

.dash-card-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}

.dash-price {
  font-weight: 700;
  font-size: .82rem;
  color: #d0d0dc;
}

.dash-net {
  font-size: .7rem;
  font-weight: 600;
}

/* PARM mini bars */
.dash-parm-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-parm-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-parm-key {
  width: 12px;
  font-size: .55rem;
  font-weight: 800;
  color: #888;
  text-align: center;
}

.dash-parm-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .05);
  border-radius: 2px;
  overflow: hidden;
}

.dash-parm-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 2px;
  transition: width .4s ease;
}

.dash-parm-val {
  width: 18px;
  font-size: .55rem;
  color: #888;
  text-align: right;
}

@media (max-width: 480px) {
  .wl-dash-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .wl-dash-modal {
    border-radius: 16px;
  }

  .wl-dash-header {
    padding: 14px 16px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* 🔔 NOTIFICATION TOGGLE                                  */
/* ═══════════════════════════════════════════════════════ */

.notif-toggle-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: #888;
  font-size: .65rem;
  cursor: pointer;
  transition: all .2s;
}

.notif-toggle-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: #bbb;
}

.notif-toggle-btn.notif-on {
  background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(167, 139, 250, .2));
  border-color: rgba(167, 139, 250, .3);
  color: #a78bfa;
}

/* ═══════════════════════════════════════════════════════ */
/* 📈 STRATEGY PERFORMANCE TRACKING                        */
/* ═══════════════════════════════════════════════════════ */

.btn-record-pred {
  background: none;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
}

.btn-record-pred:hover {
  background: rgba(251, 191, 36, .15);
  border-color: rgba(251, 191, 36, .3);
}

.btn-record-pred.active {
  background: rgba(251, 191, 36, .25);
  border-color: rgba(251, 191, 36, .5);
  box-shadow: 0 0 8px rgba(251, 191, 36, .3);
}

.btn-record-pred:active {
  transform: scale(.85);
}

.strat-section {
  margin: 12px 0;
}

.strat-toggle {
  width: 100%;
  padding: 12px 18px;
  background: rgba(20, 20, 35, .7);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  color: #d0d0dc;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
}

.strat-toggle:hover {
  background: rgba(30, 30, 50, .8);
  border-color: rgba(255, 255, 255, .1);
}

.strat-ultra-tag {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: .55rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.strat-badge {
  background: #ef4444;
  color: #fff;
  font-size: .55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.strat-panel-body {
  display: none;
  padding: 12px 0;
}

.strat-section.open .strat-panel-body {
  display: block;
}

.strat-footer {
  display: none;
  padding: 4px 0;
}

.strat-section.open .strat-footer {
  display: block;
}

.strat-clear-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
  color: #888;
  font-size: .65rem;
  cursor: pointer;
  transition: all .2s;
}

.strat-clear-btn:hover {
  background: rgba(239, 68, 68, .1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .2);
}

.strat-empty {
  text-align: center;
  padding: 30px;
  color: #666;
  font-size: .78rem;
  line-height: 1.5;
}

/* Stats row */
.strat-stats {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(22, 22, 38, .5);
  border-radius: 12px;
  margin-bottom: 12px;
}

.strat-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.strat-stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e0e0e8;
}

.strat-stat-val.hit-good {
  color: #27ae60;
}

.strat-stat-val.hit-mid {
  color: #f59e0b;
}

.strat-stat-val.hit-low {
  color: #ef4444;
}

.strat-stat-label {
  font-size: .6rem;
  color: #888;
  margin-top: 2px;
}

/* Record cards */
.strat-record {
  background: rgba(22, 22, 38, .5);
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: all .2s;
}

.strat-record.verified {
  border-left: 3px solid rgba(167, 139, 250, .3);
}

.strat-record-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.strat-rec-code {
  font-weight: 800;
  font-size: .78rem;
  color: #e0e0e8;
}

.strat-rec-name {
  font-size: .68rem;
  color: #999;
  flex: 1;
}

.strat-rec-date {
  font-size: .6rem;
  color: #666;
}

.strat-record-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strat-prediction {
  display: flex;
  align-items: center;
  gap: 6px;
}

.strat-pred-score {
  font-weight: 800;
  font-size: .78rem;
  color: #a78bfa;
}

.strat-pred-outlook {
  font-size: .75rem;
}

.strat-pred-price {
  font-size: .72rem;
  color: #999;
}

.strat-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strat-result-price {
  font-size: .72rem;
  font-weight: 700;
}

.strat-hit {
  font-size: .65rem;
  font-weight: 700;
}

.strat-hit.yes {
  color: #27ae60;
}

.strat-hit.no {
  color: #ef4444;
}

.strat-verify-btn {
  padding: 4px 10px;
  background: rgba(167, 139, 250, .1);
  border: 1px solid rgba(167, 139, 250, .2);
  border-radius: 8px;
  color: #a78bfa;
  font-size: .65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.strat-verify-btn:hover {
  background: rgba(167, 139, 250, .2);
}

@media (max-width: 480px) {
  .strat-stats {
    gap: 8px;
    padding: 8px;
  }

  .strat-stat-val {
    font-size: 1rem;
  }
}
/* ww Donation Modal Extensions ww */
.donate-plan-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.donate-label {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

.donate-label-sm {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

.donate-plan-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.donate-plan-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.donate-plan-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.donate-plan-btn:active {
  transform: translateY(0);
}

.donate-plan-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.donate-plan-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.donate-custom-wrap {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.donate-amount-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--submit);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s;
}

.donate-amount-input:focus {
  outline: none;
  border-color: var(--submit);
}

.donate-amount-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

.donate-amount-input.flash {
  animation: flashInput 0.3s ease;
}

@keyframes flashInput {
  0% { color: #fff; text-shadow: 0 0 10px var(--accent); }
  100% { color: var(--submit); text-shadow: none; }
}

.donate-bank-title {
  font-size: 0.85rem;
  color: #fff;
  opacity: 0.8;
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}


.donate-row {
  display: flex;
  gap: 12px;
}

.donate-row .donate-field {
  flex: 1;
}


/* ww Bank Transfer Premium Button ww */
.btn-donate.bank-transfer {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.15), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(197, 160, 89, 0.6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-donate.bank-transfer::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
  transition: 0.5s;
}

.btn-donate.bank-transfer:hover {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.25), rgba(0, 0, 0, 0.5));
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 15px rgba(197, 160, 89, 0.3);
  transform: translateY(-2px);
}

.btn-donate.bank-transfer:hover::before {
  left: 100%;
}


/* ww Daily Greeting Modal ww */
.greeting-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.greeting-modal {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideInUp 0.4s ease;
}

.greeting-header {
  margin-bottom: 20px;
}

.greeting-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.greeting-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.greeting-title span {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.greeting-title strong {
  font-size: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-badge {
  background: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.4);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.greeting-content {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.greeting-content p {
  margin-bottom: 12px;
}

.greeting-disclaimer {
  background: rgba(255, 50, 50, 0.05);
  border: 1px solid rgba(255, 50, 50, 0.1);
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.85rem;
  text-align: left;
}

.greeting-disclaimer strong {
  color: #ff6b6b;
  display: block;
  margin-bottom: 4px;
}

.greeting-confirm-btn {
  background: var(--accent);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}

.greeting-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.5);
  background: #fff;
}

.greeting-modal-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

