:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --portal-console-zoom: 0.9;
  --portal-console-zoom-inverse: 1.111111;
  color: #111827;
  background: #f6f8fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #111827;
  background:
    radial-gradient(circle at 48% 8%, rgba(45, 212, 191, 0.18), transparent 28%),
    linear-gradient(rgba(20, 184, 166, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.045) 1px, transparent 1px),
    #f8fbfb;
  background-size: auto, 78px 78px, 78px 78px, auto;
}

body:not(.is-auth-screen) {
  overflow-x: hidden;
}

body.theme-dark {
  color: #e5edf7;
  background:
    radial-gradient(circle at 50% 10%, rgba(20, 184, 166, 0.16), transparent 34%),
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    #111827;
  background-size: auto, 78px 78px, 78px 78px, auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: #0d9488;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.2);
}

button:hover {
  filter: brightness(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-secondary,
.icon-button,
.tiny-button,
.plain-switch {
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 9px 12px;
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
}

label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

code,
pre {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.brand-mark {
  display: block;
  object-fit: contain;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  align-content: center;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
}

.login-brand-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark-hero {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(20, 184, 166, 0.28);
}

.login-brand-panel h1 {
  margin: 0;
  color: #0d9488;
  font-size: 50px;
  line-height: 1;
}

.login-brand-panel p {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 20px;
}

.auth-card,
.section-card,
.table-card,
.metric-card,
.filter-band,
.toolbar-row,
.profile-hero,
.channel-card,
.plan-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.auth-card {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 36px 30px 30px;
}

.auth-card h2 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 30px;
}

.auth-subtitle,
.auth-card p {
  margin: 0 0 24px;
  color: #64748b;
  text-align: center;
}

.login-card-head {
  display: grid;
  justify-items: center;
  padding-top: 10px;
}

.login-mode-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  min-height: 44px;
  max-width: calc(100% - 40px);
  padding: 0 16px;
  color: #0f766e;
  background: #ccfbf1;
  box-shadow: none;
}

.login-methods {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.login-methods form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.login-methods h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 18px;
}

.code-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.send-code-btn {
  min-width: 132px;
}

.send-code-btn.is-loading {
  color: #0f766e;
  background: #ccfbf1;
}

.login-submit {
  width: 100%;
  margin-top: 16px;
  background: #7dd3c7;
}

.login-submit[aria-disabled="true"] {
  cursor: not-allowed;
}

.login-submit[aria-disabled="true"]:hover {
  filter: none;
}

.login-submit.is-login-ready {
  color: #0f766e;
  background: #ccfbf1;
  box-shadow: none;
}

.terms-line {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 16px;
  font-weight: 500;
}

.terms-line input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.console-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

body:not(.is-auth-screen) .console-shell {
  width: calc(100% * var(--portal-console-zoom-inverse));
  min-height: calc(100vh * var(--portal-console-zoom-inverse));
  zoom: var(--portal-console-zoom);
}

body:not(.is-auth-screen) .console-shell .sidebar {
  height: calc(100vh * var(--portal-console-zoom-inverse));
}

@supports not (zoom: 1) {
  body:not(.is-auth-screen) .console-shell {
    transform: scale(var(--portal-console-zoom));
    transform-origin: top left;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 88px;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 26px;
}

.brand-mark-sidebar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px 16px;
  overflow: auto;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  padding: 18px 16px;
  border-top: 1px solid #e5e7eb;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  color: #334155;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 18px;
  font-weight: 500;
}

.nav-item.active {
  color: #009688;
  background: #e9fbf7;
}

.ui-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.ui-icon svg {
  width: 1em;
  height: 1em;
}

.nav-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 0 34px;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(248, 251, 251, 0.86);
  backdrop-filter: blur(16px);
}

.page-title h1 {
  margin: 0;
  font-size: 28px;
}

.page-title p {
  margin: 3px 0 0;
  color: #64748b;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.recharge-button {
  color: #0f766e;
  background: #ecfdf5;
}

