:root {
  font-family:Inter,"SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:#283b34;
  background:#f4f4ef;
  font-synthesis:none;
  font-size:13px;
  font-weight:400;
  --ink:#264438;
  --muted:#92968b;
  --line:#e5e7dd;
  --accent:#305c48;
  --paper:#fafaf6;
  --soft:#f0f3ea;
  --radius:10px;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,select {
  font:inherit;
}

button {
  cursor:pointer;
  color:inherit;
}

button,a,input,select,summary {
  -webkit-tap-highlight-color:transparent;
}

button {
  background:none;
  border:0;
}

button:disabled {
  cursor:not-allowed;
  opacity:.35;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:2px solid #538468;
  outline-offset:4px;
}

button svg {
  flex-shrink:0;
  vertical-align:middle;
}

a {
  color:inherit;
  text-decoration:none;
}

select {
  cursor:pointer;
}

fieldset {
  border:0;
  padding:0;
  margin:0;
  min-width:0;
}

h1,h2,h3,p {
  margin:0;
}

button,.button,select {
  transition:background .15s,color .15s,border-color .15s,box-shadow .15s;
}

button:hover:not(:disabled) {
  color:#152d20;
}

input[type=range] {
  accent-color:var(--accent);
}

[hidden] {
  display:none!important;
}

.app-header {
  height:74px;
  padding:0 28px;
  display:flex;
  align-items:center;
  gap:22px;
  background:#fafbf7;
  border-bottom:1px solid var(--line);
}

.brand {
  display:flex;
  align-items:center;
  gap:11px;
  flex:none;
}

.brand-mark {
  display:grid;
  grid-template-columns:repeat(3,5px);
  gap:4px;
  padding:5px;
}

.brand-mark i {
  width:5px;
  height:5px;
  background:#294736;
  border-radius:50%;
  display:block;
}

.brand-mark i:nth-child(3) {
  opacity:.3;
}

.brand-mark i:nth-child(6) {
  opacity:.6;
}

.brand-mark i:nth-child(7) {
  width:6px;
  height:6px;
}

.brand-name {
  display:flex;
  align-items:baseline;
  gap:11px;
  font-size:22px;
  font-weight:650;
  letter-spacing:3px;
}

.brand-name>span {
  font-size:11px;
  letter-spacing:2px;
  font-weight:600;
}

.header-divider {
  width:1px;
  height:21px;
  background:#dddeda;
}

.header-caption {
  color:#858b7f;
  font-size:12px;
  letter-spacing:1px;
}

.demo-badge {
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;
  font-size:10px;
  color:#96a08f;
  letter-spacing:1px;
  padding:5px 7px;
  border:1px solid #e4e7dd;
  border-radius:3px;
}

.header-actions {
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}

.button {
  height:37px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:7px;
  padding:0 16px;
  font-size:12px;
  white-space:nowrap;
}

.button.primary {
  background:#294c3b;
  color:#f8faf2;
  border:1px solid #294c3b;
  box-shadow:0 2px 3px #162f1f10;
}

.button.primary:hover:not(:disabled) {
  background:#173928;
  color:#fff;
}

.button.secondary {
  background:#fffefa;
  border:1px solid #dfe2d7;
  color:#4d5c50;
}

.button.secondary:hover {
  background:#f1f3eb;
}

.icon-btn {
  display:flex;
  justify-content:center;
  align-items:center;
  width:32px;
  height:32px;
  border-radius:6px;
  flex:none;
  color:#7d8879;
}

.icon-btn:hover:not(:disabled) {
  background:#edf1e8;
}

.studio {
  display:grid;
  grid-template-columns:225px minmax(390px,1fr) 305px;
  height:calc(100dvh - 74px);
  min-height:630px;
}

.library {
  background:#fafbf7;
  border-right:1px solid var(--line);
  padding:27px 18px 18px;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
}

.eyebrow {
  font-size:11px;
  letter-spacing:1px;
  font-weight:550;
  display:flex;
  align-items:center;
  gap:8px;
  color:#697760;
}

.eyebrow>span:first-child {
  font-family:ui-monospace,monospace;
  font-size:10px;
  color:#a5ae9b;
  letter-spacing:0;
}

.small-count {
  margin-left:auto;
  font-size:10px;
  background:#edefe6;
  color:#8c9583;
  border-radius:4px;
  padding:1px 5px;
}

.dropzone {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid #e3e5db;
  background:#fffefa;
  width:100%;
  margin-top:17px;
  border-radius:9px;
  text-align:left;
  position:relative;
}

.dropzone:hover {
  border-color:#a9b6a0;
  background:#f5f7ef;
}

.dropzone.drag-over {
  outline:2px dashed #658d6c;
  background:#e9f0e0;
}

.source-thumb {
  width:41px;
  height:53px;
  background:#ebebdf;
  border-radius:3px;
  overflow:hidden;
  flex:none;
}

.source-thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.source-info {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:5px;
}

.source-info strong {
  font-size:10px;
  font-weight:550;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
  max-width:100px;
}

.source-info>span {
  font-size:9px;
  color:#97a08f;
  white-space:nowrap;
}

.source-more {
  margin-left:auto;
  color:#94a087;
}

.replace-hint {
  display:none;
}

.source-tip {
  font-size:10px;
  color:#a0a594;
  margin-top:11px;
  line-height:1.5;
  white-space:nowrap;
}

.preset-section {
  margin-top:32px;
}

.presets {
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:17px;
}

.preset {
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  text-align:left;
  border:1px solid transparent;
  border-radius:8px;
  padding:8px 7px;
  position:relative;
  min-height:74px;
}

.preset:hover {
  background:#f0f3e9;
}

.preset.active {
  border-color:#b8c4aa;
  background:#edf2e6;
  box-shadow:0 0 0 1px #cfdbc340 inset;
}

.preset-thumb {
  width:49px;
  height:58px;
  border-radius:3px;
  background:#e9e4d3;
  overflow:hidden;
  flex:none;
  box-shadow:0 1px 2px #0000000b;
}

.preset-thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.preset-copy {
  display:flex;
  flex-direction:column;
  gap:5px;
}

.preset-copy strong {
  font-size:12px;
  font-weight:550;
}

.preset-copy small {
  font-size:7px;
  letter-spacing:.65px;
  color:#99a18f;
}

.ink-dots {
  display:flex;
  gap:3px;
  margin-top:1px;
}

.ink-dots i {
  width:7px;
  height:7px;
  border-radius:50%;
  border:1px solid #00000006;
}

.preset-selected {
  position:absolute;
  right:6px;
  top:8px;
  color:#4e7354;
  display:none;
}

.preset.active .preset-selected {
  display:block;
}

.recipe-actions {
  display:flex;
  margin-top:18px;
  border-top:1px solid var(--line);
  padding-top:16px;
  gap:10px;
  justify-content:space-between;
}

.recipe-actions button {
  font-size:10px;
  display:flex;
  align-items:center;
  gap:5px;
  color:#818d79;
  padding:2px 0;
}

.recipe-actions button:hover {
  color:var(--accent);
}

.library-bottom {
  margin-top:auto;
  padding-top:40px;
}

.edition-label {
  font-size:8px;
  letter-spacing:1.65px;
  color:#a2aa97;
}

.library-bottom p {
  font-size:11px;
  line-height:1.9;
  letter-spacing:.3px;
  color:#8b9582;
  margin-top:11px;
}

.privacy {
  border-top:1px solid var(--line);
  padding-top:17px;
  margin-top:21px;
  display:flex;
  gap:7px;
  align-items:center;
  color:#7d9074;
  font-size:10px;
  white-space:nowrap;
}

.workspace {
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#f3f3ed;
}

.workspace-title {
  padding:25px 32px 21px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.workspace-title .eyebrow {
  font-size:8px;
  letter-spacing:1.8px;
  color:#9ca48f;
  font-weight:500;
}

.workspace-title h1 {
  font-size:22px;
  letter-spacing:1.3px;
  font-weight:500;
  margin-top:8px;
}

.live-pill {
  display:flex;
  gap:5px;
  align-items:center;
  font-size:10px;
  color:#7e8d72;
  background:#eaf0e2;
  padding:5px 8px;
  border:1px solid #e2e8d9;
  border-radius:20px;
  white-space:nowrap;
}

.live-pill i,.status-dot {
  display:inline-block;
  width:5px;
  height:5px;
  background:#7d9569;
  border-radius:50%;
}

.live-pill.rendering i {
  animation:pulse 1s ease infinite;
}

.live-pill.error {
  color:#a06749;
  background:#f6e6dc;
  border-color:#ebd9cb;
}

.workspace-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 32px 16px;
  gap:10px;
}

.view-switch {
  display:flex;
  align-items:center;
  background:#e8ebdf;
  border:1px solid #e0e5d6;
  border-radius:7px;
  padding:3px;
  gap:2px;
}

.view-switch button {
  height:28px;
  border-radius:4px;
  padding:0 12px;
  color:#8a9480;
  font-size:11px;
  display:flex;
  align-items:center;
  gap:4px;
}

.view-switch button.selected {
  background:#fffef8;
  color:#3b4e38;
  box-shadow:0 1px 4px #3a4a2520;
}

.canvas-tools {
  display:flex;
  align-items:center;
  gap:1px;
}

.canvas-tools .icon-btn {
  width:29px;
  height:29px;
}

.tool-divider {
  width:1px;
  height:14px;
  margin:0 9px;
  background:#dadecf;
}

.loupe-toggle {
  display:flex;
  align-items:center;
  gap:5px;
  font-size:10px;
  color:#78876e;
  padding:6px 7px;
  border-radius:5px;
}

.loupe-toggle[aria-pressed=true] {
  background:#e4ead8;
  color:#415b34;
}

.stage {
  position:relative;
  margin:0 20px;
  flex:1;
  min-height:270px;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:28px 28px 45px;
  background-color:#e9ece0;
  background-image:radial-gradient(#89947428 .65px,transparent .65px);
  background-size:7px 7px;
  overflow:hidden;
  border:1px solid #e1e4d7;
  border-radius:9px;
}

.stage:before {
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(ellipse at center,#f2f2e366,transparent 70%);
  pointer-events:none;
}

.stage-corner {
  position:absolute;
  width:12px;
  height:12px;
  opacity:.4;
  border-color:#a0ae90;
}

.stage-corner.tl {
  top:16px;
  left:16px;
  border-left:1px solid;
  border-top:1px solid;
}

.stage-corner.br {
  bottom:16px;
  right:16px;
  border-right:1px solid;
  border-bottom:1px solid;
}

.artboard {
  position:relative;
  flex:none;
  background:#eee7d1;
  box-shadow:0 12px 24px #39462d17,0 1px 4px #29352215;
  visibility:hidden;
  transition:box-shadow .15s;
  overflow:hidden;
}

.artboard.ready {
  visibility:visible;
}

.artboard>canvas {
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

#print-canvas {
  z-index:1;
}

#original-canvas {
  z-index:0;
}

.stage[data-view=original] #print-canvas {
  visibility:hidden;
}

.stage[data-view=compare] #print-canvas {
  clip-path:inset(0 50% 0 0);
}

