/* FinViet Pro — fintech dark theme */
:root {
  --bg: #070c18;
  --bg-soft: #0a1224;
  --panel: #0e1729;
  --panel-2: #121d33;
  --panel-3: #16233d;
  --border: #1d2b47;
  --border-soft: rgba(148, 163, 184, 0.10);
  --text: #e8eefb;
  --muted: #8ea3c4;
  --faint: #5f7395;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --up: #16c784;
  --up-soft: rgba(22, 199, 132, 0.13);
  --down: #ef4b5e;
  --down-soft: rgba(239, 75, 94, 0.13);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, 0.13);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 34px rgba(2, 6, 18, 0.5);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(56, 189, 248, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 10%, rgba(99, 102, 241, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.flat { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------- layout */
.layout {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: linear-gradient(180deg, rgba(14, 23, 41, 0.96), rgba(9, 15, 30, 0.98));
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff; box-shadow: 0 6px 18px rgba(56, 189, 248, 0.35);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 15.5px; letter-spacing: -0.01em; }
.brand-text small { color: var(--faint); font-size: 11px; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500;
  transition: all 0.16s ease;
  border: 1px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item:hover { color: var(--text); background: rgba(148, 163, 184, 0.07); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.14));
  border-color: rgba(56, 189, 248, 0.25);
}
.nav-count {
  margin-left: auto; background: var(--down); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 1px 7px; min-width: 20px; text-align: center;
}

/* Submenu Navigation */
.nav-group {
  display: flex;
  flex-direction: column;
}
.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  margin-top: 3px;
  margin-bottom: 5px;
  border-left: 1.5px dashed rgba(56, 189, 248, 0.3);
  margin-left: 20px;
}
.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
}
.nav-subitem:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}
.nav-subitem.active {
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
}
.nav-subitem .sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

/* Submenu Bar across About Pages */
.about-subnav {
  display: flex;
  gap: 8px;
  background: rgba(18, 29, 51, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.about-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
}
.about-subnav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.about-subnav-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sidebar-foot { margin-top: auto; padding: 10px 6px 2px; }
.data-note {
  display: flex; gap: 9px; align-items: center;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.14);
  padding: 10px 12px; border-radius: 11px;
}
.data-note strong { font-size: 12px; display: block; }
.data-note small { color: var(--faint); font-size: 11px; }
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 4px rgba(22, 199, 132, 0.15);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 199, 132, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(22, 199, 132, 0.05); }
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-x: hidden; max-width: 100vw; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 13, 26, 0.72);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 17px; font-weight: 700; white-space: nowrap; }
.top-search {
  flex: 1; max-width: 420px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 12px;
  transition: border-color 0.15s;
}
.top-search:focus-within { border-color: rgba(56, 189, 248, 0.5); }
.top-search svg { width: 15px; height: 15px; color: var(--faint); flex: 0 0 15px; }
.top-search input {
  border: 0; background: transparent; outline: 0; color: var(--text);
  width: 100%; font-size: 13.5px; font-family: inherit;
}
.top-actions { display: flex; align-items: center; gap: 9px; }
#top-bell { display: inline-flex; align-items: center; gap: 6px; }
#top-alert-count { font-weight: 700; font-size: 12px; color: var(--warn); }

.content { padding: 22px 26px 30px; flex: 1; min-width: 0; max-width: 100%; box-sizing: border-box; }
.footer {
  padding: 14px 26px 22px; color: var(--faint); font-size: 11.5px;
  border-top: 1px solid var(--border-soft);
}

