:root {
  color-scheme: dark;
  --bg: #070a10;
  --bg-soft: #0b1019;
  --surface: #101722;
  --surface-raised: #151e2c;
  --surface-hover: #192435;
  --border: #253146;
  --border-soft: #1b2638;
  --text: #edf3fb;
  --text-soft: #a9b7ca;
  --muted: #718198;
  --primary: #53e0ac;
  --primary-strong: #2fc58f;
  --primary-ink: #05251b;
  --blue: #62a7ff;
  --purple: #a78bfa;
  --amber: #f7b955;
  --rose: #fb7185;
  --cyan: #49d3e6;
  --danger: #ff6b7d;
  --success: #4ade80;
  --warning: #fbbf24;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --sidebar: 256px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* XiaosuBot: a warm, friendly companion instead of a developer dashboard. */
:root {
  color-scheme: light;
  --bg: #fff9f0;
  --bg-soft: #fff3e2;
  --surface: #fffdf9;
  --surface-raised: #fff7eb;
  --surface-hover: #fff0dc;
  --border: #efd5aa;
  --border-soft: #f7e5ca;
  --text: #4d2d13;
  --text-soft: #7d5b3a;
  --muted: #a77d51;
  --primary: #e99631;
  --primary-strong: #c97618;
  --primary-ink: #fffaf1;
  --blue: #6495d8;
  --purple: #a984c7;
  --amber: #e99631;
  --rose: #d7776e;
  --cyan: #5da8a2;
  --danger: #c95e57;
  --success: #67a66b;
  --warning: #d89531;
  --shadow: 0 18px 50px rgba(145, 87, 24, .12);
}

body { background: radial-gradient(circle at 84% -4%, #ffe7bc 0, transparent 25rem), var(--bg); }
.app-shell { background: var(--bg); }
.topbar, .sidebar { background: rgba(255, 253, 249, .92); border-color: var(--border-soft); }
.brand-mark, .mini-logo { background: linear-gradient(145deg, #ffc568, #e98d25); color: #6e3b10; box-shadow: 0 10px 25px rgba(222, 137, 31, .22); }
.brand-mark::after { content: "🐕"; font-size: .82em; }
.brand-mark { font-size: 0; }
.mini-logo { font-size: 0; }
.mini-logo::after { content: "🐕"; font-size: 16px; }
.panel, .stat-card, .auth-card { border-color: var(--border-soft); background: rgba(255, 253, 249, .92); box-shadow: var(--shadow); }
.button-primary { background: linear-gradient(135deg, #f5ac43, #df8521); border-color: #d77b1b; color: #fffaf1; box-shadow: 0 9px 20px rgba(216, 124, 28, .22); }
.button-secondary, .button-ghost { border-color: var(--border); color: var(--text); background: #fffaf3; }
.nav-link.is-active { color: #8d4a0c; background: #ffedcf; }
.nav-link:hover { background: #fff2df; }
.badge { background: #fff0d5; color: #8d4a0c; border-color: #edc98d; }
input, select, textarea { border-color: var(--border); background: #fffdf9; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233, 150, 49, .16); }
.eyebrow { color: #c77418; }

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -20%, rgba(83, 224, 172, .07), transparent 34rem),
    var(--bg);
  font-size: 15px;
  line-height: 1.55;
}

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

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

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--primary-ink);
  background: var(--primary);
  transform: translateY(-160%);
  transition: transform .18s ease;
}

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(140deg, rgba(12, 20, 30, .96), rgba(5, 8, 13, .99)),
    var(--bg);
}

.auth-shell::before {
  position: absolute;
  width: min(75vw, 950px);
  height: min(75vw, 950px);
  border: 1px solid rgba(83, 224, 172, .08);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 90px rgba(83, 224, 172, .025),
    0 0 0 180px rgba(83, 224, 172, .018);
}

.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(5px);
  pointer-events: none;
}

.ambient-one {
  top: 7%;
  right: 8%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(83, 224, 172, .19), transparent 68%);
}

.ambient-two {
  bottom: 5%;
  left: 6%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(98, 167, 255, .12), transparent 68%);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 40px;
  border: 1px solid rgba(137, 160, 190, .18);
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(20, 29, 42, .94), rgba(10, 15, 23, .96));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

.brand-mark,
.mini-logo {
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  background: linear-gradient(135deg, #72f1c1, #38c893);
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 8px 30px rgba(83, 224, 172, .2);
}

.brand-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border-radius: 15px;
  font-size: 19px;
}

.mini-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.2;
  letter-spacing: -.04em;
}

.auth-copy {
  margin: 14px 0 28px;
  color: var(--text-soft);
}

label {
  display: block;
  margin-bottom: 8px;
  color: #ced8e5;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #0a111b;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input,
textarea {
  padding: 11px 13px;
}

select {
  padding: 9px 34px 9px 12px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #35445c;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(83, 224, 172, .8);
  outline: none;
  background: #0c1520;
  box-shadow: 0 0 0 3px rgba(83, 224, 172, .1);
}

input::placeholder,
textarea::placeholder {
  color: #56667b;
}

.secret-field {
  position: relative;
}

.secret-field input {
  padding-right: 76px;
}

.secret-field .icon-button {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
}

.field-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 125, .32);
  border-radius: var(--radius-sm);
  color: #ffb1bb;
  background: rgba(255, 107, 125, .08);
  font-size: 13px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 760;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  color: var(--primary-ink);
  background: var(--primary);
  box-shadow: 0 8px 24px rgba(83, 224, 172, .14);
}

.button-primary:not(:disabled):hover {
  background: #70ebbd;
}

.button-secondary {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface-raised);
}

.button-secondary:not(:disabled):hover,
.button-ghost:not(:disabled):hover {
  border-color: #3a4a63;
  background: var(--surface-hover);
}

.button-ghost {
  border-color: transparent;
  color: var(--text-soft);
  background: transparent;
}

.button-danger {
  border-color: rgba(255, 107, 125, .35);
  color: #ffb0ba;
  background: rgba(255, 107, 125, .08);
}

.button-small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.button-block {
  width: 100%;
  margin-top: 22px;
}

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

.icon-button {
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(112, 129, 152, .1);
  font-size: 12px;
  font-weight: 700;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(112, 129, 152, .18);
}

.security-note,
.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.security-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .08);
}

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

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 66px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(7, 10, 16, .88);
  backdrop-filter: blur(16px);
}

