.ve-workspace{height:calc(100dvh - var(--top-h));display:flex;flex-direction:column;min-width:720px}.ve-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;flex-shrink:0;border-bottom:1px solid var(--line,#34414b);background:var(--bg-2,#151e27)}.ve-title{display:flex;flex-direction:column;gap:3px;flex:1;min-width:100px}.ve-title strong{max-width:230px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ve-title span{font-size:11px;color:var(--muted,#9aa7af)}.ve-editor{display:flex;flex:1;min-height:0;overflow:hidden}.ve-drawer{width:294px;flex-shrink:0;overflow-y:auto;padding:17px;background:var(--bg-2,#151e27);border-right:1px solid var(--line,#34414b)}.ve-drawer.ve-closed{display:none}.ve-panel-head{display:flex;align-items:center;justify-content:space-between}.ve-panel-head h3{margin:0 0 15px}.ve-drawer label{display:block;margin-bottom:12px}.ve-drawer input:not([type=file]):not([type=range]):not([type=checkbox]),.ve-drawer select,.ve-drawer textarea{width:100%;min-width:0;background:var(--bg,#101820);color:inherit;border:1px solid var(--line,#34414b);border-radius:6px;padding:8px}.ve-drawer .lb{display:block;font-size:11px;margin-bottom:5px;color:var(--muted,#9aa7af)}.ve-row{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0;align-items:flex-start}.ve-row>label{flex:1;min-width:0}.ve-row .btn{white-space:nowrap}.ve-narration{font-size:12px;line-height:1.8;padding-left:10px;border-left:2px solid #75a89c;color:var(--muted,#9aa7af)}.ve-image-drop{height:150px;background:var(--bg,#101820);border:1px dashed #73837b;border-radius:10px;display:flex;align-items:center;justify-content:center;overflow:hidden}.ve-image-drop img{width:100%;height:100%;object-fit:contain}.ve-image-drop>span{text-align:center;line-height:1.8;color:var(--muted,#9aa7af)}.ve-image-drop.dragover{outline:2px solid #75a89c}.ve-upload-label{margin:0!important;cursor:pointer}.ve-role-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:15px 0}.ve-role-upload{padding:8px;border:1px solid var(--line,#34414b);border-radius:7px;font-size:11px;text-align:center;cursor:pointer;margin:0!important}.ve-role-upload input{display:block;width:100%;font-size:9px;margin-top:7px}.ve-drawer form{padding-top:15px;margin-top:15px;border-top:1px solid var(--line,#34414b)}.ve-frame-wrap{flex:1;min-width:0;background:#202522;position:relative}.ve-studio-frame{display:block;width:100%;height:100%;border:0;background:#f5f5f0}.ve-statusbar{display:flex;justify-content:space-between;gap:12px;padding:7px 15px;font-size:10px;color:var(--muted,#9aa7af);border-top:1px solid var(--line,#34414b)}.ve-error{color:#e47f72!important}.ve-section{margin:17px 0;padding-top:13px;border-top:1px solid var(--line,#34414b)}.ve-section summary{font-size:12px;cursor:pointer;margin-bottom:12px}.ve-library{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:55vh;overflow:auto;margin-top:15px}.ve-library-item{border:1px solid var(--line,#34414b);border-radius:8px;padding:6px;background:transparent;color:inherit;cursor:pointer;text-align:left}.ve-library-item img{width:100%;height:110px;object-fit:cover;border-radius:5px}.ve-library-item span{display:block;font-size:11px;padding:6px 1px}.ve-history,.ve-export-list{max-height:50vh;overflow:auto}.ve-history>div,.ve-export-list>div{display:flex;gap:15px;justify-content:space-between;padding:12px 0;border-bottom:1px solid var(--line,#34414b);align-items:center;flex-wrap:wrap}.ve-history small{display:block;color:var(--muted,#9aa7af);margin-top:6px}.ve-export-list{margin-top:18px}.ve-drawer input[type=range]{width:100%;accent-color:#75a89c}@media(max-width:1050px){.ve-toolbar{gap:5px}.ve-title strong{max-width:150px}.ve-drawer{width:255px}}
#main:has(.ve-workspace){padding:0;overflow:hidden}#main .ve-workspace{height:calc(100dvh - var(--top-h))}#main .ve-workspace.ve-focused{position:fixed;inset:var(--titlebar-h,0px) 0 0;z-index:90;height:calc(100dvh - var(--titlebar-h,0px))}

.ve-drawer input[type=checkbox]{width:auto;accent-color:#75a89c;margin-right:7px}.ve-drawer .g2f{display:grid;grid-template-columns:1fr 1fr;gap:8px}

.ve-production{padding:12px;border:1px solid #6e9d90;border-radius:10px;background:color-mix(in srgb,var(--bg-2) 92%,#69a18c)}.ve-production summary{font-weight:700}.ve-generation-progress strong{display:block;font-size:12px;line-height:1.6}.ve-generated-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:10px 0}.ve-generated-card{padding:0;border:1px solid var(--line);background:var(--bg);color:inherit;border-radius:7px;overflow:hidden;text-align:left;cursor:pointer}.ve-generated-card img{width:100%;height:76px;object-fit:cover}.ve-generated-card small{display:block;padding:4px 6px;font-size:10px}.ve-generation-placeholder{display:flex;height:76px;align-items:center;justify-content:center;font-size:11px;color:var(--muted)}.ve-generation-fields label:has(input[type=checkbox]){font-size:12px;line-height:1.7}

/* Image project creation and library */
.ve-home {
  max-width: 1120px;
  container: image-projects / inline-size;
}
.ve-home :is(input[type=text], input[type=number], input[type=search], select, textarea):focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  box-shadow: none;
}
.ve-home-head { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; }
.ve-home-head h1 { margin: 0; font-size: 27px; font-weight: 720; line-height: 1.25; }
.ve-home-head p { margin: 4px 0 0; color: var(--muted); }
.ve-tile-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.ve-home-head .ve-tile-icon { width: 46px; height: 46px; border-radius: 13px; }
.ve-home-head .ic { width: 21px; height: 21px; }
.ve-home-nav {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 17px;
  border-bottom: 1px solid var(--line);
}
.ve-home-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
}
.ve-home-nav a:hover { color: var(--accent); }
.ve-home-nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.ve-home-nav .ve-story-link { margin-left: auto; padding-right: 0; }
.ve-home .ic { pointer-events: none; }
.ve-home-nav .ic, .ve-create .ic, .ve-project .ic { width: 16px; height: 16px; }
.ve-runtime-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--warn);
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn-ink);
}
.ve-runtime-notice p { margin: 2px 0 0; overflow-wrap: anywhere; }
.ve-surface { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.ve-composer {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  align-items: start;
  gap: 18px;
}
.ve-create { min-width: 0; margin: 0; padding: 20px 22px; }
.ve-create h2, .ve-library-head h2 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; }
.ve-create fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.ve-create .ve-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 14px 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-3);
}
.ve-modes label { position: relative; cursor: pointer; }
.ve-modes input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.ve-modes label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}
.ve-modes label:hover > span { color: var(--accent); }
.ve-modes input:checked + span { border-color: var(--line-2); background: var(--bg-2); color: var(--accent); }
.ve-modes input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.ve-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ve-field-head label { font-weight: 650; }
.ve-field-head > span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ve-field-head > span.bad { color: var(--cut); }
.ve-source textarea {
  display: block;
  min-height: 118px;
  padding: 11px 12px;
  border-color: var(--line-2);
  background: var(--bg-1);
  line-height: 1.65;
}
.ve-source textarea::placeholder { color: var(--dim); opacity: 1; }
.ve-source p, .ve-setup { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.ve-create-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(78px, .65fr); gap: 12px; margin-top: 16px; }
.ve-create-fields:has(> label[hidden]) { grid-template-columns: minmax(0, 1fr) minmax(78px, .65fr); }
.ve-create-fields label { min-width: 0; }
.ve-create .lb { font-weight: 550; }
.ve-create input:not([type=checkbox]):not([type=radio]), .ve-create select { min-height: 38px; }
.ve-create-auto {
  margin-top: 17px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.ve-auto-line, .ve-auto-toggle { display: flex; align-items: center; gap: 8px; }
.ve-auto-line { flex-wrap: wrap; justify-content: space-between; }
.ve-auto-line > a, .ve-budget { font-size: 12px; }
.ve-auto-toggle { font-weight: 630; cursor: pointer; }
.ve-auto-toggle:has(input:disabled) { color: var(--muted); cursor: default; }
.ve-auto-toggle input { width: 16px; height: 16px; margin: 0; }
.ve-budget { color: var(--muted); }
.ve-budget b { color: var(--ink); }
.ve-create-auto summary { width: fit-content; margin-top: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.ve-create-auto details[open] fieldset { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.ve-create-auto fieldset p { margin: 0 0 10px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ve-create-auto fieldset label { display: block; }
.ve-create-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 13px; margin-top: 14px; }
.ve-home .btn { justify-content: center; min-height: 38px; font-weight: 650; }
.ve-home .btn.primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent-2), black 13%); color: white; }
.ve-create-footer .btn { padding: 9px 15px; gap: 10px; }
#veCreateStatus { margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
#veCreateStatus.bad { color: var(--cut); }

