.ai-usage-dialog {
  --usage-ink: #20242c;
  --usage-muted: #67717e;
  --usage-line: #e4e7ec;
  --usage-accent: #2867c9;
  width: 1200px;
  max-width: calc(100vw - 48px);
  height: min(860px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  margin: auto;
  border: 1px solid #dfe3e9;
  border-radius: 18px;
  background: #fff;
  color: var(--usage-ink);
  box-shadow: 0 24px 80px #18243529;
  font-size: 13px;
}
.ai-usage-dialog[open] { display: flex; flex-direction: column; }
.ai-usage-dialog::backdrop { background: #17202e40; backdrop-filter: blur(4px); }
.ai-usage-dialog button,
.ai-usage-dialog input,
.ai-usage-dialog select { font: inherit; }
.ai-usage-dialog button:focus-visible,
.ai-usage-dialog input:focus-visible,
.ai-usage-dialog select:focus-visible,
.ai-usage-table-scroll:focus-visible { outline: 2px solid var(--usage-accent); outline-offset: 3px; }
.ai-usage-dialog button:disabled { opacity: .4; cursor: default; }
.ai-usage-header { display: flex; align-items: center; gap: 13px; padding: 24px 28px 20px; flex: none; border-bottom: 0; }
.ai-usage-heading-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; color: #3f556f; background: #f0f3f7; }
.ai-usage-heading { min-width: 0; flex: 1; }
.ai-usage-heading h2 { margin: 0 0 5px; font-size: 22px; font-weight: 650; letter-spacing: -.4px; }
.ai-usage-heading p { margin: 0; color: var(--usage-muted); font-size: 13px; line-height: 1.5; }
.ai-usage-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f2f3f5; color: #606976; flex: none; }
.ai-usage-dialog .ai-usage-close:hover { background: #e7eaef; color: var(--usage-ink); }
.ai-usage-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 28px 24px; overscroll-behavior: contain; }
.ai-usage-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 4px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--usage-line); }
.ai-usage-stat { min-width: 0; padding: 0 22px; border: 0; border-radius: 0; background: transparent; }
.ai-usage-stat:first-child { padding-left: 0; }
.ai-usage-stat:last-child { padding-right: 0; }
.ai-usage-stat + .ai-usage-stat { border-left: 1px solid var(--usage-line); }
.ai-usage-stat-label { display: flex; align-items: center; gap: 7px; color: #596371; font-size: 12px; line-height: 18px; }
.ai-usage-stat-label svg { color: #7c8795; }
.ai-usage-stat strong { display: block; font-variant-numeric: tabular-nums; font-size: clamp(23px, 2.2vw, 30px); letter-spacing: -.7px; font-weight: 600; margin: 8px 0 5px; line-height: 1.2; overflow-wrap: anywhere; }
.ai-usage-stat small { display: block; color: var(--usage-muted); font-size: 12px; line-height: 1.5; }
.ai-usage-stat .ai-usage-price-pending { font-size: 25px; line-height: 1.44; color: #424b58; letter-spacing: 0; }
.ai-usage-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.ai-usage-section-heading h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin: 0; }
.ai-usage-section-heading h3 span { display: inline; font-size: 12px; font-weight: 400; color: var(--usage-muted); }
.ai-usage-heading-actions { display: flex; align-items: center; gap: 6px; }
.ai-usage-heading-actions button { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--usage-line); border-radius: 7px; background: #fff; color: #485463; white-space: nowrap; font-size: 12px; }
.ai-usage-dialog .ai-usage-heading-actions button:hover,
.ai-usage-dialog .ai-usage-heading-actions button[aria-expanded=true] { background: #f0f3f7; border-color: #d7dde6; color: var(--usage-ink); }
.ai-usage-prices { padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--usage-line); background: #fafbfc; border-radius: 10px; }
.ai-usage-prices > p { margin: 0 0 10px; color: #596575; font-size: 12px; line-height: 1.7; }
.ai-usage-prices table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 12px; text-align: left; }
.ai-usage-prices th { font-weight: 500; color: #596575; padding: 9px 8px; }
.ai-usage-prices td { padding: 11px 8px; border-top: 1px solid var(--usage-line); }
.ai-usage-prices td:not(:first-child) { color: var(--usage-muted); }
.ai-usage-prices-wrap { overflow-x: auto; }
.ai-usage-filters { display: grid; flex-wrap: nowrap; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, .8fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; padding: 14px 16px; background: #f6f7f9; border: 1px solid #edf0f3; border-radius: 10px; }
.ai-usage-filters label { display: flex; flex: initial; flex-direction: column; min-width: 0; gap: 7px; font-size: 12px; line-height: 1.3; color: #596371; }
.ai-usage-filters input,
.ai-usage-filters select { width: 100%; height: 36px; min-width: 0; max-width: none; border: 1px solid #d9dee6; border-radius: 7px; background: #fff; color: #303a48; padding: 6px 9px; font-size: 13px; }
.ai-usage-filters input:hover,
.ai-usage-filters select:hover { border-color: #bbc5d3; }
.ai-usage-filter-actions { display: flex; gap: 8px; margin: 0; width: auto; }
.ai-usage-filter-actions button { flex: none; height: 36px; padding: 6px 15px; border-radius: 7px; white-space: nowrap; background: #fff; border: 1px solid #d9dee6; color: #485463; }
.ai-usage-dialog .ai-usage-filter-actions button:hover { background: #e9edf3; border-color: #bbc5d3; color: #283445; }
.ai-usage-dialog .ai-usage-filter-actions .ai-usage-apply { color: #fff; background: var(--usage-accent); border-color: var(--usage-accent); }
.ai-usage-dialog .ai-usage-filter-actions .ai-usage-apply:hover { color: #fff; background: #1f57ad; border-color: #1f57ad; }
.ai-usage-filter-error { grid-column: 1 / -1; font-size: 12px; color: #ad3432; margin: 0; }
.ai-usage-note { font-size: 12px; color: var(--usage-muted); line-height: 1.7; margin: 14px 0 0; }
.ai-usage-table-scroll { overflow: auto; border: 1px solid var(--usage-line); border-radius: 10px; min-height: 180px; background: #fff; }
.ai-usage-table { width: 100%; min-width: 920px; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-usage-table th { background: #f7f8fa; color: #596371; font-size: 12px; font-weight: 500; line-height: 20px; padding: 11px 14px; border-bottom: 1px solid var(--usage-line); }
.ai-usage-table td { padding: 13px 14px; border-bottom: 1px solid #eceff3; color: #35404e; font-size: 13px; line-height: 20px; vertical-align: middle; }
.ai-usage-table tbody > tr:last-child > td { border-bottom: 0; }
.ai-usage-table .ai-usage-numeric { text-align: right; }
.ai-usage-table th:first-child,
.ai-usage-table td:first-child { padding-left: 10px; padding-right: 0; width: 36px; }
.ai-usage-row:hover > td,
.ai-usage-row.is-expanded > td { background: #f8fafd; }
.ai-usage-expand { display: grid; place-items: center; width: 26px; height: 30px; border-radius: 5px; color: #727f8f; }
.ai-usage-dialog .ai-usage-expand:hover { background: #e7edf6; color: #305d9a; }
.ai-usage-expand svg { transition: transform .14s; }
.ai-usage-expand[aria-expanded=true] svg { transform: rotate(90deg); }
.ai-usage-table small { display: block; color: #75808e; font-size: 11px; line-height: 18px; }
.ai-usage-model { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid #e0e7f2; border-radius: 6px; line-height: 19px; white-space: nowrap; font-size: 12px; background: #f1f5fb; color: #3b6396; }
.ai-usage-model.astra { background: #faf2f5; border-color: #f0e2e8; color: #93576f; }
.ai-usage-model.sol61 { background: #f4f1fa; border-color: #e7e1f1; color: #73589c; }
.ai-usage-model.unknown { background: #f1f3f5; border-color: #e4e7eb; color: #596575; }
.ai-usage-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.ai-usage-state::before { content: ''; display: block; height: 5px; width: 5px; border-radius: 50%; background: currentColor; }
.ai-usage-state.succeeded { color: #35784b; }
.ai-usage-state.failed,
.ai-usage-state.rejected { color: #ad4646; }
.ai-usage-state.cancelled,
.ai-usage-state.interrupted { color: #717b89; }
.ai-usage-state.running { color: #386dac; }
.ai-usage-timing { display: flex; align-items: center; gap: 7px; }
.ai-usage-timing span { font-size: 12px; line-height: 20px; color: #35404e; background: transparent; padding: 0; border-radius: 0; }
.ai-usage-timing span + span { color: #727d8c; background: transparent; }
.ai-usage-timing span + span::before { content: '/'; margin-right: 7px; color: #a3adba; }
.ai-usage-timing .ai-usage-unavailable { color: #7a8593; background: transparent; }
.ai-usage-table .ai-usage-cost { color: #727d8c !important; font-size: 12px !important; }
.ai-usage-table .ai-usage-detail-cell { padding: 0 14px 16px 46px; background: #f8fafd; white-space: normal; }
.ai-usage-detail { padding: 16px 18px; background: #f0f4f9; border: 1px solid #e3e9f1; border-radius: 8px; }
.ai-usage-detail dl { display: grid; grid-template-columns: 120px minmax(0, 1fr) 115px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 12px; line-height: 19px; }
.ai-usage-detail dt { color: #697687; }
.ai-usage-detail dd { margin: 0; color: #354458; overflow-wrap: anywhere; }
.ai-usage-detail code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.ai-usage-detail .ai-usage-detail-wide { grid-column: 2 / -1; }
.ai-usage-detail p { margin: 13px 0 0; border-top: 1px solid #dce4ef; padding-top: 11px; color: #637388; font-size: 12px; line-height: 1.65; }
.ai-usage-empty { min-height: 216px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 10px; color: #8b97a7; padding: 32px 24px; }
.ai-usage-empty > svg { margin-bottom: 2px; }
.ai-usage-empty strong { font-size: 15px; font-weight: 500; color: #465366; }
.ai-usage-empty p { max-width: 400px; font-size: 13px; line-height: 1.7; margin: 0; color: #738093; }
.ai-usage-empty button,
.ai-usage-error button { color: #2e66b6; border: 1px solid #d4dfef; border-radius: 7px; background: #fff; padding: 7px 13px; margin-top: 3px; }
.ai-usage-dialog .ai-usage-empty button:hover,
.ai-usage-dialog .ai-usage-error button:hover { color: #234f8f; border-color: #b8cbe7; background: #edf3fc; }
.ai-usage-error { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #a6413e; font-size: 13px; line-height: 1.6; background: #fff6f5; border: 1px solid #eed8d5; padding: 11px 13px; border-radius: 8px; margin-bottom: 14px; }
.ai-usage-error button { margin: 0 0 0 auto; }
.ai-usage-loading-line { height: 2px; flex: none; background: linear-gradient(90deg, #edf2fa, #739bd8, #edf2fa); background-size: 200% 100%; animation: ai-usage-loading 1.2s linear infinite; }
.ai-usage-loading-line:not([data-loading=true]) { background: transparent; animation: none; }
@keyframes ai-usage-loading { to { background-position: -200% 0; } }
.ai-usage-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; font-size: 12px; color: var(--usage-muted); padding-top: 16px; font-variant-numeric: tabular-nums; }
.ai-usage-pagination-label { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
/* This atomic row must override the application's column-oriented form labels. */
.ai-usage-pagination-label > label { display: inline-flex; flex-direction: row; align-items: center; flex: none; gap: 8px; margin: 0; font-size: 12px; line-height: 20px; color: var(--usage-muted); white-space: nowrap; }
.ai-usage-pagination select { flex: none; width: 64px; height: 34px; border: 1px solid #d9dee6; border-radius: 7px; color: #3e4c60; padding: 5px 8px; background: #fff; font-size: 13px; }
.ai-usage-page-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.ai-usage-page-controls button { display: grid; place-items: center; height: 34px; width: 34px; border: 1px solid #d9dee6; border-radius: 7px; background: #fff; color: #56667c; }
.ai-usage-dialog .ai-usage-page-controls button:hover:not(:disabled) { background: #edf2f8; border-color: #b9c9df; color: #285a9e; }
.ai-usage-page-controls output { min-width: 48px; text-align: center; color: #536176; font-variant-numeric: tabular-nums; }
.ai-usage-footer { flex: none; border-top: 1px solid var(--usage-line); padding: 12px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: nowrap; font-size: 11px; color: #768192; line-height: 18px; background: #fbfcfd; }
.ai-usage-footer span:last-child { text-align: right; }
@media (max-width: 860px) {
  .ai-usage-dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); height: calc(100dvh - 24px); }
  .ai-usage-header { padding: 20px 22px 16px; }
  .ai-usage-body { padding: 8px 22px 22px; }
  .ai-usage-stat { padding: 0 15px; }
  .ai-usage-stat strong { font-size: 24px; }
  .ai-usage-stat .ai-usage-price-pending { font-size: 22px; line-height: 1.31; }
  .ai-usage-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ai-usage-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .ai-usage-footer { padding: 11px 22px; }
}
@media (max-width: 600px) {
  .ai-usage-dialog { max-width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .ai-usage-header { padding: 17px 16px 12px; gap: 10px; }
  .ai-usage-heading-icon { display: none; }
  .ai-usage-heading h2 { font-size: 20px; margin-bottom: 4px; }
  .ai-usage-heading p { font-size: 12px; }
  .ai-usage-close { width: 32px; height: 32px; }
  .ai-usage-body { padding: 8px 16px 18px; }
  .ai-usage-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; padding: 2px 0 18px; margin-bottom: 17px; }
  .ai-usage-stat { padding: 0 12px; }
  .ai-usage-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .ai-usage-stat:nth-child(even) { padding-right: 0; }
  .ai-usage-stat-label { font-size: 12px; gap: 6px; }
  .ai-usage-stat-label svg { width: 13px; height: 13px; }
  .ai-usage-stat strong { font-size: 24px; margin: 5px 0 3px; }
  .ai-usage-stat small { font-size: 11px; line-height: 1.5; }
  .ai-usage-stat .ai-usage-price-pending { font-size: 21px; line-height: 1.37; }
  .ai-usage-section-heading { margin-bottom: 12px; gap: 8px; }
  .ai-usage-section-heading h3 { font-size: 15px; }
  .ai-usage-section-heading h3 span { display: none; }
  .ai-usage-heading-actions { gap: 5px; }
  .ai-usage-heading-actions button { padding: 5px 7px; min-height: 30px; }
  .ai-usage-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px; margin-bottom: 14px; }
  .ai-usage-filters label { gap: 5px; }
  .ai-usage-filters input,
  .ai-usage-filters select { height: 35px; padding: 5px 7px; font-size: 12px; }
  .ai-usage-filter-actions { grid-column: 1 / -1; gap: 10px; }
  .ai-usage-filter-actions button { flex: 1; height: 34px; }
  .ai-usage-table-scroll { border-radius: 8px; }
  .ai-usage-empty { min-height: 190px; padding: 25px 18px; }
  .ai-usage-empty p { font-size: 12px; }
  .ai-usage-prices { padding: 12px; }
  .ai-usage-prices table { min-width: 510px; }
  .ai-usage-pagination { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding-top: 14px; }
  .ai-usage-pagination-label { display: contents; }
  .ai-usage-pagination-label > span { grid-column: 1 / -1; }
  .ai-usage-pagination-label > label { justify-self: start; gap: 6px; }
  .ai-usage-page-controls { justify-self: end; gap: 3px; }
  .ai-usage-page-controls output { min-width: 42px; }
  .ai-usage-page-controls button { width: 32px; }
  .ai-usage-note { font-size: 11px; line-height: 1.7; margin-top: 12px; }
  .ai-usage-footer { padding: 9px 16px; flex-wrap: wrap; gap: 2px 12px; font-size: 10px; }
  .ai-usage-footer span:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-usage-loading-line { animation: none; }
  .ai-usage-expand svg { transition: none; }
}
.ai-usage-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Exact currency values and request-time tariff breakdown. */
.ai-usage-stat .ai-usage-total-cost { font-size: 25px; line-height: 1.44; letter-spacing: -.3px; }
.ai-usage-table .ai-usage-cost { color: #35404e !important; font-size: 13px !important; }
.ai-usage-cost-breakdown { margin-top: 17px; padding-top: 14px; border-top: 1px solid #dce4ef; }
.ai-usage-cost-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.ai-usage-cost-heading strong { font-size: 12px; font-weight: 600; color: #354458; }
.ai-usage-cost-heading span { font-size: 11px; color: #697687; }
.ai-usage-table .ai-usage-cost-table { width: 100%; min-width: 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ai-usage-table .ai-usage-cost-table th,
.ai-usage-table .ai-usage-cost-table td { padding: 7px 10px; width: auto; border-bottom: 1px solid #e0e6ef; font-size: 12px; line-height: 19px; text-align: right; background: transparent; color: #354458; }
.ai-usage-table .ai-usage-cost-table th:first-child { padding-left: 0; text-align: left; }
.ai-usage-table .ai-usage-cost-table th { font-weight: 500; }
.ai-usage-table .ai-usage-cost-table thead th { color: #697687; font-size: 11px; }
.ai-usage-table .ai-usage-cost-table td:last-child,
.ai-usage-table .ai-usage-cost-table th:last-child { padding-right: 0; }
.ai-usage-table .ai-usage-cost-table tfoot th,
.ai-usage-table .ai-usage-cost-table tfoot td { border: 0; padding-top: 10px; font-weight: 600; }
@media (max-width: 860px) { .ai-usage-stat .ai-usage-total-cost { font-size: 21px; line-height: 1.37; } }
@media (max-width: 600px) { .ai-usage-stat .ai-usage-total-cost { font-size: 17px; line-height: 1.69; letter-spacing: -.2px; } }
