.header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--bg-border);
  padding-top: 3px;
}

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

.mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-hdr);
  font-size: 14px;
  line-height: 1;
}

.brand-text {
  font-family: var(--font-hdr);
  font-size: 17px;
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.header-meta span:last-child {
  color: var(--text-muted);
}

.price-strip {
  min-height: 56px;
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  border-bottom: 1px solid var(--bg-border);
  overflow-x: auto;
}

.ticker {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 14px;
  border-right: 1px solid var(--bg-border);
}

.ticker-label {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

.ticker-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
}

.ticker-change,
.positive,
.negative,
.neutral {
  font-family: var(--font-mono);
  font-size: 11px;
}

.positive {
  color: var(--up);
}

.negative {
  color: var(--down);
}

.neutral {
  color: var(--text-secondary);
}

.above-fold {
  min-height: calc(100vh - 147px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 1px;
  background: var(--bg-border);
  border-bottom: 1px solid var(--bg-border);
}

.panel {
  min-width: 0;
  background: var(--bg-panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-large {
  min-height: 420px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel h1,
.panel h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.panel p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.chart-frame {
  position: relative;
  flex: 1;
  min-height: 260px;
}

.chart-frame canvas {
  width: 100%;
  height: 100%;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border: 1px dashed var(--bg-border);
}

.segmented {
  display: flex;
  border: 1px solid var(--bg-border);
}

.segmented button,
.tabs button {
  border: 0;
  color: var(--text-secondary);
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 11px;
}

.segmented button {
  min-width: 46px;
  height: 28px;
  border-right: 1px solid var(--bg-border);
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active,
.tabs button.active {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--bg-border);
  color: var(--text-primary);
  background: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--bg-border);
}

.metric {
  min-height: 48px;
  padding: 9px 10px;
  background: var(--bg-base);
}

.metric span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.risk-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--bg-border);
  border-bottom: 1px solid var(--bg-border);
}

.risk-chip {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: var(--bg-panel-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.workspace {
  padding: 18px 0 28px;
}

.tabs {
  display: flex;
  align-items: center;
  overflow-x: auto;
  border: 1px solid var(--bg-border);
  border-bottom: 0;
}

.tabs button {
  min-width: max-content;
  height: 36px;
  padding: 0 14px;
  border-right: 1px solid var(--bg-border);
}

.tab-panel {
  display: none;
  border: 1px solid var(--bg-border);
  background: var(--bg-border);
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--bg-border);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--text-secondary);
  font-weight: 500;
}

td {
  color: var(--text-primary);
}

details {
  border-top: 1px solid var(--bg-border);
  padding: 12px 0 0;
  color: var(--text-secondary);
}

summary {
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
}

details p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 1050px) {
  .price-strip {
    grid-template-columns: repeat(7, 150px);
  }

  .above-fold,
  .grid,
  .grid.three,
  .risk-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header {
    align-items: flex-start;
    height: auto;
    min-height: 56px;
    padding-bottom: 8px;
  }

  .header-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
  }

  .above-fold {
    min-height: 0;
  }

  .panel {
    padding: 12px;
  }

  .chart-frame {
    min-height: 240px;
  }
}

