:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #5f6f7a;
  --line: #d9e0e4;
  --primary: #116a57;
  --primary-strong: #0a4f40;
  --danger: #b3261e;
  --soft: #e9f2ef;
  --shadow: 0 10px 24px rgba(20, 34, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
  line-height: 1.3;
}

p {
  margin-top: 6px;
  color: var(--muted);
}

.status {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  color: var(--muted);
  text-align: right;
}

.status.error {
  color: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  align-items: start;
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: -2px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  padding: 0;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 44px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--soft);
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

button {
  appearance: none;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

button.secondary,
button.small {
  background: #ffffff;
  color: var(--primary);
}

button.secondary:hover,
button.small:hover {
  background: var(--soft);
}

button.small {
  min-height: 32px;
  padding: 0 10px;
}

.output-panel {
  position: sticky;
  top: 16px;
}

#snippetOutput {
  min-height: 520px;
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: #0d2630;
  white-space: pre;
}

.config-list {
  display: grid;
  gap: 8px;
}

.config-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfc;
}

.config-item button {
  justify-self: start;
  margin-top: 4px;
}

.config-title {
  font-weight: 800;
}

.config-meta {
  color: var(--muted);
  font-size: 12px;
}

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

  .topbar,
  .layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status {
    text-align: left;
  }

  .output-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 23px;
  }
}
