/* ── Design tokens ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base:      #080B0F;
  --bg-card:      #0F1318;
  --bg-card-hover:#131920;
  --bg-border:    #1C2128;
  --bg-elevated:  #161B22;

  --text-primary: #E6EDF3;
  --text-secondary:#8B949E;
  --text-muted:   #484F58;

  --green:        #3FB950;
  --green-dim:    rgba(63,185,80,0.12);
  --yellow:       #D29922;
  --yellow-dim:   rgba(210,153,34,0.12);
  --red:          #F85149;
  --red-dim:      rgba(248,81,73,0.12);
  --blue:         #58A6FF;
  --blue-dim:     rgba(88,166,255,0.12);
  --accent:       #1F6FEB;
  --accent-hover: #2D7FF5;

  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;

  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --sidebar-width:     220px;
  --sidebar-collapsed: 60px;
  --statusbar-height:  48px;

  --transition: 150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-collapsed);
  background: var(--bg-card);
  border-right: 1px solid var(--bg-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width var(--transition);
  z-index: 100;
}
.sidebar:hover { width: var(--sidebar-width); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--bg-border);
  height: var(--statusbar-height);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar:hover .logo-text { opacity: 1; }

.nav-links { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden;
  border: none; background: none; width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-link.active { background: var(--blue-dim); color: var(--blue); }
.nav-link .nav-icon { font-size: 18px; flex-shrink: 0; width: 28px; text-align: center; }
.nav-label { opacity: 0; transition: opacity var(--transition); }
.sidebar:hover .nav-label { opacity: 1; }

/* ── Main area ─────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Status bar ────────────────────────────────────────────────────────────── */
.status-bar {
  height: var(--statusbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-border);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
  flex-shrink: 0;
}
.status-bar .status-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  margin-right: auto;
}
.status-bar .status-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.status-dot.green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.red    { background: var(--red); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.gray   { background: var(--text-muted); }

/* ── Favorites ─────────────────────────────────────────────────────────────── */
.star-btn {
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.star-btn:hover          { color: var(--yellow); transform: scale(1.2); }
.star-btn.starred        { color: var(--yellow); }

.signal-card.favorited {
  border-color: rgba(210,153,34,0.35);
  box-shadow: 0 0 0 1px rgba(210,153,34,0.15);
}

/* ── Page content ──────────────────────────────────────────────────────────── */
.page-content {
  flex: 1; overflow-y: auto;
  padding: 24px;
}
.page-header {
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
}
.page-header p {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.card-sm { padding: 12px; border-radius: var(--radius-md); }

/* ── Signal grid ───────────────────────────────────────────────────────────── */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.signal-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}
.signal-card:hover { background: var(--bg-card-hover); border-color: #2D333B; }
.signal-card.buy-buy   { border-left: 3px solid var(--green); }
.signal-card.sell-sell { border-left: 3px solid var(--red); }
.signal-card.pre-buy,
.signal-card.sell-beg,
.signal-card.pre-sell  { border-left: 3px solid var(--yellow); }
.signal-card.neutral   { border-left: 3px solid var(--text-muted); }

.signal-card .card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.signal-card .sym {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.signal-card .price {
  font-size: 18px; font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 2px;
}
.signal-card .change {
  font-size: 12px;
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.change.pos { color: var(--green); }
.change.neg { color: var(--red); }
.change.flat { color: var(--text-muted); }

.signal-card .sparkline { display: block; width: 100%; height: 32px; }

.tv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.85;
}

.signal-card .expanded-detail {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bg-border);
  font-size: 12px;
  color: var(--text-secondary);
}
.signal-card.open .expanded-detail { display: block; }
.detail-row {
  display: flex; justify-content: space-between;
  margin-bottom: 3px;
}
.detail-val {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ── Key levels section (inside expanded card detail) ───────────────────────── */
.key-levels-section {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bg-border);
}
.key-levels-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-val.kl-stop   { color: var(--red); }
.detail-val.kl-support { color: var(--yellow); }
.detail-val.kl-target  { color: var(--green); }

/* ── Signal group headers ───────────────────────────────────────────────────── */
.group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 6px;
  margin-top: 4px;
  border-bottom: 1px solid var(--bg-border);
}
.group-header:first-child { margin-top: 0; padding-top: 0; }

.group-icon  { font-size: 15px; flex-shrink: 0; line-height: 1; }

.group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.group-desc {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Group colour variants */
.group-exit  { border-bottom-color: rgba(248,81,73,0.35); }
.group-exit  .group-label { color: var(--red); }
.group-exit  .group-count { background: var(--red-dim); color: var(--red); }

.group-enter { border-bottom-color: rgba(63,185,80,0.35); }
.group-enter .group-label { color: var(--green); }
.group-enter .group-count { background: var(--green-dim); color: var(--green); }

.group-watch { border-bottom-color: rgba(210,153,34,0.35); }
.group-watch .group-label { color: var(--yellow); }
.group-watch .group-count { background: var(--yellow-dim); color: var(--yellow); }

.group-hold  { border-bottom-color: rgba(63,185,80,0.18); }
.group-hold  .group-label { color: var(--green); opacity: 0.75; }
.group-hold  .group-count { background: var(--green-dim); color: var(--green); }

.group-neutral { border-bottom-color: var(--bg-border); }
.group-neutral .group-label { color: var(--text-secondary); }

/* ── Chips ─────────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.chip-buy-buy   { background: var(--green-dim);  color: var(--green); }
.chip-pre-buy   { background: var(--yellow-dim); color: var(--yellow); }
.chip-sell-sell { background: var(--red-dim);    color: var(--red); }
.chip-neutral   { background: rgba(128,128,128,0.12); color: var(--text-secondary); }
.chip-iv        { background: var(--green-dim);  color: var(--green); }
.chip-hv        { background: var(--yellow-dim); color: var(--yellow); }
.chip-earnings  { background: var(--red-dim);    color: var(--red); }
.chip-blue      { background: var(--blue-dim);   color: var(--blue); }
/* Secondary "pre" states (TOS pre2) — distinct from PRE-BUY/PRE-SELL */
.chip-pre-buy2  { background: rgba(45,212,191,0.14);  color: #2DD4BF; }  /* bull lean — teal */
.chip-pre-sell2 { background: rgba(240,136,62,0.14);  color: #F0883E; }  /* bear lean — orange */

/* Timeframe badges on catalyst/risk list items ([upcoming]/[recent]/[ongoing]) */
.tag-chip {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 4px;
  margin-right: 6px; vertical-align: middle;
}
.tag-upcoming { background: var(--blue-dim);  color: var(--blue); }    /* future event */
.tag-recent   { background: var(--green-dim); color: var(--green); }   /* already happened */
.tag-ongoing  { background: rgba(128,128,128,0.14); color: var(--text-secondary); }  /* standing */

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--bg-border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.data-table th:hover { color: var(--text-primary); }
.data-table th.sorted { color: var(--blue); }
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); }
.data-table .mono { font-family: var(--font-mono); }
.data-table .pos  { color: var(--green); }
.data-table .neg  { color: var(--red); }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-btn {
  padding: 5px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 99px;
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--blue); color: var(--text-primary); }
.filter-btn.active { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all var(--transition);
}
.btn:hover { background: #1C2128; border-color: #2D333B; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--red-dim); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(248,81,73,0.2); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Options cards ─────────────────────────────────────────────────────────── */
.options-list { display: flex; flex-direction: column; gap: 12px; }
.option-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.option-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.option-header:hover { background: var(--bg-card-hover); }
.option-header .sym {
  font-size: 15px; font-weight: 600;
  font-family: var(--font-mono);
}
.option-header .price {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.option-header .spacer { flex: 1; }
.option-header .chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
  font-size: 12px;
}
.option-card.open .chevron { transform: rotate(180deg); }
.option-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--bg-border);
}
.option-card.open .option-body { display: block; }

.option-section { margin-top: 14px; }
.option-section-title {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.option-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bg-border);
}
.option-row:last-child { border-bottom: none; }
.option-row .label { color: var(--text-secondary); }
.option-row .val { font-family: var(--font-mono); color: var(--text-primary); }
.option-row .val.pos { color: var(--green); }
.option-row .val.neg { color: var(--red); }