.ve-create-aside { display: grid; gap: 12px; min-width: 0; }
.ve-preview {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #3b3958;
  border-radius: 16px;
  background: #1d1c30;
  color: #f3f1ff;
}
.ve-preview figcaption, .ve-preview figcaption > span:first-child { display: flex; align-items: center; gap: 8px; }
.ve-preview figcaption { justify-content: space-between; font-weight: 650; }
.ve-preview figcaption .ic { width: 16px; height: 16px; color: #c6bdfd; }
#vePreviewAspect {
  padding: 2px 8px;
  border: 1px solid #555071;
  border-radius: 6px;
  color: #e0dcff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ve-preview-stage {
  display: grid;
  place-items: center;
  height: 248px;
  min-width: 0;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid #4b4668;
  border-radius: 11px;
  background: radial-gradient(circle, #8378ad70 1px, transparent 1px) 0 0 / 13px 13px,
              radial-gradient(ellipse at 50% 45%, #413b63, #28263e 75%);
}
.ve-preview-frame {
  position: relative;
  width: min(100%, 126px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid #b9adff;
  border-radius: 5px;
  box-shadow: 0 5px 20px #110f28;
}
.ve-preview-frame[data-aspect="16:9"] { width: min(100%, 398px); aspect-ratio: 16 / 9; }
.ve-preview-frame[data-aspect="1:1"] { width: min(100%, 224px); aspect-ratio: 1; }
.ve-preview-frame img { display: block; position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 68% center; }
.ve-preview-mark {
  position: absolute;
  inset: 8%;
  border: 1px dashed #fff9;
  border-radius: 2px;
}
.ve-preview p { margin: 0; font-size: 11.5px; color: #d2cde9; }
.ve-sample { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; }
.ve-sample .ve-tile-icon { width: 34px; height: 34px; border-radius: 9px; }
.ve-sample h3 { margin: 0; font-size: 13px; }
.ve-sample p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.ve-sample .btn { padding: 6px 10px; font-size: 12px; }

.ve-library-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.ve-count { margin-left: 3px; color: var(--dim); font-size: 13px; font-weight: 600; }
.ve-project-search { position: relative; width: min(100%, 252px); }
.ve-project-search .ic { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.ve-project-search input { padding-left: 33px; background: var(--bg-1); }
.ve-projects { padding: 0; margin: 0; list-style: none; }
.ve-project {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.ve-projects li:last-child .ve-project { border-radius: 0 0 15px 15px; }
.ve-project:hover { background: var(--accent-soft); color: var(--ink); }
.ve-project:focus-visible { outline-offset: -3px; }
.ve-project-info { display: grid; min-width: 0; }
.ve-project-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-project small, .ve-project > .ic { color: var(--muted); }
.ve-project-meta { display: grid; text-align: right; }
.ve-project-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 40px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}
.ve-project-empty h3 { margin: 2px 0 0; color: var(--ink); font-size: 16px; }
.ve-project-empty p { margin: 0 0 5px; }

@container image-projects (max-width: 700px) {
  .ve-composer { grid-template-columns: 1fr; }
  .ve-create-aside { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: start; }
  .ve-sample { grid-template-columns: auto 1fr; }
  .ve-sample .btn { grid-column: 2; justify-self: start; }
}
@container image-projects (max-width: 500px) {
  .ve-home-head h1 { font-size: 23px; }
  .ve-home-nav a { padding-inline: 8px; }
  .ve-home-nav .ve-story-link { padding-inline: 8px; }
  .ve-create { padding: 16px; }
  .ve-create-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .ve-create-fields label:first-child { grid-column: 1 / -1; }
  .ve-create-aside { grid-template-columns: 1fr; }
  .ve-sample { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ve-sample .btn { grid-column: auto; }
  .ve-project { gap: 8px; padding-inline: 12px; }
}
@container image-projects (max-width: 340px) {
  .ve-home-nav .ic, .ve-project > .ic { display: none; }
  .ve-project { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ve-sample { grid-template-columns: auto minmax(0, 1fr); }
  .ve-sample .btn { grid-column: 2; }
}
