:root {
  --bg: #050607;
  --panel: #090b0d;
  --panel-2: #0b0f16;
  --line: #1a1f25;
  --line-2: #2c323a;
  --fg: #f4f6f8;
  --muted: #9aa4b2;
  --gold: #ffb000;
  --red: #c10f2e;
  --red-2: #8a0f26;
  --green: #14c784;
  --blue: #1d86d9;
  --amber: #d6a11d;
  --brown-row: #31251d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--fg);
  font-family: "Geist Mono", monospace;
}

body {
  min-height: 100vh;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  background: linear-gradient(180deg, #c91532 0%, #aa102a 100%);
  border-bottom: 1px solid #4d0815;
}

.brand-line {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.logo-img {
  max-width: 160px;
}

.header-meta,
.header-right {
  font-size: 11px;
  color: #ffd8df;
  margin-top: 3px;
}

.command-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(90deg, #111 0%, #07090d 100%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #111;
  color: var(--gold);
  border: 1px solid #4a4a4a;
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px #1b1b1b;
}

.tab-btn.active {
  background: linear-gradient(180deg, #ffbe35 0%, #e19a0b 100%);
  color: #111;
  border-color: #ffca59;
  font-weight: 700;
}

.command-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-shell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #4a4a4a;
  padding: 8px 10px;
  background: #0c0c0c;
  min-width: 420px;
}

.search-label {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.search-shell input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
}

.terminal-btn {
  background: #111;
  color: #ffcc74;
  border: 1px solid #4a4a4a;
  padding: 9px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  text-transform: uppercase;
}

#globalTooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  display: none;
  max-width: 340px;
  padding: 10px 12px;
  background: #121212;
  color: #f6e2b3;
  border: 1px solid #7e6231;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

#globalTooltip.show {
  display: block;
}

.main-shell {
  padding: 14px;
}

.tab-panel {
  display: none;
}

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

.workbench {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sidebar-stack,
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-grid {
  display: grid;
  gap: 14px;
}

.overview-top-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-gap {
  margin-top: 10px;
}

.top-support-grid {
  align-items: stretch;
}

.chart-grid {
  align-items: stretch;
}

.card {
  background: #050607;
  border: 1px solid var(--line);
  padding: 14px;
  min-width: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.fill-card {
  min-height: 560px;
}

.compact-card {
  min-height: 110px;
}

.title {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.section-text {
  font-size: 12px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.mini-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #06101f;
  min-height: 36px;
}

.metric-label-inline {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metric-value {
  color: #fff;
  font-size: 12px;
}

.mono {
  font-variant-ligatures: none;
}

.symbol-card {
  margin-top: 8px;
  border: 1px solid #15294d;
  background: #020716;
  padding: 12px;
}

.symbol-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.symbol-card-grid .full {
  grid-column: 1 / -1;
}

.metric-label {
  display: block;
  color: #6b7690;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-row {
  gap: 10px;
}

.chip,
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid #555;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip {
  background: #1a1511;
  color: #f8e0bf;
  border-color: #5e4d3d;
}

.chip .v {
  color: #f7e2c1;
}

.pill.tier-good {
  background: rgba(20, 199, 132, 0.15);
  color: #67f0bb;
  border-color: #1a7b58;
}

.pill.tier-mid {
  background: rgba(214, 161, 29, 0.16);
  color: #ffd468;
  border-color: #8a6d17;
}

.pill.tier-bad {
  background: rgba(193, 15, 46, 0.16);
  color: #ff7e99;
  border-color: #8a1731;
}

.pill.tier-na {
  background: rgba(29, 134, 217, 0.16);
  color: #7cc0ff;
  border-color: #1d86d9;
}

.pill.dir-long,
.badge.ok {
  background: rgba(20, 199, 132, 0.16);
  color: #73f3c1;
  border-color: #19835e;
}

.pill.dir-short,
.badge.fail {
  background: rgba(193, 15, 46, 0.16);
  color: #ff8aa2;
  border-color: #8b1f36;
}

.pill.dir-neutral,
.badge.warn {
  background: rgba(214, 161, 29, 0.16);
  color: #ffd36f;
  border-color: #8a6d17;
}

.badge.info {
  background: rgba(29, 134, 217, 0.16);
  color: #7cc0ff;
  border-color: #1d86d9;
}

.pill.rel-out {
  background: rgba(20, 199, 132, 0.16);
  color: #73f3c1;
  border-color: #19835e;
}

.pill.rel-under {
  background: rgba(193, 15, 46, 0.16);
  color: #ff8aa2;
  border-color: #8b1f36;
}

.pill.rel-inline {
  background: rgba(214, 161, 29, 0.16);
  color: #ffd36f;
  border-color: #8a6d17;
}

.pill.rel-nobench {
  background: rgba(29, 134, 217, 0.16);
  color: #7cc0ff;
  border-color: #1d86d9;
}

.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #6d5e42;
  color: #f3d18d;
  font-size: 10px;
  cursor: default;
  user-select: none;
  background: #15120d;
}

.chart-wrap {
  position: relative;
  width: 100%;
  border: 1px solid #1e2b3a;
  background: linear-gradient(180deg, #293a52 0%, #111f34 100%);
  padding: 10px;
}

.short-chart {
  height: 320px;
}

.medium-chart {
  height: 360px;
}

.table-shell {
  margin-top: 10px;
  max-height: 76vh;
  overflow: auto;
  border: 1px solid var(--line-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #d11134 0%, #af0d29 100%);
  color: #fff;
  text-align: left;
  padding: 10px 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #5c0e1d;
}

tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #15181d;
  color: #f2f5f7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr:nth-child(odd) td {
  background: #000;
}

tbody tr:nth-child(even) td {
  background: var(--brown-row);
}

tr.pickable {
  cursor: pointer;
}

tr.pickable:hover td {
  background: #1c2430 !important;
}

.foot {
  padding: 10px 14px 18px;
  color: #7f8895;
  font-size: 11px;
}

@media (max-width: 1400px) {
  .workbench {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .overview-top-grid,
  .two-up {
    grid-template-columns: 1fr;
  }

  .search-shell {
    min-width: 280px;
  }
}

@media (max-width: 980px) {
  .workbench {
    grid-template-columns: 1fr;
  }

  .command-bar {
    position: static;
  }

  .search-shell {
    min-width: 0;
    width: 100%;
  }

  .command-actions {
    width: 100%;
  }
}
