:root {
  color-scheme: light dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
  font-weight: 400;
  background: #eef2f8;
  color: #172033;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef2f8;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(43, 109, 246, 0.14), transparent 32rem),
    #eef2f8;
}

button,
input,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top))
    0
    max(40px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #2859b8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.15rem;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: #596579;
  font-size: 1.05rem;
}

.card,
.notice {
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 34px rgba(23, 32, 51, 0.08);
}

.card {
  margin-bottom: 18px;
  padding: clamp(18px, 4vw, 28px);
}

.notice {
  margin-bottom: 18px;
  padding: 16px 18px;
}

.notice-error {
  border-color: rgba(186, 38, 54, 0.28);
  background: #fff3f4;
  color: #8f1d2c;
}

.notice-info {
  border-color: rgba(43, 109, 246, 0.24);
  background: #f1f6ff;
  color: #1e4f9f;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-neutral {
  background: #e3e9f3;
  color: #3c495e;
}

.badge-success {
  background: #dff7e8;
  color: #176837;
}

.badge-error {
  background: #ffe2e5;
  color: #981d2d;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.status-grid > div {
  min-width: 0;
  border-radius: 12px;
  background: #f4f6fa;
  padding: 13px 14px;
}

.status-grid dt {
  color: #6c778a;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-grid dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  font-weight: 750;
}

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

.button {
  min-height: 44px;
  border: 1px solid #cbd3df;
  border-radius: 11px;
  background: #fff;
  color: #172033;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 750;
}

.button:hover:not(:disabled) {
  border-color: #8c99ad;
}

.button:focus-visible {
  outline: 3px solid rgba(43, 109, 246, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  border-color: #235fd0;
  background: #286de8;
  color: #fff;
}

.button-danger {
  border-color: #edc8cc;
  color: #9b2030;
}

.message {
  min-height: 1.5em;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
  color: #596579;
}

.message[data-type="error"] {
  color: #a12031;
}

.message[data-type="success"] {
  color: #176837;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.small {
  color: #6c778a;
  font-size: 0.78rem;
}

.code-output {
  max-height: 430px;
  overflow: auto;
  margin: 0;
  border-radius: 13px;
  background: #111827;
  color: #d8e0ed;
  padding: 17px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    0.83rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

.code-output.compact {
  max-height: 260px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 22px, 980px);
  }

  .hero {
    display: block;
  }

  .hero .badge {
    display: inline-block;
    margin-top: 16px;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    display: block;
  }

  .section-heading .small {
    display: block;
    margin: -10px 0 16px;
  }

  .button {
    flex: 1 1 180px;
  }
}

@media (max-width: 430px) {
  .status-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
    flex-basis: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root,
  html,
  body {
    background: #0d1422;
    color: #e8edf5;
  }

  body {
    background:
      radial-gradient(circle at top right, rgba(72, 126, 247, 0.18), transparent 30rem),
      #0d1422;
  }

  .lead,
  .small,
  .message {
    color: #aab5c7;
  }

  .eyebrow {
    color: #8fb4ff;
  }

  .card,
  .notice {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(23, 32, 51, 0.94);
    box-shadow: none;
  }

  .status-grid > div {
    background: #202b3e;
  }

  .status-grid dt {
    color: #aab5c7;
  }

  .button {
    border-color: #45536a;
    background: #202b3e;
    color: #ecf1f8;
  }

  .button-primary {
    border-color: #4b82ef;
    background: #2f6fdf;
  }

  .button-danger {
    border-color: #71404a;
    color: #ffadb7;
  }

  .notice-info {
    background: #172b4d;
    color: #bbd2ff;
  }

  .notice-error {
    background: #461f27;
    color: #ffc1c8;
  }
}
