:root {
  color-scheme: dark;
  --sb-bg: #10151e;
  --sb-panel: #192230;
  --sb-ink: #f4f7fc;
  --sb-dim: #c3ccda;
  --sb-line: #3c4a5d;
  --sb-accent: #91baff;
  --sb-alert: #ffd28c;
  --tone-blue: #83bdff;
  --fill-blue: #142c47;
  --tone-purple: #d0adff;
  --fill-purple: #2d2341;
  --tone-teal: #87e5c4;
  --fill-teal: #15352f;
  --tone-gold: #ffd28c;
  --fill-gold: #382d1c;
}
:root[data-theme="light"] {
  color-scheme: light;
  --sb-bg: #f3f6fb;
  --sb-panel: #ffffff;
  --sb-ink: #15253b;
  --sb-dim: #45566d;
  --sb-line: #a7b5c6;
  --sb-accent: #164eac;
  --sb-alert: #805000;
  --tone-blue: #1356a3;
  --fill-blue: #e7f0ff;
  --tone-purple: #6838a5;
  --fill-purple: #f1e9ff;
  --tone-teal: #08634f;
  --fill-teal: #e0f4ec;
  --tone-gold: #805000;
  --fill-gold: #fff0d2;
}
#app .toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sb-line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--sb-panel);
}
#app .wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
#app .scope {
  color: var(--sb-dim);
  font-size: 12px;
  margin-top: 2px;
}
#app .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#app button,
#app select {
  font: inherit;
  background: var(--sb-panel);
  color: var(--sb-ink);
  border: 1px solid var(--sb-line);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 36px;
}
#app button[aria-pressed="true"] {
  background: var(--sb-accent);
  color: var(--sb-bg);
  border-color: var(--sb-accent);
}
#app .view-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
#app .view-tabs button {
  font-size: 13px;
}
#app .display {
  aspect-ratio: 16/9;
  padding: 2.1cqw 2.4cqw 1.6cqw;
  display: flex;
  flex-direction: column;
  gap: 1.45cqw;
}
#app .screen-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
#app .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(11px, 1.14cqw, 22px);
  color: var(--sb-dim);
  font-weight: 600;
}
#app h2 {
  font-size: clamp(26px, 3.1cqw, 60px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin: 5px 0 0;
  font-weight: 700;
}
#app .period {
  text-align: right;
  color: var(--sb-dim);
  font-size: clamp(12px, 1.27cqw, 25px);
}
#app .summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2cqw;
}
#app .stat {
  background: var(--tone-fill, var(--sb-panel));
  border-top: 4px solid var(--tone, var(--sb-ink));
  padding: 1.3cqw 1.5cqw;
  border-radius: 8px;
}
#app .stat-label {
  color: var(--sb-dim);
  font-size: clamp(13px, 1.47cqw, 29px);
  font-weight: 500;
}
#app .stat-value {
  min-width: 0;
  white-space: nowrap;
  font-size: clamp(36px, 5.1cqw, 98px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 5px 0;
}
#app .stat-detail {
  color: var(--sb-dim);
  font-size: clamp(11px, 1.16cqw, 23px);
}
#app .leader-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--sb-line);
  border-bottom: 1px solid var(--sb-line);
  padding: 1cqw 0;
  font-size: clamp(13px, 1.5cqw, 29px);
}
#app .leader-strip strong {
  font-weight: 650;
}
#app .leader-label {
  color: var(--sb-dim);
}
#app .leader-name {
  margin-left: 10px;
}
#app .sort-select {
  font-size: clamp(12px, 1.2cqw, 23px);
  padding: 4px 7px;
  min-height: 30px;
}
#app .table-wrap {
  flex: 1;
  min-height: 0;
}
#app table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  text-align: left;
  table-layout: fixed;
}
#app th {
  color: var(--sb-dim);
  font-size: clamp(12px, 1.22cqw, 24px);
  font-weight: 500;
  padding: 0.5cqw 0.7cqw 0.9cqw;
  vertical-align: bottom;
}
#app td {
  border-top: 1px solid var(--sb-line);
  padding: 0.9cqw 0.7cqw;
  font-size: clamp(18px, 2.35cqw, 46px);
  font-weight: 600;
  line-height: 1.3;
}
#app td:not(:first-child),
#app th:not(:first-child) {
  text-align: right;
}
#app th:first-child {
  width: 26%;
}
#app .rank {
  color: var(--sb-dim);
  display: inline-block;
  width: 1.5em;
  font-size: 0.67em;
  font-weight: 500;
}
#app .display-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--sb-dim);
  font-size: clamp(11px, 1.12cqw, 22px);
  margin-top: auto;
}
#app .stale {
  color: var(--sb-alert);
}
#app .deal-table th:first-child {
  width: 34%;
}
#app .deal-table td {
  font-size: clamp(14px, 1.65cqw, 32px);
}
#app .deal-table td:first-child {
  font-weight: 600;
}
#app .deal-side {
  font-size: 0.75em;
  color: var(--sb-dim);
  font-weight: 400;
  margin-top: 3px;
}
#app .board-path {
  font-size: 12px;
  color: var(--sb-dim);
  padding: 13px 20px;
  border-top: 1px solid var(--sb-line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#app .desktop .summary {
  gap: 10px;
}
#app .desktop .stat-value {
  font-size: clamp(28px, 3.4cqw, 65px);
}
#app .desktop .stat {
  padding: 1.1cqw 1.3cqw;
}
#app .desktop th {
  font-size: clamp(11px, 1.12cqw, 22px);
  padding: 0.45cqw 0.7cqw;
}
#app .desktop .deal-table th:first-child {
  width: 23%;
}
#app .desktop .deal-table th {
  padding: 0.45cqw 0.5cqw;
  font-size: clamp(11px, 1.02cqw, 20px);
}
#app .desktop .leader-strip {
  font-size: clamp(13px, 1.4cqw, 27px);
}
@media (max-width: 760px) {
  #app .dashboard {
    min-height: 980px;
  }
  #app .display {
    aspect-ratio: auto;
    min-height: 820px;
    padding: 20px 14px;
    gap: 18px;
  }
  #app .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #app .stat {
    padding: 14px;
  }
  #app .screen-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  #app .period {
    text-align: left;
  }
  #app .table-wrap {
    overflow-x: auto;
  }
  #app table {
    min-width: 570px;
  }
  #app .desktop .deal-table {
    min-width: 900px;
  }
  #app td {
    padding: 14px 8px;
  }
  #app .leader-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 0;
  }
  #app .display-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  #app .toolbar {
    padding: 15px;
  }
  #app .desktop .stat {
    padding: 14px;
  }
  #app .desktop .stat-value {
    font-size: 36px;
  }
  #app .desktop td {
    padding: 10px 8px;
  }
  #app .desktop .deal-table td {
    padding: 12px 8px;
  }
}
#app .is-tv .leader-name {
  font-size: 1.3em;
}
#app .is-tv .leader-label {
  font-size: 0.85em;
}
#app .dashboard h2,
#app .dashboard table,
#app .dashboard td,
#app .dashboard .leader-copy strong {
  color: var(--sb-ink);
}
#app .dashboard table,
#app .dashboard tr,
#app .dashboard thead,
#app .dashboard tbody {
  background: transparent;
}
#app .dashboard td span {
  color: inherit;
}
#app .dashboard .tone-blue {
  --tone: var(--tone-blue);
  --tone-fill: var(--fill-blue);
}
#app .dashboard .tone-purple {
  --tone: var(--tone-purple);
  --tone-fill: var(--fill-purple);
}
#app .dashboard .tone-teal {
  --tone: var(--tone-teal);
  --tone-fill: var(--fill-teal);
}
#app .dashboard .tone-gold {
  --tone: var(--tone-gold);
  --tone-fill: var(--fill-gold);
}
#app .dashboard .stat-value {
  color: var(--tone, var(--sb-ink));
}
#app .dashboard th[class*="tone-"],
#app .dashboard td[class*="tone-"] {
  color: var(--tone);
}
#app .dashboard .selected-metric {
  background: var(--tone-fill, var(--sb-panel));
}
#app .dashboard .deal-side.buyer {
  color: var(--tone-blue);
}
#app .dashboard .deal-side.seller {
  color: var(--tone-purple);
}
#app .year-label select {
  font-size: 13px;
  min-height: 36px;
}
#app .is-tv .stat-label {
  font-size: clamp(13px, 1.4cqw, 56px);
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--sb-bg);
  color: var(--sb-ink);
  font:
    16px/1.5 system-ui,
    sans-serif;
}
body {
  padding: 20px;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--sb-accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
#app {
  max-width: 1800px;
  margin: 0 auto;
}
#app .dashboard {
  min-height: 0;
  color: var(--sb-ink);
  background: var(--sb-bg);
  font:
    14px/1.4 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  border-radius: 12px;
  overflow: hidden;
  container-type: inline-size;
}
#app .desktop .display {
  gap: 16px;
  aspect-ratio: auto;
  min-height: 56.25cqw;
}
#app .desktop .table-wrap {
  flex: none;
  min-height: auto;
}
#app .desktop td {
  font-size: clamp(16px, 1.65cqw, 30px);
  padding: 0.75cqw 0.7cqw;
}
#app .desktop .deal-table td {
  font-size: clamp(13px, 1.22cqw, 24px);
  padding: 0.9cqw 0.5cqw;
}
#app .staff-row td {
  border-top: 2px solid var(--sb-line);
  font-size: clamp(14px, 1.7cqw, 30px);
  padding: 0.55cqw 0.7cqw;
}
#app .staff-label {
  font-size: clamp(11px, 1.05cqw, 20px);
  color: var(--sb-dim);
  font-weight: 400;
}
#app .is-tv .staff-row td {
  font-size: clamp(14px, 1.7cqw, 64px);
}
#app .period-controls {
  text-align: right;
}
#app .activity-period {
  font-size: 12px;
  color: var(--sb-dim);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
