/* ============================================================================
   The real workspace — setup, pairing, connections, review.

   Same palette and parts as the Cockpit and the rooms. Nothing here is red
   because setup is incomplete: an unpaired PC is a step, not an emergency.
   ========================================================================= */

/* ---- the demo example's own mark, beside the Cockpit title -------------- */
.demo-row{ display:flex; align-items:center; gap:8px; margin:3px 0 2px; flex-wrap:wrap; }
.demo-chip{
  display:inline-flex; align-items:center; height:18px; padding:0 7px; border-radius:var(--r1);
  font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
  color:var(--violet); background:var(--violet-50); white-space:nowrap;
}
.demo-exit{
  font-size:12px; font-weight:500; color:var(--blue); background:none; border:0; padding:0; cursor:pointer;
  text-decoration:underline; text-underline-offset:2px; text-decoration-color:color-mix(in srgb, var(--blue) 40%, transparent);
}
.demo-exit:hover{ text-decoration-color:currentColor; }

/* ---- the real Cockpit ---------------------------------------------------- */
.real-work{ display:flex; flex-direction:column; }
.status--real .exec.idle{ border-color:var(--line-3); }
.rw{ display:flex; flex-direction:column; gap:var(--s5); padding:var(--s4) var(--pad-x) var(--s9); max-width:1180px; }
.rw-card{
  background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:22px 24px;
  display:flex; flex-direction:column; align-items:flex-start; gap:8px;
}
.rw-card h2{ font-size:17px; font-weight:600; letter-spacing:-.02em; }
.rw-lead{ font-size:13.5px; color:var(--ink-2); max-width:62ch; line-height:1.5; }
.rw-fine{ display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-4); line-height:1.45; }
.rw-fine svg{ width:13px; height:13px; flex:none; }
.rw-link{ font-size:12.5px; color:var(--blue); }
.rw-link:hover{ text-decoration:underline; }
.rw-err{ font-size:12.5px; color:var(--red); }
.rw-quiet p{ color:var(--ink-4); font-size:13px; }

.rw-setup{ align-items:center; text-align:center; padding:44px 24px 36px; gap:10px; }
.rw-setup h2{ font-size:22px; }
.rw-mark{
  width:44px; height:44px; border-radius:12px; display:grid; place-items:center;
  background:var(--blue-50); color:var(--blue); margin-bottom:4px;
}
.rw-mark svg{ width:22px; height:22px; }
.rw-setup .rw-lead{ font-size:14.5px; }
.rw-pair{ height:38px; padding:0 18px; font-size:14px; margin:8px 0 4px; }
.rw-setup .rw-fine{ justify-content:center; }

.rw-pc{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; width:100%; padding-bottom:10px;
  margin-bottom:4px; border-bottom:1px solid var(--line); }
.rw-pc-name{ display:inline-flex; align-items:center; gap:7px; font-size:13px; }
.rw-pc-name svg{ width:14px; height:14px; color:var(--ink-4); }
.rw-meta{ font-size:12px; color:var(--ink-4); }
.rw-chip{
  display:inline-flex; align-items:center; gap:6px; height:22px; padding:0 9px; border-radius:999px;
  font-size:11.5px; font-weight:600; background:var(--surface-2); color:var(--ink-3); white-space:nowrap;
}
.rw-chip::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--ink-5); }
.rw-chip.ok{ background:var(--green-50); color:var(--green-900); }
.rw-chip.ok::before{ background:var(--green-400); }
.rw-chip.warn{ background:var(--amber-50); color:var(--amber-900); }
.rw-chip.warn::before{ background:var(--amber-400); }
.rw-chip.crit{ background:var(--surface-2); color:var(--ink-2); }
.rw-chip.crit::before{ background:var(--ink-4); }

/* ---- money and boards ---------------------------------------------------- */
.rw-money{ display:flex; flex-wrap:wrap; align-items:stretch; gap:14px 0; padding:2px 0; }
.rw-money .kp{ border-left:1px solid var(--line); }
.rw-money .kp:first-child{ border-left:0; padding-left:0; }
.rw-money.is-stale .v{ color:var(--ink-4); }
.rw-stale-note{ display:inline-flex; align-items:center; gap:6px; margin-left:auto; align-self:center;
  font-size:11.5px; font-weight:600; color:var(--amber-900); background:var(--amber-50); padding:3px 9px; border-radius:999px; }
