:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --ink: #18211f;
  --muted: #5d6966;
  --panel: #ffffff;
  --line: #cfd8d5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --blue: #1d4ed8;
  --amber: #b45309;
  --soft: #e8f3f1;
  --code: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 30rem),
    linear-gradient(225deg, rgba(29, 78, 216, 0.08), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
  font-weight: 750;
  text-decoration-thickness: 2px;
}

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

.intro,
.workspace,
.outputs,
.reference {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 24px;
  align-items: start;
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 18px 70px rgba(24, 33, 31, 0.10);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.lede {
  max-width: 72ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.signal {
  min-height: 150px;
  border: 1px solid #99d2cb;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--soft), #ffffff);
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.signal span {
  display: block;
  color: var(--accent-strong);
  font-size: 2.4rem;
  font-weight: 950;
}

.signal small {
  color: var(--muted);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  background: #ffffff;
}

input,
select {
  min-height: 50px;
  padding: 10px 12px;
}

textarea {
  min-height: 190px;
  padding: 13px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

button:nth-child(n+3) {
  background: var(--code);
}

button:focus {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.summary {
  display: grid;
  gap: 12px;
}

.metric {
  min-height: 104px;
  border: 1px solid #acd7d1;
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
  display: grid;
  align-content: center;
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 2px;
  color: var(--accent-strong);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.outputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.output-block {
  min-width: 0;
}

.output-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.output-head small {
  color: var(--amber);
  font-weight: 850;
}

.outputs textarea {
  min-height: 260px;
  color: #dbeafe;
  background: var(--code);
  border-color: #253044;
}

.reference {
  margin-top: 18px;
  padding: 18px;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.source-strip span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.source-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
}

.reference p {
  max-width: 82ch;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 650;
}

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

  .row {
    grid-template-columns: 1fr;
  }

  .signal {
    min-height: 110px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding: 10px 0;
  }

  .intro,
  .workspace,
  .outputs,
  .reference {
    padding: 16px;
  }

  .actions button {
    width: 100%;
  }
}