#app .year-label {
  font-size: 12px;
  color: var(--sb-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 4px;
}
#app .summary .stat-detail {
  line-height: 1.35;
}
#app .board-path button {
  font-size: 12px;
  padding: 5px 9px;
  min-height: 30px;
}
#app .board-path > div {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
#app .board-path select {
  font-size: 12px;
  padding: 4px;
  min-height: 28px;
}
#auth-gate {
  min-height: 75vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-box {
  width: min(100%, 470px);
  min-width: 0;
  padding: 36px;
  background: var(--sb-panel);
  border: 1px solid var(--sb-line);
  border-radius: 16px;
}
.login-brand {
  font-weight: 750;
  color: var(--sb-accent);
  letter-spacing: 0.05em;
  font-size: 15px;
}
.login-box h1 {
  font-size: 38px;
  line-height: 1.13;
  letter-spacing: -1.3px;
}
.login-box p {
  color: var(--sb-dim);
}
#auth-message {
  font-size: 14px;
}
dialog {
  background: var(--sb-panel);
  color: var(--sb-ink);
  border: 1px solid var(--sb-line);
  border-radius: 14px;
  max-width: min(720px, 90vw);
  padding: 26px;
}
dialog::backdrop {
  background: #05080dcc;
}
dialog h2 {
  color: var(--sb-ink);
}
dialog p,
dialog li {
  color: var(--sb-dim);
}
dialog li {
  margin-bottom: 12px;
}
dialog button,
dialog input,
dialog select {
  background: var(--sb-bg);
  color: var(--sb-ink);
  border: 1px solid var(--sb-line);
  border-radius: 6px;
  padding: 10px;
}
dialog .dialog-close {
  margin-top: 20px;
}
body.tv {
  padding: 0;
  overflow: hidden;
}
body.tv #app {
  max-width: none;
}
#app .is-tv {
  border-radius: 0;
  min-height: 0;
}
#app .is-tv .toolbar,
#app .is-tv .board-path {
  display: none;
}
#app .is-tv .display {
  gap: 1.1vh;
  height: 100dvh;
  aspect-ratio: auto;
  padding: 2.5vh 2.4vw 1.8vh;
}
#app .is-tv .screen-heading select {
  font-size: clamp(14px, 1.3cqw, 52px);
}
#app .is-tv .screen-heading label {
  font-size: clamp(12px, 1.15cqw, 46px);
}
#app #exit-tv {
  flex-shrink: 0;
  min-height: 28px;
  background: var(--sb-panel);
  color: var(--sb-ink);
  border: 1px solid var(--sb-line);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 14px;
}
@media (max-width: 760px) {
  body {
    padding: 0;
  }
  #app .dashboard {
    border-radius: 0;
  }
  #app .desktop .display {
    min-height: auto;
    gap: 16px;
  }
  #app .desktop .table-wrap {
    overflow-x: auto;
  }
  #app .desktop table {
    min-width: 650px;
  }
  #app .desktop .deal-table {
    min-width: 1000px;
  }
  .login-box {
    padding: 24px;
  }
  .login-box h1 {
    font-size: 32px;
  }
  #app .period-controls {
    text-align: left;
  }
  #app .year-label,
  #app .activity-period {
    justify-content: flex-start;
  }
}
#app .summary.three-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#app .summary.five-tiles {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
#app .summary.five-tiles .stat-value {
  font-size: clamp(28px, 3.7cqw, 70px);
}
#app .summary.five-tiles .stat {
  padding: 1cqw 1.2cqw;
}
@media (max-width: 760px) {
  #app .summary.five-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  #app .summary.three-tiles {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--sb-dim);
}

