:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --panel: #ffffff;
  --panel-soft: #eef5f3;
  --ink: #17211f;
  --muted: #65716d;
  --line: #ccd6d2;
  --accent: #087f8c;
  --accent-dark: #055e68;
  --ok: #0d7a45;
  --bad: #b3261e;
  --warn: #8a5a00;
  --code: #102a30;
}

* {
  box-sizing: border-box;
}

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

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  margin-bottom: 8px;
}

.subtitle,
.hint,
.details p,
.message {
  color: var(--muted);
}

.subtitle {
  max-width: 720px;
  margin-top: 8px;
  font-size: 15px;
}

.badge {
  flex: 0 0 auto;
  min-width: 170px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.badge-muted {
  color: var(--muted);
}

.badge-ok {
  border-color: #9bd6b5;
  background: #eefaf3;
  color: var(--ok);
}

.badge-bad {
  border-color: #efb8b8;
  background: #fff2f1;
  color: var(--bad);
}

.badge-warn {
  border-color: #efd89b;
  background: #fff8e6;
  color: var(--warn);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.controls label {
  display: grid;
  gap: 6px;
  min-width: 120px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input {
  height: 38px;
  padding: 7px 9px;
}

button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.pane {
  min-width: 0;
}

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

.pane-header label {
  font-weight: 800;
}

.hint {
  font-size: 13px;
}

code,
pre,
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code {
  color: var(--code);
}

textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}

textarea:focus,
input:focus {
  outline: 3px solid rgba(8, 127, 140, 0.18);
  border-color: var(--accent);
}

.message {
  min-height: 22px;
  margin-top: 7px;
  font-size: 13px;
}

.message-error {
  color: var(--bad);
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 16px;
  margin-top: 16px;
}

.details > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

pre {
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--code);
  font-size: 13px;
}

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

  .topbar {
    display: grid;
  }

  .badge {
    width: 100%;
  }

  .pane-header {
    display: grid;
  }

  textarea {
    min-height: 260px;
  }
}
