/* ParsiTrade Scanner — Marko Dark theme
   Visual language adapted from Marko, reconciled for ParsiTrade by VibeFarsi. */

:root {
  --bg:          #0a0a12;
  --bg-deep:     #111118;
  --surface:     rgba(255,255,255,0.04);
  --card:        rgba(255,255,255,0.03);
  --card-top:    rgba(255,255,255,0.06);
  --border:      rgba(255,255,255,0.08);
  --brand:       #19B889;
  --gold:        #19B889;
  --gold-dim:    rgba(25,184,137,0.7);
  --gold-glow:   rgba(25,184,137,0.12);
  --text:        rgba(255,255,255,0.85);
  --muted:       rgba(255,255,255,0.45);
  --win:         #19B889;
  --loss:        #F05D78;
  --fail:        #F4B85A;
  --radius:      0.5rem;
  --shadow:      none;
  --shadow-soft: none;
  --grad-card:   linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  --input-line:  rgba(255,255,255,0.15);
  --btn-face:    #19B889;
  --btn-hover:   #15a07a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

::selection {
  background-color: gray;
  color: #f5f5f5;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  /* Vazirmatn covers Persian + Arabic; Inter covers Latin */
  font-family: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--grad-card);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* RTL direction inherits from <html dir="rtl"> — no extra rules needed for most blocks */

/* ─── Link ─── */
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10, 10, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #19B889, #0D6655);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.brand-sub {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
}

.header-brand { cursor: pointer; }
.header-brand:focus-visible { outline: 2px solid #19B889; outline-offset: 3px; border-radius: 4px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}

.main-nav-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 200ms, background 200ms;
  text-decoration: none;
}

.main-nav-tab:hover { color: #FFFFFF; }
.main-nav-tab.active {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

.btn-auth {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.8);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms, border-color 200ms, color 200ms;
}
.btn-auth:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: #FFFFFF;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-view[hidden] { display: none !important; }
.app-view { animation: viewIn 360ms ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--win);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Language switcher ─── */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms;
  line-height: 1;
}

.lang-btn.active,
.lang-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #19B889;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 0; inset-inline-end: 0;
  height: 2px;
  background: linear-gradient(to inline-end, #19B889, transparent);
}

.kpi-card:hover { border-color: rgba(25,184,137,0.3); background: rgba(255,255,255,0.05); }

.kpi-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.4rem;
}
.kpi-card--hero {
  border-color: rgba(25, 184, 137, 0.2);
  background: rgba(25,184,137,0.06);
}
.kpi-card--hero .kpi-value {
  font-size: 2.6rem;
  color: #19B889;
}
.kpi-card--hero::before {
  background: linear-gradient(to inline-end, #19B889, transparent);
}

/* ═══════════════════════════════════════
   CHARTS ROW
═══════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

.chart-card canvas { max-width: 100%; }

.chart-card h3 {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.chart-wrap {
  position: relative;
  height: 220px;
}

.charts-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.charts-grid-3 .chart-wrap { height: 180px; }

/* ═══════════════════════════════════════
   SIGNALS TABLE
═══════════════════════════════════════ */
.signals-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.signals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 1rem;
  flex-wrap: wrap;
}

.signals-header h3 {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Symbol chip bar when used in the signals table section */
.table-sym-chips {
  padding: 0.5rem 1.5rem 0;
  gap: 0.3rem;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 1.5rem 0.75rem;
}

.filter-select {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  border-radius: 0;
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 200ms;
}

.filter-select:hover,
.filter-select:focus {
  background-color: rgba(255,255,255,0.05);
  border: none;
  border-radius: var(--radius);
}

.filter-select option { background: #1a1a2e; color: rgba(255,255,255,0.8); }

.signal-count {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead th {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  text-align: start;
  position: sticky;
  top: 0;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}

tbody tr:hover { background: rgba(255,255,255,0.04); }

td {
  padding: 0.65rem 1rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

td.outcome { font-weight: 600; }
td.outcome.WIN     { color: var(--win); }
td.outcome.LOSS    { color: var(--loss); }
td.outcome.FAILURE { color: var(--fail); }
td.outcome.OPEN    { color: var(--muted); }

td.positive { color: var(--win); }
td.negative { color: var(--loss); }
td.muted    { color: var(--muted); }

/* Node type badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-FTR  { background: rgba(52,152,219,0.15);  color: #3498DB; border: 1px solid rgba(52,152,219,0.25); }
.badge-ETR  { background: rgba(155,89,182,0.15);  color: #9B59B6; border: 1px solid rgba(155,89,182,0.25); }
.badge-CTR  { background: rgba(230,126,34,0.15);  color: #E67E22; border: 1px solid rgba(230,126,34,0.25); }
.badge-none { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.1); }

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

.page-btn {
  background: #19B889;
  border: none;
  color: #FFFFFF;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 200ms;
}

.page-btn:hover:not(:disabled) {
  background: #15a07a;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ═══════════════════════════════════════
   DISCLAIMER
═══════════════════════════════════════ */
.disclaimer {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.disclaimer-icon {
  color: var(--fail);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ═══════════════════════════════════════
   LOADING STATE
═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  display: inline-block;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-text {
  height: 2rem;
  width: 80px;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 3rem;
}

.footer span { color: rgba(255,255,255,0.5); }

/* ═══════════════════════════════════════
   REFRESH BUTTON
═══════════════════════════════════════ */
.btn-refresh {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}

.btn-refresh:hover {
  background: rgba(255,255,255,0.06);
  color: #FFFFFF;
}

.chart-range {
  display: inline-flex;
  gap: 0.35rem;
}
.range-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms;
  color: rgba(255,255,255,0.7);
}
.range-btn:hover { background: rgba(255,255,255,0.06); }
.range-btn.active {
  border: none;
  color: #FFFFFF;
  background: #19B889;
}

/* ═══════════════════════════════════════
   TOAST / NOTIFICATION
═══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.82rem;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  pointer-events: none;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: minmax(0, 1fr); }
  .charts-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card--hero { grid-column: 1 / -1; }
  .landing-hero { grid-template-columns: 1fr; text-align: center; }
  .hero-ctas { justify-content: center; }
  .charts-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .header { padding: 0 1rem; height: auto; min-height: 64px; flex-wrap: wrap; gap: 0.5rem; padding-block: 0.5rem; }
  .header-controls { flex-wrap: wrap; gap: 0.5rem; }
  .brand-name { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.6rem; }
  .signals-header { flex-direction: column; align-items: flex-start; }
}

/* LTR override for English / Arabic when dir switches */
[dir="ltr"] .kpi-card::before {
  background: linear-gradient(to right, #19B889, transparent);
}

/* ─── Scanner Status Panel ───────────────────────────────────────────────── */
.scanner-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.scanner-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
}
.scanner-dot {
  color: #19B889;
  font-size: 1rem;
}
.scanner-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.scanner-exchange-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  background: rgba(25,184,137,0.1);
  color: #19B889;
  border: 1px solid rgba(25,184,137,0.2);
  letter-spacing: 0.04em;
}
.btn-scanner {
  background: #19B889;
  border: none;
  color: #FFFFFF;
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}
.btn-scanner:hover:not(:disabled) {
  background: #15a07a;
}
.btn-scanner:disabled { opacity: 0.4; cursor: not-allowed; }
.scanner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
}
.scanner-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.scanner-stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}
.scanner-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.scanner-result {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}
.scanner-result.scanning {
  color: #19B889;
}
.scanner-result.error {
  color: var(--loss);
}

/* ─── Scanner settings ───────────────────────────────────────────────────── */
.scanner-settings {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.scanner-settings-row { display: flex; align-items: center; gap: 0.5rem; }
.settings-label { font-size: 0.78rem; color: rgba(255,255,255,0.45); white-space: nowrap; }
.settings-input {
  background: rgba(255,255,255,0.05);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: 0;
  padding: 0.45rem 0.4rem;
  font-size: 0.82rem;
  font-family: inherit;
  width: 90px;
  text-align: center;
  outline: none;
  transition: all 200ms;
}
.settings-input:hover,
.settings-input:focus {
  background-color: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--radius);
}
.btn-scanner-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

/* ─── Trade card filter bar ─────────────────────────────────────────────── */
.card-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.25rem;
}

.card-filter-select {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  color: rgba(255,255,255,0.8);
  padding: 0.45rem 0.35rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 200ms;
}
.card-filter-select:hover,
.card-filter-select:focus {
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: var(--radius);
}
.card-filter-select option { background: #1a1a2e; color: rgba(255,255,255,0.8); }

/* Symbol chip bar — replaces the old symbol <select> */
.sym-chips-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  flex-basis: 100%;
}

.sym-chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.74rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms;
}
.sym-chip:hover {
  background: rgba(255,255,255,0.06);
}
.sym-chip-active {
  background: #19B889;
  border-color: #19B889;
  color: #FFFFFF;
  font-weight: 600;
}
.sym-chip-more {
  border-style: dashed;
  color: rgba(255,255,255,0.35);
  opacity: 0.75;
}
.sym-chip-more:hover { opacity: 1; color: rgba(255,255,255,0.7); }

