:root {
  color-scheme: light;
  --ink: #111816;
  --muted: #5e6a66;
  --line: #d9e2de;
  --paper: #f7faf7;
  --panel: #ffffff;
  --green: #0b6b4f;
  --green-dark: #074a39;
  --blue: #1d5f99;
  --amber: #c56f15;
  --red: #b24332;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
textarea,
select,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions,
.controls,
.quick-picks,
.section-head,
.metric-grid {
  display: flex;
  gap: 10px;
}

.top-actions,
.section-head {
  align-items: center;
}

.top-actions {
  min-width: 0;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(300px, 1fr) minmax(340px, 1.18fr);
  gap: 18px;
  padding: 20px clamp(18px, 4vw, 44px) 32px;
}

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

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

textarea {
  width: 100%;
  min-height: 270px;
  resize: vertical;
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.5;
}

button,
.status {
  border-radius: 8px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
}

button {
  cursor: pointer;
}

button:hover {
  background: var(--green-dark);
}

.ghost {
  background: #fff;
  color: var(--green);
}

.ghost:hover {
  background: #eaf5f0;
}

.primary {
  width: 100%;
  margin-top: 16px;
}

.status {
  border-color: #cfe2da;
  background: #eef7f2;
  color: var(--green-dark);
  font-size: 12px;
  white-space: nowrap;
}

.quick-picks {
  flex-wrap: wrap;
}

.quick-picks button {
  border-color: #cfe2da;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

select,
input[type="range"] {
  width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 18px;
}

.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric-grid span,
.json-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
}

#readinessScore {
  min-width: 54px;
  border: 2px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  padding: 8px 10px;
  text-align: center;
}

.panel-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

ol,
ul {
  margin: 0;
  padding-left: 22px;
  line-height: 1.55;
}

li + li {
  margin-top: 8px;
}

pre {
  min-height: 500px;
  max-height: 65vh;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101816;
  color: #e7f3ed;
  white-space: pre-wrap;
  line-height: 1.5;
}

.json-strip {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.json-strip code {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

  pre {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .section-head,
  .controls,
  .metric-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: auto;
    max-width: calc(100vw - 40px);
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions button {
    min-width: 0;
  }
}
