.usage-page {
  --usage-accent: var(--gold);
  display: grid;
  gap: 24px;
  max-width: 1100px;
  min-width: 0;
}
.usage-toolbar, .usage-toolbar label, .usage-toolbar nav, .usage-pager, .usage-state {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.usage-toolbar { justify-content: space-between; }
.usage-view-bar, .usage-tabs, .usage-quota-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}
.usage-view-bar:empty { display: none; }
.usage-tabs {
  display: flex;
  justify-content: flex-start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
}
.usage-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.usage-tabs a:hover, .usage-tabs a[aria-current] { color: var(--ink); }
.usage-tabs a[aria-current] { background: var(--solid); box-shadow: inset 0 -2px var(--usage-accent); }
.agreement-page { display: grid; gap: 16px; min-width: 0; }
.agreement-intro-main, .agreement-record-main, .agreement-record-side, .agreement-actions, .agreement-refresh {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.agreement-intro-main, .agreement-record-main, .agreement-refresh { justify-content: space-between; }
.agreement-intro h2, .agreement-record h3, .agreement-payments > h3 { margin: 0; }
.agreement-intro p, .agreement-refresh { margin-top: 6px; }
.agreement-intro p { max-width: 63ch; }
.agreement-actions .btn, .agreement-record-side .btn { min-height: 44px; }
.agreement-section > .agreement-record { padding: 0 0 14px; }
.agreement-record { min-width: 0; overflow-wrap: anywhere; }
.agreement-record-main { align-items: flex-start; }
.agreement-record-main > div:first-child { min-width: 0; }
.agreement-record-main h3 { font-family: var(--ui); font-size: 1rem; }
.agreement-record-main h3 span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.agreement-record-main .muted, .agreement-review-history { font-size: .8125rem; }
.agreement-status { font-size: .8125rem; font-weight: 700; }
.agreement-status[data-status="pending"] { color: var(--amber, #815500); }
[data-theme="dark"] .agreement-status[data-status="pending"] { color: #f4ba64; }
.agreement-status[data-status="approved"] { color: var(--green, #1d6b44); }
[data-theme="dark"] .agreement-status[data-status="approved"] { color: #78d9a6; }
.agreement-notes, .agreement-review-history { margin: 8px 0 0; white-space: pre-wrap; }
.agreement-review-history { color: var(--muted); }
.agreement-amounts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px 14px;
  margin: 0;
  padding: 15px 0;
  border-block: 1px solid var(--line);
}
.agreement-amounts dt { color: var(--muted); font-size: .8125rem; }
.agreement-amounts dd { margin: 3px 0 0; font-size: 1.125rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agreement-approved { grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 0; }
.agreement-payments { padding-top: 16px; }
.agreement-payments > h3 { font-size: 1.125rem; }
.agreement-payments > p { margin: 6px 0 0; }
.agreement-payments .agreement-record { padding: 12px 0; border-bottom: 1px solid var(--line); }
.agreement-payments .agreement-record:last-child { padding-bottom: 0; border-bottom: 0; }
.agreement-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: end;
  gap: 12px;
  max-width: 660px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.agreement-form label { display: grid; gap: 4px; min-width: 0; font-size: .875rem; }
.agreement-form :is(.full,.agreement-actions,label:has(textarea)) { grid-column: 1 / -1; margin: 0; }
.agreement-form .input { min-width: 0; width: 100%; }
.usage-universal { min-width: 0; }
.usage-universal-heading h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.12; }
.usage-universal-heading p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.usage-command-kpis {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin: 18px 0 0;
  font-variant-numeric: tabular-nums;
}
.usage-command-kpis > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--solid);
}
.usage-command-kpis > div:first-child { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.usage-command-kpis dt { min-height: 2.7em; color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.3; }
.usage-command-kpis dd { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.usage-command-kpis dd:first-of-type { color: var(--ink); font-size: clamp(18px, 2.45vw, 30px); font-weight: 800; letter-spacing: -.025em; overflow-wrap: anywhere; }
[data-theme="dark"] .usage-command-kpis > div:first-child dd:first-of-type { color: var(--gold); }
.usage-command-kpis .usage-progress { height: 6px; margin: 4px 0 0; }
.usage-allocation-bar { display: flex; height: 14px; overflow: hidden; border-radius: 5px; background: var(--panel2); }
.usage-allocation-bar > span { flex: none; background: var(--segment); }
.usage-allocation-bar > span + span { box-shadow: inset 1px 0 var(--solid); }
.usage-segment-codex { --segment: #e6ac4f; }
.usage-segment-claude { --segment: #d8917c; }
.usage-segment-gemini { --segment: #8c9ee5; }
.usage-segment-dev { --segment: #68afdb; }
.usage-segment-live { --segment: #3ebd93; }
.usage-allocation-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.usage-allocation-legend li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--panel2); font-size: 11px; }
.usage-allocation-legend li > span { width: 8px; height: 8px; border-radius: 50%; background: var(--segment); }
.usage-allocation-legend strong { font-variant-numeric: tabular-nums; }
.usage-cost-heading, .usage-cost-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.usage-cost-heading { justify-content: space-between; margin-bottom: 12px; }
.usage-section .usage-cost-heading h2 { margin-bottom: 0; }
.usage-cost-links .btn { min-height: 44px; }
.usage-evidence-action {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.usage-source-table td:first-child { font-weight: 700; }
.usage-source-table td:nth-child(2) { color: var(--muted); }
.usage-source-table td:last-child { white-space: normal; }
.usage-source-filter { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.usage-source-filter select { min-width: 0; max-width: 100%; }
.usage-evidence-definitions { margin: 0; }
.usage-evidence-definitions > div {
  display: grid;
  grid-template-columns: minmax(110px,1fr) minmax(0,2fr);
  gap: 6px 12px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.usage-evidence-definitions dt { color: var(--muted); }
.usage-evidence-definitions dd { margin: 0; overflow-wrap: anywhere; }
.usage-evidence-definitions > div:last-child { border-bottom: 0; }
.usage-request-proof { margin-top: 6px; font-size: .8125rem; }
.usage-request-proof summary { min-height: 34px; padding-block: 6px; color: var(--ink); cursor: pointer; }
.usage-request-proof .usage-evidence-definitions > div { display: block; }
.usage-request-proof .usage-evidence-definitions dd { margin-top: 2px; }
.usage-billing-bridge {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 12px 16px;
  margin: 0;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}
.usage-billing-bridge dt { color: var(--muted); font-size: .8125rem; }
.usage-billing-bridge dd { margin: 3px 0 0; font-size: 1.1875rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-billing-bridge > div:last-child dd { color: var(--ink); }
.usage-owner-sources { margin-top: 16px; border-top: 1px solid var(--line); }
.usage-owner-source { display: flex; justify-content: space-between; align-items: center; gap: 6px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.usage-owner-source > div { flex: 1 1 260px; min-width: 0; }
.usage-owner-source h3 { margin: 0; font: 700 .9375rem var(--ui); }
.usage-owner-source p { margin: 3px 0 0; font-size: .875rem; }
.usage-owner-source .btn, .usage-owner-cost > .btn { min-height: 44px; }
.usage-owner-nocharge { margin: 12px 0; }
.usage-owner-corrections { margin-top: 12px; }
.usage-owner-corrections summary { cursor: pointer; min-height: 44px; padding: 11px 0; font-weight: 700; }
.usage-owner-cost > .btn { margin-top: 8px; }
.usage-unified-costs :is(th,td):nth-child(3) { text-align: right; white-space: nowrap; }
.usage-unified-costs td:first-child { font-weight: 700; }
.usage-unified-costs td:nth-child(2) { color: var(--muted); }
.usage-live { margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-live[data-connected="false"] span { display: none; }
.usage-toolbar label { font-size: 13px; color: var(--muted); }
.usage-toolbar select { min-height: 44px; color: var(--ink); background: var(--solid); border: 1px solid var(--line2); border-radius: 10px; padding: 0 9px; }
.usage-toolbar nav { gap: 16px; font-size: 13px; }
.usage-toolbar a, .usage-settings-line a { text-underline-offset: 4px; }
.usage-toolbar a { display: inline-flex; align-items: center; min-height: 44px; }
.usage-overview, .usage-section, .usage-details, .usage-state {
  min-width: 0;
  background: var(--solid);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.usage-overview, .usage-section, .usage-state { padding: 24px; }
.usage-totals {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: clamp(12px, 4vw, 56px);
  margin: 0 0 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.usage-totals dt { color: var(--muted); font-size: 13px; }
.usage-totals dd { margin: 4px 0 0; font: 700 clamp(29px, 4vw, 58px)/1.08 var(--num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-totals div + div dd { font-size: clamp(27px, 3vw, 44px); }
.usage-totals dd.usage-equivalent, .usage-totals div + div dd.usage-equivalent { font: 500 13px var(--ui); color: var(--muted); }
.usage-bill-line { font-size: 14px; font-variant-numeric: tabular-nums; }
.usage-cap { white-space: nowrap; }
.usage-progress { display: block; width: 100%; margin-top: 10px; height: 8px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: var(--line2); }
.usage-progress::-webkit-progress-bar { background: var(--line2); }
.usage-progress::-webkit-progress-value { background: var(--usage-accent); }
.usage-progress::-moz-progress-bar { background: var(--usage-accent); }
.usage-note { margin-top: 12px; max-width: 72ch; font-size: 13px; }
.usage-section h2 { margin: 0 0 12px; font-size: 23px; }
.usage-chart { display: block; width: 100%; height: clamp(96px, 15vw, 150px); fill: var(--usage-accent); }
.usage-chart-grid { fill: none; stroke: var(--line2); }
.usage-chart-scale, .usage-chart-days { font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-chart-scale { margin-bottom: 4px; }
.usage-chart-days { display: flex; justify-content: space-between; margin-top: 5px; }
.usage-table { min-width: 0; overflow-x: auto; }
.usage-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.usage-table th, .usage-table td { padding: 11px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.usage-table th { color: var(--muted); font-size: 12px; }
.usage-table th:first-child, .usage-table td:first-child { padding-left: 0; }
.usage-table th:last-child, .usage-table td:last-child { padding-right: 0; text-align: right; }
.usage-table td { font-size: 13px; }
.usage-table td:last-child { white-space: nowrap; }
.usage-table small { display: block; color: var(--muted); font-size: 11px; }
.usage-call-table time { white-space: nowrap; }
.usage-source-pill { display: inline-block; padding: 2px 7px; border-radius: 999px; color: var(--ink); background: var(--panel2); font-size: 10px; font-weight: 800; white-space: nowrap; }
.usage-build-subscriptions th:last-child,
.usage-build-subscriptions td:last-child { text-align: left; white-space: normal; }
.usage-build-subscriptions td:nth-child(n+2):nth-child(-n+4) { white-space: nowrap; }
@media (max-width: 600px) {
  .usage-build-subscriptions thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .usage-build-subscriptions tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 10px 0; gap: 7px; border-bottom: 1px solid var(--line); }
  .usage-build-subscriptions td { padding: 0; border: 0; font-size: 12px; }
  .usage-build-subscriptions td:first-child,
  .usage-build-subscriptions td:last-child { grid-column: 1 / -1; }
  .usage-build-subscriptions td:first-child { font-weight: 700; }
  .usage-build-subscriptions td:last-child { color: var(--muted); }
  .usage-build-subscriptions td:nth-child(n+2):nth-child(-n+4)::before { display: block; font-size: 11px; color: var(--muted); }
  .usage-build-subscriptions td:nth-child(2)::before { content: "Monthly plan"; }
  .usage-build-subscriptions td:nth-child(3)::before { content: "Regal USD"; }
  .usage-build-subscriptions td:nth-child(4)::before { content: "Regal INR"; }
}
.usage-disclose {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  min-height: 44px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.usage-disclose::before {
  content: '';
  flex: 0 0 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}
.usage-disclose[aria-expanded="true"]::before { transform: translateY(-2px) rotate(45deg); }
.usage-disclose span { min-width: 0; }
.usage-disclose:hover span { text-decoration: underline; text-underline-offset: 3px; }
.usage-disclose small { font-weight: 500; }
.usage-group-detail > td { padding: 0 0 12px; white-space: normal; }
.usage-call-detail { padding: 0 12px; background: var(--bg); border-top: 1px solid var(--line); }
.usage-call-detail tr:last-child td { border-bottom: 0; }
.usage-pending, .usage-table small.usage-pending { color: var(--amber, #815500); }
[data-theme="dark"] .usage-pending, [data-theme="dark"] .usage-table small.usage-pending { color: #f4ba64; }
.usage-pager { justify-content: center; margin-top: 14px; font-size: 13px; }
.usage-pager button, .usage-details summary { min-height: 44px; }
.usage-pager button:disabled { opacity: .45; cursor: default; }
.usage-details summary { padding: 14px 24px; font-weight: 700; cursor: pointer; }
.usage-details-body { padding: 0 24px 24px; }
.usage-details h3 { font-size: 20px; margin: 24px 0 8px; }
.usage-details h3:first-child { margin-top: 8px; }
.usage-detail-list { margin: 0 0 14px; padding-left: 19px; overflow-wrap: anywhere; }
.usage-details .formgrid { margin: 0; padding: 0; border: 0; background: transparent; animation: none; }
.usage-details .formgrid label { min-width: 0; }
.usage-page :focus-visible, .usage-settings-line :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.usage-settings-line { font-size: 14px; }
.usage-build-overview h2 { max-width: 36ch; margin: 0 0 22px; font-size: clamp(22px, 3vw, 36px); line-height: 1.18; text-wrap: balance; }
.usage-build-totals, .usage-build-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.usage-build-totals dd, .usage-build-totals div + div dd { font-size: clamp(25px, 3vw, 42px); }
.usage-build-stats { display: grid; gap: 12px 20px; margin: 16px 0 0; }
.usage-build-stats dt { color: var(--muted); font-size: 13px; }
.usage-build-stats dd { margin: 4px 0 0; font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.usage-codex-stats { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 480px; }
.usage-codex-stats dd { overflow-wrap: anywhere; }
.usage-codex-stats dd + dt { margin-top: 8px; }
.usage-codex-stats dd:last-child { font-size: 16px; }
.usage-codex-features { margin-top: 16px; }
.usage-codex-features :is(th,td):nth-child(2) { text-align: right; white-space: nowrap; }
.usage-codex-features th:last-child { text-align: right; }
.usage-quota-line { justify-content: flex-start; }
.usage-build-days th, .usage-build-days td { width: 38%; }
.usage-build-days th:first-child, .usage-build-days td:first-child { width: 24%; }
.usage-bar-value { display: block; margin: 0 0 5px; }
.usage-daily-track { display: block; height: 5px; overflow: hidden; border-radius: 4px; background: var(--line2); }
.usage-daily-bar { display: block; height: 100%; border-radius: inherit; background: var(--usage-accent); }
.usage-daily-bar.inr { background: var(--blue); }

@media (max-width: 1050px) {
  .usage-command-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .usage-page { gap: 16px; }
  .usage-tabs { width: 100%; }
  .usage-tabs a { flex: 1 1 auto; padding-inline: 5px; font-size: 12px; text-align: center; }
  .agreement-form { grid-template-columns: minmax(0,1fr); }
  .agreement-actions { gap: 6px 8px; }
  .agreement-amounts dt { font-size: .75rem; }
  .agreement-amounts dd { font-size: 1rem; }
  .usage-command-kpis { gap: 8px; }
  .usage-command-kpis > div { padding: 12px; }
  .usage-unified-costs :is(th,td) { padding-inline: 5px; font-size: 11px; }
  .usage-source-table :is(table,tbody) { display: block; }
  .usage-source-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .usage-source-table tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "source price" "basis basis" "activity activity";
    gap: 4px 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .usage-source-table td { border: 0; padding: 0; }
  .usage-source-table td:nth-child(1) { grid-area: source; }
  .usage-source-table td:nth-child(2) { grid-area: basis; }
  .usage-source-table td:nth-child(3) { grid-area: activity; }
  .usage-source-table td:nth-child(4) { grid-area: price; }
  .usage-source-filter { display: grid; width: 100%; gap: 4px; }
  .usage-source-filter select { width: 100%; }
  .usage-billing-bridge { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .usage-billing-bridge > div:last-child { grid-column: 1 / -1; }
  .usage-call-table.usage-proof-table tbody > tr:not(.usage-group-detail) {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "when cost" "what what";
  }
  .usage-call-table.usage-proof-table td:nth-child(2) { grid-area: what; }
  .usage-call-table.usage-proof-table td:nth-child(3) { grid-area: cost; font-weight: 750; }
  .usage-correction-table :is(td,th) { padding-inline: 4px; font-size: 11px; }
  .usage-correction-table th { overflow-wrap: normal; }
  .usage-toolbar { gap: 4px 12px; }
  .usage-overview, .usage-section, .usage-state { padding: 14px; }
  .usage-details summary { padding-inline: 14px; }
  .usage-details-body { padding-inline: 14px; }
  .usage-totals { margin-bottom: 14px; padding-bottom: 14px; }
  .usage-totals dt { font-size: 12px; }
  .usage-call-table :is(table,tbody) { display: block; }
  .usage-call-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .usage-call-table tbody > tr:not(.usage-group-detail) {
    display: grid;
    grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) auto;
    grid-template-areas: 'when who cost' 'what site site';
    gap: 4px 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }
  .usage-call-table :is(th,td) { padding: 0; border-bottom: 0; font-size: 11px; line-height: 1.45; }
  .usage-call-table td:nth-child(1) { grid-area: when; }
  .usage-call-table td:nth-child(2) { grid-area: who; }
  .usage-call-table td:nth-child(3) { grid-area: what; }
  .usage-call-table td:nth-child(4) { grid-area: site; text-align: right; color: var(--muted); }
  .usage-call-table td:nth-child(5) { grid-area: cost; font-weight: 750; }
  .usage-group-detail:not([hidden]), .usage-group-detail > td { display: block; }
  .usage-call-table time small { font-size: 10px; }
  .usage-call-detail { padding-inline: 8px; }
  .usage-disclose { gap: 4px; }
  .usage-disclose::before { flex-basis: 4px; height: 4px; }
  .usage-build-totals { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .usage-build-totals div:last-child { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
  .usage-breakdown th, .usage-breakdown td { padding-inline: 4px; font-size: 11px; }
}