.recharge-button:hover {
  color: #ffffff;
  background: #0f766e;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 52px;
  min-width: 52px;
  padding: 0;
}

.doc-link,
.plain-switch,
.language-trigger,
.balance-chip,
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  color: #334155;
  text-decoration: none;
}

.language-picker {
  position: relative;
  display: inline-flex;
}

.language-trigger {
  min-width: 94px;
  justify-content: center;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.language-chevron {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
}

.language-picker.open .language-chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  display: none;
  min-width: 158px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.language-picker.open .language-menu {
  display: block;
}

.language-option {
  display: grid;
  grid-template-columns: 22px 1fr 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
  color: #334155;
  background: #ffffff;
  box-shadow: none;
  text-align: left;
  font-weight: 500;
}

.language-option.active {
  color: #0f766e;
  background: #e6fffb;
}

.language-region {
  color: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.language-check {
  justify-self: end;
  color: #14b8a6;
}

.balance-chip {
  color: #0f766e;
  background: #ecfdf5;
  font-size: 18px;
}

.profile-chip {
  background: transparent;
  box-shadow: none;
}

.profile-chip small {
  display: block;
  color: #64748b;
  font-weight: 500;
  text-align: left;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  color: #ffffff;
  background: #14b8a6;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.large {
  width: 100px;
  height: 100px;
  border-radius: 28px;
  font-size: 34px;
  box-shadow: 0 16px 28px rgba(20, 184, 166, 0.24);
}

.avatar.medium {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  font-size: 28px;
}

.workspace-body {
  padding: 42px 40px 48px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 28px 20px;
  margin-bottom: 30px;
}

.metric-grid.compact {
  margin-bottom: 30px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 118px;
  padding: 24px;
}

.metric-card span {
  color: #64748b;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.1;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  color: #10b981;
  background: #dcfce7;
  font-size: 22px;
}

.metric-icon.key,
.metric-icon.doc {
  color: #2563eb;
  background: #dbeafe;
}

.metric-icon.coin {
  color: #9333ea;
  background: #f3e8ff;
}

.metric-icon.cube {
  color: #f59e0b;
  background: #fef3c7;
}

.metric-icon.bolt {
  color: #7c3aed;
  background: #ede9fe;
}

.metric-icon.clock {
  color: #e11d48;
  background: #ffe4e6;
}

.section-card {
  padding: 24px;
  margin-bottom: 28px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.section-heading span {
  color: #64748b;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  gap: 16px;
}

.platform-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.platform-item h3 {
  margin: 0 0 12px;
}

.platform-item dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
  color: #64748b;
}

.platform-item dd {
  margin: 0;
  color: #111827;
}

.filter-band,
.toolbar-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  align-items: end;
  gap: 16px;
  padding: 20px;
  margin-bottom: 28px;
}

.keys-console {
  min-height: 0;
  padding-top: 30px;
}

.keys-actions-row {
  display: flex;
  justify-self: start;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.key-toolbar-row {
  grid-template-columns: minmax(280px, 360px) minmax(160px, 200px) minmax(160px, 200px) max-content;
  align-items: center;
  gap: 14px;
  padding: 0;
  margin: 0 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.key-toolbar-row select {
  min-height: 46px;
}

.keys-actions-row button[data-action="open-create-key"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 156px;
  min-height: 46px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.button-icon {
  width: 20px;
  height: 20px;
}

.filter-band .align-right {
  justify-self: end;
  min-width: 160px;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 58px;
  pointer-events: none;
  z-index: 1;
}

.search-field span::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  transform: translateY(-58%);
}

.search-field span::after {
  content: "";
  position: absolute;
  left: 31px;
  top: calc(50% + 5px);
  width: 8px;
  height: 2px;
  background: #94a3b8;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-field input {
  min-height: 46px;
  padding-left: 50px;
}

.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-bottom: 30px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
}

.endpoint-pill strong {
  overflow-wrap: anywhere;
  color: #334155;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 14px;
}

.table-card {
  overflow: hidden;
  margin-bottom: 30px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 430px;
}

.key-table-scroll {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 460px;
  scrollbar-gutter: stable;
}

.key-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.key-table .key-name-col {
  left: 0;
  width: 11%;
  min-width: 96px;
  max-width: 132px;
}

.key-table .key-value-col {
  width: 16%;
  min-width: 132px;
  max-width: 168px;
}

.key-table .key-group-col {
  width: 13%;
  min-width: 110px;
}

.key-table .key-quota-col {
  width: 11%;
  min-width: 96px;
}

.key-table .key-rate-col {
  width: 13%;
  min-width: 104px;
}

.key-table .key-status-col {
  width: 8%;
  min-width: 74px;
}

.key-table .key-actions-col {
  right: 0;
  width: 220px;
  min-width: 220px;
  max-width: 240px;
}

.key-attribute-cell {
  display: grid;
  gap: 4px;
}

.key-attribute-cell strong {
  font-size: 15px;
  color: #111827;
}

.key-attribute-cell small {
  color: #64748b;
  font-size: 12px;
}

.key-limit-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.key-limit-list span {
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 5px 4px;
  background: rgba(248, 250, 252, 0.92);
}

.key-limit-list small {
  color: #64748b;
  font-size: 11px;
  line-height: 1;
}

.key-limit-list strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.2;
}

table {
  min-width: 980px;
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th,
td {
  padding: 22px 26px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.key-table th,
.key-table td {
  padding: 16px 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #334155;
  background: #f8fafc;
  font-weight: 600;
}

td code {
  border-radius: 6px;
  padding: 7px 10px;
  color: #0f766e;
  background: #f1f5f9;
  font-size: 14px;
}

.key-preview-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.key-preview-cell code {
  display: inline-block;
  max-width: calc(100% - 34px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.copy-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.copy-icon-button:hover {
  color: #0f766e;
  background: #f0fdfa;
  border-color: #99f6e4;
}

.copy-icon-button .ui-icon {
  font-size: 15px;
}

.row-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.action-button {
  display: inline-grid;
  grid-template-rows: 18px auto;
  place-items: center;
  gap: 3px;
  min-width: 36px;
  min-height: 54px;
  padding: 6px 2px;
  color: #64748b;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.action-button:hover {
  color: #0f766e;
  background: #f0fdfa;
}

.action-button .ui-icon {
  font-size: 16px;
}

.action-button.danger:hover {
  color: #be123c;
  background: #fff1f2;
}

.tiny-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  box-shadow: none;
}

.tiny-button.danger {
  color: #be123c;
}

.group-badge,
.pill,
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-radius: 8px;
  padding: 4px 10px;
  color: #166534;
  background: #dcfce7;
  font-weight: 700;
}

.group-badge small {
  color: #166534;
  background: rgba(22, 101, 52, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
}

.group-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

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

.group-icon-gpt {
  color: #059669;
  background: #d1fae5;
}

.group-icon-claude {
  color: #b45309;
  background: #fef3c7;
}

.pill.gray {
  color: #475569;
  background: #e2e8f0;
}

.pill.blue {
  color: #2563eb;
  background: #dbeafe;
}

.pill.red {
  color: #be123c;
  background: #ffe4e6;
}

.cost {
  color: #16a34a;
}

.token-pair {
  display: grid;
  gap: 4px;
}

.token-pair span:first-child {
  color: #059669;
}

.token-pair span:nth-child(2) {
  color: #7c3aed;
}

.token-pair small {
  color: #0284c7;
}

.pager-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 30px;
  background: rgba(255, 255, 255, 0.75);
}

.page-button {
  min-width: 52px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.page-button.active {
  color: #0f766e;
  border-color: #14b8a6;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: #ffffff;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

.color-1 {
  background: #14b8a6;
}

.color-2 {
  background: #f59e0b;
}

.color-3 {
  background: #8b5cf6;
}

.color-4 {
  background: #06b6d4;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 180px;
  padding-top: 24px;
}

.bar-chart span {
  flex: 1;
  min-width: 12px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #3b82f6, #14b8a6);
}

.channel-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.segmented {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.segmented button {
  min-height: 34px;
  color: #64748b;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.segmented button.active {
  color: #111827;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.status-line {
  color: #047857;
  background: #d1fae5;
}

.status-line.bad {
  color: #b45309;
  background: #fef3c7;
}

.auto-refresh {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  background: #ffffff;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 360px));
  gap: 22px;
}

.channel-card {
  padding: 26px;
}

.channel-head {
  display: flex;
  align-items: start;
  gap: 14px;
}

.channel-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.channel-head p {
  margin: 0;
  color: #64748b;
}

.provider-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: #047857;
  background: #dcfce7;
  font-weight: 900;
}

.latency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 26px 0 20px;
}

.latency-grid span {
  display: grid;
  gap: 10px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.7);
}

.latency-grid small {
  color: #94a3b8;
  font-weight: 700;
}

.latency-grid strong {
  font-size: 22px;
}

.latency-grid em {
  margin-left: 2px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.availability {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  padding: 16px 0;
}

.availability span {
  color: #94a3b8;
}

.availability strong {
  color: #22c55e;
  font-size: 36px;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(60, 1fr);
  gap: 3px;
  margin-top: 16px;
}

.uptime-bars span {
  height: 26px;
  border-radius: 2px;
  background: #10b981;
}

.uptime-bars span.warn {
  background: #f59e0b;
}

.past-now {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0;
}

.copy-grid,
.profile-grid,
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.copy-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.hint-box {
  margin-top: 22px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 18px 20px;
  color: #0f766e;
  background: #ecfdf5;
}

.hint-box p {
  margin: 0 0 8px;
  font-weight: 700;
}

.hint-box ol {
  margin: 0;
  padding-left: 22px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 30px;
  width: min(1190px, 100%);
  margin: 0 auto 30px;
  padding: 30px 40px;
}

.profile-hero h2 {
  margin: 0 0 8px;
  font-size: 34px;
}

.profile-hero p {
  color: #64748b;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.profile-metrics span,
.avatar-editor,
.profile-grid form {
  border-radius: 8px;
  padding: 18px 20px;
  background: rgba(248, 250, 252, 0.72);
}

.profile-metrics small {
  display: block;
  color: #94a3b8;
}

.profile-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.avatar-editor {
  display: grid;
  align-content: start;
  gap: 12px;
}

.avatar-editor p {
  color: #64748b;
}

.plan-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.plan-card h3,
.plan-card p {
  margin: 0;
}

.plan-card p {
  color: #64748b;
}

.plan-card strong {
  font-size: 24px;
}

.generated-key {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 14px;
  background: #ecfdf5;
}

.generated-key code {
  overflow-wrap: anywhere;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.modal form {
  display: grid;
  gap: 12px;
}

.key-settings-modal {
  width: min(660px, calc(100vw - 48px));
}

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

.key-form label:nth-child(-n + 2),
.key-form-actions {
  grid-column: 1 / -1;
}

.key-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 8px;
}

.key-form-actions button {
  min-width: 92px;
}

.input-dialog {
  width: min(560px, calc(100vw - 48px));
  padding: 0;
  overflow: hidden;
}

.key-modal {
  width: min(620px, 100%);
  padding: 0;
  overflow: hidden;
}

.key-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.key-modal-header h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
}

.key-modal-close {
  min-height: 32px;
  width: 32px;
  padding: 0;
  border: 0;
  color: #94a3b8;
  background: transparent;
  box-shadow: none;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.key-create-form {
  padding: 22px 24px 8px;
}

.key-form-field {
  gap: 10px;
  color: #334155;
  font-size: 16px;
  font-weight: 500;
}

.key-form-field input,
.key-form-field select,
.money-input {
  min-height: 52px;
  border-radius: 12px;
}

.key-form-field input,
.key-form-field select {
  padding: 12px 18px;
  color: #111827;
  background: #ffffff;
}

.key-form-field select:focus {
  outline: 0;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
}

.key-form-field small {
  color: #64748b;
  font-size: 14px;
  font-weight: 400;
}

.key-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  color: #334155;
  font-size: 16px;
  font-weight: 500;
}

.key-toggle-row input {
  appearance: none;
  width: 44px;
  min-height: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  padding: 2px;
  background: #e2e8f0;
  cursor: pointer;
  transition: background 0.18s ease;
}

.key-toggle-row input::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.key-toggle-row input:checked {
  background: #14b8a6;
}

.key-toggle-row input:checked::before {
  transform: translateX(20px);
}

.key-quota-field {
  gap: 8px;
}

.money-input {
  display: flex;
  align-items: center;
  border: 1px solid #dbe3ec;
  background: #ffffff;
}

.money-input > span {
  padding-left: 16px;
  color: #64748b;
  font-size: 20px;
}

.money-input input {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  padding-left: 10px;
  box-shadow: none;
}

.money-input input:focus {
  outline: 0;
}

.key-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: 6px -24px 0;
  padding: 20px 24px 0;
  border-top: 1px solid #e2e8f0;
}

.key-modal-actions button {
  min-width: 78px;
}

.input-dialog-form {
  display: grid;
  gap: 18px;
  padding: 24px 32px 0;
}

.recharge-modal {
  width: min(720px, calc(100vw - 48px));
}

.recharge-form {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  margin: 18px 0;
}

.recharge-channel-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.recharge-channel-list article {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 6px 14px;
  padding: 14px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
}

.recharge-channel-list article.active {
  border-color: #14b8a6;
  background: #ecfdf5;
}

.recharge-channel-list code {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  white-space: normal;
}

.recharge-order {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
}

.recharge-order div {
  display: grid;
  gap: 4px;
}

.recharge-order span {
  color: #64748b;
}

.recharge-order .full {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.recharge-order .full span {
  grid-column: 1 / -1;
}

.recharge-order code {
  overflow-wrap: anywhere;
}

.confirm-backdrop {
  background: rgba(17, 24, 39, 0.54);
  backdrop-filter: blur(5px);
}

.confirm-dialog {
  width: min(560px, calc(100vw - 48px));
  padding: 0;
  overflow: hidden;
}

.confirm-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px;
  border-bottom: 1px solid #e2e8f0;
}

.confirm-dialog-head h2 {
  margin: 0;
  color: #111827;
  font-size: 24px;
}

.confirm-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  color: #94a3b8;
  background: transparent;
  box-shadow: none;
  font-size: 28px;
  font-weight: 400;
}

.confirm-close:hover {
  color: #64748b;
  background: #f8fafc;
}

.confirm-dialog-body {
  padding: 24px 32px;
  border-bottom: 1px solid #e2e8f0;
}

.confirm-dialog-body p {
  margin: 0;
  color: #475569;
  font-size: 18px;
  line-height: 1.6;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 22px 32px;
}

.confirm-dialog-actions button {
  min-width: 82px;
  min-height: 48px;
  font-size: 18px;
}

.confirm-cancel {
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.confirm-delete {
  color: #ffffff;
  background: #dc2626;
  box-shadow: none;
}

.confirm-delete:hover {
  background: #b91c1c;
}

.api-key-modal {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
}

.api-key-modal-head,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid #e2e8f0;
}

.api-key-modal-head h2 {
  margin: 0;
  font-size: 24px;
}

.api-key-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 24px 28px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
}

.config-intro {
  margin: 0 0 14px;
  color: #475569;
  font-size: 17px;
}

.config-tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  border-bottom: 1px solid #dbe3ec;
}