/* ------------------------------------------------------------- cards */
.card {
  background: linear-gradient(180deg, rgba(18, 29, 51, 0.55), rgba(14, 23, 41, 0.85));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.card-head h2, .card-head h3 { font-size: 15px; }
.card-head .sub, .card .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-title-row { display: flex; align-items: center; gap: 9px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------------- stat cards */
.stat-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 29, 51, 0.6), rgba(14, 23, 41, 0.9));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-card .label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.stat-card .value { font-size: 24px; font-weight: 800; margin-top: 7px; letter-spacing: -0.02em; }
.stat-card .delta { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.stat-card .spark { position: absolute; right: 10px; bottom: 8px; opacity: 0.9; }
.stat-card.accent { background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(99, 102, 241, 0.12)), var(--panel); }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; border: 1px solid transparent;
  padding: 9px 15px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all 0.15s ease; color: var(--text);
  background: var(--panel-3); white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #4f6df5);
  color: #fff; box-shadow: 0 6px 16px rgba(56, 189, 248, 0.28);
}
.btn-ghost { background: rgba(148, 163, 184, 0.08); border-color: var(--border); }
.btn-danger { background: var(--down-soft); color: #ff98a6; border-color: rgba(239, 75, 94, 0.35); }
.btn-success { background: var(--up-soft); color: #6ee7b7; border-color: rgba(22, 199, 132, 0.35); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: 8px; }
.icon-btn {
  border: 1px solid var(--border); background: var(--panel-3); color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center;
  cursor: pointer; transition: all 0.15s;
}
.icon-btn:hover { color: #fff; border-color: rgba(56, 189, 248, 0.4); }

/* ------------------------------------------------------------ forms */
label.field, .field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field select, input.input, select.input {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color 0.15s; width: 100%;
}
.field input:focus, .field select:focus, .input:focus { border-color: rgba(56, 189, 248, 0.55); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.check-row input { accent-color: #38bdf8; width: 15px; height: 15px; }
.hint { color: var(--faint); font-size: 11.5px; }

.symbol-form { display: flex; gap: 9px; align-items: center; }
.symbol-form input { width: 220px; }

/* ------------------------------------------------------------ tables */
.table-wrap, .table-responsive, .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  position: relative;
  max-width: 100%;
}
.table-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11.5px;
  color: var(--accent);
  padding: 6px 12px;
  background: rgba(56, 189, 248, 0.07);
  border-bottom: 1px solid var(--border-soft);
  font-weight: 500;
}
table.data-table, table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .table th {
  text-align: left; color: var(--faint); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; background: var(--panel);
}
.data-table td, .table td { padding: 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.data-table tbody tr, .table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover, .table tbody tr:hover { background: rgba(56, 189, 248, 0.05); cursor: pointer; }
.data-table tbody tr.no-hover:hover, .table tbody tr.no-hover:hover { background: none; cursor: default; }
.data-table .num, .table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sym-cell { display: flex; flex-direction: column; gap: 1px; }
.sym-cell strong { font-size: 13.5px; }
.sym-cell small { color: var(--faint); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.mobile-del-pos { display: none !important; }

/* ------------------------------------------------ View Mode Toggle */
.view-toggle-group {
  display: inline-flex;
  align-items: center;
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.btn-mode-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-mode-toggle:hover { color: var(--text); }
.btn-mode-toggle.active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

/* --------------------------------- Mobile Financial Cards (Thẻ di động) */
.cw-cards-list, .screener-cards-list, .sector-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.cw-card-mobile, .stock-card-mobile {
  background: linear-gradient(180deg, rgba(22, 35, 61, 0.7), rgba(14, 23, 41, 0.95));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.14s ease, border-color 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cw-card-mobile:active, .stock-card-mobile:active { transform: scale(0.99); }
.cw-card-top, .stock-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cw-card-sym, .stock-card-sym {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cw-card-sym .sym-title, .stock-card-sym .sym-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}
.cw-card-metrics, .stock-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: rgba(10, 18, 36, 0.65);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 8px 10px;
}
.m-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-metric .m-lbl {
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.m-metric .m-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cw-card-tags, .stock-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.cw-card-actions, .stock-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.cw-card-actions .btn, .stock-card-actions .btn {
  flex: 1;
}

/* Collapsible Filter Bar */
.mobile-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.filter-preset-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-preset-scroll::-webkit-scrollbar {
  display: none;
}

/* ------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 8px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
  border: 1px solid transparent; white-space: nowrap;
}
.tone-up { background: var(--up-soft); color: #4ade9d; border-color: rgba(22, 199, 132, 0.35); }
.tone-down { background: var(--down-soft); color: #ff8b9a; border-color: rgba(239, 75, 94, 0.35); }
.tone-neutral { background: rgba(148, 163, 184, 0.1); color: var(--muted); border-color: var(--border); }
.tone-warn { background: var(--warn-soft); color: #fbbf24; border-color: rgba(245, 165, 36, 0.35); }
.tone-info { background: var(--info-soft); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.35); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: var(--muted);
}

/* ----------------------------------------------------------- progress */
.progress { height: 8px; background: rgba(148, 163, 184, 0.12); border-radius: 999px; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  transition: width 0.35s ease;
}
.score-bar { height: 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.13); position: relative; overflow: hidden; }
.score-bar > span { position: absolute; top: 0; bottom: 0; border-radius: 999px; }

/* ------------------------------------------------------------ states */
.empty-state {
  color: var(--muted); text-align: center; padding: 42px 20px; font-size: 13.5px;
}
.empty-state strong { color: var(--text); display: block; margin-bottom: 5px; font-size: 14.5px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(148, 163, 184, 0.25); border-top-color: #38bdf8;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 34px; color: var(--muted); }

/* ------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  min-width: 270px; max-width: 380px;
  background: var(--panel-3); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 11px; padding: 12px 15px;
  box-shadow: var(--shadow); font-size: 13px;
  animation: slideIn 0.22s ease;
}
.toast.success { border-left-color: var(--up); }
.toast.error { border-left-color: var(--down); }
.toast.warn { border-left-color: var(--warn); }
.toast strong { display: block; margin-bottom: 2px; font-size: 13px; }
.toast small { color: var(--muted); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 7, 16, 0.72);
  display: grid; place-items: center; z-index: 150; backdrop-filter: blur(4px);
}
.modal {
  width: min(560px, calc(100vw - 40px));
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; box-shadow: var(--shadow);
  animation: popIn 0.18s ease;
  max-height: 88vh; overflow-y: auto;
}
@keyframes popIn { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------- analysis page */
.analysis-grid { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.side-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.chart-card { padding: 16px 16px 10px; }
.chart-card .card-head { margin-bottom: 6px; }
.chart { width: 100%; }
#price-chart { height: 460px; }
#rsi-chart { height: 110px; margin-top: 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 4px 4px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

.price-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-head .price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.price-head .chg { font-size: 14px; font-weight: 700; }

.kv-list { display: flex; flex-direction: column; gap: 8px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.level-list { display: flex; flex-direction: column; gap: 7px; }
.level-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 10px; font-size: 12.5px;
  background: rgba(148, 163, 184, 0.055); border: 1px solid var(--border-soft);
}
.level-item.buy { border-left: 3px solid var(--up); }
.level-item.sell { border-left: 3px solid var(--down); }
.level-item.stop { border-left: 3px solid var(--warn); }
.level-item .lbl { color: var(--muted); }
.level-item .prc { font-weight: 700; font-variant-numeric: tabular-nums; }

.gauge-wrap { display: flex; align-items: center; gap: 14px; }
.gauge-label { font-size: 26px; font-weight: 800; }
.reason-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.reason-list li {
  font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 9px; background: rgba(148, 163, 184, 0.05); border-radius: 8px;
}
.reason-list li::before { content: '•'; color: var(--accent); font-weight: 900; }

.kelly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kelly-result {
  margin-top: 12px; border-radius: 11px; padding: 13px 14px;
  background: rgba(56, 189, 248, 0.07); border: 1px solid rgba(56, 189, 248, 0.18);
}
.kelly-result .big { font-size: 19px; font-weight: 800; }
.kelly-notes { margin: 9px 0 0; padding-left: 16px; color: var(--muted); font-size: 11.8px; display: flex; flex-direction: column; gap: 4px; }

.warn-banner {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--warn-soft); border: 1px solid rgba(245, 165, 36, 0.3);
  color: #fcd34d; padding: 10px 12px; border-radius: 10px; font-size: 12.5px;
  margin-top: 10px;
}

.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table td, .mini-table th { padding: 6px 8px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.mini-table th { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-table tr.hl-fib td { background: rgba(245, 165, 36, 0.07); }

/* ---------------------------------------------------- alerts feed */
.alert-feed { display: flex; flex-direction: column; gap: 9px; }
.alert-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 13px; border-radius: 11px;
  background: rgba(148, 163, 184, 0.05); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border);
}
.alert-item.critical { border-left-color: var(--down); background: var(--down-soft); }
.alert-item.high { border-left-color: #fb7185; }
.alert-item.warning { border-left-color: var(--warn); }
.alert-item.medium { border-left-color: var(--info); }
.alert-item.info { border-left-color: var(--up); }
.alert-item .a-body { flex: 1; min-width: 0; }
.alert-item .a-msg { font-size: 12.8px; }
.alert-item .a-meta { color: var(--faint); font-size: 11px; margin-top: 3px; display: flex; gap: 8px; }
.alert-item .a-actions { display: flex; gap: 6px; }

/* ----------------------------------------------------- screener page */
.criteria-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.criteria-grid .span-2 { grid-column: span 2; }
.run-status-card { margin-top: 16px; }
.results-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------- dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.mover-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.mover-row:last-child { border-bottom: 0; }

.tabs { display: flex; gap: 6px; background: rgba(148, 163, 184, 0.07); border-radius: 11px; padding: 4px; width: fit-content; }
.tab {
  padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border: 0; background: transparent; transition: all 0.15s;
}
.tab.active { background: var(--panel-3); color: #fff; box-shadow: 0 3px 10px rgba(2, 6, 18, 0.4); }

.alloc-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: rgba(148, 163, 184, 0.12); }
.alloc-bar > span { height: 100%; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 11px; font-size: 11.5px; color: var(--muted); }
.alloc-legend .sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.sev-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.sev-critical { background: var(--down); }
.sev-high { background: #fb7185; }
.sev-warning { background: var(--warn); }
.sev-medium { background: var(--info); }
.sev-info { background: var(--up); }

.section-gap { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }

/* ------------------------------------- auth, journal & advanced analysis */
.big { font-size: 19px; font-weight: 800; }
.flat { color: var(--muted); }

.field textarea {
  background: rgba(148, 163, 184, 0.06); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 13px;
  padding: 9px 11px; outline: none; resize: vertical;
}
.field textarea:focus { border-color: rgba(56, 189, 248, 0.55); }

.auth-area { display: flex; align-items: center; gap: 6px; }
.auth-wrap { display: flex; justify-content: center; padding: 40px 0; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card a { color: var(--accent); }

.table-scroll { overflow-x: auto; }

.journal-summary {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.journal-form {
  display: grid; gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  align-items: end;
}
.journal-form .journal-note { grid-column: span 2; }

.pattern-list { display: flex; flex-direction: column; gap: 8px; }
.pattern-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; background: rgba(148, 163, 184, 0.04);
}
.pattern-item.hit { border-color: rgba(56, 189, 248, 0.4); }
.pattern-item.miss { opacity: 0.55; }
.pattern-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pattern-top strong { font-size: 13px; }
.pattern-msg { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }

.swing-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px; border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.swing-item:last-child { border-bottom: none; }

/* ----------------------------------------------------- mobile feature menu */
.mobile-menu-btn { display: none; }
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

/* ------------------------------------------------------- responsive architecture */

/* Mobile Bottom Navigation Bar (Hidden on desktop/tablet > 768px) */
.mobile-bottom-nav {
  display: none;
}

/* Horizontal scrollable container for chip / preset filters */
.filter-preset-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0 6px;
}
.filter-preset-scroll::-webkit-scrollbar {
  display: none;
}

/* Tablet & Desktop Large Screens (> 1024px) */
@media (min-width: 1025px) {
  .criteria-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1.62fr) minmax(320px, 1fr); }
  .journal-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Tablet Screens (641px - 1024px, iPad & Tablets in portrait / landscape) */
@media (max-width: 1024px) and (min-width: 641px) {
  .content { padding: 18px 20px 30px; }
  .grid-4, #cw-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .journal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .journal-form { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .journal-form .journal-note { grid-column: span 3 !important; }
  .side-col { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Screen widths <= 860px: Sidebar transforms into slide-in drawer */
@media (max-width: 860px) {
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.75);
    background: linear-gradient(180deg, rgba(14, 23, 41, 0.98), rgba(8, 14, 28, 0.99));
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 9px; flex: 0 0 auto; border-radius: 9px;
  }
  .sidebar-close {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 14px; right: 12px; padding: 7px;
    border-radius: 8px; color: var(--muted);
  }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(3, 7, 16, 0.68);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  body.menu-open { overflow: hidden; }
}

/* Smartphone & Tablet <= 768px: Mobile Bottom Bar, Touch Inputs, Topbar */
@media (max-width: 768px) {
  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 75;
    height: 56px;
    background: rgba(10, 17, 34, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.5);
  }

  .bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav-item svg { width: 19px; height: 19px; }
  .bnav-item:active { transform: scale(0.93); }
  .bnav-item.active { color: var(--accent); }
  .bnav-item.active svg { stroke: var(--accent); }

  /* Body & main content padding so bottom nav doesn't cover anything */
  .content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Topbar compact layout */
  .topbar {
    padding: 9px 12px;
    gap: 8px;
    position: sticky;
    top: 0;
    padding-top: max(9px, env(safe-area-inset-top, 9px));
  }
  .page-title {
    font-size: 14px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-search {
    max-width: none;
    margin-left: 0;
    padding: 6px 10px;
  }
  .top-search input {
    font-size: 13px;
  }
  #top-scan-btn { display: none; }
  .top-actions { gap: 6px; flex-shrink: 0; }
  .auth-area .btn { padding: 5px 9px; font-size: 12px; }

  /* Touch targets & Prevent iOS auto-zoom */
  input, select, textarea {
    font-size: 16px !important;
  }
  .field input, .field select, input.input, select.input {
    min-height: 42px;
    padding: 8px 12px;
  }
  .btn {
    min-height: 38px;
    padding: 8px 14px;
  }
  .btn-sm {
    min-height: 32px;
    padding: 5px 10px;
  }

  /* Sticky first column on wide data tables for mobile & tablet */
  .table-sticky-first th:first-child,
  .table-sticky-first td:first-child,
  #warrants-table th:first-child,
  #warrants-table td:first-child,
  #screener-table th:first-child,
  #screener-table td:first-child,
  #interest-rates-table th:first-child,
  #interest-rates-table td:first-child,
  #runs-history-table th:first-child,
  #runs-history-table td:first-child,
  #results-table th:first-child,
  #results-table td:first-child,
  #positions-full-table th:first-child,
  #positions-full-table td:first-child,
  #watch-table th:first-child,
  #watch-table td:first-child,
  #journal-table th:first-child,
  #journal-table td:first-child,
  #positions-table th:first-child,
  #positions-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--panel);
    box-shadow: 2px 0 6px -1px rgba(0, 0, 0, 0.5);
  }
  .table-sticky-first th:first-child,
  #warrants-table th:first-child,
  #screener-table th:first-child,
  #interest-rates-table th:first-child,
  #runs-history-table th:first-child,
  #results-table th:first-child,
  #positions-full-table th:first-child,
  #watch-table th:first-child,
  #journal-table th:first-child,
  #positions-table th:first-child {
    z-index: 5;
  }
  .table th, .table td,
  .data-table th, .data-table td {
    padding: 8px 9px;
    font-size: 12px;
  }
}

/* Smartphone Screens (<= 640px, e.g. iPhone, Samsung Galaxy) */
@media (max-width: 640px) {
  .content { padding: 12px 10px calc(74px + env(safe-area-inset-bottom, 0px)) !important; }
  .card { padding: 14px 12px; border-radius: var(--radius-sm); }
  .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-head .btn, .card-head .flex { width: 100%; justify-content: space-between; }

  /* 2 columns for stat cards on mobile: clean 2x2 grid */
  .grid-stats, #cw-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 11px 12px !important;
    border-radius: 10px !important;
  }
  .stat-card .value {
    font-size: 18px !important;
    margin-top: 4px !important;
  }
  .stat-card .label {
    font-size: 11px !important;
  }
  .stat-card .spark { display: none; }

  /* Forms & Card Grids collapse to single column */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; gap: 12px !important; }
  .criteria-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .criteria-grid .span-2 { grid-column: span 1 !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .journal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .journal-form { grid-template-columns: 1fr !important; }
  .journal-form .journal-note { grid-column: span 1 !important; }
  .side-col { grid-template-columns: 1fr !important; }
  .symbol-form { width: 100%; flex-wrap: wrap; }
  .symbol-form input { width: 100% !important; }
  .symbol-form button { width: 100%; }

  /* Chart height on phone */
  #price-chart { height: 340px !important; }
  #rsi-chart { height: 90px !important; }
  .chart-legend { gap: 8px; font-size: 10.5px; }

  /* Modal on phone: Bottom sheet style */
  .modal-backdrop-custom, .modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .modal-backdrop-custom .modal, .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 88vh !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 16px 14px !important;
    margin: 0 !important;
  }

  /* Macro Grid on mobile */
  #macro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #macro-grid .stat-card {
    padding: 10px 10px !important;
  }
  #macro-grid .value {
    font-size: 16px !important;
  }

  /* Table column optimization for smartphone */
  #interest-rates-table th:nth-child(2),
  #interest-rates-table td:nth-child(2),
  #interest-rates-table th:nth-child(3),
  #interest-rates-table td:nth-child(3),
  #interest-rates-table th:nth-child(5),
  #interest-rates-table td:nth-child(5) {
    display: none !important;
  }
  
  #positions-table th:nth-child(2),
  #positions-table td:nth-child(2),
  #positions-table th:nth-child(3),
  #positions-table td:nth-child(3),
  #positions-table th:nth-child(8),
  #positions-table td:nth-child(8) {
    display: none !important;
  }

  #topsignals-table th:nth-child(3),
  #topsignals-table td:nth-child(3),
  #topsignals-table th:nth-child(6),
  #topsignals-table td:nth-child(6) {
    display: none !important;
  }

  #positions-full-table th:nth-child(2),
  #positions-full-table td:nth-child(2),
  #positions-full-table th:nth-child(3),
  #positions-full-table td:nth-child(3),
  #positions-full-table th:nth-child(5),
  #positions-full-table td:nth-child(5),
  #positions-full-table th:nth-child(10),
  #positions-full-table td:nth-child(10) {
    display: none !important;
  }

  .mobile-del-pos {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    padding: 2px 7px !important;
    font-size: 11px !important;
    font-weight: 600;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    background: rgba(239, 68, 68, 0.08) !important;
    border-radius: 4px;
    line-height: 1.2;
    cursor: pointer;
  }
  .mobile-del-pos:active {
    background: rgba(239, 68, 68, 0.25) !important;
  }

  #watch-table th:nth-child(5),
  #watch-table td:nth-child(5),
  #watch-table th:nth-child(7),
  #watch-table td:nth-child(7) {
    display: none !important;
  }

  #journal-table th:nth-child(1),
  #journal-table td:nth-child(1),
  #journal-table th:nth-child(6),
  #journal-table td:nth-child(6),
  #journal-table th:nth-child(7),
  #journal-table td:nth-child(7),
  #journal-table th:nth-child(9),
  #journal-table td:nth-child(9) {
    display: none !important;
  }

  /* Market Analysis Grid & Card Grids collapse cleanly */
  #market-analysis-grid, .tf-steps-grid {
    grid-template-columns: 1fr !important;
  }

  /* Filter collapse state on mobile */
  .filter-grid-collapsed {
    display: none !important;
  }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  .toast {
    min-width: 0;
    max-width: 100%;
  }
}

