.account-body {
  min-width: 320px;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
}

.account-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.account-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.account-brand {
  display: grid;
  gap: 5px;
  padding: 0 8px 22px;
}

.account-brand a {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.account-brand span {
  color: var(--muted);
  font-size: 10px;
}

.account-nav {
  display: grid;
  align-content: start;
  gap: 4px;
}

.account-nav a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.account-nav a:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.account-nav a.active {
  background: var(--surface-selected);
  color: var(--accent-dark);
  font-weight: 700;
}

.account-nav a > span:first-child {
  font-size: 16px;
  text-align: center;
}

.account-sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.account-user-summary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 5px;
}

.account-user-summary > span:last-child {
  display: grid;
  min-width: 0;
}

.account-user-summary strong,
.account-user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-user-summary strong {
  font-size: 11px;
}

.account-user-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.account-footer-actions {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px;
}

.account-footer-actions button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.account-footer-actions button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.account-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
}

.account-page {
  width: min(1440px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 30px clamp(22px, 3.2vw, 52px) 48px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 55px;
  margin-bottom: 24px;
}

.page-heading p,
.page-heading h1 {
  margin: 0;
}

.page-heading p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.page-heading h1 {
  font-size: 23px;
  font-weight: 730;
}

.page-heading > a,
.refresh-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  text-decoration: none;
}

.page-heading > a:hover,
.refresh-button:hover {
  background: var(--surface-hover);
}

.wallet-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.28fr);
  min-height: 160px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-editor-muted);
}

.wallet-balance > div {
  display: grid;
  align-content: center;
  padding: 26px 30px;
}

.wallet-balance > div:first-child {
  border-right: 1px solid var(--line);
}

.wallet-balance span,
.wallet-balance small {
  color: var(--muted);
  font-size: 11px;
}

.wallet-balance strong {
  margin: 9px 0 6px;
  font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.wallet-consumed strong {
  font-size: 24px;
}

.wallet-section,
.trend-section,
.token-breakdown,
.logs-table-section {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.wallet-section > header,
.trend-section > header,
.token-breakdown > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.wallet-section h2,
.trend-section h2,
.token-breakdown h2 {
  margin: 0;
  font-size: 13px;
}

.wallet-section header span,
.trend-section header span,
.token-breakdown header span {
  color: var(--muted);
  font-size: 10px;
}

.recharge-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  padding: 18px;
}

.recharge-options button {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.recharge-options button:hover {
  border-color: var(--control-hover-border);
  background: var(--surface-hover);
}

.recharge-options button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
  background: var(--accent-soft);
}

.recharge-options strong {
  font-size: 17px;
}

.recharge-options span {
  color: var(--muted);
  font-size: 10px;
}

.custom-recharge {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-editor-muted);
}