.config-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  min-height: 54px;
  padding: 0 6px;
  color: #64748b;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: 17px;
  font-weight: 500;
}

.config-tab.active {
  color: #0d9488;
  box-shadow: inset 0 -3px 0 #14b8a6;
}

.config-tab .ui-icon {
  font-size: 18px;
}

.config-os-select {
  display: grid;
  gap: 8px;
  width: min(280px, 100%);
  margin-top: 14px;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
}

.config-os-select select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-weight: 600;
}

.config-warning {
  margin: 20px 0 10px;
  color: #c2410c;
  font-weight: 600;
}

.config-code-card {
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
}

.config-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 0 18px;
  color: #94a3b8;
  background: #1f2937;
}

.config-code-toolbar .tiny-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e5edf7;
  background: #374151;
  border-color: #4b5563;
}

.config-code-card pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 24px 20px;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre;
}

.notice-banner,
.success,
.error.banner,
.error {
  border-radius: 8px;
  padding: 12px 14px;
}

.toast-stack {
  position: fixed;
  z-index: 90;
  top: 96px;
  right: 24px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 48px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  overflow: hidden;
  padding: 0 18px;
  border-left: 5px solid #22c55e;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
  pointer-events: auto;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #22c55e;
  border-radius: 50%;
  color: #22c55e;
  font-weight: 900;
}