.compare-ui {
  display:none;
  position:absolute;
  inset:0;
  z-index:2;
}

.stage[data-view=compare] .compare-ui {
  display:block;
}

.compare-ui input {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:ew-resize;
  margin:0;
}

.compare-line {
  position:absolute;
  top:0;
  bottom:0;
  left:50%;
  width:1px;
  background:#fffefa;
  box-shadow:0 0 4px #0003;
  pointer-events:none;
}

.compare-line>span {
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:#fffff3;
  border:1px solid #cbd3bf;
  color:#4e6350;
  border-radius:50%;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  box-shadow:0 2px 5px #0002;
  font-family:serif;
  font-size:18px;
  letter-spacing:2px;
}

.compare-label {
  position:absolute;
  top:12px;
  font-size:9px;
  color:#53644b;
  background:#ffffeadb;
  padding:4px 7px;
  border-radius:3px;
  pointer-events:none;
}

.compare-label.left {
  left:12px;
}

.compare-label.right {
  right:12px;
}

.stage-note {
  position:absolute;
  bottom:13px;
  font-size:9px;
  letter-spacing:.6px;
  color:#97a08b;
  pointer-events:none;
}

.empty-message {
  position:absolute;
  text-align:center;
  color:#819071;
  pointer-events:none;
}

