:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #15191f;
  --panel-2: #10141a;
  --line: #2b333d;
  --text: #f4f7fb;
  --muted: #9aa6b4;
  --accent: #34d399;
  --accent-2: #38bdf8;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px 16px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.08;
}

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

.copy,
.hint {
  color: var(--muted);
}

.copy {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 16px;
}

.status,
.limits,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  white-space: nowrap;
  color: var(--muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.playground-grid {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.section-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.badge {
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
  color: var(--accent);
  padding: 4px 9px;
  font-size: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

input,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  padding: 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #062016;
  font-weight: 800;
  cursor: pointer;
  padding: 0 14px;
}

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

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost.copied {
  border-color: rgba(52, 211, 153, 0.65);
  color: var(--accent);
}

.key-result textarea {
  min-height: 92px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.limits {
  flex-wrap: wrap;
  margin-top: 12px;
}

.limits span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 9px;
}

pre {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  min-height: 170px;
  max-height: 420px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080a0e;
  color: #d8dee9;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 860px) {
  .intro,
  .grid,
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    display: grid;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 16px 10px;
  }

  .panel {
    padding: 16px;
  }

  .section-head {
    align-items: flex-start;
  }

  h1 {
    font-size: 24px;
  }

  .copy {
    font-size: 14px;
  }

  pre {
    font-size: 12px;
    min-height: 140px;
  }
}
