/* ============================================================== *
 *  XISOB Terminal — Clean Green/White/Blue professional theme
 *  XISOB = Uzbek for "accounting/calculation/data"
 * ============================================================== */

:root {
  --bg:        #0a0a0a;
  --bg-1:      #0f1010;
  --bg-2:      #141615;
  --bg-3:      #1c1e1d;
  --line:      #1f2220;
  --line-2:    #2a2e2b;
  --text:      #e6e6e0;
  --text-2:    #a8aaa4;
  --dim:       #6e716c;
  --accent:    #00c896;
  --accent-dim:#009a75;
  --accent-2:  #e6e6e0;
  --up:        #00d68a;
  --up-bg:     rgba(0, 214, 138, 0.12);
  --down:      #ff4f6b;
  --down-bg:   rgba(255, 79, 107, 0.12);
  --flat:      #888;
  --bond:      #8888cc;
  --info:      #5cc0ff;
  --warn:      #ffb74e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  min-height: 100vh;
  overflow-x: hidden;
}
body { background: radial-gradient(ellipse at top, #161818 0%, var(--bg) 60%); }

.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.dim   { color: var(--dim); }
.muted { color: var(--text-2); }
.up    { color: var(--up); }
.down  { color: var(--down); }
a      { color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
kbd {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-2);
}
code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--accent-2);
}

/* ====== TOP BAR ====== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #161816 0%, #0c0d0c 100%);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800; font-size: 13px;
  background: var(--accent); color: #000;
  padding: 6px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  box-shadow: 0 0 12px rgba(255, 176, 0, 0.3);
}
.title h1 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }
.title h1 .dim { color: var(--dim); font-weight: 400; }
.title .subtitle { font-size: 13px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }

/* AI Assistant banner */
.ai-banner { flex: 1; display: flex; align-items: center; min-width: 0; }
.ai-banner-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(0,200,150,0.12) 0%, rgba(0,180,255,0.08) 100%);
  border: 1px solid rgba(0,200,150,0.35);
  border-radius: 6px;
  padding: 5px 14px 5px 10px;
  transition: all 0.2s;
}
.ai-banner-link:hover {
  background: linear-gradient(135deg, rgba(0,200,150,0.20) 0%, rgba(0,180,255,0.14) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,200,150,0.15);
}
.ai-badge {
  font-size: 16px; line-height: 1;
}
.ai-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  white-space: nowrap;
}
.ai-arrow {
  font-size: 14px; color: var(--accent);
  opacity: 0.7;
}
.ticker {
  white-space: nowrap; overflow: hidden;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--text-2);
  flex: 1; min-width: 0;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker .item { display: inline-block; margin-right: 28px; }