.toast.error .toast-icon {
  border-color: #ef4444;
  color: #ef4444;
}

.toast strong {
  color: #111827;
  font-size: 16px;
}

.toast button {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  color: #94a3b8;
  background: transparent;
  box-shadow: none;
  font-size: 24px;
  font-weight: 400;
}

.toast i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: #22c55e;
  animation: toast-countdown var(--toast-duration, 3000ms) linear forwards;
  transform-origin: left center;
}

.toast.error i {
  background: #ef4444;
}

.notice-banner,
.success {
  border: 1px solid #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.error,
.error.banner {
  border: 1px solid #fecaca;
  color: #b42318;
  background: #fff1f2;
}

.error.notice {
  border: 1px solid #fecaca;
  color: #b42318;
  background: #fff1f2;
}

.empty-state,
.muted {
  color: #64748b;
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.loader {
  width: 44px;
  height: 44px;
  border: 4px solid #ccfbf1;
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

body:not(.is-auth-screen) {
  font-size: 14px;
}

.console-shell {
  grid-template-columns: 300px minmax(0, 1fr);
}

.console-shell button,
.console-shell input,
.console-shell select,
.console-shell textarea {
  font-size: 14px;
}

.console-shell button {
  min-height: 38px;
  padding: 0 14px;
}

.console-shell input,
.console-shell select,
.console-shell textarea {
  min-height: 38px;
  padding: 7px 10px;
}

.console-shell .search-field input {
  min-height: 46px;
  padding-left: 50px;
}

.console-shell .key-toolbar-row select {
  min-height: 46px;
}

.console-shell .brand-lockup {
  gap: 12px;
  height: 76px;
  padding: 0 20px;
  font-size: 22px;
}

.console-shell .brand-mark-sidebar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.console-shell .sidebar nav {
  gap: 6px;
  padding: 16px 14px;
}

.console-shell .sidebar-footer {
  gap: 6px;
  padding: 16px 14px;
}

.console-shell .nav-item {
  gap: 14px;
  min-height: 42px;
  font-size: 15px;
}

.console-shell .nav-icon {
  width: 21px;
  height: 21px;
}

.console-shell .topbar {
  gap: 18px;
  min-height: 76px;
  padding: 0 28px;
}

.console-shell .page-title h1 {
  font-size: 24px;
}

.console-shell .page-title p {
  font-size: 13px;
}

.console-shell .top-actions {
  gap: 12px;
}

.console-shell .icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.console-shell .doc-link,
.console-shell .plain-switch,
.console-shell .language-trigger,
.console-shell .balance-chip,
.console-shell .profile-chip {
  min-height: 38px;
  padding: 0 10px;
}

.console-shell .balance-chip {
  font-size: 15px;
}

.console-shell .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.console-shell .workspace-body {
  padding: 28px 32px 36px;
}

.console-shell .metric-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 20px 18px;
  margin-bottom: 24px;
}

.console-shell .metric-grid.compact {
  margin-bottom: 24px;
}

.console-shell .metric-card {
  gap: 14px;
  min-height: 96px;
  padding: 18px;
}

.console-shell .metric-card strong {
  font-size: 25px;
}

.console-shell .metric-card small {
  font-size: 13px;
}

.console-shell .metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 19px;
}

.console-shell .section-card {
  padding: 20px;
  margin-bottom: 24px;
}

.console-shell .section-heading {
  margin-bottom: 14px;
}

.console-shell .section-heading h2,
.console-shell .section-heading h3 {
  font-size: 20px;
}

.console-shell .platform-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 340px));
  gap: 14px;
}