#app .production-table .volume-cell {
  width: 22%;
  white-space: nowrap;
}
#app .desktop .production-table td.volume-cell {
  font-size: clamp(14px, 1.8cqw, 32px);
}
#app .coverage-note {
  margin: 0;
  color: var(--sb-dim);
  font-size: clamp(12px, 1.1cqw, 22px);
}

body.blur-names .sensitive {
  filter: blur(10px);
  user-select: none;
}
.sensitive {
  display: inline-block;
}
#app .fub-record {
  color: inherit;
  text-decoration: none;
  font: inherit;
}
#app .fub-record:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
#privacy-toggle[aria-pressed="true"] {
  border-color: var(--tone-gold);
  color: var(--tone-gold);
}
#app .summary.six-tiles {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
#app .summary.six-tiles .stat {
  padding: 0.75cqw 1.1cqw;
}
#app .summary.six-tiles .stat-value {
  font-size: clamp(24px, 3.2cqw, 60px);
}
#app .summary.six-tiles .stat-label {
  font-size: clamp(12px, 1.2cqw, 23px);
}
#app .summary.six-tiles .stat-detail {
  font-size: clamp(11px, 1.05cqw, 20px);
}
@media (max-width: 760px) {
  #app .summary.six-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* TV keeps context in place and devotes the remaining height to the full list. */
#app .is-tv .display > :not(.table-wrap) {
  flex-shrink: 0;
}
#app .is-tv .table-wrap {
  overflow: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
