:root {
  --paper: #f5f3ee;
  --panel: #fbfaf7;
  --ink: #1c1d1a;
  --muted: #777971;
  --line: #deddd6;
  --soft-line: #e9e7e0;
  --accent: #ed5a36;
  --accent-dark: #d64625;
  --accent-soft: #fde8e1;
  --lime: #d8ff62;
  --blue: #506cff;
  --shadow: 0 18px 60px rgba(36, 32, 27, 0.12);
  --sidebar-left: 252px;
  --sidebar-right: 296px;
  --topbar-height: 66px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-sans: "Manrope", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [draggable="true"] { user-select: none; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

::selection { background: var(--lime); color: #141510; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  background: var(--ink);
  color: white;
  border-radius: 6px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  display: grid;
  grid-template-columns: var(--sidebar-left) minmax(220px, 1fr) auto;
  align-items: center;
  background: rgba(251, 250, 247, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 30;
}

.brand {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
}
.brand-mark { width: 28px; height: 28px; position: relative; display: block; }
.brand-mark i { position: absolute; display: block; border: 2px solid var(--ink); border-radius: 3px; width: 13px; height: 13px; background: var(--panel); }
.brand-mark i:nth-child(1) { left: 1px; top: 1px; }
.brand-mark i:nth-child(2) { right: 1px; top: 1px; background: var(--accent); border-color: var(--accent); transform: rotate(8deg); }
.brand-mark i:nth-child(3) { left: 8px; bottom: 1px; background: var(--lime); transform: rotate(-6deg); }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); margin: 0 2px; }

.project-heading { display: flex; align-items: center; gap: 10px; padding: 0 20px; min-width: 0; }
.project-kicker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 2px; }
.save-dot { width: 5px; height: 5px; border-radius: 50%; background: #62a94d; box-shadow: 0 0 0 3px rgba(98,169,77,.1); }
.project-title-input { width: min(360px, 40vw); border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 650; padding: 0; outline: none !important; }

.topbar-actions { display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.view-switch { display: flex; padding: 3px; background: #eceae4; border-radius: 9px; }
.view-switch__button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 7px; padding: 7px 10px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; }
.view-switch__button svg { width: 14px; height: 14px; }
.view-switch__button.is-active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.button, .icon-button, .mini-icon-button, .tool-button { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.button { height: 38px; padding: 0 14px; border-radius: 9px; gap: 8px; font-weight: 650; font-size: 11px; letter-spacing: .01em; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--ghost { border: 1px solid var(--line); background: var(--panel); }
.button--ghost:hover { background: white; box-shadow: 0 5px 16px rgba(30,30,25,.07); }
.button--primary { background: var(--ink); color: white; box-shadow: 0 6px 18px rgba(28,29,26,.18); }
.button--primary:hover { background: #2b2c28; box-shadow: 0 8px 22px rgba(28,29,26,.23); }
.button kbd { font: 400 9px var(--font-mono); color: #b6b8af; border-left: 1px solid #4a4c46; padding-left: 8px; }
.spark { color: var(--lime); font-size: 15px; }
.icon-button { width: 38px; height: 38px; border-radius: 9px; background: transparent; }
.icon-button:hover { background: #eeece6; }
.icon-button--dark:hover { background: rgba(255,255,255,.1); }
.mini-icon-button { width: 27px; height: 27px; padding: 0; border-radius: 7px; background: transparent; }
.mini-icon-button:hover { background: #eceae4; }
.mini-icon-button svg { width: 15px; height: 15px; }
.mobile-only, .mobile-close { display: none; }

.studio { min-height: 0; flex: 1; display: grid; grid-template-columns: var(--sidebar-left) minmax(0, 1fr) var(--sidebar-right); }
.studio.is-flow-mode { grid-template-columns: var(--sidebar-left) minmax(0, 1fr) 0; }
.studio.is-flow-mode .inspector-panel { display: none; }
.sidebar { min-height: 0; background: var(--panel); position: relative; z-index: 20; }
.library-panel { grid-column: 1; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.inspector-panel { grid-column: 3; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar-scroll, .inspector-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ccc9c0 transparent; }
.sidebar-section { padding: 18px 14px 16px; }
.section-heading { height: 26px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 3px; color: var(--muted); font: 500 9px var(--font-mono); letter-spacing: .13em; }
.drag-hint { color: #aaa9a2; letter-spacing: 0; font-family: var(--font-sans); }
.section-divider { height: 1px; background: var(--soft-line); margin: 0 14px; }

.style-section { padding-top: 13px; padding-bottom: 13px; }
.style-count { color: #aaa9a2; letter-spacing: 0; }
.active-style-card { width: 100%; min-height: 58px; display: grid; grid-template-columns: 58px minmax(0,1fr) 16px; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--soft-line); border-radius: 10px; background: white; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.active-style-card:hover { border-color: #bbb8af; box-shadow: 0 6px 18px rgba(38,34,28,.07); transform: translateY(-1px); }
.active-style-card > svg { width: 14px; color: #999a93; }
.style-swatch { width: 58px; height: 42px; display: block; position: relative; overflow: hidden; border-radius: 7px; background: var(--style-bg, #f2eee5); border: 1px solid rgba(20,20,18,.1); }
.style-swatch i { position: absolute; display: block; background: var(--style-text, #1c1d1a); }
.style-swatch i:nth-child(1) { width: 25px; height: 5px; left: 7px; top: 9px; border-radius: 1px; }
.style-swatch i:nth-child(2) { width: 18px; height: 15px; right: 6px; bottom: 6px; border-radius: var(--style-radius, 4px); background: var(--style-accent, #ed5a36); }
.style-swatch i:nth-child(3) { width: 22px; height: 2px; left: 7px; top: 19px; opacity: .3; box-shadow: 0 5px var(--style-text, #1c1d1a); }
.active-style-copy { min-width: 0; }
.active-style-copy strong { display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-style-copy small { display: block; margin-top: 4px; color: #96978f; font: 400 7px var(--font-mono); letter-spacing: .08em; }

.scene-list { display: flex; flex-direction: column; gap: 5px; }
.scene-item { min-width: 0; width: 100%; height: 66px; display: grid; grid-template-columns: 70px minmax(0,1fr) 20px; align-items: center; gap: 10px; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.scene-item:hover { background: #f2f0eb; }
.scene-item.is-active { background: white; border-color: #d8d6ce; box-shadow: 0 4px 14px rgba(30,28,24,.06); }
.scene-thumb { width: 70px; height: 48px; border-radius: 6px; overflow: hidden; position: relative; border: 1px solid rgba(25,25,22,.12); background: white; }
.scene-thumb__bg { position: absolute; inset: 0; }
.scene-thumb__bar { position: absolute; left: 7px; top: 7px; right: 7px; height: 3px; border-radius: 2px; background: currentColor; opacity: .25; }
.scene-thumb__title { position: absolute; left: 7px; top: 15px; width: 28px; height: 6px; border-radius: 1px; background: currentColor; opacity: .8; }
.scene-thumb__copy { position: absolute; left: 7px; top: 24px; width: 37px; height: 3px; border-radius: 1px; background: currentColor; opacity: .25; box-shadow: 0 5px currentColor; }
.scene-thumb__block { position: absolute; width: 16px; height: 17px; right: 7px; bottom: 6px; border-radius: 3px; background: var(--accent); opacity: .8; }
.scene-meta { min-width: 0; }
.scene-meta strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-meta span { display: block; margin-top: 4px; font: 400 9px var(--font-mono); color: #999992; }
.scene-number { align-self: start; color: #aaa8a0; font: 400 9px var(--font-mono); padding-top: 2px; }

.search-box { height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 8px; margin: 0 2px 11px; border-radius: 8px; background: #efede8; border: 1px solid transparent; }
.search-box:focus-within { background: white; border-color: #ccc9c0; }
.search-box svg { width: 14px; height: 14px; color: #95958d; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 11px; }
.search-box kbd { font: 400 9px var(--font-mono); color: #aaa8a0; border: 1px solid #d6d3ca; border-radius: 4px; padding: 1px 4px; background: #f8f7f3; }
.component-filters { display: flex; gap: 4px; margin: 0 2px 11px; overflow-x: auto; scrollbar-width: none; }
.component-filters::-webkit-scrollbar { display: none; }
.component-filters button { flex: none; border: 1px solid var(--soft-line); background: white; border-radius: 999px; padding: 5px 8px; color: #898a83; font-size: 8px; cursor: pointer; }
.component-filters button.is-active { background: var(--ink); border-color: var(--ink); color: white; }
.component-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.component-category-title { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 8px 2px 2px; color: #91928a; font: 500 8px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.component-category-title span { font-size: 7px; color: #bbb9b1; letter-spacing: 0; }
.component-empty { grid-column: 1 / -1; padding: 24px 8px; text-align: center; color: #9b9c95; font-size: 9px; }
.component-tile { height: 70px; border: 1px solid var(--soft-line); border-radius: 9px; background: white; padding: 9px; cursor: grab; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.component-tile:hover { border-color: #b8b6ae; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(38,34,28,.07); }
.component-tile:active { cursor: grabbing; }
.component-tile__icon { height: 27px; display: flex; align-items: center; color: var(--ink); }
.component-tile__icon svg { width: 19px; height: 19px; }
.component-glyph { display: inline-grid; place-items: center; min-width: 21px; height: 21px; font: 600 11px var(--font-mono); letter-spacing: -.05em; }
.component-glyph--heading { font-size: 13px; letter-spacing: -.12em; }
.component-glyph--button { width: 28px; border-radius: 11px; background: var(--ink); color: white; }
.component-glyph--card { width: 21px; border: 1px solid currentColor; border-radius: 4px; box-shadow: 3px 3px 0 #d9d6ce; }
.component-glyph--image { width: 21px; border-radius: 4px; background: linear-gradient(135deg, #d8d2c7 50%, #8e8c84 51%); color: transparent; }
.component-glyph--input { width: 30px; border-bottom: 1px solid currentColor; }
.component-glyph--badge { color: var(--accent); }
.component-glyph--navbar { font-size: 18px; }
.component-glyph--divider { width: 28px; }
.component-glyph--textarea, .component-glyph--table, .component-glyph--modal, .component-glyph--hero, .component-glyph--pricing { width: 25px; border: 1px solid currentColor; border-radius: 3px; }
.component-glyph--switch { width: 28px; height: 14px; border-radius: 10px; background: #d9d7cf; color: var(--accent); text-align: right; }
.component-glyph--alert { color: #e09c27; }
.component-glyph--progress { width: 30px; height: 5px; background: linear-gradient(90deg, var(--accent) 65%, #ddd 65%); color: transparent; }
.component-glyph--spinner { border: 2px solid #ddd; border-top-color: var(--accent); border-radius: 50%; width: 18px; min-width: 18px; height: 18px; }
.component-tile span { display: block; font-size: 10px; font-weight: 600; color: #5d5f58; }
.new-project-button { flex: 0 0 48px; border: 0; border-top: 1px solid var(--soft-line); background: var(--panel); display: flex; align-items: center; justify-content: center; gap: 8px; color: #6f7069; font-size: 10px; font-weight: 600; cursor: pointer; }
.new-project-button:hover { color: var(--accent); background: white; }
.new-project-button svg { width: 15px; }

.workspace { grid-column: 2; min-width: 0; min-height: 0; position: relative; overflow: hidden; background-color: #e9e7e1; background-image: radial-gradient(#cfcdc5 .8px, transparent .8px); background-size: 16px 16px; }
.workspace.no-grid { background-image: none; }
.workspace-toolbar { position: absolute; z-index: 10; left: 16px; right: 16px; top: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.scene-breadcrumb, .canvas-tools { pointer-events: auto; background: rgba(251,250,247,.9); backdrop-filter: blur(14px); border: 1px solid rgba(202,199,190,.8); box-shadow: 0 5px 18px rgba(38,35,29,.07); height: 36px; border-radius: 9px; display: flex; align-items: center; }
.scene-breadcrumb { padding: 0 11px; gap: 5px; font-size: 10px; color: #8b8c85; }
.scene-breadcrumb svg { width: 12px; height: 12px; }
.scene-breadcrumb strong { color: #454741; font-weight: 650; }
.canvas-tools { padding: 3px; }
.tool-button { width: 29px; height: 28px; background: transparent; border-radius: 6px; }
.tool-button:hover, .tool-button.is-active { background: white; color: var(--accent); }
.tool-button svg { width: 14px; height: 14px; }
.zoom-control { display: flex; align-items: center; height: 24px; margin: 0 3px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.zoom-control button { width: 25px; border: 0; background: transparent; cursor: pointer; color: #74766f; }
.zoom-control span { min-width: 38px; text-align: center; font: 400 9px var(--font-mono); }

.canvas-viewport { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; position: relative; padding: 84px 56px 74px; scrollbar-width: thin; scrollbar-color: #c1bfb8 transparent; }
.canvas-stage { flex: none; position: relative; transition: width .2s, height .2s; }
.artboard { position: absolute; left: 50%; top: 50%; width: 1440px; height: 900px; transform-origin: center; background: white; box-shadow: 0 20px 70px rgba(37,33,27,.2), 0 0 0 1px rgba(55,50,44,.12); overflow: hidden; transition: background .2s; }
.artboard.is-dragover { box-shadow: 0 20px 70px rgba(37,33,27,.2), 0 0 0 3px var(--accent); }
.drop-message { position: absolute; z-index: 0; inset: 0; display: none; place-items: center; align-content: center; gap: 8px; color: #aaa79e; font-size: 16px; }
.drop-message svg { width: 32px; height: 32px; padding: 7px; border: 1px dashed #c3c0b7; border-radius: 8px; }
.alignment-guides { position: absolute; z-index: 90; inset: 0; pointer-events: none; overflow: hidden; }
.alignment-guide { position: absolute; background: #506cff; box-shadow: 0 0 0 1px rgba(255,255,255,.75); }
.alignment-guide--vertical { top: 0; bottom: 0; width: 1px; }
.alignment-guide--horizontal { left: 0; right: 0; height: 1px; }
.alignment-guide::after { content: attr(data-position); position: absolute; display: block; padding: 3px 5px; border-radius: 3px; background: #506cff; color: white; font: 500 9px var(--font-mono); white-space: nowrap; box-shadow: none; }
.alignment-guide--vertical::after { left: 5px; top: 7px; }
.alignment-guide--horizontal::after { right: 7px; top: 5px; }
.canvas-caption { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; color: #8e8d86; font-size: 9px; white-space: nowrap; pointer-events: none; }
.canvas-size { border-radius: 5px; background: rgba(247,245,240,.9); padding: 4px 6px; font: 400 8px var(--font-mono); color: #696b65; }

.canvas-element { position: absolute; cursor: move; transform-origin: center; }
.canvas-element.is-selected::after { content: ""; position: absolute; z-index: 50; inset: -4px; border: 2px solid var(--blue); pointer-events: none; }
.canvas-element.is-selected::before { content: attr(data-label); position: absolute; z-index: 55; left: -4px; bottom: calc(100% + 5px); background: var(--blue); color: white; font: 500 10px var(--font-mono); padding: 3px 5px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.canvas-element .resize-handle { display: none; position: absolute; z-index: 60; right: -8px; bottom: -8px; width: 11px; height: 11px; background: white; border: 2px solid var(--blue); cursor: nwse-resize; }
.canvas-element.is-selected .resize-handle { display: block; }
.canvas-element-content { width: 100%; height: 100%; overflow: hidden; }
.element-heading { display: flex; align-items: center; font-weight: 700; letter-spacing: -.045em; line-height: .98; white-space: pre-line; }
.element-text { line-height: 1.55; white-space: pre-line; }
.element-button { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 650; line-height: 1; }
.element-button::after { content: "↗"; font-size: .9em; }
.element-card { display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; border: 1px solid rgba(30,30,26,.12); box-shadow: 0 12px 35px rgba(40,35,28,.08); }
.element-card small { display: block; margin-bottom: auto; opacity: .6; font: 500 10px var(--font-mono); letter-spacing: .08em; }
.element-card strong { display: block; font-size: 1.15em; }
.element-card span { display: block; margin-top: 7px; opacity: .65; font-size: .7em; line-height: 1.4; }
.element-image { position: relative; background: linear-gradient(145deg, #ddd7cc, #b8ad9d); isolation: isolate; }
.element-image::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.5), transparent 28%), linear-gradient(135deg, transparent 45%, rgba(74,54,35,.23)); }
.element-image::after { content: attr(data-caption); position: absolute; left: 16px; bottom: 14px; color: white; font: 500 9px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 5px rgba(0,0,0,.3); }
.element-input { display: flex; align-items: center; padding: 0 15px; border: 1px solid rgba(30,30,25,.17); color: #898a83; background: rgba(255,255,255,.8); }
.element-badge { display: flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.element-navbar { display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid rgba(30,30,25,.11); }
.element-navbar strong { font-size: 1.08em; letter-spacing: -.03em; }
.element-navbar span { margin-left: auto; font-size: .7em; word-spacing: 13px; opacity: .65; }
.element-stat { padding: 16px 18px; border-left: 2px solid currentColor; display: flex; flex-direction: column; justify-content: center; }
.element-stat strong { font-size: 1.8em; line-height: 1; letter-spacing: -.05em; }
.element-stat span { font-size: .65em; opacity: .6; margin-top: 5px; text-transform: uppercase; letter-spacing: .1em; }
.element-divider { height: 100%; border-top: 1px solid currentColor; opacity: .25; }
.element-link { display: flex; align-items: center; gap: 8px; font-weight: 650; text-decoration: underline; text-underline-offset: 5px; }
.element-link span { color: var(--accent); }
.element-icon { display: grid; place-items: center; }
.element-textarea { position: relative; padding: 14px 16px; border: 1px solid rgba(30,30,25,.17); line-height: 1.45; }
.element-textarea i { position: absolute; right: 7px; bottom: 5px; font: normal 10px var(--font-mono); opacity: .4; }
.element-select { display: flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid rgba(30,30,25,.17); }
.element-select span { flex: 1; }
.element-select b { font-weight: 500; }
.element-date small { margin-left: auto; font: 400 9px var(--font-mono); opacity: .45; }
.element-check { display: flex; align-items: center; gap: 12px; }
.element-check i { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 5px; background: currentColor; color: white; font: normal 12px var(--font-sans); }
.element-radio i { border-radius: 50%; background: transparent; border: 2px solid currentColor; position: relative; }
.element-radio i::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: currentColor; }
.element-switch { display: flex; align-items: center; justify-content: space-between; }
.element-switch > i { width: 46px; height: 26px; padding: 3px; border-radius: 16px; background: currentColor; }
.element-switch > i b { display: block; width: 20px; height: 20px; margin-left: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.element-slider, .element-progress { display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 10px; }
.element-slider > b, .element-progress > b { font: 500 10px var(--font-mono); }
.element-slider > i, .element-progress > i { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: rgba(100,100,95,.18); }
.element-slider > i em, .element-progress > i em { display: block; width: 62%; height: 100%; border-radius: inherit; background: currentColor; position: relative; }
.element-slider > i em::after { content: ""; position: absolute; right: -6px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: currentColor; }
.element-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed rgba(30,30,25,.3); text-align: center; }
.element-upload > b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: currentColor; color: white; }
.element-upload > strong { font-size: .95em; }
.element-upload > span { font-size: .67em; opacity: .55; }
.element-form { display: flex; flex-direction: column; padding: 28px; box-shadow: 0 14px 35px rgba(35,30,25,.08); }
.element-form > small { font: 500 9px var(--font-mono); letter-spacing: .1em; opacity: .55; }
.element-form > strong { margin: 8px 0 18px; font-size: 1.15em; }
.element-form > i { height: 42px; display: flex; align-items: center; margin-bottom: 8px; padding: 0 12px; border: 1px solid rgba(30,30,25,.15); border-radius: max(4px, calc(var(--component-radius, 8px) * .5)); font: normal .55em var(--font-sans); opacity: .65; }
.element-form > b { height: 42px; display: grid; place-items: center; margin-top: auto; border-radius: max(4px, calc(var(--component-radius, 8px) * .5)); background: currentColor; color: white; font-size: .55em; }
.element-list, .element-table, .element-tabs, .element-accordion, .element-chat, .element-chart, .element-menu { padding: 20px; border: 1px solid rgba(30,30,25,.12); box-shadow: 0 10px 28px rgba(35,30,25,.06); }
.element-list > strong, .element-table > strong, .element-accordion > strong, .element-timeline > strong { display: block; margin-bottom: 15px; }
.element-list p { height: 43px; margin: 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(30,30,25,.1); font-size: .65em; }
.element-list p i { opacity: .4; font: normal 8px var(--font-mono); }
.element-list p b { margin-left: auto; }
.element-table > div { display: grid; grid-template-columns: repeat(4,1fr); padding: 8px 0; border-bottom: 1px solid currentColor; font-size: .45em; opacity: .6; }
.element-table p { display: grid; grid-template-columns: repeat(4,1fr); align-items: center; height: 46px; margin: 0; border-bottom: 1px solid rgba(30,30,25,.09); font-size: .55em; }
.element-tabs > div { display: flex; gap: 20px; border-bottom: 1px solid rgba(30,30,25,.12); }
.element-tabs > div b { padding: 0 0 10px; font-size: .7em; opacity: .45; }
.element-tabs > div b.is-active { opacity: 1; border-bottom: 2px solid currentColor; }
.element-tabs p { padding: 14px 3px; margin: 0; font-size: .65em; opacity: .65; }
.element-accordion p, .element-faq p { height: 45px; margin: 0; display: flex; align-items: center; border-top: 1px solid rgba(30,30,25,.12); font-size: .62em; }
.element-accordion p b, .element-faq p b { margin-left: auto; }
.element-timeline { padding: 18px; }
.element-timeline p { height: 56px; margin: 0; display: flex; gap: 13px; position: relative; font-size: .65em; }
.element-timeline p::before { content: ""; position: absolute; left: 5px; top: 15px; bottom: -3px; border-left: 1px solid currentColor; opacity: .2; }
.element-timeline p i { width: 11px; height: 11px; flex: none; border: 2px solid currentColor; border-radius: 50%; background: white; }
.element-timeline p i.is-active { background: currentColor; }
.element-timeline p small { display: block; margin-top: 4px; font: 400 8px var(--font-mono); opacity: .4; }
.element-avatar { display: flex; align-items: center; gap: 12px; }
.element-avatar > i { width: 54px; height: 54px; display: grid; place-items: center; flex: none; border-radius: 50%; background: currentColor; color: white; font: normal 20px var(--font-sans); }
.element-avatar span strong, .element-avatar span small { display: block; }
.element-avatar span small { margin-top: 4px; font-size: .65em; opacity: .55; }
.element-quote { display: flex; flex-direction: column; justify-content: center; padding-left: 55px; position: relative; }
.element-quote i { position: absolute; left: 2px; top: 15px; font: normal 64px/1 Georgia,serif; color: var(--style-accent, currentColor); }
.element-quote strong { line-height: 1.2; letter-spacing: -.03em; }
.element-quote span { margin-top: 16px; font-size: .5em; opacity: .55; }
.element-video, .element-carousel { position: relative; display: flex; align-items: flex-end; padding: 22px; overflow: hidden; background-image: radial-gradient(circle at 68% 25%, rgba(255,255,255,.25), transparent 26%), linear-gradient(145deg, transparent 40%, rgba(0,0,0,.25)); }
.element-video > i { position: absolute; inset: 50% auto auto 50%; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: white; color: #1c1d1a; transform: translate(-50%,-50%); font: normal 14px var(--font-sans); }
.element-video strong, .element-carousel strong { font-size: .85em; }
.element-video span, .element-carousel span { margin-left: auto; font: 400 9px var(--font-mono); }
.element-chat small { font: 500 8px var(--font-mono); opacity: .5; }
.element-chat p { width: 72%; margin: 13px 0; padding: 11px; border-radius: 12px 12px 12px 2px; background: rgba(110,110,105,.1); font-size: .68em; line-height: 1.4; }
.element-chat p.is-user { margin-left: auto; border-radius: 12px 12px 2px 12px; background: currentColor; color: white; }
.element-chat > div { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid rgba(30,30,25,.15); border-radius: 9px; font-size: .6em; opacity: .65; }
.element-chat > div b { margin-left: auto; }
.element-chart { display: flex; flex-direction: column; }
.element-chart > strong { display: flex; justify-content: space-between; font-size: .72em; }
.element-chart > strong b { color: var(--style-accent, currentColor); }
.chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 7%; margin: 22px 10px 8px; border-bottom: 1px solid currentColor; }
.chart-bars i { flex: 1; background: var(--style-accent, currentColor); border-radius: 4px 4px 0 0; opacity: .78; }
.element-chart > small { text-align: center; font: 400 6px var(--font-mono); opacity: .45; }
.element-carousel > i, .element-carousel > b { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: white; color: #1c1d1a; font: normal 13px var(--font-sans); }
.element-carousel > strong { margin-left: 12px; }
.element-carousel > span { margin-left: auto; margin-right: 12px; }
.element-empty, .element-result { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; border: 1px solid rgba(30,30,25,.1); }
.element-empty > i { font: normal 42px var(--font-sans); opacity: .25; }
.element-empty > strong, .element-result > strong { margin-top: 8px; font-size: .8em; }
.element-empty > span, .element-result > p { margin: 7px 0 14px; font-size: .55em; opacity: .55; }
.element-empty > b, .element-result > b { padding: 9px 14px; border-radius: 7px; background: currentColor; color: white; font-size: .5em; }
.element-alert, .element-toast { display: flex; align-items: center; gap: 13px; padding: 0 17px; border: 1px solid rgba(100,75,20,.15); }
.element-alert > i, .element-toast > i { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 50%; background: currentColor; color: white; font: normal 12px var(--font-sans); }
.element-alert span strong, .element-alert span small { display: block; }
.element-alert span small { margin-top: 4px; font-size: .62em; opacity: .6; }
.element-alert > b { margin-left: auto; }
.element-toast { box-shadow: 0 12px 35px rgba(20,20,18,.18); }
.element-toast > span { margin-left: auto; font: 400 8px var(--font-mono); opacity: .5; }
.element-modal { display: flex; flex-direction: column; padding: 28px; box-shadow: 0 22px 60px rgba(20,20,18,.18); }
.element-modal > small { font: 500 8px var(--font-mono); letter-spacing: .1em; opacity: .5; }
.element-modal > strong { margin-top: 13px; }
.element-modal > p { font-size: .55em; line-height: 1.5; opacity: .62; }
.element-modal > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.element-modal > div span, .element-modal > div b { padding: 10px 15px; border: 1px solid rgba(30,30,25,.16); border-radius: 7px; font-size: .5em; }
.element-modal > div b { background: currentColor; color: white; }
.element-progress { padding: 0 8px; }
.element-progress > i em { background: var(--style-accent, currentColor); }
.element-skeleton { padding: 18px; display: grid; grid-template-columns: 70px 1fr; gap: 10px 15px; align-content: center; }
.element-skeleton > i { grid-row: 1 / 4; border-radius: 9px; background: currentColor; opacity: .24; }
.element-skeleton > span { height: 13px; border-radius: 5px; background: currentColor; opacity: .2; }
.element-skeleton > span:nth-of-type(2) { width: 75%; }
.element-skeleton > span:nth-of-type(3) { width: 48%; }
.element-spinner { display: grid; place-items: center; }
.element-spinner i { width: 48px; height: 48px; border: 5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
.element-result > i { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 50%; background: var(--style-accent, #63a953); color: white; font: normal 24px var(--font-sans); }
.element-menu strong { display: block; padding: 5px 8px 14px; }
.element-menu p { display: flex; align-items: center; gap: 10px; margin: 3px 0; padding: 10px; border-radius: 7px; font-size: .65em; }
.element-menu p.is-active { background: currentColor; color: white; }
.element-menu p i { font: normal 9px var(--font-mono); }
.element-breadcrumb, .element-pagination { display: flex; align-items: center; word-spacing: 9px; }
.element-pagination { justify-content: center; border: 1px solid rgba(30,30,25,.12); }
.element-steps { display: flex; flex-direction: column; justify-content: center; position: relative; }
.element-steps small { font: 400 8px var(--font-mono); opacity: .5; }
.element-steps strong { margin-top: 10px; font-size: .75em; word-spacing: 14px; }
.element-steps i { position: absolute; left: 0; bottom: 5px; width: 55%; border-bottom: 3px solid var(--style-accent, currentColor); }
.element-hero { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 55px; overflow: hidden; }
.element-hero > small { font: 500 8px var(--font-mono); letter-spacing: .12em; }
.element-hero > strong { width: 70%; font-size: 1em; line-height: 1.02; letter-spacing: -.05em; }
.element-hero > p { width: 55%; margin: 16px 0 23px; font-size: .3em; line-height: 1.5; opacity: .62; }
.element-hero > b { width: fit-content; padding: 12px 16px; border-radius: 8px; background: currentColor; color: white; font-size: .25em; }
.element-hero > i { position: absolute; width: 210px; height: 210px; right: 55px; top: 50%; border-radius: 50%; background: var(--style-accent, #ed5a36); transform: translateY(-50%); opacity: .9; }
.element-pricing { padding: 34px; }
.element-pricing > strong { font-size: 1em; }
.element-pricing > p { margin: 6px 0 22px; font-size: .38em; opacity: .55; }
.element-pricing > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.element-pricing > div i { min-height: 195px; display: flex; flex-direction: column; padding: 18px; border: 1px solid rgba(30,30,25,.12); border-radius: max(5px, calc(var(--component-radius, 10px) * .65)); font-style: normal; }
.element-pricing > div i.is-featured { background: var(--style-accent, currentColor); color: var(--style-accent-text, white); }
.element-pricing i small { font: 500 8px var(--font-mono); }
.element-pricing i b { margin-top: 20px; font-size: .9em; }
.element-pricing i span { font-size: .28em; opacity: .65; }
.element-faq { padding: 30px; }
.element-faq > strong { display: block; margin-bottom: 20px; font-size: 1em; }
.element-social { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.element-social > strong { font-size: 1em; }
.element-social p { display: flex; gap: 35px; margin-top: 24px; }
.element-social p b { font: 600 10px var(--font-mono); letter-spacing: .1em; opacity: .5; }
.element-footer { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 18px; padding: 45px; }
.element-footer > strong { font-size: .9em; }
.element-footer > p { margin: 0; text-align: right; font-size: .45em; line-height: 2; opacity: .65; }
.element-footer > i { grid-column: 1 / -1; padding-top: 25px; border-top: 1px solid currentColor; font: normal 8px var(--font-mono); opacity: .45; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Scene-level style treatments */
.artboard, .preview-artboard { --style-accent: #ed5a36; --style-accent-text: #fff; --component-radius: 18px; }
.artboard[data-style="glass"], .preview-artboard[data-style="glass"] { background-image: radial-gradient(circle at 18% 20%, #4c78a8 0, transparent 34%), radial-gradient(circle at 85% 70%, #6f4d9e 0, transparent 35%); }
.artboard[data-style="glass"] .element-card, .artboard[data-style="glass"] .element-form, .artboard[data-style="glass"] .element-list, .artboard[data-style="glass"] .element-modal, .preview-artboard[data-style="glass"] .element-card, .preview-artboard[data-style="glass"] .element-form { background-color: rgba(255,255,255,.13) !important; border-color: rgba(255,255,255,.25); backdrop-filter: blur(18px); box-shadow: inset 0 1px rgba(255,255,255,.28), 0 15px 35px rgba(0,0,0,.15); }
.artboard[data-style="brutalism"] .canvas-element-content, .preview-artboard[data-style="brutalism"] .canvas-element-content { border-width: 3px; border-color: #111; box-shadow: 7px 7px 0 #111; }
.artboard[data-style="brutalism"] .element-heading, .artboard[data-style="brutalism"] .element-text, .artboard[data-style="brutalism"] .element-divider, .preview-artboard[data-style="brutalism"] .element-heading, .preview-artboard[data-style="brutalism"] .element-text { box-shadow: none; border: 0; }
.artboard[data-style="swiss"] .element-heading, .preview-artboard[data-style="swiss"] .element-heading { text-transform: uppercase; letter-spacing: -.065em; }
.artboard[data-style="editorial"] .element-heading, .artboard[data-style="editorial"] .element-quote strong, .preview-artboard[data-style="editorial"] .element-heading { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.artboard[data-style="apple"] .element-heading, .preview-artboard[data-style="apple"] .element-heading { font-weight: 600; letter-spacing: -.06em; }
.artboard[data-style="skeuo"] .canvas-element-content, .preview-artboard[data-style="skeuo"] .canvas-element-content { box-shadow: inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 5px rgba(80,55,30,.15), 0 5px 12px rgba(80,55,30,.18); }
.artboard[data-style="flat"] .canvas-element-content, .preview-artboard[data-style="flat"] .canvas-element-content { box-shadow: none; }
.artboard[data-style="material"] .element-card, .artboard[data-style="material"] .element-modal, .artboard[data-style="material"] .element-form, .preview-artboard[data-style="material"] .element-card { box-shadow: 0 4px 9px rgba(45,35,65,.2); }
.artboard[data-style="neumorphism"] .canvas-element-content, .preview-artboard[data-style="neumorphism"] .canvas-element-content { border: 0; box-shadow: 9px 9px 18px #c4c8ce, -9px -9px 18px #fff; }
.artboard[data-style="dark"] .canvas-element-content, .artboard[data-style="terminal"] .canvas-element-content, .artboard[data-style="deco"] .canvas-element-content { border-color: rgba(255,255,255,.15); }
.artboard[data-style="terminal"], .preview-artboard[data-style="terminal"] { font-family: var(--font-mono); background-image: linear-gradient(rgba(118,255,120,.035) 1px, transparent 1px); background-size: 100% 5px; }
.artboard[data-style="terminal"] .canvas-element-content, .preview-artboard[data-style="terminal"] .canvas-element-content { font-family: var(--font-mono); box-shadow: none; border-radius: 0 !important; }
.artboard[data-style="wabi"], .preview-artboard[data-style="wabi"] { background-image: radial-gradient(rgba(80,65,45,.08) .6px, transparent .8px); background-size: 5px 5px; }
.artboard[data-style="wabi"] .element-heading, .artboard[data-style="wabi"] .element-quote, .preview-artboard[data-style="wabi"] .element-heading { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.artboard[data-style="memphis"], .preview-artboard[data-style="memphis"] { background-image: radial-gradient(#ff5b55 2px, transparent 2px), linear-gradient(35deg, transparent 47%, rgba(40,40,35,.07) 48%, rgba(40,40,35,.07) 52%, transparent 53%); background-size: 38px 38px, 70px 70px; }
.artboard[data-style="bauhaus"] .element-image, .artboard[data-style="bauhaus"] .element-hero > i, .preview-artboard[data-style="bauhaus"] .element-image { border-radius: 50% !important; }
.artboard[data-style="deco"], .preview-artboard[data-style="deco"] { background-image: linear-gradient(45deg, transparent 48%, rgba(198,164,91,.08) 49%, rgba(198,164,91,.08) 51%, transparent 52%); background-size: 42px 42px; }
.artboard[data-style="deco"] .canvas-element-content, .preview-artboard[data-style="deco"] .canvas-element-content { border-color: #c6a45b; }
.artboard[data-style="deco"] .element-heading, .artboard[data-style="deco"] .element-hero > strong, .preview-artboard[data-style="deco"] .element-heading { font-family: Georgia, "Times New Roman", serif; text-transform: uppercase; letter-spacing: .02em; }

.inspector-header { height: 76px; flex: 0 0 76px; padding: 17px 18px; border-bottom: 1px solid var(--soft-line); display: flex; justify-content: space-between; align-items: center; }
.eyebrow { display: block; color: var(--accent); font: 500 8px var(--font-mono); letter-spacing: .15em; margin-bottom: 4px; }
.inspector-header h2, .modal-header h2 { font-size: 14px; margin: 0; letter-spacing: -.02em; }
.inspector-scroll { padding: 17px 18px 40px; }
.inspector-footer { height: 38px; flex: 0 0 38px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--soft-line); color: #9b9b94; font-size: 9px; }
kbd { font: 400 8px var(--font-mono); }
.property-group { margin-bottom: 21px; }
.property-group__title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #8b8c85; font: 500 8px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.property-group__title span:last-child { color: #b1b0a9; letter-spacing: 0; }
.field { display: block; margin-bottom: 9px; }
.field > span { display: block; color: #686a63; font-size: 9px; font-weight: 600; margin: 0 0 5px 2px; }
.field input:not([type="color"]):not([type="range"]), .field textarea, .field select { width: 100%; border: 1px solid #dddbd4; background: white; border-radius: 7px; color: var(--ink); padding: 8px 9px; font-size: 10px; outline: none; }
.field textarea { min-height: 65px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #999b93; box-shadow: 0 0 0 3px rgba(80,108,255,.08); }
.inspector-style-button { width: 100%; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid #dddbd4; border-radius: 8px; background: white; cursor: pointer; text-align: left; }
.inspector-style-button > i { width: 24px; height: 24px; border-radius: 6px; }
.inspector-style-button > span strong, .inspector-style-button > span small { display: block; }
.inspector-style-button > span strong { font-size: 9px; }
.inspector-style-button > span small { margin-top: 2px; color: #9a9b94; font: 400 7px var(--font-mono); text-transform: uppercase; }
.inspector-style-button > b { color: var(--accent); font-size: 8px; }
.snap-settings { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 9px; border: 1px solid #dddbd4; border-radius: 8px; background: white; }
.snap-settings strong, .snap-settings small { display: block; }
.snap-settings strong { font-size: 9px; }
.snap-settings small { margin-top: 3px; color: #96978f; font-size: 8px; }
.snap-toggle { width: 35px; height: 20px; padding: 3px; border: 0; border-radius: 12px; background: #d4d3cd; cursor: pointer; transition: background .15s; }
.snap-toggle i { display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .15s; }
.snap-toggle.is-active { background: var(--blue); }
.snap-toggle.is-active i { transform: translateX(15px); }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.number-input { position: relative; }
.number-input em { position: absolute; left: 8px; bottom: 9px; color: #aaa8a0; font: normal 8px var(--font-mono); pointer-events: none; }
.number-input input { padding-left: 23px !important; }
.color-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: white; border: 1px solid #dddbd4; border-radius: 7px; }
.color-row input[type="color"] { width: 23px; height: 23px; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: transparent; cursor: pointer; }
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-row code { font: 400 9px var(--font-mono); color: #686a63; }
.range-row { display: grid; grid-template-columns: 1fr 34px; gap: 8px; align-items: center; }
.range-row input { accent-color: var(--ink); }
.range-row output { font: 400 9px var(--font-mono); color: #777871; text-align: right; }
.relation-card { position: relative; padding: 11px; border-radius: 9px; background: #efede8; border: 1px solid #e0ded7; }
.relation-card::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px; background: var(--accent); }
.relation-card strong { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.relation-card strong svg { width: 13px; color: var(--accent); }
.relation-card p { color: #898a83; font-size: 9px; margin: 6px 0 0; line-height: 1.5; }
.danger-button { width: 100%; height: 34px; border: 1px solid #eccbc3; color: #c64e32; background: #fff8f6; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 600; }
.danger-button:hover { background: #fcede9; }
.relation-add-button { margin-bottom: 10px; color: #3f5140; border-color: #ccd9c6; background: #f4faf1; }
.relation-add-button:hover { background: #eaf5e5; }
.relation-card--list { margin-top: 8px; padding-right: 32px; }
.relation-card--list button { position: absolute; right: 7px; top: 7px; width: 20px; height: 20px; border: 0; background: transparent; color: #9b9b94; cursor: pointer; }
.empty-note { margin: 8px 2px 0; color: #9a9b94; font-size: 9px; line-height: 1.55; }
.inline-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.inline-actions button { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: white; cursor: pointer; font-size: 10px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.inline-actions svg { width: 13px; }

.flow-view { width: 100%; height: 100%; overflow: auto; padding: 82px 6vw 70px; background: #20211e; color: #f7f5ef; }
.flow-hero { display: grid; grid-template-columns: 1.4fr .8fr; align-items: end; gap: 40px; max-width: 1100px; margin: 0 auto 70px; }
.flow-hero h1 { font-size: clamp(28px, 3.2vw, 48px); line-height: 1.08; letter-spacing: -.055em; margin: 10px 0 0; }
.flow-hero p { max-width: 390px; color: #a7a9a1; line-height: 1.7; font-size: 11px; margin: 0; }
.flow-board { min-height: 360px; max-width: 1100px; margin: 0 auto; position: relative; }
.flow-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flow-line { fill: none; stroke: #70736c; stroke-width: 1.5; stroke-dasharray: 4 5; }
.flow-line-dot { fill: var(--lime); stroke: #20211e; stroke-width: 3; }
.flow-cards { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(190px,1fr)); gap: 70px; align-items: start; }
.flow-scene-card { border: 1px solid #4a4c46; background: #2b2c28; border-radius: 14px; padding: 8px; cursor: pointer; transition: transform .18s, border-color .18s; }
.flow-scene-card:hover { transform: translateY(-5px); border-color: #777a71; }
.flow-scene-card.is-orphan { margin-top: 90px; }
.flow-scene-preview { aspect-ratio: 1.5; border-radius: 9px; overflow: hidden; padding: 12px; color: #20211e; position: relative; }
.flow-scene-preview::after { content: ""; position: absolute; width: 40%; right: 10px; top: 10px; bottom: 10px; border-radius: 6px; background: var(--scene-accent, var(--accent)); opacity: .88; }
.flow-scene-preview i, .flow-scene-preview b { display: block; border-radius: 2px; background: currentColor; position: relative; z-index: 1; }
.flow-scene-preview i { width: 38%; height: 7px; margin-top: 18%; }
.flow-scene-preview b { width: 28%; height: 3px; margin-top: 8px; opacity: .3; box-shadow: 0 6px currentColor; }
.flow-scene-info { display: flex; justify-content: space-between; align-items: flex-end; padding: 12px 6px 6px; }
.flow-scene-info strong { display: block; font-size: 12px; }
.flow-scene-info span { display: block; color: #8d8f88; font: 400 8px var(--font-mono); margin-top: 4px; }
.flow-scene-info em { font: normal 9px var(--font-mono); color: var(--lime); }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(25,25,22,.58); backdrop-filter: blur(8px); animation: fade-in .2s ease; }
.modal-backdrop[hidden] { display: none; }
.style-modal { width: min(1040px, 100%); height: min(820px, calc(100vh - 56px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #f8f7f3; box-shadow: 0 30px 100px rgba(0,0,0,.3); animation: modal-in .32s cubic-bezier(.2,.8,.2,1); }
.style-modal-header { align-items: center; }
.style-modal-header h2 { font-size: 21px; }
.style-modal-header p { margin: 6px 0 0; color: #85877f; font-size: 9px; }
.style-modal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 24px; border-bottom: 1px solid var(--soft-line); background: white; }
.style-search { width: min(400px, 50%); margin: 0; }
.scope-switch { display: flex; padding: 3px; border-radius: 8px; background: #efede8; }
.scope-switch button { border: 0; border-radius: 6px; background: transparent; padding: 7px 11px; color: #85877f; font-size: 9px; cursor: pointer; }
.scope-switch button.is-active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.style-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); align-content: start; gap: 10px; padding: 18px 24px 26px; scrollbar-width: thin; scrollbar-color: #c9c6be transparent; }
.style-option { min-width: 0; display: flex; flex-direction: column; padding: 7px; border: 1px solid var(--soft-line); border-radius: 12px; background: white; cursor: pointer; text-align: left; transition: transform .15s, border-color .15s, box-shadow .15s; }
.style-option:hover { transform: translateY(-2px); border-color: #aaa9a2; box-shadow: 0 8px 22px rgba(35,32,27,.08); }
.style-option.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.style-option-preview { height: 98px; position: relative; overflow: hidden; border-radius: 8px; background: var(--preview-bg); color: var(--preview-text); border: 1px solid rgba(30,30,25,.1); }
.style-option-preview::before { content: "Aa"; position: absolute; left: 12px; top: 12px; font-size: 27px; font-weight: 700; letter-spacing: -.08em; }
.style-option-preview::after { content: ""; position: absolute; left: 12px; bottom: 13px; width: 58px; height: 25px; border-radius: var(--preview-radius); background: var(--preview-accent); box-shadow: var(--preview-shadow, none); }
.style-option-preview i { position: absolute; width: 66px; right: 9px; top: 10px; bottom: 9px; border-radius: var(--preview-radius); background: var(--preview-surface); border: 1px solid rgba(30,30,25,.1); }
.style-option-preview i::before, .style-option-preview i::after { content: ""; position: absolute; left: 9px; right: 9px; height: 4px; border-radius: 2px; background: var(--preview-text); opacity: .72; }
.style-option-preview i::before { top: 14px; }
.style-option-preview i::after { top: 24px; right: 24px; opacity: .25; }
.style-option-preview[data-preview="glass"] { background-image: radial-gradient(circle at 18% 15%, #667fb8, transparent 43%), radial-gradient(circle at 80% 80%, #764b91, transparent 45%); }
.style-option-preview[data-preview="terminal"] { font-family: var(--font-mono); }
.style-option-preview[data-preview="brutalism"]::after { border: 2px solid #111; box-shadow: 4px 4px 0 #111; }
.style-option-copy { padding: 10px 5px 6px; }
.style-option-copy strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.style-option-copy strong i { display: none; width: 15px; height: 15px; place-items: center; border-radius: 50%; background: var(--accent); color: white; font: normal 8px var(--font-sans); }
.style-option.is-active .style-option-copy strong i { display: grid; }
.style-option-copy small { display: block; margin-top: 3px; color: #9a9b94; font: 400 7px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.style-option-copy p { height: 30px; margin: 7px 0 0; color: #73756e; font-size: 8px; line-height: 1.5; }
.style-modal-footer { height: 49px; flex: 0 0 49px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-top: 1px solid var(--soft-line); background: white; color: #8c8d86; font-size: 8px; }
.style-modal-footer p { margin: 0; }
.style-modal-footer span { display: flex; align-items: center; gap: 8px; }
.style-modal-footer .status-pulse { width: 6px; height: 6px; }
.prompt-modal { width: min(880px, 100%); max-height: min(780px, calc(100vh - 56px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #f8f7f3; box-shadow: 0 30px 100px rgba(0,0,0,.28); animation: modal-in .32s cubic-bezier(.2,.8,.2,1); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 19px; }
.prompt-summary { display: grid; grid-template-columns: repeat(3, 100px) 1fr; gap: 10px; align-items: center; padding: 15px 24px; background: white; border-bottom: 1px solid var(--soft-line); }
.prompt-summary > div { display: flex; align-items: baseline; gap: 6px; }
.prompt-summary strong { font-size: 18px; letter-spacing: -.04em; }
.prompt-summary span { color: #96978f; font: 400 8px var(--font-mono); text-transform: uppercase; }
.prompt-summary p { justify-self: end; margin: 0; color: #5d5f58; font-size: 9px; }
.status-pulse { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #78b45e; box-shadow: 0 0 0 4px rgba(120,180,94,.13); }
.format-tabs { display: flex; gap: 4px; padding: 13px 24px 0; }
.format-tabs button { display: flex; align-items: center; gap: 7px; border: 0; border-radius: 8px 8px 0 0; background: transparent; padding: 9px 13px; color: #8b8c85; font-size: 10px; font-weight: 650; cursor: pointer; }
.format-tabs button svg { width: 14px; height: 14px; }
.format-tabs button.is-active { background: #242521; color: white; }
.code-wrap { min-height: 230px; flex: 1; margin: 0 24px; overflow: hidden; display: flex; flex-direction: column; background: #242521; color: #dcded5; border-radius: 0 10px 10px 10px; }
.code-meta { height: 32px; flex: 0 0 32px; display: flex; justify-content: space-between; align-items: center; padding: 0 13px; border-bottom: 1px solid #3c3e38; color: #898c82; font: 400 8px var(--font-mono); }
.code-wrap pre { margin: 0; padding: 15px 17px 24px; overflow: auto; white-space: pre-wrap; font: 400 10px/1.7 var(--font-mono); scrollbar-width: thin; scrollbar-color: #51534d transparent; }
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 24px 20px; }
.modal-footer p { max-width: 340px; color: #888981; font-size: 9px; line-height: 1.5; margin: 0; }
.modal-footer > div { display: flex; gap: 8px; }

.preview-backdrop { padding: 18px; background: rgba(18,19,17,.88); }
.preview-modal { width: 100%; height: 100%; background: #11120f; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.preview-topbar { height: 55px; flex: 0 0 55px; padding: 0 13px 0 18px; color: white; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid #2d2f2a; }
.preview-brand { font: 500 8px var(--font-mono); letter-spacing: .12em; display: flex; align-items: center; gap: 10px; }
.preview-scene-tabs { display: flex; background: #242521; border-radius: 8px; padding: 3px; }
.preview-scene-tabs button { border: 0; background: transparent; color: #868980; padding: 7px 12px; border-radius: 6px; font-size: 9px; cursor: pointer; }
.preview-scene-tabs button.is-active { background: #3b3d37; color: white; }
.preview-topbar .icon-button { justify-self: end; }
.preview-viewport { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 30px; background-image: radial-gradient(#292a26 1px, transparent 1px); background-size: 18px 18px; }
.preview-artboard { position: relative; width: 1440px; height: 900px; transform-origin: center; overflow: hidden; box-shadow: 0 20px 80px rgba(0,0,0,.4); }
.preview-artboard .canvas-element { pointer-events: auto; cursor: default; }
.preview-artboard .canvas-element[data-target] { cursor: pointer; }

.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 190px; padding: 11px 14px; border-radius: 9px; background: #22231f; color: white; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .25s ease both; }
.toast svg { width: 14px; color: var(--lime); }
.toast.is-leaving { animation: toast-out .2s ease both; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  :root { --sidebar-left: 224px; --sidebar-right: 270px; }
  .brand-name { font-size: 12px; }
  .component-tile { height: 66px; }
  .compact-hide { display: none; }
}

@media (max-width: 940px) {
  :root { --sidebar-left: 0px; --sidebar-right: 0px; }
  .topbar { grid-template-columns: 150px 1fr auto; }
  .brand { border-right: 0; padding-left: 14px; }
  .library-panel, .inspector-panel { position: fixed; z-index: 50; top: var(--topbar-height); bottom: 0; width: 270px; box-shadow: 0 15px 50px rgba(30,28,24,.18); transition: transform .25s ease; }
  .library-panel { left: 0; transform: translateX(-105%); }
  .library-panel.is-open { transform: translateX(0); }
  .inspector-panel { right: 0; width: 296px; transform: translateX(105%); }
  .inspector-panel.is-open { transform: translateX(0); }
  .mobile-only, .mobile-close { display: inline-flex; }
  .project-heading { padding-left: 8px; }
  .project-title-input { max-width: 250px; }
  .flow-cards { gap: 35px; }
  .style-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .studio.is-flow-mode { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .studio.is-flow-mode .library-panel { display: none; }
}

@media (max-width: 680px) {
  .topbar { grid-template-columns: 44px minmax(0,1fr) auto; height: 60px; --topbar-height: 60px; }
  .brand { padding: 0 8px; }
  .brand-name { display: none; }
  .brand-mark { transform: scale(.82); }
  .project-heading { padding-left: 0; }
  .project-title-input { width: 150px; font-size: 11px; }
  .project-kicker { display: none; }
  .view-switch { display: none; }
  .topbar-actions { gap: 3px; padding-right: 6px; }
  .button--primary kbd { display: none; }
  .button--primary { padding: 0 10px; }
  .button--primary .spark { display: none; }
  .workspace-toolbar { left: 8px; right: 8px; }
  .scene-breadcrumb { display: none; }
  .canvas-tools { margin-left: auto; }
  .canvas-viewport { padding-left: 26px; padding-right: 26px; }
  .canvas-caption span:last-child { display: none; }
  .flow-view { padding: 75px 24px 60px; }
  .flow-hero { grid-template-columns: 1fr; gap: 20px; margin-bottom: 45px; }
  .flow-cards { grid-template-columns: 1fr; }
  .flow-scene-card.is-orphan { margin-top: 0; }
  .prompt-modal { max-height: calc(100vh - 24px); }
  .style-modal { height: calc(100vh - 24px); }
  .style-modal-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .style-search { width: 100%; }
  .style-grid { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 13px; }
  .style-modal-footer p { display: none; }
  .modal-backdrop { padding: 12px; }
  .prompt-summary { grid-template-columns: repeat(3, 1fr); }
  .prompt-summary p { display: none; }
  .modal-footer { align-items: stretch; flex-direction: column; }
  .modal-footer p { display: none; }
  .modal-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .preview-backdrop { padding: 0; }
  .preview-modal { border-radius: 0; }
  .preview-brand { display: none; }
  .preview-topbar { grid-template-columns: 1fr auto; }
  .preview-scene-tabs { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
