/* Phantom Syndicate — petrol & brass */
:root {
  --bg: #0e2629;
  --panel: #133236;
  --panel-2: #183d42;
  --line: #255158;
  --text: #e6eeea;
  --muted: #8daaa6;
  --brass: #e0b354;
  --brass-ink: #2a1e05;
  --win: #58cfa0;
  --loss: #ff8170;
  --watch: #b3a6f2;
  --focus: #f3d58e;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Onest", "Segoe UI", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eaf0ef; --panel: #ffffff; --panel-2: #f3f7f6; --line: #cfdcda;
    --text: #0e2629; --muted: #557370; --brass: #9a6b0c; --brass-ink: #fff8e6;
    --win: #1a8a5b; --loss: #c2402f; --watch: #5c4fc2; --focus: #9a6b0c;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eaf0ef; --panel: #ffffff; --panel-2: #f3f7f6; --line: #cfdcda;
  --text: #0e2629; --muted: #557370; --brass: #9a6b0c; --brass-ink: #fff8e6;
  --win: #1a8a5b; --loss: #c2402f; --watch: #5c4fc2; --focus: #9a6b0c;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.01em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: none; }
main { padding: 0 16px 96px; max-width: 980px; width: 100%; margin: 0 auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0 10px;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--brass); }
.status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dot {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  padding: 4px 9px; border-radius: 99px; background: var(--panel);
}
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.on::before { background: var(--win); }
.dot.off::before { background: var(--loss); }

/* account strip */
.account {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px;
}
.account > div { background: var(--panel); padding: 12px 14px; }
.account small { display: block; color: var(--muted); font-size: 12.5px; }
.account b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.account .sub { font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) {
  .account > div { padding: 10px 12px; }
  .account b { font-size: 18px; }
  .account small, .account .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dot { font-size: 12px; padding: 3px 8px; }
  .field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* bottom nav (phone) */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 6px 0; border-radius: 10px;
}
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--brass); }

/* ---------- common ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.view-head h1 { font-size: 26px; }
.muted { color: var(--muted); }
.win { color: var(--win); }
.loss { color: var(--loss); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 13.5px;
}
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); font-weight: 600; }
.btn {
  border: 1px solid var(--line); background: var(--panel-2); padding: 9px 14px;
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 500;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); font-weight: 600; }
.btn.danger { color: var(--loss); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
select.inline { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-family: var(--display); font-size: 18px; margin-bottom: 4px; }

/* ---------- signal list ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.sig {
  display: block; text-decoration: none; background: var(--panel); border-radius: var(--radius);
  padding: 12px 14px 14px; border: 1px solid transparent;
}
.sig:hover { border-color: var(--line); }
.sig-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sig-title { font-family: var(--display); font-weight: 600; font-size: 17px; }
.side { font-weight: 700; font-size: 13px; margin-right: 6px; }
.side.buy { color: var(--win); }
.side.sell { color: var(--loss); }
.sig-meta { font-size: 13px; color: var(--muted); }
.sig-right { text-align: right; white-space: nowrap; }
.outcome { font-size: 13px; font-weight: 600; }
.o-won { color: var(--win); } .o-lost { color: var(--loss); }
.o-open, .o-pending { color: var(--brass); } .o-watch { color: var(--watch); }
.o-skipped, .o-unfilled, .o-even, .o-failed { color: var(--muted); }
.net { font-family: var(--display); font-weight: 600; font-size: 16px; }
.reason { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- the price ladder ---------- */
.ladder { position: relative; height: 26px; margin-top: 10px; }
.ladder .track { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--line); border-radius: 2px; }
.ladder .risk { position: absolute; top: 12px; height: 2px; background: color-mix(in srgb, var(--loss) 55%, transparent); }
.ladder .gain { position: absolute; top: 12px; height: 2px; background: var(--win); }
.ladder .zone { position: absolute; top: 6px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--brass) 35%, transparent); border: 1px solid var(--brass); min-width: 4px; }
.ladder .mk { position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--muted); background: var(--panel); }
.ladder .mk.sl { border-radius: 2px; border-color: var(--loss); background: var(--loss); width: 4px; margin-left: -2px; height: 16px; top: 5px; }
.ladder .mk.hit { border-color: var(--win); background: var(--win); }
.ladder .mk.run { border-style: dashed; }
.ladder.big { height: 64px; margin: 18px 0 6px; }
.ladder.big .track, .ladder.big .risk, .ladder.big .gain { top: 22px; height: 3px; }
.ladder.big .zone { top: 14px; height: 19px; }
.ladder.big .mk { top: 16px; width: 15px; height: 15px; margin-left: -7.5px; }
.ladder.big .mk.sl { top: 13px; height: 21px; width: 5px; margin-left: -2.5px; }
.ladder .lb { position: absolute; top: 40px; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; text-align: center; line-height: 1.25; }
.ladder .lb b { display: block; color: var(--text); font-weight: 600; }

