:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
  background: #08090b;
  color: #f5f7fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% -10%, rgba(73, 105, 255, 0.16), transparent 36rem),
    #08090b;
}

.shell {
  width: min(100%, 54rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(1rem, env(safe-area-inset-left));
}

.status {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.9rem;
  color: #aeb4c0;
  text-align: center;
}

.status p {
  max-width: 22rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.pulse {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #7c94ff;
  box-shadow: 0 0 0 0 rgba(124, 148, 255, 0.42);
  animation: pulse 1.7s ease-out infinite;
}

.status.error .pulse {
  background: #ff8c82;
  animation: none;
}

.result-meta {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.25rem;
  color: #8d94a1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 11, 0.9);
  backdrop-filter: blur(20px);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.counter {
  color: #bdc4cf;
  font-family: "SF Mono", ui-monospace, monospace;
  letter-spacing: 0;
}

.result {
  padding: 1.15rem 0 4rem;
  overflow-wrap: anywhere;
  font-size: clamp(0.98rem, 2.8vw, 1.08rem);
  line-height: 1.68;
}

.result > :first-child {
  margin-top: 0;
}

.result h1,
.result h2,
.result h3,
.result h4 {
  margin: 1.5em 0 0.58em;
  color: #fbfcff;
  line-height: 1.28;
}

.result h1 { font-size: 1.42em; }
.result h2 { font-size: 1.25em; }
.result h3 { font-size: 1.12em; }
.result h4 { font-size: 1.03em; }

.result p,
.result ul,
.result ol,
.result blockquote,
.result pre {
  margin: 0.85em 0;
}

.result ul,
.result ol {
  padding-left: 1.45em;
}

.result li + li {
  margin-top: 0.35em;
}

.result blockquote {
  margin-left: 0;
  padding: 0.15em 0 0.15em 0.9em;
  color: #b8bfca;
  border-left: 0.2rem solid #596cbd;
}

.result pre {
  max-width: 100%;
  overflow-x: hidden;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.7rem;
  background: #111318;
  white-space: pre-wrap;
  word-break: break-word;
}

.result code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.88em;
}

.result p code,
.result li code,
.result blockquote code {
  padding: 0.1em 0.32em;
  border-radius: 0.28em;
  background: rgba(255, 255, 255, 0.09);
}

.result a {
  color: #9eb1ff;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 0.65rem rgba(124, 148, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 148, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  html { scroll-behavior: auto; }
}
