/* Meadowism green + white skin for the prompt-first Studio.
   Visual properties only. Keep component geometry, ports, wire colours,
   product artwork, event handling, and the alternate Pigment theme intact.
   Loaded after legacy cream-glass.css and studio-workspace.css. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) {
  --bg-1: #f5f7f2;
  --bg-2: #eaf0e5;
  --paper: #ffffff;
  --ink: #35382f;
  --ink-2: #626b5c;
  --warm: #707968;
  --line: #dce3d6;
  --line-strong: #a8b69d;
  --accent: #434b3a;
  --accent-2: #637653;
  --accent-3: #839772;
  --accent-rgb: 67, 75, 58;
  --accent-2-rgb: 99, 118, 83;
  --canvas-bg: #f1f5ed;
  --canvas-grid: rgba(67, 75, 58, .12);
  --node-bg: #ffffff;
  --node-shadow: 0 4px 16px rgba(35, 48, 26, .07);
  --selected-ring: rgba(67, 75, 58, .5);
  --studio-green: #434b3a;
  --studio-green-hover: #343e2c;
  --studio-soft: #eaf0e5;
  --studio-white: #ffffff;
  --studio-shadow: 0 6px 22px rgba(35, 48, 26, .07);
  color: var(--ink);
  background: var(--bg-1) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) { background: #f5f7f2 !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry))::before,
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-topbar::after { background: var(--line) !important; }

/* Prompt entry: an opaque white writing surface on pale green. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-entry { background: var(--bg-1); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-brand,
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-content h1 { color: var(--studio-green); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-form {
  background: var(--studio-white);
  border-color: var(--line);
  box-shadow: 0 12px 36px rgba(35, 48, 26, .06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-entry button {
  background: var(--studio-white);
  border-color: var(--line);
  box-shadow: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-entry button:hover:not(:disabled) {
  background: var(--studio-soft);
  border-color: var(--line-strong);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-entry .cx-prompt-submit {
  background: var(--studio-green);
  border-color: var(--studio-green);
  color: var(--studio-white);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-entry .cx-prompt-submit:hover:not(:disabled) {
  background: var(--studio-green-hover);
  border-color: var(--studio-green-hover);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-prompt-reply { background: var(--studio-white); }

/* App chrome and shared controls. Do not change sizing or positioning. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-topbar {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
  box-shadow: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-proj-name, .cx-moodboard-head) { color: var(--ink) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-navlink.active, .cx-seg, .cx-mini-stat) {
  background: var(--studio-soft) !important;
  border-color: var(--line-strong) !important;
  box-shadow: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-tbtn, .cx-tbtn.ghost, .cx-theme-picker, .cx-node-act,
  .cx-chip, .cx-tile, .cx-btn-ghost, .cx-libnode,
  .cx-wire-tool, .cx-zoom, .cx-minimap, .cx-hint,
  .cx-side-tabs--canvas .cx-side-tab) {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-tbtn, .cx-node-act, .cx-chip, .cx-tile, .cx-btn-ghost,
  .cx-libnode, .cx-side-tab):hover:not(:disabled) {
  background: var(--studio-soft) !important;
  border-color: var(--line-strong) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-tbtn.primary, .cx-btn-primary, .cx-ai-chat-send,
  .cx-chip.sel, .cx-tile.sel, .cx-side-tab[aria-selected="true"],
  .cx-prev-mode-btn.on) {
  background: var(--studio-green) !important;
  color: var(--studio-white) !important;
  border-color: var(--studio-green) !important;
  box-shadow: none !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-tbtn.primary, .cx-btn-primary, .cx-ai-chat-send,
  .cx-chip.sel, .cx-tile.sel, .cx-side-tab[aria-selected="true"],
  .cx-prev-mode-btn.on):hover:not(:disabled) {
  background: var(--studio-green-hover) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-seg-b.sel, .cx-wire-tool.sel) {
  background: var(--studio-soft) !important;
  border-color: var(--studio-green) !important;
  color: var(--studio-green) !important;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-select, .cx-textarea, .cx-size-input, .cx-size-unit,
  .cx-text-node-fields input, .cx-text-node-fields select, .cx-text-node-fields textarea,
  .cx-text-controls input, .cx-text-controls select, .cx-text-controls textarea) {
  background: var(--studio-white) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
  accent-color: var(--studio-green);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-select, .cx-textarea, .cx-size-input, .cx-size-unit):focus {
  border-color: var(--studio-green) !important;
  box-shadow: 0 0 0 2px rgba(67, 75, 58, .14);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :focus-visible { outline-color: var(--studio-green) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-range { accent-color: var(--studio-green) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-range::-webkit-slider-thumb {
  background: var(--studio-green) !important;
  border-color: var(--studio-green) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-range::-moz-range-thumb {
  background: var(--studio-green) !important;
  border-color: var(--studio-green) !important;
}

/* Result + chat stays one card, with the original resize handles. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace-panel { background: var(--studio-white); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace-editor { background: var(--canvas-bg); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-workspace-layout-options > div, .cx-workspace-editor-tools > summary) {
  background: var(--studio-white);
  border-color: var(--line);
  box-shadow: var(--studio-shadow);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-workspace-toolbar, .cx-workspace-panel-head) button:hover,
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace-toolbar button[aria-controls="cx-panel-editor"] {
  background: var(--studio-soft);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace-split::after { background: var(--line-strong); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace-split-horizontal::before { background: var(--line); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace .cx-ai-chat-compose {
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace .cx-ai-chat-msg-user .cx-ai-chat-msg-text {
  background: var(--studio-soft) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace .cx-ai-chat-msg-edit { background: var(--studio-soft); }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-workspace .cx-prev-ico:hover { background: var(--studio-soft) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-ai-chat-bar, .cx-mm-h) {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-text-toggle, .cx-text-actions button) { background: var(--studio-soft); }

/* Canvas and nodes: preserve pattern spacing, dimensions and family-coded ports. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-canvas-col::before,
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-canvas-col::after {
  background: none;
  animation: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-grid[data-cx-canvas-pattern="weave"] {
  background-image:
    repeating-linear-gradient(90deg, rgba(67,75,58,.09) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(67,75,58,.09) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(99,118,83,.14) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(99,118,83,.14) 0 1px, transparent 1px 56px) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-grid[data-cx-canvas-pattern="dots"] {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(67,75,58,.24) .7px, transparent .95px),
    radial-gradient(circle at 50% 50%, rgba(99,118,83,.18) .55px, transparent .75px) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-grid[data-cx-canvas-pattern="stripes"] {
  background-image:
    repeating-linear-gradient(90deg, rgba(67,75,58,.07) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(99,118,83,.07) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(99,118,83,.06) 0 1px, transparent 1px 30px) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-canvas-wrap::before {
  background: linear-gradient(90deg, rgba(241,245,237,.7) 0 22px),
    repeating-linear-gradient(0deg, rgba(67,75,58,.35) 0 1px, transparent 1px 10px,
      rgba(99,118,83,.45) 10px 11px, transparent 11px 20px) !important;
  border-color: var(--line) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-canvas-wrap::after { color: var(--warm) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
  box-shadow: var(--node-shadow) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node:hover { box-shadow: 0 6px 20px rgba(35,48,26,.11) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node.sel {
  border-color: var(--studio-green) !important;
  box-shadow: 0 0 0 2px var(--selected-ring), var(--node-shadow) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node .cx-node-header {
  background: var(--studio-soft) !important;
  border-color: var(--line) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node-header::after,
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-side-h::after {
  background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 10px) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node-body { background: var(--studio-white) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-node-type, .cx-moodboard-head, .cx-moodboard-item) {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node-collapse { color: var(--warm) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-node-collapse:hover { color: var(--ink) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-motif-preview, .cx-airender-preview:not(.cx-airender-pattern-preview), .cx-moodboard) {
  background: var(--bg-1) !important;
  border-color: var(--line-strong) !important;
  box-shadow: none;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-moodboard-item-sel {
  border-color: var(--studio-green) !important;
  box-shadow: 0 0 0 2px var(--selected-ring), var(--node-shadow) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-moodboard-resize, .cx-moodboard-item-resize)::after { border-color: var(--line-strong) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-port {
  border-color: var(--studio-white) !important;
  box-shadow: 0 0 0 1px rgba(67,75,58,.25) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-port:hover { box-shadow: 0 0 0 2px var(--studio-green) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-port::after { background: var(--studio-white) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-sidebar {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
  box-shadow: var(--studio-shadow) !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-sidebar::after { background: var(--line) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-proj-list li.active, .cx-proj-list li:hover, .cx-workshop-list li) {
  background: var(--studio-soft) !important;
}

/* Dialogs use the same surfaces; warnings/errors retain distinct colours. */
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-modal-card {
  background: var(--studio-white) !important;
  border-color: var(--line) !important;
  box-shadow: 0 20px 60px rgba(35,48,26,.15);
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) .cx-modal-card::before { background: var(--studio-green) !important; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-node-issue.error, .cx-render-note-err) {
  color: #973b32 !important;
  background: #fff0ed !important;
  border-color: #e7bbb4 !important;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) #cx-prompt-error { color: #973b32; }
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-sidebar, .cx-prev-footer-scroll, .cx-ai-chat-list)::-webkit-scrollbar-thumb {
  background: #b1bdab;
}
.cx-app[data-theme="atelier"]:is([data-route="studio"], :has(> .cx-prompt-entry)) :is(.cx-sidebar, .cx-prev-footer-scroll, .cx-ai-chat-list)::-webkit-scrollbar-thumb:hover {
  background: #839772;
}

