:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #15202b;
  --muted: #5f6f7d;
  --line: #dbe3ea;
  --blue: #2364aa;
  --teal: #15847b;
  --green: #2e7d32;
  --red: #b33a3a;
  --amber: #946200;
  --shadow: 0 8px 24px rgba(21, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 48px);
  background: #17212b;
  color: #f9fbfd;
}

.eyebrow {
  margin: 0 0 6px;
  color: #a9c5d8;
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 720;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid #6b879c;
  border-radius: 8px;
  padding: 0 14px;
  background: #f9fbfd;
  color: #17212b;
  cursor: pointer;
}

button:hover {
  background: #e8f1f7;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 36px) 56px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.update-indicator {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.14);
}

.metrics,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  margin-bottom: 16px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 108px;
  padding: 18px;
}

.metric-card span,
.panel-heading span,
label {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 760;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.bucket-chart {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.bucket-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 2fr) minmax(90px, auto);
  align-items: center;
  gap: 12px;
}

.bucket-name {
  font-size: 0.9rem;
  font-weight: 650;
}

.bucket-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e8ee;
}

.bucket-bar {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.bucket-value {
  text-align: right;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.controls {
  display: grid;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.88rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f7fafc;
}

.issuer {
  display: grid;
  gap: 3px;
  min-width: 230px;
}

.issuer strong {
  font-size: 0.92rem;
}

.issuer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 9px;
  background: #edf3f7;
  color: #304657;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill.long_equity,
.pill.increased,
.pill.added,
.pill.positive {
  background: #e8f4eb;
  color: var(--green);
}

.pill.bullish_convexity,
.pill.new {
  background: #e7f2fb;
  color: var(--blue);
}

.pill.bearish_or_hedge,
.pill.reduced,
.pill.mixed {
  background: #fff2dd;
  color: var(--amber);
}

.pill.exited,
.pill.negative {
  background: #fae9e9;
  color: var(--red);
}

.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-row {
  padding: 28px 14px;
  color: var(--muted);
}

.notes-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px 22px 18px 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab-button:hover {
  background: #eaf1f6;
}

.tab-button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.tab-panel {
  display: none;
}

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

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

  .dashboard-grid .panel:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .bucket-row {
    grid-template-columns: 1fr;
  }

  .bucket-value {
    text-align: left;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
