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

:root {
  /* TradingView dark (9/23 v2): black chrome everywhere, navy #131722 reserved
     for the chart pane only, flat TV-blue #2962ff accent */
  --bg: #0a0b0d;
  --card: #101114;
  --card2: #1b1d23;
  --chart: #131722;
  --text: #d1d4dc;
  --muted: #787b86;
  --accent: #2962ff;
  --accent2: #5b8cff;
  --green: #089981;
  --green2: #0aaf94;
  --danger: #f23645;
  --border: #23262d;
  --grad: linear-gradient(90deg, #2962ff, #00bce5);
  /* TV is flatter: tighter radii */
  --r-panel: 8px;
  --r-card: 6px;
  --r-ctl: 4px;
  --shadow-panel: 0 1px 3px rgba(0, 0, 0, 0.32);
  --shadow-pop: 0 10px 32px rgba(0, 0, 0, 0.6);
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh; display: flex; flex-direction: column;
}
.hidden { display: none !important; }

/* ---- header ---- */
header {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; }
.logo-img { width: 30px; height: 30px; }
.logo { font-size: 17px; font-weight: 800; letter-spacing: -0.4px; white-space: nowrap; }
.logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#research-form { display: flex; gap: 8px; flex: 1; max-width: 420px; }
#ticker {
  flex: 1; min-width: 70px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text); font-size: 14px; text-transform: uppercase; outline: none;
}
#ticker:focus { border-color: var(--accent); }
#run-date {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 8px; color: var(--text); font-size: 12.5px; outline: none; color-scheme: dark;
}
#run-date:focus { border-color: var(--accent); }
button {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: wait; }
button.mini { padding: 5px 10px; font-size: 11.5px; background: var(--card2); color: var(--text); border: 1px solid var(--border); }
button.mini:hover { border-color: var(--accent); }
button.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
#user-bar { display: flex; align-items: center; margin-left: auto; position: relative; }
/* avatar button + dropdown menu */
#avatar-btn { background: none; border: none; padding: 0; border-radius: 50%; line-height: 0; }
#avatar-btn:hover { filter: none; }
#avatar-btn:hover .avatar-dot { box-shadow: 0 0 0 2px var(--accent); }
#avatar-btn .avatar-dot { width: 30px; height: 30px; font-size: 13px; }
#user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; min-width: 232px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.um-email { padding: 8px 10px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 6px; overflow-wrap: anywhere; }
.um-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; color: var(--text); font-size: 12.5px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px; text-align: left;
}
.um-item:hover { background: var(--card2); filter: none; }
.um-item .um-ic { line-height: 0; }
.um-item .ic { width: 15px; height: 15px; color: var(--accent2); }
.um-item.off .ic { color: var(--muted); }
.um-item .um-state { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--accent2); }
.um-item.off .um-state { color: var(--muted); }
.um-item.off .um-label { color: var(--muted); }
.um-div { height: 1px; background: var(--border); margin: 6px 0; }
.um-item.um-danger { color: #f87171; }
.um-item.um-danger .ic { color: #f87171; }
.avatar-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #fff; font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
#user-email { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- auth ---- */
#auth-card {
  max-width: 420px; margin: 8vh auto; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px; text-align: center;
}
.auth-logo { width: 64px; height: 64px; margin-bottom: 12px; }
#auth-card h3 { font-size: 20px; }
#auth-card .tagline { color: var(--muted); font-size: 12.5px; margin: 6px 0 18px; }
.auth-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.auth-fields input { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; color: var(--text); font-size: 15px; outline: none; }
.auth-fields input:focus { border-color: var(--accent); }
.auth-actions { display: flex; gap: 10px; }
.auth-actions button { flex: 1; padding: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ---- terminal layout: app-shell — page never scrolls, one scroll area per panel ---- */
body:has(#app-body:not(.hidden)) { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.terminal {
  display: grid; grid-template-columns: 1fr 8px var(--side-w, 350px); gap: 6px;
  padding: 10px; flex: 1; min-height: 0; overflow: hidden;
}
.main-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
#chart-panel { background: var(--chart); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); overflow: hidden; flex: 1.25; min-height: 260px; }
#tv-chart { width: 100%; height: 100%; }
#bottom-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.side-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
#watchlists-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); padding: 12px; overflow-y: auto; flex: 0 1 auto; max-height: 42%; min-height: 0; }
#watchlists-panel.collapsed { flex: 0 0 auto !important; max-height: none !important; overflow: hidden; }

/* ---- draggable panel resizers (desktop) ---- */
.rz { flex: 0 0 auto; touch-action: none; user-select: none; display: flex; align-items: center; justify-content: center; position: relative; z-index: 5; }
.rz-h { cursor: row-resize; height: 8px; }
.rz-v { cursor: col-resize; width: 8px; }
.rz::after { content: ""; background: var(--border); border-radius: 3px; transition: background 0.12s, width 0.12s, height 0.12s; }
.rz-h::after { width: 44px; height: 3px; }
.rz-v::after { width: 3px; height: 44px; }
.rz:hover::after, .rz.dragging::after { background: var(--muted); }
.rz-h:hover::after, .rz-h.dragging::after { width: 64px; }
.rz-v:hover::after, .rz-v.dragging::after { height: 64px; }
@media (max-width: 1000px) { .rz { display: none; } }
#watchlists-panel.collapsed #watchlists-body,
#watchlists-panel.collapsed #wl-expand-btn { display: none; }
#watchlists-panel.collapsed .section-head { margin-bottom: 0; }
#wl-panel-head { cursor: pointer; gap: 7px; justify-content: flex-start; user-select: none; }
#wl-panel-head .wl-caret { transform: rotate(90deg); }
#watchlists-panel.collapsed #wl-panel-head .wl-caret { transform: none; }
#wl-panel-head #wl-expand-btn { margin-left: auto; }
/* sector intel strip (P5) — sits above the activity feed */
#sectors-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); padding: 10px 12px 7px; flex: 0 0 auto; }
#sectors-panel .section-head { margin-bottom: 8px; }
#sectors-panel .section-head .meta { color: var(--muted); font-size: 10.5px; }
.sector-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; } /* auto-drifts — no scrollbar needed */
.sector-strip::-webkit-scrollbar { display: none; }
/* minimal edge arrows for manual fast-scrub of the auto-drifting strip */
.strip-wrap { position: relative; }
.strip-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 22px; height: 44px; border: 0; padding: 0 0 3px; display: flex; align-items: center; justify-content: center; background: rgba(10, 14, 20, 0.72); color: var(--muted); font-size: 19px; line-height: 1; border-radius: 7px; cursor: pointer; opacity: 0.5; transition: opacity 0.15s, color 0.15s; user-select: none; }
.strip-arrow:hover { opacity: 1; color: var(--text); }
.strip-arrow.left { left: -4px; }
.strip-arrow.right { right: -4px; }
.strip-arrow.hidden { display: none; }
/* hover read-more popover for sector cards */
#sec-pop { position: fixed; z-index: 80; width: min(420px, calc(100vw - 32px)); background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); pointer-events: none; }
#sec-pop .sp-name { font-size: 12px; font-weight: 800; color: var(--accent2); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
#sec-pop .sp-name .sec-date { font-weight: 400; }
#sec-pop .sp-headline { font-size: 12.5px; font-weight: 700; line-height: 1.45; margin-bottom: 6px; }
#sec-pop .sp-body { font-size: 12px; color: var(--text); line-height: 1.55; max-height: 180px; overflow: hidden; }
#sec-pop .sp-hint { color: var(--muted); font-size: 10.5px; margin-top: 8px; }
.sec-card { flex: 0 0 auto; width: 200px; background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 8px 10px; cursor: pointer; transition: border-color 0.12s; }
.sec-card:hover { border-color: var(--accent); }
.sec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-date { color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.sec-headline { font-size: 11.5px; color: var(--text); line-height: 1.4; margin-top: 3px; min-height: 32px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sec-chips { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.sec-chip { font-size: 10px; font-weight: 700; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--accent2); background: var(--card); cursor: pointer; white-space: nowrap; }
.sec-chip:hover { border-color: var(--accent); }
.sec-more { font-size: 10px; color: var(--muted); padding: 1px 3px; }
.sec-card.sec-minor { opacity: 0.8; }
.sec-card.sec-minor .sec-headline { color: var(--muted); }
.sec-minor-tag { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.sec-card.sec-quiet { opacity: 0.55; }
.sec-card.sec-quiet .sec-headline { color: var(--muted); font-style: italic; min-height: 0; }
/* mobile Today — pinned Sector Intel carousel above the feed */
#today-sectors { margin-bottom: 10px; }
#today-sectors .ts-head { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 6px; }
#today-sectors .ts-head .ic { width: 14px; height: 14px; color: #2e9d9d; }
/* sector modal */
#sector-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; }
#sector-modal { width: min(560px, 100%); max-height: 76vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6); }
.sm-head { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.sm-head .ic { width: 17px; height: 17px; }
.sm-close { margin-left: auto; }
.sm-headline { font-size: 13.5px; font-weight: 700; color: var(--accent2); line-height: 1.45; margin-bottom: 8px; }
.sm-body { font-size: 13px; }
.sm-chips-label { color: var(--muted); font-size: 11px; margin: 12px 0 6px; }
.sm-chips .sec-chip { font-size: 12px; padding: 4px 10px; }
.sm-note { color: var(--muted); font-size: 12px; margin-bottom: 10px; line-height: 1.5; }
.sm-quiet-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.sm-quiet-row:last-child { border-bottom: none; }

/* activity feed — always visible, fills all remaining side-column height */
#feed-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); flex: 1; min-height: 130px; display: flex; flex-direction: column; overflow: hidden; }
#feed-panel .feed-host { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; }
.feed-host { background: var(--card); }
/* desktop: compact cards — timestamp in the top-right corner instead of its own line */
@media (min-width: 1001px) {
  #feed-panel .feed-card { position: relative; padding: 7px 12px; margin-bottom: 5px; }
  #feed-panel .feed-main { line-height: 1.4; }
  #feed-panel .feed-main > .meta { position: absolute; top: 7px; right: 28px; margin-top: 0; }
  #feed-panel .feed-head { padding-right: 62px; }
  #feed-panel .feed-day { margin: 4px 0 5px; }
  #feed-panel .feed-icon { width: 24px; height: 24px; }
}

/* tabs: tab row pinned, tab body is the panel's single scroller */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 6px 10px 0; flex-shrink: 0; }
.tab { background: none; color: var(--muted); border: none; padding: 8px 14px; font-size: 12.5px; font-weight: 600; border-radius: 8px 8px 0 0; }
.tab.active { color: var(--text); background: var(--card2); }
.tab-body { padding: 14px; overflow-y: auto; flex: 1; min-height: 0; }

/* progress */
/* parallel research: one card per running job */
.job-card { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.job-dismiss { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--muted, #888); font-size: 14px; cursor: pointer; padding: 4px 6px; }
.job-dismiss:hover { color: #fff; }
.job-card.clickable { cursor: pointer; }
.job-card.clickable:hover { border-color: var(--green); }
.job-card .job-title { font-size: 14px; margin-bottom: 10px; overflow-wrap: anywhere; }
.job-card .job-steps { list-style: none; }
.job-card .job-steps li { padding: 7px 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: flex-start; gap: 9px; }
.job-card .job-steps li.running { color: var(--text); }
.job-card .job-steps li.done { color: var(--green2); }
.job-card .job-steps li.error { color: var(--danger); }
.job-card .job-steps li .note { color: var(--muted); font-size: 12px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-top: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* brief */
.brief-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.brief-header h2 { font-size: 16px; overflow-wrap: anywhere; }
.markdown { line-height: 1.6; font-size: 13.8px; overflow-wrap: break-word; }
.markdown h1 { font-size: 17px; margin: 14px 0 6px; }
.markdown h2 { font-size: 15.5px; margin: 14px 0 6px; }
.markdown h3 { font-size: 14px; margin: 12px 0 6px; }
.markdown p { margin: 7px 0; }
.markdown ul, .markdown ol { margin: 7px 0 7px 20px; }
.markdown table { border-collapse: collapse; margin: 10px 0; font-size: 12px; display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.markdown th { background: var(--card2); white-space: nowrap; }
.markdown code { background: var(--card2); padding: 2px 5px; border-radius: 4px; font-size: 12.5px; overflow-wrap: anywhere; }
.markdown strong { color: #fff; }
.markdown hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.markdown a { color: var(--accent2); }

/* watchlists */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
/* type hierarchy: all panel titles = small caps labels, same voice as feed day headers */
.section-head h3 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 800; }
.wl-card { border: 1px solid var(--border); border-radius: var(--r-card); padding: 8px 10px; margin-bottom: 8px; background: var(--card2); transition: border-color 0.12s; }
.wl-card:hover { border-color: #31405e; }
.wl-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.wl-head h4 { font-size: 13px; }
.wl-head .meta { color: var(--muted); font-size: 11px; }
.wl-items { overflow: visible; } /* no nested scroll — the watchlists panel is the scroller */
/* accordion: collapsed by default, .open expands */
.wl-head { gap: 7px; justify-content: flex-start; }
.wl-head .meta { margin-left: auto; }
.wl-caret { color: var(--muted); font-size: 10px; transition: transform 0.15s; flex-shrink: 0; }
.wl-card.open .wl-caret { transform: rotate(90deg); }
.wl-card .wl-items, .wl-card .wl-add { display: none; }
.wl-card.open .wl-items { display: block; margin-top: 6px; }
.wl-card.open .wl-add { display: flex; }
.wl-item { display: flex; align-items: center; gap: 7px; padding: 7px 2px; border-top: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.wl-item:hover { background: rgba(41, 98, 255, 0.07); }
.wl-item strong { font-size: 13px; }
.wl-sector { color: var(--muted); font-size: 10.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-quote { margin-left: auto; display: flex; align-items: baseline; gap: 7px; font-variant-numeric: tabular-nums; }
.wl-price { font-size: 12px; color: var(--text); font-weight: 600; }
.wl-mcap { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.wl-chg { font-size: 11px; font-weight: 700; min-width: 44px; text-align: right; }
.wl-chg.up { color: var(--green2); }
.wl-chg.down { color: #e15c5c; }

/* ---- crypto instant stats block (top of ticker popup — TV-dark, tabular) ---- */
#coinstats { background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; margin-bottom: 10px; }
.cs-loading { color: var(--muted); font-size: 12px; }
.cs-head { font-size: 12px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cs-name { color: var(--muted); font-weight: 600; }
.cs-meta { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.cs-cell { background: var(--chart); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-k { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.cs-v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-v.good { color: var(--green2); }
.cs-v.bad { color: #e15c5c; }
.cs-badge { font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.cs-b-good { color: var(--green2); }
.cs-b-bad { color: #e15c5c; }
.cs-b-mid { color: var(--muted); }
.cs-note { font-size: 9px; color: var(--muted); line-height: 1.35; }
.cs-flags { margin-top: 8px; font-size: 11.5px; }
.cs-flags summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.cs-flag { display: grid; grid-template-columns: 74px 70px 70px 1fr; gap: 8px; padding: 4px 2px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cs-flag-src { color: var(--accent2); }
.cs-flag-out.cs-confirmed { color: var(--green2); }
.cs-flag-out.cs-failed { color: #e15c5c; }
.cs-flag-out.cs-candidate { color: #eab308; }
.cs-flag-out.cs-expired { color: var(--muted); }

/* sector-news sentiment tints (watchlists + sector cards) */
.senti-arrow { font-size: 9px; vertical-align: 1px; }
.senti-arrow.up { color: var(--green2); }
.senti-arrow.down { color: #e15c5c; }
/* heat tiers — hot rows glow red/orange, warm rows yellow (subtle, terminal-style) */
.wl-item.heat-hot { background: linear-gradient(90deg, rgba(255, 112, 60, 0.13), transparent 72%); box-shadow: inset 2px 0 0 rgba(255, 112, 60, 0.6); }
.wl-item.heat-hot:hover { background: linear-gradient(90deg, rgba(255, 112, 60, 0.2), rgba(255, 112, 60, 0.04) 72%); }
.wl-item.heat-warm { background: linear-gradient(90deg, rgba(232, 195, 80, 0.09), transparent 72%); box-shadow: inset 2px 0 0 rgba(232, 195, 80, 0.45); }
.wl-item.heat-warm:hover { background: linear-gradient(90deg, rgba(232, 195, 80, 0.15), rgba(232, 195, 80, 0.03) 72%); }
/* sector heat indicator on watchlist card names (lib/heat.js sector aggregation) */
.wl-secheat { display: inline-block; margin-left: 6px; vertical-align: middle; flex: none; }
.wl-secheat.hot { font-size: 10px; line-height: 1; filter: drop-shadow(0 0 3px rgba(255, 112, 60, 0.8)); }
.wl-secheat.warm { width: 7px; height: 7px; border-radius: 50%; background: #e8c350; box-shadow: 0 0 4px rgba(232, 195, 80, 0.5); }
.wl-secheat.neutral { width: 7px; height: 7px; border-radius: 50%; background: #3a4763; }
/* signal lifecycle badges (two-stage setup: 👀 candidate → ✅ confirmed / grayed failed) */
.wl-flame { font-size: 11px; line-height: 1; cursor: help; filter: drop-shadow(0 0 4px rgba(70, 220, 130, 0.75)); }
.wl-eye { font-size: 10px; line-height: 1; cursor: help; opacity: 0.6; }
.wl-item:hover .wl-eye { opacity: 0.9; }
.wl-suppress { font-size: 10px; line-height: 1; cursor: help; opacity: 0.85; }
/* failed-signal fade applies per-child so the researched dot stays visibly green */
.wl-item.wl-sig-failed > *:not(.dot) { opacity: 0.42; filter: grayscale(0.85); }
.wl-item.wl-sig-failed:hover > *:not(.dot) { opacity: 0.65; }
.wl-item.wl-sig-failed > .dot { opacity: 0.9; }
.wl-failed-x { font-size: 9px; line-height: 1; cursor: help; color: #8a8f98; }

.wl-card.senti-bull { border-left: 3px solid var(--green2); background: linear-gradient(90deg, rgba(8, 153, 129, 0.09), var(--card2) 55%); }
.wl-card.senti-bear { border-left: 3px solid #e15c5c; background: linear-gradient(90deg, rgba(225, 92, 92, 0.1), var(--card2) 55%); }
.sec-card.senti-bull { border-left: 3px solid var(--green2); background: linear-gradient(90deg, rgba(8, 153, 129, 0.09), var(--card2) 55%); }
.sec-card.senti-bear { border-left: 3px solid #e15c5c; background: linear-gradient(90deg, rgba(225, 92, 92, 0.1), var(--card2) 55%); }
.wl-del { padding: 2px 7px !important; font-size: 11px !important; color: var(--muted) !important; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.dot.has { background: var(--green); }
/* verdict-colored research dots — same palette as the brief verdict chip */
.dot.v-buy { background: var(--green); }
.dot.v-starter { background: #38bdf8; }
.dot.v-watch { background: #eab308; }
.dot.v-pass { background: #f87171; }
.dot.v-neutral { background: #94a3b8; }
.hist-item .dot, .tr-brief .dot { display: inline-block; vertical-align: 1px; }
.tr-brief .dot { margin-right: 5px; }
.wl-add { display: flex; gap: 6px; margin-top: 8px; }
.wl-add input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; color: var(--text); font-size: 12px; text-transform: uppercase; outline: none; }
.wl-add input:focus { border-color: var(--accent); }
.wl-add-btn { flex-shrink: 0; border-color: var(--accent); color: var(--accent2); font-weight: 700; }
.wl-type { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font-size: 11px; padding: 0 4px; }
.wl-none { color: var(--muted); font-size: 12px; font-style: italic; }

/* runs & memory expander (brief header) */
#ticker-research { background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.tr-briefs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.tr-brief { color: var(--accent2); font-size: 12.5px; text-decoration: none; padding: 4px 0; }
.tr-mem { margin-top: 12px; }
.tr-mem summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.tr-mem .markdown { font-size: 12px; margin-top: 8px; }
.tr-run { margin-top: 4px; }

/* history dropdown (brief header) */
.brief-header { position: relative; }
.brief-hbtns { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
#history-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  width: min(340px, calc(100vw - 40px)); max-height: 320px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}
#history-list { list-style: none; }
#history-list li { border-bottom: 1px solid var(--border); }
#history-list .hist-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12.5px; color: inherit; text-decoration: none; }
#history-list .hist-left { display: inline-flex; align-items: center; gap: 6px; }
#history-list .hist-item:hover { background: rgba(255, 255, 255, 0.04); }
#history-list .hist-date { color: var(--muted); font-size: 10.5px; }

/* ---- chat dock (desktop: right-side push drawer / mobile: agent tab) ---- */
#chat-dock {
  position: fixed; background: var(--card); z-index: 50;
  display: flex; flex-direction: column;
}
#chat-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border); flex-shrink: 0; }
#chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.chat-msg.user { background: var(--card2); align-self: flex-end; border: 1px solid var(--border); }
.chat-msg.agent { background: rgba(41, 98, 255, 0.09); border: 1px solid rgba(41, 98, 255, 0.3); align-self: flex-start; }
.chat-msg.agent .markdown, .chat-msg.agent p { font-size: 13px; }
#chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
#chat-input { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--text); font-size: 13px; outline: none; }
#chat-input:focus { border-color: var(--accent); }
.chat-header-btns { display: flex; gap: 6px; align-items: center; }

/* attachments */
#chat-attach-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 14px 0; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 11.5px; max-width: 200px; }
.att-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.att-chip .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip .att-x { cursor: pointer; color: var(--muted); font-weight: 800; padding: 0 2px; }
.att-chip .att-x:hover { color: var(--danger); }
.att-note { color: var(--danger); font-size: 11px; }
#chat-attach { flex-shrink: 0; padding: 9px 10px; }
.chat-msg .msg-atts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.chat-msg .msg-atts img { max-width: 150px; max-height: 150px; border-radius: 8px; border: 1px solid var(--border); display: block; }

/* full-screen agent mode (desktop) */
#chat-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); z-index: 49; }
#chat-dock.full {
  left: 50%; transform: translateX(-50%);
  width: min(1000px, calc(100vw - 48px)); max-width: none;
  top: 28px; bottom: 0;
}
#chat-dock.full #chat-header { cursor: default; padding: 14px 20px; font-size: 14px; }
#chat-dock.full #chat-toggle { display: none; }
#chat-dock.full #chat-messages { height: auto; flex: 1; padding: 14px 20px; gap: 10px; }
#chat-dock.full .chat-msg { max-width: 78%; font-size: 14px; }
#chat-dock.full .chat-msg.agent .markdown, #chat-dock.full .chat-msg.agent p { font-size: 14px; }
#chat-dock.full #chat-form { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
#chat-dock.full #chat-input { font-size: 14px; padding: 11px 14px; }

/* desktop drawer geometry + push behavior */
#chat-pill { display: none; }
@media (min-width: 1001px) {
  #chat-dock {
    top: var(--hdr-h, 53px); right: 0; bottom: 0; left: auto;
    width: 420px; max-width: none;
    border: none; border-left: 1px solid var(--border); border-radius: 0;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
    transform: translateX(0); transition: transform 0.22s ease;
  }
  #chat-dock.collapsed { transform: translateX(102%); box-shadow: none; }
  #chat-dock.full {
    right: auto; border: 1px solid var(--border); border-bottom: none;
    border-radius: 14px 14px 0 0; transition: none;
  }
  .terminal { transition: margin-right 0.22s ease; }
  body.chat-open .terminal { margin-right: 420px; }
  /* collapsed = slim floating pill bottom-right */
  #chat-pill:not(.hidden) {
    display: inline-flex; align-items: center; gap: 7px;
    position: fixed; right: 18px; bottom: 18px; z-index: 48;
    background: var(--card); color: var(--text); border: 1px solid var(--border);
    border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 700;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); cursor: pointer;
  }
  #chat-pill .ic { width: 16px; height: 16px; color: var(--accent2); }
  #chat-pill:hover { border-color: var(--accent); background: var(--card2); filter: none; }
  body.chat-open #chat-pill { display: none; }
}

footer { text-align: center; color: var(--muted); font-size: 10.5px; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); }

/* ---- verdict chip ---- */
#brief-verdict {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-card);
  border-left: 3px solid var(--border);
  padding: 11px 16px; margin-bottom: 12px;
}
#brief-verdict[data-kind="buy"] { border-left-color: #089981; background: linear-gradient(90deg, rgba(8, 153, 129, 0.08), var(--card2) 45%); }
#brief-verdict[data-kind="watch"] { border-left-color: #eab308; background: linear-gradient(90deg, rgba(234, 179, 8, 0.07), var(--card2) 45%); }
#brief-verdict[data-kind="pass"] { border-left-color: #e15c5c; background: linear-gradient(90deg, rgba(225, 92, 92, 0.07), var(--card2) 45%); }
.v-pill {
  padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 12.5px;
  letter-spacing: 0.6px; text-transform: uppercase; white-space: nowrap;
}
.v-buy { background: rgba(8, 153, 129, 0.16); color: #0aaf94; border: 1px solid #089981; }
.v-starter { background: rgba(56, 189, 248, 0.14); color: #38bdf8; border: 1px solid #2593c4; }
.v-watch { background: rgba(234, 179, 8, 0.14); color: #eab308; border: 1px solid #a3810a; }
.v-pass { background: rgba(225, 92, 92, 0.14); color: #f87171; border: 1px solid #b94848; }
.v-neutral { background: var(--card); color: var(--muted); border: 1px solid var(--border); }
/* compact variant for feed cards — reads at a glance next to the ticker */
.v-pill.sm { padding: 1px 8px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; vertical-align: 1px; margin-left: 5px; margin-right: 3px; }
.v-conviction { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 140px; }
.v-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---- brief section cards ---- */
.brief-card {
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin: 10px 0;
}
.brief-card > .bc-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--accent2); margin-bottom: 8px;
}
.brief-card .markdown h1, .brief-card .markdown h2 { font-size: 14px; margin: 8px 0 5px; }

/* ---- today feed ---- */
/* desktop: dilution watch as a full overlay under the top bar */
@media (min-width: 1001px) {
  body[data-mview="dilution"] #dilution-panel {
    display: flex; flex-direction: column;
    position: fixed; top: 52px; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--bg); border-top: 1px solid var(--border);
  }
  body[data-mview="dilution"] #dilution-body { flex: 1; min-height: 0; overflow-y: auto; max-width: 860px; width: 100%; margin: 0 auto; }
}

/* dilution watch panel (S-3 engine) — shown via body[data-mview="dilution"] */
#dilution-panel { display: none; }

/* ---- market dashboard (regime gauges) — shown via body[data-mview="market"] ---- */
#market-panel { display: none; }
#market-panel .section-head { flex-shrink: 0; }
#market-body { flex: 1; min-height: 0; }
#market-frame { width: 100%; height: 100%; border: 0; display: block; background: #0d1117; }
@media (min-width: 1001px) {
  body[data-mview="market"] #market-panel {
    display: flex; flex-direction: column;
    position: fixed; top: 52px; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--bg); border-top: 1px solid var(--border);
  }
}
.dil-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 12px 4px; font-weight: 700; }
.dil-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; min-height: 38px; }
.dil-row:hover { background: rgba(255,255,255,.035); }
.dil-tk { font-weight: 700; color: var(--accent2); min-width: 50px; }
.dil-co { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); min-width: 0; }
.dil-form { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(255,80,80,.13); color: #ff9a8a; white-space: nowrap; }
.dil-form.eff { background: rgba(80,255,140,.10); color: #7ee2a8; }
.dil-tag { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 6px; background: rgba(255,180,60,.12); color: #ffb44c; white-space: nowrap; }
.dil-tag.dim { background: rgba(160,170,180,.10); color: var(--muted); }
.dil-tag.dil-ins-buy { background: rgba(10,175,148,.16); color: var(--green2); }
.dil-tag.dil-primary { background: rgba(225,92,92,.14); color: #e15c5c; }
.dil-tag.dil-zstk { background: rgba(10,175,148,.14); color: var(--green2); }
.dil-pct { font-size: 12px; font-weight: 800; min-width: 40px; text-align: right; color: #ffb44c; white-space: nowrap; }
.dil-pct.zstk { color: var(--green2); }
.dil-pct.dim { color: var(--muted); font-weight: 600; }
.dil-row.dil-lf { background: rgba(10,175,148,.05); }
.dil-row.dil-lf:hover { background: rgba(10,175,148,.09); }
.dil-row.dil-stale { opacity: .55; }
.dil-row.dil-stale:hover { opacity: .8; }
.dil-shares { font-weight: 600; white-space: nowrap; }
.dil-days { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dil-note { color: var(--muted); font-size: 11px; padding: 0 12px 10px; }

#today-panel {
  display: none; /* mobile-only view; desktop uses Alerts tab */
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; grid-column: 1 / -1;
}
/* sticky date headers: pin under the (sticky) Signals/Scanner tab row while scrolling */
.feed-day {
  color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  margin: 8px 0 6px; padding: 3px 0;
  position: sticky; top: 33px; z-index: 1; background: var(--card);
}
.feed-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color 0.12s;
}
.feed-card:hover { border-color: #31405e; }
.feed-card:active { border-color: var(--accent); }
/* kind icon in a tinted chip — color-coded by stream (signals = kind color, scanner = amber) */
.feed-icon {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
}
.fi-price { background: rgba(8, 153, 129, 0.10); border-color: rgba(8, 153, 129, 0.30); }
.fi-filing { background: rgba(143, 168, 204, 0.10); border-color: rgba(143, 168, 204, 0.28); }
.fi-sector { background: rgba(46, 157, 157, 0.12); border-color: rgba(46, 157, 157, 0.32); }
.fi-brief { background: rgba(169, 154, 230, 0.10); border-color: rgba(169, 154, 230, 0.28); }
.fi-scan, .fi-level { background: rgba(216, 180, 90, 0.10); border-color: rgba(216, 180, 90, 0.28); }
/* tier badges: EARLY / CONFIRMED / IGNITION as colored pills (emoji-safe on every OS) */
.tier-pill {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  border-radius: 999px; padding: 1px 7px; margin: 0 5px 0 6px; vertical-align: 1px; white-space: nowrap;
}
.tier-early { background: rgba(234, 179, 8, 0.13); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.45); }
.tier-confirmed { background: rgba(249, 115, 22, 0.13); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.45); }
.tier-ignition { background: rgba(167, 139, 250, 0.13); color: #b4a3f0; border: 1px solid rgba(167, 139, 250, 0.45); }
.tier-grind { background: rgba(8, 153, 129, 0.13); color: var(--green2); border: 1px solid rgba(8, 153, 129, 0.45); }
/* empty states */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 16px; text-align: center; color: var(--muted);
}
.empty-state .ic { width: 26px; height: 26px; opacity: 0.45; }
.empty-state .es-title { font-size: 13px; font-weight: 700; color: var(--text); }
.empty-state .es-hint { font-size: 11.5px; line-height: 1.55; max-width: 270px; }

/* ---- custom SVG icon set ---- */
.ic { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; }
button .ic { vertical-align: -3px; margin-right: 2px; }
.feed-icon .ic { width: 15px; height: 15px; margin: 0; }
.pr-icon .ic { width: 15px; height: 15px; }
.tr-brief .ic { width: 13px; height: 13px; vertical-align: -2px; }
#chat-header .ic { width: 15px; height: 15px; color: var(--accent2); }
.toggle .ic { width: 15px; height: 15px; color: var(--muted); }
/* per-kind feed colors */
.ic-filing { color: #8fa8cc; }
.ic-price { color: var(--green); }
.ic-sector { color: #2e9d9d; }
.ic-scanner { color: #d8b45a; }
.ic-brief { color: #a99ae6; }
.ic-insider { color: #089981; }
.ic-level, .ic-undefined { color: #d8b45a; }
.feed-main { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.feed-main strong { font-size: 13.5px; }
.feed-main .meta { color: var(--muted); font-size: 10.5px; display: block; margin-top: 3px; }
#push-btn.on { border-color: var(--accent); color: var(--accent2); }

/* ---- level popover ---- */
#level-pop {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom));
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; max-width: min(420px, calc(100vw - 24px));
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); font-size: 13px; line-height: 1.5;
}
#level-pop .lp-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 4px; }
#level-pop .lp-dot { width: 10px; height: 10px; border-radius: 2px; }
#level-pop .lp-note { color: var(--muted); font-size: 12.5px; }
.lvl { cursor: pointer !important; }
.lvl:active, .lvl:hover { border-color: var(--accent); color: var(--text); }

/* ---- command palette ---- */
#palette-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
}
#palette {
  width: min(560px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; box-shadow: 0 16px 60px rgba(0,0,0,0.6);
}
#palette-input {
  width: 100%; background: var(--card2); border: none; border-bottom: 1px solid var(--border);
  padding: 15px 18px; color: var(--text); font-size: 16px; outline: none; text-transform: uppercase;
}
#palette-results { list-style: none; max-height: 46vh; overflow-y: auto; }
#palette-results li {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px; font-size: 13.5px;
  cursor: pointer; border-bottom: 1px solid rgba(35, 44, 61, 0.5);
}
#palette-results li.sel, #palette-results li:hover { background: var(--card2); }
#palette-results .pr-icon { font-size: 15px; width: 22px; text-align: center; }
#palette-results .pr-hint { margin-left: auto; color: var(--muted); font-size: 11px; }

/* ---- dilution ladder ---- */
#ladder-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; }
#ladder-btn.active { border-color: var(--accent) !important; color: var(--accent2) !important; }
.ladder-row { display: flex; align-items: center; gap: 12px; padding: 3px 0; }
.ladder-price { width: 76px; text-align: right; font-weight: 800; font-size: 13px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ladder-bar-wrap { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.ladder-bar { height: 22px; border-radius: 4px; min-width: 4px; opacity: 0.85; flex-shrink: 0; }
.ladder-label { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ladder-label .meta { color: var(--muted); font-size: 10.5px; }
.ladder-now { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.ladder-now .ladder-price { color: var(--green2); }
.ladder-now-line { flex: 1; border-top: 2px dashed var(--green); position: relative; }
.ladder-now-line span { position: absolute; top: -9px; left: 12px; background: var(--card); padding: 0 8px; color: var(--green2); font-size: 10.5px; font-weight: 800; }
.ladder-zone { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 800; margin: 12px 0 4px; }

/* ---- verdict re-check ---- */
.v-recheck { margin-left: auto; }
.v-stale { color: #eab308; font-size: 11px; white-space: nowrap; }

/* ---- mobile bottom nav ---- */
#mobile-nav { display: none; }

/* ---- mobile ---- */
@media (max-width: 1000px) {
  /* ---- app-shell: lock the page; each view gets exactly ONE scroll area ---- */
  body:has(#app-body:not(.hidden)) { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  .terminal {
    grid-template-columns: 1fr;
    display: flex; flex-direction: column;
    flex: 1; min-height: 0; overflow: hidden;
    padding-bottom: 0;
  }
  .main-col { flex: 1; min-height: 0; }
  /* lists view: the whole side column is the single scroller — panels inside don't scroll */
  .side-col { position: static; max-height: none; flex: 1; min-height: 0; overflow-y: auto; }
  #watchlists-panel, #feed-panel { flex: none !important; overflow: visible; min-height: 0; max-height: none !important; }
  #chart-panel { flex: 1 !important; }
  .wl-items { max-height: none; }
  #feed-panel .feed-host { overflow: visible; flex: none; }
  /* today view: the feed is the single scroller */
  /* today view: header (Today head + sector intel + early-watch rail + Signals/Scanner tabs)
     stays pinned — only the feed list below scrolls */
  /* display stays none here — only body[data-mview="today"] turns it on (flex) */
  #today-panel { flex: 1; min-height: 0; overflow: hidden; flex-direction: column; }
  #today-panel .section-head, #today-sectors, #today-feed-head { flex-shrink: 0; }
  #today-feed { flex: 1; min-height: 0; overflow-y: auto; }
  #today-feed .feed-day { top: 0; }
  /* research view: tabs pinned, tab body is the single scroller */
  #bottom-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  #bottom-panel .tabs { flex-shrink: 0; }
  #bottom-panel .tab-body { flex: 1; min-height: 0; overflow-y: auto; }
  #chart-panel { height: 44vh; min-height: 260px; flex-shrink: 0; }
  /* legend: single horizontally-scrollable row instead of a wrapping stack */
  #levels-legend {
    flex-wrap: nowrap; overflow-x: auto; max-height: none;
    justify-content: flex-start; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-basis: 100%;
  }
  #levels-legend::-webkit-scrollbar { display: none; }
  #levels-legend .lvl { flex-shrink: 0; padding: 3px 8px; font-size: 10.5px; }
  #watchlists-panel { max-height: none; flex: none; }
  /* mobile: sector intel lives in the Today carousel — hide the desktop strip in Lists view */
  #sectors-panel { display: none; }
  header { gap: 8px; padding: 8px 10px; position: sticky; top: 0; background: var(--bg); z-index: 40; }
  #research-form { max-width: none; order: 3; flex-basis: 100%; }
  #user-bar { margin-left: auto; }
  #user-menu { position: fixed; top: 52px; right: 8px; left: auto; }
  .tab-body { max-height: none; }
  footer { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* bottom nav */
  #mobile-nav:not(.hidden) {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  #mobile-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; color: var(--muted); font-size: 10.5px; font-weight: 600;
    padding: 4px 0; border-radius: 10px;
  }
  #mobile-nav button .mn-icon { line-height: 0; }
  #mobile-nav button .mn-icon .ic { width: 21px; height: 21px; }
  #mobile-nav button.active { color: var(--accent2); }

  /* view switching (only applies on mobile) */
  /* the ticker + Research bar belongs to the Research tab only — don't pin it in every view */
  body[data-mview]:not([data-mview="research"]) #research-form { display: none; }
  /* Research view: input bar docks at the bottom, just above the nav bar */
  body[data-mview="research"] #research-form {
    position: fixed; left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    z-index: 50; margin: 0; padding: 8px 10px;
    background: var(--card); border-top: 1px solid var(--border);
    flex-basis: auto; order: 0;
  }
  body[data-mview="research"] { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  body[data-mview="dilution"] #dilution-panel { display: flex; flex: 1; min-height: 0; overflow: hidden; flex-direction: column; }
  body[data-mview="dilution"] #dilution-panel .section-head { flex-shrink: 0; }
  body[data-mview="dilution"] #dilution-body { flex: 1; min-height: 0; overflow-y: auto; }
  body[data-mview="dilution"] #chart-panel,
  body[data-mview="dilution"] #bottom-panel,
  body[data-mview="dilution"] .main-col,
  body[data-mview="dilution"] .side-col { display: none; }
  body[data-mview="market"] #market-panel { display: flex; flex: 1; min-height: 0; overflow: hidden; flex-direction: column; }
  body[data-mview="market"] #chart-panel,
  body[data-mview="market"] #bottom-panel,
  body[data-mview="market"] .main-col,
  body[data-mview="market"] .side-col { display: none; }
  body[data-mview="today"] #today-panel { display: flex; }
  body[data-mview="today"] #chart-panel,
  body[data-mview="today"] #bottom-panel,
  body[data-mview="today"] .main-col,
  body[data-mview="today"] .side-col { display: none; }
  body[data-mview="lists"] .main-col { display: none; }
  body[data-mview="research"] #chart-panel,
  body[data-mview="research"] .side-col { display: none; }
  body[data-mview="chart"] #bottom-panel,
  body[data-mview="chart"] .side-col { display: none; }
  body[data-mview="chart"] #chart-panel { flex: 1; height: auto; min-height: 0; }
  body[data-mview="lists"] #chart-panel,
  body[data-mview="lists"] #bottom-panel { display: none; }
  /* Lists = watchlists only — the Signals/Scanner feed already lives in Today */
  body[data-mview="lists"] #feed-panel { display: none; }
  body[data-mview="agent"] .terminal { display: none; }

  /* chat: hidden unless agent view, then full-screen */
  body:not([data-mview="agent"]) #chat-dock { display: none; }
  body[data-mview="agent"] #chat-dock {
    position: fixed; left: 0; right: 0; width: auto; max-width: none;
    top: 0; bottom: calc(58px + env(safe-area-inset-bottom));
    border-radius: 0; border: none; z-index: 45;
    padding-top: env(safe-area-inset-top);
  }
  body[data-mview="agent"] #chat-messages { height: auto; flex: 1; }
  body[data-mview="agent"] #chat-toggle { display: none; }
  /* mobile agent view is already full-screen — no expand button, backdrop, or pill */
  #chat-expand, #chat-backdrop, #chat-pill { display: none !important; }
}

/* ---- chart bar + levels legend ---- */
#chart-panel { display: flex; flex-direction: column; }
#chart-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
#chart-symbol {
  font-weight: 800; font-size: 14px; width: 90px;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  color: inherit; font-family: inherit; padding: 2px 6px;
}
#chart-symbol:hover { border-color: var(--border); }
#chart-symbol:focus { border-color: var(--accent); outline: none; background: rgba(255, 255, 255, 0.04); }
.chart-modes { display: flex; gap: 4px; }
.chart-mode.active { border-color: var(--accent) !important; color: var(--accent2) !important; }
#tv-chart { flex: 1; min-height: 0; }
#levels-legend { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: flex-end; max-height: 44px; overflow-y: auto; }
.lvl { font-size: 10px; color: var(--muted); border-left: 3px solid; padding: 1px 6px; background: var(--card2); border-radius: 3px; white-space: nowrap; cursor: default; }
.lvl-more { border-left-color: var(--muted); cursor: pointer !important; font-weight: 700; }
.lvl-more:hover { color: var(--text); }
.chart-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }

/* ---- unified feed: Signals / Scanner tabs + collapsed cards ---- */
.feed-host { position: relative; }
.feed-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 0; padding-bottom: 8px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.feed-tab {
  background: var(--card2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.feed-tab.active { color: var(--text, #e8eef7); border-color: var(--accent); }
.feed-badge { background: var(--accent); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 10.5px; font-weight: 800; }
.feed-badge.dim { background: var(--card); color: var(--muted); border: 1px solid var(--border); }
.feed-gear { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 13px; }
.feed-gear:hover { color: var(--text, #e8eef7); border-color: var(--accent); }
.feed-main { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; }
.feed-head { display: block; overflow: hidden; }
.feed-card:not(.open) .feed-head { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-tkr { cursor: pointer; }
.feed-tkr:hover { color: var(--accent2); text-decoration: underline; }
.feed-count { background: var(--card); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 0 5px; font-size: 10px; font-weight: 700; margin: 0 4px; white-space: nowrap; }
.feed-chev { color: var(--muted); font-size: 11px; margin-top: 2px; }
.feed-card.open { border-color: var(--accent); }
.feed-detail { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 12.5px; }
.feed-detail .markdown p { margin: 0 0 6px; }
.feed-update { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.feed-update:last-child { border-bottom: none; }
.feed-update > .meta { font-size: 10.5px; color: var(--muted); }
/* scanner prefs popover */
.scan-pop {
  position: absolute; top: 34px; right: 0; z-index: 30; width: 250px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.sp-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; }
.sp-row label { font-size: 11px; color: var(--muted); font-weight: 700; }
.sp-row select, .sp-row input {
  background: var(--card2); border: 1px solid var(--border); color: inherit;
  border-radius: 7px; padding: 6px 8px; font-size: 12.5px;
}
.sp-note { font-size: 10.5px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.sp-save { width: 100%; }

/* ============ GROUP CHANNELS ============ */
/* desktop entry point: header "Rooms" button next to the avatar */
#ch-header-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 10px; padding: 7px 13px;
}
#ch-header-btn .ic { width: 14px; height: 14px; color: var(--accent2); }
#ch-header-btn:hover { border-color: var(--accent); }
#ch-hdr-badge, #mn-ch-badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 800; padding: 1px 6px; min-width: 17px; text-align: center;
}
#mn-ch-badge { position: absolute; top: 3px; right: 50%; margin-right: -22px; }
#mobile-nav button { position: relative; }

#ch-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 7, 12, 0.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 3vh 2vw;
}
#ch-modal {
  display: flex; width: min(1100px, 100%); height: min(760px, 94vh);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--shadow-pop);
}
#ch-sidebar {
  width: 230px; flex: none; border-right: 1px solid var(--border);
  background: #10141e; display: flex; flex-direction: column;
}
.ch-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
#ch-list { flex: 1; overflow-y: auto; padding: 8px; }
.ch-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; color: var(--muted);
  padding: 9px 10px; border-radius: 6px;
  font-size: 13.5px; cursor: pointer; text-align: left;
}
.ch-item:hover { background: var(--card2); color: var(--text); }
.ch-item.active { background: var(--card2); color: var(--text); font-weight: 600; }
.ch-hash { color: #4a5a72; }
.ch-hash-chip {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(41, 98, 255, 0.12); border: 1px solid rgba(41, 98, 255, 0.3);
  color: var(--accent2); font-weight: 800; font-size: 14px;
}
.ch-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ch-item .ch-name { color: var(--text); font-weight: 600; }
.ch-item-meta { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-unread {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 800; padding: 1px 6px;
}
#ch-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#ch-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
#ch-back { display: none; }
.ch-title-wrap { flex: 1; min-width: 0; }
#ch-title { font-size: 15px; font-weight: 700; }
#ch-sub { font-size: 11.5px; margin-top: 1px; }
#ch-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 13px; }
.ch-msg { max-width: 82%; }
.ch-msg.in { animation: chIn 0.18s ease-out; }
@keyframes chIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.ch-msg.mine { align-self: flex-end; }
.ch-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.ch-who { font-size: 12px; font-weight: 700; color: #8fb7d6; display: inline-flex; align-items: center; gap: 4px; }
.ch-who.agent { color: var(--accent2); }
.ch-who .ic { width: 12px; height: 12px; }
.ch-time { font-size: 10.5px; color: var(--muted); }
.ch-body {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 9px 12px;
  font-size: 13.5px; line-height: 1.5; word-wrap: break-word;
}
.ch-msg.mine .ch-body { background: #17304a; border-color: #23507a; }
.ch-msg.agent .ch-body { background: #131c30; border-color: #28407a; }
.ch-mention { color: var(--accent2); font-weight: 700; }
.ch-sys {
  text-align: center; font-size: 12px; color: var(--muted);
  padding: 3px 0; font-style: italic;
}
.ch-sys p { margin: 0; }
.ch-msg.ch-working .ch-sys { opacity: 0.75; animation: chPulse 1.3s ease-in-out infinite; }
@keyframes chPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 0.9; } }
.ch-brief-card {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 7px;
  background: var(--card2); border: 1px solid var(--accent); color: var(--text);
  border-radius: var(--r-ctl); padding: 7px 12px; font-size: 12.5px;
  font-weight: 600; cursor: pointer;
}
.ch-brief-card:hover { background: #16233f; }
.ch-brief-card .ic { width: 14px; height: 14px; }
/* header member avatars + settings panel */
#ch-avatars { display: flex; align-items: center; cursor: pointer; }
.ch-av {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(41, 98, 255, 0.18); border: 1px solid rgba(41, 98, 255, 0.4);
  color: var(--accent2); font-size: 10.5px; font-weight: 800;
}
#ch-avatars .ch-av { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
#ch-avatars .ch-av:first-child { margin-left: 0; }
.ch-av-more { background: var(--card2); border-color: var(--border); color: var(--muted); }
.ch-meta .ch-av { width: 18px; height: 18px; font-size: 9px; }
#ch-settings {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 6;
  width: min(320px, 100%); background: var(--card);
  border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
}
#ch-main { position: relative; }
.chs-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; }
.chs-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.chs-member { display: flex; align-items: center; gap: 9px; padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.chs-member:last-child { border-bottom: 0; }
.chs-mname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chs-role { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent2); border: 1px solid rgba(41, 98, 255, 0.4); border-radius: 999px; padding: 1px 7px; }
.chs-remove { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 6px; }
.chs-remove:hover { color: var(--danger); }
#chs-invite-form { display: flex; gap: 6px; }
#chs-email { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-ctl); color: var(--text); padding: 8px 10px; font-size: 12.5px; }
#chs-email:focus { outline: none; border-color: var(--accent); }
.chs-hint { font-size: 10.5px; color: var(--muted); }
#chs-leave { color: #f87171 !important; border-color: rgba(242, 54, 69, 0.4) !important; margin-top: auto; }

/* voice mic button */
#ch-mic { min-width: 40px; }
#ch-mic.rec { color: #f23645 !important; border-color: rgba(242, 54, 69, 0.55) !important; animation: micPulse 1.4s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 54, 69, 0.35); } 50% { box-shadow: 0 0 0 5px rgba(242, 54, 69, 0); } }

/* agent typing indicator — animated dots */
.ch-typing-row { display: flex; align-items: center; gap: 12px; }
.ch-stop-btn { background: none; border: 1px solid var(--muted); color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: 11px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.ch-stop-btn:hover { color: #ff6b6b; border-color: #ff6b6b; }
.ch-stop-btn:disabled { opacity: 0.5; cursor: default; }
.ch-typing { display: inline-flex; gap: 4px; padding: 8px 2px 2px; }
.ch-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chTyping 1.2s ease-in-out infinite; }
.ch-typing span:nth-child(2) { animation-delay: 0.15s; }
.ch-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chTyping { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
#chs-rename-form { display: flex; gap: 6px; }
#chs-rename { flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-ctl); color: var(--text); padding: 8px 10px; font-size: 12.5px; }
#chs-rename:focus { outline: none; border-color: var(--accent); }
#chs-delete { color: #f87171 !important; border-color: rgba(242, 54, 69, 0.4) !important; margin-top: 6px; }

#ch-form { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); }
#ch-input {
  flex: 1; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--r-ctl); color: var(--text); padding: 10px 13px; font-size: 13.5px;
}
#ch-input:focus { outline: none; border-color: var(--accent); }
.ch-msg .markdown p { margin: 0 0 6px; }
.ch-msg .markdown p:last-child { margin-bottom: 0; }

@media (max-width: 1000px) {
  /* Rooms is a first-class mobile view — it must NOT cover the bottom nav.
     Overlay stops above the nav (58px + safe area) and sits BELOW it in z
     (nav = 60) so every tab stays tappable. */
  #ch-overlay { padding: 0; top: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 45; background: var(--bg); backdrop-filter: none; align-items: stretch; }
  #ch-modal { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); box-shadow: none; }
  #ch-sidebar { width: 100%; background: var(--bg); }
  #ch-modal.show-main #ch-sidebar { display: none; }
  #ch-modal:not(.show-main) #ch-main { display: none; }
  #ch-back { display: inline-flex; }
  #ch-header-btn { display: none; } /* mobile uses the Rooms nav tab */
  #ch-close { display: none; } /* nav handles exit on mobile */
  #ch-messages { padding: 12px; }
  .ch-msg { max-width: 92%; }
  #ch-form { padding-bottom: 11px; }
  #ch-settings { width: 100%; }
}

/* ============ TradingView-style scrollbars ============ */
/* thin, gray, transparent track, thumb only appears while hovering the pane */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: rgba(148, 158, 178, 0.35) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
*:hover::-webkit-scrollbar-thumb { background: rgba(148, 158, 178, 0.3); }
*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active { background: rgba(148, 158, 178, 0.55); }
*::-webkit-scrollbar-corner { background: transparent; }

/* watchlist market tabs (Stocks | Crypto) */
.wl-market-tabs { display: flex; gap: 4px; padding: 4px 6px 8px; }
.wl-mtab {
  flex: 1; background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--r-ctl); padding: 6px 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.wl-mtab:hover { color: var(--text); }
.wl-mtab.active { background: var(--card2); color: var(--text); border-color: var(--accent); }
.wl-mtab .meta { font-size: 10.5px; }

/* fix: alerts feed content bleeding above/behind the sticky Signals/Scanner bar —
   kill the scroll-container top padding and let the tab bar own it edge-to-edge */
#feed-panel .feed-host { padding-top: 0; }
#feed-panel .feed-tabs {
  margin: 0 -12px 0; padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}
#feed-panel .feed-day { top: 46px; }

/* watchlist legend */
.wl-legend-row { padding: 0 6px 6px; }
.wl-legend-btn { background: none; border: 0; color: var(--muted); font-size: 10.5px; cursor: pointer; padding: 0 2px; }
.wl-legend-btn:hover { color: var(--text); }
.wl-legend { font-size: 11px; color: var(--muted); line-height: 1.7; padding: 7px 9px; background: var(--card2); border: 1px solid var(--border); border-radius: var(--r-ctl); margin-top: 4px; }
.wl-legend .dot { display: inline-block; vertical-align: middle; }
.lg-hot, .lg-warm { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.lg-hot { background: rgba(248, 113, 113, 0.45); }
.lg-warm { background: rgba(234, 179, 8, 0.4); }

/* filing/alert sentiment tints in the Signals feed (green good / red bad / neutral untinted) */
.feed-card.feed-bull { border-left: 3px solid rgba(8, 153, 129, 0.75); background: rgba(8, 153, 129, 0.07); }
.feed-card.feed-bear { border-left: 3px solid rgba(248, 113, 113, 0.7); background: rgba(248, 113, 113, 0.06); }

/* TV-style symbol search dropdown */
#chart-bar { position: relative; }
#sym-dd { position: absolute; top: 100%; left: 0; z-index: 60; min-width: 300px; max-height: 300px; overflow-y: auto; background: #131722; border: 1px solid #2a2e39; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
#sym-dd.hidden { display: none; }
.sym-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 12px; }
.sym-row:hover, .sym-row.hl { background: #1e222d; }
.sym-row.hl { box-shadow: inset 2px 0 0 #d4a017; }
.sym-row b { min-width: 56px; }
.sym-name { color: var(--muted, #787b86); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sym-tag { font-size: 10px; color: #787b86; white-space: nowrap; }
.sym-tag.crypto { color: #d4a017; }
.sym-none { padding: 10px 12px; font-size: 12px; color: var(--muted, #787b86); }

/* crypto/stock toggle on the chart symbol input — same active treatment as chart-mode buttons */
#sym-class { display: inline-flex; gap: 4px; }
#sym-input-wrap { position: relative; display: inline-flex; align-items: center; }
#sym-input-wrap #chart-symbol { padding-right: 24px; }
#sym-arrow { position: absolute; right: 5px; border: none; background: transparent; color: #787b86; cursor: pointer; font-size: 10px; padding: 3px 4px; line-height: 1; transition: transform 0.15s ease, color 0.15s ease; }
#sym-arrow:hover { color: #d1d4dc; }
#sym-arrow.open { transform: rotate(180deg); color: #d1d4dc; }
.sym-cls { padding: 5px 7px; }
.sym-cls.active { border-color: var(--accent) !important; color: var(--accent2) !important; }
.sym-cls.active[data-cls="crypto"] { border-color: #d4a017 !important; color: #d4a017 !important; }
/* header Run Research button */
#run-btn.run-accent { border-color: var(--accent); color: var(--accent); font-weight: 700; }
#run-btn.run-accent:hover:not(:disabled) { background: var(--accent); color: #0b0e14; }
#run-btn:disabled { opacity: 0.6; cursor: default; }
#run-btn .spinner { width: 10px; height: 10px; display: inline-block; vertical-align: -1px; }
.dil-ovh { font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; margin-left: 6px; }

/* ---- mobile overflow fixes (10/10/26) ----
   .dil-row packed 8+ nowrap chips in one flex line — ran to ~700px on a 390px
   phone (measured). Now wraps: ticker+pct+company on line 1, chips flow after.
   .section-head buttons (Supply / Expand all / + List) wrapped past the edge. */
@media (max-width: 1000px) {
  .dil-row { flex-wrap: wrap; row-gap: 5px; }
  .dil-co {
    flex-basis: calc(100% - 128px);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
  }
  .dil-days { margin-left: auto; }
}
/* section heads wrap at ANY width when buttons don't fit (watchlists head
   overflowed the desktop sidebar too — Supply/Expand all/+ List, 10/10) */
.section-head { flex-wrap: wrap; gap: 6px 8px; }

/* supply refresh button — spin while loading (was: zero feedback, felt dead) */
#dilution-refresh.spinning { animation: sa-spin 0.9s linear infinite; }
#dilution-refresh:disabled { opacity: .55; cursor: default; }
@keyframes sa-spin { to { transform: rotate(360deg); } }