/* On desktop (> 768px), show table by default and hide cards unless toggled */
@media (min-width: 769px) {
  #warrants-cards-container,
  #results-cards-container,
  #sector-stocks-cards-container {
    display: none;
  }
  .table-scroll-hint {
    display: none;
  }
}

/* On mobile / tablet (<= 768px), default to cards view unless user chooses table view */
@media (max-width: 768px) {
  body:not(.view-table-active) #warrants-cards-container,
  body:not(.view-table-active) #results-cards-container,
  body:not(.view-table-active) #sector-stocks-cards-container {
    display: flex !important;
  }
  body:not(.view-table-active) #warrants-table-container,
  body:not(.view-table-active) #results-table-container,
  body:not(.view-table-active) #sector-stocks-table-container {
    display: none !important;
  }

  body.view-table-active #warrants-cards-container,
  body.view-table-active #results-cards-container,
  body.view-table-active #sector-stocks-cards-container {
    display: none !important;
  }
  body.view-table-active #warrants-table-container,
  body.view-table-active #results-table-container,
  body.view-table-active #sector-stocks-table-container {
    display: block !important;
  }
}

/* Extra small screens (<= 420px) */
@media (max-width: 420px) {
  .page-title { display: none; }
  .grid-stats, #cw-summary-cards, #macro-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .btn-filter-preset {
    padding: 4px 9px;
    font-size: 11px;
  }
  #interest-rates-table th:nth-child(4),
  #interest-rates-table td:nth-child(4),
  #interest-rates-table th:nth-child(8),
  #interest-rates-table td:nth-child(8) {
    display: none !important;
  }
}

