:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #28312a;
  background: #f7f7f2;
  font-synthesis: none;
  font-size: 13px;
  --ink: #28312a;
  --muted: #777d73;
  --line: #e1e4da;
  --green: #486442;
  --accent: #dfeeaa;
  --paper: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 74px 55px minmax(0, 1fr) 31px;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
summary,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.38;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
textarea:focus-visible {
  outline: 2px solid #71894a;
  outline-offset: 3px;
}
button {
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
p {
  margin: 0;
}
button {
  transition:
    background 0.15s,
    color 0.15s;
}
input[type="number"],
input[type="search"],
select {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  min-width: 0;
}
input[type="number"] {
  font-variant-numeric: tabular-nums;
}
input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}
input[type="range"] {
  accent-color: var(--green);
  width: 100%;
  margin: 0;
  height: 22px;
  cursor: ew-resize;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #d9dfd0;
  border-radius: 3px;
}
input[type="range"]::-webkit-slider-thumb {
  margin-top: -6px;
}
button:hover {
  background: #eaece2;
}
.button {
  border: 1px solid #d5d9ce;
  border-radius: 5px;
  background: transparent;
  min-height: 35px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  min-height: 38px;
}
.button.primary:hover {
  background: #46563f;
}
.button.primary span {
  margin-left: 22px;
}
.button.small {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 11px;
}
.icon-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 30px;
  height: 30px;
  font-size: 19px;
}
.text-button {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  padding: 7px;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand strong {
  font-size: 26px;
  letter-spacing: -1.4px;
  font-weight: 650;
  white-space: nowrap;
}
.brand-dot {
  color: #7b9459;
}
.brand-mark {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.brand-caption {
  margin-left: 13px;
  border-left: 1px solid #d8ddd0;
  padding-left: 22px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
}
.local-badge i {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #849767;
}
.project-nav {
  display: flex;
  align-items: stretch;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  gap: 25px;
  overflow-x: auto;
  scrollbar-width: none;
}
.project-tab {
  font-size: 12px;
  color: #798072;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 3px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.project-tab span {
  font-size: 9px;
  color: #9ea595;
  font-variant-numeric: tabular-nums;
}
.project-tab:hover {
  color: var(--ink);
}
.project-tab.active {
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 600;
}
.project-tab.active span {
  color: #71834f;
}
.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
}
.preview {
  min-width: 0;
  min-height: 0;
  padding: 26px 36px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 36px auto;
  background: radial-gradient(#daddd2 0.65px, transparent 0.65px) 0 0/9px 9px;
}
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #7d8675;
  font-weight: 600;
}
.preview h1 {
  font-size: 23px;
  letter-spacing: -0.7px;
  margin-top: 6px;
  font-weight: 500;
}
.preview-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}
.canvas-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 10px 16px;
}
.canvas-stage:before,
.canvas-stage:after {
  content: "+";
  color: #a7afa0;
  position: absolute;
  left: 1px;
  top: 0;
  font-size: 16px;
  font-weight: 200;
}
.canvas-stage:after {
  left: auto;
  top: auto;
  right: 1px;
  bottom: 0;
}
#canvas-host {
  position: relative;
  flex: none;
  box-shadow:
    0 3px 12px #2933250b,
    0 0 0 1px #dce0d5;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
}
#canvas-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.empty-state {
  position: absolute;
  max-width: 300px;
  text-align: center;
  line-height: 1.8;
  font-size: 12px;
  color: var(--muted);
  padding: 30px;
  background: #fffffff2;
  border: 1px solid var(--line);
  border-radius: 6px;
  pointer-events: none;
}
.empty-state[hidden] {
  display: none;
}
.canvas-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #858c7d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.preview-footer {
  border-top: 1px solid #e0e4d9;
  padding: 14px 0 17px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 11px;
  line-height: 1.5;
  color: #7c8474;
}
.line-badge {
  white-space: nowrap;
  color: #5e6b51;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 14px;
}
.inspector {
  min-height: 0;
  background: #fdfdf9;
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.inspector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 23px 15px;
}
.inspector h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin-top: 5px;
}
.seed-block {
  padding: 0 23px 16px;
  border-bottom: 1px solid var(--line);
}
.seed-block > label {
  font-size: 11px;
  font-weight: 550;
}
.seed-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}
.seed-controls input {
  width: 100%;
  height: 35px;
}
.seed-controls .button {
  background: #edf2e1;
  border-color: #dfe6cf;
}
.seed-block p {
  font-size: 10px;
  color: #878c7e;
  line-height: 1.4;
  margin-top: 8px;
}
.control-search {
  padding: 14px 23px 10px;
}
.control-search input {
  font-size: 11px;
  width: 100%;
  background: #f6f7ef;
  border-color: #e9ebe2;
  padding: 9px 11px;
}
.controls-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d3d9c9 transparent;
  padding: 0 23px 20px;
}
.control-section {
  border-bottom: 1px solid var(--line);
}
.control-section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 17px 0;
  font-size: 12px;
  font-weight: 600;
}
.control-section > summary::-webkit-details-marker {
  display: none;
}
.control-section > summary:before {
  content: "›";
  font-size: 18px;
  font-weight: 400;
  line-height: 12px;
  color: #8b9580;
  transform: rotate(0deg);
}
.control-section[open] > summary:before {
  transform: rotate(90deg);
}
.section-description {
  font-size: 10px;
  line-height: 1.6;
  color: #909686;
  margin: -5px 0 16px;
}
.control-row {
  padding-bottom: 19px;
}
.control-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.control-top > label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.control-number {
  width: 69px;
  text-align: right;
  height: 28px;
  padding: 4px 7px !important;
  font-size: 11px;
}
.control-help {
  color: #89917f;
  font-size: 10px;
  line-height: 1.5;
  margin-top: 7px;
}
.range-editor {
  font-size: 9px;
  color: #959c8b;
  margin-top: 3px;
}
.range-editor > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.range-editor > summary::-webkit-details-marker {
  display: none;
}
.range-editor > summary:after {
  content: "Edit range";
  text-decoration: underline;
  text-underline-offset: 2px;
}
.range-fields {
  display: flex;
  gap: 8px;
  align-items: end;
  margin: 8px 0;
  padding: 9px;
  background: #f3f5eb;
  border-radius: 4px;
}
.range-fields label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.range-fields input {
  width: 100%;
  font-size: 10px;
  padding: 5px;
}
.range-fields button {
  font-size: 10px;
  padding: 5px;
  min-height: 26px;
}
.control-row select {
  width: 110px;
  font-size: 11px;
}
.inspector-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 15px 23px;
  border-top: 1px solid var(--line);
  background: #f9faf3;
}
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 0 20px;
  font-size: 10px;
  color: #7b8471;
  gap: 15px;
}
.statusbar .error {
  color: #a54a35;
}
.status-note {
  white-space: nowrap;
  color: #9aa18f;
  letter-spacing: 0.3px;
}
.image-block {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.image-block input {
  font-size: 11px;
  width: 100%;
  padding: 8px 0;
}
.image-block input::file-selector-button {
  font: inherit;
  border: 1px solid var(--line);
  background: #eef2e4;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--ink);
  margin-right: 8px;
  cursor: pointer;
}
.image-block p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 0 2px;
}
.control-row[hidden],
.control-section[hidden] {
  display: none;
}
.paper-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  padding-bottom: 18px;
}
.gif-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 18px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(580px, calc(100vw - 30px));
  padding: 25px;
  color: var(--ink);
  background: #fdfdf9;
  box-shadow: 0 20px 100px #25302130;
}
dialog::backdrop {
  background: #23302055;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-heading h2 {
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.5px;
}
dialog p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: 15px 0;
}
dialog textarea {
  display: block;
  width: 100%;
  height: 260px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f4f6ed;
  font:
    11px/1.6 ui-monospace,
    monospace;
  color: #566348;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.error {
  color: #a04b36;
}
#preset-error:empty {
  margin: 15px 0;
}
@media (min-width: 1550px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
  .preview {
    padding: 30px 60px 0;
  }
  .controls-scroll,
  .seed-block,
  .inspector-heading,
  .inspector-footer {
    padding-left: 28px;
    padding-right: 28px;
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .preview {
    padding: 22px 20px 0;
  }
  .brand-caption {
    display: none;
  }
  .project-nav {
    gap: 20px;
  }
  .line-badge {
    display: none;
  }
  .inspector-heading,
  .seed-block,
  .controls-scroll,
  .inspector-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .control-search {
    padding-left: 18px;
    padding-right: 18px;
  }
  .preview-footer {
    font-size: 10px;
  }
}
@media (max-width: 680px) {
  body {
    grid-template-rows: 58px 45px minmax(0, 1fr) 28px;
  }
  .masthead {
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    gap: 8px;
  }
  .brand strong {
    font-size: 20px;
    letter-spacing: -0.9px;
  }
  .brand-mark {
    width: 24px;
    height: 24px;
  }
  .local-badge {
    display: none;
  }
  .header-actions {
    gap: 8px;
  }
  .header-actions .button {
    font-size: 11px;
    padding: 8px 12px;
  }
  .header-actions .button.primary span {
    margin-left: 8px;
  }
  .project-nav {
    padding: 0 14px;
    gap: 20px;
  }
  .project-tab {
    font-size: 11px;
  }
  .project-tab span {
    display: none;
  }
  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 43% minmax(0, 1fr);
  }
  .preview {
    padding: 12px 16px 0;
    grid-template-rows: auto minmax(0, 1fr) 25px;
  }
  .preview-heading {
    margin-bottom: 3px;
  }
  .preview h1 {
    font-size: 17px;
    margin-top: 0;
  }
  .preview .eyebrow {
    display: none;
  }
  .preview-footer {
    display: none;
  }
  .canvas-stage {
    padding: 7px 14px;
  }
  .preview-tools {
    gap: 5px;
  }
  .preview-tools .icon-button {
    height: 27px;
    width: 27px;
  }
  .preview-tools .button {
    min-height: 27px;
  }
  .canvas-caption {
    font-size: 9px;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .inspector-heading {
    display: none;
  }
  .seed-block {
    display: grid;
    grid-template-columns: 75px 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
  }
  .seed-block p {
    display: none;
  }
  .seed-controls {
    margin: 0;
  }
  .control-search {
    padding: 7px 18px;
  }
  .controls-scroll {
    padding: 0 18px 16px;
  }
  .inspector-footer {
    padding: 10px 18px;
  }
  .control-section > summary {
    padding: 14px 0;
  }
  .control-row {
    padding-bottom: 17px;
  }
  .status-note {
    display: none;
  }
  .statusbar {
    padding: 0 12px;
    font-size: 9px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}

#status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Conditional parameters keep their saved values while another mode is active. */
.control-row.is-inactive > input,
.control-row.is-inactive .control-top > input,
.control-row.is-inactive .control-top > select,
.control-row.is-inactive .range-editor {
  opacity: 0.55;
}
.control-row.is-inactive .range-editor > summary {
  pointer-events: none;
  cursor: default;
}
.control-row.is-inactive input[type="range"] {
  cursor: default;
}
