:root {
  --ink: #141311;
  --paper: #f4f1ea;
  --paper-2: #e8e2d6;
  --mute: #5e574c;
  --line: #d5cdc0;
  --accent: #c4512c;
  --cream: #f4f1ea;
  --sheet: #fbf8f1;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

.page {
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  color: var(--cream);
  background: var(--ink);
  padding: 2.4rem max(1.25rem, calc((100% - 1200px) / 2)) 1.8rem;
}

.kicker {
  margin: 0 0 0.7rem;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e07a52;
}

h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.thesis {
  max-width: 38rem;
  margin: 0.85rem 0 0;
  color: #e6e0d4;
  font-size: 1.12rem;
  line-height: 1.45;
}

.thesis em {
  color: var(--cream);
  font-style: italic;
}

.asof {
  margin: 1rem 0 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #d9d2c6;
}

.asof.stale {
  color: #e07a52;
}

.counts {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.counts div {
  min-width: 118px;
  padding: 12px 14px;
  border: 1px solid #3a3530;
  background: #1c1a17;
}

.counts b {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.counts span {
  display: block;
  margin-top: 6px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #d9d2c6;
}

.methods,
.panel,
.sheet {
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.methods {
  padding: 1.4rem max(1.25rem, calc((100% - 1200px) / 2)) 1.2rem;
}

.methods h2,
.panel-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.steps {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps b {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 560;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.steps span {
  color: var(--ink);
  font-size: 1rem;
}

.panel {
  padding: 1.1rem max(1.25rem, calc((100% - 1200px) / 2)) 0.7rem;
}

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

.panel-head p {
  margin: 0;
  color: var(--mute);
  font-size: 0.95rem;
}

.chart-wrap {
  margin-top: 8px;
}

.breadth-svg {
  width: 100%;
  height: 188px;
  display: block;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.axis {
  fill: var(--mute);
  font-size: 10px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.chart-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--mute);
  padding: 8px 2px 6px;
}

.chart-legend strong {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
}

.swatch {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 4px;
}

.swatch.s100 {
  background: #c4512c;
}
.swatch.s90 {
  background: rgba(196, 81, 44, 0.35);
}
.swatch.sspy {
  background: #141311;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

.filters button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.filters button.on {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}

.toolbar input {
  flex: 1;
  min-width: 180px;
}

.toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--mute);
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 160px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  background: var(--sheet);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 4px 7px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper-2);
  text-align: center;
  font-weight: 650;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

th button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 650;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

th button.on {
  color: var(--accent);
}

.name-cell {
  text-align: left;
  min-width: 210px;
}

.type-cell {
  text-align: left;
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticker {
  font-weight: 700;
  margin-right: 8px;
}

.gname {
  color: var(--mute);
}

tr.pinned td {
  background: var(--paper-2);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}

tr.section-row td {
  text-align: left;
  background: var(--paper);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding: 8px 7px 6px;
}

tr:hover td {
  filter: brightness(0.985);
}

.spark {
  display: block;
  margin: 0 auto;
}

.bar-cell {
  position: relative;
  display: block;
  min-width: 72px;
  height: 18px;
}

.bar-fill {
  position: absolute;
  inset: 2px auto 2px 0;
  opacity: 0.85;
}

.bar-text {
  position: relative;
  display: block;
  text-align: right;
  padding-right: 2px;
}

.empty,
.boot,
.chart-empty {
  padding: 24px;
  color: var(--mute);
}

.boot {
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.foot {
  margin: 0;
  padding: 10px 14px 14px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: var(--mute);
}

.page.embed .methods {
  display: none;
}

.page.embed .hero {
  padding-top: 1.2rem;
}

@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    padding: 1.6rem 1rem 1.2rem;
  }
  .counts {
    flex-wrap: wrap;
  }
  .methods,
  .panel {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .table-scroll {
    max-height: none;
  }
  .chart-legend strong {
    margin-left: 0;
    width: 100%;
  }
}
