:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #5d6a7d;
  --line: #dce2ec;
  --brand: #3157d5;
  --brand-dark: #2441a2;
  --notice: #fff6d9;
  --notice-line: #e7c95d;
  --success: #16794a;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(20, 32, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--brand-dark); }
a:hover { text-decoration-thickness: 2px; }

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 3.5rem 2rem;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.35rem; font-size: clamp(2.3rem, 7vw, 4.8rem); line-height: 1; letter-spacing: -0.055em; }
h2 { margin-bottom: 0.4rem; font-size: 1.45rem; }
.lede { margin: 0; color: var(--muted); font-size: 1.08rem; }
.eyebrow { margin-bottom: 0.45rem; color: var(--brand-dark); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.muted { color: var(--muted); }

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 0.6rem 0.9rem;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-pill.healthy { color: var(--success); border-color: #9dd6bb; }

.notice {
  border: 1px solid var(--notice-line);
  border-radius: 12px;
  background: var(--notice);
  padding: 1rem 1.15rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-block: 1rem;
}

.metrics article, .panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics article { min-width: 0; padding: 1rem; }
.metrics span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.metrics strong { font-size: 1.45rem; }
.metrics code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { margin-block: 1rem; padding: clamp(1rem, 3vw, 1.6rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.link-row, .actions, footer { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.link-row { margin-bottom: 1rem; font-size: 0.9rem; }

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input, select, textarea, button, .button {
  border: 1px solid #bac4d3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}

textarea, input { width: 100%; }
textarea, pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus, .button:focus { outline: 3px solid rgba(49, 87, 213, 0.22); outline-offset: 1px; }

button, .button {
  display: inline-block;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

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

.records { display: grid; gap: 0.75rem; }
.record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  background: #fbfcfe;
}
.record header { display: flex; justify-content: space-between; gap: 1rem; }
.record h3 { margin: 0; font-size: 1rem; }
.record code { color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
.record pre { margin: 0.75rem 0 0; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 0.82rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 0.9rem; }
.actions { margin-top: 0.9rem; }
.preview { min-height: 2rem; max-height: 28rem; overflow: auto; border-radius: 9px; background: #101828; color: #e7eefc; padding: 1rem; white-space: pre-wrap; word-break: break-word; }
.preview:empty { display: none; }
.error { min-height: 1.2rem; margin: 0.65rem 0 0; color: var(--danger); font-weight: 700; }
.inline-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.7rem; }
[hidden] { display: none !important; }

footer { justify-content: center; padding-block: 2rem 3rem; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 720px) {
  .hero, .section-heading { align-items: stretch; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .inline-form { grid-template-columns: 1fr; }
}