/* ---------- detail ---------- */
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; margin: 4px 0 10px; font-size: 14px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h1 { font-size: 30px; }
.panel { background: var(--panel); border-radius: var(--radius-lg); padding: 16px; margin-top: 14px; }
.panel h2 { font-size: 17px; margin-bottom: 10px; }
.message {
  white-space: pre-wrap; margin: 0; padding: 12px 14px; background: var(--panel-2);
  border-left: 3px solid var(--brass); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font: 400 14.5px/1.55 var(--body);
}
.legs { width: 100%; border-collapse: collapse; font-size: 14px; }
.legs th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 8px 6px 0; font-size: 13px; }
.legs td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); }
.legs td:last-child, .legs th:last-child { text-align: right; padding-right: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: 13px; }
.ev-win { color: var(--win); } .ev-loss, .ev-error { color: var(--loss); } .ev-tp, .ev-sl { color: var(--brass); }

/* ---------- positions ---------- */
.pos { background: var(--panel); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.pos .net { font-size: 19px; }

/* ---------- channels ---------- */
.chan { background: var(--panel); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.chan h3 { font-size: 17px; }
.chan .stats { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 99px; padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"].auto { background: var(--brass); color: var(--brass-ink); font-weight: 600; }
.seg button[aria-pressed="true"].watch { background: var(--watch); color: #191433; font-weight: 600; }
.warn { color: var(--loss); font-size: 13px; }

/* ---------- forms ---------- */
.form-group { background: var(--panel); border-radius: var(--radius-lg); padding: 6px 16px; margin-bottom: 12px; }
.form-group > summary { cursor: pointer; padding: 12px 0; font-family: var(--display); font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; }
.form-group > summary::after { content: "+"; color: var(--muted); }
.form-group[open] > summary::after { content: "–"; }
.field { display: grid; grid-template-columns: 1fr minmax(140px, 220px); gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.field label { font-weight: 500; }
.field .help { grid-column: 1 / -1; font-size: 13px; color: var(--muted); max-width: 70ch; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
}
.field textarea { min-height: 76px; resize: vertical; }
.field.inherit select, .field.inherit input { border-style: dashed; }
.savebar {
  position: sticky; bottom: 76px; display: flex; justify-content: flex-end; gap: 10px; align-items: center;
  padding: 10px 0; background: linear-gradient(transparent, var(--bg) 35%);
}
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 500;
  font-size: 14px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; width: min(480px, calc(100vw - 32px)); max-height: 70vh; }
dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.pick { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 4px; cursor: pointer; }
.pick small { color: var(--muted); }

/* ---------- manual mode ---------- */
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-size: 11px; line-height: 18px; text-align: center;
  background: var(--brass); color: var(--brass-ink); font-weight: 700;
}
.tabs a { position: relative; }
.tabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
.sidebar .badge { margin-left: auto; }
.approvals { margin-bottom: 18px; }
.approvals h2 { font-size: 18px; margin: 0 0 8px; }
.approve-card {
  background: var(--panel); border-radius: var(--radius); padding: 12px 14px 14px; margin-bottom: 8px;
  border: 1px solid var(--brass);
}
.approve-card .reason { color: var(--text); }
.o-approval { color: var(--brass); } .o-rejected, .o-expired { color: var(--muted); }
.ev-approval, .ev-manual { color: var(--brass); } .ev-cancel { color: var(--muted); }
.seg button[aria-pressed="true"].manual { background: var(--text); color: var(--bg); font-weight: 600; }
.modes { display: grid; gap: 8px; margin: 0 0 16px; }
.modes > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 14px; }
.modes dt { font-weight: 600; }
.modes dd { margin: 0; color: var(--muted); max-width: 70ch; }
.m-watch { color: var(--watch); } .m-manual { color: var(--text); } .m-auto { color: var(--brass); }

/* onboarding */
.onboarding ol { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.onboarding li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.onboarding li:first-child { border-top: 0; }
.onboarding li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; color: var(--muted);
}
.onboarding li.done::before { content: "✓"; background: var(--win); border-color: var(--win); color: var(--bg); }
.onboarding li span { color: var(--muted); font-size: 14px; }
.onboarding li.done b { color: var(--muted); text-decoration: line-through; }

/* explanations */
.rec { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 99px; background: var(--panel-2); color: var(--text); font-size: 12.5px; white-space: nowrap; }
.more { grid-column: 1 / -1; font-size: 13.5px; }
.more summary { cursor: pointer; color: var(--brass); width: fit-content; }
.more p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; line-height: 1.55; }
.form-group .intro { margin: -4px 0 8px; color: var(--muted); font-size: 14px; max-width: 70ch; }
.glossary dl { margin: 0 0 10px; display: grid; gap: 0; }
.glossary dl > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) {
  .glossary dl > div, .modes > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .chan { grid-template-columns: minmax(0, 1fr); }
  .chan .seg { justify-self: start; }
}