/* chip bar inside card-filters-bar gets a subtle bottom separator */
.card-filters-bar .sym-chips-bar {
  padding-bottom: 0.4rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.card-filter-news-chk {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0.28rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: transparent;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.card-filter-news-chk:hover {
  border-color: rgba(231,76,60,0.4);
  color: var(--loss);
}
.card-filter-news-chk input { accent-color: var(--loss); }

.card-filter-count {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.35);
  margin-inline-start: auto;
  white-space: nowrap;
}

/* ─── Trade cards ────────────────────────────────────────────────────────── */
.trade-cards {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.trade-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.trade-card:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); }
.trade-card.LONG  { border-top: 3px solid var(--win); }
.trade-card.SHORT { border-top: 3px solid var(--loss); }
.trade-card.news-alerted {
  border-color: rgba(231,76,60,0.35);
}
.trade-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.45rem;
  gap: 0.5rem;
}
.trade-symbol { font-size: 1rem; font-weight: 700; color: #FFFFFF; }
.trade-dir-badge {
  font-size: 0.7rem; font-weight: 700;
  padding: 0.18rem 0.6rem; border-radius: 20px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.trade-dir-badge.LONG  { background: rgba(25,184,137,0.15); color: var(--win); }
.trade-dir-badge.SHORT { background: rgba(240,93,120,0.15); color: var(--loss); }
.trade-meta {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  padding: 0 1rem 0.6rem;
}
.trade-meta-tag {
  font-size: 0.68rem; padding: 0.12rem 0.4rem;
  border-radius: 4px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.45);
}
.trade-card-body {
  padding: 0 1rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}
.trade-field { display: flex; flex-direction: column; gap: 0.1rem; }
.trade-field-label { font-size: 0.67rem; color: rgba(255,255,255,0.4); }
.trade-field-value {
  font-size: 0.86rem; font-weight: 600; color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}
.trade-field-value.entry  { color: #19B889; }
.trade-field-value.sl     { color: var(--loss); }
.trade-field-value.tp     { color: var(--win);  }
.trade-field-value.profit { color: var(--win);  }
.trade-field-value.risk   { color: var(--fail); }
.trade-field-value.lev    { color: #3498DB; }
.trade-zone-row {
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.trade-zone-label { font-size: 0.67rem; color: rgba(255,255,255,0.4); }
.trade-zone-range { font-size: 0.82rem; font-weight: 600; color: rgba(25,184,137,0.7); }

/* ML (MidLine) and CL (CloseLine) indicator row */
.trade-mlcl-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.2rem;
  padding: 0.25rem 0.7rem 0.15rem;
}
.trade-mlcl-item { display: flex; align-items: center; gap: 0.35rem; }
.mlcl-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 3px;
  padding: 0.05rem 0.3rem;
}
.mlcl-val { font-size: 0.74rem; color: rgba(255,255,255,0.85); font-variant-numeric: tabular-nums; }

/* ── Signal chart screenshot ───────────────────────────────────────────────── */
.trade-chart-wrap {
  position: relative;
  width: 100%;
  background: #0d1117;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  cursor: zoom-in;
}
.trade-chart-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  object-position: top;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.92;
}
.trade-chart-img:hover { opacity: 1; transform: scale(1.01); }
.trade-chart-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.55rem;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
  background: rgba(10,10,18,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.08rem 0.35rem;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ── Chart lightbox modal ─────────────────────────────────────────────────── */
#chart-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9900;
  align-items: center;
  justify-content: center;
}
#chart-modal.open { display: flex; }
.chart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}
.chart-modal-box {
  position: relative;
  z-index: 9901;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  max-width: min(96vw, 1000px);
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chart-modal-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
  font-family: monospace;
}
.chart-modal-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.chart-modal-close:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.3); }
.chart-modal-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
}
.chart-modal-link {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  padding: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  transition: color 0.15s;
}
.chart-modal-link:hover { color: #19B889; }

.trade-card-footer {
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.trade-rr   { font-size: 0.78rem; font-weight: 600; color: #19B889; }
.trade-age  { font-size: 0.68rem; color: rgba(255,255,255,0.35); }
.trade-cards-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 2rem;
  color: rgba(255,255,255,0.35); font-size: 0.85rem;
}

.show-more-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0.5rem;
}
.btn-show-more {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 0.6rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 200ms;
}
.btn-show-more:hover { background: rgba(255,255,255,0.06); color: #FFFFFF; }

/* ─── AI Insights Panel ───────────────────────────────────────────────────── */
.ai-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ai-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #19B889;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-dot {
  font-size: 1.1rem;
  opacity: 0.8;
}

.ai-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-provider-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
}
.ai-provider-select {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  min-width: 9.5rem;
}
.ai-provider-select:disabled { opacity: 0.45; }
.ai-provider-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
}
.ai-provider-badge.active {
  color: #FFFFFF;
  background: #19B889;
  border-color: #19B889;
}