.console-shell .platform-item {
  padding: 14px;
}

.console-shell .filter-band,
.console-shell .toolbar-row {
  gap: 14px;
  padding: 16px;
  margin-bottom: 24px;
}

.console-shell .keys-console {
  min-height: 0;
  padding-top: 22px;
}

.console-shell .keys-actions-row {
  gap: 12px;
  margin: 0;
}

.console-shell .key-toolbar-row {
  grid-template-columns: minmax(280px, 360px) minmax(160px, 200px) minmax(160px, 200px) max-content;
  gap: 14px;
  padding: 0;
  margin: 0 0 12px;
}

.console-shell .keys-actions-row button[data-action="open-create-key"] {
  min-height: 46px;
}

.console-shell .key-toolbar-row select,
.console-shell .search-field input {
  min-height: 46px;
}

.console-shell .endpoint-pill {
  margin-bottom: 22px;
  padding: 7px 12px;
}

.console-shell .table-card {
  margin-bottom: 24px;
}

.console-shell table {
  font-size: 14px;
}

.console-shell th,
.console-shell td {
  padding: 16px 20px;
}

.console-shell .key-table th,
.console-shell .key-table td {
  padding: 14px 12px;
}

.console-shell td code {
  padding: 6px 9px;
  font-size: 13px;
}

