:root {
  --ink: #18211e;
  --ink-soft: #53605b;
  --ink-faint: #7a8580;
  --canvas: #f3f5f1;
  --paper: #ffffff;
  --paper-soft: #f8f9f6;
  --line: #dfe5df;
  --line-strong: #ccd5ce;
  --sidebar: #10251e;
  --sidebar-soft: #173128;
  --sidebar-line: rgba(255, 255, 255, 0.09);
  --accent: #169b66;
  --accent-dark: #087a4d;
  --accent-soft: #e3f5ec;
  --blue: #397bd6;
  --blue-soft: #e9f1ff;
  --violet: #7356c7;
  --violet-soft: #f0ebff;
  --amber: #b87518;
  --amber-soft: #fff2dd;
  --danger: #c33f46;
  --danger-dark: #a92e35;
  --danger-soft: #ffebec;
  --warning: #936213;
  --warning-soft: #fff5df;
  --shadow-sm: 0 1px 2px rgba(12, 35, 26, 0.06);
  --shadow-md: 0 14px 40px rgba(17, 42, 33, 0.09);
  --shadow-lg: 0 24px 70px rgba(9, 27, 20, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

code,
pre {
  font-family: var(--mono);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clipboard-fallback {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent-dark);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(22, 155, 102, 0.3);
  outline-offset: 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 48%),
    var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px 12px 12px 4px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 24px rgba(11, 166, 103, 0.22);
}

.brand-mark-large {
  width: 54px;
  height: 54px;
  border-radius: 17px 17px 17px 6px;
  font-size: 25px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-on-dark {
  color: #fff;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 700;
  line-height: 1.2;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(22, 155, 102, 0.2);
}

.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 10px 28px rgba(8, 122, 77, 0.25);
}

.button-secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  border-color: #aebbb2;
  background: var(--paper-soft);
}

.button-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(24, 33, 30, 0.14);
}

.button-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button-danger:hover {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
}

.button-danger-quiet {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f8cfd1;
}

.button-danger-quiet:hover {
  color: var(--danger-dark);
  background: #ffe1e3;
}

.button-small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.button-block {
  width: 100%;
}

.button-arrow {
  margin-left: auto;
  font-size: 20px;
  font-weight: 400;
}

.button.is-loading .button-label::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 9px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 24px;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(24, 33, 30, 0.06);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button-bordered {
  background: var(--paper);
  border: 1px solid var(--line);
}

.icon-button-on-dark {
  color: rgba(255, 255, 255, 0.58);
}

.icon-button-on-dark:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.text-button,
.text-link {
  padding: 0;
  color: var(--accent-dark);
  background: none;
  border: 0;
  font-weight: 700;
}

.text-button:hover,
.text-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field > small {
  color: var(--ink-faint);
  font-size: 12px;
}

.field input,
.field select,
.field textarea,
.compact-field select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a0aaa4;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.compact-field select:hover {
  border-color: #aebbb2;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 155, 102, 0.12);
}

.field textarea {
  min-height: 92px;
  height: auto;
  padding: 11px 13px;
  resize: vertical;
}

.password-control,
.secret-control {
  position: relative;
  display: flex;
  align-items: center;
}

.password-control input {
  padding-right: 65px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  padding: 5px 7px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid;
  border-radius: 11px;
  font-size: 13px;
}

.inline-alert > span:last-child {
  display: grid;
  gap: 2px;
}

.inline-alert small {
  color: inherit;
  opacity: 0.78;
  line-height: 1.45;
}

.inline-alert-warning {
  color: #79500d;
  background: var(--warning-soft);
  border-color: #f1d69f;
}

.inline-alert-error {
  color: #9c3036;
  background: var(--danger-soft);
  border-color: #f4c5c8;
}

.alert-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #aab2ad;
  border-radius: 50%;
}

.status-dot-live,
.is-healthy .status-dot,
.status-dot.is-healthy {
  background: #25c77e;
  box-shadow: 0 0 0 4px rgba(37, 199, 126, 0.12);
}

