:root {
  color-scheme: light;
  --ink: #19283d;
  --muted: #68758a;
  --line: #dde5f0;
  --line-strong: #cfd9e7;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --page: #f3f7ff;
  --blue: #4d8ff7;
  --blue-deep: #3377e5;
  --green: #42a56f;
  --amber: #d8952d;
  --red: #db5b64;
  --shadow: 0 18px 55px rgba(70, 101, 145, 0.11);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfdff 0, #f3f7ff 36%, #eef5ff 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
  opacity: 0.32;
}

.ambient-one {
  top: -20rem;
  right: -8rem;
  background: radial-gradient(circle, #a9c9ff, transparent 68%);
}

.ambient-two {
  bottom: -26rem;
  left: -12rem;
  background: radial-gradient(circle, #b9e8ff, transparent 68%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1840px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 30px;
}

.topbar,
.hero,
.control-panel,
.summary-card,
.plan-section,
.catalog-section,
.table-panel {
  border: 1px solid rgba(214, 224, 238, 0.92);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px 20px;
  border-radius: 20px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #66a6ff, #447ff1);
  box-shadow: 0 9px 20px rgba(68, 127, 241, 0.28);
}

.brand-mark svg,
.update-icon svg,
.search-box svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.announcement {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 8px 14px;
  border: 1px solid #dce7f5;
  border-radius: 14px;
  color: #34465e;
  background: linear-gradient(110deg, rgba(245, 249, 255, 0.98), rgba(250, 252, 255, 0.94));
}

.announcement-label {
  flex: 0 0 auto;
  color: #3273cf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.announcement-text {
  min-width: 0;
  overflow: hidden;
  color: #52657d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement[data-status="stale"] {
  border-color: #eadbbd;
  background: #fffaf1;
}

.announcement[data-status="stale"] .announcement-label {
  color: #b77718;
}

.announcement[data-status="error"] {
  border-color: #eadfe2;
  background: #fff9fa;
}

.announcement[data-status="error"] .announcement-label {
  color: #b85d66;
}

.cache-pill,
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.cache-pill {
  justify-self: end;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #dce6f3;
  border-radius: 999px;
  color: #4f6077;
  background: #f7faff;
  font-size: 13px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8da0b8;
  box-shadow: 0 0 0 4px rgba(141, 160, 184, 0.13);
}

[data-status="fresh"] .status-dot {
  background: #49ad77;
  box-shadow: 0 0 0 4px rgba(73, 173, 119, 0.14);
}

[data-status="partial"] .status-dot,
[data-status="stale"] .status-dot {
  background: #e0a13e;
  box-shadow: 0 0 0 4px rgba(224, 161, 62, 0.14);
}

[data-status="error"] .status-dot {
  background: #df626a;
  box-shadow: 0 0 0 4px rgba(223, 98, 106, 0.14);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-top: 16px;
  padding: 20px 24px;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.97) 0%, rgba(247, 251, 255, 0.96) 55%, rgba(232, 242, 255, 0.92) 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: #3273cf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.update-note {
  display: flex;
  min-width: 340px;
  gap: 13px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(108, 157, 229, 0.24);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
}

.update-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: #eaf3ff;
}

.update-note strong,
.update-note span {
  display: block;
}

.update-note strong {
  font-size: 14px;
}

.update-note div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 12px 15px;
  border-radius: 20px;
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fc;
}

.tab {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #5d697b;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tab:hover {
  color: var(--blue-deep);
}

.tab:focus-visible,
.search-box:focus-within {
  outline: 3px solid rgba(77, 143, 247, 0.22);
  outline-offset: 2px;
}

.tab.is-active {
  color: var(--blue-deep);
  background: white;
  box-shadow: 0 4px 15px rgba(67, 100, 147, 0.11);
}

