:root {
  /* Black theme: white text, green = profit/TP/buy, red = loss/SL/sell, yellow = actions and highlights */
  --ink: #000000;
  --panel: #0D0D0D;
  --panel-2: #171717;
  --line: #262626;
  --text: #FFFFFF;
  --muted: #9CA3AF;
  --win: #22C55E;
  --win-soft: rgba(34, 197, 94, .15);
  --loss: #EF4444;
  --loss-soft: rgba(239, 68, 68, .15);
  --brass: #FACC15;
  --brass-ink: #000000;
  --focus: #FDE047;
  --radius-s: 6px;
  --radius-m: 10px;
  --ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --num: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.win { color: var(--win); } .loss { color: var(--loss); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--brass); }

/* ---------- buttons & inputs ---------- */
.btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: var(--radius-s); padding: 8px 14px; 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.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--loss); }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], select, textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 11px;
}
textarea { resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.error { color: var(--loss); font-size: 14px; min-height: 1.2em; margin: 4px 0 10px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 14px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--brass); }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 28px; }
.auth-brand h1 { font-family: var(--num); font-size: 40px; font-weight: 600; letter-spacing: -.01em; }
.auth-brand p { margin: 0; color: var(--muted); }
.auth-track { height: 6px; border-radius: 3px; margin: -14px 0 28px; background: linear-gradient(90deg, var(--loss) 0 22%, var(--line) 22% 30%, var(--win) 30% 100%); opacity: .8; }
.auth .seg { margin-bottom: 20px; width: 100%; }
.auth .seg button { flex: 1; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: minmax(0, 1fr); height: 100%; overflow: hidden; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 18px 18px 14px; }
.rail-head .brand { font-family: var(--num); font-weight: 600; font-size: 22px; }
.rail-head .who { color: var(--muted); font-size: 14px; }
.rooms { list-style: none; margin: 0; padding: 6px 8px; overflow: auto; flex: 1; }
.rooms button { width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.rooms button:hover { background: var(--panel-2); }
.rooms button[aria-current="true"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--brass); }
.rooms .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-left: auto; }
.rooms .tag { font-size: 12px; color: var(--muted); margin-left: auto; }
.rooms .dot + .tag { margin-left: 4px; }
.rail-foot { border-top: 1px solid var(--line); padding: 10px 8px; display: grid; gap: 2px; }
.rail-foot button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; color: var(--muted); }
.rail-foot button:hover { background: var(--panel-2); color: var(--text); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.room-head { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.room-head h2 { font-size: 22px; font-weight: 600; }
.room-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.menu-btn { display: none; }
.mobile-tabs { display: none; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); grid-template-rows: minmax(0, 1fr); }
.pane { min-height: 0; display: flex; flex-direction: column; }
.pane + .pane { border-left: 1px solid var(--line); }
.pane-bar { padding: 12px 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pane-body { flex: 1; overflow: auto; padding: 16px 22px 28px; }

/* ---------- signal card with price track ---------- */
.sig { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px 16px; margin-bottom: 12px; }
.sig.fresh { animation: arrive 1.6s ease-out; }
@keyframes arrive { from { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(250, 204, 21, .3); } }
@media (prefers-reduced-motion: reduce) { .sig.fresh { animation: none; } }
.sig-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sym { font-family: var(--num); font-size: 24px; font-weight: 600; letter-spacing: .01em; }
.side { font-family: var(--num); font-weight: 600; font-size: 15px; padding: 1px 8px; border-radius: 4px; }
.side.buy { background: var(--win-soft); color: var(--win); }
.side.sell { background: var(--loss-soft); color: var(--loss); }
.sig-meta { color: var(--muted); font-size: 14px; margin-left: auto; }
.chip { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.chip.running { color: var(--brass); border-color: currentColor; }
.chip.tp { color: var(--win); border-color: currentColor; background: var(--win-soft); }
.chip.sl { color: var(--loss); border-color: currentColor; background: var(--loss-soft); }
.chip.closed, .chip.cancelled { color: var(--muted); }

.track { position: relative; height: 54px; margin: 18px 6px 8px; }
.track-rail { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.track-fill { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: var(--win); }
.track-fill.loss { background: var(--loss); }
.mark { position: absolute; top: 6px; transform: translateX(-50%); display: grid; justify-items: center; gap: 3px; }
.mark i { width: 2px; height: 22px; background: var(--muted); display: block; }
.mark.entry i { background: var(--text); width: 3px; }
.mark.sl i { background: var(--loss); }
.mark.tp i { background: var(--brass); }
.mark.hit i { background: var(--win); }
.mark.hit.sl i { background: var(--loss); }
.mark span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mark.hit span { color: var(--text); font-weight: 600; }
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.levels div { font-size: 13px; color: var(--muted); }
.levels b { display: block; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 16px; color: var(--text); font-weight: 700; }
.levels .hit b { color: var(--win); }
.levels .hit.sl b { color: var(--loss); }
.sig-foot { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.sig-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.pips { font-family: var(--num); font-weight: 600; font-size: 18px; margin-left: auto; }

/* ---------- day records (compact rows, 30-60 trades a day) ---------- */
.day { margin-bottom: 26px; }
.day-head { position: sticky; top: -16px; z-index: 2; background: var(--ink); padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.day-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-title h3 { font-size: 19px; font-weight: 600; }
.day-pips { margin-left: auto; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }
.tally { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.tally b { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; color: var(--text); }
.tally .win b { color: var(--win); } .tally .loss b { color: var(--loss); } .tally .live b { color: var(--brass); }
.day-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.srow { width: 100%; display: grid; grid-template-columns: 50px 92px 46px minmax(0, 1fr) 70px; gap: 8px; align-items: center;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 8px 6px; cursor: pointer; }
.srow:hover { background: var(--panel); }
.srow[aria-expanded="true"] { background: var(--panel); border-bottom-color: transparent; border-radius: var(--radius-m) var(--radius-m) 0 0; }
.srow .t { color: var(--muted); font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.srow .sym2 { font-family: var(--num); font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.srow .sym2 .from-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font: 600 10px/1.5 var(--ui, sans-serif); letter-spacing: .04em; text-transform: uppercase; color: #000; background: var(--yellow, #FACC15); vertical-align: middle; }
.srow .side { font-size: 13px; padding: 0 6px; text-align: center; }
.srow .st { font-weight: 600; font-size: 15px; white-space: nowrap; }
.srow .st small { font-weight: 400; color: var(--muted); font-size: 12px; }
.srow .st.live { color: var(--brass); }
.srow .st.win.live { color: var(--win); }
.srow .pp { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.srow.fresh { animation: rowflash 1.8s ease-out; }
@keyframes rowflash { from { background: rgba(250, 204, 21, .2); } }
@media (prefers-reduced-motion: reduce) { .srow.fresh { animation: none; } }
.sdetail { background: var(--panel); border-bottom: 1px solid var(--line); border-radius: 0 0 var(--radius-m) var(--radius-m); padding: 2px 14px 14px; margin-bottom: 8px; }
.sig-meta2 { font-size: 14px; }
.sdetail .track { margin-top: 12px; }
.events { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; display: grid; gap: 2px; }
.btn.more { margin-top: 4px; }

/* history / stats tables */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td.r, .table th.r { text-align: right; }
.table tr.total td { font-weight: 600; border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.summary { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 16px; }
.summary div { font-size: 14px; color: var(--muted); }
.summary b { display: block; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.1; }

.empty { color: var(--muted); padding: 30px 4px; max-width: 46ch; }

/* ---------- chat ---------- */
.chat-list { flex: 1; overflow: auto; padding: 12px 18px; }
.msg { padding: 6px 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.msg-head b { font-weight: 600; }
.msg-head time { color: var(--muted); font-size: 12px; }
.msg-head .badge { font-size: 11px; font-weight: 600; color: var(--brass); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.msg-body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .del { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; visibility: hidden; }
.msg:hover .del, .msg .del:focus-visible { visibility: visible; }
/* TP hit announcements in chat */
.tpmsg { position: relative; display: flex; flex-direction: column; margin: 8px 0; }
.tpmsg-main { width: 100%; }
.tpmsg-main { flex: 1; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--win-soft); border: 1px solid transparent; border-left: 3px solid var(--win); border-radius: var(--radius-s); padding: 9px 12px; overflow: hidden; position: relative; }
.tpmsg-main:hover { border-color: var(--win); }
.tpmsg.final .tpmsg-main { border-left-color: var(--brass); background: linear-gradient(90deg, rgba(250, 204, 21, .18), var(--win-soft)); }
.tp-badge { font-family: var(--num); font-weight: 600; font-size: 15px; background: var(--win); color: #000; border-radius: 5px; padding: 2px 8px; }
.tpmsg.final .tp-badge { background: var(--brass); color: var(--brass-ink); }
.tp-what { min-width: 0; }
.tp-what b { font-family: var(--num); font-size: 17px; }
.tp-what small { display: block; color: var(--muted); font-size: 12px; }
.tp-pips { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 22px; color: var(--win); }
.tpmsg time { color: var(--muted); font-size: 12px; }
.tpmsg .del { position: absolute; right: 6px; top: -14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; visibility: hidden; }
.tpmsg:hover .del, .tpmsg .del:focus-visible { visibility: visible; }
/* TP3 poll */
.poll { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-s) var(--radius-s); padding: 8px 12px 10px; }
.tpmsg:has(.poll) .tpmsg-main { border-radius: var(--radius-s) var(--radius-s) 0 0; }
.poll p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.poll-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.poll-opt { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--ink); border-radius: var(--radius-s); padding: 7px 10px; cursor: pointer; text-align: left; }
.poll-opt:hover { border-color: var(--muted); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--win-soft); transition: width .3s; }
.poll-opt.missed .poll-bar { background: rgba(255, 255, 255, .1); }
.poll-label, .poll-n { position: relative; }
.poll-label { font-weight: 600; white-space: nowrap; }
.poll-n { font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.poll-opt[aria-pressed="true"] { border-color: var(--win); }
.poll-opt.missed[aria-pressed="true"] { border-color: var(--text); }
@media (prefers-reduced-motion: reduce) { .poll-bar { transition: none; } }

/* the one celebratory moment: a pop and a sweep of light when a TP lands live */
.tpmsg.pop .tp-badge { animation: tppop .7s cubic-bezier(.2, 1.6, .4, 1); }
.tpmsg.pop .tpmsg-main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-100%); animation: tpsweep 1.1s ease-out .15s; pointer-events: none; }
@keyframes tppop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes tpsweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .tpmsg.pop .tp-badge, .tpmsg.pop .tpmsg-main::after { animation: none; } }

.composer { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 8px; }
.composer textarea { min-height: 42px; max-height: 140px; }
.chat-note { color: var(--muted); font-size: 13px; padding: 0 16px 8px; }

/* ---------- dialogs ---------- */
dialog { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: var(--radius-m); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dlg-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 19px; font-weight: 600; }
.dlg-head .x { margin-left: auto; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.dlg-body { padding: 18px 20px; overflow: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }

/* ---------- admin ---------- */
.admin { flex: 1; overflow: auto; padding: 18px 22px 40px; }
.admin section { max-width: 1100px; }
.admin h3 { font-size: 18px; font-weight: 600; margin: 22px 0 10px; }
.room-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); }
.pill[aria-pressed="true"] { border-color: var(--win); color: var(--win); background: var(--win-soft); }
.pill.leader[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); background: transparent; }
.codebox { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.copyrow { display: flex; gap: 8px; align-items: stretch; }
.copyrow .codebox { flex: 1; }
.callout { border-left: 3px solid var(--brass); padding: 8px 12px; background: var(--panel); margin: 10px 0; font-size: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; top: 16px; display: grid; gap: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: var(--radius-s); padding: 10px 14px; min-width: 240px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast.win { border-left-color: var(--win); } .toast.loss { border-left-color: var(--loss); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; }
  .mobile-tabs { display: flex; border-bottom: 1px solid var(--line); }
  .mobile-tabs button { flex: 1; border: 0; background: transparent; padding: 11px; color: var(--muted); cursor: pointer; font-weight: 500; }
  .mobile-tabs button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--brass); }
  .panes[data-show="signals"] .pane.chat { display: none; }
  .panes[data-show="chat"] .pane.signals { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.rail-open .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .7); }
  .menu-btn { display: inline-flex; }
  .room-head { gap: 10px 12px; padding-top: 12px; padding-bottom: 12px; }
  .room-head .grow { flex: 1 1 60%; }
  .room-head h2 { font-size: 20px; }
  .room-head p { display: none; }
  .head-actions { width: 100%; }
  .room-head, .pane-bar, .pane-body, .admin { padding-left: 16px; padding-right: 16px; }
  .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* phone: TP1 TP2 TP3 on the first line, Stop loss and Entry below */
  .levels .lv-t1 { order: 1; } .levels .lv-t2 { order: 2; } .levels .lv-t3 { order: 3; } .levels .lv-sl { order: 4; } .levels .lv-en { order: 5; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .sig-meta { margin-left: 0; width: 100%; }
}
@media (max-width: 760px) {
  .srow { grid-template-columns: 40px 74px 40px minmax(0, 1fr) 52px; gap: 6px; padding: 8px 2px; }
  .srow .sym2 { font-size: 16px; }
  .day-pips { font-size: 19px; }
}
@media (max-width: 420px) {
  .poll-opt { padding: 7px 8px; gap: 4px; font-size: 15px; }
  .poll-opts { gap: 6px; }
}

/* ---------- names, pictures, profile ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; color: #fff; font-weight: 600; background: var(--panel-2); }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.msg .avatar { margin-top: 2px; }
.nm { font-weight: 600; }
.nm.long { color: #fff; padding: 0 7px; border-radius: 4px; }
.nm.support { background: var(--brass); color: #000; padding: 0 7px; border-radius: 4px; }
.rail-head .who { display: flex; align-items: center; gap: 10px; margin-top: 10px; border: 0; background: transparent; padding: 4px 0; cursor: pointer; text-align: left; width: 100%; }
.rail-head .who small { display: block; color: var(--muted); font-size: 12px; }
.rail-head .who .nm { font-size: 15px; }
.pf-top { display: flex; align-items: center; gap: 16px; }
.pf-pic .avatar { width: 76px; height: 76px; }
.pf-preview { font-size: 15px; margin: -6px 0 6px; }
.pf-h { font-size: 16px; margin: 22px 0 10px; }
.subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.subs li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.subs li.past { opacity: .7; }
.sub-name { display: flex; align-items: center; gap: 8px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.plan { font-size: 12px; font-weight: 600; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; }
.plan.long { color: #fff; border-color: transparent; }
.sub-dates { font-size: 14px; color: var(--muted); }
.pill.long[aria-pressed="true"] { font-weight: 600; }
input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--ink); }

/* ---------- locked rooms + preview ---------- */
.rail-scroll { flex: 1; overflow: auto; min-height: 0; }
.rail-scroll .rooms { overflow: visible; flex: none; }
.rooms.locked { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.rooms.locked button { color: var(--muted); }
.lock { margin-left: auto; width: 12px; height: 14px; position: relative; flex: none; }
.lock::before { content: ''; position: absolute; left: 2px; top: 0; width: 8px; height: 8px; border: 2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; }
.lock::after { content: ''; position: absolute; left: 0; bottom: 0; width: 12px; height: 8px; background: currentColor; border-radius: 2px; }
.preview { max-width: 900px; }
.pv-intro { font-size: 17px; max-width: 62ch; margin: 0 0 18px; }
.pv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pv-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: grid; gap: 2px; }
.pv-label { font-weight: 600; }
.pv-sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.pv-pips { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 600; line-height: 1.05; }
.pv-unit { color: var(--muted); font-size: 14px; }
.pv-n { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pv-cta { margin-top: 22px; padding: 16px 18px; border-left: 3px solid var(--brass); background: var(--panel); border-radius: 0 var(--radius-m) var(--radius-m) 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pv-cta p { margin: 0; flex: 1; min-width: 220px; }
@media (max-width: 900px) { .pv-grid { grid-template-columns: 1fr 1fr; } .pv-pips { font-size: 28px; } }

.flag { font-size: 15px; line-height: 1; margin-right: 2px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; accent-color: var(--brass); }

/* ---------- phones first: bottom navigation, sheets, safe areas ---------- */
.bottombar { display: none; }
.menu-btn { display: none !important; }
.install { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--brass); background: var(--panel-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.install p { margin: 4px 0 10px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  #app { height: 100vh; height: 100dvh; }
  .shell { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  body.typing .shell { padding-bottom: 0; }
  body.typing .bottombar { display: none; }
  .bottombar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
  .bottombar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bottombar button[aria-current="true"] { color: var(--brass); }
  .bottombar .ico { width: 24px; height: 24px; display: grid; place-items: center; }
  .bottombar svg { width: 23px; height: 23px; }
  .bottombar .avatar { width: 24px; height: 24px; font-size: 11px; }
  .nav-dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--loss); border: 2px solid var(--panel); }
  .mobile-tabs { display: none !important; }
  .room-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .rail { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); z-index: 45; width: 280px; }
  .rooms button { padding: 12px 10px; font-size: 17px; }
  .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body:not(.typing) .composer { padding-bottom: 10px; }
  .composer textarea { font-size: 16px; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .dlg-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .toasts { top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; }
  .toast { min-width: 0; }
  .btn.small { padding: 7px 12px; }
  .srow { min-height: 46px; }
}

/* ---------- screenshot deterrents ---------- */
.protect { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wm { position: absolute; inset: 0; z-index: 3; pointer-events: none; background-repeat: repeat; background-position: center; border-radius: inherit; }
body.shield .protect > :not(.wm) { filter: blur(16px); transition: filter .1s; }
@media print { body { display: none !important; } }

.nudge { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: var(--radius-s); padding: 10px 12px; margin: 4px 0 14px; font-size: 14px; }
.nudge span { flex: 1; }
.nudge-x { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }

/* ---------- private support chat ---------- */
.count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--loss); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.rail-foot .count { margin-left: 8px; }
.support-pane { flex: 1; min-height: 0; }
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.threads { overflow: auto; border-right: 1px solid var(--line); }
.thread { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 14px; cursor: pointer; }
.thread:hover, .thread[aria-current="true"] { background: var(--panel); }
.thread.unread b { color: var(--brass); }
.th-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.th-top { display: flex; gap: 6px; align-items: baseline; }
.th-top time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.th-last { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { min-height: 0; }
.convo-head { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.convo-head .back { display: none; }
@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-convo .threads { display: none; }
  .inbox:not(.has-convo) .convo { display: none; }
  .threads { border-right: 0; }
  .convo-head .back { display: inline-flex; }
}

.linkbtn { border: 0; background: none; color: var(--brass); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.tag-offers { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--brass); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* support inbox translation */
.tr { margin-top: 4px; padding: 6px 10px; border-left: 2px solid var(--brass); background: var(--panel-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; max-width: 60ch; }
.tr.muted { border-left-color: var(--line); background: transparent; padding: 2px 10px; font-size: 13px; }
.tr-label { display: block; font-size: 12px; color: var(--brass); font-weight: 600; margin-bottom: 2px; }
.tr-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tr-btn { font-size: 13px; margin-top: 2px; }

.plan-cell { min-width: 280px; }
.plan-cell input[type=date] { padding: 7px 8px; color-scheme: dark; }
.exp-note { font-size: 13px; margin-top: 4px; }

/* team */
.staff { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 12px; max-width: 760px; background: var(--panel); }
.staff-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tag-owner { font-size: 12px; font-weight: 600; color: var(--brass); border: 1px solid currentColor; border-radius: 4px; padding: 0 6px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; }
.perm-list .check { margin-bottom: 8px; align-items: flex-start; }
.perm-list .check input { margin-top: 3px; }
.auth-help { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, #222); font-size: 14px; }
.auth-help p { margin: 0 0 10px; color: var(--muted, #9aa); }
.auth-help .row { gap: 8px; flex-wrap: wrap; }
.auth-help a.btn { text-decoration: none; }
/* Track Record */
.record { display: grid; gap: 22px; }
.rec-hero { display: grid; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; }
.rec-hero .pv-pips { font-size: 44px; }
.rec-hero .tally { margin-top: 10px; }
.rec-block h3 { margin: 0 0 10px; }
.rec-bars { display: grid; gap: 6px; }
.rec-bar { display: grid; grid-template-columns: 76px 1fr 84px; align-items: center; gap: 10px; font-size: 14px; }
.rec-m { color: var(--muted); }
.rec-track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.rec-fill { display: block; height: 100%; border-radius: 5px; background: #22C55E; }
.rec-fill.loss { background: #EF4444; }
.rec-v { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.rec-row { cursor: default; }
.table td.win { color: #22C55E; } .table td.loss { color: #EF4444; }
@media (max-width: 700px) { .rec-two { grid-template-columns: 1fr; } .rec-hero .pv-pips { font-size: 38px; } .rec-bar { grid-template-columns: 64px 1fr 72px; } }
.rec-row { grid-template-columns: 104px 120px 46px minmax(0, 1fr) 70px; }
.rec-row .t { white-space: normal; font-size: 13px; }
@media (max-width: 700px) { .rec-row { grid-template-columns: 58px 92px 36px minmax(0, 1fr) 54px; } .rec-row .sym2 { font-size: 15px; } }
.record-seg button, .pane-bar .seg button { white-space: nowrap; }
.import-box { margin: 8px 0 4px; }
.import-list { display: grid; gap: 8px; margin-top: 10px; }
.import-row { gap: 10px; align-items: center; flex-wrap: wrap; }
.import-row .win { color: #22C55E; } .import-row .loss { color: #EF4444; }
.rec-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rec-filter select { width: auto; min-width: 150px; }
.rec-two.one { grid-template-columns: 1fr; max-width: 640px; }
.rec-click { cursor: pointer; }
.rec-click:hover td { background: var(--panel); }
.srow .t.two { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; font-size: 12px; }
.srow .t.two span:last-child { color: var(--text); font-size: 13px; }
