:root {
  --bg: #0e1116;
  --panel: #171b22;
  --card: #1f242d;
  --border: #2b313b;
  --text: #e6e9ee;
  --muted: #95a0af;
  --accent: #00ff88;
  --danger: #ff5d5d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 18px; margin: 0; }
.tradeBtn {
  position: absolute; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #04130a; font-weight: 800; text-decoration: none;
  padding: 9px 18px; border-radius: 8px; white-space: nowrap; box-shadow: 0 0 14px rgba(0,255,136,.25);
}
.tradeBtn:hover { filter: brightness(1.08); }
@media (max-width: 720px) { .tradeBtn { position: static; transform: none; } }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--accent); }
.dot.off { background: var(--danger); }
button {
  background: var(--accent); color: #04130a; border: none; border-radius: 7px;
  padding: 8px 12px; font-weight: 600; cursor: pointer;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); padding: 4px 8px; font-size: 12px; }
main { display: grid; grid-template-columns: 1fr 420px; gap: 16px; padding: 16px 20px; align-items: start; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
main.feedOnly { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
main.settingsOnly { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
.trash { background: transparent; border: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 10px; opacity: 0; transition: opacity .12s; }
.alert:hover .trash { opacity: .75; }
.trash:hover { opacity: 1; filter: brightness(1.3); }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
#feedPane h2 { margin-top: 0; }
#feedControls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
#search { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 12px; font-size: 14px; flex: 0 1 280px; min-width: 200px; }
#chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--card); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--text); }
.chip.active { color: var(--text); border-color: var(--accent); }
#soundPanel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.soundRow { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.soundRow input { accent-color: var(--accent); width: 16px; height: 16px; }
#feed { display: flex; flex-direction: column; gap: 8px; }
.alert {
  --ch: var(--accent);
  background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--accent);
  border-radius: 8px; padding: 11px 14px; animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.alert .label {
  font-weight: 800; font-size: 18px; letter-spacing: .01em; line-height: 1.15;
  display: inline-flex; align-items: center; gap: 7px;
}
.chDot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.alert .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.alert .body { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.alert .media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.alert .media img.alertImg {
  max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--border);
  cursor: zoom-in; display: block; background: var(--bg);
}
.alert .files { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; }
.alert .fileLink { color: var(--accent); font-size: 13px; text-decoration: none; }
.alert .fileLink:hover { text-decoration: underline; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.card input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px; }
.card textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 9px 10px; font: inherit; resize: vertical; min-height: 70px; }
.dashLeft { display: flex; flex-direction: column; gap: 16px; }
#announcePane h2 { margin-top: 0; }
#announceHint { font-size: 12px; }
#announceHint.ok { color: var(--accent); }
#announceHint.err { color: var(--danger); }
.atRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.atUrl { font-size: 11px; color: var(--muted); word-break: break-all; }
.annChans { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; padding-bottom: 2px; }
.annChans label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.annChans input { accent-color: var(--accent); width: 15px; height: 15px; }
.annChans .annAll { color: var(--muted); font-weight: 600; }
.annImg { display: flex; align-items: center; gap: 8px; }
.annImg img { max-height: 60px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.annImg button { background: transparent; border: 1px solid var(--border); color: var(--danger); padding: 3px 9px; font-size: 12px; }
#announceCard.dropping, #quickCard.dropping { outline: 2px dashed var(--accent); outline-offset: 3px; }
#quickPane h2 { margin-top: 0; }
#quickList { display: flex; flex-direction: column; gap: 6px; }
.qpRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; }
.qpRow.done { opacity: .55; }
.qpRow .qpLabel { font-size: 13px; word-break: break-word; }
.qpRow .row { gap: 8px; }
.qpRow button { font-size: 12px; padding: 5px 10px; }
.qpRow .qpTick { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.qpRow .qpTick input { accent-color: var(--accent); width: 15px; height: 15px; }
.qpMove { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 2px 7px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.chTitle { font-weight: 600; }
.chId { font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.uploadLabel { font-size: 12px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.uploadLabel input { display: none; }
.tgInput { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 12px; flex: 1; min-width: 130px; }
.tgThreadRow { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.tgThreadRow:last-child { border-bottom: none; }
.copy { color: var(--accent); cursor: pointer; }
.copy:hover { text-decoration: underline; }
.loginWrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.loginCard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.4); }
.loginCard h1 { margin: 0; font-size: 22px; }
.loginCard .muted { margin: 0; }
.loginCard input { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 11px 12px; font-size: 15px; }
.loginCard button { padding: 11px; font-size: 15px; }
.loginErr { color: var(--danger); font-size: 13px; min-height: 16px; }
.pnlBig { font-size: 46px; font-weight: 800; letter-spacing: .01em; margin-top: 6px; }

/* --- merged dashboard: Day P&L band + open positions ---------------------- */
.pnlBand { margin: 16px 20px 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pnlBandHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pnlBandLabel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.pnlLive { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.pnlBandBody { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.pnlBand .pnlBig { font-size: 40px; font-weight: 800; line-height: 1; margin: 0; }
.pnlStats { display: flex; flex-wrap: wrap; gap: 8px; }
.pnlStat { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; min-width: 96px; }
.pnlStatLabel { font-size: 11px; color: var(--muted); }
.pnlStatVal { font-size: 16px; font-weight: 700; }
main.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 20px; align-items: start; }
@media (max-width: 900px) { main.dash { grid-template-columns: 1fr; } }
#positions { display: flex; flex-direction: column; }
.posRow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.posRow:first-child { border-top: none; }
.posName { font-weight: 700; }
.posSub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.posRight { text-align: right; white-space: nowrap; }
.posPnl { font-weight: 700; }
.posPct { font-size: 11px; }
.pnlEmpty { padding: 16px 0; text-align: center; color: var(--muted); font-size: 13px; }
.alarmOverlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.alarmOverlay.pos { animation: flashPos .6s steps(1) infinite; }
.alarmOverlay.neg { animation: flashNeg .6s steps(1) infinite; }
@keyframes flashPos { 0%,49% { background:#00321c; } 50%,100% { background:#00ff88; } }
@keyframes flashNeg { 0%,49% { background:#3a0000; } 50%,100% { background:#ff2d2d; } }
.alarmInner { text-align: center; color: #000; }
.alarmTitle { font-size: 34px; font-weight: 900; letter-spacing: .08em; }
.alarmAmt { font-size: 72px; font-weight: 900; margin: 8px 0 24px; }
.alarmDismiss { font-size: 26px; font-weight: 900; padding: 18px 48px; border-radius: 12px; background: #000; color: #fff; border: none; cursor: pointer; letter-spacing: .1em; }
.alarmDismiss:hover { filter: brightness(1.2); }