.empty-dots {
  font-size:30px;
  letter-spacing:4px;
  animation:pulse 1s infinite;
}

.empty-message p {
  font-size:12px;
  margin-top:10px;
}

.workspace-footer {
  height:38px;
  padding:0 25px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:9px;
  color:#9ba28f;
  white-space:nowrap;
}

.workspace-footer>span:first-child {
  display:flex;
  align-items:center;
  gap:5px;
}

.workspace-footer .status-dot {
  width:4px;
  height:4px;
}

.loupe {
  position:absolute;
  width:210px;
  right:15px;
  bottom:44px;
  background:#fdfbf2;
  z-index:5;
  border:1px solid #d1d6c6;
  border-radius:8px;
  padding:9px;
  box-shadow:0 8px 24px #39442b22;
  pointer-events:none;
}

.loupe-head {
  display:flex;
  justify-content:space-between;
  color:#7c896f;
  font-size:9px;
  margin-bottom:7px;
}

.loupe canvas {
  width:192px;
  height:140px;
  display:block;
  border-radius:4px;
  background:#e8e5d6;
}

.loupe p {
  font-size:9px;
  color:#a0a694;
  margin-top:6px;
  text-align:center;
}

.inspector {
  background:#fcfcf8;
  border-left:1px solid var(--line);
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}

.inspector-heading {
  padding:25px 22px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}

.inspector-heading h2 {
  font-size:15px;
  font-weight:550;
  letter-spacing:.5px;
}

.inspector-heading p {
  font-size:10px;
  color:#9aa28f;
  margin-top:5px;
}

.inspector-scroll {
  overflow-y:auto;
  flex:1;
  scrollbar-width:thin;
  scrollbar-color:#dfe4d3 transparent;
}

.parameter-section {
  padding:22px 22px 20px;
  border-bottom:1px solid var(--line);
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px;
  gap:5px;
}

.section-heading h3 {
  font-size:12px;
  font-weight:600;
}

.text-button {
  display:flex;
  align-items:center;
  gap:4px;
  color:#789268;
  font-size:10px;
  padding:0;
}

.section-tag {
  font-size:7px;
  letter-spacing:1px;
  color:#a2ac95;
  font-weight:500;
}

.mode-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 9px;
  background:#f1f4eb;
  border:1px solid #e9ede1;
  border-radius:5px;
  font-size:10px;
  color:#859276;
  margin-bottom:16px;
}

.profile-swatches {
  display:flex;
  gap:4px;
}

.profile-swatches i {
  width:10px;
  height:10px;
  border:1px solid #0001;
  border-radius:50%;
  display:block;
}

.control {
  margin-top:16px;
}

.control:first-child {
  margin-top:0;
}

.control-label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:11px;
  color:#7a8770;
  margin-bottom:7px;
}

