:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --surface: #171b24;
  --surface-2: #1d2330;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f5f8;
  --text-2: #c5cdd8;
  --muted: #8b93a3;
  --gold: #d4b45a;
  --gold-dim: rgba(212, 180, 90, 0.14);
  --ok: #3dbe7a;
  --ok-dim: rgba(61, 190, 122, 0.14);
  --bad: #e85d5d;
  --bad-dim: rgba(232, 93, 93, 0.14);
  --warn: #e0a354;
  --warn-dim: rgba(224, 163, 84, 0.14);
  --info: #6ea8ff;
  --info-dim: rgba(110, 168, 255, 0.14);
  --idle: #6b7382;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --display: "Vazirmatn", "Outfit", sans-serif;
  --mono: "JetBrains Mono", "Consolas", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  letter-spacing: -0.01em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(212, 180, 90, 0.06), transparent 55%),
    radial-gradient(700px 380px at 0% 100%, rgba(110, 168, 255, 0.05), transparent 50%);
  z-index: 0;
}
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(212, 180, 90, 0.28); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 22px;
  background: rgba(11, 13, 18, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #f0d78a, #b8922e);
  color: #1a1406;
  font-family: var(--display); font-weight: 800; font-size: 13px;
}
.brand { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.brand em { font-style: normal; color: var(--gold); }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }

.nav { display: flex; gap: 6px; padding: 4px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; }
.nav a, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; font-weight: 700; font-size: 13px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.nav a { color: var(--text-2); }
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a.active { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-teal, .btn-primary {
  background: var(--gold);
  color: #1a1406; border: 0; font-weight: 800;
}
.btn-teal:hover, .btn-primary:hover { filter: brightness(1.06); }
.btn-blue {
  background: #2b3342;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-warn {
  background: #7c2d12;
  color: #ffedd5;
  border: 1px solid #c2410c;
  font-weight: 800;
}
.btn-warn:hover { filter: brightness(1.08); }
.btn-danger {
  background: #991b1b;
  color: #fef2f2;
  border: 1px solid #dc2626;
  font-weight: 800;
}
.btn-danger:hover {
  background: #b91c1c;
  filter: brightness(1.08);
}
.btn-warn.is-idle {
  opacity: 0.55;
  background: #3f3f46;
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.header-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--text-2);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.pill .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.pill .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-dim); }
.pill .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.pill-mt5-detail {
  max-width: min(420px, 46vw);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.notice-bar {
  display: none; margin: 0; padding: 10px 22px;
  background: var(--bad-dim); border-bottom: 1px solid rgba(232, 93, 93, 0.25);
  color: #ffc9c9; font-size: 13px; font-weight: 600;
}
.notice-bar.on { display: block; }

.wrap {
  width: min(1360px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 56px;
  flex: 1;
}

.page-head, .hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.page-head h1, .hero h1 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2px 0 0;
}
.page-head p, .hero p { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 52ch; }
.kicker, .page-kicker {
  font-size: 11px; font-weight: 800; color: var(--gold);
  letter-spacing: 0.12em; text-transform: uppercase;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sys-indicator {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 4px 6px 2px;
  min-width: 220px;
}
.sys-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.sys-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-dim); }
.sys-dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-dim); }
.sys-dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-dim); }
.sys-meta { display: grid; gap: 2px; }
.sys-label { font-size: 13px; font-weight: 800; }
.sys-sub { font-size: 11px; color: var(--muted); font-weight: 600; }

.field { display: grid; gap: 5px; min-width: 124px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 700; }

