* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #101418;
  --text: #141923;
  --muted: #627086;
  --faint: #8a96a8;
  --border: #dce3ee;
  --border-strong: #c7d1df;
  --blue: #0e5bd8;
  --blue-strong: #0848ad;
  --amber: #d98a1b;
  --amber-soft: #fff5df;
  --green: #168447;
  --green-soft: #dcf6e7;
  --red: #ae2730;
  --red-soft: #f9e0e3;
  --shadow: 0 14px 36px rgba(17, 25, 40, 0.08);
  --radius: 8px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.48;
}

a {
  color: var(--blue);
  text-decoration: none;
}

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

.app-frame {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  padding: 22px 18px;
  position: sticky;
  top: 0;
}

.brand-lockup {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  gap: 12px;
  min-width: 0;
}

.brand-icon {
  border-radius: 10px;
  display: block;
  flex: 0 0 auto;
  height: 40px;
  width: 40px;
}

.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-text strong {
  color: #111318;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.08;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

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

.side-nav a {
  border-radius: 7px;
  color: #2b384b;
  font-weight: 690;
  padding: 10px 11px;
}

.side-nav a:hover {
  background: #eef4ff;
  color: var(--blue-strong);
}

.sidebar-note {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 13px;
}

.sidebar-note strong {
  color: var(--text);
  font-size: 13px;
}

.sidebar-note span {
  font-size: 12px;
}

.app-main {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}

.account-menu {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.account-dot {
  align-items: center;
  background: var(--surface-strong);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.account-email {
  color: var(--muted);
  font-weight: 650;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px 28px 42px;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 28px;
}

.auth-frame {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 330px minmax(0, 460px);
  margin: 0 auto;
  max-width: 860px;
  overflow: hidden;
  width: 100%;
}

.auth-rail {
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.98), rgba(19, 23, 27, 0.96)),
    #111418;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 28px;
}

.auth-rail .brand-text strong,
.auth-rail .brand-text span {
  color: #ffffff;
}

.auth-rail .brand-text span,
.auth-rail .sidebar-note {
  opacity: 0.78;
}

.auth-rail .sidebar-note {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.76);
}

.auth-rail .sidebar-note strong {
  color: #ffffff;
}

.auth-steps {
  display: grid;
  gap: 18px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.auth-steps li {
  display: grid;
  gap: 2px 12px;
  grid-template-columns: 30px 1fr;
}

.auth-steps span {
  align-items: center;
  background: rgba(217, 138, 27, 0.14);
  border: 1px solid rgba(217, 138, 27, 0.48);
  border-radius: 999px;
  color: #ffd596;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  grid-row: span 2;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.auth-steps strong {
  color: #ffffff;
  font-size: 14px;
}

.auth-steps em {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-style: normal;
}

.auth-card {
  background: var(--surface);
  display: grid;
  gap: 22px;
  padding: 34px;
  width: 100%;
}

.auth-brand {
  margin-bottom: 22px;
}

.error-card {
  border-left: 3px solid var(--amber);
}

.notice {
  background: var(--amber-soft);
  border: 1px solid #e8bd69;
  border-radius: var(--radius);
  color: #684600;
  padding: 11px 13px;
}

.delivery-debug {
  display: none;
}

h1 {
  color: var(--text);
  font-size: 30px;
  font-weight: 780;
  line-height: 1.12;
  margin: 0 0 14px;
}

h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  margin: 0 0 12px;
}

.panel,
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.panel {
  padding: 20px;
}

.hero-panel {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 26px;
}

.approved-hero,
.reveal-hero {
  border-color: #b9d8c5;
  box-shadow: 0 14px 34px rgba(22, 132, 71, 0.08);
}

.reveal-hero {
  border-color: #e8bd69;
  box-shadow: 0 14px 34px rgba(217, 138, 27, 0.08);
}

.hero-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.page-lead {
  color: #40506a;
  font-size: 17px;
  margin: 0 0 8px;
  max-width: 780px;
}

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