.is-unhealthy .status-dot,
.status-dot.is-unhealthy {
  background: #e25c63;
  box-shadow: 0 0 0 4px rgba(226, 92, 99, 0.12);
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.status-badge-success {
  color: #08764a;
  background: var(--accent-soft);
  border-color: #c6e9d9;
}

.status-badge-muted {
  color: #68736e;
  background: #f0f2ef;
  border-color: #dee3df;
}

.status-badge-error {
  color: #a72f36;
  background: var(--danger-soft);
  border-color: #f3c6c9;
}

.toast {
  position: fixed;
  z-index: 1000;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  color: #fff;
  background: #16362a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 650;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  background: #842d32;
}

/* Login */

.auth-page {
  overflow-x: hidden;
  background: #eef1ec;
}

.auth-layout {
  min-height: 100vh;
}

.auth-main {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 96px 28px 70px;
}

.auth-topbar {
  position: absolute;
  top: 30px;
  left: 34px;
  right: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.auth-topbar-actions,
.auth-service-status,
.auth-docs-link {
  display: inline-flex;
  align-items: center;
}

.auth-topbar-actions {
  gap: 22px;
}

.auth-service-status {
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.auth-docs-link {
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.auth-docs-link:hover {
  color: var(--accent-dark);
}

.auth-card {
  width: min(420px, 100%);
  padding: 39px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(210, 220, 213, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-heading h1 {
  margin: 0;
  font-size: 29px;
  letter-spacing: -0.04em;
}

.auth-card .inline-alert {
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 19px;
}

.auth-form .button {
  margin-top: 3px;
}

.auth-mode-switch {
  margin-top: 22px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 13px;
}

.auth-mode-switch .text-button {
  margin-left: 4px;
}

.auth-security-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding-top: 20px;
  margin: 22px 0 0;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.55;
}

.auth-security-note span {
  color: var(--accent);
  font-size: 8px;
  transform: translateY(4px);
}

/* Console shell */

.console-page {
  background: var(--canvas);
}

.console-page.sidebar-open {
  overflow: hidden;
}

.console-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--ink-soft);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 650;
}

.loading-line {
  position: relative;
  width: 120px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.loading-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 45%;
  height: 100%;
  background: var(--accent);
  animation: loading-line 1s ease-in-out infinite;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: 246px;
  flex-direction: column;
  padding: 27px 19px 20px;
  color: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 0 0, rgba(40, 181, 119, 0.13), transparent 28%),
    var(--sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 28px;
}

.sidebar-close {
  display: none;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.admin-nav-group {
  display: grid;
  gap: 5px;
  padding-top: 17px;
  margin-top: 10px;
  border-top: 1px solid var(--sidebar-line);
}

.nav-label {
  margin: 0 10px 8px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.56);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(51, 193, 132, 0.15);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  background: #3ace8d;
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

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

.nav-count {
  min-width: 20px;
  padding: 2px 6px;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 10px;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
  min-height: 30px;
}

.sidebar-resources {
  padding: 16px 4px;
  border-top: 1px solid var(--sidebar-line);
}

.resource-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px;
  color: rgba(255, 255, 255, 0.47);
  font-size: 11px;
}

.resource-link:hover {
  color: #fff;
}

.sidebar-user {
  display: grid;
  align-items: center;
  padding: 15px 5px 0;
  border-top: 1px solid var(--sidebar-line);
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 9px;
}

.user-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #baf0d6;
  background: rgba(49, 196, 132, 0.15);
  border: 1px solid rgba(102, 218, 166, 0.16);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-user-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
}

.main-panel {
  min-height: 100vh;
  margin-left: 246px;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(243, 245, 241, 0.9);
  border-bottom: 1px solid rgba(209, 217, 211, 0.8);
  backdrop-filter: blur(14px);
}

.mobile-menu {
  display: none;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

.topbar-context strong {
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-docs {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.topbar-docs:hover {
  color: var(--accent-dark);
}

.service-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.content-wrap {
  width: min(1360px, 100%);
  padding: 36px 34px 70px;
  margin: 0 auto;
}

.view-header {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}

.view-header h1 {
  margin: 5px 0 4px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.view-header p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.view-actions {
  display: flex;
  gap: 10px;
}

.global-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  color: #973039;
  background: var(--danger-soft);
  border: 1px solid #f1c7ca;
  border-radius: 12px;
}

.global-error > span {
  display: grid;
  gap: 2px;
}

.global-error small {
  opacity: 0.78;
}

.console-view {
  animation: view-in 180ms ease-out;
}

.overview-access-panel {
  display: grid;
  align-items: center;
  padding: 28px;
  margin-bottom: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  gap: 32px;
}

.access-copy h2 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.access-copy > p {
  max-width: 550px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.endpoint-card {
  display: grid;
  min-width: 0;
  padding: 25px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(46, 193, 131, 0.2), transparent 45%),
    #132b22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(13, 39, 29, 0.18);
}

.endpoint-label {
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.endpoint-card code {
  display: block;
  overflow: hidden;
  margin: 10px 0 14px;
  color: #dff8ed;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}

.copy-button:hover {
  color: var(--accent-dark);
  border-color: #b6cec0;
}

.copy-button-dark {
  width: fit-content;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.copy-button-dark:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.endpoint-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  margin-top: 19px;
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 9px;
}

.endpoint-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.endpoint-meta .status-dot {
  width: 6px;
  height: 6px;
}

.metric-grid {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  min-height: 135px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
}

.metric-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  grid-column: 2;
  grid-row: 1 / span 2;
}

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

.metric-icon-green {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.metric-icon-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon-violet {
  color: var(--violet);
  background: var(--violet-soft);
}

.metric-icon-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.metric-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.metric-value {
  align-self: end;
  margin-top: 9px;
  font-size: 25px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card small {
  align-self: end;
  margin-top: 9px;
  color: var(--ink-faint);
  font-size: 10px;
}

.metric-grid-compact .metric-card {
  min-height: 110px;
}

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

.metric-card-featured {
  background:
    linear-gradient(145deg, rgba(227, 245, 236, 0.62), transparent 66%),
    var(--paper);
  border-color: #c5dfd1;
}

.money-metric,
.money-value {
  font-variant-numeric: tabular-nums;
}

.money-metric {
  overflow-wrap: anywhere;
}

.money-value {
  white-space: nowrap;
}

.money-value.is-positive {
  color: var(--accent-dark);
  font-weight: 750;
}

.money-value.is-negative {
  color: var(--danger);
  font-weight: 750;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h3 {
  margin: 4px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.overview-grid {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 14px;
}

.quickstart-panel,
.service-panel,
.recent-panel {
  padding: 22px;
}

.code-window {
  overflow: hidden;
  margin-top: 18px;
  color: #d8eee5;
  background: #13251e;
  border-radius: 12px;
}

.code-window-bar {
  display: flex;
  height: 33px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.33);
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.code-window-bar > span {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.code-window-bar small {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8px;
}

.code-window pre {
  max-height: 270px;
  overflow: auto;
  padding: 17px;
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.panel-footnote {
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.panel-footnote code {
  color: var(--ink-soft);
  font-size: 9px;
}

.service-list,
.account-details {
  margin: 18px 0 0;
}

.service-list > div,
.account-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0ed;
}

.service-list dt,
.account-details dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.service-list dd,
.account-details dd {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.service-note {
  padding: 10px 11px;
  margin: 14px 0 0;
  color: #755310;
  background: var(--warning-soft);
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.5;
}

.recent-list {
  display: grid;
  margin-top: 14px;
}

.recent-item {
  display: grid;
  min-height: 55px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #edf0ed;
  grid-template-columns: 26px minmax(130px, 1fr) minmax(100px, 0.8fr) 90px 90px;
  gap: 12px;
}

.recent-result {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.recent-result.is-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.recent-main,
.recent-secondary {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.recent-main strong,
.recent-secondary strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-main small,
.recent-secondary small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.recent-item > time,
.recent-item > span:last-child {
  color: var(--ink-faint);
  font-size: 10px;
  text-align: right;
}

.empty-state {
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 24px;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state > span {
  display: grid;
  gap: 5px;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state small {
  font-size: 10px;
}

.table-panel {
  overflow: hidden;
}

.table-panel-header,
.usage-toolbar {
  align-items: center;
  padding: 22px 24px;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.data-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.data-table th {
  height: 42px;
  padding: 0 16px;
  color: var(--ink-faint);
  background: #f8f9f7;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: 60px;
  padding: 11px 16px;
  color: var(--ink-soft);
  border-bottom: 1px solid #edf0ed;
  font-size: 11px;
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: #fbfcfa;
}

.data-table td strong {
  color: var(--ink);
  font-size: 12px;
}

.data-table code {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  padding: 5px 7px;
  color: #405149;
  background: #f1f4f1;
  border: 1px solid #e0e6e1;
  border-radius: 6px;
  font-size: 10px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-primary {
  display: grid;
  gap: 2px;
}

.table-primary small {
  color: var(--ink-faint);
  font-size: 10px;
}

.table-action {
  padding: 6px 9px;
  color: var(--danger);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.table-action:hover {
  background: var(--danger-soft);
  border-color: #f4d1d3;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-action:disabled:hover {
  background: transparent;
  border-color: transparent;
}

.table-action-neutral {
  color: var(--accent-dark);
}

.table-action-neutral:hover {
  background: var(--accent-soft);
  border-color: #ccebdd;
}

.table-action-positive {
  color: var(--accent-dark);
}

.table-action-positive:hover {
  background: var(--accent-soft);
  border-color: #ccebdd;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.table-empty td {
  height: 180px;
  color: var(--ink-faint);
  text-align: center;
}

.info-strip {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  margin-top: 14px;
  color: var(--ink-soft);
  background: #edf3ee;
  border: 1px solid #d6e1d8;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.6;
}

.info-strip strong {
  display: block;
  color: var(--ink);
}

.info-strip-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-dark);
  border: 1px solid #8dc4a9;
  border-radius: 50%;
  font-family: serif;
  font-size: 11px;
  font-weight: 800;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-field select {
  width: auto;
  min-width: 120px;
  height: 36px;
  padding: 0 30px 0 10px;
  background-color: var(--paper);
  font-size: 11px;
}

.usage-table {
  min-width: 700px;
}

.ledger-table {
  min-width: 980px;
}

.admin-users-table {
  min-width: 1080px;
}

.price-table {
  min-width: 1320px;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-search input {
  width: min(230px, 28vw);
  height: 36px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  font-size: 11px;
}

.admin-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 155, 102, 0.12);
}

.result-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.result-code {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 45px;
  padding: 10px 16px;
  color: var(--ink-faint);
  background: #fafbfa;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(380px, 1.3fr);
  gap: 14px;
}

.account-profile-card {
  display: grid;
  align-items: center;
  padding: 25px;
  grid-row: 1 / span 2;
  grid-template-columns: 58px 1fr auto;
  gap: 15px;
}

.account-avatar {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent),
    var(--accent);
  border-radius: 18px 18px 18px 6px;
  font-size: 21px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-profile-card h3 {
  overflow: hidden;
  margin: 5px 0 2px;
  font-size: 14px;
  text-overflow: ellipsis;
}

.account-profile-card p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.account-details-card,
.security-card {
  padding: 22px;
}

.account-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 25px;
}

.security-item {
  display: grid;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf0ed;
  grid-template-columns: 36px 1fr auto;
  gap: 11px;
}

.security-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 10px;
}

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

.security-item > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.security-item strong {
  font-size: 11px;
}

.security-item small {
  color: var(--ink-faint);
  font-size: 10px;
}

.security-card > .button {
  margin-top: 18px;
}

/* Dialogs */

.modal {
  width: min(500px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(8, 22, 17, 0.58);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modal-in 170ms ease-out;
}

.modal-card {
  padding: 26px;
  margin: 0;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

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

.modal-card-scroll {
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 17px;
}

.form-grid-two {
  margin: 20px 0 17px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  margin-top: 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.field-checkbox input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent-dark);
}

.field-checkbox > span {
  display: grid;
  gap: 3px;
}

.field-checkbox strong {
  font-size: 12px;
}

.field-checkbox small {
  color: var(--ink-faint);
  font-size: 10px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h2 {
  margin: 5px 0 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.modal-description {
  margin: 17px 0 21px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 25px;
}

.modal-actions-single .button {
  width: 100%;
}

.modal-card .inline-alert {
  margin: 19px 0;
}

.success-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 7px 20px rgba(22, 155, 102, 0.24);
}

.secret-control input {
  padding-right: 76px;
  font-family: var(--mono);
  font-size: 10px;
}

.secret-control .copy-button {
  position: absolute;
  right: 7px;
}

.revoke-prefix {
  display: block;
  overflow: hidden;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-overlay {
  position: fixed;
  z-index: 45;
  inset: 0;
  background: rgba(8, 22, 17, 0.5);
  backdrop-filter: blur(2px);
}

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

@keyframes loading-line {
  from {
    left: -45%;
  }
  to {
    left: 100%;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@media (max-width: 1120px) {
  .overview-access-panel {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    gap: 28px;
  }

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

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .auth-main {
    padding: 90px 20px 70px;
  }

  .auth-topbar {
    top: 18px;
    left: 22px;
    right: 22px;
  }

  .sidebar {
    width: min(286px, calc(100vw - 45px));
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close {
    display: inline-grid;
  }

  .main-panel {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 20px;
  }

  .topbar-context {
    margin-right: auto;
    margin-left: 10px;
  }

  .content-wrap {
    padding: 30px 20px 60px;
  }
}

@media (max-width: 700px) {
  .auth-card {
    padding: 28px 23px;
    border-radius: 22px;
  }

  .overview-access-panel {
    padding: 24px;
    grid-template-columns: 1fr;
  }

  .access-copy h2 {
    font-size: 22px;
  }

  .view-header {
    min-height: auto;
    margin-bottom: 22px;
  }

  .view-header h1 {
    font-size: 24px;
  }

  .view-actions {
    display: none;
  }

  .recent-item {
    grid-template-columns: 26px minmax(120px, 1fr) 80px;
  }

  .recent-secondary,
  .recent-item > span:last-child {
    display: none;
  }

  .account-profile-card {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .account-profile-card .status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .account-avatar {
    width: 50px;
    height: 50px;
  }

  .account-details {
    grid-template-columns: 1fr;
  }

  .table-panel-header,
  .usage-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-header-actions {
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .admin-search {
    flex: 1 1 290px;
  }

  .admin-search input {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .form-grid-two {
    grid-template-columns: 1fr;
  }

  .compact-field {
    flex: 1;
  }

  .compact-field select {
    width: 100%;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .responsive-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .responsive-data-table tbody {
    display: grid;
    padding: 12px;
    background: #f8f9f7;
    gap: 10px;
  }

  .responsive-data-table tbody tr {
    display: grid;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-data-table td {
    display: grid;
    min-width: 0;
    height: auto;
    min-height: 58px;
    align-content: center;
    gap: 4px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf0ed;
    overflow-wrap: anywhere;
  }

  .responsive-data-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 750;
  }

  .responsive-data-table td:not([data-label])::before {
    display: none;
  }

  .responsive-data-table td:first-child,
  .responsive-data-table .responsive-action-cell {
    grid-column: 1 / -1;
  }

  .responsive-data-table .responsive-action-cell {
    min-height: 52px;
  }

  .responsive-data-table .table-action {
    min-height: 44px;
    padding: 9px 11px;
  }

  .responsive-data-table .money-value {
    white-space: normal;
  }

  .responsive-data-table tbody tr:hover td {
    background: transparent;
  }

  .responsive-data-table .table-empty {
    display: block;
  }

  .responsive-data-table .table-empty td {
    min-height: 150px;
    border: 0;
  }
}

@media (max-width: 480px) {
  .auth-service-status {
    display: none;
  }

  .auth-main {
    padding: 80px 14px 55px;
  }

  .auth-topbar {
    top: 15px;
    left: 17px;
    right: 17px;
  }

  .auth-docs-link {
    font-size: 11px;
  }

  .content-wrap {
    padding: 25px 14px 50px;
  }

  .topbar {
    height: 58px;
    padding: 0 12px;
  }

  .topbar-docs {
    display: none;
  }

  .topbar-context > span:first-child,
  .topbar-context > span:nth-child(2) {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .wallet-metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 120px;
    padding: 14px;
  }

  .metric-icon {
    width: 30px;
    height: 30px;
  }

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

  .access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .endpoint-card {
    padding: 20px;
  }

  .quickstart-panel,
  .service-panel,
  .recent-panel {
    padding: 18px;
  }

  .recent-item {
    grid-template-columns: 24px minmax(100px, 1fr) 68px;
    gap: 8px;
  }

  .modal-card {
    padding: 22px 19px;
  }

  .admin-header-actions,
  .admin-search {
    flex-direction: column;
  }

  .admin-search {
    flex-basis: auto;
  }

  .admin-search .button,
  .admin-header-actions > .button {
    width: 100%;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
