:root {
  color-scheme: light;
  font: 15px/1.5 "Instrument Sans", "Segoe UI", sans-serif;
  background: #f5f0e9;
  color: #372a24;
  --panel: #fffdf9;
  --ink: #372a24;
  --muted: #6a5144;
  --line: #ddc6b6;
  --field: #a78977;
  --accent: #97421e;
  --button-text: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1140px; margin: auto; padding: clamp(14px, 4vw, 42px); }
header { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--accent); }
h1 { margin: 0; font-size: clamp(27px, 5vw, 42px); letter-spacing: -.04em; line-height: 1.1; }
h2 { margin: 0; font-size: 19px; }
header p, .help { color: var(--muted); }
header p { margin: 8px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 14px; padding: clamp(13px, 2.4vw, 20px); min-width: 0; }
.section-heading, .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-heading { justify-content: space-between; margin-bottom: 12px; }
.channel-grid, .editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 15px; }
.channel-grid .span { grid-column: 1 / -1; }
label { display: block; font-weight: 600; }
input, textarea, select, button { font: inherit; }
input, textarea, select { color: var(--ink); background: var(--panel); border: 1px solid var(--field); border-radius: 6px; padding: 6px 9px; max-width: 100%; }
label > input, textarea { width: 100%; min-width: 0; display: block; }
textarea { resize: vertical; }
#source, #output, #project { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 13px; }
input[type="file"] { margin: 4px 0 10px; width: 100%; }
button { color: var(--button-text); background: var(--accent); border: 1px solid var(--accent); border-radius: 6px; min-height: 38px; padding: 7px 11px; cursor: pointer; }
button.secondary { color: var(--ink); background: var(--panel); border-color: var(--field); }
button:disabled { color: var(--muted); background: var(--panel); border-color: var(--line); cursor: default; }
summary { cursor: pointer; }
details label, #issues { margin-top: 10px; }
details .controls { margin-top: 8px; }
:focus-visible { outline: 3px solid #d4834e; outline-offset: 2px; }
[role="status"]:empty { display: none; }
.help { margin: 8px 0 0; }
#items-issues { padding-inline-start: 22px; }
footer { display: flex; flex-wrap: wrap; gap: 14px; }
a { color: var(--accent); }
@media (max-width: 700px) {
  .editors { display: block; }
}
@media (max-width: 420px) {
  .channel-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #231c19;
    --panel: #342820;
    --ink: #fbede3;
    --muted: #e0c0ab;
    --line: #674f43;
    --field: #a68775;
    --accent: #f0a474;
    --button-text: #2b1b13;
  }
  body { color: var(--ink); }
}