.custom-recharge label,
.custom-recharge > div {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.amount-input {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
}

.amount-input b {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.amount-input input {
  min-width: 0;
  height: 100%;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.custom-recharge > div strong {
  min-height: 38px;
  padding: 10px 0;
  color: var(--ink);
  font-size: 12px;
}

.custom-recharge > button {
  min-width: 102px;
  height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.custom-recharge > button:hover {
  background: var(--accent-hover);
}

.account-inline-notice {
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--warning);
  font-size: 10px;
}

.account-table-wrap {
  width: 100%;
  overflow: auto;
}

.account-table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.account-table-wrap th,
.account-table-wrap td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.account-table-wrap th {
  background: var(--surface-editor-muted);
  color: var(--ink);
  font-weight: 670;
}

.account-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.account-empty {
  height: 100px;
  color: var(--subtle) !important;
  text-align: center !important;
}

.heading-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heading-controls select,
.log-filters select,
.log-filters input {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--panel);
  color: var(--ink);
  font-size: 10px;
}

.heading-controls select:focus,
.log-filters select:focus,
.log-filters input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.metric-strip:has(.admin-only:not([hidden])) {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.metric-strip > div {
  display: grid;
  min-height: 128px;
  align-content: center;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip span,
.metric-strip small {
  color: var(--muted);
  font-size: 10px;
}

.metric-strip strong {
  margin: 10px 0 5px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.trend-section > header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.metric-toggle {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.metric-toggle button {
  min-height: 27px;
  padding: 4px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.metric-toggle button.active {
  background: var(--panel);
  box-shadow: 0 1px 3px var(--panel-shadow);
  color: var(--ink);
}

.trend-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 330px;
  padding: 28px 22px 42px;
  overflow-x: auto;
  background-image: repeating-linear-gradient(to top, transparent 0, transparent 63px, var(--line) 64px);
}

.trend-bar-item {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  flex: 1 0 34px;
  min-width: 34px;
  max-width: 72px;
  height: 100%;
  align-items: end;
  gap: 7px;
}

.trend-bar-track {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: end;
}

.trend-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #20a9cf;
  transition: height 180ms ease;
}

.trend-bar-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 2px;
  overflow: hidden;
  border-radius: 3px 3px 0 0;
}

.trend-segment {
  display: block;
  min-height: 1px;
}

.trend-segment.normal { background: #20a9cf; }
.trend-segment.cached { background: #008c6d; }
.trend-segment.output { background: #d49219; }

.trend-bar.turns {
  background: #6e75c9;
}

.trend-bar-item > span {
  overflow: hidden;
  color: var(--subtle);
  font-size: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--subtle);
  font-size: 11px;
}

.trend-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0 18px 17px;
  color: var(--muted);
  font-size: 9px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trend-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-input { background: #20a9cf; }
.legend-cache { background: #008c6d; }
.legend-output { background: #d49219; }

.token-breakdown > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.token-breakdown p {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.token-breakdown p:last-child {
  border-right: 0;
}

.token-breakdown p span {
  color: var(--muted);
  font-size: 10px;
}

.token-breakdown p strong {
  font-size: 18px;
}

.log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 0.8fr)) minmax(170px, 1.2fr);
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-editor-muted);
}

.log-filters:has(.admin-only:not([hidden])) {
  grid-template-columns: repeat(5, minmax(110px, 0.75fr)) minmax(160px, 1.2fr);
}

.log-filters input {
  width: 100%;
  padding-right: 10px;
}

.logs-table-section {
  overflow: hidden;
}

.logs-table-wrap {
  max-height: calc(100dvh - 250px);
}

.logs-table {
  min-width: 1000px !important;
}

.logs-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.logs-table td {
  color: var(--ink);
  vertical-align: top;
}

.cell-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cell-stack strong,
.cell-stack span {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-stack strong {
  font-size: 10px;
}

.cell-stack span {
  color: var(--muted);
  font-size: 9px;
}

.token-badge,
.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--surface-selected);
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.status-badge {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.logs-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logs-pagination button {
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
}

.logs-pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.log-detail-button {
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}

.log-detail-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.usage-detail-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-width: none;
  height: min(880px, calc(100dvh - 28px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(8, 14, 11, 0.28);
  color: var(--ink);
}

.usage-detail-dialog::backdrop {
  background: var(--backdrop);
}

.usage-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.usage-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-editor-muted);
}

.usage-detail-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.usage-detail-header h1 {
  margin: 0;
  font-size: 18px;
}

.usage-detail-header > button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.usage-detail-header > button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.usage-detail-content {
  min-height: 0;
  overflow: auto;
  padding: 4px 22px 28px;
}

.detail-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section > h2,
.detail-section > header h2 {
  margin: 0 0 14px;
  font-size: 13px;
}

.detail-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-section > header > span {
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 680;
}

.detail-grid {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) 115px minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-editor-muted);
  font-size: 10px;
}

.detail-grid dt {
  color: var(--muted);
}

.detail-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 620;
}

.detail-grid .detail-wide {
  grid-column: span 3;
  font-weight: 500;
  line-height: 1.55;
}

.detail-grid.compact {
  margin-bottom: 14px;
}

.detail-token-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-editor-muted);
}

.detail-token-strip p {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.detail-token-strip p:last-child {
  border-right: 0;
}

.detail-token-strip span,
.detail-token-strip small {
  color: var(--muted);
  font-size: 9px;
}

.detail-token-strip strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.detail-calculation {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.detail-calculation-result {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--accent-soft);
}

.detail-calculation-result span,
.detail-calculation-result small {
  color: var(--accent-dark);
  font-size: 9px;
}

.detail-calculation-result strong {
  color: var(--accent-dark);
  font-size: 19px;
}

.detail-formula {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 17px 19px;
  background: var(--surface-editor-muted);
}

.detail-formula > span {
  color: var(--muted);
  font-size: 9px;
}

.detail-formula code {
  overflow-x: auto;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
}

.detail-formula strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.detail-price-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-price-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.detail-price-table th,
.detail-price-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.detail-price-table th {
  background: var(--surface-editor-muted);
  color: var(--ink);
}

.detail-price-table tbody tr:last-child td {
  border-bottom: 0;
}

.detail-price-table tr.hit td {
  background: var(--accent-soft);
  color: var(--ink);
}

.tier-badge,
.tier-hit {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  background: #e6edf8;
  color: #315f9b;
  font-size: 9px;
  font-weight: 700;
}

html[data-theme="dark"] .tier-badge {
  background: #26354b;
  color: #9fc4f2;
}

.tier-badge.short {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tier-hit {
  display: none;
  margin-left: 5px;
  background: var(--accent);
  color: #ffffff;
}

.detail-price-table tr.hit .tier-hit {
  display: inline-flex;
}

.account-auth {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
}

.account-auth strong { font-size: 15px; }
.account-auth p { margin: 0; color: var(--muted); font-size: 11px; }
.account-auth a { margin-top: 8px; padding: 8px 12px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; text-decoration: none; }

.account-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(380px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid var(--toast-border);
  border-radius: 6px;
  background: var(--toast-background);
  box-shadow: 0 10px 30px var(--panel-shadow);
  color: var(--toast-text);
  font-size: 10px;
}

@media (max-width: 1100px) {
  .metric-strip,
  .metric-strip:has(.admin-only:not([hidden])) {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-strip > div:nth-child(3n) { border-right: 0; }
  .metric-strip > div:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .recharge-options { grid-template-columns: repeat(2, 1fr); }
  .log-filters,
  .log-filters:has(.admin-only:not([hidden])) { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  html,
  .account-body {
    height: auto;
    min-height: 100%;
  }

  html {
    overflow: auto;
  }

  .account-body { overflow: auto; }
  .account-shell { display: block; height: auto; min-height: 100dvh; padding-bottom: 58px; }
  .account-sidebar { position: static; display: block; padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .account-brand { padding: 0; }
  .account-brand span { display: none; }
  .account-nav { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); }
  .account-nav a { grid-template-columns: 1fr; justify-items: center; min-height: 42px; gap: 2px; padding: 3px; font-size: 9px; }
  .account-nav a > span:first-child { font-size: 14px; }
  .account-sidebar-footer { position: absolute; top: 8px; right: 12px; display: flex; align-items: center; border: 0; padding: 0; }
  .account-user-summary { display: none; }
  .account-footer-actions { grid-template-columns: 32px auto; }
  .account-main { overflow: visible; }
  .account-page { padding: 20px 13px 38px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: 20px; }
  .page-heading > a { display: none; }
  .wallet-balance { grid-template-columns: 1fr; }
  .wallet-balance > div:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .wallet-balance > div { padding: 22px; }
  .custom-recharge { grid-template-columns: 1fr; align-items: stretch; }
  .custom-recharge > button { width: 100%; }
  .dashboard-heading { align-items: flex-end; }
  .heading-controls { display: grid; }
  .metric-strip,
  .metric-strip:has(.admin-only:not([hidden])) { grid-template-columns: 1fr 1fr; }
  .metric-strip > div { min-height: 108px; border-bottom: 1px solid var(--line); }
  .metric-strip > div:nth-child(2n) { border-right: 0; }
  .metric-strip > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .trend-chart { height: 260px; }
  .token-breakdown > div { grid-template-columns: 1fr; }
  .token-breakdown p { border-right: 0; border-bottom: 1px solid var(--line); }
  .token-breakdown p:last-child { border-bottom: 0; }
  .log-filters,
  .log-filters:has(.admin-only:not([hidden])) { grid-template-columns: 1fr 1fr; }
  .log-filters input { grid-column: 1 / -1; }
  .logs-table-wrap { max-height: none; }
  .usage-detail-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); }
  .usage-detail-header { min-height: 58px; padding: 11px 14px; }
  .usage-detail-content { padding: 2px 14px 22px; }
  .detail-grid { grid-template-columns: 92px minmax(0, 1fr); }
  .detail-grid .detail-wide { grid-column: auto; }
  .detail-token-strip { grid-template-columns: 1fr 1fr; }
  .detail-token-strip p:nth-child(2) { border-right: 0; }
  .detail-token-strip p:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .detail-calculation { grid-template-columns: 1fr; }
  .detail-calculation-result { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .trend-bar { transition: none; }
}