#app .is-tv .table-wrap::-webkit-scrollbar {
  display: none;
}
#app .is-tv th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--sb-bg);
  font-size: clamp(12px, 1.22cqw, 48px);
}
#app .is-tv tbody tr,
#app .is-tv tfoot tr {
  height: var(--tv-row-height);
}
#app .is-tv td {
  font-size: clamp(24px, 2cqw, 80px);
  line-height: 1.2;
  padding: 0.35cqw 0.7cqw;
  vertical-align: middle;
}
#app .is-tv .deal-table td {
  font-size: clamp(24px, 1.85cqw, 72px);
}
#app .is-tv .staff-label {
  font-size: clamp(12px, 0.9cqw, 36px);
}
#app .is-tv .display-footer {
  margin-top: 0;
  font-size: clamp(11px, 1.12cqw, 44px);
}

#app .is-tv .production-table .volume-cell {
  width: 16%;
}

#app .stat-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#app .stat-part .stat-value,
#app .stat-part .stat-detail {
  color: var(--tone);
}

#app .is-tv h2 {
  font-size: clamp(26px, 3.1cqw, 120px);
}
#app .is-tv .eyebrow {
  font-size: clamp(11px, 1.14cqw, 44px);
}
#app .is-tv .period {
  font-size: clamp(12px, 1.27cqw, 50px);
}

#app .is-tv .stat-value {
  font-size: clamp(36px, 5.1cqw, 196px);
}
#app .is-tv .stat-detail {
  font-size: clamp(11px, 1.16cqw, 46px);
}
#app .is-tv .summary.five-tiles .stat-value {
  font-size: clamp(30px, 3.6cqw, 144px);
}
#app .is-tv .summary.six-tiles .stat-value {
  font-size: clamp(24px, 3.2cqw, 120px);
}
#app .is-tv .summary.six-tiles .stat-label {
  font-size: clamp(12px, 1.2cqw, 46px);
}
#app .is-tv .summary.six-tiles .stat-detail {
  font-size: clamp(11px, 1.05cqw, 40px);
}
#app .is-tv .leader-strip {
  font-size: clamp(13px, 1.5cqw, 58px);
}
#app .is-tv .sort-select {
  font-size: clamp(12px, 1.2cqw, 46px);
}

#app .is-tv .coverage-note {
  font-size: clamp(12px, 1.1cqw, 44px);
}
#app .is-tv #exit-tv {
  font-size: clamp(14px, 0.8cqw, 32px);
}