.ev-bar-wrap { margin-top: 8px; }
.ev-bar {
  display: flex; height: 8px;
  border-radius: 99px; overflow: hidden;
  margin-bottom: 4px;
}
.ev-bar .seg-bear { background: var(--red);   }
.ev-bar .seg-base { background: var(--text-muted); }
.ev-bar .seg-bull { background: var(--green); }
.ev-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}

/* ── Alerts feed ───────────────────────────────────────────────────────────── */
.alert-feed { display: flex; flex-direction: column; gap: 1px; }
.alert-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-border);
  font-size: 13px;
}
.alert-row:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.alert-row:last-child { border-bottom: none; border-radius: 0 0 var(--radius-md) var(--radius-md); }
.alert-ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.alert-hint { color: var(--text-secondary); font-size: 12px; flex: 1; }
.alert-sym { cursor: pointer; transition: filter 0.12s, transform 0.12s; }
.alert-sym:hover { filter: brightness(1.25); transform: translateY(-1px); }
.chip-tf {
  background: rgba(128,128,128,0.14);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
}
.alert-price {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.alert-align {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ── Options "How to read" help button + modal ─────────────────────────────── */
.help-btn {
  margin-left: 10px;
  vertical-align: middle;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.help-btn:hover { color: var(--text-primary); border-color: var(--accent); }

.help-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn 0.12s ease;
}
.help-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  max-width: 640px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.help-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bg-border);
  font-weight: 600; color: var(--text-primary);
}
.help-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  line-height: 1; padding: 2px 6px;
}
.help-close:hover { color: var(--text-primary); }
.help-modal-body {
  padding: 8px 18px 18px;
  overflow-y: auto;
  font-size: 13px; line-height: 1.5;
  color: var(--text-secondary);
}
.help-modal-body p { margin: 6px 0; }
.help-modal-body h4 {
  color: var(--text-primary);
  margin: 16px 0 4px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.help-modal-body b { color: var(--text-primary); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Screener page filter bar ──────────────────────────────────────────────── */
.scr-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.scr-in {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px; width: 110px;
}
.scr-in:focus { outline: none; border-color: var(--accent); }
.scr-in::placeholder { color: var(--text-muted); }
.scr-act {
  background: var(--bg-elevated); border: 1px solid var(--bg-border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 2px 7px; font-size: 12px; cursor: pointer; margin-right: 4px;
}
.scr-act:hover { color: var(--text-primary); border-color: var(--accent); }

/* ── Positions page (paper account) ────────────────────────────────────────── */
.acct-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.acct-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-md); padding: 12px 16px; min-width: 120px;
}
.acct-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tr-toggle {
  border: 1px solid var(--bg-border); border-radius: var(--radius-sm);
  padding: 4px 12px; font-size: 14px; font-weight: 700; font-family: var(--font-mono);
  cursor: pointer; align-self: flex-start;
}
.tr-toggle.on  { background: var(--green-dim); color: var(--green); border-color: var(--green); }
.tr-toggle.off { background: var(--red-dim);   color: var(--red);   border-color: var(--red); }
.acct-val { font-size: 18px; font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.sec-title { font-size: 13px; color: var(--text-secondary); margin: 18px 0 8px; font-weight: 600; }

/* ── Research page + chart-modal section ───────────────────────────────────── */
.research-list { display: flex; flex-direction: column; gap: 12px; }
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.research-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.research-head .sym { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.research-head .spacer { flex: 1; }
.research-ts { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.research-summary { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
.research-sub { margin: 6px 0; font-size: 12px; }
.research-sub b { color: var(--text-primary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.research-sub ul, .cm-research-cats { margin: 4px 0 0; padding-left: 18px; color: var(--text-secondary); }
.research-sub li, .cm-research-cats li { font-size: 12px; line-height: 1.45; margin: 2px 0; }
.research-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.research-sources a { font-size: 11px; color: var(--blue); }
.research-sources a:hover { text-decoration: underline; }

/* ── Watchlist chips ───────────────────────────────────────────────────────── */
.wl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.wl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.wl-chip .rm {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 14px; line-height: 1;
  padding: 0 2px;
  transition: color var(--transition);
}
.wl-chip .rm:hover { color: var(--red); }

/* ── Job log ───────────────────────────────────────────────────────────────── */
.job-log {
  background: #0D1117;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 10px;
}

/* ── Sector gate banner ────────────────────────────────────────────────────── */
.gate-banner {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--red);
  font-size: 13px; font-weight: 500;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Skeleton loader ───────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-border) 25%, var(--bg-elevated) 50%, var(--bg-border) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
.skeleton-card {
  height: 130px;
  border-radius: var(--radius-lg);
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: fadeIn 200ms ease;
  max-width: 320px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.info    { border-color: var(--blue);  color: var(--blue); }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Stale badge ───────────────────────────────────────────────────────────── */
.stale-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--yellow-dim);
  border: 1px solid var(--yellow);
  border-radius: 99px;
  font-size: 11px;
  color: var(--yellow);
  margin-left: 8px;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; }

/* ── Error state ───────────────────────────────────────────────────────────── */
.error-banner {
  background: var(--red-dim);
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Add input row ─────────────────────────────────────────────────────────── */
.input-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.input-row input[type=text],
.input-row input[type=password] {
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color var(--transition);
}
.input-row input:focus { border-color: var(--accent); }
.input-row input::placeholder { color: var(--text-muted); }

/* ── Strategy page ─────────────────────────────────────────────────────────── */
.strategy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.strategy-grid.three-col { grid-template-columns: 1fr 1fr 1fr; }
.strategy-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.strategy-section-title::after {
  content: ''; flex: 1;
  height: 1px; background: var(--bg-border);
}
.rule-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-border);
  font-size: 13px;
}
.rule-row:last-child { border-bottom: none; }
.rule-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.rule-text { flex: 1; }
.rule-text strong { color: var(--text-primary); display: block; margin-bottom: 2px; }
.rule-text span   { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

.signal-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.signal-matrix th {
  text-align: center; padding: 6px 8px;
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--bg-border);
}
.signal-matrix td {
  text-align: center; padding: 7px 8px;
  border-bottom: 1px solid var(--bg-border);
  color: var(--text-secondary);
}
.signal-matrix td:first-child { text-align: left; font-family: var(--font-mono); }
.signal-matrix tr:last-child td { border-bottom: none; }
.signal-matrix .check { color: var(--green); font-size: 14px; }
.signal-matrix .cross { color: var(--red);   font-size: 14px; }
.signal-matrix .dot   { color: var(--text-muted); font-size: 14px; }

.decision-tree {
  display: flex; flex-direction: column; gap: 6px;
}
.dt-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.dt-step.entry { background: var(--green-dim); border: 1px solid rgba(63,185,80,.25); }
.dt-step.exit  { background: var(--red-dim);   border: 1px solid rgba(248,81,73,.25); }
.dt-step.watch { background: var(--yellow-dim);border: 1px solid rgba(210,153,34,.25); }
.dt-step.info  { background: var(--bg-elevated);border: 1px solid var(--bg-border); }
.dt-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-border);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.dt-step.entry .dt-num { background: rgba(63,185,80,.3);  color: var(--green); }
.dt-step.exit  .dt-num { background: rgba(248,81,73,.3);  color: var(--red); }
.dt-step.watch .dt-num { background: rgba(210,153,34,.3); color: var(--yellow); }
.dt-text { flex: 1; }
.dt-text strong { display: block; color: var(--text-primary); margin-bottom: 1px; }
.dt-text small  { color: var(--text-secondary); font-size: 12px; }

.tip-box {
  background: var(--blue-dim);
  border: 1px solid rgba(88,166,255,.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.tip-box strong { color: var(--blue); }

/* ── Chart Modal ───────────────────────────────────────────────────────────── */
.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms ease;
}
.chart-modal-backdrop.chart-modal-visible { opacity: 1; }

.chart-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  display: flex;
  width: 90vw;
  max-width: 1100px;
  height: 75vh;
  max-height: 720px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.chart-modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition);
}
.chart-modal-close:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* LEFT — chart pane */
.chart-modal-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--bg-border);
  overflow: hidden;
  min-width: 0;
}

