/* ─────────────────────────────────────────────
   RouteBase — personal account
   Data-first dashboard, near-black + citron
   ───────────────────────────────────────────── */

.account-page {
  min-width: 320px;
}

.account-page .site-footer {
  margin-top: 0;
}

.account-main {
  min-height: calc(100vh - var(--header-h) - 90px);
  padding: 30px 0 52px;
}

.account-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.account-page .avatar.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav a.is-active {
  background: var(--panel-2);
  color: var(--text);
}

/* ─────────────────────────────────────────────
   Sidebar
   ───────────────────────────────────────────── */

.account-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.account-user-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.account-user-copy {
  min-width: 0;
}

.account-user-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-user-copy span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

.account-user-chip {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--dim);
  transition: color 0.15s ease;
}

.account-nav-link::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -13px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.account-nav-link:hover {
  background: rgba(252, 252, 254, 0.035);
  color: var(--text-soft);
}

.account-nav-link:hover svg {
  color: var(--muted);
}

.account-nav-link.is-active {
  background: rgba(252, 252, 254, 0.055);
  color: var(--text);
}

.account-nav-link.is-active svg {
  color: var(--accent);
}

.account-nav-link.is-active::before {
  background: var(--accent);
}

.account-sidebar-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.account-health {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.account-health-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  margin-top: 5px;
  border-radius: 50%;
  background: #3b6ea5;
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.09);
}

.account-health b {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
}

.account-health span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.4;
}

.account-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  transition: color 0.15s ease;
}

.account-support:hover {
  color: var(--accent);
}

.account-support svg {
  width: 11px;
  height: 11px;
}

/* ─────────────────────────────────────────────
   View header
   ───────────────────────────────────────────── */

.account-content {
  min-width: 0;
}

.account-view:not([hidden]) {
  animation: account-view-in 0.18s ease both;
}

@keyframes account-view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.account-head-copy {
  min-width: 0;
}