/* accounts */
.acc-switch {
  background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 13px;
  max-width: 170px;
}
.acc-card.current { border: 1px solid var(--brass); }
.plan-line { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.tabs { grid-template-columns: repeat(7, 1fr); }
.tabs a { font-size: 10px; }

/* channel statistics */
.wr { font-family: var(--display); font-weight: 700; font-size: 20px; margin-right: 6px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.tiles > div { background: var(--panel-2); padding: 10px 12px; }
.tiles small { display: block; color: var(--muted); font-size: 12.5px; }
.tiles b { font-family: var(--display); font-size: 19px; font-weight: 600; }
.sub-h { font-size: 15px; margin: 16px 0 8px; }
.tpbar { display: grid; grid-template-columns: 38px 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; margin: 5px 0; }
.tpbar > div { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.tpbar i { display: block; height: 100%; background: var(--win); border-radius: 99px; }
.tpbar b { text-align: right; font-weight: 600; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.progress-line { color: var(--brass); font-size: 14px; margin-top: 4px; }

/* Telegram connection */
.tg-form { display: flex; gap: 8px; flex-wrap: wrap; }
.tg-form input {
  flex: 1 1 200px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px;
}

.qr-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qr-wrap img { border-radius: 12px; background: #fff; }
.qr-wait { width: 220px; height: 220px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-2); color: var(--muted); }
.keys-steps { margin: 0; padding-left: 20px; font-size: 14px; max-width: 46ch; }
.keys-steps li { margin: 4px 0; }
.keys-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-top: 12px; }
.keys-form input { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; min-width: 0; }
@media (max-width: 640px) { .keys-form { grid-template-columns: minmax(0, 1fr); } }

dialog.ask p { margin: 0 0 6px; line-height: 1.55; }
dialog.ask input { display: block; width: 100%; margin: 4px 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }

/* Telegram group picker */
dialog.picker { padding: 0; width: min(520px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 40px)); display: flex; flex-direction: column; }
dialog.picker:not([open]) { display: none; }
.picker-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.picker-head h2 { font-size: 18px; margin-bottom: 10px; }
.picker-head input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.picker-list { overflow-y: auto; padding: 6px 8px; flex: 1; min-height: 120px; }
.picker-list > p { padding: 16px 8px; margin: 0; }
.picker-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.picker-row:hover { background: var(--panel-2); }
.picker-row[aria-selected="true"] { background: color-mix(in srgb, var(--brass) 16%, transparent); }
.picker-row.taken { opacity: 0.55; cursor: default; }
.picker-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-weight: 600; color: var(--brass); }
.picker-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-name small { display: block; color: var(--muted); font-size: 12.5px; }
.picker-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); }
.picker-row[aria-selected="true"] .picker-check { background: var(--brass); border-color: var(--brass); box-shadow: inset 0 0 0 3px var(--panel); }
.picker-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.picker-foot [data-count] { margin-right: auto; font-size: 13.5px; }

.public-url { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 14px; word-break: break-all; user-select: all; }

