:root {
  --bg-canvas: #0b0f17;
  --bg-surface: #111827;
  --bg-elevated: #172033;
  --bg-row-hover: #1a253b;
  --border-subtle: #243049;
  --border-strong: #334366;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --crimson: #ef4444;
  --crimson-bg: rgba(239, 68, 68, 0.14);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.14);
  --radius-card: 8px;
  --radius-badge: 6px; /* Strict rectangular fintech badge rule (never 999px) */
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ws-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-badge);
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 14px;
  flex-shrink: 0;
}

.ws-brand-title {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.ws-brand-sub {
  font-size: 0.70rem;
  color: var(--text-secondary);
}

.ws-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ws-nav-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-badge);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.ws-nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.ws-nav-btn.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.ws-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-badge);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 180ms ease, color 160ms ease;
}

.ws-icon-btn:hover {
  color: var(--text-primary);
}

.ws-icon-btn.collapsed svg {
  transform: rotate(-90deg);
}

/* Strict 4-Card Collision-Proof Top Subbar (BUG-162 parity) */
.ws-subbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 20px;
  background: #0e1420;
  border-bottom: 1px solid var(--border-subtle);
}

.ws-subbar.hidden {
  display: none;
}

.subbar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  min-width: 0;
  overflow: hidden;
}

.subbar-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subbar-val {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subbar-meta {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.02rem;
  font-weight: 600;
}

.section-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.flt-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-badge);
  padding: 6px 11px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
}

.flt-btn.active,
.flt-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.tier-strip,
.disk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mini-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}

.mini-card-title {
  font-size: 0.69rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.mini-card-val {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 600;
  margin-top: 4px;
}

.mini-card-sub {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Rectangular 6px Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-badge);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.badge-emerald {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-crimson {
  background: var(--crimson-bg);
  color: var(--crimson);
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.badge-cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.32);
}

.badge-slate {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Unified Prophet Fintech Table Typography (0.69 / 0.78 / 0.70rem, 16px edge padding, tabular-nums) */
.card-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.card-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.ft-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.ft-table th {
  font-size: 0.69rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: #0f1624;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.ft-table td {
  font-size: 0.78rem;
  color: var(--text-primary);
  padding: 9px 10px;
  border-bottom: 1px solid rgba(36, 48, 73, 0.65);
  vertical-align: middle;
}

.ft-table th:first-child,
.ft-table td:first-child {
  padding-left: 16px;
}

.ft-table th:last-child,
.ft-table td:last-child {
  padding-right: 16px;
}

.ft-table tbody tr:hover {
  background: var(--bg-row-hover);
}

.ft-table .num {
  text-align: right;
  font-family: var(--font-mono);
}

.cell-sub {
  display: block;
  font-size: 0.70rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.mono {
  font-family: var(--font-mono);
}

.pos {
  color: var(--emerald);
}

.neg {
  color: var(--crimson);
}

@media (max-width: 1080px) {
  .ws-subbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ws-subbar {
    grid-template-columns: 1fr;
  }
  .ws-topbar,
  .ws-main {
    padding-left: 12px;
    padding-right: 12px;
  }
}