.chart-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-border);
  flex-shrink: 0;
}
.cm-symbol {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
}
.cm-price {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
}
.cm-change {
  font-family: var(--font-mono);
  font-size: 13px;
}
.cm-change.pos  { color: var(--green); }
.cm-change.neg  { color: var(--red); }
.cm-change.flat { color: var(--text-muted); }

.chart-range-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bg-border);
  flex-shrink: 0;
}
.range-btn {
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.range-btn:hover   { color: var(--text-primary); border-color: var(--blue); }
.range-btn.active  { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.range-btn:disabled,
.range-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Intraday-limit hint shown beside the range buttons */
.chart-iv-note {
  margin-left: auto;
  align-self: center;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Candle-interval selector row */
.chart-interval-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--bg-border);
  flex-shrink: 0;
}
.iv-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 4px;
}
.iv-btn {
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.iv-btn:hover  { color: var(--text-primary); border-color: var(--blue); }
.iv-btn.active { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* ── Multi-timeframe compare view ────────────────────────────────────────────── */
.cm-compare-btn {
  margin-left: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition);
}
.cm-compare-btn:hover { border-color: var(--blue); color: var(--blue); }

.mtf-modal-backdrop {
  position: fixed; inset: 0; z-index: 3000;   /* above the chart modal (2000) */
  display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0; transition: opacity 0.15s ease;
}
.mtf-modal-backdrop.mtf-visible { opacity: 1; }
.mtf-dialog {
  position: absolute; inset: 3%;
  background: #080B0F;
  border: 1px solid var(--bg-border); border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
}
.mtf-header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--bg-border); flex-shrink: 0;
}
.mtf-title   { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.mtf-readout { font-size: 13px; color: var(--text-secondary); }
.mtf-toggles { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.mtf-close {
  background: none; border: none;
  color: var(--text-secondary); font-size: 22px; line-height: 1; cursor: pointer;
}
.mtf-close:hover { color: var(--text-primary); }
/* Landscape: 3 full-width charts stacked as rows; head is a compact left rail. */
.mtf-grid {
  flex: 1; display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 1px; background: var(--bg-border); min-height: 0;
}
.mtf-pane { display: flex; flex-direction: row; background: #080B0F; min-height: 0; }
.mtf-pane-head {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 6px; width: 92px; padding: 0 10px; flex-shrink: 0;
  border-right: 1px solid var(--bg-border);
}
.mtf-pane-label { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.mtf-pane-state { font-size: 10px; }
.mtf-pane-body  { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mtf-chart { flex: 1; position: relative; min-height: 0; }
.mtf-osc {
  display: none; height: 25%; min-height: 0; position: relative;
  border-top: 1px solid var(--bg-border);
}
.mtf-osc.active { display: block; }
/* Hover legend — all indicator values at the crosshair bar */
.mtf-leg {
  position: absolute; top: 6px; left: 8px; z-index: 4;
  pointer-events: none; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
  max-width: calc(100% - 16px);
  background: rgba(8, 11, 15, 0.72); border-radius: 4px; padding: 2px 8px;
  font-size: 11px; font-family: var(--font-mono); color: var(--text-secondary);
  backdrop-filter: blur(4px);
}
.mtf-leg span { white-space: nowrap; }
.mtf-leg b    { font-weight: 600; }
@media (max-width: 900px) {
  .mtf-pane      { flex-direction: column; }
  .mtf-pane-head {
    flex-direction: row; align-items: center; width: auto; padding: 5px 10px;
    border-right: none; border-bottom: 1px solid var(--bg-border);
  }
  .mtf-dialog { inset: 1%; }
}

.chart-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}
.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-base);
  z-index: 5;
}

/* Signal state badge overlaid on the candlestick chart */
.chart-signal-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;           /* above chart canvas, below .chart-loading */
  pointer-events: none; /* don't block chart interactions */
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.03em;
}

/* Indicator toggle bar */
.chart-ind-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ind-toggle {
  padding: 2px 9px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ind-toggle:hover              { border-color: var(--text-secondary); color: var(--text-primary); }
.ind-toggle.active             { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.ind-toggle[data-ind="rsi"].active   { background: rgba(210,153,34,0.12); border-color: var(--yellow); color: var(--yellow); }
.ind-toggle[data-ind="macd"].active  { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.ind-toggle[data-ind="ema50"].active { background: rgba(240,136,62,0.12); border-color: #F0883E; color: #F0883E; }
.ind-toggle[data-ind="ema200"].active{ background: rgba(188,140,255,0.12); border-color: #BC8CFF; color: #BC8CFF; }
.ind-toggle-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 4px;
}

/* Oscillator sub-pane (RSI / MACD) */
.chart-osc-pane {
  position: relative;   /* anchor the .chart-osc-legend overlay */
  display: none;
  width: 100%;
  height: 110px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chart-osc-legend {
  position: absolute;
  top: 4px;
  left: 8px;
  z-index: 4;
  pointer-events: none;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.chart-osc-legend span { white-space: nowrap; }
.chart-osc-legend b    { font-weight: 600; }

.chart-ind-legend {
  position: absolute;
  top: 36px;
  left: 10px;
  z-index: 4;
  pointer-events: none;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(8,11,15,0.72);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  backdrop-filter: blur(4px);
}
.chart-ind-legend span { white-space: nowrap; }
.chart-ind-legend b    { font-weight: 600; }

/* RIGHT — detail panel */
.chart-modal-right {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 14px 14px 20px;
}

.cm-section { margin-bottom: 16px; }
.cm-section:last-child { margin-bottom: 0; }

.cm-section-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: center;
}

/* ⚡ Auto button inside Key Levels section title */
.kl-auto-btn {
  margin-left: auto;
  padding: 1px 8px;
  font-size: 10px;
  border-radius: 99px;
  border: 1px solid var(--bg-border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  transition: all var(--transition);
  flex-shrink: 0;
}
.kl-auto-btn:hover    { color: var(--blue); border-color: var(--blue); }
.kl-auto-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Empty state when no levels are set */
.kl-empty {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0 4px;
  font-style: italic;
}

/* Auto-fill preview card */
.kl-preview-card {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  font-size: 12px;
}
.kl-preview-meta {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  line-height: 1.4;
}
.kl-preview-hint {
  color: var(--text-muted);
  font-size: 10px;
  font-style: italic;
}
.kl-preview-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.kl-save-btn, .kl-dismiss-btn {
  flex: 1;
  font-size: 11px;
  padding: 5px 8px;
  justify-content: center;
}
.cm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(28,33,40,0.5);
}
.cm-row:last-child { border-bottom: none; }


/* ── Chart-modal action suggestion ─────────────────────────────────────────── */
.cm-suggestion {
  font-size: 12px;
  line-height: 1.45;
  padding: 9px 11px;
  border-radius: 6px;
  border-left: 3px solid var(--text-muted);
  background: rgba(110,118,129,0.10);
  color: var(--text-secondary);
}
.cm-suggestion.sug-enter   { border-left-color: var(--green);  background: var(--green-dim);  color: var(--green); }
.cm-suggestion.sug-danger  { border-left-color: var(--red);    background: var(--red-dim);    color: var(--red); }
.cm-suggestion.sug-warn    { border-left-color: var(--yellow); background: var(--yellow-dim); color: var(--yellow); }
.cm-suggestion.sug-neutral { border-left-color: var(--text-muted); }


/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .signal-grid { grid-template-columns: repeat(2, 1fr); }
  .status-bar .status-item:nth-child(n+3) { display: none; }

  /* ── Chart modal: full-screen vertical stack on mobile ───────────────────── */

  /* Drop the backdrop blur — expensive on low-end Android */
  .chart-modal-backdrop { backdrop-filter: none; }

  /* Full-screen dialog, column-stacked (chart top, detail bottom) */
  .chart-modal-dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;          /* dynamic viewport height — hides mobile browser chrome */
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex-direction: column;  /* stack LEFT (chart) above RIGHT (detail) */
  }

  /* Bigger touch target for the close button */
  .chart-modal-close {
    width: 40px;
    height: 40px;
    top: 6px;
    right: 8px;
    font-size: 22px;
    border-radius: var(--radius-md);
  }

  /* Chart pane: fixed height slice at top */
  .chart-modal-left {
    height: 56vh;
    height: 56dvh;
    flex: none;              /* don't let it grow/shrink */
    border-right: none;
    border-bottom: 1px solid var(--bg-border);
    min-height: 0;           /* allow flex children to shrink */
  }

  /* Leave room for the absolute-positioned close button */
  .chart-modal-header {
    padding: 10px 52px 10px 14px;
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .cm-symbol { font-size: 15px; }
  .cm-price  { font-size: 14px; }
  .cm-change { font-size: 12px; }

  /* Compact range + interval bars */
  .chart-range-btns    { padding: 6px 10px; gap: 3px; flex-wrap: wrap; }
  .range-btn           { padding: 4px 10px; font-size: 11px; }
  .chart-interval-btns { padding: 5px 10px; gap: 3px; flex-wrap: wrap; }
  .iv-btn              { padding: 3px 8px;  font-size: 10px; }

  /* Detail panel: fills remaining height, scrolls, 2-column layout */
  .chart-modal-right {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 12px 16px;
    /* Place Key Levels full-width; Signal and TradingView share a row */
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    column-gap: 14px;
  }

  /* Key Levels: full-width row with visual separator below */
  .chart-modal-right .cm-section:first-child {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--bg-border);
  }
}

@media (max-width: 480px) {
  .signal-grid { grid-template-columns: 1fr; }
  .page-content { padding: 14px; }

  /* Very narrow screens: single-column detail panel */
  .chart-modal-right {
    grid-template-columns: 1fr;
  }
  .chart-modal-right .cm-section:first-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}
