.usage-costs {
  --usage-accent: #91c9e5;
  --usage-internal: #baa5db;
  color: var(--text);
}
.usage-costs[aria-busy='true'] { cursor: progress; }
.usage-costs-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.usage-costs-heading { flex-wrap: wrap; }
.usage-costs-heading .intro { margin-block: 0; }
.usage-costs h2 { font-size: 19px; font-weight: 600; letter-spacing: -.018em; }
.usage-costs-row p { margin-top: 4px; }
.usage-costs-filters, .usage-costs-legend, .usage-costs-controls, .usage-costs-segments {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
}
.usage-costs-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.usage-costs-control select {
  appearance: none;
  min-width: 85px;
  min-height: 42px;
  padding: 8px 27px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 12px) 52% / 4px 4px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 8px) 52% / 4px 4px no-repeat,
    var(--elevated);
}
.usage-costs-month select { min-width: 128px; }
.usage-costs-cards, .usage-costs-charts, .usage-costs-split { display: grid; gap: 16px; }
.usage-costs-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.usage-costs-charts { grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr); }
.usage-costs-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.usage-costs .usage-costs-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 19px;
}
.usage-costs .usage-costs-kpi {
  padding: 16px 18px;
  background: linear-gradient(145deg, #1a2028, var(--surface) 74%);
}
.usage-costs .usage-costs-kpi:first-child { border-color: #456071; }
.usage-costs-kpi p { font-size: 13px; }
.usage-costs-kpi strong, .usage-costs-total strong {
  display: block;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.usage-costs-kpi strong {
  font-size: clamp(21px, 3vw, 38px);
  letter-spacing: -.05em;
  line-height: 1.14;
}
.usage-costs-kpi small { display: block; overflow-wrap: anywhere; }
.usage-costs-kpi small, .usage-costs-note, .usage-costs-legend {
  color: var(--muted);
  font-size: 12px;
}
.usage-costs-legend { gap: 5px 12px; }
.usage-costs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.usage-costs-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--usage-accent);
}
.usage-costs-legend .internal i { background: var(--usage-internal); }
.usage-costs-legend .total i { background: var(--text); }
.usage-costs-legend .unclassified i, .usage-costs-track .unclassified { background: var(--warning); }
.usage-costs-row .usage-costs-note, .usage-costs-row .muted { font-size: 13px; }
.usage-costs figure { margin: 0; }
.usage-costs canvas { display: block; width: 100%; height: 190px; margin: 12px 0 8px; }
.usage-costs-segments {
  flex-wrap: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  background: var(--canvas);
}
.usage-costs-segments button {
  min-height: 32px;
  border: 0;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--muted);
}
.usage-costs-segments button[aria-pressed='true'] { background: #303847; color: var(--text); }
.usage-costs-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
  margin: 12px 0 10px;
}
.usage-costs-bars button {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 4px;
  width: 100%;
  height: 154px;
  padding: 4px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
}
.usage-costs-bars button[aria-pressed='true'] {
  color: var(--text);
  border-color: #455567;
  background: #232c37;
  font-weight: 650;
}
.usage-costs-track {
  display: flex;
  flex-direction: column-reverse;
  height: 119px;
  width: min(63%, 21px);
}
.usage-costs-track span { display: block; border-radius: 2px; background: #75abc8; }
.usage-costs-track .internal { background: #aa96cb; }
.usage-costs-track.zero::before { content: ''; height: 1px; background: #49515e; }
.usage-costs-track.unknown::before { content: ''; height: 3px; background: var(--warning); }
.usage-costs-total {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.usage-costs-total strong { font-size: 19px; }
.usage-costs-below { margin-top: 16px; }
.usage-costs-billing-grid { margin-top: 13px; }
.usage-costs-box {
  padding: 13px 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.usage-costs-box strong { display: block; margin: 3px 0; font-size: 22px; }
.usage-costs-box p { font-size: 13px; }
.usage-costs-box button { margin-top: 11px; }
.usage-costs button:disabled { cursor: default; }
.usage-costs-status {
  display: inline-block;
  white-space: nowrap;
  padding: 3px 9px;
  border: 1px solid #3f4957;
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.usage-costs-status[data-tone='warning'] { color: var(--warning); border-color: #70553d; }
.usage-costs-status[data-tone='success'] { color: var(--success); border-color: #42604c; }
.usage-costs-lines { margin-top: 10px; }
.usage-costs-lines div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.usage-costs-lines div:last-child { border: 0; }
.usage-costs-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-costs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-costs-table th, .usage-costs-table td { padding: 6px; border-bottom: 1px solid var(--line); }
.usage-costs-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 550; }
.usage-costs-table th.usage-costs-num { text-align: right; }
.usage-costs-table tr:last-child td { border-bottom: 0; }
.usage-costs button.quiet { color: var(--usage-accent); min-height: 38px; padding: 4px 6px; }
.usage-costs-history { margin-top: 12px; }
.usage-costs-history-row {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) minmax(78px, auto) 65px;
  align-items: center;
  gap: 8px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.usage-costs-history-row time, .usage-costs-history-row small { color: var(--muted); font-size: 12px; }
.usage-costs-history-row small { display: block; }
.usage-costs-history-row .usage-costs-num { font-weight: 600; }
.usage-costs-controls { justify-content: end; margin-top: 12px; }
.usage-costs-controls button { min-height: 38px; padding: 5px 10px; }
.usage-costs-empty { margin-top: 12px; padding: 12px; background: var(--canvas); border-radius: 8px; }
.usage-costs details summary { cursor: pointer; font-weight: 550; }
.usage-costs details p { margin-top: 8px; }
.usage-costs-feedback:empty { display: none; }
.usage-costs-feedback { margin: 10px 0; }
.usage-costs-dialog { margin: auto; width: min(530px, calc(100% - 28px)); max-height: 90dvh; }
.usage-costs-dialog dl { margin: 13px 0 0; }
.usage-costs-dialog dl div {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.usage-costs-dialog dt { color: var(--muted); }
.usage-costs-dialog dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 1160px) {
  .usage-costs-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .usage-costs-heading { align-items: stretch; flex-direction: column; }
  .usage-costs-filters { display: grid; grid-template-columns: minmax(70px, 87px) minmax(100px, 127px); }
  .usage-costs-control select, .usage-costs-month select { min-width: 0; width: 100%; }
  .usage-costs-cards { gap: 7px; }
  .usage-costs-kpi strong { font-size: clamp(17px, 5vw, 26px); overflow-wrap: anywhere; }
  .usage-costs-kpi p, .usage-costs-kpi small { font-size: 11px; }
  .usage-costs .usage-costs-panel { padding: 12px; }
  .usage-costs .usage-costs-kpi { padding: 9px; }
  .usage-costs-history-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 7px; }
  .usage-costs-history-row time { grid-column: 1 / -1; }
  .usage-costs-split { grid-template-columns: minmax(0, 1fr); }
  .usage-costs-bars { gap: 1px; }
  .usage-costs-table { table-layout: fixed; font-size: 12px; }
  .usage-costs-table td, .usage-costs-table th { padding: 5px 2px; }
  .usage-costs-table th { white-space: normal; overflow-wrap: anywhere; }
  .usage-costs-table td:last-child { font-size: 11px; overflow-wrap: anywhere; }
  .usage-costs-table td button.quiet { padding-inline: 0; font-size: 11px; }
  .usage-costs canvas { height: 174px; }
}

@media (max-width: 370px) {
  #usage-costs .usage-costs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #usage-costs .usage-costs-kpi:first-child { grid-column: 1 / -1; }
}