.btn-ai {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: #19B889;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 200ms;
}
.btn-ai:hover:not(:disabled) {
  background: #15a07a;
}
.btn-ai:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ai.btn-ai-sec {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #19B889;
}
.btn-ai.btn-ai-sec:hover:not(:disabled) { border-color: #19B889; color: #19B889; }

.ai-body {
  min-height: 3rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  line-height: 1.8;
}

.ai-placeholder, .ai-loading {
  color: rgba(255,255,255,0.35);
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

.ai-result { display: flex; flex-direction: column; gap: 0.4rem; }

.ai-line { color: rgba(255,255,255,0.85); line-height: 1.75; }
.ai-line.ai-heading {
  font-weight: 700;
  font-size: 0.9rem;
  color: #19B889;
  margin-top: 0.6rem;
}
.ai-line.ai-point { padding-inline-start: 0.5rem; }
.ai-line.ai-bold { font-weight: 600; }

.ai-via {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.5rem;
}

.ai-error { color: var(--fail); padding: 0.5rem 0; }

.ai-disclaimer {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  border-top: 1px dashed rgba(255,255,255,0.08);
  padding-top: 0.75rem;
  font-style: italic;
}

/* ─── Offline Banner ─────────────────────────────────────────────────────── */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #7B241C;
  border-bottom: 2px solid #E74C3C;
  color: #fff;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.offline-icon { font-size: 1rem; flex-shrink: 0; }
.offline-hint {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  flex: 1;
  min-width: 200px;
}
.offline-retry {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-inline-start: auto;
  white-space: nowrap;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }
body.offline-active { padding-top: 42px; }

/* ═══════════════════════════════════════
   ADMIN PANEL
═══════════════════════════════════════ */

/* Gear button in header */
.btn-admin-gear {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 200ms;
  flex-shrink: 0;
}
.btn-admin-gear:hover { background: rgba(255,255,255,0.06); }
.btn-admin-gear.active {
  border: none;
  color: #FFFFFF;
  background: #19B889;
}

/* Full-screen overlay */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
}

/* Semi-transparent backdrop */
.admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

/* Side drawer — always anchored to physical right */
.admin-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: #0a0a12;
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.55);
  animation: adminSlideIn 0.22s ease;
}

@keyframes adminSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0);    }
}

/* Drawer header */
.admin-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
}

.admin-drawer-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #19B889;
}

.admin-close {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 200ms;
}
.admin-close:hover { background: rgba(255,255,255,0.06); color: #FFFFFF; }

/* ─── Login view ─── */
.admin-login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.admin-login-card {
  width: min(400px, 100%);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-login-icon { font-size: 2.2rem; }

.admin-login-card h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #19B889;
  margin: 0.5rem 0 1rem;
}

.admin-login-hint {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}
.admin-login-hint code {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.85em;
  color: #19B889;
}

.admin-token-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.admin-token-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: 0;
  padding: 1rem 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  direction: ltr;
  min-width: 0;
  outline: none;
  transition: all 200ms;
}
.admin-token-input:hover,
.admin-token-input:focus {
  background-color: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
}

.admin-login-error {
  width: 100%;
  font-size: 0.76rem;
  color: var(--loss);
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  line-height: 1.5;
}