.control-label output {
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;
  font-size:10px;
  color:#647753;
  min-width:34px;
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.control input[type=range] {
  display:block;
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  height:14px;
  background:transparent;
  margin:0;
  cursor:pointer;
}

.control input[type=range]::-webkit-slider-runnable-track {
  height:3px;
  border-radius:2px;
  background:linear-gradient(to right,#5f7951 0%,#5f7951 var(--fill,50%),#e5e9dc var(--fill,50%),#e5e9dc 100%);
}

.control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:11px;
  height:11px;
  border-radius:50%;
  background:#fafcf3;
  border:2px solid #58764b;
  box-shadow:0 0 0 2px #fafcf3;
  margin-top:-4px;
}

.control input[type=range]::-moz-range-track {
  height:3px;
  border-radius:2px;
  background:#e5e9dc;
}

.control input[type=range]::-moz-range-progress {
  background:#5f7951;
  height:3px;
}

.control input[type=range]::-moz-range-thumb {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#fafcf3;
  border:2px solid #58764b;
}

.range-note {
  display:flex;
  justify-content:space-between;
  font-size:8px;
  color:#a6ac9b;
  margin-top:3px;
}

.hint {
  font-size:9px;
  color:#a0aa92;
}

.shape-label {
  margin-top:16px;
  margin-bottom:8px;
}

.shape-switch {
  display:flex;
  gap:6px;
}

.shape-switch button {
  height:30px;
  flex:1;
  border:1px solid #e5e9dd;
  border-radius:5px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  font-size:10px;
  color:#9aab8c;
  background:#fcfcf7;
}

.shape-switch button.selected {
  background:#eff3e7;
  border-color:#b9c9a7;
  color:#4a6940;
}

.shape-preview {
  display:block;
  width:7px;
  height:7px;
  background:currentColor;
}

.shape-preview.circle {
  border-radius:50%;
}

.shape-preview.diamond {
  transform:rotate(45deg);
  width:6px;
  height:6px;
}

.shape-preview.line {
  height:1px;
  box-shadow:0 3px currentColor,0 -3px currentColor;
  transform:rotate(-35deg);
  width:9px;
}

.paper-switch {
  display:flex;
  gap:6px;
}

.paper-switch button {
  flex:1;
  font-size:9px;
  color:#92a084;
  border:1px solid #e5e9dd;
  border-radius:6px;
  padding:8px 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
}

.paper-switch button i {
  width:10px;
  height:10px;
  border:1px solid #0001;
  border-radius:2px;
  display:block;
}

.paper-switch button.selected {
  border-color:#b3c6a0;
  color:#527145;
  background:#f1f5e9;
}

.select-control {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:11px;
  color:#7c8b70;
  margin-top:17px;
  gap:10px;
}

.select-control select,.select-control input[type=number] {
  border:1px solid #e2e7d9;
  border-radius:5px;
  background:#fafcf4;
  color:#7b8b6d;
  font-size:10px;
  height:28px;
  padding:0 7px;
  width:142px;
}

.select-control input[type=number] {
  width:100px;
}

.advanced {
  margin:0 22px;
}

.advanced summary {
  font-size:10px;
  list-style:none;
  display:flex;
  gap:5px;
  padding:17px 0;
  cursor:pointer;
  color:#919f84;
  align-items:center;
}

.advanced summary::-webkit-details-marker {
  display:none;
}

.advanced summary span {
  margin-left:auto;
  font-size:14px;
}

.advanced[open] summary span {
  transform:rotate(45deg);
}

.advanced>div {
  padding-bottom:18px;
}

.advanced-note {
  font-size:9px;
  color:#9aa68e;
  line-height:1.9;
  margin-top:15px;
}

.export-settings {
  padding:16px 20px 17px;
  border-top:1px solid var(--line);
  background:#f7f9f1;
  flex:none;
}

.export-settings-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:10px;
  color:#7a8c69;
}

.export-row {
  display:grid;
  grid-template-columns:1.1fr .8fr 1fr;
  gap:5px;
  margin-top:10px;
}

.export-row select {
  width:100%;
  height:30px;
  border-radius:5px;
  border:1px solid #dfe6d4;
  background:#fdfff7;
  font-size:10px;
  color:#738666;
  padding:0 4px;
}

.export-settings p {
  font-size:9px;
  color:#9ba98c;
  margin-top:8px;
  font-variant-numeric:tabular-nums;
}

.toast {
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translateX(-50%);
  z-index:100;
  background:#2c4438;
  color:#f8fbef;
  border:1px solid #71836340;
  box-shadow:0 6px 22px #25371924;
  border-radius:8px;
  padding:12px 18px;
  font-size:12px;
  max-width:min(600px,90vw);
  line-height:1.6;
}

.toast.error {
  background:#78503e;
  color:#fff6ef;
}

dialog {
  border:1px solid #dce3d2;
  background:#fbfcf5;
  color:#314930;
  border-radius:15px;
  padding:38px;
  width:min(510px,90vw);
  box-shadow:0 20px 100px #1e341f33;
  max-height:90dvh;
}

dialog::backdrop {
  background:#2036274a;
  backdrop-filter:blur(5px);
}