.account-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.account-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.account-head h1 {
  color: var(--text);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.account-head p {
  max-width: 650px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.account-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.account-head-actions .btn svg {
  width: 13px;
  height: 13px;
}

.period-switch {
  display: inline-flex;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.period-switch button {
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.period-switch button:hover {
  color: var(--text-soft);
}

.period-switch button.is-active {
  background: rgba(252, 252, 254, 0.075);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ─────────────────────────────────────────────
   Stats filters
   ───────────────────────────────────────────── */

.stats-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.stats-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.stats-filter-caption {
  color: var(--dim);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.date-field {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.date-field-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  min-width: 116px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.date-field-button svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--dim);
  transition: color 0.15s ease;
}

.date-field-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-3);
}

.date-field-button:hover svg {
  color: var(--accent);
}

.date-field-button:focus-visible {
  border-color: var(--accent-line);
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  color-scheme: dark;
}

.stats-date-word {
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1;
}

.stats-apply {
  height: 30px;
  padding: 0 10px;
  font-size: 10.5px;
}

.stats-source,
.stats-model {
  min-width: 138px;
}

.stats-reset {
  margin-left: auto;
}

/* ─────────────────────────────────────────────
   Metrics
   ───────────────────────────────────────────── */

.account-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.account-metric {
  min-width: 0;
  padding: 13px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
}

.account-metric-balance {
  border-color: rgba(214, 255, 79, 0.16);
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(214, 255, 79, 0.075), transparent 54%),
    linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.metric-chip {
  padding: 2px 6px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.5;
  white-space: nowrap;
}

.metric-period {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.metric-value {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-height: 15px;
  margin-top: 8px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
}

.metric-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 500;
}

.metric-link::after {
  content: "→";
  font-size: 10px;
  transition: transform 0.15s ease;
}

.metric-link:hover::after {
  transform: translateX(1px);
}

.metric-muted {
  color: var(--dim);
  font-size: 9.5px;
}

.metric-delta {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.metric-delta.is-negative {
  color: #f19b8d;
}

.metric-success {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 10px;
}

.metric-success i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3b6ea5;
}

/* ─────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────── */

.account-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(11, 17, 20, 0.96) 0%, rgba(8, 13, 15, 0.98) 100%);
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
}

.account-card-head h2 {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.account-card-head > div > span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
}

.account-card-tag {
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.account-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.account-card-link svg {
  width: 11px;
  height: 11px;
  transition: transform 0.15s ease;
}

.account-card-link:hover {
  color: var(--accent);
}

.account-card-link:hover svg {
  transform: translateX(2px);
}

/* ─────────────────────────────────────────────
   Spend chart
   ───────────────────────────────────────────── */

.account-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(268px, 0.9fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.spend-card,
.model-spend-card {
  min-height: 324px;
  padding: 15px 18px 13px;
}

.spend-card .account-card-head,
.model-spend-card .account-card-head {
  padding: 0;
}

.spend-total {
  text-align: right;
}

.spend-total b {
  display: block;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spend-total small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.spend-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: var(--dim);
  font-size: 9.5px;
}

.spend-legend-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.spend-legend-key i {
  position: relative;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.spend-legend-key i::after {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.spend-peak {
  overflow: hidden;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spend-chart {
  margin-top: 6px;
}

.spend-empty {
  display: grid;
  place-items: center;
  height: 218px;
  color: var(--dim);
  font-size: 10.5px;
}

.spend-chart-inner {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  height: 218px;
}

.spend-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1px 0 23px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.spend-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.spend-canvas svg {
  width: 100%;
  height: 194px;
  overflow: visible;
}

.spend-grid-line {
  stroke: rgba(252, 252, 254, 0.07);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 4;
}

.spend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.spend-area {
  opacity: 0.9;
}

.spend-point {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.spend-x-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 22px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1;
  white-space: nowrap;
}

.spend-hover-line {
  position: absolute;
  top: 0;
  bottom: 22px;
  left: 0;
  width: 1px;
  background: rgba(252, 252, 254, 0.18);
  pointer-events: none;
}

.spend-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 104px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #0d1417;
  color: var(--text-soft);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  white-space: nowrap;
}

.spend-tooltip span {
  display: block;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.spend-tooltip b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────
   Model spend
   ───────────────────────────────────────────── */

.model-spend-card {
  display: flex;
  flex-direction: column;
}

.model-spend-list {
  flex: 1;
  padding: 4px 0 0;
}

.model-spend-row {
  padding: 8px 0;
}

.model-spend-row + .model-spend-row {
  border-top: 1px solid rgba(252, 252, 254, 0.055);
}

.model-spend-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-spend-logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 23px;
  height: 23px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-3);
}

.model-spend-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-spend-name {
  min-width: 0;
}

.model-spend-name b {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-spend-name span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.3;
}

.model-spend-amount {
  min-width: 62px;
  margin-left: auto;
  text-align: right;
}

.model-spend-amount b {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.model-spend-amount span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.model-spend-track {
  height: 2px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(252, 252, 254, 0.06);
}

.model-spend-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0.72;
}

.model-spend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9.5px;
}

.model-spend-foot a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.model-spend-foot a:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────── */

.account-table-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.recent-card {
  margin-bottom: 12px;
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.account-table th {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(252, 252, 254, 0.022);
  color: var(--dim);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.account-table td {
  padding: 9px 12px;
  border-top: 1px solid rgba(252, 252, 254, 0.055);
  color: var(--muted);
  vertical-align: middle;
}

.account-table tbody tr:first-child td {
  border-top: 0;
}

.account-table th:first-child,
.account-table td:first-child {
  padding-left: 18px;
}

.account-table th:last-child,
.account-table td:last-child {
  padding-right: 18px;
}

.account-table tbody tr[data-request-id] {
  cursor: pointer;
  transition: background 0.12s ease;
}

.account-table tbody tr[data-request-id]:hover td {
  background: rgba(252, 252, 254, 0.024);
}

.account-table tbody tr[data-request-id]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cell-time b {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-time span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
}

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

.cell-model-logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-3);
}

.cell-model-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cell-model-copy {
  min-width: 0;
}

.cell-model-copy b {
  display: block;
  overflow: hidden;
  max-width: 210px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-model-copy span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.3;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-cost {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-key {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(252, 252, 254, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip.is-ok {
  border-color: rgba(59, 110, 165, 0.22);
  background: rgba(59, 110, 165, 0.055);
  color: #5b8fc4;
}

.status-chip.is-warn {
  border-color: rgba(230, 196, 122, 0.22);
  background: rgba(230, 196, 122, 0.055);
  color: #e6c47a;
}

.status-chip.is-error {
  border-color: rgba(241, 155, 141, 0.22);
  background: rgba(241, 155, 141, 0.055);
  color: #f19b8d;
}

.status-chip.is-muted {
  color: var(--dim);
}

/* ─────────────────────────────────────────────
   Requests view
   ───────────────────────────────────────────── */

.requests-panel {
  overflow: hidden;
}

.request-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 18px 0;
}

.request-periods {
  display: inline-flex;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.request-periods button {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.request-periods button:hover {
  color: var(--text-soft);
}

.request-periods button.is-active {
  background: rgba(252, 252, 254, 0.075);
  color: var(--text);
}

.account-select {
  height: 32px;
  padding: 0 27px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235d676b' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.account-select:hover {
  border-color: var(--line-strong);
}

.account-select:focus-visible {
  border-color: var(--accent-line);
}

.request-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 175px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--dim);
}

.request-search svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.request-search:focus-within {
  border-color: var(--accent-line);
}

.request-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 10.5px;
  outline: none;
}

.request-search input::placeholder {
  color: var(--dim);
}

.request-search input::-webkit-search-cancel-button {
  display: none;
}

.request-reset {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text-soft);
  font-size: 10px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.request-reset:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.request-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 18px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 10px;
}

.request-summary-muted {
  color: var(--dim);
  font-size: 9.5px;
}

.request-summary-muted::before {
  content: "·";
  margin-right: 8px;
  color: var(--dim);
}

.request-table {
  min-width: 855px;
}

.request-table th:nth-child(1),
.request-table td:nth-child(1) {
  width: 108px;
}

.request-table th:nth-child(2),
.request-table td:nth-child(2) {
  width: 190px;
}

.request-table th:nth-child(3),
.request-table td:nth-child(3) {
  width: 100px;
}

.request-table th:nth-child(4),
.request-table td:nth-child(4) {
  width: 116px;
}

.request-table th:nth-child(5),
.request-table td:nth-child(5) {
  width: 86px;
}

.request-table th:nth-child(6),
.request-table td:nth-child(6) {
  width: 80px;
}

.request-table th:nth-child(7),
.request-table td:nth-child(7) {
  width: 78px;
}

.request-table th:last-child,
.request-table td:last-child {
  width: 36px;
  padding-left: 4px;
}

.request-open {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.request-open svg {
  width: 11px;
  height: 11px;
}

.request-open:hover {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--accent);
}

.request-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9.5px;
}

.account-pager {
  display: flex;
  align-items: center;
  gap: 2px;
}

.account-pager button {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-pager button:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text-soft);
}

.account-pager button.is-active {
  border-color: var(--line-strong);
  background: rgba(252, 252, 254, 0.06);
  color: var(--text);
}

.account-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.account-empty {
  padding: 38px 20px 34px;
  text-align: center;
}

.account-empty-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--dim);
}

