/*
 * Trading desk shell — the outer chrome only. The tab content is each service's own front end,
 * embedded through the gateway with its topbar/statusbar hidden (?embed=1). Terminal-style dark
 * UI, shared with orderbook / risk-engine / trading-system — see the palette in
 * workspace-config/CLAUDE.md -> "Live demo look and feel". The tokens below are copied from
 * orderbook's app.css so the whole family reads as one product.
 */
:root {
  --bg-base: #08090c;
  --bg-1: #0e0f14;
  --bg-2: #14151c;
  --bg-3: #1c1e28;
  --bg-pin: #050608;
  --rule: #1f2230;
  --rule-bright: #2e3244;
  --brand: #14b8a6;
  --brand-glow: rgba(20, 184, 166, 0.3);
  --cyan: #5fc3e7;
  --ink: #e8e8ec;
  --ink-2: #b4b4be;
  --ink-3: #888898;
  --ink-4: #7d7f91;
  --bid: #34d399;
  --ask: #f87171;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums slashed-zero;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- Topbar ----------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  height: 46px;
  background: var(--bg-pin);
  border-bottom: 1px solid var(--rule-bright);
  flex: none;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  white-space: nowrap;
}

.brand .mark {
  color: var(--brand);
  font-size: 13px;
}

.brand .eyebrow {
  color: var(--ink-4);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 2px;
  margin-left: 6px;
}

.tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab .kbd {
  font-size: 10px;
  color: var(--ink-4);
  border: 1px solid var(--rule-bright);
  padding: 0 4px;
  line-height: 14px;
}

.tab:hover {
  color: var(--ink-2);
  background: var(--bg-1);
}

.tab.active {
  color: var(--ink);
  background: var(--bg-2);
  border-color: var(--rule-bright);
  border-bottom-color: var(--brand);
}

.tab.active .kbd {
  color: var(--brand);
  border-color: var(--brand);
}

.tab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--ink-4);
  display: inline-block;
}

.dot.live {
  background: var(--bid);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.dot.down {
  background: var(--ask);
}

/* ---- Workspace (the embedded tabs) ------------------------------------ */
.workspace {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg-base);
}

.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-base);
  display: none;
}

.frame.active {
  display: block;
}

/* ---- Statusbar -------------------------------------------------------- */
.statusbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 26px;
  padding: 0 14px;
  background: var(--bg-pin);
  border-top: 1px solid var(--rule-bright);
  color: var(--ink-4);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  flex: none;
}

.statusbar .grow {
  margin-left: auto;
}

.statusbar .sb-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.statusbar .tagline {
  color: var(--ink-3);
}

.statusbar a {
  color: var(--ink-3);
  text-decoration: none;
}

.statusbar a:hover {
  color: var(--cyan);
}

@media (max-width: 720px) {
  .brand .eyebrow,
  .tab .kbd {
    display: none;
  }
  .topbar {
    gap: 12px;
  }
}