/* The waitlist is portalled to body, so scope it to the active Studio. */
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-panel {
  background: #ffffff;
  border-color: #dce3d6;
  box-shadow: 0 20px 60px rgba(35,48,26,.15);
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-backdrop { background: rgba(35,48,26,.35); }
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) :is(.cx-email-cap-title, .cx-audience-chip, .cx-email-cap-input) { color: #35382f; }
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) :is(.cx-email-cap-eyebrow, .cx-email-cap-lead, .cx-email-cap-label, .cx-email-cap-later) { color: #626b5c; }
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) :is(.cx-audience-chip, .cx-email-cap-input) {
  background: #ffffff;
  border-color: #dce3d6;
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-audience-chip:has(input:checked) {
  background: #eaf0e5;
  border-color: #434b3a;
  box-shadow: 0 0 0 2px rgba(67,75,58,.12);
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-audience-chip:hover { border-color: #a8b69d; }
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-input:focus {
  border-color: #434b3a;
  box-shadow: 0 0 0 2px rgba(67,75,58,.12);
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-x { background: #eaf0e5; color: #35382f; }
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-submit {
  background: #434b3a;
  border-color: #434b3a;
  color: #ffffff;
}
body:has(.cx-app[data-theme="atelier"][data-route="studio"], .cx-app[data-theme="atelier"] > .cx-prompt-entry) .cx-email-cap-submit:hover:not(:disabled) { background: #343e2c; }
