:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #64706e;
  --paper: #ffffff;
  --canvas: #f3f7f6;
  --line: #d5dfdc;
  --line-strong: #9caaa7;
  --teal: #087f71;
  --teal-soft: #e3f2ef;
  --orange: #c64f2a;
  --blue: #2f67b1;
  --focus: #111111;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.app-header__inner,
main,
footer {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.app-header__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 36px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ink);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.text-link,
.text-button {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
}

.text-link:hover,
.text-button:hover {
  color: var(--ink);
}

main {
  padding: 44px 0 72px;
}

.overview {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 34px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.overview__copy {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 1px;
  min-width: 320px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.summary div {
  padding: 14px 16px;
  background: var(--paper);
}

.summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.summary dd {
  margin: 3px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
  font-weight: 800;
}

.platform-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-strong);
  scrollbar-width: thin;
}

.platform-tabs button,
.case-list button {
  border: 0;
  background: transparent;
  text-align: left;
}

.platform-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
}

.platform-tabs button:hover {
  color: var(--ink);
  background: var(--paper);
}

.platform-tabs button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 32px;
  padding-top: 28px;
}

.case-panel {
  min-width: 0;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.case-panel__header,
.table-heading,
.case-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.case-panel h2 {
  margin-bottom: 0;
  font-size: 15px;
}

.count,
.commit-label {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.search-field {
  display: block;
  margin: 14px 0;
}

.search-field input,
.control select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
}

.search-field input {
  padding: 0 10px;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-list button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.case-list button:hover {
  color: var(--ink);
  background: var(--paper);
}

.case-list button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--teal);
}

.case-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.case-list__count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.results {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.control {
  min-width: 150px;
}

.control label,
.segmented-control legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.control select {
  padding: 0 30px 0 10px;
}

.segmented-control {
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-control > div {
  display: grid;
  grid-auto-flow: column;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.segmented-control button {
  min-width: 72px;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

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

.segmented-control button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--ink);
}

.mobile-case-control {
  display: none;
}

.case-heading {
  align-items: end;
  padding: 28px 0 18px;
}

.case-heading h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
}

.case-path {
  margin-bottom: 5px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.case-meta {
  margin-bottom: 2px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-align: right;
}

.chart-region {
  position: relative;
  width: 100%;
  height: 430px;
  padding: 18px 10px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.chart-region canvas {
  width: 100% !important;
  height: 100% !important;
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
}

.table-section {
  padding-top: 28px;
}

.table-heading {
  margin-bottom: 12px;
}

.table-heading h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8faf9;
  font-size: 10px;
  text-transform: uppercase;
}

td:nth-child(3),
td:nth-child(4),
th:nth-child(3),
th:nth-child(4) {
  text-align: right;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.value-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.delta--better {
  color: var(--teal);
}

.delta--worse {
  color: var(--orange);
}

.table-empty {
  color: var(--muted);
  text-align: center !important;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .overview {
    align-items: start;
    flex-direction: column;
    gap: 24px;
  }

  .summary {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
  }

  .case-panel {
    padding-right: 18px;
  }

  .toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .app-header__inner,
  main,
  footer {
    width: min(100% - 28px, 1280px);
  }

  .app-header__inner {
    min-height: 58px;
  }

  .last-update,
  .text-link {
    display: none;
  }

  main {
    padding-top: 30px;
  }

  h1 {
    font-size: 28px;
  }

  .workspace {
    display: block;
    padding-top: 20px;
  }

  .case-panel {
    display: none;
  }

  .mobile-case-control {
    display: block;
    margin-bottom: 18px;
  }

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

  .control {
    min-width: 0;
  }

  .segmented-control > div,
  .segmented-control button {
    width: 100%;
  }

  .case-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .case-meta {
    text-align: left;
  }

  .chart-region {
    height: 340px;
    padding-left: 0;
    padding-right: 0;
  }

  th,
  td {
    padding: 10px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .summary {
    min-width: 0;
  }

  .summary div {
    padding: 12px 10px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .chart-region {
    height: 310px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
