﻿:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9dee7;
  --primary: #1668dc;
  --primary-strong: #0f4fb0;
  --success: #147a49;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

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

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-size: 20px;
  font-weight: 650;
}

.panel-head p {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  background: #fff;
}

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

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

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

button:disabled {
  cursor: wait;
  opacity: .65;
}

.result-panel {
  min-height: 520px;
}

#output {
  min-height: 440px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--text);
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.is-success {
  color: var(--success) !important;
}

.is-error {
  color: var(--danger) !important;
}

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

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

  .panel-head p {
    white-space: normal;
  }
}
