/* RETEST desk - design system + single-pane desk layout.
   Shared by the mockups (desk/mockups) and the live app (desk/web). Dark only: it's a trading desk.
   Strategy colors match the user's TradingView chart (vwap_trend_retest_strategy.pine). */

:root {
  color-scheme: dark;
  /* surfaces */
  --bg: #06080c;
  --panel: #0c1016;
  --panel-2: #10151d;
  --panel-3: #161c26;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  /* ink (all text tokens clear 4.5:1 on --panel) */
  --ink: #e9edf3;
  --ink-2: #a3adbb;
  --ink-3: #7d899b;
  --ink-4: #566173;          /* decorative / disabled only */
  /* strategy semantics (TradingView chart colors) */
  --up: #00e676;             /* rising VWAP, long */
  --down: #ff5252;           /* falling VWAP, short */
  --flat: #787b86;
  --far: #5d606b;            /* candles far from the VWAP */
  --vwap: #ffd600;           /* at-VWAP candles, brand accent */
  --trail: #ff9800;
  --info: #4c9bff;
  --up-ink: #3ddc84;
  --down-ink: #ff6b6b;
  --up-bg: rgba(0, 230, 118, 0.1);
  --down-bg: rgba(255, 82, 82, 0.1);
  --vwap-bg: rgba(255, 214, 0, 0.1);
  --trail-bg: rgba(255, 152, 0, 0.12);
  --info-bg: rgba(76, 155, 255, 0.12);
  --on-vwap: #1a1500;
  /* type */
  --ui: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* shape */
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 50px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 400 13px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 214, 0, 0.28); }
:focus-visible { outline: 2px solid var(--vwap); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: #232b37 transparent; }

/* ---------- utilities ---------- */
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.up { color: var(--up-ink); }
.down { color: var(--down-ink); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.eyebrow { font: 600 10.5px/1 var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font: 650 15px/1 var(--ui); letter-spacing: 0.22em; }
.brand small { font: 500 11px/1 var(--ui); color: var(--ink-3); letter-spacing: 0.04em; margin-left: 2px; }

/* ---------- chips, pills, badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2);
  font: 500 12px/1 var(--ui); color: var(--ink-2); white-space: nowrap;
}
.chip strong { color: var(--ink); font-weight: 600; }
.chip .mono { font-size: 11.5px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px;
  font: 650 10.5px/1 var(--ui); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  background: var(--panel-3); color: var(--ink-2);
}
.badge.long, .badge.up { background: var(--up-bg); color: var(--up-ink); }
.badge.short, .badge.down { background: var(--down-bg); color: var(--down-ink); }
.badge.vwap { background: var(--vwap-bg); color: var(--vwap); }
.badge.trail { background: var(--trail-bg); color: var(--trail); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge svg { width: 10px; height: 10px; }
.tag-sample {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px;
  border: 1px dashed rgba(255, 214, 0, 0.45); color: var(--vwap);
  font: 600 9.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flat); flex: none; }
.dot.live { background: var(--up); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5); animation: pulse 2.4s var(--ease) infinite; }
.dot.warn { background: var(--trail); }
.dot.off { background: var(--down); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(0, 230, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font: 600 13.5px/1 var(--ui); letter-spacing: 0.01em; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--vwap); color: var(--on-vwap); box-shadow: 0 6px 24px rgba(255, 214, 0, 0.18); }
.btn-primary:hover { background: #ffe03d; box-shadow: 0 8px 30px rgba(255, 214, 0, 0.28); }
.btn-ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--panel-3); border-color: var(--line-3); }
.btn-danger { background: var(--down-bg); border-color: rgba(255, 82, 82, 0.35); color: var(--down-ink); }
.btn-danger:hover { background: rgba(255, 82, 82, 0.18); }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  font: 600 11px/1 var(--ui); color: var(--ink-3); letter-spacing: 0.03em;
}
.seg button:hover { color: var(--ink); }
.seg .seg-lbl { align-self: center; padding: 0 6px 0 5px; font: 600 9.5px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2) inset; }

/* ---------- cards ---------- */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0) 120px), var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0;
}
.card-hd { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 12px 16px 0; }
.card-hd h2, .card-hd h3 { margin: 0; font: 600 11px/1 var(--ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.card-hd .meta { margin-left: auto; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.card-bd { padding: 12px 16px 16px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--panel); padding: 11px 12px; min-width: 0; }
.stat .k { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.stat .v { margin-top: 4px; font: 600 18px/1.15 var(--ui); letter-spacing: -0.01em; white-space: nowrap; }
.stat .d { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* hero figure: one per view, proportional figures, same sans */
.hero-num { font: 650 50px/1 var(--ui); letter-spacing: -0.03em; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font: 600 10.5px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  padding: 0 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; }
.tbl th.n { font-family: var(--ui); }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.tbl tr.flash td { animation: rowIn 1.6s var(--ease); }
@keyframes rowIn { from { background: rgba(255, 214, 0, 0.12); } to { background: transparent; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.input {
  height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.input::placeholder { color: var(--ink-4); }
.input:focus { border-color: rgba(255, 214, 0, 0.55); box-shadow: 0 0 0 4px rgba(255, 214, 0, 0.1); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; cursor: pointer; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--vwap); flex: none; }
.hint { font-size: 11.5px; color: var(--ink-3); }

/* ---------- feed (desk timeline) ---------- */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed li { display: grid; grid-template-columns: 62px 14px 1fr; gap: 10px; align-items: start; padding: 7px 0; }
.feed li + li { border-top: 1px solid var(--line); }
.feed time { font: 500 11.5px/18px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed .ic { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; background: var(--flat); }
.feed .ic.signal { background: var(--vwap); }
.feed .ic.fill.long { background: var(--up); }
.feed .ic.fill.short { background: var(--down); }
.feed .ic.stop { background: transparent; box-shadow: 0 0 0 2px var(--down) inset; }
.feed .ic.trail { background: var(--trail); }
.feed .ic.exit.win { background: var(--up); border-radius: 50%; }
.feed .ic.exit.loss { background: var(--down); border-radius: 50%; }
.feed .ic.info { background: var(--info); }
.feed .ic.warn { background: var(--trail); }
.feed .tx { font-size: 12.5px; color: var(--ink); line-height: 18px; }
.feed .tx small { display: block; color: var(--ink-3); font-size: 11.5px; }
.feed li.new { animation: feedIn 0.6s var(--ease); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- meter ---------- */
.meter { position: relative; height: 6px; border-radius: 999px; background: var(--panel-3); }
.meter > i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--up); }

/* =====================================================================
   DESK (single pane)
   ===================================================================== */
.desk {
  min-height: 100vh; display: grid; gap: 10px; padding: 0 12px 12px;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    radial-gradient(900px 380px at 18% -8%, rgba(255, 214, 0, 0.05), transparent 70%),
    radial-gradient(800px 420px at 92% -10%, rgba(76, 155, 255, 0.05), transparent 70%),
    var(--bg);
}
@media (min-width: 1100px) { .desk { height: 100vh; min-height: 720px; } }

/* top bar */
.topbar { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 4px; min-width: 0; }
.topbar .sep { width: 1px; height: 22px; background: var(--line-2); flex: none; }
.topbar .inst { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topbar .inst b { font: 600 14px/1 var(--ui); letter-spacing: 0.01em; white-space: nowrap; }
.topbar .inst span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.clock { font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.clock span { color: var(--ink-3); font-family: var(--ui); font-size: 11px; margin-left: 4px; letter-spacing: 0.06em; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #2b3445, #161c26); border: 1px solid var(--line-2);
  font: 600 12px/1 var(--ui); color: var(--ink);
}
.owner-tools { display: flex; gap: 6px; }

/* session strip */
.sess { position: relative; height: 50px; padding: 8px 14px 0; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); }
.sess .track { position: relative; height: 12px; border-radius: 6px; background: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 6px, transparent 6px 12px), #0a0e13; border: 1px solid var(--line); }
.sess .win { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.045); }
.sess .elapsed { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(255,214,0,0.0), rgba(255,214,0,0.10)); }
.sess .pos { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; min-width: 3px; }
.sess .pos.long { background: var(--up); opacity: 0.85; }
.sess .pos.short { background: var(--down); opacity: 0.85; }
.sess .pos.open { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.45; } }
.sess .notch { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 214, 0, 0.55); }
.sess .now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.sess .ticks { position: relative; height: 24px; }
.sess .tk { position: absolute; top: 6px; transform: translateX(-50%); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.sess .tk b { font: 500 10.5px/1 var(--mono); color: var(--ink-2); margin-right: 4px; font-weight: 500; }
.sess .tk.edge-l { transform: none; }
.sess .tk.edge-r { transform: translateX(-100%); }
.sess .tk.hot b { color: var(--vwap); }

/* three columns, split by job: the desk's narration (left), the market (center), you (right) */
.cols { display: grid; gap: 10px; min-height: 0; grid-template-columns: 300px minmax(0, 1fr) 364px; }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.col > .card { display: flex; flex-direction: column; overflow: hidden; min-height: 0; flex: none; }
.col > .card > * { flex: none; }
.col > .grow { flex: 1 1 0; }
.col > .card > .card-bd.scroll { flex: 1 1 auto; overflow: auto; min-height: 0; }
.col > .read-card > .card-bd { flex: 1 1 auto; overflow: auto; min-height: 0; }
.col > .chart-card > .chart-wrap { flex: 1 1 auto; min-height: 0; }
.col > .acct-card > .ac-list { flex: 1 1 auto; overflow: auto; min-height: 0; }
.today-card { height: clamp(220px, 29vh, 320px); }
.chart-hd .legend { display: none; }
/* performance in the narrow left column: two tiles a row, a short curve */
.col-left .card-hd .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-left .card-hd .meta > span { overflow: hidden; text-overflow: ellipsis; }
.col-left .perf .stats { --cols: 2 !important; }
.col-left .perf .stat { padding: 8px 11px; }
.col-left .perf .stat .v { font-size: 16px; }
.col-left .perf .stat .d { display: none; }
.col-left .perf > .eq-wrap { height: 84px; }
.col-left .read .ln { grid-template-columns: 80px minmax(0, 1fr); }
.col-left .band-gauge { width: 96px; }
/* a compact position card: the accounts list below it gets the height */
.col-right .pos-card > .card-bd { padding-bottom: 14px; }
.col-right .pos-card .pos-pnl { margin-top: 10px; }
.col-right .pos-card .hero-num { font-size: 42px; }
.col-right .pos-card .levels { margin-top: 10px; }
@media (min-width: 1100px) and (max-width: 1366px) { .cols { grid-template-columns: 272px minmax(0, 1fr) 336px; } }
@media (min-width: 1700px) { .cols { grid-template-columns: 340px minmax(0, 1fr) 400px; } .chart-hd .legend { display: flex; } }
@media (min-width: 1100px) and (max-height: 999px) { .pos-card .ladder { display: none; } }
/* the read: a card on the left, or one line in the chart toolbar when the screen is too short for it */
.read-strip { display: none; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; row-gap: 6px; }
.read-strip .rs-k { font: 600 9.5px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.read-strip .rs-i { display: inline-flex; align-items: center; gap: 6px; }
.read-strip small { font-size: 11.5px; color: var(--ink-3); }
.read-strip .rs-i:empty { display: none; }
@media (min-width: 1100px) and (max-height: 860px) { .acct-card .ac-foot, .col-left .perf > .eq-wrap { display: none; } }
@media (min-width: 1100px) and (max-height: 759px) {
  .read-strip { display: flex; }
  .col-left > .read-card { display: none; }
}

/* chart card */
.chart-card { display: flex; flex-direction: column; min-height: 300px; overflow: hidden; }
.chart-hd { display: flex; align-items: center; gap: 16px; padding: 12px 14px 8px; flex-wrap: wrap; row-gap: 8px; }
.px { display: flex; align-items: baseline; gap: 10px; }
.px b { font: 650 24px/1 var(--ui); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.px .chg { font: 500 12.5px/1 var(--mono); }
.px b.tick-up { animation: tickUp 0.7s var(--ease); }
.px b.tick-down { animation: tickDown 0.7s var(--ease); }
@keyframes tickUp { from { color: var(--up); } }
@keyframes tickDown { from { color: var(--down); } }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv .k { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.kv .v { font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.legend { display: flex; gap: 12px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.box { width: 9px; height: 9px; border-radius: 2px; }
.chart-wrap { position: relative; flex: 1; min-height: 0; }
.chart { position: absolute; inset: 0 4px 4px 4px; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 190px; max-width: 280px; padding: 10px 12px;
  border-radius: 10px; background: rgba(12, 16, 22, 0.94); border: 1px solid var(--line-2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); font-size: 12px; display: none;
}
.chart-tip .t { font: 500 11px/1 var(--mono); color: var(--ink-3); margin-bottom: 8px; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.chart-tip .r span { color: var(--ink-3); }
.chart-tip .r b { font: 500 12px/1.3 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.chart-tip .ev { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink); line-height: 1.4; }
.chart-tip .ev + .ev { margin-top: 4px; padding-top: 4px; }
.chart-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; color: var(--ink-3); pointer-events: none; }
.chart-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

/* position card */
.pos-card { overflow: hidden; }
.pos-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(420px 200px at 85% -20%, var(--glow, transparent), transparent 70%);
}
.pos-card.long { --glow: rgba(0, 230, 118, 0.16); }
.pos-card.short { --glow: rgba(255, 82, 82, 0.16); }
.pos-card.long::before, .pos-card.short::before { opacity: 1; }
.pos-top { display: flex; align-items: center; gap: 10px; }
.pos-side { font: 650 15px/1 var(--ui); letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 8px; }
.pos-side svg { width: 14px; height: 14px; }
.pos-side.long { color: var(--up-ink); }
.pos-side.short { color: var(--down-ink); }
.pos-side.flat { color: var(--ink-2); }
.pos-pnl { margin-top: 12px; display: flex; align-items: flex-end; gap: 12px; }
.pos-pnl .hero-num.up { color: var(--up-ink); }
.pos-pnl .hero-num.down { color: var(--down-ink); }
.pos-size { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.pos-sub { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); min-height: 18px; }
.pos-sub b { color: var(--ink); font-weight: 600; }
.levels { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; }
.levels > div { background: var(--panel-2); padding: 8px 11px; }
.levels .k { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.levels .k i { width: 10px; height: 2px; border-radius: 2px; display: inline-block; }
.levels .v { margin-top: 4px; font: 500 13px/1 var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.levels .v s { color: var(--ink-4); text-decoration-thickness: 1px; }
.ladder { margin-top: 14px; }
.ladder .bar { position: relative; height: 26px; }
.ladder .rail-line { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--panel-3); border-radius: 2px; }
.ladder .seg-risk { position: absolute; top: 12px; height: 2px; background: linear-gradient(90deg, var(--down), rgba(255,82,82,0.2)); }
.ladder .seg-gain { position: absolute; top: 12px; height: 2px; background: linear-gradient(90deg, rgba(0,230,118,0.2), var(--up)); }
.ladder .mk { position: absolute; top: 6px; width: 2px; height: 14px; margin-left: -1px; border-radius: 2px; }
.ladder .mk.now { top: 4px; width: 12px; height: 18px; margin-left: -6px; border-radius: 4px; background: var(--ink); box-shadow: 0 0 0 3px var(--panel), 0 0 14px rgba(255,255,255,0.35); transition: left 0.5s var(--ease); }
.ladder .lbls { position: relative; height: 16px; font: 500 10.5px/1 var(--mono); color: var(--ink-3); }
.ladder .lbls span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
/* your accounts: every broker account the member's follower app sees, each with an on/off switch */
.acct-card { container: acc / inline-size; --ac-cols: 54px minmax(0, 1fr) 132px 76px 108px; }
.acct-card[hidden] { display: none !important; }
.acct-card .card-hd .meta { gap: 10px; white-space: nowrap; }
.ac-count b { color: var(--ink); font-weight: 650; }
.ac-app { display: inline-flex; align-items: center; gap: 6px; }
.ac-app .dot { width: 7px; height: 7px; }
.ac-att { display: inline-flex; align-items: center; gap: 6px; color: var(--trail); }
.ac-att::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--trail); }
.ac-att.bad { color: var(--down-ink); }
.ac-att.bad::before { background: var(--down); }
.ac-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 16px 4px; }
.ac-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "sw lbl pos" "sw meta eq" ". note note";
  column-gap: 12px; row-gap: 0; align-items: center; padding: 7px 0;
}
.ac-row > .ac-meta, .ac-row > .ac-eq { margin-top: 4px; }
.ac-row + .ac-row { border-top: 1px solid var(--line); }
.ac-lbl { grid-area: lbl; display: flex; min-width: 0; font: 550 12.5px/1.25 var(--mono); color: var(--ink); cursor: default; }
.ac-lbl .h { flex: 0 1 auto; min-width: 2ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-lbl .t { flex: none; white-space: nowrap; }
.ac-meta { grid-area: meta; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ac-brk { min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-pos { grid-area: pos; justify-self: end; font: 600 12.5px/1.25 var(--mono); color: var(--ink-3); white-space: nowrap; }
.ac-pos.up { color: var(--up-ink); }
.ac-pos.down { color: var(--down-ink); }
.ac-eq { grid-area: eq; justify-self: end; font: 500 11.5px/1.25 var(--mono); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-eq.none { font-family: var(--ui); color: var(--ink-3); }
.ac-note { grid-area: note; margin-top: 4px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.ac-row.t-warn .ac-note { color: #ffc078; }
.ac-row.t-bad .ac-note { color: var(--down-ink); }
.ac-row.is-off .ac-lbl { color: var(--ink-2); }
.ac-row.is-off .ac-eq { color: var(--ink-3); }
.ac-empty { padding: 6px 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.ac-empty a { color: var(--info); }
/* sync chip: dot + words, never colour alone */
.ac-sync {
  display: inline-flex; align-items: center; gap: 6px; height: 18px; padding: 0 7px 0 6px; border-radius: 5px; flex: none;
  font: 650 10.5px/1 var(--ui); letter-spacing: 0.04em; white-space: nowrap; background: var(--panel-3); color: var(--ink-2);
}
.ac-sync i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ac-sync.t-ok { background: var(--up-bg); color: var(--up-ink); }
.ac-sync.t-bad { background: var(--down-bg); color: var(--down-ink); }
.ac-sync.t-warn { background: var(--trail-bg); color: var(--trail); }
.ac-sync.t-idle { background: var(--panel-3); color: var(--ink-3); }
.ac-sync.t-idle i { background: transparent; box-shadow: 0 0 0 1.5px currentColor inset; }
/* the switch: the word, the knob's side and the colour all change. ON = knob right; OFF = knob left */
.ac-sw {
  grid-area: sw; position: relative; width: 54px; height: 26px; padding: 0; flex: none; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line-3); background: #0a0e13; transition: background 0.18s, border-color 0.18s;
}
.ac-sw i {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #4a5463; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); transition: left 0.18s var(--ease), background 0.18s;
}
.ac-sw .ac-sw-t {
  position: absolute; top: 0; bottom: 0; right: 7px; display: flex; align-items: center;
  font: 750 9.5px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.ac-sw:hover { border-color: rgba(255, 255, 255, 0.32); }
.ac-sw:focus-visible { outline: 2px solid var(--vwap); outline-offset: 2px; }
.ac-sw:disabled { opacity: 0.55; cursor: progress; }
.ac-sw[aria-checked="true"] { background: rgba(0, 230, 118, 0.16); border-color: rgba(0, 230, 118, 0.6); }
.ac-sw[aria-checked="true"] i { left: 31px; background: var(--up); box-shadow: 0 0 10px rgba(0, 230, 118, 0.45); }
.ac-sw[aria-checked="true"] .ac-sw-t { right: auto; left: 9px; color: var(--up-ink); }
.ac-cols {
  display: none; grid-template-columns: var(--ac-cols); column-gap: 12px; padding: 0 16px 7px; border-bottom: 1px solid var(--line);
  font: 600 10px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.ac-cols .r { text-align: right; }
.ac-foot { padding: 8px 16px 11px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.ac-foot b { color: var(--ink-2); font-weight: 600; }
/* a wide card (phones turned sideways, tablets): table columns Copy | Account | Sync | Position | Equity */
@container acc (min-width: 620px) {
  .ac-cols { display: grid; }
  .ac-row { grid-template-columns: var(--ac-cols); grid-template-areas: "sw lbl sync pos eq" "sw brk sync pos eq" ". note note note note"; }
  .ac-row > .ac-meta { display: contents; }
  .ac-row > .ac-eq { margin-top: 0; }
  .ac-sync { grid-area: sync; justify-self: start; }
  .ac-brk { grid-area: brk; margin-top: 2px; }
  .ac-pos, .ac-eq { align-self: center; }
  .ac-eq { font-size: 12px; }
}
@container acc (max-width: 310px) { .ac-brk { display: none; } }
.pos-flat-copy { margin-top: 10px; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }

/* strategy read */
.read { display: grid; gap: 0; }
.read .ln { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.read .ln:first-child { border-top: 0; padding-top: 2px; }
.read .k { font-size: 12px; color: var(--ink-3); }
.read .v { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.read .v small { color: var(--ink-3); font-size: 11.5px; }
.strength { display: inline-flex; gap: 3px; }
.strength i { width: 10px; height: 6px; border-radius: 2px; background: var(--panel-3); }
.strength.up i.on { background: var(--up); }
.strength.down i.on { background: var(--down); }
.band-gauge { position: relative; width: 120px; height: 18px; flex: none; }
.band-gauge .z { position: absolute; top: 8px; height: 2px; background: var(--panel-3); left: 0; right: 0; border-radius: 2px; }
.band-gauge .s1 { position: absolute; top: 5px; height: 8px; left: 25%; right: 25%; border-radius: 3px; background: rgba(255,255,255,0.06); }
.band-gauge .mid { position: absolute; top: 3px; height: 12px; width: 2px; left: 50%; margin-left: -1px; background: var(--vwap); border-radius: 2px; }
.band-gauge .p { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--panel); transition: left 0.5s var(--ease); }

/* equity sparkline chart */
.eq-wrap { position: relative; height: 112px; margin: 2px -4px 0; }

/* empty / offline */
.banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r);
  background: var(--trail-bg); border: 1px solid rgba(255, 152, 0, 0.3); color: #ffc078; font-size: 12.5px;
}

/* ---------- responsive ---------- */
/* below 1100px the three columns become one: chart, your position, your accounts, today, the read, feed, results */
@media (max-width: 1099px) {
  .desk { height: auto; }
  .cols { display: flex; flex-direction: column; }
  .col { display: contents; }
  .col > .card, .col > .grow { flex: none; }         /* stacked: every card takes its own height */
  .chart-card { order: 1; height: 460px; flex: none; }
  .pos-card { order: 2; }
  .acct-card { order: 3; }
  .today-card { order: 4; height: auto; }
  .read-card { order: 5; }
  .feed-card { order: 6; }
  .perf { order: 7; }
  .card-bd.scroll { max-height: 320px; overflow: auto; }
  .ac-list { max-height: 420px; overflow: auto; }
  .chart-hd .legend { display: flex; }
  .topbar .inst, .topbar .sep, .topbar .clock, #d-market { display: none; }     /* room for the owner's buttons on tablets */
}
@media (max-width: 720px) {
  .desk { padding: 0 10px 16px; gap: 10px; }
  .topbar { height: 56px; gap: 10px; }
  .topbar .hide-sm { display: none !important; }
  .brand small { display: none; }
  .chart-card { height: 360px; min-height: 0; }
  .chart-hd .legend, .chart-hd .seg-range { display: none; }
  .hero-num { font-size: 46px; }
  .sess { height: auto; padding-bottom: 6px; }
  .sess .tk:not(.keep) { display: none; }
  .read .ln { grid-template-columns: 96px minmax(0, 1fr); }
  .stats { --cols: 2 !important; }
  /* phone: drop the entry-time and how-closed columns so P&L stays on screen */
  #d-trades th:nth-child(2), #d-trades td:nth-child(2), #d-trades th:nth-child(5), #d-trades td:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* owner "View as": a bar that floats over any page, desk included */
.viewas { position: fixed; z-index: 1000; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 8px 8px 16px; border-radius: 14px;
  background: #2a2208; border: 1px solid rgba(255, 214, 0, 0.45); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); font-size: 13px; color: var(--ink); }
.viewas > span { min-width: 0; }
.viewas b { color: #ffe566; }
.viewas form { margin: 0; flex: none; }
.viewas .dot { flex: none; }
.viewas.compact { padding: 5px 5px 5px 12px; gap: 10px; font-size: 12.5px; }
.viewas.compact .viewas-more { display: none; }
.viewas.compact .btn { height: 26px; }
@media (max-width: 640px) { .viewas { left: 16px; right: 16px; transform: none; max-width: none; } .viewas-mail { display: none; } }
