/* Cloudfloat Developer Portal — dark app theme built around the brand cloud
   (#FF38AF). One vivid colour, used with restraint; the rest is a disciplined
   neutral ramp. Sidebar-navigated app shell; centred card for login. */
:root {
  --brand: #ff38af;
  --brand-strong: #ff63c2;
  --brand-tint: rgba(255, 56, 175, 0.14);
  --brand-line: rgba(255, 56, 175, 0.45);
  --on-brand: #ffffff;

  --ground: #0b0c14;
  --glow: rgba(255, 56, 175, 0.16);
  --surface: #14151f;
  --surface-2: #1a1c28;
  --inset: #101019;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f3f4fa;
  --text-soft: #aeb3c8;
  --muted: #767c93;

  --danger: #ff6b84;
  --danger-tint: rgba(255, 107, 132, 0.15);

  --ring: 0 0 0 3px rgba(255, 56, 175, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font: inherit;
}

/* ----- Brand mark (login + sidebar) ----- */
.brand-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px -8px var(--glow);
}
.brand-logo__svg {
  width: 28px;
  height: 20px;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-text__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ----- Loading ----- */
.loading-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================ Buttons / fields ============================ */
.btn {
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.04s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn--block {
  width: 100%;
}
.btn--primary {
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: 0 8px 22px -10px var(--brand);
}
.btn--primary:hover {
  background: var(--brand-strong);
}
.btn--primary:disabled {
  opacity: 0.65;
  cursor: progress;
  box-shadow: none;
}
.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-soft);
}
.btn--ghost:hover {
  border-color: var(--brand-line);
  color: var(--text);
}
.btn--danger {
  color: var(--danger);
}
.btn--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-tint);
}
.btn--compact {
  padding: 8px 13px;
  font-size: 13px;
}
.btn__spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: none;
  animation: spin 0.6s linear infinite;
}
.btn.is-loading .btn__label {
  opacity: 0.85;
}
.btn.is-loading .btn__spinner {
  display: inline-block;
}
.icon-plus {
  width: 15px;
  height: 15px;
}
/* Inherits the button's currentColor (unlike .nav__icon, which is forced muted). */
.btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.field {
  display: block;
  margin-bottom: 15px;
}
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-soft);
}
.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.field input::placeholder {
  color: var(--muted);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.error {
  margin: 0 0 13px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

/* ============================ Login ============================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(820px 460px at 50% -120px, var(--glow), transparent 60%),
    var(--ground);
}
.login {
  width: 100%;
  max-width: 400px;
}
.login__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 20px;
  padding-left: 2px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.8);
}
.card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.025em;
}
.card__lede {
  margin: 7px 0 22px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}
.card__foot {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================ App shell ============================ */
.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px;
  background: var(--ground);
  border-right: 1px solid var(--line);
}
.side__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}
.side__brand .brand-logo {
  width: 40px;
  height: 40px;
}
/* Collapse / expand toggle — sits at the right of the brand row when expanded,
   centred under the logo when collapsed (the brand row goes column in rail mode). */
.side__toggle {
  flex: none;
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}
.side__toggle:hover {
  border-color: var(--brand-line);
  color: var(--text);
}
.side__toggle:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.side__toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
}
.nav__item:hover {
  background: var(--surface);
  color: var(--text);
}
.nav__item:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.nav__item.is-active {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  color: #fff;
}
.nav__icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}
.nav__item.is-active .nav__icon,
.nav__item:hover .nav__icon {
  color: var(--text);
}
.nav__item.is-active .nav__icon {
  color: var(--brand);
}
.nav__label {
  flex: 1;
}
.nav__soon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}
.nav__item:disabled {
  cursor: default;
}
.nav__item:disabled:hover {
  background: transparent;
  color: var(--text-soft);
}
.nav__item:disabled:hover .nav__icon {
  color: var(--muted);
}
.nav__divider {
  height: 1px;
  background: var(--line);
  margin: 10px 6px;
}
.side__spacer {
  flex: 1;
}
.side__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 8px;
}
.side__userinfo {
  min-width: 0;
  flex: 1;
}
.side__email {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side__platform {
  font-size: 11px;
  color: var(--brand);
}
.side__platform.is-muted {
  color: var(--muted);
}
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}