.account-empty-icon svg {
  width: 17px;
  height: 17px;
}

.account-empty b {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.account-empty p {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

/* ─────────────────────────────────────────────
   Keys
   ───────────────────────────────────────────── */

.keys-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.keys-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.keys-tab span {
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(252, 252, 254, 0.055);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
}

.keys-tab:hover {
  color: var(--text-soft);
}

.keys-tab.is-active {
  color: var(--text);
}

.keys-tab.is-active span {
  background: var(--accent-soft);
  color: var(--accent);
}

.keys-tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.key-security {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.key-security-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

.key-security-icon svg {
  width: 15px;
  height: 15px;
}

.key-security-copy {
  min-width: 0;
  padding-top: 1px;
}

.key-security-copy b {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
}

.key-security-copy p {
  max-width: 540px;
  margin-top: 2px;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.5;
}

.key-baseurl {
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.key-baseurl > span {
  display: block;
  color: var(--dim);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.key-baseurl > div {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 3px;
}

.key-baseurl code {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  white-space: nowrap;
}

.key-baseurl .icon-btn {
  width: 21px;
  height: 21px;
}

.keys-panel {
  margin-bottom: 12px;
  overflow: hidden;
}

.keys-panel .account-card-head {
  padding-bottom: 13px;
}

.keys-panel .btn svg {
  width: 12px;
  height: 12px;
}

.key-table {
  min-width: 850px;
}

.key-table th:nth-child(1),
.key-table td:nth-child(1) {
  width: 175px;
}

.key-table th:nth-child(2),
.key-table td:nth-child(2) {
  width: 122px;
}

.key-table th:nth-child(3),
.key-table td:nth-child(3) {
  width: 120px;
}

.key-table th:nth-child(4),
.key-table td:nth-child(4) {
  width: 118px;
}

.key-table th:nth-child(5),
.key-table td:nth-child(5) {
  width: 130px;
}

.key-table th:nth-child(6),
.key-table td:nth-child(6) {
  width: 86px;
}

.key-table th:last-child,
.key-table td:last-child {
  width: 142px;
  padding-left: 4px;
}

.key-name b {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.key-name span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  max-width: 145px;
  color: var(--dim);
  font-size: 8.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-prefix {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-3);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.4;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.key-prefix:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.key-prefix svg {
  width: 9px;
  height: 9px;
  opacity: 0.7;
}

.key-limit-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.key-limit-value {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.key-limit-value.is-empty {
  color: var(--dim);
}

.key-limit-share {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.4;
  white-space: nowrap;
}

.key-spent {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.key-spent span {
  color: var(--dim);
  font-size: 8.5px;
}

.key-used {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.key-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.text-action:hover {
  color: var(--text);
}

.text-action-danger {
  color: rgba(241, 155, 141, 0.78);
}

.text-action-danger:hover {
  color: #f19b8d;
}

.key-table tr.is-revoked td {
  opacity: 0.58;
}

.key-table tr.is-revoked td:last-child {
  opacity: 1;
}

.master-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(262px, 0.72fr);
  gap: 12px;
  align-items: start;
}

.master-keys-card {
  overflow: hidden;
}

.master-key-list {
  padding: 0 18px 4px;
}

.master-key-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.master-key-item:first-child {
  border-top: 0;
}

.master-key-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.master-key-icon svg {
  width: 17px;
  height: 17px;
}

.master-key-body {
  min-width: 0;
  padding-top: 1px;
}

.master-key-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.master-key-top > b {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.master-key-body .key-prefix {
  margin-top: 6px;
}

.master-key-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 13px;
  margin-top: 6px;
  color: var(--dim);
  font-size: 8.5px;
  line-height: 1.4;
}

.master-key-meta b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
}

.master-key-actions {
  padding-top: 3px;
}

.master-key-item.is-revoked .master-key-icon,
.master-key-item.is-revoked .master-key-body,
.master-key-item.is-revoked .master-key-actions {
  opacity: 0.58;
}

.master-empty {
  padding: 26px 0 22px;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.master-info {
  padding: 18px;
}

.master-info-kicker {
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.master-info h2 {
  margin-top: 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.master-info p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.master-info ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.master-info li {
  position: relative;
  padding-left: 11px;
  color: var(--text-soft);
  font-size: 9.5px;
  line-height: 1.5;
}

.master-info li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.master-info a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 500;
}

.master-info a span {
  transition: transform 0.15s ease;
}

.master-info a:hover span {
  transform: translateX(2px);
}

.panel-note {
  padding: 11px 18px 14px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Finance
   ───────────────────────────────────────────── */

.finance-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
  gap: 10px;
  margin-bottom: 12px;
}

.finance-balance-card {
  padding: 14px 16px 13px;
  border-color: rgba(214, 255, 79, 0.16);
  background:
    radial-gradient(130% 160% at 100% 0%, rgba(214, 255, 79, 0.07), transparent 55%),
    linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
}

.finance-balance-value {
  margin-top: 6px;
  font-size: 30px;
}

.finance-balance-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
}

.finance-balance-foot b {
  color: var(--text-soft);
  font-weight: 500;
}

.finance-small-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
}

.finance-small-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.finance-small-card > b {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.finance-small-foot {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 9.5px;
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(264px, 0.78fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.topup-card {
  padding: 0 18px 18px;
}

.topup-card .account-card-head {
  padding: 15px 0 0;
}

.topup-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.topup-presets button {
  height: 33px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.topup-presets button:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.topup-presets button.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.topup-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 10.5px;
}

.amount-field {
  display: flex;
  align-items: center;
  width: 180px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  transition: border-color 0.15s ease;
}

.amount-field:focus-within {
  border-color: var(--accent-line);
}

.amount-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  appearance: textfield;
}

.amount-field input::-webkit-outer-spin-button,
.amount-field input::-webkit-inner-spin-button,
.auto-fields input::-webkit-outer-spin-button,
.auto-fields input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.amount-field input::-webkit-outer-spin-button,
.amount-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.amount-field i {
  padding-right: 11px;
  color: var(--dim);
  font-size: 10px;
  font-style: normal;
}

.payment-methods {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.payment-methods legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.payment-method {
  position: relative;
  display: block;
  min-width: 0;
}

.payment-method input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.payment-methods legend {
  grid-column: 1 / -1;
}

.payment-method-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 67px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.payment-method-card svg {
  width: 15px;
  height: 15px;
  margin-bottom: 2px;
  color: var(--muted);
}

.payment-method-card b {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
}

.payment-method-card small {
  color: var(--dim);
  font-size: 8.5px;
  line-height: 1.35;
}

.payment-method:hover .payment-method-card {
  border-color: var(--line-strong);
}

.payment-method input:checked + .payment-method-card {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.payment-method input:checked + .payment-method-card svg {
  color: var(--accent);
}

.payment-method input:focus-visible + .payment-method-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topup-submit {
  width: 100%;
  height: 37px;
  margin-top: 14px;
  font-size: 12px;
}

.topup-note {
  margin-top: 8px;
}

.finance-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auto-card,
.docs-card {
  padding: 0 16px 15px;
}

.auto-card .account-card-head,
.docs-card .account-card-head {
  padding: 14px 0 0;
}

.auto-card .account-card-head h2,
.docs-card .account-card-head h2 {
  font-size: 12px;
}

.auto-copy {
  margin-top: 9px;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.5;
}

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

.auto-fields .form-field input {
  height: 32px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.auto-fields.is-disabled {
  opacity: 0.5;
}

.auto-save {
  margin-top: 12px;
}

.docs-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--dim);
}

.docs-card .btn {
  margin-top: 12px;
}

.payments-card {
  overflow: hidden;
}

.payments-table {
  min-width: 0;
}

.payments-table th:first-child,
.payments-table td:first-child {
  width: auto;
}

.payments-table th:last-child,
.payments-table td:last-child {
  width: 140px;
  text-align: right;
}

.payment-date b {
  display: block;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payment-date span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
  white-space: nowrap;
}

.payment-amount {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   Settings
   ───────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.settings-grid:last-child {
  margin-bottom: 0;
}

.settings-card {
  padding: 0 18px 16px;
}

.settings-card .account-card-head {
  padding: 15px 0 0;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.profile-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.profile-row-copy {
  min-width: 0;
}

.profile-row-copy b {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-row-copy span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
}

.profile-row .text-action {
  margin-left: auto;
  flex-shrink: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.form-field {
  display: block;
  min-width: 0;
}

.form-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.form-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input::placeholder {
  color: var(--dim);
}

.form-field input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field input.is-invalid {
  border-color: rgba(241, 155, 141, 0.55);
  box-shadow: 0 0 0 3px rgba(241, 155, 141, 0.08);
}

.form-field-full {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 13px;
}

.setting-row,
.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.settings-card .setting-row:first-of-type,
.settings-card .setting-toggle:first-of-type {
  margin-top: 12px;
}

.setting-row-copy {
  min-width: 0;
}

.setting-row-copy b {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
}

.setting-row-copy span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 9px;
  line-height: 1.4;
}

.setting-row .text-action {
  flex-shrink: 0;
}

.account-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid rgba(59, 110, 165, 0.22);
  border-radius: 99px;
  background: rgba(59, 110, 165, 0.055);
  color: #5b8fc4;
  font-size: 8.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.account-status-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 30px;
  height: 18px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #151d20;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.15s ease, transform 0.15s ease;
}

.switch input:checked + i {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.switch input:checked + i::after {
  background: var(--accent);
  transform: translateX(12px);
}

.switch input:focus-visible + i {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.endpoint-block {
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.endpoint-block > span {
  display: block;
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.endpoint-block > div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.endpoint-block code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-block .icon-btn {
  width: 22px;
  height: 22px;
}

.mono-copy {
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.settings-docs-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}

.settings-docs-link span {
  transition: transform 0.15s ease;
}

.settings-docs-link:hover span {
  transform: translateX(2px);
}

/* ─────────────────────────────────────────────
   Dialogs
   ───────────────────────────────────────────── */

.account-dialog {
  width: min(480px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6);
}

.account-dialog[open] {
  animation: account-dialog-in 0.17s ease both;
}

@keyframes account-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.account-dialog::backdrop {
  background: rgba(2, 5, 6, 0.72);
  backdrop-filter: blur(5px);
}

.account-dialog-sm {
  width: min(430px, calc(100vw - 28px));
}

.account-dialog form {
  margin: 0;
}

.account-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 28px);
}

.account-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.account-dialog-head h2 {
  margin-top: 4px;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.dialog-kicker {
  display: block;
  color: var(--accent);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-dialog-head .icon-btn {
  width: 28px;
  height: 28px;
  margin-top: -1px;
}

.account-dialog-body {
  padding: 17px 20px;
  overflow-y: auto;
}

.account-dialog-body .form-field + .form-field {
  margin-top: 12px;
}

.account-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
}

.account-dialog-foot .btn {
  height: 34px;
  font-size: 11.5px;
}

.form-note {
  margin-top: 7px;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.5;
}

.form-warning {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(230, 196, 122, 0.18);
  border-radius: 7px;
  background: rgba(230, 196, 122, 0.05);
  color: #c9b27c;
  font-size: 9.5px;
  line-height: 1.55;
}

.key-result-copy {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.key-secret-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 9px 9px 9px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.key-secret-row code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
}

.key-secret-row .icon-btn {
  color: var(--accent);
}

.key-action-text {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.6;
}

.key-action-text b {
  color: var(--text);
  font-weight: 500;
}

.request-dialog {
  width: min(680px, calc(100vw - 28px));
}

.request-dialog-identity {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.request-dialog-logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
}

.request-dialog-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.request-dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.request-dialog-provider {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 10px;
}

.request-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 22px;
}

.request-detail-section {
  min-width: 0;
}

.request-detail-section h3 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.request-detail-section h3 + h3,
.request-token-list + h3 {
  margin-top: 16px;
}

.request-facts,
.request-token-list {
  margin: 0;
  padding: 0;
}

.request-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(252, 252, 254, 0.055);
}

.request-facts > div:last-child {
  border-bottom: 0;
}

.request-facts dt {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.4;
}

.request-facts dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-facts dd code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.request-fact-wide dd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.request-fact-wide .icon-btn {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.request-token-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(252, 252, 254, 0.055);
}

.request-token-list > div:last-child {
  border-bottom: 0;
}

.request-token-list dt {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.4;
}

.request-token-list dd {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.request-token-list dd b {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.request-token-list dd span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.request-cost-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.request-cost-total span {
  color: var(--text-soft);
  font-size: 10px;
}

.request-cost-total b {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.request-detail-note {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Toast
   ───────────────────────────────────────────── */

.account-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 200;
  max-width: min(420px, calc(100vw - 28px));
  padding: 9px 13px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: #0e1518;
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.account-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */

@media (max-width: 1180px) {
  .account-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
  }

  .account-main-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.9fr);
  }

  .account-metric {
    padding: 12px 12px 11px;
  }

  .metric-value {
    font-size: 21px;
  }

  .key-baseurl {
    padding-left: 12px;
  }
}

@media (max-width: 1020px) {
  .account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .spend-card,
  .model-spend-card {
    min-height: 0;
  }

  .model-spend-card {
    min-height: 0;
  }

  .model-spend-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }

  .model-spend-row:nth-child(2) {
    border-top: 0;
  }

  .model-spend-foot {
    margin-top: 12px;
  }

  .finance-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(245px, 0.75fr);
  }

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

@media (max-width: 960px) {
  .account-main {
    padding-top: 22px;
  }

  .account-shell {
    display: block;
  }

  .account-sidebar {
    position: static;
    display: block;
    margin-bottom: 20px;
  }

  .account-user,
  .account-sidebar-note {
    display: none;
  }

  .account-nav {
    flex-direction: row;
    gap: 2px;
    padding-bottom: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .account-nav::-webkit-scrollbar {
    display: none;
  }

  .account-nav-link {
    height: 36px;
    padding: 0 11px;
    flex-shrink: 0;
    border-radius: 6px 6px 0 0;
  }

  .account-nav-link::before {
    display: none;
  }

  .account-nav-link.is-active {
    background: rgba(252, 252, 254, 0.04);
    box-shadow: inset 0 -2px 0 var(--accent);
  }

  .account-head {
    align-items: flex-start;
  }

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

  .finance-balance-card {
    grid-column: 1 / -1;
  }

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

  .finance-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

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

  .key-security {
    flex-wrap: wrap;
  }

  .key-baseurl {
    width: 100%;
    margin-left: 0;
    padding-top: 9px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .account-main {
    padding: 18px 0 40px;
  }

  .account-nav {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
    justify-content: space-between;
    gap: 0;
  }

  .account-nav-link {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 5px;
    font-size: 11px;
    gap: 0;
  }

  .account-nav-link svg {
    display: none;
  }

  .account-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 16px;
  }

  .account-head h1 {
    font-size: 25px;
  }

  .account-head p {
    font-size: 11.5px;
  }

  .account-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .account-head-actions .btn {
    flex-shrink: 0;
  }

  .stats-filterbar {
    gap: 6px;
    margin-bottom: 10px;
    padding: 7px;
  }

  .stats-dates {
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: wrap;
    padding-right: 0;
    padding-bottom: 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-filter-caption {
    display: none;
  }

  .date-field {
    flex: 1;
    min-width: 0;
  }

  .date-field-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .stats-apply {
    flex-shrink: 0;
  }

  .stats-source,
  .stats-model {
    flex: 1;
    min-width: 0;
  }

  .stats-reset {
    flex-shrink: 0;
    margin-left: 0;
  }

  .keys-tabs {
    gap: 18px;
  }

  .master-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .master-key-list {
    padding: 0 13px 4px;
  }

  .master-key-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 12px 0;
  }

  .master-key-icon {
    width: 30px;
    height: 30px;
  }

  .master-key-icon svg {
    width: 15px;
    height: 15px;
  }

  .master-key-actions {
    grid-column: 2;
    justify-content: flex-start;
    gap: 14px;
    margin-top: 1px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
  }

  .master-key-actions .text-action {
    padding: 4px 0;
  }

  .master-info {
    padding: 15px;
  }

  .account-metrics {
    gap: 8px;
  }

  .account-metric {
    padding: 11px 12px 10px;
  }

  .metric-value {
    font-size: 20px;
    letter-spacing: -0.03em;
  }

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

  .metric-chip {
    display: none;
  }

  .metric-foot {
    font-size: 9.5px;
  }

  .account-main-grid {
    gap: 10px;
    margin-bottom: 10px;
  }

  .spend-card {
    padding: 14px 13px 12px;
  }

  .spend-chart-inner {
    grid-template-columns: 31px minmax(0, 1fr);
    height: 182px;
  }

  .spend-canvas svg {
    height: 160px;
  }

  .spend-y-axis {
    padding-bottom: 22px;
    font-size: 7.5px;
  }

  .spend-card .account-card-head h2,
  .model-spend-card .account-card-head h2 {
    font-size: 12px;
  }

  .spend-total b {
    font-size: 16px;
  }

  .spend-legend {
    margin-top: 11px;
    font-size: 8.5px;
  }

  .model-spend-card {
    padding: 14px 13px 12px;
  }

  .model-spend-list {
    display: block;
  }

  .model-spend-row:nth-child(2) {
    border-top: 1px solid rgba(252, 252, 254, 0.055);
  }

  .account-card-head {
    padding: 13px 13px;
  }

  .account-card-head h2 {
    font-size: 12px;
  }

  .recent-card {
    margin-bottom: 10px;
  }

  .account-table {
    font-size: 10.5px;
  }

  .account-table th {
    padding: 7px 9px;
    font-size: 7.5px;
  }

  .account-table td {
    padding: 8px 9px;
  }

  .account-table th:first-child,
  .account-table td:first-child {
    padding-left: 13px;
  }

  .account-table th:last-child,
  .account-table td:last-child {
    padding-right: 13px;
  }

  .account-table-recent th:nth-child(3),
  .account-table-recent td:nth-child(3),
  .account-table-recent th:nth-child(5),
  .account-table-recent td:nth-child(5) {
    display: none;
  }

  .cell-model-copy b {
    max-width: 145px;
  }

  .cell-model-logo {
    width: 19px;
    height: 19px;
  }

  .request-table {
    min-width: 0;
  }

  .request-table th:nth-child(3),
  .request-table td:nth-child(3),
  .request-table th:nth-child(4),
  .request-table td:nth-child(4),
  .request-table th:nth-child(6),
  .request-table td:nth-child(6) {
    display: none;
  }

  .request-table th:nth-child(1),
  .request-table td:nth-child(1) {
    width: 100px;
  }

  .request-table th:nth-child(2),
  .request-table td:nth-child(2) {
    width: auto;
  }

  .request-table th:nth-child(5),
  .request-table td:nth-child(5) {
    width: 73px;
  }

  .request-table th:nth-child(7),
  .request-table td:nth-child(7) {
    width: 64px;
  }

  .request-filters {
    padding: 12px 13px 0;
  }

  .request-summary {
    padding: 8px 13px 9px;
  }

  .request-summary-muted {
    display: none;
  }

  .request-foot {
    padding: 10px 13px;
  }

  .key-security {
    gap: 9px;
    padding: 11px 12px;
  }

  .key-security-copy p {
    font-size: 9px;
  }

  .keys-panel .account-card-head {
    padding: 13px;
  }

  .settings-card {
    padding: 0 13px 14px;
  }

  .settings-card .account-card-head {
    padding-top: 13px;
  }

  .setting-row,
  .setting-toggle {
    padding: 10px 0;
  }

  .form-grid {
    gap: 7px;
  }

  .finance-summary {
    gap: 8px;
  }

  .finance-balance-card,
  .finance-small-card {
    padding: 12px 13px;
  }

  .finance-balance-value {
    font-size: 27px;
  }

  .finance-side {
    display: flex;
  }

  .topup-card {
    padding: 0 13px 15px;
  }

  .topup-card .account-card-head {
    padding-top: 13px;
  }

  .auto-card,
  .docs-card {
    padding: 0 13px 14px;
  }

  .auto-card .account-card-head,
  .docs-card .account-card-head {
    padding-top: 12px;
  }

  .account-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .account-dialog-inner {
    max-height: calc(100dvh - 16px);
  }

  .account-dialog-head {
    padding: 15px 16px 12px;
  }

  .account-dialog-body {
    padding: 15px 16px;
  }

  .account-dialog-foot {
    padding: 12px 16px;
  }

  .request-detail-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .request-detail-section + .request-detail-section {
    padding-top: 15px;
    border-top: 1px solid var(--line);
  }

  .account-toast {
    bottom: 14px;
  }
}

@media (max-width: 620px) {
  .master-keys-card .account-card-tag {
    display: none;
  }

  .key-table,
  .master-table {
    display: block;
    min-width: 0;
  }

  .key-table thead,
  .master-table thead {
    display: none;
  }

  .key-table tbody,
  .master-table tbody {
    display: block;
  }

  .key-table tr,
  .master-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    padding: 12px 13px;
    border-top: 1px solid rgba(252, 252, 254, 0.055);
  }

  .key-table tbody tr:first-child,
  .master-table tbody tr:first-child {
    border-top: 0;
  }

  .key-table tbody tr:hover,
  .master-table tbody tr:hover {
    background: rgba(252, 252, 254, 0.024);
  }

  .key-table td,
  .master-table td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }

  .key-table td:nth-child(1),
  .key-table td:nth-child(2),
  .key-table td:nth-child(3),
  .key-table td:nth-child(4),
  .key-table td:nth-child(5),
  .key-table td:nth-child(6),
  .key-table td:nth-child(7),
  .master-table td:nth-child(1),
  .master-table td:nth-child(2),
  .master-table td:nth-child(3),
  .master-table td:nth-child(4),
  .master-table td:nth-child(5),
  .master-table td:nth-child(6) {
    width: auto;
  }

  .key-table td:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
  }

  .key-table td:nth-child(6) {
    grid-row: 1;
    grid-column: 2;
    align-self: start;
    justify-self: end;
  }

  .key-table td:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }

  .key-table td:nth-child(4) {
    grid-row: 2;
    grid-column: 2;
    align-self: center;
    justify-self: end;
  }

  .key-table td:nth-child(3) {
    grid-row: 3;
    grid-column: 1;
  }

  .key-table td:nth-child(5) {
    grid-row: 3;
    grid-column: 2;
    align-self: center;
    justify-self: end;
  }

  .key-table td:nth-child(7) {
    grid-row: 4;
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .key-table .key-actions,
  .master-table .key-actions {
    justify-content: flex-start;
    gap: 14px;
  }

  .key-table .key-actions .text-action,
  .master-table .key-actions .text-action {
    padding: 5px 0;
  }

  .key-table .key-name span {
    max-width: 210px;
  }

  .master-table td:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
  }

  .master-table td:nth-child(5) {
    grid-row: 1;
    grid-column: 2;
    align-self: start;
    justify-self: end;
  }

  .master-table td:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }

  .master-table td:nth-child(3) {
    grid-row: 3;
    grid-column: 1;
  }

  .master-table td:nth-child(4) {
    grid-row: 4;
    grid-column: 1;
  }

  .master-table td:nth-child(6) {
    grid-row: 5;
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .master-table td:nth-child(3)::before,
  .master-table td:nth-child(4)::before {
    margin-right: 4px;
    color: var(--dim);
    font-family: var(--font-sans);
    font-size: 8.5px;
  }

  .master-table td:nth-child(3)::before {
    content: "Создан";
  }

  .master-table td:nth-child(4)::before {
    content: "Использован";
  }

  .master-table td:nth-child(3) .key-used,
  .master-table td:nth-child(4) .key-used {
    display: inline;
  }

  .master-table .panel-note {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .account-head-actions {
    flex-wrap: wrap;
  }

  .account-head-actions .btn {
    flex: 1 1 136px;
  }

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

  .metric-value {
    font-size: 20px;
  }

  .metric-chip {
    display: inline-block;
  }

  .metric-foot {
    gap: 3px 6px;
  }

  .spend-chart-inner {
    grid-template-columns: 29px minmax(0, 1fr);
  }

  .payment-methods {
    grid-template-columns: minmax(0, 1fr);
  }

  .payment-method-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .payment-method-card svg {
    margin-bottom: 0;
  }

  .payment-method-card small {
    margin-left: auto;
  }

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

  .topup-custom {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .amount-field {
    width: 100%;
  }

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

  .finance-balance-card {
    grid-column: 1 / -1;
  }

  .finance-small-card > b {
    font-size: 20px;
  }

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

  .form-field-full {
    grid-column: auto;
  }

  .profile-row {
    flex-wrap: wrap;
  }

  .profile-row .text-action {
    margin-left: 46px;
  }

  .setting-row {
    align-items: flex-start;
  }

  .setting-row .account-status-pill,
  .setting-row .text-action {
    margin-top: 1px;
  }

  .auto-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .key-security-icon {
    width: 26px;
    height: 26px;
  }

  .request-periods {
    width: 100%;
  }

  .request-periods button {
    flex: 1;
  }

  .request-search {
    flex-basis: 100%;
  }

  .request-table {
    display: block;
    min-width: 0;
  }

  .request-table thead {
    display: none;
  }

  .request-table tbody {
    display: block;
  }

  .request-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding: 10px 13px;
    border-top: 1px solid rgba(252, 252, 254, 0.055);
  }

  .request-table tbody tr:first-child {
    border-top: 0;
  }

  .request-table tr:hover {
    background: rgba(252, 252, 254, 0.024);
  }

  .request-table td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }

  .request-table td:nth-child(1),
  .request-table td:nth-child(2),
  .request-table td:nth-child(5),
  .request-table td:nth-child(7) {
    width: auto;
  }

  .request-table td:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
  }

  .request-table td:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }

  .request-table td:nth-child(5) {
    grid-row: 2;
    grid-column: 2;
    align-self: center;
    justify-self: end;
  }

  .request-table td:nth-child(7) {
    grid-row: 1;
    grid-column: 2;
    align-self: start;
    justify-self: end;
  }

  .request-table td:nth-child(3),
  .request-table td:nth-child(4),
  .request-table td:nth-child(6),
  .request-table td:nth-child(8) {
    display: none;
  }

  .request-table .cell-time {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  .request-table .cell-time span {
    margin-top: 0;
  }

  .request-table .cell-model-copy b {
    max-width: 220px;
  }

  .account-pager button {
    min-width: 21px;
    height: 21px;
  }
}

@media (max-width: 360px) {
  .account-nav-link {
    padding: 0 3px;
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-view:not([hidden]),
  .account-dialog[open] {
    animation: none;
  }

  .account-toast,
  .metric-link::after,
  .account-card-link svg,
  .settings-docs-link span {
    transition: none;
  }
}
