:root {
  color-scheme: light;
  --page: #f5f7fa;
  --panel: #ffffff;
  --accent: #194f90;
  --border: #bac4d1;
  --text: #1d2430;
  --muted: #5d6978;
  --success: #23866f;
  --warning: #9a6a00;
  --destructive: #8f1d1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

.site-header,
main,
footer {
  width: min(1120px, calc(100vw - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding-block: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.eyebrow,
.helper-text,
footer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.eyebrow {
  margin-bottom: 4px;
}

.header-actions,
.panel-heading,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions,
.panel-heading {
  justify-content: space-between;
}

button,
input {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

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

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.secondary-button,
.tabs button {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}

.tabs button[aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.destructive-button {
  color: var(--destructive);
  background: var(--panel);
  border-color: var(--destructive);
}

.environment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.status-item,
.panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 12px 16px;
}

.status-item strong,
.status-label {
  display: block;
}

.status-label {
  min-height: 22px;
  color: var(--muted);
}

.status-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
}

.status-pending {
  background: var(--muted);
}

.status-warning {
  background: var(--warning);
}

.status-active {
  background: var(--accent);
}

.status-success {
  background: var(--success);
}

.status-failed {
  background: var(--destructive);
}

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

.panel {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.full-span {
  grid-column: 1 / -1;
}

.api-url,
pre,
code {
  overflow-wrap: anywhere;
}

.api-url {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page);
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input {
  width: 100%;
  color: var(--text);
  background: var(--panel);
}

.message {
  min-height: 48px;
}

.message.success {
  color: var(--success);
}

.message.warning {
  color: var(--warning);
}

.message.failed {
  color: var(--destructive);
}

.diagnostics {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
}

footer {
  padding-block: 24px 32px;
}

@media (max-width: 720px) {
  .site-header,
  .header-actions,
  .panel-heading,
  .tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    min-height: 0;
  }

  .status-strip,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .full-span {
    grid-column: auto;
  }
}