/* ─── Authenticated content ─── */
.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tab bar */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 0.6rem 0.85rem;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* Tab panes */
.admin-tab-pane {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-hint-text {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.65;
}

/* DB stats grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.admin-stat-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.admin-stat-key { color: var(--muted); }
.admin-stat-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Signal stats table */
.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.admin-table th {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  text-align: start;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.4rem 0.55rem;
  color: var(--text);
  border-bottom: 1px solid rgba(37, 37, 37, 0.4);
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  margin: 0 0.1rem 0.1rem 0;
  white-space: nowrap;
}
.admin-badge.active { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.admin-badge.testnet { background: rgba(241, 196, 15, 0.15); color: #f1c40f; }
.admin-badge.off { background: rgba(231, 76, 60, 0.12); color: #e74c3c; }

/* Form rows */
.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-label {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 500;
}

.admin-input {
  background: rgba(255,255,255,0.05);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: 0;
  padding: 0.85rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: all 200ms;
}
.admin-input:hover,
.admin-input:focus {
  background-color: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
}

.admin-select {
  background: rgba(255,255,255,0.05);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  border-radius: 0;
  padding: 0.75rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  outline: none;
  transition: all 200ms;
}
.admin-select option { background: #111118; color: rgba(255,255,255,0.85); }
.admin-select:hover,
.admin-select:focus {
  background-color: rgba(255,255,255,0.08);
  border-radius: 8px;
}

.admin-btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons — brand primary */
.btn-admin-primary {
  background: #19B889;
  border: none;
  color: #FFFFFF;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}
.btn-admin-primary:hover:not(:disabled) {
  background: #15a07a;
}
.btn-admin-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-admin-danger {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: var(--loss);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-admin-danger:hover:not(:disabled) { background: rgba(231, 76, 60, 0.2); }
.btn-admin-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-admin-sm {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 200ms;
  white-space: nowrap;
}
.btn-admin-sm:hover:not(:disabled) { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); color: #FFFFFF; }
.btn-admin-sm:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-admin-danger-sm {
  border-color: rgba(231, 76, 60, 0.35);
  color: var(--loss);
}
.btn-admin-danger-sm:hover:not(:disabled) {
  border-color: rgba(231, 76, 60, 0.6);
  color: var(--loss);
}

/* Progress bar */
.admin-progress-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-progress-bar-outer {
  width: 100%;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.admin-progress-bar-inner {
  height: 100%;
  background: linear-gradient(to right, var(--gold-dim), var(--gold));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.admin-progress-stats {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.75;
}

.admin-progress-status {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.admin-progress-errors {
  font-size: 0.7rem;
  color: var(--fail);
  max-height: 80px;
  overflow-y: auto;
  background: rgba(243, 156, 18, 0.07);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ML result box */
.admin-ml-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text);
}

/* Delete result */
.admin-del-result {
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
.admin-del-result.success {
  background: rgba(39, 174, 96, 0.08);
  color: var(--win);
  border: 1px solid rgba(39, 174, 96, 0.25);
}
.admin-del-result.error {
  background: rgba(231, 76, 60, 0.08);
  color: var(--loss);
  border: 1px solid rgba(231, 76, 60, 0.25);
}

/* Tools grid */
.admin-tool-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-tool-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s;
}

.admin-tool-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 1.8rem;
  text-align: center;
}

.admin-tool-info { flex: 1; min-width: 0; }
.admin-tool-info strong { font-size: 0.8rem; color: var(--text); display: block; margin-bottom: 0.1rem; }
.admin-tool-info p { font-size: 0.7rem; color: var(--muted); line-height: 1.45; margin: 0; }

.admin-tool-result {
  font-size: 0.76rem;
  color: var(--muted);
  min-height: 1.4rem;
  padding: 0.2rem 0;
}
.admin-tool-result.ok  { color: var(--win); }
.admin-tool-result.err { color: var(--loss); }

/* ═══════════════════════════════════════
   NEWS FEED PANEL
═══════════════════════════════════════ */
.news-panel {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.news-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.news-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.news-icon { font-size: 1rem; }

.news-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-filter-select {
  background: rgba(255,255,255,0.05);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  color: rgba(255,255,255,0.8);
  padding: 0.45rem 0.35rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all 200ms;
}
.news-filter-select:hover,
.news-filter-select:focus {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
}
.news-filter-select option { background: #111118; color: rgba(255,255,255,0.85); }

.btn-news-refresh {
  background: #19B889;
  border: none;
  color: #FFFFFF;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 200ms;
}
.btn-news-refresh:hover { background: #15a07a; }
.btn-news-refresh.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Horizontal scrolling news row */
.news-feed {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.news-feed::-webkit-scrollbar { height: 4px; }
.news-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.news-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.5rem 0;
  width: 100%;
}

/* Individual news card */
.news-card {
  flex-shrink: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.news-card:hover { border-color: var(--gold-dim); background: var(--card); }

.news-card.impact-HIGH    { border-left: 3px solid #E67E22; }
.news-card.impact-BREAKING { border-left: 3px solid var(--loss); }
.news-card.impact-MEDIUM  { border-left: 3px solid var(--gold-dim); }

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.news-source {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-impact-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.news-impact-badge.LOW      { background: rgba(184,168,138,0.15); color: var(--muted); }
.news-impact-badge.MEDIUM   { background: rgba(25,184,137,0.12);  color: #19B889; }
.news-impact-badge.HIGH     { background: rgba(224,176,106,0.2);  color: var(--fail); }
.news-impact-badge.BREAKING { background: rgba(224,122,106,0.2);   color: var(--loss); }

.news-time {
  font-size: 0.65rem;
  color: var(--muted);
  margin-inline-start: auto;
  white-space: nowrap;
}

.news-symbols {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.news-sym {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.08em 0.35em;
  border-radius: 3px;
  background: rgba(25,184,137,0.1);
  color: #19B889;
  letter-spacing: 0.03em;
}

.news-title {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Trade card: breaking-news warning badge ─── */
.trade-news-warning {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.15);
  color: var(--loss);
  border: 1px solid rgba(231, 76, 60, 0.3);
  white-space: nowrap;
}

/* ─── ML score bar on trade cards ─────────────────────────────────────────── */
.ml-score-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.ml-score-label {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 4.5rem;
  text-align: right;
}

.ml-score-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.ml-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.ml-score-fill.ml-grade-a { background: #27ae60; }
.ml-score-fill.ml-grade-b { background: #f39c12; }
.ml-score-fill.ml-grade-c { background: #e67e22; }
.ml-score-fill.ml-grade-d { background: #c0392b; }

.ml-score-pct {
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 2.4rem;
  text-align: left;
}

.ml-score-pct.ml-grade-a { color: #27ae60; }
.ml-score-pct.ml-grade-b { color: #f39c12; }
.ml-score-pct.ml-grade-c { color: #e67e22; }
.ml-score-pct.ml-grade-d { color: #c0392b; }

/* ─── News suppress banner ─────────────────────────────────────────────────── */
.scanner-suppress-banner {
  margin: 0.5rem 0;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--loss);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── Admin suppress row ───────────────────────────────────────────────────── */
.admin-suppress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.admin-suppress-row strong {
  font-size: 0.8rem;
  color: var(--text);
}

/* ─── Scanner auto-refresh countdown ──────────────────────────────────────── */
.scanner-refresh-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scanner-auto-refresh {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Unified auto-refresh timers ─────────────────────────────────────────── */
.auto-timer {
  display: inline-block;
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.65;
  min-width: 2.4rem;
  text-align: center;
  transition: color 0.3s, opacity 0.3s;
}

.auto-timer.auto-timer-urgent {
  color: var(--gold);
  opacity: 1;
  font-weight: 700;
}

/* admin auto-refresh row */
.admin-auto-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0 0.8rem;
}

.admin-input-sm {
  width: 5rem !important;
}

.admin-auto-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Win-rate insufficient-data warning ─────────────────────────────── */
.kpi-warn {
  display: inline-block;
  margin-right: 0.25rem;
  font-size: 0.9em;
  color: var(--fail);
  cursor: help;
  vertical-align: middle;
}

/* ── Signal source badges (LIVE / SIM) ──────────────────────────────── */
.trade-source-badge {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.trade-source-badge.live {
  background: rgba(39, 174, 96, 0.18);
  color: #2ecc71;
  border: 1px solid rgba(39, 174, 96, 0.35);
}
.trade-source-badge.sim {
  background: rgba(136, 136, 136, 0.12);
  color: var(--muted);
  border: 1px solid rgba(136, 136, 136, 0.2);
}
.trade-confirmed-by {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 0.15rem 0.35rem;
  direction: rtl;
}

/* ── Leverage risk disclaimer (footer) ─────────────────────────────── */
.leverage-disclaimer {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: rgba(231, 76, 60, 0.06);
  border: 1px solid rgba(231, 76, 60, 0.18);
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

/* ── Outcome badge (trade cards) ───────────────────────────────────── */
.outcome-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.outcome-badge.WIN     { background: rgba(39,174,96,0.18);  color: var(--win);  border: 1px solid rgba(39,174,96,0.35); }
.outcome-badge.LOSS    { background: rgba(231,76,60,0.18);  color: var(--loss); border: 1px solid rgba(231,76,60,0.35); }
.outcome-badge.OPEN    { background: rgba(110,118,129,0.15); color: var(--muted); border: 1px solid rgba(110,118,129,0.25); }
.outcome-badge.FAILURE { background: rgba(255,165,0,0.15);  color: #f0883e;      border: 1px solid rgba(255,165,0,0.3); }
.outcome-badge.BREAKEVEN { background: rgba(88,166,255,0.12); color: #58a6ff;   border: 1px solid rgba(88,166,255,0.3); }
.outcome-badge.CANCELLED  { background: rgba(110,118,129,0.15); color: var(--muted); border: 1px solid rgba(110,118,129,0.25); }

/* ── Closed Trades Section ─────────────────────────────────────────── */
.closed-trades-section {
  margin-top: 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.closed-trades-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}
.closed-trades-header:hover { background: rgba(255,255,255,0.04); }
.closed-trades-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.closed-trades-chevron { color: var(--muted); font-size: 0.75rem; }
.closed-trades-stats {
  margin-right: auto;
  font-size: 0.75rem;
  color: var(--muted);
}
.closed-trades-body { padding: 1rem; background: var(--bg); }
.closed-trades-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.closed-card { opacity: 0.92; }
.closed-card .trade-card-header { flex-wrap: wrap; gap: 0.4rem; }
.score-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(88,166,255,0.12);
  color: #58a6ff;
  border: 1px solid rgba(88,166,255,0.25);
}

/* ─── Role gate / view-only ─── */
body.role-pending > :not(#role-gate) { visibility: hidden; }
body.role-pending #role-gate { visibility: visible; }

.role-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  background: var(--grad-card);
  padding: 1.5rem;
}
.role-gate[hidden],
body:not(.role-pending) .role-gate { display: none !important; }

.role-gate-card {
  width: min(400px, 100%);
  min-height: 400px;
  background-image: var(--grad-card);
  display: flex;
  align-items: center;
  flex-direction: column;
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.role-gate-brand {
  width: 56px; height: 56px; margin: 0.5rem auto 0;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; letter-spacing: 0.04em;
  color: #FFFFFF;
  background: #19B889;
}
.role-gate-card h1 {
  color: #19B889;
  margin: 2rem 0 0.75rem;
  font-size: 2rem;
}
.role-gate-sub { color: rgba(255,255,255,0.45); font-size: 0.95rem; margin-bottom: 1.5rem; }
.role-gate-actions { display: grid; gap: 0.85rem; margin-bottom: 1rem; width: min(20rem, 100%); }
.role-gate-btn {
  height: 3rem;
  width: 100%;
  border: none;
  background: #19B889;
  color: #FFFFFF;
  border-radius: 999px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}
.role-gate-btn:hover {
  background: #15a07a;
}
.role-gate-user {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}
.role-gate-user:hover {
  background: rgba(255,255,255,0.06);
  color: #FFFFFF;
}
.role-gate-hint { color: rgba(255,255,255,0.35); font-size: 0.78rem; line-height: 1.5; margin-bottom: 1rem; }
.role-gate-lang { display: inline-flex; gap: 0.35rem; }

.role-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}
body.role-admin .role-badge { color: #19B889; border-color: rgba(25,184,137,0.35); background: rgba(25,184,137,0.08); }
body.role-user .role-badge { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.2); }

.btn-role-switch {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 200ms;
}
.btn-role-switch:hover { background: rgba(255,255,255,0.06); }

body.role-user [data-admin-only] { display: none !important; }

/* Hover help tooltips on titles/labels */
.has-tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted rgba(255,255,255,0.15);
}
.has-tip[data-tip]:hover::after,
.btn-refresh[data-tip]:hover::after,
.btn-scanner[data-tip]:hover::after,
.btn-admin-gear[data-tip]:hover::after,
.btn-role-switch[data-tip]:hover::after,
.btn-ai[data-tip]:hover::after,
.role-badge[data-tip]:hover::after,
.card-filter-news-chk[data-tip]:hover::after,
.auto-timer[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  max-width: min(280px, 70vw);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  background-image: var(--grad-card);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: start;
  white-space: normal;
}
html[dir="rtl"] .has-tip[data-tip]:hover::after,
html[dir="rtl"] .btn-refresh[data-tip]:hover::after,
html[dir="rtl"] .btn-scanner[data-tip]:hover::after,
html[dir="rtl"] .btn-admin-gear[data-tip]:hover::after,
html[dir="rtl"] .btn-role-switch[data-tip]:hover::after,
html[dir="rtl"] .role-badge[data-tip]:hover::after {
  transform: translateX(50%);
}

.ml-suggest-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  padding: 1rem;
}
.ml-suggest-card {
  width: min(480px, 100%);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.4rem 1.3rem;
}
.ml-suggest-card h2 { font-size: 1.4rem; margin: 0.5rem 0 0.8rem; color: #19B889; }
.ml-suggest-stats { font-size: 0.85rem; color: rgba(255,255,255,0.45); margin-bottom: 0.75rem; line-height: 1.6; }
.ml-suggest-ai {
  font-size: 0.82rem;
  line-height: 1.65;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}
.ml-suggest-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Landing hero ───────────────────────────────────────────── */
.landing-hero {
  margin: 0.25rem 0 1.75rem;
  padding: 2rem 2rem 1.75rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}
.hero-content { max-width: 36rem; }
.landing-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #19B889;
  margin: 0 0 0.65rem;
  font-weight: 500;
}
.landing-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 0.65rem;
  line-height: 1.2;
}
.hero-brand {
  color: var(--brand);
}
.landing-tagline {
  max-width: 34rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
  line-height: 1.7;
}
.hero-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-visual {
  display: flex;
  justify-content: center;
}

/* ── Signal card mock (hero visual) ── */
.signal-card-mock {
  width: 220px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  font-size: 0.78rem;
}
.mock-signal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mock-symbol {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 0.85rem;
}
.mock-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.mock-badge-win {
  background: rgba(25, 184, 137, 0.15);
  color: var(--brand);
  border: 1px solid rgba(25, 184, 137, 0.3);
}
.mock-signal-body {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mock-label {
  color: var(--muted);
  font-size: 0.72rem;
}
.mock-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mock-profit {
  color: var(--brand);
}
.mock-signal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.65rem;
}

/* ── Buttons (VibeFarsi-inspired) ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  min-height: 44px;
}
.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover {
  background: #15a07a;
  border-color: #15a07a;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--muted);
}
.btn-lg {
  padding: 0.7rem 1.6rem;
  font-size: 0.92rem;
  min-height: 48px;
}

/* ── Promo band (after KPI overview) ────────────────────────── */
.promo-band {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin: 0 0 1.75rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.promo-media {
  position: relative;
  min-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.06);
}
.promo-video {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: none;
  background: #000;
}
.promo-video.has-src { display: block; }
.promo-video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.88rem;
  background: #111118;
}
.promo-band.has-video .promo-video-fallback { display: none; }
.promo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
}
.promo-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: rgba(25, 184, 137, 0.1);
  border: 1px solid rgba(25, 184, 137, 0.2);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  margin: 0;
}
.promo-title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  color: var(--text);
  margin: 0;
  line-height: 1.25;
  font-weight: 700;
}
.promo-sub { color: var(--muted); font-size: 0.9rem; margin: 0; }
.promo-cta {
  appearance: none;
  align-self: flex-start;
  margin-top: 0.45rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  color: #FFFFFF;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  background: #19B889;
  transition: transform 220ms, filter 220ms;
}
.promo-cta:hover:not(:disabled) { background: #15a07a; transform: translateY(-1px); }
.promo-cta:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Luxury store view ──────────────────────────────────────── */
.store-hero {
  margin: 0.4rem 0 1.5rem;
  padding: 2rem 1.5rem 1.6rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.store-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #19B889;
}
.store-title {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  color: #FFFFFF;
  margin: 0 0 0.5rem;
}
.store-lead, .shop-status { color: rgba(255,255,255,0.45); font-size: 0.9rem; margin: 0 0 0.55rem; }
.store-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}
.shop-plans { display: grid; gap: 0.85rem; margin-bottom: 1.25rem; }
.store-plans-lux .shop-plan {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1.3rem;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color 220ms, background 220ms;
}
.store-plans-lux .shop-plan:hover {
  border-color: rgba(25,184,137,0.35);
  background: rgba(255,255,255,0.05);
}
.dashboard .shop-plan.selected {
  border-color: #19B889;
  box-shadow: 0 0 0 1px rgba(25,184,137,0.3);
}
.shop-plan h3 { margin: 0 0 0.35rem; color: #FFFFFF; font-size: 1.12rem; }
.shop-plan .price {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  color: #19B889;
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0.45rem 0;
}
.shop-plan ul {
  margin: 0.55rem 0 0;
  padding-inline-start: 1.1rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.84rem;
  line-height: 1.7;
}
.store-checkout-col {
  display: grid;
  gap: 0.7rem;
  padding: 1.2rem 1.15rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  position: sticky;
  top: 80px;
}
.store-checkout-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: #FFFFFF;
}
.shop-label { font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.shop-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85);
  font-family: inherit;
}
.store-pay-btn { width: 100%; align-self: stretch; text-align: center; }
.shop-msg { font-size: 0.82rem; min-height: 1.2em; }
.shop-msg.err { color: var(--loss, #c44); }
.shop-msg.ok { color: var(--win, #3a8); }

/* ── Auth placeholder ───────────────────────────────────────── */
.auth-panel {
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
}
.auth-title {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  font-size: 2rem;
  color: #FFFFFF;
  margin: 0 0 0.5rem;
}
.auth-lead { color: rgba(255,255,255,0.45); margin: 0 0 1.25rem; font-size: 0.9rem; }
.auth-card {
  display: grid;
  gap: 0.55rem;
  text-align: start;
  padding: 1.25rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 1rem;
}
.auth-hint { font-size: 0.78rem; color: var(--muted); margin: 0.35rem 0 0; }

@media (max-width: 900px) {
  .promo-band,
  .store-grid { grid-template-columns: 1fr; }
  .store-checkout-col { position: static; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
  .header { flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 0.55rem; gap: 0.55rem; }
}

/* ─── Marko-style dark theme (2026-09-22): applied globally ───
   Palette: #0a0a12 bg, white/opacity text, #19B889 brand accent.
   Replaces previous Phase 2 light unification. Revert: restore Phase 2 block. */
body { background: var(--bg); color: var(--text); }
::selection { background: #19B889; color: #FFFFFF; }
::-webkit-scrollbar-track { background: #0a0a12; }
/* tables */
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
tbody tr:hover { background: rgba(255,255,255,0.04); }
/* filter inputs */
.filter-select { border-bottom: 1px solid rgba(255,255,255,0.15); color: var(--text); background: transparent; }
.filter-select:hover,
.filter-select:focus { background: rgba(255,255,255,0.05); }
.filter-select option { background: #1a1a2e; color: var(--text); }
.card-filter-select { border-bottom: 1px solid rgba(255,255,255,0.15); color: var(--text); background: transparent; }
.card-filter-select:hover,
.card-filter-select:focus { background: rgba(255,255,255,0.05); }
.card-filter-select option { background: #1a1a2e; color: var(--text); }
.settings-input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text); }
.settings-input:hover,
.settings-input:focus { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
/* chips + range */
.sym-chip { border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.55); }
.sym-chip:hover { background: rgba(255,255,255,0.06); }
.sym-chip-active { background: #19B889; border-color: #19B889; color: #FFFFFF; box-shadow: none; }
.range-btn { border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }
.range-btn:hover { background: rgba(255,255,255,0.06); }
.range-btn.active { color: #FFFFFF; background: #19B889; box-shadow: none; }
/* buttons */
.btn-refresh { color: rgba(255,255,255,0.7); box-shadow: none; background: transparent; border: 1px solid rgba(255,255,255,0.15); }
.btn-refresh:hover { color: #FFFFFF; background: rgba(255,255,255,0.06); box-shadow: none; }
.btn-scanner { color: #FFFFFF; box-shadow: none; }
.page-btn { background: #19B889; color: #FFFFFF; box-shadow: none; border: none; }
.page-btn:hover:not(:disabled) { background: #15a07a; color: #FFFFFF; box-shadow: none; }
/* role gate */
.role-gate { background: #0a0a12; }
.role-gate-brand { color: #FFFFFF; background: #19B889; box-shadow: none; }
.role-gate-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.role-gate-card h1 { color: #FFFFFF; }
.role-gate-btn { background: #19B889; color: #FFFFFF; box-shadow: none; border: none; }
.role-gate-btn:hover { background: #15a07a; box-shadow: none; }
.role-gate-user { border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); background: transparent; }
.role-gate-user:hover { background: rgba(255,255,255,0.06); color: #FFFFFF; }
/* scanner panel */
.scanner-dot { color: #19B889; }
.scanner-exchange-badge { background: rgba(25,184,137,0.1); color: #19B889; border: 1px solid rgba(25,184,137,0.2); }
.scanner-stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
/* toast */
.toast { background-image: none; background: rgba(255,255,255,0.1); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.15); color: #FFFFFF; box-shadow: 0 8px 28px rgba(0,0,0,0.4); }
/* chart lightbox */
.chart-modal-box { background: #111118; border: 1px solid rgba(255,255,255,0.1); }
/* auth card */
.auth-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }

/* ═══════ Phase 1 — shared shell, mobile-first responsive ═══════
   Breakpoints: 1024 / 768 / 390 / 360. Touch targets ≥ 44px.
   No horizontal page scroll; tables scroll inside .table-wrap only. */

html, body { max-width: 100%; overflow-x: hidden; }

/* ─── Touch targets ≥ 44px (header/nav controls, all breakpoints) ─── */
.main-nav-tab, .btn-auth, .lang-btn, .page-btn, .nav-toggle { min-height: 44px; }
.lang-btn, .page-btn { min-width: 44px; }

/* ─── Hamburger toggle (hidden on desktop) ─── */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle:focus-visible { outline: 2px solid #19B889; outline-offset: 2px; }
/* when the nav collapses, pack the toggle with the controls at the far end
   instead of letting it float in the middle of the header */
.nav-toggle { margin-inline-start: auto; }

/* ─── Shared footer (index + shop) ─── */
.site-footer { text-align: start; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: start;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin: 0 0 0.6rem;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.3rem 0;
  min-height: 32px;
}
.footer-col a:hover { color: #FFFFFF; }
.footer-name { font-weight: 700; color: rgba(255,255,255,0.85); margin: 0.4rem 0 0.15rem; }
.footer-tagline { margin: 0 0 0.5rem; font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.footer-trust { margin-top: 0.5rem; }
.footer-bottom {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}
.footer-risk { margin: 0; font-size: 0.75rem; color: rgba(255,255,255,0.55); }
.copyright { margin: 0; }
.shop-footer .footer-grid { text-align: start; }

/* ─── 1024px ─── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-nav-tab { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
}

/* ─── 768px: hamburger takes over ─── */
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .header { gap: 0.5rem; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: #101019;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    padding: 0.5rem;
    gap: 0.25rem;
    z-index: 120;
    box-shadow: 0 12px 24px rgba(0,0,0,0.45);
  }
  .main-nav.open { display: flex; }
  .main-nav-tab { text-align: start; min-height: 44px; padding: 0.7rem 1rem; }
  .header-status { display: none; } /* polling status shown in scanner panel; saves mobile space */
  .btn-auth { min-height: 44px; padding: 0.55rem 1rem; }
  .lang-btn { min-width: 44px; min-height: 44px; }
  .page-btn { min-width: 44px; min-height: 44px; }
  .filter-select, .card-filter-select { min-height: 44px; }
  .settings-input { min-height: 44px; }
  .shop-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: #101019;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.5rem 1rem;
    gap: 0;
    z-index: 120;
  }
  .shop-nav.open { display: flex; }
  .shop-nav a { min-height: 44px; display: flex; align-items: center; font-size: 0.9rem; }
  .shop-header { position: sticky; flex-wrap: wrap; }
  .footer-col a { min-height: 44px; }
  /* hero mock is decorative; hide on mobile (overrides the base .hero-visual
     display:flex below — must live after it to win the cascade) */
  .hero-visual { display: none; }
}

/* ─── 390px ─── */
@media (max-width: 390px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .header { padding: 0 0.75rem; }
  .brand-sub { display: none; }
  .shop-header-cta .shop-status-mini { display: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ─── 360px ─── */
@media (max-width: 360px) {
  .brand-name { display: none; } /* logo keeps the brand; saves room for lang + auth */
  .container { padding: 0.75rem; }
  .main-nav-tab { font-size: 0.85rem; }
}

/* ─── Shared auth modal ──────────────────────────────────── */
.pt-auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65);
  padding: 1rem;
}
.pt-auth-overlay.visible { display: flex; }
.pt-auth-card {
  position: relative; background: #101019; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 1.5rem; width: min(420px, 92vw);
  max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.pt-auth-close {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px;
  display: grid; place-items: center; border: none; background: transparent;
  color: rgba(255,255,255,0.6); font-size: 18px; cursor: pointer; border-radius: 10px;
}
.pt-auth-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.pt-auth-body { min-width: 260px; }
.pt-title { font-size: 1.25rem; font-weight: 700; color: #FFFFFF; margin: 0 0 1rem; text-align: center; }
.pt-input {
  display: block; width: 100%; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(255,255,255,0.05);
  color: #FFFFFF; font-size: 0.9rem; min-height: 44px; box-sizing: border-box;
}
.pt-input::placeholder { color: rgba(255,255,255,0.3); }
.pt-btn {
  display: block; width: 100%; padding: 0.6rem; border: none; border-radius: 10px;
  background: #19B889; color: #fff; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; min-height: 44px; margin-bottom: 0.5rem;
}
.pt-btn:disabled { opacity: 0.5; cursor: default; }
.pt-btn:hover:not(:disabled) { background: #159a72; }
.pt-link {
  display: inline-block; background: none; border: none; color: #19B889;
  font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0; min-height: 44px;
  font-weight: 600;
}
.pt-links { display: flex; justify-content: space-between; font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; }
.pt-sub { color: rgba(255,255,255,0.45); font-size: 0.8rem; text-align: center; margin: 0.25rem 0 0; }
.pt-unav { color: #f59e0b; font-size: 0.85rem; text-align: center; margin-bottom: 0.75rem; }
@media (max-width: 390px) {
  .pt-auth-card { padding: 1rem; }
.role-admin .main-nav { display: none; }
.role-admin .header-brand { flex: 1; }
.role-admin .header-status { display: none; }
.role-admin .pt-auth-overlay { display: none; }
.role-admin .pt-auth-card { display: none; }
.role-admin .pt-loggedIn { display: block; }
.role-admin .pt-unav { display: none; }
@media (max-width: 768px) {
  .role-admin .nav-toggle { display: none; }
  .role-admin .pt-auth-overlay { display: block; }
}
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 — bands 1, 3, 4, 6, 7
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Band 1: status strip above the KPI cards ─── */
.status-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}
.status-strip-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.7rem;
}
.status-strip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}
.status-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  min-height: 62px;
  justify-content: center;
}
.status-cell.is-warn { border-color: var(--loss); }
.status-cell-label {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
}
.status-cell-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.status-cell-none { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.status-strip-error {
  margin: 0.7rem 0 0;
  font-size: 0.76rem;
  color: var(--loss);
}

@media (max-width: 900px) {
  .status-strip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .status-strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Band 3: past-signals panel ─── */
.history-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.history-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.history-filter select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
  min-height: 40px;
  min-width: 120px;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.history-table th,
.history-table td {
  padding: 0.5rem 0.45rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.history-table th { color: var(--muted); font-weight: 600; font-size: 0.72rem; }
.history-table td.win   { color: var(--win);  font-weight: 700; }
.history-table td.loss  { color: var(--loss); }
.history-table td.profit { color: var(--win); }
.history-table td.long  { color: var(--win); }
.history-table td.short { color: var(--loss); }

/* ─── Band 4: news card image ─── */
.news-card.has-image { padding-top: 0.55rem; }
.news-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
}
.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card-media.is-broken { display: none; }
.news-card.no-image { padding-top: 0.75rem; }

/* ─── Band 6: AI market brief card ─── */
.brief-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.brief-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.brief-dot { color: var(--gold); }
.brief-meta { font-size: 0.7rem; color: var(--muted); }
.brief-result { display: flex; flex-direction: column; gap: 0.5rem; }
.brief-line {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text);
  margin: 0;
}
.brief-placeholder { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ─── Band 7: user reviews ─── */
.testimonials-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.testimonials-panel[hidden] { display: none; }
.testimonials-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.testimonials-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.testimonials-count { font-size: 0.75rem; color: var(--muted); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.testimonial-avatar-img,
.testimonial-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}
.testimonial-body {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.85;
  color: var(--text);
}
.testimonial-author { font-size: 0.76rem; color: var(--muted); font-weight: 600; }

/* ─── Band 2: dedicated active-signals page ─── */
.signals-active .section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.btn-header-back {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.btn-header-back:hover { color: var(--gold); border-color: var(--gold-dim); }

/* ─── Signal-cards login gate (blurred preview for guests) ─────────────── */
.cards-gate { margin: 1.5rem 0; }
.cards-gate-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 0.6rem;
}
.cards-gate-head h2 { margin: 0; font-size: 1.15rem; }
.cards-gate-body { position: relative; }
/* Guests: teaser is capped at roughly one card row; members see the full grid. */
.cards-gate.is-guest .cards-gate-body { max-height: 460px; overflow: hidden; }
.cards-gate.is-guest .trade-cards,
.cards-gate.is-guest .card-filters-bar,
.cards-gate.is-guest .show-more-row {
  filter: blur(9px);
  pointer-events: none;
  user-select: none;
}
.cards-gate-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; z-index: 5;
}
.cards-gate-overlay[hidden] { display: none; }
.cards-gate-card {
  background: rgba(10, 12, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 2rem 2.4rem;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.cards-gate-lock { font-size: 2.2rem; margin-bottom: 0.6rem; }
.cards-gate-text { margin: 0 0 1.2rem; font-size: 1.02rem; }

/* ─── Shop agreement modal (shown at purchase time) ────────────────────── */
.agree-modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.65);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.agree-modal-backdrop[hidden] { display: none; }
.agree-modal-box {
  background: #14141c; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; max-width: 560px; width: 100%;
  max-height: 82vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.agree-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 700;
}
.agree-modal-close {
  background: none; border: 1px solid rgba(255,255,255,0.2); color: #fff;
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer;
}
.agree-modal-body {
  padding: 1rem 1.2rem; overflow: auto; white-space: pre-wrap;
  font-size: 0.85rem; line-height: 1.9; color: rgba(255,255,255,0.85);
}
.agree-modal-footer {
  display: flex; gap: 0.6rem; padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ─── Favorite star on trade cards ─────────────────────────────────────── */
.trade-fav-btn {
  margin-inline-start: auto;
  background: none; border: none; cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 2px 4px;
  color: rgba(255, 255, 255, 0.45);
}
.trade-fav-btn:hover { color: #FFD166; }
.trade-fav-btn.is-fav { color: #FFD166; }