.topbar-brand {
  display: flex;
  width: var(--sidebar);
  align-items: center;
  gap: 11px;
  padding: 0 22px;
  font-weight: 850;
  letter-spacing: -.02em;
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding-right: 24px;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-soft);
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: 66px;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--border-soft);
  background: #090e16;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(21, 30, 44, .55);
}

.sidebar-user > div {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  font-size: 13px;
}

.sidebar-user div > span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.avatar {
  display: grid !important;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #bcebd9;
  background: rgba(83, 224, 172, .11);
  font-weight: 850;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}

.nav-link > span {
  width: 20px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(21, 30, 44, .7);
}

.nav-link.is-active {
  color: #c8f8e6;
  background: rgba(83, 224, 172, .1);
  box-shadow: inset 2px 0 var(--primary);
}

.nav-link.is-active > span {
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--border-soft);
}

.sidebar-footer span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.sidebar-footer p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-scrim {
  position: fixed;
  z-index: 35;
  inset: 66px 0 0;
  border: 0;
  background: rgba(0, 0, 0, .6);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 98px clamp(22px, 4vw, 54px) 56px;
}

.page {
  width: min(100%, 1380px);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -.045em;
}

.page-heading > div > p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--text-soft);
}

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

.stat-card {
  position: relative;
  min-height: 144px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(21, 30, 44, .86), rgba(13, 19, 29, .86));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.stat-card::after {
  position: absolute;
  top: -50px;
  right: -45px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  content: "";
  background: var(--card-accent);
  filter: blur(42px);
  opacity: .15;
}

.stat-card > span,
.stat-card > strong,
.stat-card > small {
  position: relative;
  z-index: 1;
  display: block;
}

.stat-card > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 680;
}