.console-shell .tiny-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.console-shell .action-button {
  min-height: 54px;
  padding: 6px 2px;
  font-size: 11px;
}

.console-shell .pager-row {
  margin-bottom: 24px;
  padding: 14px 24px;
}

.console-shell .page-button {
  min-width: 44px;
}

.console-shell .chart-grid {
  gap: 22px;
}

.console-shell .donut-layout {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
}

.console-shell .donut {
  width: 140px;
  height: 140px;
}

.console-shell .donut::after {
  inset: 38px;
}

.console-shell .bar-chart {
  min-height: 150px;
  gap: 10px;
  padding-top: 18px;
}

.console-shell .channel-toolbar {
  gap: 14px;
  margin-bottom: 22px;
}

.console-shell .channel-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
  gap: 20px;
}

.console-shell .channel-card {
  padding: 20px;
}

.console-shell .provider-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.console-shell .channel-head h3 {
  font-size: 20px;
}

.console-shell .latency-grid {
  margin: 20px 0 16px;
}

.console-shell .latency-grid span {
  padding: 12px;
}

.console-shell .latency-grid strong {
  font-size: 20px;
}

.console-shell .availability {
  padding: 13px 0;
}

.console-shell .availability strong {
  font-size: 30px;
}

.console-shell .uptime-bars {
  margin-top: 14px;
}

