:root {
  --bg: #0b0e13; --panel: #11151c; --panel2: #161b23; --line: #1f2630; --line2: #2a323e; --text: #e3e8ee; --muted: #7f8a97;
  --green: #22b39f; --red: #f0534f; --amber: #f2b33d; --blue: #5b93ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; overflow: hidden; }
button, select, input, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line2); border-radius: 7px; padding: 6px 10px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
button { cursor: pointer; transition: border-color .15s, background .15s; }
button:hover { border-color: #3c4757; background: #1b212b; }
button:disabled { opacity: .5; cursor: default; }
a { color: var(--muted); text-decoration: none; } a:hover { color: var(--text); }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--red); } .spacer { flex: 1; }
.pos { color: var(--green); } .neg { color: var(--red); }

header { display: flex; gap: 18px; align-items: center; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.brand { font-weight: 700; letter-spacing: .2px; } .brand .muted { margin: 0 4px; }
header label { display: flex; gap: 6px; align-items: center; }

main { flex: 1; min-height: 0; display: grid; grid-template-columns: 440px minmax(0, 1fr) 380px; }
section { min-width: 0; min-height: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
#right { border-right: none; background: var(--panel); }
#left { background: var(--panel); }
.head { padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--line); flex: none; }

/* market table */
.tablewrap, #left > table { overflow: auto; }
#left { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 6px 8px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 11.5px; position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
td.c { font-weight: 600; }
#coins tbody tr { cursor: pointer; border-bottom: 1px solid #171c24; }
#coins tbody tr:hover { background: #161c25; }
#coins tbody tr.sel { background: #18233a; box-shadow: inset 3px 0 0 var(--blue); }
.pill { display: inline-block; min-width: 40px; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; text-align: center; background: #1c232d; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.w { background: rgba(242,179,61,.16); color: var(--amber); }
.pill.h { background: rgba(240,83,79,.18); color: #ff8a86; font-weight: 600; }

/* chart */
#center { background: var(--bg); }
.chart-bar { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.coin { font-size: 16px; }
.px { font-size: 16px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.tf { display: flex; gap: 4px; }
.opts { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.opts label { display: flex; gap: 4px; align-items: center; cursor: pointer; }
.opts input { accent-color: var(--blue); margin: 0; }
.tf button { padding: 4px 10px; }
.tf button.on, .tabs button.on { border-color: var(--blue); background: rgba(91,147,255,.12); color: #fff; }
#chart { flex: 1; min-height: 320px; }
.legend { padding: 4px 14px 6px; flex: none; }
#sel-signal { padding: 6px 14px; flex: none; }
#sel-signal:empty { display: none; }
.decide { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); flex: none; background: var(--panel); }
.decide input { flex: 1; min-width: 80px; }
button.long { border-color: rgba(34,179,159,.6); color: #6fe3d2; } button.long:hover { background: rgba(34,179,159,.12); }
button.short { border-color: rgba(240,83,79,.6); color: #ff8a86; } button.short:hover { background: rgba(240,83,79,.12); }
#decide-msg:empty { display: none; }

/* right panel */
.tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; }
.tab { padding: 10px 12px; overflow: auto; flex: 1; min-height: 0; }
.tab[hidden] { display: none; }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.filters select { flex: 1; min-width: 0; }
.filters label { white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.sig { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: var(--panel2); }
.sig:hover { border-color: var(--line2); } .sig.sel { border-color: var(--blue); }
.sig .t { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tag { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11px; background: #232b36; color: #b9c2cd; margin-left: 4px; }
.tag.taken { background: rgba(34,179,159,.18); color: #7fe0d4; }
#question { width: 100%; resize: vertical; margin-bottom: 8px; }
#ask { width: 100%; margin-bottom: 12px; border-color: rgba(91,147,255,.6); }
.ai { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--panel2); }
.ai .v { font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.ai ul { margin: 6px 0 6px 18px; padding: 0; }
.jrow { border-bottom: 1px solid var(--line); padding: 8px 0; }
#j-sum:empty { display: none; } #j-sum { margin-bottom: 8px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 10; }
.overlay[hidden] { display: none; }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 10px; width: 300px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }

::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #262e39; border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1250px) { main { grid-template-columns: 380px minmax(0, 1fr) 340px; } th:nth-child(4), td:nth-child(4) { display: none; } }
@media (max-width: 1000px) {
  body { overflow: auto; } main { display: flex; flex-direction: column; }
  section { border-right: none; border-bottom: 1px solid var(--line); } #left { max-height: 320px; } #chart { height: 400px; flex: none; } .tab { max-height: 520px; }
}

/* bot call in the table and the decision panel */
.bot { display: inline-block; min-width: 72px; text-align: left; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #1c232d; color: var(--muted); white-space: nowrap; }
.bot i { font-style: normal; font-weight: 500; opacity: .8; margin-left: 2px; }
.bot.long.near { color: #6fe3d2; background: rgba(34,179,159,.12); } .bot.short.near { color: #ff8a86; background: rgba(240,83,79,.12); }
.bot.long.fire { color: #0b0e13; background: var(--green); } .bot.short.fire { color: #0b0e13; background: var(--red); }
#decision { padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.dline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 2px 0; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.chip { border: 1px solid transparent; cursor: pointer; padding: 1px 7px; min-width: 0; }
.chip.on { border-color: var(--blue); }
#decision:empty { display: none; }
.verdict { margin-bottom: 8px; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rule { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel2); font-size: 12px; line-height: 1.6; }
.rule.lead { border-color: rgba(91,147,255,.55); }
.rule .rt { font-size: 12.5px; margin-bottom: 2px; }
.ok { color: var(--green); font-weight: 700; } .no { color: #556070; font-weight: 700; }
@media (max-width: 1250px) { .rules { grid-template-columns: 1fr; } }

#calls-sum { margin-bottom: 10px; } #calls-sum .muted a { text-decoration: underline; }
table.sum { margin-top: 6px; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; table-layout: fixed; }
table.sum td:first-child, table.sum th:first-child { width: 30%; overflow: hidden; text-overflow: ellipsis; }
table.sum th { position: static; background: var(--panel2); }
table.sum td, table.sum th { padding: 3px 4px; }

.aiw { margin-top: 4px; font-size: 11.5px; color: #c4ccd6; }
.aiw summary { cursor: pointer; list-style: none; } .aiw summary::-webkit-details-marker { display: none; }
.aiw .v { font-weight: 700; text-transform: uppercase; }
.aiw ul { margin: 4px 0 4px 16px; padding: 0; }

#conf-note { padding: 6px 14px; border-bottom: 1px solid var(--line); background: rgba(255,209,102,.06); color: #ffe3a3; flex: none; }
#conf-note:empty { display: none; }

.big { display: inline-block; padding: 2px 10px; border-radius: 7px; font-weight: 700; font-size: 13px; background: #1c232d; color: var(--muted); margin-right: 4px; }
.big.long.near { color: #6fe3d2; background: rgba(34,179,159,.15); } .big.short.near { color: #ff8a86; background: rgba(240,83,79,.15); }
.big.long.fire { color: #0b0e13; background: var(--green); } .big.short.fire { color: #0b0e13; background: var(--red); }
.bot b { font-weight: 700; margin: 0 2px; }