.symbol-panel[hidden] { display: none !important; }
.symbol-panel {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.symbol-panel-head {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.symbol-panel-head h2 {
  font-family: var(--display); font-size: 16px; font-weight: 800; margin: 0 0 4px;
}
.symbol-panel-head p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; max-width: 42rem; }
.symbol-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.symbol-groups {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.symbol-group h3 {
  font-size: 12px; color: var(--muted); font-weight: 800;
  margin: 0 0 8px; letter-spacing: 0.02em;
}
.symbol-checks {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.symbol-check {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  font-weight: 700; font-size: 13px;
  user-select: none;
}
.symbol-check:hover { border-color: var(--line-strong); }
.symbol-check input { accent-color: var(--gold); width: 15px; height: 15px; }
.symbol-check.is-on {
  border-color: rgba(212, 180, 90, 0.45);
  background: var(--gold-dim);
  color: var(--text);
}
.symbol-panel-foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.field input, .field select {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
}
.field input:focus, .field select:focus { border-color: rgba(212, 180, 90, 0.45); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .l { font-size: 11px; color: var(--muted); font-weight: 700; }
.stat .v {
  font-family: var(--display);
  font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.04em;
}
.stat .v.ok { color: var(--ok); }
.stat .v.bad { color: var(--bad); }
.stat .v.warn { color: var(--warn); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.slot-main-chart {
  width: 100%;
  height: 260px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0e1118;
  margin-bottom: 10px;
  display: block;
  direction: ltr;
}
.wave-preview {
  width: 100%;
  height: 96px;
  min-height: 96px;
  display: block !important;
  visibility: visible;
  opacity: 1;
  direction: ltr;
  unicode-bidi: isolate;
  border-radius: var(--radius-sm);
  background: #0e1118;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  overflow: visible;
}
svg.wave-preview {
  overflow: visible;
  width: 100%;
  max-width: 100%;
}
.wave-preview.wave-preview-levels { height: 148px; min-height: 148px; }
.wave-preview.wave-empty {
  display: flex; align-items: center; padding: 0 12px;
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.wave-meta {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 8px;
}
.wave-meta b { color: var(--text); }
.wave-abc {
  font-size: 11px; color: var(--muted); font-weight: 700;
  margin: -4px 0 8px; font-family: var(--mono);
}
.wave-abc b { color: var(--text); }
.filter-box {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--bad-dim); border: 1px solid rgba(232, 93, 93, 0.28);
}
.filter-box.ok { background: var(--ok-dim); border-color: rgba(61, 190, 122, 0.28); }
.filter-box.warn { background: var(--warn-dim); border-color: rgba(224, 163, 84, 0.28); }
.filter-box .fb-title { font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.filter-box ul { margin: 0; padding: 0 16px 0 0; }
.filter-box li { font-size: 11.5px; color: #ffc9c9; margin: 3px 0; }
.filter-box.ok li { color: #b8f0d0; }
.filter-box.warn li, .filter-box.warn .fb-title { color: #f6d9a6; }
.slot-updated { font-size: 11px; color: var(--muted); margin-top: 8px; }
.busy-spin {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(246, 217, 166, 0.3); border-top-color: #f0c674;
  animation: spin .7s linear infinite; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-box {
  position: absolute; z-index: 20;
  min-width: 210px; max-width: min(320px, 46%);
  padding: 10px 12px;
  background: rgba(12, 14, 20, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.overlay-box.wave-box { top: 16px; right: 16px; }
.overlay-box.wave-box.collapsed {
  min-width: 0;
  max-width: min(280px, 90%);
  padding-bottom: 8px;
}
.wave-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  cursor: pointer;
  user-select: none;
}
.wave-box-head h4 {
  font-size: 12px;
  margin: 0;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.wave-box-summary {
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
}
.wave-box-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.wave-box-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}
.wave-box-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.wave-box.collapsed .wave-box-body {
  display: none;
}
.wave-box.collapsed .wave-box-head {
  margin-bottom: 0;
}
.overlay-box.filter-box-abs { top: 16px; left: 16px; max-width: min(340px, 48%); }
.overlay-box h4 { font-size: 12px; margin-bottom: 6px; }
.overlay-box .wave-box-head h4 { margin-bottom: 0; }
.overlay-box div { color: var(--muted); margin: 3px 0; }
.overlay-box .wave-box-body div { margin: 3px 0; }
.overlay-box b { color: var(--text); }
.overlay-box ul { margin: 4px 0 0; padding: 0 14px 0 0; }
.overlay-box li { color: #ffc9c9; margin: 2px 0; }
.exact-pts { font-size: 11px; line-height: 1.55; color: var(--muted); }
.exact-pts b { color: var(--text); font-family: var(--mono); }
.hist-wave { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.hist-wave canvas { width: 88px; height: 40px; border-radius: 8px; background: #0e1118; border: 1px solid var(--line); flex: 0 0 auto; }
.hist-wave .wave-text { font-size: 12px; color: var(--text); line-height: 1.45; }
.hist-wave .wave-text b { font-family: var(--mono); font-size: 12px; color: #e8edf5; }
.show-wave-field { display: flex; align-items: center; gap: 8px; padding-top: 18px; }
.show-wave-field input { width: 16px; height: 16px; }
.trade-modal-body { display: grid; gap: 10px; margin-top: 10px; }
.trade-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .trade-modal-grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--idle);
}
.card.ok::before { background: var(--ok); }
.card.warn::before { background: var(--warn); }
.card.bad::before { background: var(--bad); }
.card.info::before { background: var(--info); }
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card .top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  margin-bottom: 12px;
}
.card .sym { font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.card .tf { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 2px; }
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; white-space: nowrap;
}
.badge.ok { background: var(--ok-dim); color: #8ee0b0; }
.badge.warn { background: var(--warn-dim); color: #f0c674; }
.badge.bad { background: var(--bad-dim); color: #ffb1b1; }
.badge.info { background: var(--info-dim); color: #b7d2ff; }
.rows { display: grid; gap: 7px; }
.row {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.row b { color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.actions .btn { flex: 1; min-width: 110px; }

.chart-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
#tv-chart { width: 100%; height: min(72vh, 680px); min-height: 420px; border-radius: 12px; overflow: hidden; direction: ltr; background: #0e1118; }
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.legend .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px;
}
.meta-panel {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.meta-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.meta-item span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.meta-item b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 13px; }

.trade-tooltip {
  position: absolute; z-index: 30; display: none;
  min-width: 210px; padding: 12px;
  background: rgba(12, 14, 20, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.trade-tooltip.on { display: block; }
.trade-tooltip h4 { font-size: 13px; margin-bottom: 8px; }
.trade-tooltip div { font-size: 12px; color: var(--muted); margin: 3px 0; }
.trade-tooltip b { color: var(--text); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
tbody tr[data-row] { cursor: pointer; }
th, td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
th {
  position: sticky; top: 0;
  background: #1a1f2a;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  z-index: 1;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr.row-ok { background: rgba(61, 190, 122, 0.05); }
tbody tr.row-bad { background: rgba(232, 93, 93, 0.05); }
tbody tr.row-warn { background: rgba(224, 163, 84, 0.05); }
.thumb {
  width: 72px; height: 36px;
  border-radius: 8px;
  background: #0e1118;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: none; place-items: center;
  background: rgba(0,0,0,0.72);
  padding: 20px;
}
.lightbox.on { display: grid; }
.lightbox-card {
  width: min(720px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 16px;
}
.lightbox-card canvas { width: 100%; height: 220px; background: #0e1118; border-radius: 10px; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  opacity: 0; pointer-events: none;
  background: #1a1f2a; color: #fff;
  border: 1px solid var(--line-strong);
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow);
  transition: .25s ease; z-index: 100;
  max-width: min(92vw, 480px); text-align: center; font-weight: 700; font-size: 13px;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(61, 190, 122, .45); }
.toast.bad { border-color: rgba(232, 93, 93, .45); }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 8px 12px 22px;
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  #tv-chart { height: 54vh; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { flex: 1; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .brand { font-size: 16px; }
  .wrap { width: calc(100% - 20px); }
  .actions .btn { flex: 1 1 100%; }
  .toolbar { padding: 12px; }
}

html.embed-chart,
html.embed-chart body {
  background: #0e1118;
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100%;
}
html.embed-chart .app-shell,
html.embed-chart .wrap,
html.embed-chart .chart-shell {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
  box-shadow: none;
  background: #0e1118;
}
html.embed-chart #app-chrome,
html.embed-chart .hero,
html.embed-chart .page-head,
html.embed-chart .toolbar,
html.embed-chart .legend,
html.embed-chart .meta-panel,
html.embed-chart .overlay-box,
html.embed-chart .footer-note,
html.embed-chart .trade-tooltip {
  display: none !important;
}
html.embed-chart #tv-chart {
  height: 100%;
  min-height: 100%;
  border-radius: 0;
}

.report-panel[hidden] { display: none !important; }
.report-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}
.report-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.report-banner.ok { border-color: rgba(61, 190, 122, 0.35); background: var(--ok-dim); }
.report-banner.warn { border-color: rgba(224, 163, 84, 0.35); background: var(--warn-dim); }
.report-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ok);
  flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(61, 190, 122, 0.55);
  animation: reportPulse 1.6s ease-out infinite;
}
.report-banner.warn .report-pulse {
  background: var(--warn);
  animation: none;
  box-shadow: none;
}
@keyframes reportPulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 190, 122, 0.55); }
  70% { box-shadow: 0 0 0 14px rgba(61, 190, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 190, 122, 0); }
}
.report-banner .report-banner-title {
  font-weight: 800;
  font-size: 16px;
}
.report-banner .report-banner-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.report-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.report-kpi .l { font-size: 11px; color: var(--muted); font-weight: 700; }
.report-kpi .v {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.03em;
}
.report-kpi .v.ok { color: var(--ok); }
.report-kpi .v.warn { color: var(--warn); }
.report-kpi .v.info { color: var(--info); }
.report-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 180px;
}
.report-card h3 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.report-pipe {
  display: flex;
  align-items: stretch;
  gap: 6px;
  direction: ltr;
}
.report-pipe-step {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
}
.report-pipe-step .n {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}
.report-pipe-step .t { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.report-pipe-step .p { font-size: 11px; font-weight: 800; color: var(--gold); margin-top: 2px; }
.report-pipe.mini { margin-top: 4px; }
.report-note { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.7; }
.report-donut-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.report-donut { width: min(100%, 240px); height: auto; }
.report-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.report-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.report-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.report-legend-item span { flex: 1; }
.report-legend-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.report-reason { margin: 0 0 14px; }
.report-reason-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}
.report-reason-head span { color: var(--muted); font-weight: 700; }
.report-reason-meta { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.report-bar-track.tall { height: 10px; }
.report-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
  font-weight: 700;
}
.report-bar-track {
  height: 8px;
  border-radius: 99px;
  background: #2a3140;
  overflow: hidden;
  direction: ltr;
}
.report-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gold);
}
.report-spark {
  width: 100%;
  height: 88px;
  display: block;
  direction: ltr;
}
.report-log {
  list-style: none;
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-log li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.report-log .muted { color: var(--muted); font-weight: 600; }
.report-waves {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.report-wave-item {
  background: #0e1118;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.report-wave-item .cap {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-2);
}
#report-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-tunes h4 {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
}
.report-tunes h4:first-of-type { margin-top: 4px; }
.report-tune-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.report-tune-label { font-size: 13px; font-weight: 800; }
.report-tune-hint { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.report-tune-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}
.report-tune-check {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}
.report-tune-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.report-tunes-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
@media (max-width: 900px) {
  .report-kpis, .report-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .report-tune-row { grid-template-columns: 1fr; }
  .report-tune-check { justify-content: flex-start; }
}