.rw-stale-note svg{ width:12px; height:12px; }
.rw-board-h{ display:flex; align-items:baseline; gap:10px; margin-bottom:10px; }
.rw-board-h h2{ font-size:14px; font-weight:600; }
.rw-board-h span{ font-size:12px; color:var(--ink-4); }
.rw-firms{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap:12px; }
.rw-firm{ background:var(--surface); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.rw-firm > header{ display:flex; justify-content:space-between; align-items:baseline; padding:10px 14px; border-bottom:1px solid var(--line); }
.rw-firm > header b{ font-size:13.5px; }
.rw-firm > header span{ font-size:11px; color:var(--ink-4); text-transform:uppercase; letter-spacing:.06em; font-weight:600; }
.rw-accts{ list-style:none; margin:0; padding:0; }
.rw-acct{ display:grid; grid-template-columns:22px 1fr auto; grid-template-areas:'q main nums' 'q pos age';
  gap:2px 10px; padding:9px 14px; border-top:1px solid var(--line); align-items:center; }
.rw-acct:first-child{ border-top:0; }
.rw-q{ grid-area:q; font-size:11px; color:var(--ink-4); font-variant-numeric:tabular-nums; align-self:start; padding-top:2px; }
.rw-a-main{ grid-area:main; min-width:0; display:flex; flex-direction:column; }
.rw-a-main b{ font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rw-a-sub{ font-size:11px; color:var(--ink-4); }
.rw-a-nums{ grid-area:nums; display:flex; flex-direction:column; align-items:flex-end; font-size:12.5px; font-weight:600; }
.rw-a-pos{ grid-area:pos; font-size:11.5px; color:var(--ink-3); }
.rw-a-age{ grid-area:age; font-size:11px; color:var(--ink-4); text-align:right; white-space:nowrap; }
.rw-acct.is-stale .rw-a-nums{ color:var(--ink-4); }
.rw-acct.is-stale .rw-a-age{ color:var(--amber-900); }
.rw-empty{ max-width:640px; }

/* ---- pairing dialog -------------------------------------------------------- */
.pair-body{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:26px 22px; }
.pair-k{ font-size:13px; color:var(--ink-3); }
.pair-code{
  font-size:44px; font-weight:600; letter-spacing:.14em; line-height:1; color:var(--ink);
  padding:14px 22px 14px calc(22px + .14em); border:1px solid var(--line-2); border-radius:12px; background:var(--surface-2);
  font-variant-numeric:tabular-nums; user-select:all;
}
.pair-exp{ font-size:12.5px; color:var(--ink-3); }
.pair-exp.soon{ color:var(--amber-900); }
.pair-wait{ display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-4); margin-top:4px; }
.pair-wait .pulse{ width:7px; height:7px; border-radius:50%; background:var(--blue-400); animation:beat 1.6s var(--ease) infinite; }
@media (prefers-reduced-motion:reduce){ .pair-wait .pulse{ animation:none } }
.pair-err{ display:flex; flex-direction:column; align-items:center; gap:12px; font-size:13px; color:var(--ink-2); }
.pair-done{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.pair-done h3{ font-size:17px; font-weight:600; }
.pair-ok svg{ width:30px; height:30px; color:var(--green); }
.dialog-foot .spread svg{ display:inline-block; width:12px; height:12px; vertical-align:-1px; margin-right:3px; }

/* ---- Settings → Connections ------------------------------------------------- */
.conn-card{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:18px 20px;
  display:flex; flex-direction:column; gap:12px; margin-bottom:14px; max-width:820px; }
.conn-card > header{ display:flex; align-items:center; gap:10px; }
.conn-card > header h3{ font-size:15px; font-weight:600; }
.conn-card > p{ font-size:13px; color:var(--ink-2); }
.conn-card > .btn{ align-self:flex-start; }
.conn-facts{ display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:10px 18px; margin:0; }
.conn-facts dt{ font-size:10px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-4); font-weight:600; }
.conn-facts dd{ margin:2px 0 0; font-size:13px; font-weight:500; color:var(--ink); }
.conn-table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.conn-table th{ text-align:left; font-size:10px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-4); font-weight:600; padding:6px 8px 6px 0; border-bottom:1px solid var(--line); }
.conn-table td{ padding:7px 8px 7px 0; border-bottom:1px solid var(--line); }
.conn-table .sig{ display:inline-block; width:6px; height:6px; margin-right:6px; vertical-align:1px; }
.sig.ok{ background:var(--green-400); }
.sig.warn{ background:var(--amber-400); }
.conn-acts{ display:flex; gap:8px; flex-wrap:wrap; }
.conn-another{ margin-bottom:18px; }
.conn-trouble{ display:flex; flex-direction:column; gap:8px; max-width:820px; margin-bottom:18px; }
.conn-tr{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; font-size:12.5px; padding:10px 12px;
  background:var(--amber-50); border-radius:8px; color:var(--ink-2); }
