:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #657187;
  --line: #d9e0ea;
  --primary: #176b87;
  --primary-dark: #0f4f64;
  --accent: #d9822b;
  --ok: #237b55;
  --shadow: 0 16px 48px rgba(23, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

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

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

.app-shell {
  min-height: 100vh;
  padding: 32px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef7f5;
  color: var(--ok);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.16);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 760;
}

.primary-button {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
}

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

.secondary-button {
  background: #edf1f6;
  color: var(--ink);
  padding: 12px 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  background: #edf1f6;
  color: var(--ink);
}

.output-panel {
  overflow: hidden;
}

.output-panel .panel-heading {
  padding: 20px 20px 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 20px;
}

.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.metrics strong {
  font-size: 22px;
}

pre {
  min-height: 490px;
  max-height: 680px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #111827;
  color: #e8edf5;
  padding: 20px;
  white-space: pre-wrap;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 20px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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