.button,
button {
  align-items: center;
  background: var(--blue);
  border: 1px solid transparent;
  border-radius: 7px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

.button:hover,
button:hover {
  background: var(--blue-strong);
}

.button.secondary,
button.secondary {
  background: #eef2f7;
  color: var(--text);
}

.button.secondary:hover,
button.secondary:hover {
  background: #e1e7f0;
}

.button.copied,
button.copied {
  background: var(--green-soft);
  color: var(--green);
}

.nav-button {
  min-height: 34px;
  padding: 6px 10px;
}

.button.danger,
button.danger {
  background: var(--red);
}

.button.danger:hover,
button.danger:hover {
  background: #8d1f27;
}

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

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.journey-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.journey-steps li {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 1fr;
  min-height: 72px;
  padding: 14px;
}

.journey-steps li > span {
  align-items: center;
  background: #eef3f9;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 820;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.journey-steps li.done > span {
  background: var(--green-soft);
  color: var(--green);
}

.journey-steps li.current {
  border-color: #7aaaf2;
}

.journey-steps strong,
.journey-steps em {
  display: block;
}

.journey-steps em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  margin-top: 2px;
}

.action-panel {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.action-copy h2 {
  margin-bottom: 8px;
}

.action-copy p {
  margin: 8px 0 0;
}

.action-icon {
  align-items: center;
  background:
    radial-gradient(circle at 50% 48%, #151a18 0 42%, transparent 44%),
    radial-gradient(circle at 50% 50%, transparent 0 42%, #d98a1b 43% 48%, transparent 49%),
    linear-gradient(145deg, #303532, #0b0d0d);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  color: #f2bd70;
  display: inline-flex;
  font-size: 0;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.key-summary-panel {
  display: grid;
  gap: 18px;
}

.summary-main {
  display: grid;
  gap: 10px;
}

.summary-main h2 {
  margin: 0;
}

.key-chip {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  width: fit-content;
}

.details-grid,
.endpoint-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.endpoint-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.details-grid div,
.endpoint-grid div {
  background: var(--surface-soft);
  border: 1px solid #e4eaf2;
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.details-grid span,
.endpoint-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.details-grid strong {
  color: var(--text);
  font-size: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-details {
  margin-top: 16px;
}

.customer-actions {
  border-top: 1px solid #e4eaf2;
  padding-top: 16px;
}

.reveal-panel {
  display: grid;
  gap: 14px;
}

.strong-notice {
  color: #4c3600;
}

.secret-label {
  gap: 0;
}

.secret-row {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

.copy-button {
  min-width: 108px;
}

.code-block {
  background: var(--surface-strong);
  color: #f1f5fb;
  margin: 0 0 16px;
  white-space: pre;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e4eaf2;
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

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

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 780;
  padding: 4px 10px;
  white-space: nowrap;
}

.status.active {
  background: var(--green-soft);
  color: var(--green);
}

.status.pending,
.status.warning {
  background: var(--amber-soft);
  color: #815300;
}

.status.revoked,
.status.failed,
.status.blocked,
.status.critical {
  background: var(--red-soft);
  color: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

form.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 720;
}

input,
textarea {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  padding: 9px 11px;
  width: 100%;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14, 91, 216, 0.13);
  outline: none;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

.checkbox-row {
  align-items: start;
  display: grid;
  font-weight: 500;
  gap: 10px;
  grid-template-columns: 18px 1fr;
}

.checkbox-row input {
  min-height: 18px;
  padding: 0;
}

code,
pre {
  background: var(--surface-strong);
  border-radius: 6px;
  color: #f1f5fb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 2px 5px;
}

pre {
  overflow-x: auto;
  padding: 14px;
}

.secret {
  background: var(--amber-soft);
  border: 1px solid #e8bd69;
  color: #1d2533;
  padding: 14px;
  word-break: break-all;
}

@media (max-width: 900px) {
  .app-frame {
    display: block;
  }

  .sidebar {
    min-height: 0;
    position: static;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    position: static;
  }

  .auth-frame {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .auth-rail {
    display: none;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 20px 16px 34px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .account-menu {
    flex-wrap: wrap;
  }

  .account-email {
    max-width: 100%;
  }

  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 24px;
  }

  h1 {
    font-size: 25px;
  }

  .hero-panel,
  .panel {
    padding: 18px;
    width: 100%;
  }

  .hero-panel,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-lead {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .metric-grid,
  .journey-steps,
  .details-grid,
  .endpoint-grid,
  .secret-row,
  .action-panel {
    grid-template-columns: 1fr;
  }

  .copy-button,
  .action-panel button {
    justify-content: center;
    width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
