:root {
  color-scheme: dark;
  --bg: #16130f;
  --panel: #221c16;
  --line: #3a3128;
  --ink: #f3ecdf;
  --muted: #b3a89a;
  --copper: #e2a15a;
  --copper-ink: #2a1c0e;
  --danger: #e7b4a4;
  --ok: #b7d7c5;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
button, textarea, input { font: inherit; color: inherit; }
.top {
  display: flex; align-items: center; gap: 18px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: #1c1712;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.mark { letter-spacing: 0.18em; font-weight: 700; font-size: 14px; }
.product { color: var(--copper); font-family: Georgia, "Noto Serif", serif; font-style: italic; }
.tag { margin: 0; color: var(--muted); flex: 1; min-width: 12rem; font-size: 14px; line-height: 1.35; }
.top-actions, .samples { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--copper); color: var(--copper-ink); border-color: var(--copper); font-weight: 700; }
main { display: grid; grid-template-columns: 320px minmax(0, 1fr) 280px; min-height: calc(100vh - 62px); }
.panel { padding: 16px; overflow: auto; }
.controls { border-right: 1px solid var(--line); }
.side { border-left: 1px solid var(--line); background: #1c1712; }
label { display: block; margin: 14px 0 6px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
label span { display: block; text-transform: none; letter-spacing: 0; margin-top: 4px; }
textarea, input[type="file"] {
  width: 100%; background: #120f0c; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
textarea { resize: vertical; }
#build, #apply { margin-top: 10px; }
.ai-panel { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #2a2118; }
.ai-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-panel h2 { margin: 0; }
#planner-badge { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--copper); border: 1px solid var(--copper); border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; }
.stage { background: #cfc6b8; display: flex; flex-direction: column; min-width: 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; min-height: 0; flex: 1; }
.compare > div { display: flex; flex-direction: column; min-width: 0; min-height: 70vh; overflow: auto; }
.pane-label { margin: 0 0 6px; color: #2a241c; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
#original, #preview { flex: 1; width: 100%; border: 0; background: #d9d3c7; min-height: 70vh; }
.stage-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: #2a241c; background: #e7e0d4; }
#preview { flex: 1; width: 100%; border: 0; background: #d9d3c7; min-height: 70vh; }
h2 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); margin: 18px 0 8px; }
ul, ol { margin: 0; padding-left: 18px; }
li { margin: 0 0 8px; }
li.empty { color: var(--muted); list-style: none; margin-left: -18px; }
#rules, #figures { font-size: 13px; white-space: pre-wrap; }
#figures div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 4px 0; }
#figures dt { color: var(--muted); }
#figures dd { margin: 0; font-variant-numeric: tabular-nums; }
.warn { color: var(--danger); }
.ok { color: var(--ok); }
.site-foot { padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-foot a { color: var(--copper); }
@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
  .controls, .side { border: 0; }
  .top { flex-wrap: wrap; }
  .compare { grid-template-columns: 1fr; }
  #original, #preview { min-height: 70vh; }
}