/* login */
.login label { display: block; margin-top: 12px; }
.login input { margin: 4px 0 6px; }
.login .btn.primary { margin-top: 10px; }
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.login h1 { font-size: 32px; margin-bottom: 4px; }
.login input { width: 100%; margin: 16px 0 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; position: sticky; top: 0; height: 100dvh;
    border-right: 1px solid var(--line);
  }
  .sidebar .brand { margin: 0 10px 22px; font-size: 22px; line-height: 1.05; }
  .sidebar .brand span { display: block; }      /* two lines: the name is wider than the sidebar */
  .sidebar a.nav { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); }
  .sidebar a.nav svg { width: 20px; height: 20px; }
  .sidebar a.nav[aria-current="page"] { background: var(--panel); color: var(--text); }
  .sidebar a.nav[aria-current="page"] svg { color: var(--brass); }
  .sidebar .foot { margin-top: auto; font-size: 12.5px; color: var(--muted); padding: 0 10px; }
  .tabs, .topbar .brand { display: none; }
  .topbar { justify-content: flex-end; padding-top: 20px; }
  main { padding: 0 32px 40px; }
  .savebar { bottom: 0; }
  .toast { bottom: 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sig, .chip, .btn { transition: border-color .15s, background-color .15s; }
  .toast { animation: toast-in .2s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
}

/* groups shared between users, copy from another account */
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(127,127,127,.18); }
.share-users { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; }
.share-users label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.share-users input { width: auto; }
.theme-seg { justify-self: start; display: inline-flex; }
.theme-seg button[aria-pressed="true"] { background: var(--brass); color: var(--brass-ink); font-weight: 600; }

/* ---------- depth: cards float above a lit background ---------- */
:root {
  --depth: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 14px 34px -16px rgba(0, 0, 0, .65), 0 3px 8px -3px rgba(0, 0, 0, .45);
  --depth-hi: 0 1px 0 rgba(255, 255, 255, .09) inset, 0 26px 50px -18px rgba(0, 0, 0, .75), 0 6px 14px -6px rgba(0, 0, 0, .5);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 45%);
  --glow-a: rgba(224, 179, 84, .13); --glow-b: rgba(88, 207, 160, .09);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --depth: 0 1px 0 #fff inset, 0 12px 26px -16px rgba(14, 38, 41, .28), 0 2px 6px -2px rgba(14, 38, 41, .12);
    --depth-hi: 0 1px 0 #fff inset, 0 24px 44px -18px rgba(14, 38, 41, .35), 0 6px 12px -6px rgba(14, 38, 41, .16);
    --sheen: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 50%);
    --glow-a: rgba(154, 107, 12, .10); --glow-b: rgba(26, 138, 91, .08);
  }
}
:root[data-theme="light"] {
  --depth: 0 1px 0 #fff inset, 0 12px 26px -16px rgba(14, 38, 41, .28), 0 2px 6px -2px rgba(14, 38, 41, .12);
  --depth-hi: 0 1px 0 #fff inset, 0 24px 44px -18px rgba(14, 38, 41, .35), 0 6px 12px -6px rgba(14, 38, 41, .16);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 50%);
  --glow-a: rgba(154, 107, 12, .10); --glow-b: rgba(26, 138, 91, .08);
}
body {
  background:
    radial-gradient(900px 520px at 8% -8%, var(--glow-a), transparent 65%),
    radial-gradient(800px 480px at 105% 12%, var(--glow-b), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}
.panel, .chan, .pos, .sig, .form-group, .approve-card, .account, dialog {
  background-image: var(--sheen); box-shadow: var(--depth);
}
.sig, .chan, .pos { transition: transform .18s ease, box-shadow .18s ease; }
@media (hover: hover) {
  .sig:hover, .chan:hover, .pos:hover { transform: translateY(-2px); box-shadow: var(--depth-hi); }
}
.btn { box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 0 rgba(0, 0, 0, .22); transition: transform .1s ease, box-shadow .1s ease; }
.btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brass) 80%, #fff), var(--brass));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 3px 0 color-mix(in srgb, var(--brass) 55%, #000), 0 10px 20px -10px var(--brass);
}
.btn.primary:active { box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 1px 0 color-mix(in srgb, var(--brass) 55%, #000); }
.brand { text-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .25); }
.brand span { background: linear-gradient(180deg, color-mix(in srgb, var(--brass) 70%, #fff), var(--brass)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- KPI page ---------- */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease, box-shadow .25s ease; transform-style: preserve-3d; will-change: transform;
}
.tilt:hover { box-shadow: var(--depth-hi); }
.tilt::after {        /* light that follows the pointer */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(360px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .09), transparent 60%);
}
.tilt:hover::after { opacity: 1; }
.kpi-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-big {
  position: relative; background: var(--panel); background-image: var(--sheen); box-shadow: var(--depth);
  border-radius: var(--radius-lg); padding: 16px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.kpi-big small { display: block; color: var(--muted); font-size: 12.5px; }
.kpi-big b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.15; display: block; margin: 2px 0; }
.kpi-big .sub { font-size: 12.5px; color: var(--muted); }
.ring-tile { display: flex; gap: 12px; align-items: center; }
.ring {
  --c: var(--muted); flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--c) 16%, transparent) 0);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}