.range-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.meta-divider {
  width: 1px;
  height: 15px;
  background: var(--line-strong);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.summary-card {
  position: relative;
  min-height: 144px;
  padding: 16px 20px;
  overflow: hidden;
  border-radius: 20px;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #5e6b7e;
  font-size: 14px;
  font-weight: 720;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
}

.metric-value {
  display: block;
  margin-top: 13px;
  font-size: clamp(27px, 2.4vw, 37px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.metric-caption {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.spark {
  position: absolute;
  right: -7px;
  bottom: 18px;
  width: 104px;
  height: 34px;
  border-top: 3px solid currentColor;
  border-radius: 50% 44% 0 0;
  opacity: 0.1;
  transform: rotate(-7deg);
}

.spark::after {
  position: absolute;
  top: -9px;
  right: 17px;
  width: 50px;
  height: 27px;
  border-top: 3px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: rotate(19deg);
}

.accent-blue .metric-icon { color: #387be7; background: #e9f1ff; }
.accent-blue .metric-value, .accent-blue .spark { color: #377ce7; }
.accent-violet .metric-icon { color: #7a65d8; background: #f0edff; }
.accent-violet .metric-value, .accent-violet .spark { color: #745fd1; }
.accent-cyan .metric-icon { color: #299fc1; background: #e8f8fc; }
.accent-cyan .metric-value, .accent-cyan .spark { color: #2995b4; }
.accent-amber .metric-icon { color: #d38b20; background: #fff4e2; }
.accent-amber .metric-value, .accent-amber .spark { color: #c98522; }
.accent-green .metric-icon { color: #379c64; background: #e8f7ee; }
.accent-green .metric-value, .accent-green .spark { color: #3c9e68; }

.plan-section {
  margin-top: 16px;
  /* Horizontal padding matches .table-heading so every panel title shares one left edge. */
  padding: 11px 24px 13px;
  border-radius: 20px;
}

.plan-heading-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-bottom: 8px;
}

.plan-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.plan-note {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
}

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

.plan-card {
  padding: 9px 14px 10px;
  border: 1px solid #e7edf6;
  border-radius: 15px;
  background: #fafcff;
}

.plan-card[data-plan="codex"] { --plan-accent: #377ce7; --plan-soft: #e9f1ff; --plan-soft-line: #d3e3ff; }
.plan-card[data-plan="nv"] { --plan-accent: #4c8b2b; --plan-soft: #eef7e6; --plan-soft-line: #d5e9c4; }
.plan-card[data-plan="glm"] { --plan-accent: #6f5bcd; --plan-soft: #f0edff; --plan-soft-line: #dcd5fa; }

.plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.plan-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--plan-accent, #8da0b8);
}

.plan-name {
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.plan-badge {
  max-width: 58%;
  margin-left: auto;
  padding: 2px 9px;
  overflow: hidden;
  border: 1px solid var(--plan-soft-line, var(--line));
  border-radius: 999px;
  color: var(--plan-accent, var(--muted));
  background: var(--plan-soft, #f7faff);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-card[data-status="stale"] .plan-badge {
  border-color: #efdfbd;
  color: #8b671f;
  background: #fffaf0;
}

.plan-card[data-status="error"] .plan-badge {
  border-color: #f0d2d4;
  color: #a33d46;
  background: #fff6f6;
}

.plan-windows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 7px;
}

.plan-card[data-plan="nv"] .plan-windows {
  grid-template-columns: minmax(0, 1fr);
}

.plan-window + .plan-window {
  padding-left: 16px;
  border-left: 1px solid #edf1f7;
}

.plan-window-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.plan-window-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.plan-window-value {
  color: #2b3b52;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  letter-spacing: -0.02em;
}

.plan-track {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e9eff7;
}

.plan-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #e9eff7;
}

.plan-track::-webkit-progress-value {
  border-radius: inherit;
  background: #aab8ca;
}

.plan-track::-moz-progress-bar {
  border-radius: inherit;
  background: #aab8ca;
}

.plan-track[data-level="high"]::-webkit-progress-value { background: linear-gradient(90deg, #5cbe8b, #42a56f); }
.plan-track[data-level="high"]::-moz-progress-bar { background: linear-gradient(90deg, #5cbe8b, #42a56f); }
.plan-track[data-level="medium"]::-webkit-progress-value { background: linear-gradient(90deg, #efb757, #d8952d); }
.plan-track[data-level="medium"]::-moz-progress-bar { background: linear-gradient(90deg, #efb757, #d8952d); }
.plan-track[data-level="low"]::-webkit-progress-value { background: linear-gradient(90deg, #ec838b, #db5b64); }
.plan-track[data-level="low"]::-moz-progress-bar { background: linear-gradient(90deg, #ec838b, #db5b64); }
.plan-track[data-level="none"]::-webkit-progress-value { background: transparent; }
.plan-track[data-level="none"]::-moz-progress-bar { background: transparent; }

.plan-window-reset {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #8290a3;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 640;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-window-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 8px;
  overflow: visible;
}

.plan-window-balance {
  margin-left: auto;
  text-align: right;
  white-space: normal;
}

.table-panel {
  margin-top: 16px;
  overflow: hidden;
  border-radius: 23px;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
}

.table-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.search-box {
  display: flex;
  width: min(390px, 42vw);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #8190a4;
  background: #fbfcfe;
}

.search-box svg {
  width: 19px;
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: #708097;
}

.status-banner {
  margin: 0 24px 16px;
  padding: 10px 13px;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  color: #657287;
  background: #f7faff;
  font-size: 12px;
  font-weight: 620;
}

.status-banner[data-status="partial"],
.status-banner[data-status="stale"] {
  border-color: #efdfbd;
  color: #8b671f;
  background: #fffaf0;
}

.status-banner[data-status="error"] {
  border-color: #f0d2d4;
  color: #a33d46;
  background: #fff6f6;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid #edf1f6;
  scrollbar-color: #cfd9e7 transparent;
  scrollbar-width: thin;
}

.table-scroll:focus-visible {
  outline: 3px solid rgba(77, 143, 247, 0.25);
  outline-offset: -3px;
}

table {
  width: 100%;
  min-width: 1690px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  height: 64px;
  padding: 0 17px;
  border-bottom: 1px solid #e9eef4;
  white-space: nowrap;
}

th {
  height: 55px;
  color: #69778b;
  background: #fafbfd;
  font-size: 12px;
  font-weight: 760;
  text-align: left;
}

th.number,
td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody tr {
  --row-background: #fff;
  background: var(--row-background);
  transition: background 140ms ease;
}

tbody tr:nth-child(even) {
  --row-background: #fcfdff;
}

tbody tr:hover {
  --row-background: #f3f8ff;
}

tbody tr.top-rank {
  --row-background: #f4f8ff;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 66px;
  min-width: 66px;
  background: var(--row-background, #fafbfd);
}

thead th:first-child,
thead th:nth-child(2) {
  z-index: 4;
  background: #fafbfd;
}

th:nth-child(2),
td:nth-child(2) {
  position: sticky;
  left: 66px;
  z-index: 2;
  width: 220px;
  min-width: 220px;
  background: var(--row-background, #fafbfd);
  box-shadow: 10px 0 16px -16px rgba(36, 55, 81, 0.5);
}

.rank-badge {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  color: #65748a;
  background: white;
  font-weight: 780;
}

.rank-badge.rank-1 { color: #a56d12; border-color: #f0d9a8; background: #fff8e9; }
.rank-badge.rank-2 { color: #65738a; border-color: #d6dee9; background: #f6f8fb; }
.rank-badge.rank-3 { color: #a76740; border-color: #ead0c1; background: #fff5ef; }

.key-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.key-symbol {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #397ddb;
  background: #eaf3ff;
  font-size: 11px;
  font-weight: 850;
}

.model-symbol {
  color: #7a65d8;
  background: #f0edff;
}

.key-name {
  max-width: 155px;
  overflow: hidden;
  font-weight: 720;
  text-overflow: ellipsis;
}

.token-value {
  color: #34445b;
  font-weight: 650;
}

.rate {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 65px;
  color: #26754b;
  font-weight: 720;
}

.rate.is-low {
  color: #c35e65;
}

.failure-count {
  color: #bd525b;
  font-weight: 720;
}

.share-cell {
  min-width: 150px;
}

.share-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-track {
  appearance: none;
  -webkit-appearance: none;
  width: 78px;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e9eff7;
}

.share-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #e9eff7;
}

.share-track::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, #69a8ff, #4d87ee);
}

.share-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #69a8ff, #4d87ee);
}

.share-text {
  min-width: 49px;
  color: #526178;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.loading-row td,
.empty-row td {
  height: 130px;
  color: var(--muted);
  text-align: center;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 24px;
  color: #8290a3;
  background: #fbfcfe;
  font-size: 12px;
}

.catalog-section {
  margin-top: 16px;
  /* Horizontal padding matches .plan-section so every panel title shares one left edge. */
  padding: 18px 24px 20px;
  border-radius: 20px;
}

.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 14px;
}

.catalog-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.catalog-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.catalog-count {
  padding: 3px 11px;
  border: 1px solid #cbe6d6;
  border-radius: 999px;
  color: #2f7f55;
  background: #eff9f3;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  white-space: nowrap;
}

.catalog-count[data-status="loading"],
.catalog-count[data-status="stale"] {
  border-color: #efdfbd;
  color: #8b671f;
  background: #fffaf0;
}

.catalog-count[data-status="error"] {
  border-color: #f0d2d4;
  color: #a33d46;
  background: #fff6f6;
}

.catalog-note {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.catalog-groups {
  display: grid;
  gap: 10px;
}

.catalog-placeholder {
  margin: 0;
  padding: 14px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.catalog-group {
  padding: 12px 14px 13px;
  border: 1px solid #e7edf6;
  border-radius: 15px;
  background: #fafcff;
}

.catalog-group[data-group="gpt"] { --group-accent: #2f8f6b; --group-soft: #edf8f3; --group-soft-line: #cfe8dd; }
.catalog-group[data-group="claude"] { --group-accent: #c0673a; --group-soft: #fff2ec; --group-soft-line: #f2d8c9; }
.catalog-group[data-group="gemini"] { --group-accent: #377ce7; --group-soft: #e9f1ff; --group-soft-line: #d3e3ff; }
.catalog-group[data-group="kimi"] { --group-accent: #1f2d4d; --group-soft: #eef1f8; --group-soft-line: #d6dcea; }
.catalog-group[data-group="qwen"] { --group-accent: #6f5bcd; --group-soft: #f0edff; --group-soft-line: #dcd5fa; }
.catalog-group[data-group="glm"] { --group-accent: #2b7fa8; --group-soft: #e9f5fb; --group-soft-line: #cbe4f0; }
.catalog-group[data-group="grok"] { --group-accent: #4a5568; --group-soft: #f1f3f7; --group-soft-line: #dbe0e9; }
.catalog-group[data-group="deepseek"] { --group-accent: #3f5bd0; --group-soft: #ecefff; --group-soft-line: #d3daf8; }
.catalog-group[data-group="minimax"] { --group-accent: #b0448c; --group-soft: #fdedf7; --group-soft-line: #f2cfe4; }

.catalog-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
}

.catalog-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--group-accent, #8da0b8);
}

.catalog-group-name {
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.catalog-group-count {
  padding: 2px 9px;
  border: 1px solid var(--group-soft-line, var(--line));
  border-radius: 999px;
  color: var(--group-accent, var(--muted));
  background: var(--group-soft, #f7faff);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  white-space: nowrap;
}

.catalog-models {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.catalog-chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #33445e;
  background: var(--surface-solid);
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 6px 0;
  color: #66758a;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.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;
}

@media (max-width: 1220px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plan-windows {
    gap: 11px;
  }

  .plan-window + .plan-window {
    padding-left: 11px;
  }
}

@media (max-width: 700px) {
  .plan-windows {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .plan-window + .plan-window {
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid #edf1f7;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 1840px);
    padding-top: 12px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
    min-height: 66px;
    border-radius: 17px;
  }

  .announcement {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 42px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .cache-pill {
    grid-column: 2;
    grid-row: 1;
  }

  .announcement-text {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .brand small {
    display: none;
  }

  .cache-pill {
    max-width: 48vw;
    overflow: hidden;
  }

  .cache-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    display: block;
    padding: 22px 24px;
  }

  .update-note {
    min-width: 0;
    margin-top: 20px;
  }

  .control-panel {
    display: block;
    overflow: hidden;
  }

  .tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    min-width: 105px;
    flex: 1 0 auto;
    padding: 0 13px;
  }

  .range-meta {
    justify-content: flex-start;
    margin: 12px 4px 2px;
    text-align: left;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 146px;
  }

  .plan-grid {
    gap: 10px;
  }

  .plan-card {
    padding: 11px 12px 12px;
  }

  .table-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 16px, 1840px);
    padding-bottom: 18px;
  }

  .topbar,
  .hero,
  .control-panel,
  .summary-card,
  .plan-section,
  .catalog-section,
  .table-panel {
    box-shadow: 0 10px 35px rgba(70, 101, 145, 0.09);
  }

  .topbar {
    padding: 11px 13px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 15px;
  }

  .cache-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .hero {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .hero-copy {
    font-size: 13px;
  }

  .update-note {
    padding: 13px;
  }

  .update-note strong {
    font-size: 13px;
  }

  .update-note div > span {
    line-height: 1.5;
  }

  .control-panel {
    padding: 10px;
    border-radius: 17px;
  }

  .range-meta {
    display: grid;
    gap: 4px;
  }

  .meta-divider {
    display: none;
  }

  .summary-grid {
    gap: 10px;
  }

  .summary-card,
  .summary-card:nth-child(4),
  .summary-card:nth-child(5) {
    min-height: 132px;
    padding: 15px;
    border-radius: 17px;
  }

  .card-label {
    gap: 7px;
    font-size: 12px;
  }

  .metric-icon {
    width: 27px;
    height: 27px;
  }

  .metric-value {
    margin-top: 15px;
    font-size: 25px;
  }

  .metric-caption {
    margin-top: 8px;
    font-size: 10px;
  }

  .spark {
    display: none;
  }

  .summary-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  .plan-section {
    /* Follows .table-heading's 16px inset on phones. */
    padding: 11px 16px 13px;
    border-radius: 17px;
  }

  .plan-heading {
    font-size: 14px;
  }

  .plan-grid {
    gap: 8px;
  }

  .plan-card {
    padding: 11px 8px 12px;
    border-radius: 13px;
  }

  .plan-head {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Keep the badge on its own line for every card so the windows stay aligned. */
  .plan-head::after {
    order: 0;
    width: 100%;
    height: 0;
    content: "";
  }

  .plan-name {
    font-size: 12.5px;
  }

  .plan-badge {
    order: 1;
    max-width: 100%;
    margin-left: 0;
    padding: 2px 7px;
    font-size: 10px;
  }

  .plan-window-value {
    font-size: 14px;
  }

  .plan-window-reset {
    font-size: 10px;
  }

  .catalog-section {
    /* Follows .plan-section's 16px inset on phones. */
    padding: 16px 16px 18px;
    border-radius: 17px;
  }

  .catalog-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .catalog-heading h2 {
    font-size: 19px;
  }

  .catalog-group {
    padding: 11px 11px 12px;
    border-radius: 13px;
  }

  .catalog-group-name {
    font-size: 13px;
  }

  .catalog-models {
    gap: 6px;
  }

  .catalog-chip {
    padding: 3px 8px;
    font-size: 11px;
  }

  .table-heading {
    padding: 20px 16px 15px;
  }

  .status-banner {
    margin: 0 16px 14px;
  }

  .table-footer {
    padding: 0 16px;
  }

  th:first-child,
  td:first-child,
  th:nth-child(2),
  td:nth-child(2) {
    position: static;
    box-shadow: none;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 180px;
    min-width: 180px;
  }

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

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