.console-shell .uptime-bars span {
  height: 22px;
}

.console-shell .copy-grid,
.console-shell .profile-grid,
.console-shell .plan-grid {
  gap: 18px;
}

.console-shell .profile-hero {
  gap: 24px;
  margin-bottom: 24px;
  padding: 24px 32px;
}

.console-shell .profile-hero h2 {
  font-size: 28px;
}

.console-shell .avatar.large {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  font-size: 28px;
}

.console-shell .avatar.medium {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 24px;
}

.console-shell .profile-metrics {
  gap: 14px;
  margin-top: 16px;
}

.console-shell .profile-metrics span,
.console-shell .avatar-editor,
.console-shell .profile-grid form {
  padding: 16px;
}

.console-shell .profile-metrics strong,
.console-shell .plan-card strong {
  font-size: 21px;
}

.console-shell .plan-card {
  padding: 18px;
}

.console-shell.is-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-countdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.theme-dark .sidebar,
.theme-dark .topbar,
.theme-dark .auth-card,
.theme-dark .section-card,
.theme-dark .table-card,
.theme-dark .metric-card,
.theme-dark .filter-band,
.theme-dark .toolbar-row,
.theme-dark .toast,
.theme-dark .profile-hero,
.theme-dark .channel-card,
.theme-dark .plan-card,
.theme-dark .modal {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(17, 24, 39, 0.88);
}

