/* Claude Limits — Simple centered sheet */
:root {
  --ground: #f6f8fa;
  --surface: #ffffff;
  --raised: #f4f6f8;
  --border: #e8eaec;
  --rule: #f0f1f2;
  --control: #cdced1;
  --text: #131416;
  --muted: #5d5f60;
  --faint: #676a6e;
  --accent: #1b6c80;
  --primary: #131416;
  --primary-ink: #ffffff;
  --positive: #1e7b4f;
  --negative: #c4242a;
  --warning: #92400e;
  --chart-muted: #d2d6da;
  --pill-positive-bg: #dcfae5;
  --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea;
  --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb;
  --pill-warning-ink: #92400e;
  --pill-neutral-bg: #ebedee;
  --pill-neutral-ink: #353736;

  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --radius-sheet: 14px;
  --radius-card: 8px;
  --radius-control: 6px;
  --gap: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.num, table { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page {
  min-height: 100svh;
  padding: 24px 20px;
}

.sheet {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  padding: 24px;
  display: grid;
  gap: var(--gap);
}

/* ---------- Header ---------- */
.head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.title-wrap { display: grid; gap: 6px; min-width: 0; }
.title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-mark { flex: none; }
h1 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.finding {
  color: var(--muted);
  font-size: 14px;
  max-width: 72ch;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stamp {
  font-size: 13px;
  color: var(--faint);
  margin-right: 4px;
  white-space: nowrap;
}

/* ---------- Buttons & segmented filter ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--control);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover:not(:disabled) { background: var(--raised); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
}
.btn.primary:hover:not(:disabled) { background: #26292d; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }

.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-card);
  background: var(--raised);
  border: 1px solid var(--border);
}
.segmented button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- Summary cards ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; }
.meta { font-size: 13px; color: var(--faint); margin-top: 2px; }

.bars { display: grid; gap: 12px; }
.bar-item { display: grid; gap: 5px; min-width: 0; }
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.bar-title { min-width: 0; flex: 1; }
.bar-label { font-size: 14px; font-weight: 500; color: var(--text); }
.bar-sub { font-size: 13px; color: var(--muted); display: block; overflow-wrap: anywhere; }
.bar-val { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; flex: none; }
.bar-track {
  height: 7px;
  border-radius: 4px;
  background: var(--raised);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.warn { background: var(--warning); }
.bar-fill.neg { background: var(--negative); }
.bar-fill.unknown { background: var(--chart-muted); }

.note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--negative);
}
.note a {
  color: inherit;
  font-weight: 500;
  text-underline-offset: 2px;
}

/* ---------- Pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--pill-neutral-bg);
  color: var(--pill-neutral-ink);
  white-space: nowrap;
  flex: none;
}
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* ---------- Models table ---------- */
.models-panel { padding-bottom: 10px; }
.models-head { flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  height: 34px;
  padding: 0 12px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td {
  padding: 11px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
th.n, td.n { text-align: right; }

.model-name { font-weight: 500; color: var(--text); }
.sub-line {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.status-detail {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-cards { display: none; }
.empty-state {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .summary-grid { grid-template-columns: 1fr; }
  #models-table-wrap { display: none; }
  .mobile-cards { display: grid; gap: 10px; }
  .m-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 12px 14px;
    display: grid;
    gap: 8px;
    min-width: 0;
  }
  .m-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }
  .m-top > div { min-width: 0; flex: 1; }
  .m-top .sub-line { overflow-wrap: anywhere; }
  .m-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
  }
  .m-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
    min-width: 0;
  }
  .m-foot .sub-line { margin-top: 0; min-width: 0; flex: 1; }
}

@media (max-width: 680px) {
  .page { padding: 0; background: var(--surface); }
  .sheet {
    border: 0;
    border-radius: 0;
    padding: 16px;
    gap: 16px;
  }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .stamp { display: none; }
  .panel { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