.conn-tr .sig{ align-self:center; }
.conn-events{ max-width:820px; }
.conn-events h3{ font-size:12px; font-weight:600; color:var(--ink-3); margin-bottom:6px; }
.conn-events ul{ list-style:none; margin:0; padding:0; }
.conn-events li{ display:flex; justify-content:space-between; gap:12px; font-size:12.5px; padding:6px 0; border-bottom:1px solid var(--line); color:var(--ink-2); }
.conn-events time{ color:var(--ink-4); font-variant-numeric:tabular-nums; white-space:nowrap; }

/* ---- account review ----------------------------------------------------------- */
.rv-table{ display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:hidden; max-width:1000px; }
.rv-row{ display:grid; grid-template-columns:minmax(150px, 1.3fr) minmax(150px, 1.2fr) minmax(120px, .8fr) 64px minmax(120px, .8fr);
  gap:12px; align-items:start; padding:12px 16px; border-top:1px solid var(--line); }
.rv-row:first-child{ border-top:0; }
.rv-head{ background:var(--surface-2); padding:8px 16px; }
.rv-head span{ font-size:10px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-4); font-weight:600; }
.rv-acct{ display:flex; flex-direction:column; min-width:0; }
.rv-acct b{ font-size:13px; overflow-wrap:anywhere; }
.rv-acct span{ font-size:11.5px; color:var(--ink-4); }
.rv-firm, .rv-type{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.rv-row .inp{ width:100%; height:32px; }
.rv-sug{ font-size:11px; color:var(--violet); }
.rv-inc{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-2); padding-top:7px; cursor:pointer; }
.rv-inc input{ width:16px; height:16px; accent-color:var(--blue); }
.rv-inc input:disabled + span{ color:var(--ink-4); }
.rv-foot{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:14px; max-width:1000px; }
.rv-foot .rw-fine{ margin-right:auto; }

/* ---- Help → Connect TradeSeq ------------------------------------------------------ */
.connect-steps{ list-style:none; margin:0 0 var(--s5); padding:0; display:flex; flex-direction:column; gap:10px; max-width:760px; }
.connect-steps li{ display:flex; gap:12px; align-items:flex-start; }
.connect-steps .n{ width:24px; height:24px; flex:none; border-radius:50%; display:grid; place-items:center;
  font-size:12px; font-weight:600; background:var(--blue-50); color:var(--blue); }
.connect-steps li div{ display:flex; flex-direction:column; gap:1px; padding-top:2px; }
.connect-steps li b{ font-size:13.5px; font-weight:600; }
.connect-steps li span{ font-size:12.5px; color:var(--ink-3); }
.demo-again{ margin-top:var(--s4); }

/* ---- narrow ---------------------------------------------------------------------- */
@media (max-width:760px){
  .rw-card{ padding:18px 16px; }
  .rw-setup{ padding:32px 16px 28px; }
  .rv-head{ display:none; }
  .rv-row{ grid-template-columns:1fr 1fr; grid-template-areas:'acct acct' 'firm firm' 'type q' 'inc inc'; gap:8px 12px; }
  .rv-acct{ grid-area:acct; } .rv-firm{ grid-area:firm; } .rv-type{ grid-area:type; } .rv-q{ grid-area:q; } .rv-inc{ grid-area:inc; padding-top:0; }
  .rw-money .kp{ flex:1 1 45%; }
  .rw-money .kp:nth-child(3){ border-left:0; padding-left:0; }
  .rw-stale-note{ margin-left:0; }
  .pair-code{ font-size:36px; }
}
@media (max-width:440px){
  .demo-exit{ font-size:11.5px; }
  .rw-acct{ grid-template-columns:18px 1fr auto; padding:9px 12px; }
}

/* a last-known reading never looks like a live one, gains and losses included */
.rw-acct.is-stale .rw-a-nums .num, .rw-money.is-stale .v.num{ color:var(--ink-4); }