/* ----- Main / pages ----- */
.main {
  min-width: 0;
  padding: 34px 40px 64px;
}
.main__inner {
  /* Fill the available width on larger screens (the old 760px cap left a wide
     empty gutter), but hold a ceiling so text lines don't get unreadably long. */
  max-width: 1200px;
}
.page-head {
  margin-bottom: 22px;
}
.page-head__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.03em;
}
.page-lede {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
  max-width: 52ch;
}
.note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ============================ Create form ============================ */
.key-create {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.key-create__grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 14px;
}
.key-create__grid .field {
  margin-bottom: 0;
}
.key-create .error {
  margin: 13px 0 0;
}
.key-create__row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ----- One-time reveal — the memorable moment ----- */
.reveal {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.reveal::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
}
.reveal__title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
}
.reveal__msg {
  margin: 0 0 13px;
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.5;
}
.reveal__value {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-all;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}
.reveal__row {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

/* ============================ Key cards ============================ */
.keys {
  display: grid;
  gap: 12px;
}
.key-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease;
}
.key-card:hover {
  border-color: var(--line-strong);
}
.key-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.key-card__name {
  font-size: 15.5px;
  font-weight: 660;
  letter-spacing: -0.01em;
}
.key-card__id {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-soft);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
}
.key-card__controls {
  flex: none;
  display: flex;
  gap: 8px;
}
.key-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 18px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.stat__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat__value {
  font-size: 13px;
  color: var(--text);
  margin-top: 3px;
}
.stat__value.is-empty {
  color: var(--muted);
}

/* ============================ Empty states ============================ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 60px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty__icon {
  width: 30px;
  height: 30px;
  color: var(--brand);
}
.empty__title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.empty__text {
  font-size: 13.5px;
  max-width: 40ch;
  line-height: 1.5;
}

/* ============================ Settings ============================ */
.block {
  margin-bottom: 30px;
}
.block__title {
  margin: 0 0 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.block__head .block__title {
  margin: 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.panel:empty {
  display: none;
}
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}
.kv + .kv {
  border-top: 1px solid var(--line);
}
.kv__k {
  font-size: 13px;
  color: var(--text-soft);
}
.kv__v {
  font-size: 13.5px;
  font-weight: 550;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}
.device + .device {
  border-top: 1px solid var(--line);
}
.device__name {
  font-weight: 600;
  font-size: 14px;
}
.device__meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.device__badge {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 4px 11px;
}

/* ============================ Usage ============================ */
.stats4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.statcard {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.statcard__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.statcard__value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.usage-note {
  margin-bottom: 16px;
}
.usage-recent-title {
  margin: 0 0 12px;
}
.usage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
}
.usage-item + .usage-item {
  border-top: 1px solid var(--line);
}
.usage-item__main {
  min-width: 0;
}
.usage-item__ep {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.usage-item__method {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}
.usage-item__route {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-item__when {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.usage-item__right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.usage-item__lat {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Status colours encode the response band (2xx/4xx/5xx) — semantic, not decoration. */
.status-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: var(--inset);
  font-variant-numeric: tabular-nums;
}
.status-badge.is-ok {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.12);
}
.status-badge.is-warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}
.status-badge.is-err {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-tint);
}

/* ============================ Playground ============================ */
.inline-code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--text-soft);
}

