/* Trenchline Capital design system: neutral, dense, data-first (modelled on pro trading terminals) */
:root {
  --bg: #09090b;
  --bg-2: #0c0c0f;
  --panel: #111114;
  --panel-2: #16161a;
  --panel-3: #1d1d22;
  --line: #1f1f25;
  --line-2: #2b2b33;
  --text: #ececf1;
  --text-2: #b4b4be;
  --dim: #868690;
  --faint: #55555e;
  --brand: #3ddc97;
  --brand-2: #2bb980;
  --brand-glow: rgba(61, 220, 151, .14);
  --buy: #2ebd85;
  --sell: #f6465d;
  --gold: #e7b74c;
  --red: #f6465d;
  --red-2: #d93a50;
  --blue: #4c8dff;
  --purple: #9b7bff;
  --r: 8px;
  --r-sm: 6px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
.mono { font-family: var(--mono); }
.num, .tabnum { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.brand { color: var(--brand); }
.up, .green { color: var(--buy); }
.down, .red { color: var(--sell); }
.gold { color: var(--gold); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
::selection { background: rgba(61, 220, 151, .25); }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: #26262d; border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
svg.i { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { border-color: #3a3a44; background: var(--panel-3); }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #04140c; }
.btn-primary:hover { background: #5ce6a9; border-color: #5ce6a9; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-red { background: var(--sell); border-color: var(--sell); color: #fff; }
.btn-red:hover { background: #ff5b70; border-color: #ff5b70; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 8px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 22px; padding: 0 7px; font-size: 11.5px; border-radius: 5px; }
.btn-block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--panel); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.chip-brand { color: var(--brand); border-color: rgba(61, 220, 151, .28); background: rgba(61, 220, 151, .06); }
.chip-gold { color: var(--gold); border-color: rgba(231, 183, 76, .28); background: rgba(231, 183, 76, .06); }
.chip-red { color: var(--sell); border-color: rgba(246, 70, 93, .28); background: rgba(246, 70, 93, .06); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { background: var(--buy); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- inputs ---------- */
.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); outline: none;
  transition: border-color .12s;
}
.input:focus { border-color: #4a4a55; }
.input::placeholder { color: var(--faint); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--dim); font-weight: 500; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card-pad { padding: 18px; }
.card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--dim); }
.label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* ---------- toast + modal ---------- */
.toasts { position: fixed; right: 14px; bottom: 36px; display: flex; flex-direction: column; gap: 6px; z-index: 200; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 250px; max-width: 360px; padding: 10px 12px; border-radius: 8px;
  background: #18181c; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 12.5px; display: flex; align-items: center; gap: 9px; animation: tin .18s ease-out;
}
.toast img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.toast.ok { border-left: 3px solid var(--buy); }
.toast.err { border-left: 3px solid var(--sell); }
.toast.out { animation: tout .2s ease-in forwards; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
@keyframes tout { to { opacity: 0; } }

.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 22px; }
.modal h3 { margin: 0 0 8px; font-size: 17px; font-weight: 650; }
.modal p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal .actions.stack { flex-direction: column; align-items: stretch; }
.modal .actions.stack .btn { height: auto; min-height: 42px; padding: 10px 14px; justify-content: flex-start; text-align: left; white-space: normal; font-weight: 550; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.logo img { width: 26px; height: 26px; }
.logo b { font-weight: 750; }

/* ---------- misc ---------- */
.sk { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; }
@keyframes sk { to { background-position: -200% 0; } }
.badge { display: inline-flex; align-items: center; gap: 4px; font: 600 10.5px var(--sans); letter-spacing: .02em; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.badge-brand { background: rgba(61, 220, 151, .1); color: var(--brand); }
.badge-gold { background: rgba(231, 183, 76, .1); color: var(--gold); }
.badge-red { background: rgba(246, 70, 93, .1); color: var(--sell); }
.badge-blue { background: rgba(76, 141, 255, .12); color: var(--blue); }
.badge-dim { background: var(--panel-3); color: var(--text-2); }
.bar { height: 4px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.bar.gold > i { background: var(--gold); }
.bar.red > i { background: var(--sell); }
kbd { font: 10.5px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--dim); }
