:root {
  color-scheme: dark;
  --bg: #0b1020;
  --card: rgba(18, 25, 45, 0.86);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #eef4ff;
  --muted: #9fb0cc;
  --brand: #ef294b;
  --brand-2: #ff6a84;
  --ok: #3ddc97;
  --warn: #ffca3a;
  --danger: #ff5d73;
  --code: #080c18;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(239, 41, 75, 0.22), transparent 32rem),
    radial-gradient(circle at 85% 0%, rgba(58, 120, 255, 0.18), transparent 32rem),
    var(--bg);
  color: var(--text);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 800;
}

h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(30px, 5vw, 54px); max-width: 880px; }
h2 { font-size: 20px; margin-bottom: 14px; }

.muted { color: var(--muted); line-height: 1.55; }
code { color: #ffd1d9; background: rgba(255,255,255,.06); padding: 2px 5px; border-radius: 6px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.actions.small button { padding: 9px 12px; font-size: 13px; }

button, input, .buttonish {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 16px;
  font: inherit;
}
.buttonish { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; font-weight:700; }
button { cursor: pointer; font-weight: 700; transition: transform .15s, border-color .15s, background .15s; }
button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.28); }
button.primary { border: 0; background: linear-gradient(135deg, var(--brand), #ff7a42); color: white; }
button.danger { border-color: rgba(255, 93, 115, .45); background: rgba(255, 93, 115, .12); color: #ffd7dd; }
input { width: 100%; outline: none; }
input:focus { border-color: var(--brand-2); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.status { display: grid; gap: 8px; color: var(--muted); }
.status-row { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--warn); box-shadow: 0 0 16px currentColor; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }

.fallback { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--card-border); }
a { color: #8ab4ff; }
.hidden { display: none; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.badge { background: rgba(239, 41, 75, .18); color: #ffd9df; border: 1px solid rgba(239, 41, 75, .35); border-radius: 999px; padding: 5px 10px; font-weight: 800; }

.items { display: grid; gap: 10px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}
.item-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

pre {
  min-height: 360px;
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--code);
  border: 1px solid rgba(255,255,255,.08);
  color: #d7e4ff;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .actions { justify-content: stretch; }
  .actions button { flex: 1; }
  .inline-form, .item-row { grid-template-columns: 1fr; }
}

.version-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 8px auto 24px;
  padding: 10px 4px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.version-footer a { color: var(--muted); font-weight: 700; }
.version-footer a:hover { color: var(--brand-2); }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.linklike:hover { color: var(--brand-2); }

.version-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.version-modal.hidden { display: none; }
.version-modal-content {
  width: min(640px, 100%);
  max-height: 80vh;
  overflow: auto;
}
.version-entry { padding: 12px 0; border-top: 1px solid var(--card-border); }
.version-entry:first-child { border-top: 0; padding-top: 0; }
.version-entry-title { margin-bottom: 6px; }
.version-entry ul { margin: 0; padding-left: 20px; color: var(--muted); }
.version-entry li { margin-bottom: 4px; }