.theme-dark input,
.theme-dark select,
.theme-dark textarea,
.theme-dark .button-secondary,
.theme-dark .icon-button,
.theme-dark .tiny-button,
.theme-dark .plain-switch {
  color: #e5edf7;
  border-color: rgba(148, 163, 184, 0.28);
  background: #1f2937;
}

.theme-dark th {
  color: #d1d5db;
  background: #1f2937;
}

.theme-dark .key-table .sticky-col,
.theme-dark .key-table .sticky-col-right {
  background: #111827;
}

.theme-dark .key-table th.sticky-col,
.theme-dark .key-table th.sticky-col-right {
  background: #1f2937;
}

.theme-dark .key-attribute-cell strong,
.theme-dark .key-limit-list strong {
  color: #e5edf7;
}

.theme-dark .key-attribute-cell small,
.theme-dark .key-limit-list small {
  color: #94a3b8;
}

.theme-dark .key-limit-list span {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(31, 41, 55, 0.92);
}

.theme-dark .api-key-modal-head,
.theme-dark .modal-footer,
.theme-dark .key-modal-header,
.theme-dark .key-modal-actions,
.theme-dark .confirm-dialog-head,
.theme-dark .confirm-dialog-body {
  border-color: rgba(148, 163, 184, 0.28);
}

.theme-dark .key-modal-header h2,
.theme-dark .key-form-field,
.theme-dark .key-toggle-row,
.theme-dark .confirm-dialog-head h2 {
  color: #e5edf7;
}

.theme-dark .money-input {
  border-color: rgba(148, 163, 184, 0.28);
  background: #1f2937;
}

.theme-dark .money-input > span,
.theme-dark .key-form-field small {
  color: #94a3b8;
}

.theme-dark .toast strong {
  color: #e5edf7;
}

.theme-dark .config-tabs {
  border-bottom-color: rgba(148, 163, 184, 0.28);
}

.theme-dark td {
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.theme-dark .platform-item,
.theme-dark .profile-metrics span,
.theme-dark .avatar-editor,
.theme-dark .profile-grid form {
  background: rgba(31, 41, 55, 0.72);
}

.theme-dark .donut::after {
  background: #111827;
}

.console-shell.is-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.console-shell.is-collapsed .brand-lockup strong,
.console-shell.is-collapsed .nav-item span:last-child,
.console-shell.is-collapsed .sidebar-footer span:last-child {
  display: none;
}

.console-shell.is-collapsed .brand-lockup,
.console-shell.is-collapsed .nav-item {
  justify-content: center;
}

@media (max-width: 1180px) {
  .console-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

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

  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 18px 24px;
  }
}

@media (max-width: 780px) {
  .console-shell,
  .console-shell.is-collapsed,
  .copy-grid,
  .profile-grid,
  .plan-grid,
  .chart-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .workspace-body {
    padding: 24px 16px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .keys-console {
    min-height: 0;
    padding-top: 12px;
  }

  .keys-actions-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }

  .toolbar-row,
  .filter-band,
  .key-toolbar-row,
  .inline-form,
  .key-form {
    grid-template-columns: 1fr;
  }

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

  .key-table-scroll {
    overflow-x: auto;
  }

  .key-table .key-name-col {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }

  .key-table .key-value-col {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
  }

  .key-table .key-actions-col {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }

  .api-key-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .api-key-modal-head,
  .api-key-modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-hero {
    align-items: start;
    flex-direction: column;
  }

  .profile-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 22px;
  }

  .login-brand-lockup,
  .code-control,
  .copy-input,
  .generated-key,
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .login-brand-lockup {
    display: grid;
    justify-items: center;
  }

  .login-brand-panel h1 {
    font-size: 36px;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }
}