dialog h2 {
  font-size:23px;
  font-weight:500;
  margin-top:16px;
  letter-spacing:1px;
}

dialog .eyebrow {
  font-size:9px;
  letter-spacing:1.5px;
}

.dialog-mark {
  height:48px;
  width:48px;
  display:grid;
  place-items:center;
  border:1px solid #cad8bd;
  border-radius:12px;
  background:#eaf1e0;
  margin-bottom:22px;
  color:#5f7f4f;
}

#export-progress-text {
  font-size:12px;
  color:#859576;
  margin-top:16px;
}

progress {
  appearance:none;
  width:100%;
  height:5px;
  margin-top:22px;
}

progress::-webkit-progress-bar {
  background:#e2e9d7;
  border-radius:4px;
}

progress::-webkit-progress-value {
  background:#688950;
  border-radius:4px;
}

progress::-moz-progress-bar {
  background:#688950;
  border-radius:4px;
}

.dialog-note {
  font-size:10px;
  color:#9caa90;
  margin:14px 0 24px;
}

.dialog-close {
  position:absolute;
  right:15px;
  top:15px;
}

.help-step {
  display:flex;
  gap:15px;
  margin-top:25px;
}

.help-step>b {
  font-family:monospace;
  color:#afba9e;
  font-size:13px;
  font-weight:400;
  padding-top:1px;
}

.help-step h3 {
  font-size:13px;
  font-weight:500;
}

.help-step p {
  font-size:11px;
  line-height:1.9;
  color:#849579;
  margin-top:5px;
}

.help-foot {
  margin-top:25px;
  border-top:1px solid #e2e7d8;
  padding-top:16px;
}

.help-foot p {
  font-size:10px;
  line-height:1.8;
  color:#9ca78e;
  margin-top:6px;
}

.busy .studio {
  pointer-events:none;
}

.busy .header-actions button {
  pointer-events:none;
  opacity:.45;
}

.fatal-message {
  position:absolute;
  inset:20%;
  font-size:13px;
  text-align:center;
  color:#7b593d;
  line-height:1.9;
}

.stage.drag-over {
  border:2px dashed #7f9e64;
  background:#e4eed9;
}

.loading .artboard {
  opacity:.75;
}

@keyframes pulse {
  50% {
    opacity:.3;
  }
}

@media(min-width:1600px) {
  .studio {
    grid-template-columns:245px minmax(440px,1fr) 325px;
  }
  .library {
    padding-left:22px;
    padding-right:22px;
  }
  .parameter-section {
    padding:24px;
  }
  .inspector-heading {
    padding:28px 24px 23px;
  }
  .control {
    margin-top:19px;
  }
  .workspace-title {
    padding:30px 40px 25px;
  }
  .workspace-toolbar {
    padding:0 40px 20px;
  }
  .stage {
    margin:0 28px;
  }
  .workspace-footer {
    height:44px;
    padding:0 32px;
  }
  .preset {
    min-height:82px;
  }
  .preset-thumb {
    width:54px;
    height:65px;
  }
  .preset-section {
    margin-top:36px;
  }
}

@media(max-width:1170px) {
  .studio {
    grid-template-columns:188px minmax(330px,1fr) 275px;
  }
  .library {
    padding-left:13px;
    padding-right:13px;
  }
  .header-caption,.demo-badge {
    display:none;
  }
  .workspace-title {
    padding:24px 22px 18px;
  }
  .workspace-title h1 {
    font-size:19px;
  }
  .workspace-toolbar {
    padding:0 20px 14px;
  }
  .view-switch button {
    padding:0 8px;
  }
  .loupe-toggle span {
    display:none;
  }
  .stage {
    margin:0 13px;
    padding-left:15px;
    padding-right:15px;
  }
  .preset {
    gap:7px;
    padding:7px 5px;
  }
  .preset-copy strong {
    font-size:11px;
  }
  .preset-copy small {
    font-size:6px;
  }
  .source-info strong {
    max-width:75px;
  }
  .source-info>span {
    font-size:8px;
  }
  .source-tip {
    font-size:9px;
  }
  .source-more {
    display:none;
  }
  .preset-thumb {
    width:44px;
    height:54px;
  }
  .parameter-section {
    padding:19px 18px;
  }
  .inspector-heading {
    padding:24px 18px 18px;
  }
  .workspace-footer {
    font-size:8px;
    padding:0 15px;
  }
  #zoom-label {
    display:none;
  }
  .recipe-actions {
    gap:5px;
  }
  .recipe-actions button {
    font-size:9px;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    animation:none!important;
  }
}

.control.irrelevant {
  opacity:.42;
}