.stat-card > strong {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.stat-card > small {
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accent-green { --card-accent: var(--primary); }
.accent-blue { --card-accent: var(--blue); }
.accent-purple { --card-accent: var(--purple); }
.accent-amber { --card-accent: var(--amber); }
.accent-cyan { --card-accent: var(--cyan); }
.accent-rose { --card-accent: var(--rose); }

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(16, 23, 34, .82);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-heading h2,
.panel > h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.025em;
}

.panel-heading > strong {
  font-size: 18px;
}

.badge,
.status-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(113, 129, 152, .08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}

.status-badge.is-success,
.badge.is-success {
  border-color: rgba(74, 222, 128, .25);
  color: #9df4ba;
  background: rgba(74, 222, 128, .08);
}

.status-badge.is-warning,
.badge.is-warning {
  border-color: rgba(251, 191, 36, .25);
  color: #fbd774;
  background: rgba(251, 191, 36, .08);
}

.status-badge.is-danger,
.badge.is-danger {
  border-color: rgba(255, 107, 125, .25);
  color: #ffa4af;
  background: rgba(255, 107, 125, .08);
}

.status-badge.is-info {
  border-color: rgba(98, 167, 255, .25);
  color: #a8ccff;
  background: rgba(98, 167, 255, .08);
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(90px, 35%) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.scope-list span {
  padding: 5px 8px;
  border: 1px solid rgba(83, 224, 172, .18);
  border-radius: 7px;
  color: #aee7d2;
  background: rgba(83, 224, 172, .06);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.text-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.activity-list {
  display: grid;
  gap: 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.activity-dot.is-success { background: var(--success); }
.activity-dot.is-danger { background: var(--danger); }
.activity-dot.is-warning { background: var(--warning); }

.activity-item strong,
.activity-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item strong {
  font-size: 12px;
}

.activity-item small {
  color: var(--muted);
  font-size: 10px;
}

.activity-item > time {
  color: var(--muted);
  font-size: 10px;
}

.usage-layout {
  margin-bottom: 18px;
}

.progress {
  display: block;
  width: 100%;
  height: 8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #080d14;
}

.progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #080d14;
}

.progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-strong), var(--primary));
}

.progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-strong), var(--primary));
}

.progress-purple::-webkit-progress-value {
  background: linear-gradient(90deg, #7c5ce2, var(--purple));
}

.progress-purple::-moz-progress-bar {
  background: linear-gradient(90deg, #7c5ce2, var(--purple));
}

.muted {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--border-soft);
}

.metric-strip > div {
  padding: 18px;
  background: #0d141e;
}

.metric-strip span,
.metric-strip strong {
  display: block;
}

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

.metric-strip strong {
  margin-top: 6px;
  font-size: 20px;
}

.tester-grid .panel {
  min-height: 300px;
}

.tester-grid form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.tester-grid form label {
  margin-bottom: -5px;
}

.tester-grid .button {
  margin-top: 7px;
  justify-self: start;
}

.endpoint-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.endpoint-label span {
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--primary-ink);
  background: var(--primary);
  font-size: 9px;
  font-weight: 900;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.endpoint-label code,
.docs-endpoints code {
  color: #bed2e9;
  font-size: 11px;
}

.response-panel pre,
.dialog pre,
.prose pre {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: #c5d5e7;
  background: #060a10;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.table-toolbar label {
  margin: 0;
}

.table-toolbar select {
  width: auto;
  min-width: 140px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: rgba(10, 16, 25, .72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

td {
  max-width: 280px;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
}

tbody tr:hover td {
  background: rgba(25, 36, 53, .3);
}

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

.row-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  margin: 0;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.prose {
  max-width: 980px;
}

.prose h2 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--text-soft);
}

.prose code {
  color: #bdebd9;
}

.docs-endpoints {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.docs-endpoints > div {
  display: grid;
  grid-template-columns: minmax(250px, 38%) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.docs-endpoints > div:last-child {
  border-bottom: 0;
}

.docs-endpoints span {
  color: var(--muted);
  font-size: 12px;
}

.dialog {
  width: min(92vw, 760px);
  max-height: 86vh;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(3px);
}

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

.dialog-heading h2 {
  margin: 0;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(380px, calc(100vw - 40px));
  gap: 10px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(16, 23, 34, .97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  animation: toast-in .2s ease-out;
}

.toast.is-success { border-left-color: var(--success); }
.toast.is-error { border-left-color: var(--danger); }

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  color: var(--text);
  font-size: 12px;
}

.toast span {
  margin-top: 3px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

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

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

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

@media (max-width: 800px) {
  :root { --sidebar: 268px; }

  .menu-button {
    display: flex;
    margin-left: 12px;
  }

  .topbar-brand {
    width: auto;
    padding: 0 10px;
  }

  .connection-state {
    display: none;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 20px 0 55px rgba(0, 0, 0, .38);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding-top: 92px;
  }

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

@media (max-width: 620px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 22px;
  }

  .topbar-actions {
    padding-right: 10px;
  }

  .topbar-brand > span:last-child {
    display: none;
  }

  .main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading .button {
    width: 100%;
  }

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

  .stat-card {
    min-height: 128px;
  }

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

  .docs-endpoints > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .panel {
    padding: 18px;
  }

  .table-panel {
    padding: 0;
  }

  .dialog {
    padding: 18px;
  }
}

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