:root {
  color-scheme: light;
  --paper: #f6f7f2;
  --surface: #fdfdf9;
  --ink: #202c25;
  --muted: #52615a;
  --line: #dce2d9;
  --forest: #224c37;
  --night: #10231b;
  --view-text: #e5ede2;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.46; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 2px solid #5a8f65; outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 23px clamp(19px, 3vw, 48px); border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { width: 40px; height: 40px; stroke: var(--forest); stroke-width: 1.3; fill: none; flex: none; }
h1 { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.05; letter-spacing: -0.05em; }
.brand p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.local { color: var(--forest); font-size: 12px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.local i { height: 7px; width: 7px; background: #5a896a; border-radius: 50%; }
.workspace {
  max-width: 1680px; margin: 0 auto; padding: 28px clamp(18px, 3vw, 48px) 35px;
  display: grid; grid-template-columns: minmax(265px, 310px) minmax(0, 1fr); gap: 30px; align-items: start;
}
aside { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 19px; }
.form-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
h2 { font-size: 19px; letter-spacing: -0.025em; }
.text-button { border: 0; background: transparent; color: var(--forest); font-size: 12px; font-weight: 700; padding: 4px; }
.text-button:hover { text-decoration: underline; }
fieldset { padding: 0; margin: 0 0 15px; border: 0; }
label { position: relative; display: block; font-size: 12px; line-height: 1.2; font-weight: 700; }
label span { color: var(--muted); font-weight: 500; font-size: 11px; white-space: nowrap; }
input[type="number"], textarea {
  display: block; width: 100%; margin-top: 6px; border: 1px solid #ccd5ca; border-radius: 6px;
  padding: 8px 10px; background: #f8faf4; color: var(--ink); font-size: 14px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
textarea { font: 11px/1.45 ui-monospace, monospace; resize: vertical; }
.presets, .field-grid { display: grid; gap: 9px; }
.presets { grid-template-columns: repeat(3, 1fr); margin: 9px 0 17px; }
.presets button, .downloads button, .secondary {
  padding: 8px 10px; background: var(--surface); border: 1px solid #ccd5ca; color: var(--forest);
  border-radius: 6px; font-size: 12px; font-weight: 700;
}
.presets button[aria-pressed="true"] { background: #dfede1; border-color: #8aa993; }
.presets button:hover, .downloads button:hover:enabled, .secondary:hover:enabled { background: #e9f0e5; }
.field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 13px; }
.settings-grid { padding: 2px 0 5px; }
.hint, .model-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 8px; }
.override-label { margin-top: 12px; }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-size: 13px; font-weight: 700; padding: 12px 0; }
details[open] { padding-bottom: 9px; }
.primary {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 11px 13px;
  margin-top: 8px; background: var(--forest); color: white; border: 1px solid var(--forest);
  border-radius: 7px; font-size: 13px; font-weight: 700;
}
.primary:hover:enabled { background: #173b29; }
.notice { margin-top: 9px; font-size: 11px; line-height: 1.45; color: var(--forest); }
.notice[data-error="true"] { color: #8d3525; font-weight: 650; }
.result-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.result-title h2 { font-size: 25px; letter-spacing: -0.05em; }
.result-title p { color: var(--muted); margin-top: 3px; font-size: 12px; line-height: 1.5; }
.secondary { white-space: nowrap; }
.views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.view {
  overflow: hidden; display: flex; flex-direction: column; background: var(--night);
  border: 1px solid #294638; border-radius: 12px; color: var(--view-text);
}
.view header, .view footer { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.view header { min-height: 49px; border-bottom: 1px solid #2d473b; }
.view h3 { font-size: 13px; font-weight: 700; }
.view footer { justify-content: flex-start; font-size: 11px; flex-wrap: wrap; border-top: 1px solid #2d473b; gap: 12px; }
.view footer span { display: inline-flex; align-items: center; gap: 5px; }
.tools { display: inline-flex; gap: 5px; }
.tools button { color: #e5ede2; background: #203d30; border: 1px solid #466352; padding: 5px 7px; border-radius: 5px; font-size: 10px; }
.tools button:hover { background: #2f5140; }
canvas { width: 100%; height: clamp(280px, 30vw, 408px); display: block; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
.legend { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #d8b872; }
.legend.trace { background: #ddc17b; }
.legend.opening { background: #f49458; }
.legend.base { background: #729180; }
.selection { font-size: 12px; color: var(--muted); min-height: 36px; padding: 9px 0 6px; line-height: 1.45; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 2px 0 12px; }
.metrics > div { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px; }
.metrics span { color: var(--muted); font-size: 11px; font-weight: 650; }
.metrics strong { color: var(--forest); font-size: clamp(17px, 2vw, 26px); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.metrics small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.checks { border-bottom: 1px solid var(--line); }
.checks dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 18px; margin: 0 0 6px; font-size: 12px; }
.checks dd { margin: 0; font-variant-numeric: tabular-nums; }
.downloads { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px 14px; margin-top: 14px; }
.downloads h3 { font-size: 12px; }
.downloads div { display: flex; flex-wrap: wrap; gap: 7px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 1050px) {
  .workspace { gap: 16px; grid-template-columns: minmax(245px, 270px) minmax(0, 1fr); }
  .views { gap: 8px; }
}
@media (max-width: 890px) {
  .workspace { grid-template-columns: 1fr; }
  aside { max-width: none; }
  .primary-fields .field-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .masthead { padding: 17px 13px; }
  .brand { gap: 8px; }
  .brand svg { width: 32px; height: 32px; }
  .local { font-size: 10px; }
  .workspace { padding: 17px 12px; }
  .views { grid-template-columns: 1fr; }
  .primary-fields .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: 1fr; }
  canvas { height: 300px; }
}
.inspector { min-height: 46px; padding: 9px 0; }
.inspector header, .edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }
.inspector select { padding: 4px 6px; border: 1px solid #ccd5ca; border-radius: 5px; font: inherit; font-size: 12px; background: var(--surface); color: var(--forest); }
.inspector header p { font-size: 11px; color: var(--muted); }
.edit-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 9px 0; }
.edit-fields input { padding: 5px 7px; font-size: 12px; }
#edit-status:empty, #notice:empty { display: none; }