/* Selective color: labels + check states make hue choices usable without color perception. */
.feature-badge { margin-left:7px; padding:2px 5px; color:#3f7858; background:#eaf1e6; border-radius:4px; font-size:8px; letter-spacing:.8px; font-weight:500; }
.section-subtitle { margin-top:6px; color:#929d86; font-size:10px; font-weight:400; }
.hue-section .section-heading { margin-bottom:14px; }
.toggle-switch { width:44px; height:44px; padding:12px 1px; position:relative; flex:none; }
.toggle-switch::before { content:""; display:block; height:21px; background:#dce2d5; border-radius:20px; transition:background .15s; }
.toggle-switch span { position:absolute; width:15px; height:15px; top:15px; left:5px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #283e3822; transition:transform .15s; }
.toggle-switch[aria-checked=true]::before { background:#365c46; }
.toggle-switch[aria-checked=true] span { transform:translateX(18px); }
.hue-spectrum { display:flex; height:4px; overflow:hidden; border-radius:4px; margin:0 0 15px; gap:2px; }
.hue-spectrum i { flex:1; background:var(--hue); transition:opacity .12s; }
.hue-spectrum i.muted { background:#d9dfd2; }
.hue-channels { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.hue-chip { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:7px; min-height:63px; border:1px solid #e4e8df; border-radius:8px; background:#fffefb; color:#7c8874; font-size:10px; padding:8px 3px; }
.hue-swatch { display:flex; width:22px; height:22px; border-radius:50%; background:var(--hue); align-items:center; justify-content:center; color:white; box-shadow:inset 0 0 0 1px #00000009; }
.hue-swatch svg { visibility:hidden; }
.hue-chip[aria-pressed=true] { color:#254636; border-color:#9bb29b; background:#f1f5eb; }
.hue-chip[aria-pressed=true] .hue-swatch svg { visibility:visible; }
.hue-chip:hover { border-color:#91a68a; }
.hue-actions { display:flex; align-items:center; justify-content:space-between; gap:4px; margin-top:10px; flex-wrap:wrap; }
.hue-actions>span { font-size:10px; color:#6e8064; flex:1; min-width:80px; }
.hue-actions>div { display:flex; gap:1px; }
.hue-actions button { font-size:10px; color:#73896c; min-width:34px; min-height:32px; border-radius:5px; padding:0 4px; }
.hue-actions button:hover { background:#edf2e6; }
.hue-note { color:#8c9880; font-size:10px; line-height:1.8; margin-top:14px; }
.output-description { font-size:13px; color:#7c8973; margin-top:8px; }
.output-note { font-size:12px; line-height:1.8; color:#849076; margin:14px 0 20px; }
#output-dialog .export-settings { border:1px solid #e4e9dc; border-radius:10px; padding:16px; margin-top:22px; }
#output-dialog .export-settings-title { font-size:12px; }
#output-dialog .export-row select { height:46px; font-size:16px; padding:0 7px; }
#output-dialog .export-settings p { font-size:11px; }
#confirm-export { width:100%; min-height:48px; font-size:14px; }

/* Mobile editor: persistent preview + one scrollable tool panel, never a long stacked page. */
.mobile-tabs,.mobile-expand,.mobile-help-button,.mobile-utility { display:none; }
@media (max-width:900px), (max-width:1100px) and (max-height:560px) {
  html { height:100%; overflow:hidden; }
  body { height:100%; overflow:hidden; overscroll-behavior:none; }
  #app { height:100vh; height:100dvh; display:flex; flex-direction:column; overflow:hidden;
    padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px); }
  .app-header { height:60px; min-height:60px; padding:0 14px; gap:8px; flex:none; }
  .header-caption,.header-divider,.demo-badge { display:none; }
  .brand { gap:6px; }
  .brand-name { font-size:19px; gap:7px; letter-spacing:2px; }
  .brand-name>span { font-size:9px; letter-spacing:1.2px; }
  .brand-mark { grid-template-columns:repeat(3,4px); gap:3px; padding:3px; }
  .brand-mark i,.brand-mark i:nth-child(7) { width:4px; height:4px; }
  .header-actions { gap:6px; }
  .button,.icon-btn { height:44px; min-height:44px; }
  .header-actions .button { padding:0 13px; font-size:12px; border-radius:8px; gap:5px; }
  .header-actions #import-btn span { display:none; }
  .header-actions #import-btn { width:44px; padding:0; }
  .header-actions .icon-btn { display:flex; width:44px; }
  .studio { --tool-height: min(40dvh, 354px); display:grid;
    grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) 54px var(--tool-height);
    grid-template-areas:"workspace" "tools" "panel";
    height:auto; min-height:0; flex:1; overflow:hidden;
    padding-bottom:env(safe-area-inset-bottom,0px); background:#fcfcf8; }
  .workspace { grid-area:workspace; min-height:0; width:100%; }
  .workspace-title { display:none; }
  .workspace-title h1 { font-size:12px; letter-spacing:.3px; margin:0; }
  .workspace-title .eyebrow { display:none; }
  .workspace-title .live-pill { margin-left:auto; font-size:9px; padding:4px 7px; }
  .mobile-expand { display:flex; width:44px; min-height:44px; height:44px; }
  .header-actions #help-btn { display:none; }
  .mobile-utility { display:flex; gap:8px; }
  .mobile-help-button { display:flex; align-items:center; justify-content:center; gap:6px; min-height:44px; font-size:12px; width:100%; }
  .workspace-footer .live-pill { font-size:8px; padding:0 2px; border:0; background:none; }
  .workspace-toolbar { flex:none; padding:2px 12px 5px; gap:5px; min-height:53px; }
  .view-switch { padding:2px; gap:0; border-radius:8px; }
  .view-switch button { min-height:44px; height:44px; font-size:11px; padding:0 9px; white-space:nowrap; border-radius:6px; }
  .view-switch button svg { width:12px; }
  .canvas-tools { gap:0; }
  .canvas-tools .icon-btn,.loupe-toggle { height:44px; min-height:44px; width:44px; padding:0; justify-content:center; }
  .loupe-toggle span,.tool-divider { display:none; }
  .stage { flex:1; min-height:0; margin:0 12px; padding:10px 12px 19px; border-radius:9px; }
  .stage-note { font-size:8px; bottom:5px; }
  .stage-corner { display:none; }
  .artboard { flex:none; }
  .workspace-footer { flex:none; height:23px; min-height:23px; padding:0 15px; font-size:8px; }
  .workspace-footer>span:nth-child(2) { display:inline; }
  #zoom-label { display:none; }
  .mobile-tabs { grid-area:tools; display:grid; grid-template-columns:repeat(5,minmax(0,1fr));
    padding:0 8px; gap:4px; border-block:1px solid #e3e7dc; background:#fafbf6; z-index:2; }
  .mobile-tabs button { display:flex; align-items:center; justify-content:center; gap:7px; min-width:0; min-height:52px;
    font-size:12px; color:#919b86; border-bottom:2px solid transparent; border-radius:7px 7px 0 0; }
  .mobile-tabs button[aria-selected=true] { color:#284f38; border-bottom-color:#3b6348; background:linear-gradient(0deg,#edf2e8,transparent); font-weight:600; }
  .library { grid-area:panel; display:none; min-height:0; height:auto; padding:17px 18px 24px; border:0; overflow-y:auto; gap:0; }
  .inspector { grid-area:panel; min-height:0; border:0; height:auto; }
  .inspector-heading { display:none; }
  .inspector-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  #parameters { display:block; min-width:0; }
  .parameter-section { padding:16px 20px 22px; border:0; }
  .parameter-section h3 { font-size:13px; }
  .section-heading { margin-bottom:12px; gap:8px; }
  .section-tag { display:inline; font-size:8px; }
  .section-subtitle { font-size:11px; }
  .text-button { min-height:44px; font-size:11px; gap:5px; }
  .mode-row { margin-bottom:12px; font-size:11px; padding:10px 12px; }
  .control { margin-top:12px; }
  .control-label { font-size:12px; color:#647a58; margin-bottom:0; }
  .control-label output { font-size:11px; }
  .control input[type=range] { height:44px; touch-action:pan-y; }
  .control input[type=range]::-webkit-slider-runnable-track { height:4px; }
  .control input[type=range]::-webkit-slider-thumb { width:22px; height:22px; border-width:2px; margin-top:-9px; box-shadow:0 1px 4px #40553925; }
  .control input[type=range]::-moz-range-track,.control input[type=range]::-moz-range-progress { height:4px; }
  .control input[type=range]::-moz-range-thumb { width:18px; height:18px; }
  .range-note { font-size:10px; margin-top:-4px; }
  .select-control { font-size:12px; }
  .select-control select,.select-control input[type=number] { height:44px; font-size:16px; width:185px; max-width:64%; }
  .shape-switch button,.paper-switch button { min-height:44px; font-size:12px; }
  .paper-switch button i { width:14px; height:14px; }
  .shape-switch,.paper-switch { gap:8px; }
  .hint { font-size:10px; }
  .advanced { margin:0 20px 20px; }
  .advanced summary { min-height:44px; font-size:12px; }
  .advanced-note { font-size:11px; }
  .hue-section .section-heading { margin-bottom:10px; }
  .hue-spectrum { margin-bottom:12px; }
  .hue-channels { gap:8px; }
  .hue-chip { min-height:57px; flex-direction:row; gap:6px; padding:7px 5px; font-size:12px; }
  .hue-swatch { width:20px; height:20px; flex:none; }
  .hue-actions { margin-top:5px; }
  .hue-actions>span { font-size:11px; }
  .hue-actions button { min-width:44px; min-height:44px; font-size:11px; }
  .hue-section .control { margin-top:5px; }
  .hue-note { font-size:11px; margin-top:12px; line-height:1.7; }
  .studio [data-panel] { display:none; }
  .studio[data-mobile-panel=hue] [data-panel=hue],
  .studio[data-mobile-panel=color] [data-panel=color],
  .studio[data-mobile-panel=screen] [data-panel=screen],
  .studio[data-mobile-panel=paper] [data-panel=paper] { display:block; }
  .studio[data-mobile-panel=style] .library { display:flex; }
  .studio[data-mobile-panel=style] .inspector { display:none; }
  .studio.panel-collapsed { grid-template-rows:minmax(0,1fr) 54px 0; }
  .studio.panel-collapsed .library,.studio.panel-collapsed .inspector { visibility:hidden; }
  .header-actions .mobile-expand[aria-expanded=true] { background:#e5eddf; color:#305740; }
  .source-section { width:auto; margin-bottom:16px; }
  .source-section>.eyebrow,.source-tip { display:none; }
  .source-section .dropzone { margin:0; padding:7px 10px; }
  .source-thumb { width:28px; height:36px; }
  .source-info { gap:3px; }
  .source-info strong { font-size:11px; max-width:190px; }
  .source-info>span { font-size:10px; }
  .source-more { display:block; }
  .preset-section { margin:0; }
  .preset-section>.eyebrow { font-size:12px; margin-bottom:12px; }
  .presets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
  .preset { width:100%; min-width:0; min-height:83px; padding:8px; gap:9px; height:auto; }
  .preset-thumb { width:45px; height:64px; }
  .preset-copy { min-width:0; }
  .preset-copy strong { font-size:12px; }
  .preset-copy small { display:none; }
  .preset-selected { width:16px; height:16px; top:4px; right:4px; }
  .ink-dots { margin-top:6px; }
  .recipe-actions { margin-top:12px; padding-top:4px; }
  .recipe-actions button { min-height:44px; font-size:12px; }
  .library-bottom { display:block; margin-top:0; padding-top:0; }
  .library-bottom>.edition-label,.library-bottom>p { display:none; }
  .privacy { border:0; margin-top:0; padding:4px 0; justify-content:center; font-size:10px; }
  #compare-slider { touch-action:none; }
  .loupe { width:162px; right:7px; bottom:18px; padding:8px; pointer-events:none; }
  .loupe canvas { width:144px; height:105px; }
  .loupe p { font-size:8px; }
  .loupe-head { margin-bottom:5px; }
  .compare-label { font-size:8px; padding:4px 5px; }
  .compare-line span { width:34px; height:34px; }
  dialog { padding:26px 22px; width:calc(100% - 28px); max-height:calc(100dvh - 40px); overflow-y:auto; }
  dialog h2 { font-size:22px; }
  .dialog-close { width:44px; height:44px; top:7px; right:7px; }
  .help-step { gap:12px; }
  .help-step p,.help-foot p { font-size:12px; }
  #output-dialog { margin:auto 0 0; width:100%; max-width:900px; border-radius:20px 20px 0 0;
    padding-bottom:calc(24px + env(safe-area-inset-bottom,0px)); }
  #output-dialog .export-row { grid-template-columns:1.12fr .87fr 1.07fr; gap:6px; }
  #output-dialog .export-row select { min-width:0; }
  .toast { max-width:calc(100vw - 32px); width:max-content; font-size:12px; bottom:calc(14px + env(safe-area-inset-bottom,0px)); pointer-events:none; }
}
/* Very narrow handsets keep 44px targets without an overflowing toolbar. */
@media (max-width:359px) {
  .app-header { padding:0 10px; }
  .brand-name>span { display:none; }
  .header-actions .icon-btn { width:44px; }
  .workspace-title { padding-left:12px; padding-right:10px; }
  .workspace-title h1 { font-size:11px; }
  .workspace-toolbar { padding:2px 8px 4px; gap:2px; }
  .view-switch button { padding:0 6px; font-size:10px; }
  .canvas-tools .icon-btn,.loupe-toggle { width:44px; }
  .mobile-tabs { padding:0 4px; gap:0; }
  .mobile-tabs button { font-size:11px; gap:5px; }
  .parameter-section { padding:14px 15px 20px; }
  .hue-chip { gap:4px; font-size:11px; }
  .hue-swatch { width:17px; height:17px; }
}
/* Short landscape: image on the left, tools on the right, all in the visual viewport. */
@media (max-width:1100px) and (max-height:560px) and (orientation:landscape) {
  .app-header { height:52px; min-height:52px; }
  .studio { grid-template-columns:minmax(0,1fr) minmax(275px,40%); grid-template-rows:52px minmax(0,1fr);
    grid-template-areas:"workspace tools" "workspace panel"; }
  .workspace-title { display:none; }
  .workspace-toolbar { padding:4px 9px; }
  .mobile-tabs { padding:0 3px; gap:0; }
  .mobile-tabs button { flex-direction:column; gap:3px; font-size:10px; min-height:50px; }
  .mobile-tabs button svg { width:16px; height:16px; }
  .studio.panel-collapsed { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); grid-template-areas:"workspace"; }
  .studio.panel-collapsed .inspector,.studio.panel-collapsed .library,.studio.panel-collapsed .mobile-tabs { display:none; }
  .stage { margin:0 8px; padding:7px 10px 17px; }
  .parameter-section { padding:14px 16px 22px; }
  .hue-chip { font-size:11px; min-height:54px; }
  .hue-note { font-size:10px; }
  .library { padding:14px 12px 20px; }
  .preset { gap:5px; padding:6px; }
  .preset-thumb { width:34px; height:50px; }
  .preset-copy strong { font-size:10px; }
}
@media (pointer:coarse) and (min-width:901px) and (min-height:561px) {
  .control input[type=range] { height:40px; }
  .shape-switch button,.paper-switch button,.recipe-actions button { min-height:44px; }
}

@media (max-width:900px) and (max-height:700px) and (orientation:portrait) {
  .studio { --tool-height:34dvh; }
}