/* ------------------------------------------------ Trend Following strategy */
.tf-card {
  margin-top: 20px;
  background: linear-gradient(180deg, rgba(14, 23, 41, 0.95), rgba(10, 18, 36, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.tf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tf-badge.pass { background: var(--up-soft); color: var(--up); border: 1px solid rgba(22, 199, 132, 0.35); }
.tf-badge.fail { background: var(--down-soft); color: var(--down); border: 1px solid rgba(239, 75, 94, 0.35); }
.tf-badge.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(245, 165, 36, 0.35); }
.tf-badge.info { background: var(--info-soft); color: var(--info); border: 1px solid rgba(56, 189, 248, 0.35); }

.tf-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(18, 29, 51, 0.65);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.tf-controls .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.tf-controls input[type="number"], .tf-controls input[type="text"] {
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13px;
}
.tf-controls input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.tf-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.tf-step-box {
  background: rgba(18, 29, 51, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease;
}
.tf-step-box:hover {
  border-color: rgba(56, 189, 248, 0.28);
}
.tf-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.tf-step-header h4 {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.tf-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.tf-tranches-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.tf-tranche-card {
  background: rgba(22, 35, 61, 0.7);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}
.tf-tranche-card strong {
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.tf-summary-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.tf-summary-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.tf-summary-table-wrap th, .tf-summary-table-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.tf-summary-table-wrap th {
  background: rgba(18, 29, 51, 0.8);
  color: var(--muted);
  text-align: left;
  font-weight: 600;
}
.tf-summary-table-wrap tr:last-child td {
  border-bottom: none;
}



.module-state .mod-loading, .module-state .mod-error, .module-state .mod-body { display: none; }
.mod-loading-state .mod-loading { display: block !important; }
.mod-error-state .mod-error { display: block !important; }
.mod-body-state .mod-body { display: block !important; }

/* ----------------------------------------------- Covered Warrants (CW) */
.btn-filter-preset {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-filter-preset:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn-filter-preset.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 16, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  padding: 16px;
}
.chip-success {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}
.chip-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.chip-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}

/* ------------------------------------------------------------- Market News & SEO Posts */
.news-feed-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
@media (max-width: 768px) {
  .news-feed-list {
    grid-template-columns: 1fr;
  }
}
.news-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(2, 6, 18, 0.4);
}
.news-card.sentiment-positive {
  border-left: 4px solid var(--up);
}
.news-card.sentiment-negative {
  border-left: 4px solid var(--down);
}
.news-card.sentiment-neutral {
  border-left: 4px solid var(--faint);
}
.news-card-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
  cursor: pointer;
}
.news-card-title:hover {
  color: var(--accent);
}
.news-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.news-impact-box {
  background: rgba(255, 255, 255, 0.025);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.news-symbols-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.news-sym-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.15s ease;
}
.news-sym-chip:hover {
  background: rgba(56, 189, 248, 0.25);
  text-decoration: underline;
}
.news-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

/* ------------------------------------------------------------- Sector Comparison Table */
.sec-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sec-tab-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.sec-tab-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.comparison-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.comparison-table th.sortable:hover {
  color: var(--accent);
}
.badge-breakout {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.badge-breakout.super {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseBreakout 2s infinite;
}
@keyframes pulseBreakout {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
/* ------------------------------------------------ ticker news & events on analysis page */
.ticker-news-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ticker-news-item {
  background: var(--panel-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 12px 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  border-left: 3px solid var(--border);
}
.ticker-news-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
  background: rgba(56, 189, 248, 0.03);
}
.ticker-news-item.type-dividend {
  border-left-color: #10b981;
}
.ticker-news-item.type-news {
  border-left-color: #38bdf8;
}
.ticker-news-item.type-event {
  border-left-color: #a78bfa;
}
.ticker-news-item.type-insider {
  border-left-color: #f59e0b;
}
.ticker-news-item .tni-link {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-bright, #fff);
  text-decoration: none;
  line-height: 1.45;
  display: inline-block;
  transition: color 0.12s ease;
}
.ticker-news-item .tni-link:hover {
  color: var(--accent, #38bdf8);
}
.ticker-news-item .tni-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright, #fff);
  line-height: 1.45;
}
.ticker-news-item .tni-snippet {
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.5;
}
.badge-div {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 600;
  font-size: 11px;
}
.badge-news {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 600;
  font-size: 11px;
}
.badge-event {
  background: rgba(167, 139, 250, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.35);
  font-weight: 600;
  font-size: 11px;
}
.badge-insider {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
  font-size: 11px;
}

