:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-strong: #eef3f9;
  --text: #142033;
  --text-soft: #58677b;
  --text-faint: #748297;
  --line: #dce4ee;
  --line-strong: #c8d3df;
  --brand: #155eef;
  --brand-dark: #0d46be;
  --brand-soft: #eaf1ff;
  --success: #087a55;
  --success-soft: #e9f8f1;
  --warning: #9a5b00;
  --warning-soft: #fff7df;
  --danger: #b4232f;
  --danger-dark: #8d1822;
  --danger-soft: #fff0f1;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 16px 42px rgb(31 47 70 / 0.1);
  --radius-sm: 0.45rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.2rem;
  --content-width: 92rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgb(21 94 239 / 0.06), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

a {
  color: var(--brand-dark);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand);
}

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

button,
summary,
select {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgb(21 94 239 / 0.35);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

code {
  border-radius: 0.3rem;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.api-example {
  max-width: 100%;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  white-space: pre-wrap;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

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

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgb(220 228 238 / 0.9);
  background: rgb(255 255 255 / 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  display: flex;
  width: min(100% - 2rem, var(--content-width));
  min-height: 4.6rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--text);
  text-decoration: none;
}

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

.brand__mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 0.72rem;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  box-shadow: 0 8px 20px rgb(21 94 239 / 0.22);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: -0.1rem;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.topbar__account {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.account-label__avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #cbd9ee;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-label__caption,
.account-label strong {
  display: block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-label__caption {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.account-label strong {
  font-size: 0.82rem;
}

.app-layout {
  display: grid;
  width: min(100% - 2rem, var(--content-width));
  min-height: calc(100vh - 9rem);
  margin-inline: auto;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}

.app-layout--centered {
  display: grid;
  width: min(100% - 2rem, 42rem);
  min-height: calc(100vh - 9rem);
  margin-inline: auto;
  place-items: center;
}

.sidebar {
  align-self: start;
  padding-block: 2rem;
  position: sticky;
  top: 4.7rem;
}

.section-nav ul {
  display: grid;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.section-nav a {
  display: flex;
  min-height: 2.55rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 650;
  text-decoration: none;
}

.section-nav a:hover {
  background: rgb(255 255 255 / 0.7);
  color: var(--text);
}

.section-nav a[aria-current="page"] {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--brand-dark);
}

.section-nav__marker {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.section-nav a[aria-current="page"] .section-nav__marker {
  background: var(--brand);
  box-shadow: 0 0 0 0.25rem var(--brand-soft);
}

.main-content {
  min-width: 0;
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.main-content:focus {
  outline: none;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}

.page-heading p,
.section-heading p {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--text-soft);
}

.eyebrow {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--brand-dark);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  margin: 0 0 2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  min-width: 0;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card dt {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-card dd {
  margin: 0.25rem 0 0.1rem;
  color: var(--text);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 780;
  letter-spacing: -0.04em;
}

.stat-card span {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.dashboard-section {
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  scroll-margin-top: 5.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.count-pill {
  flex: 0 0 auto;
  padding: 0.3rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.notice p {
  margin: 0;
}

.notice__mark {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  margin-top: 0.43rem;
  border-radius: 50%;
  background: var(--brand);
}

.notice--success {
  border-color: #b8e7d3;
  background: var(--success-soft);
  color: #075d43;
}

.notice--success .notice__mark {
  background: var(--success);
}

.notice--warning {
  border-color: #efd58b;
  background: var(--warning-soft);
  color: #714200;
}

.notice--warning .notice__mark {
  background: var(--warning);
}

.notice--error {
  border-color: #efbdc1;
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.notice--error .notice__mark {
  background: var(--danger);
}

.action-panel {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.action-panel summary {
  padding: 0.78rem 1rem;
  color: var(--brand-dark);
  font-weight: 750;
  list-style-position: inside;
}

.action-panel summary:hover {
  background: var(--brand-soft);
}

.action-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.action-panel__body {
  padding: 1rem;
}

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

.stack-form {
  display: grid;
  gap: 1rem;
}

.field {
  min-width: 0;
}

.field--span-2 {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 720;
}

.field > label {
  display: block;
  margin-bottom: 0.34rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="datetime-local"],
.field select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.68rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.field input:hover,
.field select:hover {
  border-color: #aebdce;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(21 94 239 / 0.14);
}

.field input:disabled,
.field select:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

fieldset.field {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.check-grid {
  display: grid;
  margin-top: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
}

.check-grid label {
  display: flex;
  align-items: start;
  gap: 0.48rem;
  color: var(--text-soft);
  font-weight: 520;
}

.check-grid input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin-top: 0.18rem;
  accent-color: var(--brand);
}

.field-hint {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.form-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.92rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 730;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

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

.button--primary {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 5px 14px rgb(21 94 239 / 0.18);
  color: #fff;
}

.button--primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #fff;
}

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

.button--secondary:hover {
  border-color: #9fadc0;
  background: var(--surface-subtle);
  color: var(--text);
}

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

.button--quiet:hover {
  background: var(--surface-strong);
  color: var(--text);
}

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

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

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

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

.button--small {
  min-height: 2rem;
  padding: 0.37rem 0.58rem;
  font-size: 0.76rem;
}

.button--wide {
  width: 100%;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.82rem;
  text-align: left;
}

th,
td {
  padding: 0.82rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #fbfcfe;
}

tbody th {
  font-weight: inherit;
}

.table-primary,
.table-secondary,
.table-id {
  display: block;
}

.table-primary {
  color: var(--text);
  font-weight: 700;
}

.table-secondary {
  margin-top: 0.1rem;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.table-id {
  max-width: 16rem;
  margin-top: 0.16rem;
  overflow: hidden;
  color: var(--text-faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  min-width: 9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.inline-form {
  display: inline-flex;
}

.url-value {
  display: block;
  max-width: 20rem;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  max-width: 20rem;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag-list code {
  display: inline-block;
  padding: 0.16rem 0.34rem;
  border: 1px solid #d8e3f6;
  background: var(--brand-soft);
  color: #154391;
  font-size: 0.68rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status__dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--text-faint);
}

.status--active,
.status--succeeded,
.status--success {
  color: var(--success);
}

.status--active .status__dot,
.status--succeeded .status__dot,
.status--success .status__dot {
  background: var(--success);
  box-shadow: 0 0 0 0.22rem var(--success-soft);
}

.status--queued,
.status--running {
  color: var(--brand-dark);
}

.status--queued .status__dot,
.status--running .status__dot {
  background: var(--brand);
  box-shadow: 0 0 0 0.22rem var(--brand-soft);
}

.status--suspended,
.status--blocked,
.status--locked,
.status--expired {
  color: var(--warning);
}

.status--suspended .status__dot,
.status--blocked .status__dot,
.status--locked .status__dot,
.status--expired .status__dot {
  background: var(--warning);
  box-shadow: 0 0 0 0.22rem var(--warning-soft);
}

.status--revoked,
.status--failed,
.status--failure,
.status--disabled,
.status--cancelled {
  color: var(--danger);
}

.status--revoked .status__dot,
.status--failed .status__dot,
.status--failure .status__dot,
.status--disabled .status__dot,
.status--cancelled .status__dot {
  background: var(--danger);
  box-shadow: 0 0 0 0.22rem var(--danger-soft);
}

.muted {
  color: var(--text-faint);
}

.empty-state {
  padding: 2.3rem 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  text-align: center;
}

.empty-state__mark {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-faint);
  font-size: 1.35rem;
}

.empty-state p {
  max-width: 30rem;
  margin: 0 auto;
  color: var(--text-soft);
}

.auth-card,
.secret-card,
.error-card {
  width: 100%;
  padding: clamp(1.35rem, 5vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-card {
  max-width: 30rem;
  margin-inline: auto;
}

.auth-card__intro p,
.auth-card__help {
  color: var(--text-soft);
}

.auth-card__help {
  margin: 1.2rem 0 0;
  font-size: 0.78rem;
  text-align: center;
}

.secret-card {
  max-width: 50rem;
  margin-inline: auto;
}

.key-summary {
  display: grid;
  padding: 0;
  margin: 1.3rem 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.key-summary > div {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.key-summary dt {
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.key-summary dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 650;
}

.secret-display {
  padding: 1rem;
  border: 1px solid #bdcdeb;
  border-radius: var(--radius-md);
  background: #f5f8ff;
}

.secret-display__label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.secret-display code {
  display: block;
  max-width: 100%;
  padding: 0.9rem;
  overflow-x: auto;
  border: 1px solid #d5e0f5;
  background: var(--surface);
  color: #102f67;
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
  user-select: all;
}

.secret-instructions {
  margin-top: 1.35rem;
}

.secret-instructions ol {
  padding-left: 1.4rem;
  color: var(--text-soft);
}

.secret-instructions li + li {
  margin-top: 0.35rem;
}

.page-actions {
  display: flex;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.error-card {
  max-width: 36rem;
  margin-inline: auto;
  text-align: center;
}

.error-card > p {
  color: var(--text-soft);
}

.error-card .page-actions {
  justify-content: center;
}

.error-code {
  display: block;
  color: #dce5f2;
  font-size: clamp(4.5rem, 18vw, 8rem);
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 0.85;
}

.request-id {
  font-size: 0.78rem;
}

.request-id code {
  padding: 0.16rem 0.3rem;
  background: var(--surface-strong);
}

.site-footer {
  width: min(100% - 2rem, var(--content-width));
  padding: 1.3rem 0 2rem;
  margin-inline: auto;
  color: var(--text-faint);
  font-size: 0.72rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 70rem) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-layout {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1.25rem;
  }

  .section-nav a {
    font-size: 0.84rem;
  }
}

@media (max-width: 52rem) {
  html {
    scroll-padding-top: 8.5rem;
  }

  .topbar {
    position: static;
  }

  .account-label {
    display: none;
  }

  .app-layout {
    display: block;
  }

  .sidebar {
    position: static;
    padding: 1rem 0 0;
  }

  .section-nav {
    overflow-x: auto;
  }

  .section-nav ul {
    display: flex;
    width: max-content;
    min-width: 100%;
  }

  .section-nav a {
    white-space: nowrap;
  }

  .section-nav__marker {
    display: none;
  }

  .main-content {
    padding-top: 1.5rem;
  }

  .dashboard-section {
    scroll-margin-top: 1rem;
  }
}

@media (max-width: 38rem) {
  .topbar__inner,
  .app-layout,
  .app-layout--centered,
  .site-footer {
    width: min(100% - 1rem, var(--content-width));
  }

  .topbar__inner {
    min-height: 4.2rem;
  }

  .brand small {
    display: none;
  }

  .stats-grid,
  .form-grid,
  .check-grid,
  .key-summary {
    grid-template-columns: 1fr;
  }

  .field--span-2 {
    grid-column: auto;
  }

  .section-heading {
    display: block;
  }

  .section-heading .count-pill {
    display: inline-block;
    margin-top: 0.75rem;
  }

  .dashboard-section {
    padding: 0.8rem;
    border-radius: var(--radius-md);
  }

  .table-wrap {
    margin-inline: -0.1rem;
  }

  .auth-card,
  .secret-card,
  .error-card {
    border-radius: var(--radius-md);
  }

  .button {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .brand__mark,
  .status__dot,
  .notice__mark {
    forced-color-adjust: none;
  }

  .button,
  .status,
  .count-pill {
    border: 1px solid currentColor;
  }
}