/* Shared API key card — full-width, prominent */
.pg-key-card {
  margin-bottom: 20px;
  padding: 18px 20px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.pg-key-card .field {
  margin-bottom: 6px;
}
.pg-key-card .field input {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.pg-key-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Two-column layout: endpoint list + panel */
.pg-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

/* Endpoint list — column of selectable rows */
.pg-endpoints {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pg-ep {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.13s ease,
    border-color 0.13s ease,
    color 0.13s ease;
}
.pg-ep:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
}
.pg-ep.is-active {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  color: #fff;
}
.pg-ep:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.pg-ep__top {
  display: flex;
  align-items: center;
  gap: 7px;
}
/* Method pill */
.pg-ep__method {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}
.pg-ep__method--post {
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.pg-ep__method--get {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.pg-ep.is-active .pg-ep__method--post {
  color: #fff;
  background: rgba(255, 56, 175, 0.35);
  border-color: rgba(255, 255, 255, 0.3);
}
.pg-ep.is-active .pg-ep__method--get {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.5);
}
.pg-ep__path {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  /* override inline-code for slightly larger display in the list */
  padding: 0;
  border: none;
  background: none;
}
.pg-ep.is-active .pg-ep__path {
  color: #fff;
}
.pg-ep__summary {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}
.pg-ep.is-active .pg-ep__summary {
  color: rgba(255, 255, 255, 0.65);
}

/* Right panel */
.pg-panel {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.pg-panel__head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
/* reuse the pill style in the panel header too */
.pg-panel__head .pg-ep__method {
  font-size: 11px;
  padding: 3px 8px;
}
.pg-panel__head .pg-ep__path {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--inset);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 6px;
}
.pg-panel__summary {
  font-size: 13px;
  color: var(--muted);
}
.pg-fields {
  margin-bottom: 16px;
}
.pg-fields .field {
  margin-bottom: 14px;
}
.pg-fields .field:last-child {
  margin-bottom: 0;
}
.pg-no-params {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.pg-panel .error {
  margin: 0 0 14px;
}

/* Response viewer */
.pg-result {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.pg-result__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.pg-result__title {
  margin: 0;
}
.pg-body {
  margin: 0;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

/* ===================== Collapsed sidebar (rail) ===================== */
/* Scoped to the desktop layout only — below 760px the sidebar is already a
   horizontal bar, so the rail toggle is inert there (and hidden). */
@media (min-width: 761px) {
  .app.is-rail {
    grid-template-columns: 72px 1fr;
  }
  .app.is-rail .side {
    padding-left: 12px;
    padding-right: 12px;
  }
  .app.is-rail .side__brand {
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 14px;
  }
  .app.is-rail .brand-text {
    display: none;
  }
  .app.is-rail .side__toggle {
    margin-left: 0;
  }
  .app.is-rail .side__toggle svg {
    transform: rotate(180deg);
  }
  .app.is-rail .nav__item {
    justify-content: center;
    padding: 9px;
  }
  .app.is-rail .nav__label,
  .app.is-rail .nav__soon {
    display: none;
  }
  .app.is-rail .side__user {
    justify-content: center;
    padding: 9px;
  }
  .app.is-rail .side__userinfo {
    display: none;
  }
  .app.is-rail #logout-button .btn__text {
    display: none;
  }
}

/* ============================ Responsive ============================ */
@media (max-width: 760px) {
  .side__toggle {
    display: none;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--line);
    gap: 8px;
    padding: 12px 14px;
  }
  .side__brand {
    padding: 0;
    margin-right: auto;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .nav__soon,
  .nav__divider,
  .side__spacer {
    display: none;
  }
  .side__user {
    order: 5;
    flex: 1 1 200px;
    margin-bottom: 0;
  }
  .side > .btn--block {
    width: auto;
  }
  .main {
    padding: 24px 18px 56px;
  }
  .key-create__grid {
    grid-template-columns: 1fr;
  }
  .key-card__stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats4 {
    grid-template-columns: 1fr 1fr;
  }
  .pg-layout {
    grid-template-columns: 1fr;
  }
  .pg-endpoints {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pg-ep {
    flex: 1 1 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .btn__spinner {
    animation: none;
  }
}