.ring.good { --c: var(--win); } .ring.bad { --c: var(--loss); }
.ring span {
  width: 74%; height: 74%; border-radius: 50%; display: grid; place-items: center; background: var(--panel);
  font: 700 13px var(--display); box-shadow: 0 2px 6px rgba(0, 0, 0, .35) inset;
}
.ring.lg { width: 68px; height: 68px; } .ring.lg span { font-size: 15px; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; margin: 6px 0 20px; perspective: 900px; }
.podium .who { text-align: center; padding: 0 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.podium .who b { font-family: var(--display); font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .who small { color: var(--muted); font-size: 12px; }
.podium .who > span:last-child { font: 700 15px var(--display); }
.podium .medal { font-size: 26px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.podium .block {
  border-radius: 12px 12px 4px 4px; display: grid; place-items: center; transform: rotateX(14deg); transform-origin: bottom;
  font: 800 30px var(--display); color: rgba(255, 255, 255, .85); text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 -8px 0 rgba(0, 0, 0, .12) inset, 0 18px 30px -14px rgba(0, 0, 0, .7);
}
.podium .s1 .block { height: 110px; background: linear-gradient(180deg, #f3cf7a, #b8862a); }
.podium .s2 .block { height: 80px; background: linear-gradient(180deg, #c9d6d4, #7f9592); }
.podium .s3 .block { height: 60px; background: linear-gradient(180deg, #e0a47a, #9a5d34); }

.kpi-acc { margin: 22px 0 6px; }
.kpi-acc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kpi-acc-head h2 { font-size: 21px; }
.kpi-acc-net { margin-left: auto; font: 700 18px var(--display); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.kcard {
  position: relative; text-align: left; cursor: pointer; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--panel); background-image: var(--sheen); box-shadow: var(--depth); border-radius: var(--radius-lg);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; color: var(--text);
}
.kc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kc-top h3 { font-size: 16px; margin-bottom: 4px; overflow-wrap: anywhere; }
.mode-badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.mode-badge.m-auto { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, transparent); }
.mode-badge.m-manual { color: var(--text); }
.mode-badge.m-watch { color: var(--watch); border-color: color-mix(in srgb, var(--watch) 40%, transparent); }
.kc-net { font: 700 24px var(--display); }
.netbar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--win) 12%, transparent); overflow: hidden; }
.netbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--win) 60%, transparent), var(--win)); box-shadow: 0 0 12px var(--win); }
.netbar.neg { background: color-mix(in srgb, var(--loss) 12%, transparent); }
.netbar.neg i { background: linear-gradient(90deg, color-mix(in srgb, var(--loss) 60%, transparent), var(--loss)); box-shadow: 0 0 12px var(--loss); }
.kc-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.kc-row b { color: var(--text); }
.kc-row b.win { color: var(--win); } .kc-row b.loss { color: var(--loss); }
.kc-tps { display: flex; gap: 6px; align-items: flex-end; height: 52px; margin-top: 2px; }
.kc-tps > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.kc-tps i { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--brass), color-mix(in srgb, var(--brass) 45%, transparent)); box-shadow: 0 4px 10px -4px var(--brass); }
.kc-tps span { font-size: 10.5px; color: var(--muted); }
@media (max-width: 760px) { .kpi-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-big b { font-size: 22px; } }
@media (max-width: 420px) { .podium .block { font-size: 22px; } .podium .s1 .block { height: 86px; } .podium .s2 .block { height: 62px; } .podium .s3 .block { height: 46px; } }
@media (prefers-reduced-motion: reduce) {
  .tilt, .sig, .chan, .pos, .btn { transition: none; transform: none !important; }
  .podium .block { transform: none; }
}
.podium .vacant { opacity: .28; }

/* why a signal entered like it did */
.why-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.why-list li { padding: 8px 10px 8px 12px; border-left: 3px solid var(--brass); background: var(--panel-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.why-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.why-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 4px 2px 9px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); }
.why-chip small { font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.why-chip.own { border-color: color-mix(in srgb, var(--brass) 55%, transparent); }
.why-chip.own small { background: var(--brass); color: var(--brass-ink); font-weight: 600; }
p .why-chip { padding: 0 2px; vertical-align: middle; }
@media (max-width: 520px) { .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