.ticker .item.pos { color: var(--up); }
.ticker .item.neg { color: var(--down); }
.ticker-empty { color: var(--dim); font-style: italic; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-select {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  background: var(--bg-3); color: var(--accent);
  border: 1px solid var(--line-2);
  padding: 5px 7px; border-radius: 3px;
  cursor: pointer;
}
.lang-select:focus { outline: none; border-color: var(--accent); }
.cmd-btn {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  background: var(--bg-3); color: var(--accent);
  border: 1px solid var(--line-2);
  padding: 5px 10px; border-radius: 3px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.12s;
}
.cmd-btn:hover { background: var(--accent); color: #000; }
.cmd-btn span {
  background: var(--bg); padding: 1px 4px; border-radius: 2px;
  font-size: 13px; color: var(--accent);
  border: 1px solid var(--line-2);
}
.cmd-btn:hover span { background: rgba(0,0,0,0.15); color: #000; border-color: rgba(0,0,0,0.3); }

.status { display: flex; align-items: center; gap: 8px; }
.market-session { color: var(--dim); font-size: 13px; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  padding: 4px 8px; border-radius: 999px;
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dim);
}
.pill.live   .dot { background: var(--up); animation: pulse 1.6s ease-out infinite; }
.pill.stale  .dot { background: var(--warn); }
.pill.error  .dot { background: var(--down); }
.pill.live  { color: var(--up); }
.pill.stale { color: var(--warn); }
.pill.error { color: var(--down); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 214, 138, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(0, 214, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 214, 138, 0); }
}
.clock { font-size: 13px; color: var(--text); min-width: 70px; text-align: right; }

/* ====== STRIP ====== */
.strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr 2fr;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.strip-cell {
  padding: 3px 10px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.strip-cell:last-child { border-right: none; }
.strip-cell .lbl {
  font-size: 9px; color: var(--dim);
  letter-spacing: 0.05em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.strip-cell .val { font-size: 13px; font-weight: 600; color: var(--text); }
.strip-cell .delta { font-size: 10px; font-weight: 500; }
.strip-cell.movers { flex-direction: row; align-items: center; gap: 10px; }
.strip-cell.movers span { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.strip-cell.fx { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 8px; font-size: 11px; }
.strip-cell.fx .lbl { width: auto; }
.strip-cell.fx .up, .strip-cell.fx .down { font-size: 10px; }

/* subtle data attribution */
.attribution {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--dim);
  opacity: 0.5;
  padding: 2px 12px 0 0;
  letter-spacing: 0.05em;
}

/* ====== GRID ====== */
.grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  grid-template-rows: 1fr;
  gap: 1px;
  background: var(--line);
  height: calc(100vh - 95px - 30px);
}
.panel {
  background: var(--bg-1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tape-panel    { grid-row: 1; grid-column: 1; }
.right-col     { grid-row: 1; grid-column: 2; overflow-y: auto; overflow-x: hidden; background: var(--bg-1); }
.watchlist-panel { max-height: none; flex-shrink: 0; }
.news-panel    { flex: 1; min-height: 0; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.panel-head h2 {
  margin: 0;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.panel-head .hint { color: var(--dim); font-weight: 400; font-size: 13px; margin-left: 6px; }
.panel-tools { display: flex; gap: 6px; align-items: center; }
.panel-tools input, .panel-tools select {
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 4px 8px; border-radius: 3px;
  font: inherit; font-size: 13px;
  outline: none;
}
.panel-tools input:focus, .panel-tools select:focus { border-color: var(--accent); }
.panel-tools input { width: 180px; }

.filter-group { display: flex; gap: 2px; }
.chip {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  padding: 3px 8px; border-radius: 3px;
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: 'JetBrains Mono', monospace;
}
.chip:hover  { color: var(--text); border-color: var(--text-2); }
.chip.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }

/* ====== TABLE ====== */
.table-wrap { flex: 1; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  user-select: none;
  z-index: 1;
}
thead th.num   { text-align: right; }
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--accent); }
thead th .arr  { display: inline-block; width: 8px; opacity: 0.4; margin-left: 3px; }
thead th.sort-asc  .arr::after { content: '▲'; opacity: 1; color: var(--accent); }
thead th.sort-desc .arr::after { content: '▼'; opacity: 1; color: var(--accent); }
tbody tr {
  border-bottom: 1px solid rgba(31, 34, 32, 0.5);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover  { background: rgba(255, 176, 0, 0.04); }
tbody tr.selected { background: rgba(255, 176, 0, 0.10) !important; }
tbody tr.watch    { background: rgba(179, 136, 255, 0.05); }
tbody tr.flash-up   { animation: flashUp 1.2s ease-out; }
tbody tr.flash-up td.col-last { animation: flashPriceUp 1.2s ease-out; }
tbody tr.flash-down { animation: flashDown 1.2s ease-out; }
tbody tr.flash-down td.col-last { animation: flashPriceDown 1.2s ease-out; }
tbody tr.empty td { text-align: center; padding: 40px; color: var(--dim); }
@keyframes flashUp   { 0% { background: rgba(0,214,138,0.25); } 100% { background: transparent; } }
@keyframes flashPriceUp { 0% { color: #00ffa3; font-weight: 700; } 50% { color: #00d68a; } 100% { color: inherit; font-weight: inherit; } }
@keyframes flashDown { 0% { background: rgba(255,79,107,0.25); } 100% { background: transparent; } }
@keyframes flashPriceDown { 0% { color: #ff6b7f; font-weight: 700; } 50% { color: #ff4f6b; } 100% { color: inherit; font-weight: inherit; } }

tbody td {
  padding: 5px 8px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
tbody td.num { text-align: right; }
tbody td.col-ticker { color: var(--accent); font-weight: 600; }
tbody td.col-ticker .tag-bond,
tbody td.col-ticker .tag-flat {
  display: inline-block; margin-left: 4px;
  font-size: 13px; padding: 1px 3px; border-radius: 2px;
  font-weight: 600; letter-spacing: 0.05em;
  vertical-align: middle;
}
tbody td.col-ticker .tag-bond { background: rgba(179, 136, 255, 0.15); color: var(--bond); }
tbody td.col-ticker .tag-flat { background: rgba(255, 183, 78, 0.12); color: var(--warn); }
tbody td.col-name { color: var(--text-2); font-family: 'Inter', sans-serif; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
tbody td.col-name .isin { color: var(--dim); font-size: 13px; font-family: 'JetBrains Mono', monospace; margin-left: 6px; }
tbody tr.row-up   td.col-change, tbody tr.row-up   td.col-pct { color: var(--up); }
tbody tr.row-down td.col-change, tbody tr.row-down td.col-pct { color: var(--down); }
tbody tr.row-flat td.col-change, tbody tr.row-flat td.col-pct { color: var(--dim); }

/* ====== WATCHLIST ====== */
.watchlist { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px 0; }
.watchlist .item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 32px;
  transition: background 0.1s;
}
.watchlist .item:hover { background: rgba(255, 176, 0, 0.06); }
.watchlist .item .ticker { color: var(--accent); font-weight: 600; }
.watchlist .item .price  { color: var(--text); }
.watchlist .item .pct    { min-width: 60px; text-align: right; }
.watchlist .item .pct.up { color: var(--up); }
.watchlist .item .pct.down { color: var(--down); }
.watchlist .item .remove {
  color: var(--dim); cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 4px; border-radius: 2px;
}
.watchlist .item .remove:hover { color: var(--down); }
.watchlist .item .star-on  { color: var(--accent); }
.watchlist .item .star-off { color: var(--dim); }
.watchlist .star {
  font-size: 14px; line-height: 1;
  margin-right: 6px;
  cursor: pointer;
  user-select: none;
}

/* ====== WATCHLIST v2 (new module) ====== */
.wl-header { display:flex; justify-content:space-between; align-items:center; padding:6px 4px 2px; }
.wl-title { font-size:11px; font-weight:700; color:var(--accent); font-family:'JetBrains Mono',monospace; }
.wl-count { font-size:9px; color:var(--dim); font-family:'JetBrains Mono',monospace; }
.wl-add-row { display:flex; gap:4px; padding:4px; }
.wl-input { flex:1; background:var(--bg-3); border:1px solid var(--line); color:var(--text); padding:4px 8px; border-radius:2px; font-size:11px; font-family:'JetBrains Mono',monospace; text-transform:uppercase; }
.wl-input:focus { border-color:var(--accent); outline:none; }
.wl-btn-add { background:var(--accent); color:var(--bg); border:none; width:26px; height:26px; border-radius:2px; cursor:pointer; font-size:16px; font-weight:700; line-height:1; }
.wl-btn-add:hover { background:var(--accent-hover); }
.wl-empty { padding:16px; color:var(--dim); text-align:center; font-size:11px; }
.wl-list { display:flex; flex-direction:column; }
.wl-row { display:grid; grid-template-columns:1fr auto auto 20px; gap:8px; padding:5px 4px; border-bottom:1px solid var(--line); align-items:center; font-family:'JetBrains Mono',monospace; font-size:11px; transition:background 0.1s; }
.wl-row:hover { background:rgba(255,176,0,0.04); }
.wl-row-up { border-left:2px solid var(--up); }
.wl-row-down { border-left:2px solid var(--down); }
.wl-ticker { color:var(--accent); font-weight:700; cursor:pointer; }
.wl-ticker:hover { text-decoration:underline; }
.wl-price { color:var(--text); text-align:right; }
.wl-change { text-align:right; font-weight:600; }
.wl-change.up { color:var(--up); }
.wl-change.down { color:var(--down); }
.wl-change.dim { color:var(--dim); }
.wl-btn-rm { background:none; border:none; color:var(--dim); cursor:pointer; font-size:13px; padding:0 2px; }
.wl-btn-rm:hover { color:var(--down); }

/* ====== MARKET HEATMAP ====== */
.hm-header { display:flex; justify-content:space-between; align-items:center; padding:4px 6px; flex-wrap:wrap; gap:4px; }
.hm-title { font-size:11px; font-weight:700; color:var(--accent); font-family:'JetBrains Mono',monospace; }
.hm-count { font-size:9px; color:var(--dim); font-family:'JetBrains Mono',monospace; }
.hm-legend { display:flex; gap:8px; align-items:center; font-size:8px; color:var(--dim); }
.hm-legend-item { display:flex; align-items:center; gap:3px; }
.hm-dot { display:inline-block; width:8px; height:8px; border-radius:2px; }
.hm-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(80px, 1fr)); gap:2px; padding:4px; }
.hm-empty { padding:16px; color:var(--dim); text-align:center; grid-column:1/-1; font-size:11px; }
.hm-cell { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:6px 4px; border-radius:2px; cursor:pointer; transition:transform 0.1s, box-shadow 0.1s; font-family:'JetBrains Mono',monospace; min-height:40px; }
.hm-cell:hover { transform:scale(1.05); box-shadow:0 0 8px rgba(0,0,0,0.5); z-index:1; }
.hm-ticker { font-size:10px; font-weight:700; letter-spacing:0.05em; }
.hm-change { font-size:8px; opacity:0.9; }

/* ====== PRICE ALERTS ====== */
.alert-form { padding:4px; border-bottom:1px solid var(--line); }
.alert-form-title { font-size:10px; color:var(--accent); font-weight:700; margin-bottom:4px; font-family:'JetBrains Mono',monospace; }
.alert-inputs { display:flex; gap:4px; flex-wrap:wrap; }
.alert-input { flex:1; min-width:60px; background:var(--bg-3); border:1px solid var(--line); color:var(--text); padding:4px 6px; border-radius:2px; font-size:10px; font-family:'JetBrains Mono',monospace; }
.alert-input:focus { border-color:var(--accent); outline:none; }
.alert-select { background:var(--bg-3); border:1px solid var(--line); color:var(--text); padding:4px 6px; border-radius:2px; font-size:10px; font-family:'JetBrains Mono',monospace; }
.alert-btn-add { background:var(--accent); color:var(--bg); border:none; padding:4px 10px; border-radius:2px; cursor:pointer; font-size:10px; font-weight:700; white-space:nowrap; }
.alert-btn-add:hover { background:var(--accent-hover); }
.alert-section { padding:2px 0; }
.alert-section-title { font-size:10px; color:var(--accent); font-weight:700; padding:4px 4px 2px; font-family:'JetBrains Mono',monospace; }
.alert-section-title.triggered { color:var(--dim); }
.alert-empty { padding:12px; color:var(--dim); text-align:center; font-size:10px; }
.alert-row { display:grid; grid-template-columns:1fr auto auto 20px; gap:6px; padding:4px; border-bottom:1px solid var(--line); align-items:center; font-family:'JetBrains Mono',monospace; font-size:10px; }
.alert-row.active { border-left:2px solid var(--accent); }
.alert-row.triggered-row { opacity:0.5; }
.alert-ticker { color:var(--accent); font-weight:700; }
.alert-up { color:var(--up); }
.alert-down { color:var(--down); }
.alert-current { color:var(--dim); font-size:9px; }
.alert-target { color:var(--text); }
.alert-date { color:var(--dim); font-size:8px; }
.alert-btn-del { background:none; border:none; color:var(--dim); cursor:pointer; font-size:12px; padding:0 2px; }
.alert-btn-del:hover { color:var(--down); }

/* ====== COMPANY MODAL ====== */
.company-modal { display:none; position:fixed; inset:0; z-index:2000; }
.company-modal.active { display:flex; align-items:center; justify-content:center; }
.cm-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.7); }
.cm-dialog { position:relative; background:var(--bg-2); border:1px solid var(--line-2); border-radius:6px; max-width:520px; width:90%; max-height:80vh; display:flex; flex-direction:column; box-shadow:0 8px 32px rgba(0,0,0,0.5); }
.cm-header { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid var(--line); }
.cm-close { color:var(--dim); cursor:pointer; font-size:18px; padding:4px 8px; }
.cm-close:hover { color:var(--text); }
.cm-title { font-family:'JetBrains Mono',monospace; font-size:14px; color:var(--accent); margin:0; }
.cm-body { flex:1; overflow-y:auto; padding:12px 16px; }
.cm-loading { text-align:center; color:var(--dim); padding:24px; font-size:13px; }
.cm-empty { text-align:center; }
.cm-empty p { color:var(--dim); font-size:13px; margin-bottom:12px; }
.cm-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.cm-field { display:flex; flex-direction:column; gap:2px; }
.cm-label { font-size:9px; color:var(--dim); text-transform:uppercase; letter-spacing:0.05em; font-family:'JetBrains Mono',monospace; }
.cm-value { font-size:12px; color:var(--text); font-family:'JetBrains Mono',monospace; }
.cm-value a { color:var(--accent); text-decoration:none; }
.cm-value a:hover { text-decoration:underline; }
.cm-section-title { font-size:10px; color:var(--accent); font-weight:700; margin-bottom:4px; font-family:'JetBrains Mono',monospace; }
.cm-desc { margin-bottom:12px; }
.cm-desc p { font-size:11px; color:var(--text-2); line-height:1.5; }
.cm-actions { display:flex; gap:8px; flex-wrap:wrap; }
.cm-btn-chart, .cm-btn-alert { padding:6px 12px; border-radius:3px; cursor:pointer; font-size:10px; font-family:'JetBrains Mono',monospace; font-weight:600; border:none; }
.cm-btn-chart { background:var(--accent); color:var(--bg); }
.cm-btn-alert { background:var(--bg-3); color:var(--accent); border:1px solid var(--accent); }
.cm-btn-chart:hover, .cm-btn-alert:hover { filter:brightness(1.2); }

/* ====== NEWS FEED ====== */
.news-feed { flex: 1; overflow: auto; }
.news-feed .item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
}
.news-feed .item:hover { background: rgba(255, 176, 0, 0.04); }
.news-feed .item .head {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--dim); margin-bottom: 3px;
}
.news-feed .item .head .src { color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.news-feed .item .head .when { color: var(--dim); }
.news-feed .item .head .sent {
  font-size: 13px; padding: 1px 4px; border-radius: 2px;
  font-weight: 600; text-transform: uppercase;
}
.news-feed .item .head .sent.positive { background: rgba(0, 214, 138, 0.15); color: var(--up); }
.news-feed .item .head .sent.negative { background: rgba(255, 79, 107, 0.15); color: var(--down); }
.news-feed .item .head .sent.neutral  { background: rgba(120, 120, 120, 0.15); color: var(--dim); }
.news-feed .item .title {
  font-size: 13px; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-feed .item .tickers {
  margin-top: 3px;
  display: flex; flex-wrap: wrap; gap: 3px;
}
.news-feed .item .tickers .tk {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  background: var(--bg-3); color: var(--accent-2);
  padding: 1px 4px; border-radius: 2px;
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.news-feed .item .tickers .tk:hover { background: var(--accent); color: #000; }

/* ====== TICKER TAPE (bottom) ====== */
.tape {
  height: 32px;
  background: #000;
  border-top: 1px solid var(--accent);
  display: flex; align-items: center;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  white-space: nowrap;
}
.tape .item { display: inline-block; padding: 0 18px; border-right: 1px solid var(--line); }
.tape .item .tk { color: var(--accent); font-weight: 600; }
.tape .item .px { color: var(--text); margin: 0 4px; }
.tape .item .pc { font-size: 13px; }
.tape .item .pc.up { color: var(--up); }
.tape .item .pc.down { color: var(--down); }

/* ====== OVERLAYS / MODAL ====== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid; place-items: start center;
  z-index: 200;
  backdrop-filter: blur(4px);
  padding-top: 80px;
}
.overlay[hidden] { display: none; }

.cmd {
  width: min(640px, 92vw);
  background: var(--bg-1);
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(255, 176, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.cmd input {
  width: 100%;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  padding: 16px 18px;
  font: inherit; font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}
.cmd input:focus { background: rgba(255, 176, 0, 0.04); }
#cmdResults { max-height: 400px; overflow: auto; }
#cmdResults .res {
  padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
#cmdResults .res:hover, #cmdResults .res.active { background: rgba(255, 176, 0, 0.08); }
#cmdResults .res .l { display: flex; flex-direction: column; gap: 2px; }
#cmdResults .res .l .title { color: var(--text); font-size: 13px; }
#cmdResults .res .l .sub   { color: var(--dim); font-size: 13px; }
#cmdResults .res .r { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.cmd-hint {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 8px 16px; background: var(--bg-2);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--dim);
}

/* ====== QUOTE MODAL ====== */
.modal {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  width: min(900px, 95vw);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
}
.modal-x {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: var(--text-2);
  font-size: 22px; cursor: pointer;
  line-height: 1;
}
.modal-x:hover { color: var(--down); }

.quote-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; padding-right: 30px;
}
.qt-ticker { font-size: 28px; font-weight: 700; color: var(--accent); }
.qt-name   { color: var(--text-2); font-size: 13px; margin-top: 4px; font-family: 'Inter', sans-serif; }
.qt-meta   { color: var(--dim); font-size: 13px; margin-top: 4px; }
.qt-price  { text-align: right; }
.qt-last   { font-size: 28px; font-weight: 700; }
.qt-chg    { font-size: 14px; font-weight: 600; margin-top: 4px; }
.qt-chg.up   { color: var(--up); }
.qt-chg.down { color: var(--down); }
.ask-ai-btn {
  display: inline-block; margin-top: 12px; padding: 6px 14px;
  background: #00d68a; color: #0a0a0a; font-weight: 700; font-size: 13px;
  border-radius: 4px; text-decoration: none; letter-spacing: 0.5px;
  transition: all 0.15s;
}
.ask-ai-btn:hover { background: #00ffa3; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,214,138,0.3); }
.quote-section { margin-bottom: 18px; }
.quote-section h3 {
  font-size: 13px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 8px; font-family: 'JetBrains Mono', monospace;
}
.intraday {
  width: 100%; height: 180px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
#history { height: 140px; }
.intraday-stats { font-size: 13px; color: var(--dim); margin-top: 6px; }
.qt-news { max-height: 180px; overflow: auto; }
.qt-news .item {
  padding: 6px 0; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.qt-news .item:hover { color: var(--text); }
.qt-news .item .head { font-size: 13px; color: var(--dim); margin-bottom: 2px; }

.alert-creator { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.alert-creator select, .alert-creator input {
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 5px 8px; border-radius: 3px;
  font: inherit; font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.alert-creator input[type="number"] { width: 100px; }
.alert-creator input[type="text"]   { width: 200px; }
.alerts-list { display: flex; flex-direction: column; gap: 4px; }
.alerts-list .alert {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
}
.alerts-list .alert .type { color: var(--accent); }
.alerts-list .alert .del  { color: var(--dim); cursor: pointer; }
.alerts-list .alert .del:hover { color: var(--down); }
.alerts-list .empty { color: var(--dim); font-style: italic; padding: 6px; }

/* ====== DISCLOSURES PANEL ====== */
.qt-disclosures { font-size: 13px; }
.qt-disclosures .disclosure-header {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.qt-disclosures .disclosure-header .pill {
  background: var(--bg); border: 1px solid var(--line-2);
  color: var(--text-2); padding: 3px 8px; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
}
.qt-disclosures .disclosure-header .pill b { color: var(--accent); }
.qt-disclosures .grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px;
}
.qt-disclosures .disc-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--bg); border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent); border-radius: 3px;
  color: var(--text); text-decoration: none; font-size: 13px;
  transition: all 0.12s;
}
.qt-disclosures .disc-link:hover {
  background: rgba(255, 176, 0, 0.06); border-color: var(--accent);
  border-left-color: var(--accent);
}
.qt-disclosures .disc-link .l {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.qt-disclosures .disc-link .l .title { color: var(--text); font-weight: 600; font-size: 13px; }
.qt-disclosures .disc-link .l .sub   { color: var(--dim); font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.qt-disclosures .disc-link .r {
  color: var(--accent); font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700;
}
.qt-disclosures .disc-link.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.qt-disclosures .disclosure-news {
  display: flex; flex-direction: column; gap: 4px; margin-top: 6px;
}
.qt-disclosures .disc-news-item {
  padding: 6px 8px; background: var(--bg); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: 2px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.qt-disclosures .disc-news-item:hover { background: rgba(255, 176, 0, 0.04); color: var(--text); }
.qt-disclosures .disc-news-item .head {
  font-size: 13px; color: var(--dim); margin-bottom: 2px;
  display: flex; justify-content: space-between; gap: 6px;
}
.qt-disclosures .disc-news-item .sent {
  padding: 0 4px; border-radius: 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.qt-disclosures .disc-news-item .sent.positive { color: var(--up); }
.qt-disclosures .disc-news-item .sent.negative { color: var(--down); }
.qt-disclosures .disc-news-item .sent.neutral  { color: var(--dim); }
.qt-disclosures .disc-section-title {
  font-size: 13px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.1em; margin: 8px 0 4px 0;
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
}
.qt-disclosures .disc-empty {
  color: var(--dim); font-style: italic; padding: 8px 0; font-size: 13px;
}
.qt-disclosures .disc-callout {
  color: var(--text-2); background: rgba(255, 176, 0, 0.05);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 8px 10px; border-radius: 3px; font-size: 13px; line-height: 1.5;
}
.qt-disclosures .disc-documents {
  display: flex; flex-direction: column; gap: 4px;
}
.qt-disclosures .disc-document {
  display: flex; align-items: stretch; gap: 4px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
}
.qt-disclosures .doc-main {
  display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px;
  color: var(--text); padding: 7px 9px; text-decoration: none;
}
.qt-disclosures .doc-main:hover { background: rgba(255, 176, 0, 0.04); }
.qt-disclosures .doc-main .title { font-size: 13px; font-weight: 600; }
.qt-disclosures .doc-main .sub { color: var(--dim); font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.qt-disclosures .doc-pdf {
  display: flex; align-items: center; padding: 0 10px;
  color: var(--accent); border-left: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  font-weight: 700; text-decoration: none;
}
.qt-disclosures .doc-pdf:hover { background: rgba(255, 176, 0, 0.08); }
.qt-disclosures .disc-source {
  display: inline-block; background: var(--bg-2);
  border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 2px;
  font-size: 13px; color: var(--dim); font-family: 'JetBrains Mono', monospace;
  margin-right: 4px;
}
@media (max-width: 720px) {
  .qt-disclosures .grid-2 { grid-template-columns: 1fr; }
}

/* ====== HELP MODAL ====== */
.help-modal { width: min(560px, 92vw); }
.help-table { width: 100%; border-collapse: collapse; }
.help-table td { padding: 8px 0; vertical-align: top; }
.help-table td:first-child { width: 180px; color: var(--text-2); font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.help-table td:last-child  { color: var(--text); font-size: 13px; }

/* ====== RESPONSIVE ====== */
@media (max-width: 1100px) {
  .strip { grid-template-columns: 1fr 1fr 1fr; }
  .strip-cell.fx { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) 200px 220px; }
  .tape-panel    { grid-row: 1; grid-column: 1; }
  .watchlist-panel { grid-row: 2; grid-column: 1; }
  .news-panel    { grid-row: 3; grid-column: 1; }
  .ai-banner { display: none; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand { min-width: auto; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .panel-tools input { width: 120px; }
}

/* Halal/Haram badges */
.tag-halal { background: rgba(0,200,150,0.15); color: #00c896; padding:1px 5px; border-radius:3px; font-size:9px; margin-left:3px; }
.tag-haram { background: rgba(255,79,107,0.15); color: #ff4f6b; padding:1px 5px; border-radius:3px; font-size:9px; margin-left:3px; }
.tag-unknown { color: #6e716c; font-size:9px; margin-left:3px; opacity:0.5; }

/* === Community Chat === */
.chat-panel {
  position: fixed; right: 0; top: 0; width: min(320px, 100vw); height: 100vh;
  background: var(--bg-1); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 998;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; padding-bottom: 70px; }
.chat-input-area {
  position: sticky; bottom: 0; display: flex; gap: 4px; padding: 6px 10px;
  border-top: 1px solid var(--line); background: var(--bg-2); z-index: 2;
}
.chat-input-area input {
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text);
  padding: 6px 8px; border-radius: 4px; font-family: inherit; font-size: 13px;
}
.chat-input-area input:first-child { width: 70px; min-width: 70px; }
.chat-input-area input:nth-child(2) { flex: 1; min-width: 0; }
.chat-input-area button { flex-shrink: 0; }

.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.chat-msg {
  padding: 5px 8px; border-radius: 5px; background: var(--bg-2);
  border: 1px solid var(--line); max-width: 100%;
}
.chat-msg .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chat-msg .name { font-weight: 700; font-size: 13px; color: var(--accent); }
.chat-msg .time { font-size: 7px; color: var(--dim); }
.chat-msg .body { font-size: 13px; color: var(--text-2); line-height: 1.4; word-wrap: break-word; }
.chat-msg .actions { display: flex; gap: 6px; margin-top: 4px; font-size: 13px; }
.chat-msg .actions span { cursor: pointer; color: var(--dim); }
.chat-msg .actions span:hover { color: var(--text); }
.chat-msg.reply { border-left: 2px solid var(--accent); margin-left: 8px; }
@media (max-width: 480px) { .chat-panel { width: 100vw; } }

.heatmap-grid { display: flex; gap: 3px; padding: 4px 8px; overflow-x: auto; }
.heatmap-grid .hm-cell { flex: 1; min-width: 70px; padding: 6px 8px; border-radius: 4px; text-align: center; }
.heatmap-grid .hm-label { display: block; font-size: 13px; font-weight: 600; color: #e6e6e0; }
.heatmap-grid .hm-change { display: block; font-size: 13px; font-weight: 700; margin: 2px 0; }
.heatmap-grid .hm-count { display: block; font-size: 7px; color: #6e716c; }

.ticker-scroll { display: inline-block; white-space: nowrap; animation: tickerScroll 40s linear infinite; }
.ticker-scroll:hover { animation-play-state: paused; }
@keyframes tickerScroll { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* Dividend Calendar */
.div-table { width:100%; border-collapse:collapse; }
.div-table th { color:var(--dim); font-size:8px; text-transform:uppercase; padding:3px 6px; text-align:left; border-bottom:1px solid var(--line); }
.div-table td { padding:3px 6px; border-bottom:1px solid rgba(255,255,255,0.03); font-size:10px; }
.div-table .tkr { color:var(--accent); font-weight:600; }
.div-status { padding:1px 5px; border-radius:2px; font-size:8px; font-weight:600; }
.div-approved { background:rgba(0,200,150,0.15); color:#00d68a; }
.div-expected { background:rgba(230,184,0,0.15); color:#e6b800; }
.div-paid { background:rgba(110,113,108,0.1); color:#6e716c; }

/* ── Registration Modal ── */
.register-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.register-card {
  background: #111; border: 1px solid #222; border-radius: 12px;
  padding: 32px; width: 380px; max-width: 90vw;
}
.register-card h2 { color: var(--accent); font-size: 20px; margin: 0 0 4px; }
.reg-subtitle { color: #888; font-size: 13px; margin: 0 0 20px; }
.reg-input {
  width: 100%; padding: 10px 14px; background: #1a1a2e;
  border: 1px solid #333; border-radius: 6px; color: #fff;
  font-size: 14px; margin-bottom: 10px; font-family: inherit;
}
.reg-input:focus { outline: none; border-color: var(--accent); }
.reg-buttons { display: flex; gap: 10px; margin-top: 16px; }
.reg-btn {
  flex: 1; padding: 10px; border-radius: 6px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none;
}
.reg-btn.primary { background: var(--accent); color: #000; }
.reg-btn.secondary { background: #222; color: #ccc; border: 1px solid #333; }
.reg-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.reg-status { margin-top: 12px; font-size: 13px; text-align: center; }
.reg-status.success { color: var(--accent); }
.reg-status.error { color: #f44; }
.reg-label { display: block; font-size: 12px; color: #aaa; margin-bottom: 4px; font-weight: 500; }
.reg-optional { color: #666; font-weight: 400; font-size: 11px; }

/* ── Profile Panel ── */
.profile-panel {
  position: fixed; top: 60px; right: 20px; z-index: 998;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px;
  width: 420px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.prof-header { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); background: var(--bg-2); border-radius: 12px 12px 0 0; }
.prof-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent);
  color: var(--bg); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; flex-shrink: 0;
}
.prof-info { flex: 1; min-width: 0; }
.prof-name { font-size: 15px; font-weight: 600; color: var(--text); }
.prof-sub { font-size: 11px; color: var(--dim); }
.prof-close { background: none; border: none; color: var(--dim); font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.15s; }
.prof-close:hover { color: var(--text); }
.prof-section { padding: 14px 20px; }
.prof-section + .prof-section { border-top: 1px solid var(--line-2); }
.prof-section-title {
  font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.prof-holding-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); font-size: 10px; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%; margin-left: 6px;
}
.prof-add-btn {
  background: var(--bg-3); color: var(--accent); border: 1px solid var(--line-2);
  padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 500;
  transition: all 0.15s; margin-left: auto;
}
.prof-add-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.prof-empty { font-size: 12px; color: var(--dim); padding: 12px 0 6px; line-height: 1.5; }
.prof-table { width: 100%; border-collapse: collapse; font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.prof-table th {
  text-align: left; padding: 6px 8px; color: var(--dim); font-weight: 500;
  border-bottom: 1px solid var(--line-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.prof-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prof-table tr:last-child td { border-bottom: none; }
.prof-table tbody tr { transition: background 0.12s; }
.prof-table tbody tr:hover { background: var(--bg-2); }
.prof-ticker-cell { width: 60px; }
.prof-ticker { color: var(--accent); font-weight: 600; font-size: 12px; cursor: pointer; }
.prof-ticker:hover { text-decoration: underline; }
.prof-up { color: var(--up); font-weight: 600; }
.prof-down { color: var(--down); font-weight: 600; }
.prof-pct { font-weight: 400; opacity: 0.8; }
.prof-total td {
  border-top: 2px solid var(--line-2); font-weight: 700; font-size: 12px; padding-top: 10px;
}
.prof-remove { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 4px; transition: color 0.15s; }
.prof-remove:hover { color: var(--down); }
.prof-na { color: var(--dim); opacity: 0.5; }
.prof-watch-table .prof-ticker { color: var(--text); font-weight: 500; }
.prof-watch-table td { padding: 5px 8px; }

/* ── Inline Add Form ── */
.prof-add-form { margin-bottom: 10px; }
.prof-add-inner {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.prof-add-row { display: flex; align-items: center; gap: 8px; }
.prof-add-row label { font-size: 11px; color: var(--dim); min-width: 70px; flex-shrink: 0; }
.prof-add-input {
  flex: 1; background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
  padding: 6px 10px; border-radius: 6px; font-size: 13px; font-family: 'JetBrains Mono', monospace;
  outline: none; transition: border-color 0.15s;
}
.prof-add-input:focus { border-color: var(--accent); }
.prof-add-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.prof-add-save {
  background: var(--accent); color: var(--bg); border: none;
  padding: 6px 18px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
  transition: opacity 0.15s;
}
.prof-add-save:hover { opacity: 0.85; }
.prof-add-cancel {
  background: var(--bg-3); color: var(--dim); border: 1px solid var(--line-2);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px;
  transition: all 0.15s;
}
.prof-add-cancel:hover { color: var(--text); border-color: var(--dim); }

/* ── FAQ Panel ── */
.faq-panel {
  position: fixed; top: 60px; left: 20px; z-index: 997;
  background: #111; border: 1px solid #222; border-radius: 10px;
  width: 340px; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.faq-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #222; }
.faq-title { color: #e6b800; font-size: 13px; font-weight: 600; }
.faq-close { background: none; border: none; color: #888; font-size: 18px; cursor: pointer; }
.faq-list { padding: 8px; }
.faq-item { margin-bottom: 4px; }
.faq-q {
  width: 100%; text-align: left; background: #1a1a2e; border: 1px solid #222;
  color: #ddd; padding: 10px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: inherit; transition: border-color 0.2s;
}
.faq-q:hover { border-color: #e6b800; }
.faq-a { padding: 10px 12px; color: #bbb; font-size: 12px; line-height: 1.6; }
.faq-a p { margin: 0 0 10px; }
.faq-cta {
  display: inline-block; background: var(--accent); color: #000;
  padding: 6px 14px; border-radius: 6px; text-decoration: none;
  font-size: 12px; font-weight: 600; margin-top: 4px;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE — Phone & Tablet
   Desktop users see ZERO difference.
   ═══════════════════════════════════════════ */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  /* Hide less important columns in stock table */
  thead th.col-isin,
  tbody td.col-isin,
  thead th.col-turnover,
  tbody td.col-turnover,
  thead th.col-count,
  tbody td.col-count { display: none; }

  .strip { grid-template-columns: 1fr 1fr 1fr; }
  .strip-cell.fx { grid-column: 1 / -1; }
  .topbar { gap: 10px; }
  .brand { min-width: 180px; }
  .cmd-btn span { display: none; }
}

/* ── Phone (≤600px) ── */
@media (max-width: 600px) {
  /* === BODY === */
  html, body { font-size: 13px; }
  body { background: radial-gradient(ellipse at top, #161818 0%, var(--bg) 40%); }

  /* === TOPBAR === */
  .topbar {
    padding: 6px 10px; gap: 6px;
    position: sticky; top: 0; z-index: 100;
    flex-wrap: wrap;
  }
  .brand { min-width: 0; gap: 6px; }
  .logo { font-size: 11px; padding: 5px 7px; }
  .title h1 { font-size: 12px; }
  .title .subtitle { font-size: 10px; }
  .ai-banner { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; gap: 6px; }
  .lang-select { font-size: 11px; padding: 4px 6px; }
  .cmd-btn { font-size: 11px; padding: 5px 8px; min-height: 40px; }
  .cmd-btn span { font-size: 10px; }
  .status { gap: 4px; }
  .market-session { font-size: 10px; }
  .pill { font-size: 10px; padding: 3px 6px; }
  .clock { font-size: 11px; min-width: 50px; }

  /* === STRIP === */
  .strip { grid-template-columns: 1fr 1fr; }
  .strip-cell { padding: 3px 8px; }
  .strip-cell .lbl { font-size: 8px; }
  .strip-cell .val { font-size: 11px; }
  .strip-cell .delta { font-size: 9px; }
  .strip-cell.fx { grid-column: 1 / -1; gap: 6px; }
  .strip-cell.movers { flex-direction: column; align-items: flex-start; gap: 2px; }

  /* === MAIN GRID — stack everything === */
  .grid {
    display: flex; flex-direction: column;
    height: auto; min-height: 60vh;
    gap: 1px;
  }
  .tape-panel { order: 1; max-height: 55vh; }
  .right-col { order: 2; }
  .watchlist-panel { max-height: 35vh; }
  .news-panel { max-height: 40vh; }

  /* === PANEL HEADERS === */
  .panel-head { padding: 6px 10px; }
  .panel-head h2 { font-size: 11px; }
  .panel-tools { gap: 4px; flex-wrap: wrap; }
  .panel-tools input { width: 100% !important; min-width: 0; font-size: 12px; padding: 6px 8px; }
  .panel-tools select { font-size: 12px; }
  .filter-group { flex-wrap: wrap; }
  .chip { font-size: 11px; padding: 4px 7px; }

  /* === STOCK TABLE — card mode === */
  thead th {
    font-size: 10px; padding: 4px 5px;
  }
  /* Hide everything except ticker, price, change */
  thead th.col-name,
  tbody td.col-name,
  thead th.col-open,
  tbody td.col-open,
  thead th.col-high,
  tbody td.col-high,
  thead th.col-low,
  tbody td.col-low,
  thead th.col-isin,
  tbody td.col-isin,
  thead th.col-turnover,
  tbody td.col-turnover,
  thead th.col-count,
  tbody td.col-count,
  thead th.col-close,
  tbody td.col-close { display: none; }

  tbody td {
    padding: 4px 5px; font-size: 12px;
  }
  tbody td.col-ticker { font-size: 12px; }
  tbody td.col-last { font-size: 13px; font-weight: 600; }

  /* Make rows tappable — 44px touch target */
  tbody tr { min-height: 44px; }

  /* === RIGHT COLUMN === */
  .right-col { overflow-y: visible; }

  /* === WATCHLIST === */
  .watchlist .item {
    padding: 10px 12px; min-height: 44px;
    font-size: 12px; gap: 6px;
    grid-template-columns: 1fr auto auto;
  }
  .watchlist .item .star { font-size: 16px; padding: 4px; }

  /* === NEWS === */
  .news-feed .item { padding: 10px 12px; }
  .news-feed .item .title { font-size: 12px; }
  .news-feed .item .head { font-size: 11px; }

  /* === QUOTE MODAL — full screen === */
  .modal {
    width: 100vw; max-width: 100vw;
    height: 100vh; max-height: 100vh;
    border-radius: 0; border: none;
    padding: 12px; padding-top: 16px;
    overflow-y: auto;
  }
  .quote-head { flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .qt-ticker { font-size: 22px; }
  .qt-last { font-size: 22px; }
  .qt-chg { font-size: 13px; }
  .modal-x { top: 8px; right: 10px; font-size: 28px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

  /* === OVERLAY === */
  .overlay { padding-top: 0; align-items: start; }

  /* === CMD PALETTE === */
  .cmd { width: 100vw; border-radius: 0; border-left: none; border-right: none; }
  .cmd input { font-size: 16px; padding: 14px; min-height: 50px; }

  /* === FAQ PANEL === */
  .faq-panel { left: 0; top: 0; width: 100vw; max-height: 100vh; border-radius: 0; z-index: 999; }
  .faq-q { min-height: 44px; font-size: 13px; }
  .faq-a { font-size: 13px; }

  /* === PROFILE PANEL === */
  .profile-panel { right: 0; top: 0; left: 0; width: 100vw; max-height: 100vh; border-radius: 0; z-index: 999; border: none; }
  .prof-header { border-radius: 0; }
  .prof-table { font-size: 10px; }
  .prof-table th, .prof-table td { padding: 4px 6px; }

  /* === REGISTRATION === */
  .register-card { width: 100vw; max-width: 100vw; border-radius: 0; padding: 24px 16px; }
  .reg-input { font-size: 16px; min-height: 48px; }
  .reg-btn { min-height: 48px; font-size: 16px; }

  /* === MOBILE AI FAB === */
  .ai-fab {
    display: flex !important;
    position: fixed; bottom: 80px; right: 20px; z-index: 998;
    background: var(--accent); color: var(--bg);
    border: none; border-radius: 50%;
    width: 48px; height: 48px;
    font-size: 20px;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 16px rgba(0,200,150,0.35);
    cursor: pointer; text-decoration: none;
  }

  /* === COMMUNITY CHAT === */
  .chat-panel { width: 100vw; }
  .chat-input-area input { font-size: 16px; min-height: 44px; }
  .chat-input-area button { min-height: 44px; min-width: 44px; }

  /* === DIVIDENDS TABLE === */
  .div-table th { font-size: 9px; padding: 3px 4px; }
  .div-table td { font-size: 10px; padding: 3px 4px; }

  /* === HEATMAP === */
  .heatmap-grid { gap: 2px; }
  .heatmap-grid .hm-cell { min-width: 55px; padding: 4px 5px; }
  .heatmap-grid .hm-label { font-size: 11px; }
  .heatmap-grid .hm-change { font-size: 11px; }

  /* === TICKER TAPE === */
  .tape { font-size: 11px; height: 28px; }
  .tape .item { padding: 0 12px; }

  /* === BUTTONS — 44px touch target === */
  button, .cmd-btn, .chip, .ask-ai-btn {
    min-height: 36px;
  }
  .ask-ai-btn {
    display: block; text-align: center;
    padding: 12px; font-size: 14px;
  }

  /* === SCROLLABLE TABLES === */
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* === MISC === */
  kbd { font-size: 10px; }
  code { font-size: 11px; }
}
