/* ============================================================================
 * CK-4260-EDITOR-LAYOUT-20260922 · 隔离候选（overlay：放在 uiopt-r6 链之后即整体胜出）
 * 只落实主审四条裁决，纯增量覆写，不修订父树任何一行：
 *  ① 缩略图占满自身高度；名称可隐藏（默认隐、悬停/聚焦浮签，title 常驻 DOM）；左缘与大图后退边对齐
 *  ② 主窗口（编辑器视口暗岛）不再黑块 → 主题 surface token 浅洗（--ed-island 契约第一处翻案）
 *  ③ 工作流未打开：底部缩略条零预留（旧 --preview-composer-width 无 setter=恒 406px 假预留作废）
 *  ④ 打开后才占用：让位与岛同闸走 --ed-wf（开 400 / ≤1000px 340 / .max 420），未开态画布可用宽度不动
 * 边界注记：分屏比较台 .ed-cmp-splitstage 的 --ed-island 是契约第二处，本单不翻；
 *          G5-VIS1-L 闭合缩裹（--ed-fit-w 未发值=恒拉伸）不受触；全文件零硬编码颜色。
 * 落地注记（非本件执行）：「占满自身高度」的槽宽同步须 paintThumbs(JS:2081) TH 闸 92→106 一行发值——
 *          Chrome intrinsic 尺寸通道不认 %-高替换元素加宽（aspect-ratio/!important/attr 三变体实测无效，见 RESULT 坑记），
 *          本 CSS 负责解除 92 钳制与带高填充，二者共同构成终态。
 * ==========================================================================*/

/* —— ② 视口暗岛翻案：墨丸 4% 入白洗出浅面，保留岛缘可辨（纯 token 推导，无字面色） —— */
.editor-layer.ws[data-ed-demo] .ws .ws-canvas {
  background-color: color-mix(in srgb, var(--ink-1) 4%, var(--surface));
}

/* —— ③ 未打开态：缩略条只让工具列（46px）+ 浮窗缝（20px），与岛闭合面完全同宽 —— */
.editor-layer.ws[data-ed-demo] .ws .ed-history {
  left: 12px;   /* ① 对齐大图后退边：岛 inset left=12px（refinement:3922，闭合/打开同值） */
  right: 66px;  /* 顶掉 uiopt-r4:109 / refinement:4717 的 calc(66px|46px + var(--preview-composer-width,340px)) 假预留 */
}
/* —— ④ 打开态：与岛同一变量闸（refinement:3915 + :5156 覆写段），窄屏随 --ed-wf 自动缩 —— */
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open] .ed-history { /* 属性在内层 section.ws（main.js:3171 openAttr），与 refinement:3915 同宿主 */
  right: calc(76px + var(--ed-wf));  /* 工具列合计 66 + 条-窗呼吸 10 + 工作流窗宽 */
}

/* ——— CK-4260-HIST-NARROW-OPEN-20261010 · 窄窗打开态「缩略带被输入列整条压住」具名窄修（纯增量，不动上面两行） ———
   实证（360x800，r8 基线，真实手势）：打开态 .ed-history 盒 [86,660,20,120]，cw20 恰为自身左右 padding（10+10），
   右缘由上面 26 行 right:calc(76px + var(--ed-wf)) 推入 ws 内 396px，而 ws 仅 276px ⇒ 内容宽 0；
   同带 .ed-composer [74,628,210,160]（z8，父 .ed-rail z7 均高于条 z6）整条压住：条带盒内 6/6 采样点命中
   textarea（外来节点，非条带后代），真实 Ctrl+点击不触发 handler，两轴滚轮皆惰 ⇒ 该态下历史项不可达。
   修法：把缩略带抬到输入列上缘之上；取值与 .ed-composer 自身 min-height:clamp(150px,20vh,200px) 同源 +10px 呼吸。
   **门值 494px 的实测依据（本票 verify-base 逐 1px 扫 470→502；判据 = 不加任何程序化 scrollLeft 时，
   项「夹心可见窗口中心」的 elementFromPoint 顶层节点是否为项自身）**：vw ≤ 497 ⇒ 顶层恒为 div.ed-composer
   （composer.left=vw−396 ≤ 采样点 x=101 故压住）；vw ≥ 498 ⇒ 顶层变为 button.ed-hist-item（composer.left=vw−396
   ≥102 > 101）。即名义无滚遮挡边界是 **497/498**。本修取 494 = 该带上「无滚顶层遮挡」与「真实无预滚 Ctrl+点击 0/5」
   两个判据同时成立的最大宽度；495–501 段的条带仍是 20px 退化缝（cw=20、内容宽 0、无缩略图可见），其点击命中共 4/5
   只在本仪器 CLICK 的预滚 scrollLeft **之后**才出现——该预滚正是本票合同禁止当作可达性依据的程序化滚动，
   故不据此扩大门值。**此处不假称「某一像素起全部可达」**。
   **495–640 段本票留置（现状与后续收口见下方 20261011 块）**：cw = max(20, vw−492)，vw ≤ 512 恒 20，
   该带当时另行具名，未纳入本修。
   **470x800 列表态落点实测（元素级清点，非推算）**：creation-choice 占 y50..339，输入列 textarea 起于 y646，
   工具轨 x411..443；抬升带 [86,500,308,120]（right:66px ⇒ 右缘 ws.right−66=394 < 411）整体落在 x86..394 × y340..645
   的控件空白矩形内 ⇒ 覆盖 0 个交互控件（本票 verify 基线/candidate 双腿均 coveredN=0，面板控件 own 命中全保留）。
   471–494 同构（面板右锚定 320 宽，y 布局不变；条右缘 vw−76 仍 < 工具轨 vw−59）。
   **诚实边界**：clamp 只是 min-height，不等于该列实测高度恒等；实测 360x800/470x800 两个面板子态该列 bbox 均
   [74,628,210,160] / [74,628,320,160]（=min-height 生效值），故几何不相交（重叠面积 2400px²→0）；
   若未来该列因内容长高到 min-height 以上，本规则不保证不相交，此处不假称「所有高度皆完美」。
   **详情态 = 本票冻结的具名结构缺口（未修，不假称已修）**：470x800 详情态实测 tile 行 y109..445、
   .ed-wf-foot [86,410,296,198] 内含 y420..445（生成张数）、y534..589（API生成ComfyUI/执行/自动/设置）、
   输入列 y646..780 ⇒ 左列 y109..608 全满，唯一空白带仅 y589..645(57px) 与 y40..84(44px)，均 < 120px 条高；
   现结构内不存在 120px 高 × 可用宽的控件空白带 ⇒ 纯 CSS 无法在不覆盖配方控件的前提下安置条带。
   该态条带保持 r8 几何（被输入列压住，指针不可达），仅键盘 Tab 可达（实测整圈含 HIST0/-1/1/2/3）。
   闭合态 :not([data-ed-wf-open]) 与 ≥495px 零生效 ⇒ 闭合条内部滚动/缩略图形制（含编辑器其余规则）逐字节不变。 */

/* ——— CK-4260-HIST-MIDWIDTH-20261011 · 495/560/640 代表宽度 + 长 composer 内容态实测，及「只改门值」扩围 ———
   目标：按**容器预算**收口上段留置的 495–640 退化缝，而不是继续放大门值掩盖内容问题。
   **预算推导（可复算）**：打开态条带内容宽 cw = max(20, vw−492)（实测 495/560/640/470 ⇒ cw 20/68/148/20，盒
   [86,660,20,120]/[86,660,68,120]/[86,660,148,120] 逐项相符）；单个历史项实测宽 158px（DOM 序 0/-1/1/2/3，
   项间 8px）⇒ **能容下完整一项的最小宽度 = 492 + 158 = 650** ⇒ 门值取 649。
   **495 默认位实测（真实手势；不施加任何程序化 scrollLeft）**：条带与输入列盒相交 840px²，最新项可见窗仅
   **2px**（项盒 [96,664,158,108]，自由带 x86..98），其余四项 0px ⇒ 默认位只有 2px 可点。
   560/640 默认位可见窗 57/137px，实轮滚入后各项 own 命中且真实点击可选中 ⇒ 该两宽已可用，本修不改其几何。
   **修法 = 只改门值 494 → 649，块内三条声明逐字节不动**（与 r11→r2 同法：声明不变则 <495 的 computed style
   不变，既有 r12 证据与 <495 布局继续有效）；:has(.ed-wf-panel[data-wf-view="list"]) 保留。
   同一仪器基线/候选双腿实测：495 列表态条带 [86,500,333,120]（cw 333），最新项可见窗 2 → 158px，560/640 同向；
   **coveredN 0/63·0/63·0/64（覆盖交互控件 0）**，prompt/send own 命中全真，文档无溢出，pageerror 0。
   **本修不覆盖（实测具名，不假称已修）**：
   ① **详情态**：在 :has(list) 之外，抬升带与该态 .ed-wf-foot（内含 y534..589 的 API生成ComfyUI/执行/自动/设置
      等）相交。同一仪器把本规则**在详情态也放开**实测：495/560/640 各覆盖 **14** 个交互控件（360 为 11）⇒ 故不放开。
      详情态保持 r8 几何：495 时 cw 20、与输入列相交 840px²、默认位五项可见窗 0px；360 详情态实测条带中心
      elementFromPoint = textarea ⇒ 真实滚轮被输入列夺走（条带自身 scrollLeft 不动）。该态仅键盘 Tab 可达
      （实测整圈 HIST0/-1/1/2/3）。结构缺口与 r12 冻结结论一致：现结构内无 120px 高 × 可用宽的控件空白带。
   ② **内容增长**：长提示词真实键入（470 列表态，fill + type 30 行）⇒ 输入列 160 → 181（盒 [74,607,320,181]），
      与抬升带相交 **4004px²**，五项可见窗全 0（真实滚轮仍可滑 sl 0→513，但带内无点可命中、点击 handler 不触发）。
      = 上段「clamp 只是 min-height，不等于该列实测高度」边界的实测化：本规则按该列 min-height 取值，内容长高后
      可被重新压住；不改动输入列声明则无纯 CSS 解（本票不改输入列声明）。
   闭合态 :not([data-ed-wf-open]) 零生效 ⇒ 闭合条逐字节不变。 */
@media (max-width: 649px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-history {
    right: 66px;                                    /* 与闭合态同值：条带恢复可滚动宽（overflow-x:auto 合同不变） */
    bottom: calc(clamp(150px, 20vh, 200px) + 10px); /* 抬到输入列上缘之上：与该列自身 min-height 同源取值 */
    z-index: 8;                                     /* 仅盖过 .ed-rail(z7) 底色；与输入列无几何重叠故不抢位 */
  }
}

/* R2 correction: keep settings in their own bounded scroller so the prompt
   retains a reachable 120px body in narrow detail mode. */
.editor-layer.ws[data-ed-demo] .ws .ed-composer {
  min-height: 120px;
  max-height: min(62vh, 460px);
  display: flex;
  flex-direction: column;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config-mount {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  max-height: min(38vh, 300px);
  overflow: auto;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-group {
  display: flex;
  flex: 1 1 30%;
  flex-wrap: wrap;
  align-items: center;
  min-width: 180px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-group h4 {
  flex: 0 0 auto;
  margin-right: 5px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-parameters {
  flex: 1 1 100%;
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-parameters .ed-cfg {
  flex: 1 1 100%;
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-c-body {
  flex: 0 0 120px;
  min-height: 120px;
}
@media (max-width: 649px) {
  .editor-layer.ws[data-ed-demo] .ws .ed-composer {
    min-height: 120px;
    max-height: min(62vh, 440px);
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer-config {
    max-height: min(36vh, 240px);
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer-group {
    flex-basis: 100%;
    min-width: 0;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer-parameters {
    flex-basis: 100%;
  }
}

/* ——— CK-4260-HIST-DETAIL-BUDGET-20261011 · 详情态 ≤649 空间预算（纯增量；上两块的列表态声明逐字节不动）———
   本票（work/b-history-detail-composer-budget-20261011）只修两个已复现缺口，实测与结论如下。
   **① 详情态指针不可达（本块修）**：≤649 详情态不命中上面 :has(list) 闸，条带维持 r8 几何。
   实测（真实手势，无程序化 scrollLeft）495/470/360 详情态条带盒均 [86,660,20,120]（cw=20，=自身左右 padding），
   与输入列盒相交 840/2400/2400px²；**470/360 条带中心 elementFromPoint 顶层 = textarea（输入列）**⇒真实水平
   滚轮被输入列夺走（条带 scrollLeft 不动），REAL 两项 own 0/2、真实效果 0/2（applySwitch 零调用、confirm.target 未变）
   ⇒ 该态历史项指针不可达，与 r12/r15 冻结结论同源。495 仅因自由带余 ~9px 才 2/2，仍是 20px 退化缝（无缩略图可见）。
   **② 长 composer（结论更正，不改任何声明）**：上块 ② 记「470 列表态 refs+30 行长提示词 ⇒ 输入列 160→181、
   与带相交 4004px²、五项可见窗全 0、带内无点可命中」。本票改用**浏览器命中测试**复测同一状态：
   条带自身盒内 6×12=72 点采样，**71 点顶层为真实 .ed-hist-item**（余 1 点为条带底色）、输入列 0 点；
   REAL 两项 own 2/2、真实效果 2/2（applySwitch idx=2 真实完成）。即 4004px² 只是盒相交：两元素同 z 而条带在
   DOM 后 ⇒ y607..620 段实际由条带绘制在上（命中测试在该段 y=610 返回项，非输入列）。该段内**逐控件命中
   测试 coveredN 0/59**（无交互控件被遮）⇒ 该项**不是可达性缺口**；旧结论源于「任意垂交即整条横切」的判据
   + 未计绘制序，本票不继承、也不为此改任何声明。
   **修法（详情态空间预算：不搬条带，用局部 flex/max-height 把带腾出来）**：
   ① .ed-rail 下缘抬到 H−161 ⇒ 左列（面板+输入列）止于带上方（条带上缘 H−151，10px 呼吸）；
   ② 输入列钉回 A5 设计高 120px（refinement.css:4547 原始 flex:0 0 120px / height:120px 值）⇒ 参考行与长提示词
      只在列内滚动，不再长高挤压条带；③ 面板正文 flex:1 1 0（basis 0，不是 auto）⇒ 正文独占剩余空间自滚，
      foot 按 820 高块给的自身 flex-shrink 收进既有滚动口；④ 条带落入 [H−151, H−63]（下缘距画布底栏 y≈H−53 有 10px）。
   同一仪器（注入同一 CSS 文本，非源改）实测 495/470/360 详情态：条带 [86,607,333/308/198,120]（cw 333/308/198），
   默认位可见窗 158/158·131/131·21/21px，coveredN 0/61·0/61·0/59，REAL 两项 own 2/2、效果 2/2，
   正文 ch 60 可滚（sh 760）、foot 盒 187 自身无溢出（sh=ch=186），执行/设置 own 命中（「参数」在 DOM 中不存在，
   按真实标签记为缺，不以推测补），prompt/send own，文档无溢出（doc 495/470/360 = vw），pageerror 0。
   同一注入在列表态四条腿（495/470/470+refs/360）与基线**逐项相同**（条带盒、cw、输入列 160/181、own/效果、coveredN 全同）
   ⇒ 本块只对详情态生效。闭合态 :not([data-ed-wf-open]) 与 ≥650px 零生效。
   **诚实边界**：本修把左列压短 191px（正文 200→60、输入列 160→120、foot 198→187），是「正文可见行数」换
   「条带可用宽度」的有意取舍——正文须滚动才看全（sh 760/ch 60）；相对 r8~r15 详情态（cw 20、REAL 0/2）为净改善，
   但**不假称正文一眼可见全、也不假称 470/360 详情态以外宽度同样良好**。 */
@media (max-width: 649px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-rail {
    bottom: 161px;                                  /* ⑪ 带高 120→88（refinement.css:4056）⇒ 带上缘 H−183→H−151；
                                                       仍取「带上缘 + 10px 呼吸」= 161，保护本条既有语义（左列止于带上方、不压条带） */
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-composer {
    flex: 0 0 auto;
    min-height: 120px;                              /* 钉回 A5 设计高；参考行/长提示词只在列内滚动 */
    max-height: 120px;
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-wf-mount .ed-wf-body {
    flex: 1 1 0;                                    /* basis 0：正文独占剩余并自滚，不连坐 foot */
    min-height: 60px;                               /* 正文可读下限；foot 由自身 flex-shrink 收进滚动口 */
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-history {
    right: 66px;                                    /* 与闭合态/列表态同值（overflow-x:auto 合同不变） */
    bottom: 63px;                                   /* 带下缘 H−63：距画布底栏 y≈H−53 留 10px */
    z-index: 8;
  }
}

/* —— ① 缩略带占满自身高度 + 名称可隐藏 —— */
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item {
  position: relative;       /* 浮签定位父；带高由 strip align-items:stretch 供（120−pad12=108） */
  flex-basis: max-content;  /* 占满后 canvas 等比实宽（如 21:9→246px）晚于 content 基线解析，旧 flex:0 0 auto 按固有 200 出槽会压叠邻项——宽轴一并占满 */
}
.editor-layer.ws[data-ed-demo] .ws .ed-hist-thumb { flex: 1 1 auto; min-height: 0; }
.editor-layer.ws[data-ed-demo] .ws .ed-hist-thumb canvas {
  height: 100%;        /* 占满自身高度=内容带 108（旧「max-height:92 与 JS TH=92 同闸」R7-02 档作废） */
  width: auto;         /* 替换元素定高+宽自动=按固有纵横等比，零畸变 */
  max-height: none;    /* 92 上限随占满裁决退场 */
  max-width: none;     /* 200 宽钳一并退场：宽图自然加宽，由条既有 overflow-x:auto 承接（合同不变） */
  background-color: var(--surface); /* #10130f 黑底（refinement:4090）→ 主题面；圆角残角即唯一留白 */
}
.editor-layer.ws[data-ed-demo] .ws .ed-hist-label {
  display: none;       /* 名称默认隐藏；DOM 常驻（title 属性同项已有——edHistoryHtml:1081） */
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  z-index: 2; pointer-events: none;
  background: var(--surface-soft); color: var(--ink-1);
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
  padding: 1px 8px; font-size: 11px; line-height: 1.4; white-space: nowrap;
  box-shadow: var(--sh-rest);
}
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:hover .ed-hist-label,
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:focus-visible .ed-hist-label { display: block; }

/* Total dialog width = fitted image viewport + the actual left/right panel insets. */
.editor-layer.ws[data-ed-demo]:not(.max) .ws {
  width: var(--ed-dialog-w, min(340px, calc(100vw - 20px))); /* T02-R100：--ed-dialog-w 缺省窗（首帧/layout 未写变量）不再暴露 64% 巨幅；潜在加载回退窗加固，用户原始闪大尚未复现；窄占位≈layout ph9 首帧形，decode 后由 JS 写真实 fit 宽单向展开 */
  min-width: min(300px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
}
.editor-layer.ws[data-ed-demo] .ws:not([data-ed-wf-open]) .ws-canvas { width: auto; }

/* Decode gate is independent of the measured editor shell. */
/* FB1024-02：loading=框架可见+inert（整层隐藏仅保留给 failed；失败面板沿原式280px不变）；工具/画布交互全禁，Esc（既有全局链）与门层点击退出仍可达 */
.editor-layer[data-ed-opening="failed"] > section.ws { visibility: hidden; pointer-events: none; }
.editor-layer.ws[data-ed-demo][data-ed-opening="loading"] > section.ws { width: calc(100vw - 20px); pointer-events: none; }
.editor-layer .ed-loading-gate[data-ed-phase="loading"] { position: fixed; inset: 0; left: 0; top: 0; transform: none; width: auto; max-width: none; background: transparent; box-shadow: none; padding: 0; display: block; cursor: progress; }
.editor-layer [data-ed-open-preview] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(18px) saturate(1.05); transform: scale(1.02); pointer-events: none; }
.editor-layer [data-ed-open-preview].ed-pv-out { opacity: 0; transition: opacity 180ms ease-out; }
@media (prefers-reduced-motion: reduce) { .editor-layer [data-ed-open-preview].ed-pv-out { transition: none; } }
.editor-layer .ed-loading-gate {
 position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
 width: min(280px, calc(100vw - 32px)); box-sizing: border-box;
 display: grid; gap: 14px; padding: 20px; border-radius: var(--r-pop, 10px);
 background: var(--surface); color: var(--ink-1); box-shadow: var(--sh-lift);
 font: inherit; pointer-events: auto;
}
.editor-layer .ed-loading-gate button { justify-self: end; font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-btn, 6px); padding: 6px 10px; cursor: pointer; }

/* ── 原13UI 红字5/6（UX-REDLINE-20261011 右栏两排）——仅重排既有真控件，不新增功能、不改控件语义、不改可访问名称 ──
   第一排 = .recipe-batch 的直系子：模型分配控件（批量统一行 或 edGenSlotHtml 的唯一一组）+ 分配方式 + 图层网格开关；
   第二排 = .ed-c-cfgrow：生成张数下拉（recipeQuantityHtml）+ 执行（模式）/比例/设置，四控件等宽同排。
   开关刻意保持 .recipe-batch 直系子（不裹进新容器）——uiopt-r4 既有 `.recipe-batch > [data-recipe-return]` 窄态契约逐字不动。 */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 4px 0;
}
/* 模型分配控件 flex-basis:0（不是 100%）：否则行内 width:100% 会让它独占整行、把分配方式/开关挤到下一行。 */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > .recipe-assignment,
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > .ed-generation-controls {
  flex: 1 1 0; min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > .recipe-mode { flex: 0 0 auto; margin-bottom: 0; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > [data-recipe-return],
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > [data-recipe-cancelbatch] { flex: 0 0 auto; }
/* 状态行独占一排；无必要信息时 <p> 为空 ⇒ 高度 0、外边距 0，不占版面（红字5「多余说明取消」）。 */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > p[data-recipe-status] { flex: 1 1 100%; margin: 2px 0; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .recipe-batch > p[data-recipe-status]:empty { margin: 0; }
/* 第二排：张数下拉与三枚 pill 等宽同排（.ed-c-cfgrow 的列数见 JS 内联 grid-template-columns，本票 3→4）。 */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .ed-c-cfgrow > .recipe-quantity {
  width: 100%; min-width: 0; margin: 0; display: flex; align-items: center; justify-content: stretch;
}
.editor-layer.ws[data-ed-demo] .ws .ed-wf-foot .ed-c-cfgrow > .recipe-quantity > select {
  width: 100%; height: 26px; min-width: 0; box-sizing: border-box;
}

/* UX-REDLINE-20261011 · composer settings overlay: existing controls only. */
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-btn, 6px);
  background: var(--surface-soft);
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-group h4 {
  margin: 0;
  color: var(--ink-1);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 650;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-group-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 10px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .ed-generation-controls {
  width: 100%;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .recipe-batch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .recipe-batch > .recipe-assignment,
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .recipe-batch > .ed-generation-controls {
  flex: 1 1 0;
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .recipe-batch > .recipe-mode {
  flex: 0 0 auto;
  margin-bottom: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .recipe-batch > p[data-recipe-status] {
  flex: 1 1 100%;
  margin: 2px 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-config .ed-cfg {
  margin: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer-actions .ed-tool {
  width: 28px;
  height: 26px;
  padding: 3px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-c-tawrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-c-tawrap .ed-c-send {
  position: static;
  flex: 0 0 auto;
}
@media (max-width: 649px) {
  .editor-layer.ws[data-ed-demo] .ws .ed-composer-config {
    padding: 6px;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer-config .ed-c-cfgrow {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ==========================================================================
 * CK-4260-COMPOSER-BUDGET-20261011 · 编辑器 composer 设置/输入两栏高度预算收口
 * 票 task_e6d6f87c155b / dispatch ctx_5c404f2174db
 * 纯末段追加：本叶上方任何一行未改 ⇒ 未命中的档位（桌面 / 闭合态 / ≥650px 非目标态）zero-diff。
 * --------------------------------------------------------------------------
 * 依据 = Sol 真跑 work/sol-ui-controls-review-20261011/out/RESULT.json（实测视口高 890）：
 *  · 1440/2048：22 项检查全真（settings 250 / prompt 104 / actions 26 均可达）；
 *    其后 error = harness `[data-ed-cfg-open]` **严格模式命中 2 元素**（「API/ComfyUI」与
 *    「逐图分配」两区各有一枚合法入口）⇒ 仪器选择器歧义，非产品/CSS 缺陷；本叶零 JS 权限、
 *    亦不改仪器 ⇒ 该项不能也不应由本叶修正（见 report/CHECKPOINT.md §6）。
 *  · 470/360（详情态）：composer 盒 [74,609,320|210,120]；设置块真实 [86,617,296|186,240]；
 *    正文 textarea 被推到 [86,937,256|146,104]（折叠线 890 之下）；actions [86,885,…]；
 *    promptOwn/sendOwn/actions own 全 false。
 * 三处根因（与票面逐条对应）：
 *  ① 类名/属性错配：上方 R2 块命中 `.ed-composer-config-mount`（**类**），真实标记是
 *     `<div data-ed-composer-config-mount>`（image-editor-demo.js:2238，**属性**）
 *     ⇒ 其「有界滚动」声明从未匹配，设置块原尺寸外溢。
 *  ② 后块压前块：L103 的 flex 滚动器被其后 L270 的 `display:grid` 同特异度后置覆盖（grid 压 flex）。
 *  ③ 盒高结构不足：≤649 详情态把 `.ed-composer` 钉 `max-height:120px`，而最少内容
 *     actions(≈34)+正文(120)=154 ⇒ 结构上必然外溢，设置越多正文越远。
 * 修法（A/B/C 三段，全部末段）：
 *  A 属性选择器补回 mount 有界滚动（可收缩 + 内层自滚）；
 *  B 末段重声明 flex 版设置容器：三选择组并排紧凑、参数 pill 占整行；皮肤逐值沿用后置块；
 *  C ≤649 **list 与 detail 两态统一空间预算**：`.ed-rail` 下缘 161、`.ed-history` 下缘 63
 *    （带高 88 不变 ⇒ 条带自成一档命中窗），composer 由「钉死 120」改「有界自适应
 *    clamp(240px,46vh,360px)」，正文 `.ed-c-body` 钉 120 可达、actions 保持同排。
 * 明确不动：顶部 r37 `top:38`（不在本叶）、条带 `height:88`（refinement.css:4056）、
 *  `.ed-c-cfgrow` 列数（JS 内联栅格，承载 6 输出）、pill 弹层生命周期、绘制工具、
 *  `[data-ed-composer-input]` 真实输入选择器。
 * ==========================================================================*/

/* —— A. mount 有界滚动：属性选择器，修正 ① 的类名错配 —— */
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] {
  flex: 0 1 auto;      /* 可被压缩：父列内唯一弹性项，设置让位给正文 */
  min-height: 0;       /* 解除 flex 项 auto 最小尺寸，否则不收缩 */
  overflow: hidden;    /* 兜底：绝不把设置块外溢到正文/视口之外 */
  display: flex;
  flex-direction: column;
}

/* —— B. 设置容器 = flex（压过后置 grid）+ 独立有界滚动（A 的收缩结果落在此层）；皮肤逐值沿用 —— */
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] > .ed-composer-config {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-btn, 6px);
  background: var(--surface-soft);
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(38vh, 300px);   /* 桌面档设置块上界（远 < 400px ⇒ 无 400px 白块） */
  overflow: auto;                 /* 设置获得**独立有界滚动** */
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group {
  display: flex;
  flex: 1 1 30%;       /* 三选择组并排紧凑 */
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group h4 {
  flex: 0 0 auto;
  margin: 0 5px 0 0;
  color: var(--ink-1);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 650;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 10px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-parameters {
  flex: 1 1 100%;      /* 参数 pill 占整行 */
  min-width: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-parameters .ed-cfg {
  flex: 1 1 auto;
  min-width: 0;
}

/* —— C. ≤649：list 与 detail 两态统一空间预算 —— */
@media (max-width: 649px) {
  /* 窄档设置上界再收一档，保证正文优先；mount 已可收缩，故此处再压即触发独立滚动 */
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] > .ed-composer-config {
    max-height: min(36vh, 240px);
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group {
    flex: 1 1 45%;     /* 窄档：两列并排（≥92px 实用宽），余下一组自换行 */
    min-width: 92px;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-parameters {
    flex: 1 1 100%;
    min-width: 0;
  }
  /* 左列下缘抬到条带上方：带高 88 ⇒ 带上缘 H−151，取 161（留 10px 呼吸）—— list 与 detail 同值 */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-rail,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-rail {
    bottom: 161px;
  }
  /* 条带自成一档命中窗（右缘同闭合态，overflow-x:auto 合同不变） */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-history,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-history {
    right: 66px;
    bottom: 63px;
    z-index: 8;
  }
  /* composer = 有界自适应（不再钉死 120，票面「足够总高放进 rail」）：设置滚动 + actions 同排 + 正文 120 可达 */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-composer,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-composer {
    flex: 0 1 auto;
    min-height: 120px;
    max-height: clamp(240px, 46vh, 360px);
  }
  /* 正文（唯一输入）钉 120px：与设置滚动解耦，始终在视口内 */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-composer .ed-c-body,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-composer .ed-c-body {
    flex: 0 0 120px;
    min-height: 120px;
  }
  /* 列表态工作流正文自滚（detail 档已由上块给 flex:1 1 0 / min-height:60px，此处不覆盖） */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-wf-mount .ed-wf-body {
    flex: 1 1 0;
    min-height: 0;
  }
}

/* ==========================================================================
 * CK-4260-COMPOSER-BUDGET-20261011-R2 · 生成/输入两组防溢出窄修（B2）
 * 票 task_1e1640bb94e2 / dispatch ctx_9eaf7a221376
 * 证据 = Sol 真跑 work/sol-ui-controls-review-20261011/out/RESULT-R3.json：
 *   1440/2048 两档 22 项检查**全真**（settings 165.5 / prompt 104 / actions 26 全可达），
 *   随后 `[data-ed-cfg-open]`（唯一齿轮）点击 **Timeout 3500ms**；Playwright 记录拦截者 =
 *   「<summary>两个输入源的区别</summary> from <section aria-label="输入源">」。
 *   470 档 26/26 全绿、360 档 23 项全绿（其唯一 error = `[data-action="close-sidebar"]`
 *   「element is outside of the viewport」，属既有 sidebar 340px 宽的**前存**行为，本票不扩域）。
 * 根因：上轮「三选择组 flex:1 1 30% / min-width:0」把「来源与模型」组压到 ~110px，而组内
 *   `.ed-generation-controls` 带**行内** `display:flex;…;min-width:0;width:100%`
 *   （image-editor-demo.js:2318-2321 / :2281），其子项（来源下拉 + 真实模型 + 齿轮）横向溢出该组，
 *   压到邻组「输入源」的 `<summary>`；命中测试返回该 summary ⇒ 齿轮不再 own 命中。
 * 修法（票面提案，最小 scoped）：① 组最小宽 **150px** ⇒ 342 内容宽一行只容 2×150+gap6，需换行的行自然换行；
 *   ② `.ed-generation-controls { flex-wrap: wrap }`（`flex-wrap` 不在行内声明内，普通声明即生效，无需 !important）；
 *   ③ 组直系子项与 `.ed-generation-controls` 子项 `min-width:0; max-width:100%` ⇒ 内容被**包住**而非溢出；
 *   ④ 齿轮 `[data-ed-cfg-open] { flex: 0 0 auto }` ⇒ 恒占自身宽、绝不被挤没。
 * **不用 z-index、不使用 hidden/裁剪隐藏任何控件**（无 overflow:hidden）。
 * 作用域 **@media (min-width:650px)**：≤649 档本轮已全绿，逐字节不动（其组宽仍走上方 92px 规则）。
 * 未改：`-- source165px settings 预算`（设置 max-height 上界 min(38vh,300px) 未动）、
 *   `.ed-c-cfgrow` 列数、pill 生命周期、绘制工具、真实输入选择器、r37 CSS top / history 88。
 * ==========================================================================*/
@media (min-width: 650px) {
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group {
    min-width: 150px;   /* 压顶：三组 30%/0 曾把首组压到 ~110px 致内容溢出压住邻组 summary */
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-composer-group > * {
    min-width: 0;       /* 内容包在自身组内，不外溢到邻组 */
    max-width: 100%;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-generation-controls {
    flex-wrap: wrap;    /* 行内 display:flex 未含 flex-wrap ⇒ 普通声明即可生效 */
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-generation-controls > * {
    min-width: 0;
    max-width: 100%;    /* 来源/模型/齿轮换行而非横向溢出 */
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] .ed-generation-controls > [data-ed-cfg-open] {
    flex: 0 0 auto;     /* 唯一齿轮恒占自身宽 ⇒ 数量 6→1、manual/unified/auto、来源切换后仍 own 命中 */
  }
}

/* IMG-01.03 r39: keep the floating auxiliary card, including its close
   control, inside the narrow viewport's fixed left/right safety rails. */
@media (max-width: 649px) {
  .app-frame:has(.canvas-shell) .canvas-shell > .sidebar.aux-card {
    max-width: calc(100vw - 84px) !important;
  }
}

/* R77 用户10/13截图：真实编辑器参数在上、来源/输入/分配随后、唯一正文置底。
   工具绘制组独立滚动，六钮固定列底，避免旧composer reserve抬高/遮盖。 */
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-toolbar,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-toolbar {
  bottom: 10px; overflow: hidden;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-drawing-tools {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-workflow-tools {
  position: static !important; flex: 0 0 auto; margin-top: auto;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer {
  height: auto; min-height: 0; flex: 0 1 auto; max-height: min(60vh, 560px);
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-c-body,
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-c-tawrap {
  flex: 0 1 auto; min-height: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-input] {
  field-sizing: content; height: auto; min-height: 72px; max-height: min(20vh, 200px);
  flex: 1 1 auto; overflow-y: auto;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer [data-ed-composer-config-mount] > .ed-composer-config {
  margin-bottom: 0;
}
/* 与旧短窗空间预算同级特异度：正文可增长，长文有界滚动，历史条仍保留原区域。 */
@media (max-width: 649px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-composer,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-composer {
    height: auto; min-height: 0; flex: 0 1 auto;
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="list"]) .ed-composer .ed-c-body,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-composer .ed-c-body {
    flex: 0 1 auto; min-height: 0;
  }
}

/* W213: the editor uses the same prompt/control composition as the canvas generator. */
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified {
  display:flex; flex-direction:column; gap:8px; padding:12px;
  max-height:min(56vh,520px); overflow:auto;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-compact-top {
  display:flex; align-items:center; gap:8px; min-width:0;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-compact-top > span {flex:1;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer {
  display:flex; flex-direction:column; gap:8px; min-width:0;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-prompt-box {min-width:0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified [data-ed-composer-input] {
  box-sizing:border-box; width:100%; min-height:88px; max-height:180px; padding:8px;
  border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text);
  font:inherit; font-size:12px; resize:vertical;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified [data-ed-composer-config-mount] {display:block;max-height:none;overflow:visible;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) 32px; gap:6px; align-items:center;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields > * {min-width:0;margin:0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields > :nth-child(4) {grid-column:1;grid-row:2;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields > :nth-child(5) {grid-column:2;grid-row:2;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields > :nth-child(6) {grid-column:3;grid-row:2;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified [data-ed-generation-send] {grid-column:4;grid-row:1 / span 2;align-self:stretch;display:flex;align-items:center;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified [data-ed-generation-send] button {width:30px;height:30px;border-radius:50%;padding:6px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields select {
  box-sizing:border-box; width:100%; min-width:0; max-width:100%;height:28px;
  border:0; border-radius:4px; background:var(--surface);color:inherit;font:inherit;font-size:11px;
}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-options {margin-top:8px;font-size:11px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-options summary {cursor:pointer;padding:5px 0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-options .ed-wf-params {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .recipe-batch {margin-top:8px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified button:focus-visible,
.editor-layer.ws[data-ed-demo] .ed-generation-unified select:focus-visible,
.editor-layer.ws[data-ed-demo] .ed-generation-unified textarea:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-controls {display:block;width:100%;min-width:0;padding:0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields {width:100%;box-sizing:border-box;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-references {display:flex;gap:6px;align-items:center;min-width:0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-primary {flex:0 0 56px;display:flex;flex-direction:column;font-size:10px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-primary img {width:56px;height:44px;object-fit:contain;border-radius:4px;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-references {flex:1;min-width:0;}
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-ref-add {flex:0 0 28px;width:28px;height:28px;padding:5px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-references {flex:1 1 0;min-width:0;width:0;max-width:100%;padding:0;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-generation-fields .gen-ctl {display:flex;flex-direction:row;align-items:center;gap:4px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-generation-fields .gen-ctl > svg {flex:0 0 13px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified [data-ed-generation-send] button {box-sizing:border-box;min-width:0;width:30px;height:30px;flex:0 0 30px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-references > small {display:block;white-space:normal;overflow-wrap:anywhere;}
/* Shared thumbnail tiles keep their edit controls reachable inside the editor strip. */
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-references {max-height:96px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified [data-wf-ref-item] {flex:0 0 90px;min-width:0;width:90px;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified [data-wf-ref-item] img {width:56px;height:44px;object-fit:contain;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified [data-wf-ref-add] {display:none;}

.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-primary[hidden] {display:none;}

/* ============================================================================
 * UI-BUDGET-20261018-A · 截图红9：生成区文字框尽量大 + 两排参数间距缩小 + 文字框保底
 * 纯增量覆写，零 JS、零模板面板 CSS，保留全部原真实控件。
 *   ① 文字框尽量大：解除 180px 上限，参数让位后文字框吃掉剩余面板高度
 *   ② 两排参数间距缩小：fields 网格 gap 6→3、行高 28→26、options 上距 8→4
 *   ③ 文字框保底：底=保持 promptPosition:'bottom'（DOM 未动），min-height 88→140 兜底
 * ==========================================================================*/
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified { height:min(44vh,420px); flex:0 0 auto; } /* 红9: 解除 refinement:4551 的 120px 钳制, 参数行让位, 文字框吃剩余高度 */
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer { flex:1 1 auto; min-height:0; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer .gen-controls { flex:0 0 auto; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer .gen-prompt-box { flex:1 1 auto; display:flex; min-height:0; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer .gen-prompt-box [data-ed-composer-input] { flex:1 1 auto; height:100%; min-height:140px; max-height:none; resize:vertical; }

.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields { gap:3px 4px; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields select { height:26px; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-fields .gen-ctl { gap:3px; }
.editor-layer.ws[data-ed-demo] .ed-generation-unified .ed-generation-options { margin-top:4px; }

/* User T4 dashboard: fill the workspace below the existing 28px header.
   Keep desktop canvas, history and workflow in their existing live hosts. */
@media (min-width: 900px) {
  .editor-layer.ws[data-ed-demo]:is(.max,:not(.max)) > .ws {
    top:28px;
    border-radius:0; box-shadow:none;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-rail { top:0; bottom:0; gap:8px; }
  .editor-layer.ws[data-ed-demo] .ws .ws-canvas { top:0; left:0; }
  .editor-layer.ws[data-ed-demo] .ws .ed-history { left:0; }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-panel { border-radius:0; }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-body {
    min-height:0; max-height:none; flex:1 1 0;
    scrollbar-width:thin; scrollbar-color:var(--accent-ui) transparent;
  }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-body::-webkit-scrollbar { width:4px; }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-body::-webkit-scrollbar-thumb { background:var(--accent-ui); }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-body::-webkit-scrollbar-button { display:none; }
}

/* One tool column with local scrolling; persistent actions remain reachable. */
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-toolbar,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-toolbar {
  width: 40px; align-items: center;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-layer-entry {
  order: -1; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-drawing-tools {
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center;
  gap: 3px; width: 100%; overflow-y: auto; overflow-x: hidden; min-height: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-drawing-tools > :is(.ed-tool,details) {
  flex: 0 0 auto; width: 32px; min-height: 32px;
}
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-workflow-tools {
  width: 32px; align-self: center;
}

/* Tool properties open beside the rail instead of covering its tools. */
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-toolbar,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-toolbar { overflow: visible; }
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-toolbar > .ed-draw-properties,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-toolbar > .ed-draw-properties {
  position: absolute; left: auto; right: calc(100% + 2px); top: 0; bottom: 0;
  height: fit-content; width: auto; margin: auto 0; transform: none;
  padding: 5px 4px; background: var(--u6-paper, #f8f7f2);
  border: 1px solid var(--u6-line, #dedcd3); border-right: 0;
  border-radius: 8px 0 0 8px;
}

/* Reserve the same single-column width for the recipe and result docks. */
.editor-layer.ws[data-ed-demo] .ws { --ed-rail-inset: 46px; }
.editor-layer.ws[data-ed-demo] .ws .ed-rail,
.editor-layer.ws[data-ed-demo] .ws .ed-history { right: 46px; --ed-rail-inset: 46px; }

/* FB1020-22: personal text-only covers share builtin preview height so the title retains a line. */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-tile > .ed-personal-cover { min-height: 0; height: 48px; flex: 0 0 48px; }
@media (max-height: 820px) {
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-tile > .ed-personal-cover { height: 38px; flex-basis: 38px; }
}

/* History metadata overlays the thumbnail instead of shrinking its image area. */
.editor-layer.ws[data-ed-demo] .ws .ed-hist-detail {
  display: none; position: absolute; top: 4px; left: 4px; right: 4px; z-index: 1;
  padding: 2px 4px; border-radius: 4px;
  background: var(--surface-soft); color: var(--ink-1);
  font-size: 11px; line-height: 1.3; text-align: left;
  white-space: normal; overflow-wrap: anywhere; pointer-events: none;
}
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:hover .ed-hist-detail,
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:focus-visible .ed-hist-detail { display: block; }

/* History actions use the same responsive rail inset plus the toolbar edge offset. */
.editor-layer.ws[data-ed-demo] .ws .ed-history { right: calc(var(--ed-rail-inset, 56px) + 10px); }

/* Keep the send row reachable while editing long text on a narrow short screen. */
@media (min-width: 650px) and (max-width: 899px) and (max-height: 600px) {
  .editor-layer.ws[data-ed-demo] .ed-generation-unified .gen-composer .gen-prompt-box [data-ed-composer-input] { min-height: 72px; }
}

/* The recipe directory owns this area while choosing the next operation. */
.editor-layer.ws[data-ed-demo] .ws:has(.ed-wf-panel[data-wf-view="list"]) .ed-draw-properties { display: none; }

/* Cutout reuses the recipe's quiet inline control language. */
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-body { display: grid; gap: 20px; padding: 0 0 20px; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 6px; background: var(--surface-soft, #f1eee6); }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch button { display: flex; justify-content: center; align-items: baseline; gap: 6px; min-height: 34px; padding: 8px 5px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2, #565951); font: inherit; font-size: 12px; line-height: 1.5; cursor: pointer; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch button[aria-pressed="true"] { background: var(--u6-paper, #f8f7f2); color: var(--ink-1, #292b26); font-weight: 600; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch small { font-size: 10px; font-weight: 400; white-space: nowrap; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch button:disabled { opacity: .5; cursor: not-allowed; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-switch button:focus-visible { outline: 2px solid var(--accent, #8c6b24); outline-offset: 2px; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description { display: grid; min-width: 0; gap: 8px; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description > span { font-size: 13px; font-weight: 500; color: var(--ink-1, #292b26); }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description textarea { box-sizing: border-box; width: 100%; min-height: 108px; max-height: 180px; padding: 12px; border: 1px solid var(--u6-line, #dedcd3); border-radius: 6px; background: var(--u6-paper, #f8f7f2); color: var(--ink-1, #292b26); caret-color: var(--ink-1, #292b26); font: inherit; font-size: 13px; line-height: 1.7; resize: vertical; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description textarea::placeholder { color: var(--ink-2, #565951); opacity: 1; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description textarea:focus-visible { outline: 2px solid var(--accent, #8c6b24); outline-offset: 3px; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-action { display: grid; gap: 10px; width: 100%; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-action p { margin: 0; color: var(--ink-2, #565951); font-size: 12px; line-height: 1.6; }
.editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-reconnect { justify-self: center; border: 0; padding: 4px 8px; background: transparent; color: var(--ink-1, #292b26); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-height: 700px) {
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-body { gap: 16px; }
  .editor-layer.ws[data-ed-demo] .ws .ed-wf-panel .ed-cutout-description textarea { min-height: 80px; }
}

/* Keep the image strip visibly scrollable; selection and redraw preserve its horizontal position. */
.editor-layer.ws[data-ed-demo] .ws .ed-history {
  scrollbar-width: thin;
  scrollbar-color: var(--u6-line) transparent;
  overscroll-behavior-x: contain;
}
.editor-layer.ws[data-ed-demo] .ws .ed-history::-webkit-scrollbar { height: 7px; }
.editor-layer.ws[data-ed-demo] .ws .ed-history::-webkit-scrollbar-thumb { background: var(--u6-line); border-radius: 4px; }

/* FONT-R1（2026-10-24 用户实测：底部版本条「N · 图层编辑…」名称浮签与「仅本机/同步中」存储徽章重叠）：
   存储徽章 in-flow 占据条目底部带；名称浮签 absolute bottom:4 居中 → 同带相撞。
   仅当条目带存储徽章时把浮签上移让位（无徽章条目＝原图/关联项原位不变）；
   title 全名、单行省略、选中/重命名/横向滚动、缩略 contain 全部不变。22=徽章带顶 20.6px+余量。 */
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:has(.ed-hist-flag) .ed-hist-label { bottom: 22px; }

/* FONT-R1b（2026-10-24 root 独立验补充：版本项同时带「未持久·内嵌」＋「仅本机」两枚相邻徽章时，
   bottom:20 只让开第一枚，浮签仍与徽章带相交）。双徽章=两枚相邻 in-flow .ed-hist-flag 叠放
   （~2×16.6px+gap），浮签再上移让出第二行；单徽章 20 / 无徽章原位两档不变。 */
/* FONT-R1b（2026-10-24 root 独立验补充：版本项同时带「未持久·内嵌」＋「仅本机」两枚相邻徽章时，
   bottom:20 只让开一枚；且 hover 时详情(top:4)与浮签之间竖向净空 < 浮签高，纯上移无解）。
   等效排版：双徽章项的两枚徽章改底带**左右并排**（绝对定位，退出列流），徽章带高度回到单枚档，
   浮签沿用 :has(.ed-hist-flag) 的 bottom:20 档 → 详情(top) / 浮签(bottom:20) / 徽章(bottom:4) 三带互不相交；
   仅双徽章项受影响，单徽章 20 / 无徽章原位两档不变。 */
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:has(.ed-hist-flag + .ed-hist-flag) .ed-hist-flag { position: absolute; bottom: 4px; z-index: 1; }
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:has(.ed-hist-flag + .ed-hist-flag) .ed-hist-flag[data-ed-hist-flag] { left: 6px; }
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item:has(.ed-hist-flag + .ed-hist-flag) .ed-hist-flag[data-ed-hist-nas] { right: 6px; }

/* Existing t2i surface: compact labelled poster fields. */
.ed-t2i-poster-fields{display:grid;gap:8px;min-width:0}.ed-t2i-poster-fields label{display:grid;gap:4px;min-width:0}.ed-t2i-poster-fields input{width:100%;min-width:0;box-sizing:border-box}

/* User-owned working layers are distinct from the linked result strip. */
.editor-layer.ws[data-ed-demo] [data-native-layer-host] .natlp-row {
  display:grid;grid-template-columns:36px minmax(0,1fr) auto auto;align-items:center;gap:6px;
  min-height:44px;padding:5px 6px 5px calc(6px + var(--native-layer-depth,0)*12px);border-radius:6px;
}
.editor-layer.ws[data-ed-demo] [data-native-layer-host] .natlp-row:has([data-layer-action="collapse"]){grid-template-columns:36px 16px minmax(0,1fr) auto auto}
.editor-layer.ws[data-ed-demo] [data-native-layer-host] .natlp-row[aria-selected="true"]{background:var(--u6-paper-deep,#e6eadf);box-shadow:inset 2px 0 var(--u6-ink,#415f50)}
.editor-layer.ws[data-ed-demo] .natlp-thumb{width:36px;height:36px;display:grid;place-items:center;overflow:hidden;border:1px solid var(--u6-line,#d1d0c6);border-radius:4px;background:repeating-conic-gradient(#ecece5 0 25%,#fafaf6 0 50%) 0/10px 10px;font-size:11px;color:#70776d}
.editor-layer.ws[data-ed-demo] .natlp-thumb canvas{width:36px;height:36px}
.editor-layer.ws[data-ed-demo] .natlp-row [data-layer-action="select"]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.editor-layer.ws[data-ed-demo] .ed-reference-sources{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.editor-layer.ws[data-ed-demo] .ed-reference-sources button{font:inherit;font-size:11px;padding:5px 9px;border:1px solid var(--u6-line,#d1d0c6);background:var(--u6-paper,#faf9f6);border-radius:6px;color:inherit;cursor:pointer}
.editor-layer.ws[data-ed-demo] .ed-return-canvas{position:fixed;left:16px;top:16px;z-index:400;pointer-events:auto;border:1px solid var(--u6-line,#d1d0c6);background:var(--u6-paper,#faf9f6);border-radius:18px;padding:7px 12px;font:inherit;font-size:12px;color:var(--u6-ink,#415f50);cursor:pointer}
.picking-canvas-reference .editor-layer{visibility:hidden!important;pointer-events:none!important}
.canvas-reference-notice{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:9999;display:flex;align-items:center;gap:16px;padding:10px 16px;background:var(--u6-paper,#faf9f6);border:1px solid var(--u6-line,#ccc);border-radius:24px;box-shadow:0 5px 20px #20332520;font-size:13px;color:#314e42}
.canvas-reference-notice button{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}

/* Keep image geometry outside the recipe dock, including its breathing room. */
.editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ws-canvas {
  right:calc(var(--ed-rail-inset,56px) + var(--ed-wf));
}
/* Tablet portrait: keep the image visible above a local layer shelf. */
@media (max-width:1100px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] {
    --ed-layer-shelf:min(250px,30dvh);
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-operation-mount {
    left:10px;right:calc(var(--ed-rail-inset,56px) + var(--ed-wf));width:auto;
    top:auto;bottom:162px;height:var(--ed-layer-shelf);
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ws-canvas {
    left:10px;bottom:calc(172px + var(--ed-layer-shelf));
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-history {left:10px}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-operation-sections {
    display:flex;flex-direction:column;overflow:auto;
  }
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-operation-section {flex:none}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-operation-section:has([data-ed-operation-section="layers"]) {order:-1}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-operation-body {flex:none;overflow:visible}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] [data-ed-operation-section="layers"] {display:flex;flex-direction:column}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] [data-native-layer-host] {order:-1}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] [data-native-layer-host]>[role="tree"] {order:-1}
}

/* Layer-first editor dock: familiar list, compact controls, optional inspectors. */
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock .ed-operation-sections{display:flex;flex-direction:column;min-height:0;overflow:auto}
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock .ed-layer-primary{flex:1 0 240px;min-height:0;border-top:0}
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock [data-ed-operation-section="layers"]{display:flex;flex-direction:column;gap:8px;min-height:100%;overflow:visible}
.editor-layer.ws[data-ed-demo] .ed-layer-secondary summary,.editor-layer.ws[data-ed-demo] .natlp-details summary{cursor:pointer;padding:8px 4px;font-size:11px;color:var(--u6-ink-soft)}
.editor-layer.ws[data-ed-demo] .ed-layer-secondary{flex:none;border-top:1px solid var(--u6-line);padding:0 8px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [data-native-layer-host]{order:0;gap:8px;min-width:0}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-controls{display:flex;gap:6px;align-items:flex-end;order:-2}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-controls label{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:10px;color:var(--u6-ink-soft)}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-blend{flex:1}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-opacity{width:64px;flex:none}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-controls :is(input,select){width:100%;font-size:11px;height:28px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [role="tree"]{order:-1;min-height:100px;border-block:1px solid var(--u6-line);padding:4px 0}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [data-native-layer-host] .natlp-row{grid-template-columns:24px 36px minmax(0,1fr) 24px;gap:4px;padding:4px 2px 4px calc(2px + var(--native-layer-depth,0)*10px);border-radius:3px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [data-native-layer-host] .natlp-row:has([data-layer-action="collapse"]){grid-template-columns:24px 36px 14px minmax(0,1fr) 24px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-row button{border:0;background:transparent;padding:2px;min-height:30px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-row [data-layer-action="select"]{font-size:11px;font-weight:500}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-row :is([data-layer-action="visible"],[data-layer-action="lock"]){display:grid;place-items:center;width:24px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-unlocked svg{opacity:.35}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer>button{width:28px;height:28px;min-height:28px;padding:4px;display:grid;place-items:center}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer [role="status"]{flex-basis:100%;font-size:11px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-details{border-top:1px solid var(--u6-line)}
@media(max-width:1100px){.editor-layer.ws[data-ed-demo] .ws[data-ed-operation-open][data-ed-wf-open] .ed-layer-dock .ed-layer-primary{flex-basis:200px}}

/* Input roles remain visible while choosing either image. */
.editor-layer.ws[data-ed-demo] .ed-input-roles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:4px 0 12px}
.editor-layer.ws[data-ed-demo] .ed-input-role{min-width:0;display:flex;flex-direction:column;gap:6px}
.editor-layer.ws[data-ed-demo] .ed-input-role header{display:flex;flex-direction:column;gap:2px}
.editor-layer.ws[data-ed-demo] .ed-input-role header strong{font-size:12px;font-weight:600}
.editor-layer.ws[data-ed-demo] .ed-input-role header small{font-size:10px;color:var(--u6-ink-soft)}
.editor-layer.ws[data-ed-demo] .ed-role-preview{display:flex;position:relative;align-items:center;justify-content:center;width:100%;height:84px;min-height:84px;padding:0;overflow:hidden;border:1px solid var(--u6-line);border-radius:6px;background:var(--ctl-hover);color:var(--u6-ink-soft)}
.editor-layer.ws[data-ed-demo] button.ed-role-preview{cursor:pointer}
.editor-layer.ws[data-ed-demo] .ed-role-preview img{width:100%;height:100%;object-fit:contain}
.editor-layer.ws[data-ed-demo] .ed-role-preview>span:not(.ed-role-placeholder){position:absolute;bottom:0;inset-inline:0;padding:3px;background:var(--u6-paper);font-size:10px}
.editor-layer.ws[data-ed-demo] .ed-role-placeholder{display:grid;place-items:center;width:100%;height:100%}
.editor-layer.ws[data-ed-demo] .ed-role-name{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:16px}
.editor-layer.ws[data-ed-demo] .ed-input-role>button:not(.ed-role-preview),.editor-layer.ws[data-ed-demo] .ed-role-sources button{min-height:28px;border:1px solid var(--u6-line);border-radius:4px;background:var(--u6-paper);color:inherit;font:inherit;font-size:10px;padding:4px;cursor:pointer}
.editor-layer.ws[data-ed-demo] .ed-role-sources{display:flex;gap:4px}.editor-layer.ws[data-ed-demo] .ed-role-sources button{flex:1;white-space:nowrap}
.editor-layer.ws[data-ed-demo] .ws .ed-composer .ed-references{flex:1;min-width:0;max-height:110px;padding:4px 0;overflow:auto}
.editor-layer.ws[data-ed-demo] .ed-reference-heading{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.editor-layer.ws[data-ed-demo] .ed-reference-heading strong{font-size:11px;font-weight:600}.editor-layer.ws[data-ed-demo] .ed-reference-heading small{font-size:9px}

/* The open image stays marked independently of Ctrl comparison selections. */
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item[aria-current="true"]{outline:2px solid var(--accent-ui);outline-offset:2px}
.editor-layer.ws[data-ed-demo] .ws .ed-hist-item[aria-current="true"] .ed-hist-label{color:var(--accent-ui);font-weight:600}

.editor-layer.ws[data-ed-demo] .ed-up-panel .ed-input-roles .ed-role-sources button{min-width:0;padding:6px 4px;font-size:11px;white-space:nowrap}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer [data-native-clip-warning]{flex-basis:100%}

/* Image layers use the current native document, independent of the result chain. */
.editor-layer.ws[data-ed-demo] .ed-layer-dock .ed-layer-import{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;order:-1}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .ed-layer-import button{min-width:0;padding:5px 4px;min-height:28px;border:1px solid var(--u6-line);border-radius:4px;background:var(--u6-paper);color:inherit;font:inherit;font-size:11px;white-space:nowrap;cursor:pointer}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .ed-layer-import small{grid-column:1/-1;font-size:10px;color:var(--u6-ink-soft)}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [data-native-image-file][hidden]{display:none}


.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-thumb[role="button"]{cursor:pointer}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-thumb[aria-pressed="true"]{outline:1px solid var(--accent-ui);outline-offset:1px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock [data-native-layer-host] .natlp-row.natlp-has-mask{grid-template-columns:22px 30px 30px minmax(0,1fr) 22px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-has-mask .natlp-thumb{width:30px;height:30px;min-height:30px;padding:0}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-has-mask .natlp-thumb canvas{width:30px;height:30px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer [data-layer-mask]{flex-basis:100%;min-width:0;margin:6px 0;padding:6px;border:1px solid var(--u6-line);font-size:11px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-footer [data-layer-mask][hidden]{display:none}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-mask-advanced{margin-top:6px;font-size:10px}
.editor-layer.ws[data-ed-demo] .ed-layer-dock .natlp-mask-advanced summary{cursor:pointer;color:var(--u6-ink-soft)}

/* History settings and long lists must not paint over the layer/file controls. */
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock .ed-layer-primary {
  flex: 0 0 auto; min-height: min-content;
}
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock [data-ed-operation-section="layers"] {
  flex: none; min-height: 0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-layer-dock [data-ed-operation-section="history"] {
  max-height: 280px; overflow: auto;
}
.editor-layer.ws[data-ed-demo] .ed-history-settings { display: grid; gap: 6px; margin-bottom: 8px; }
.editor-layer.ws[data-ed-demo] .ed-history-settings label { display: flex; align-items: center; gap: 8px; }
.editor-layer.ws[data-ed-demo] .ed-history-settings input { width: 64px; }
.editor-layer.ws[data-ed-demo] .ed-history-settings small { color: var(--u6-ink-soft); line-height: 1.5; }

/* Layer dragging shows the destination without changing the live stack. */
.editor-layer.ws[data-ed-demo] .natlp-row[data-native-drop-edge="above"] { box-shadow: inset 0 2px var(--accent-ui,currentColor); }
.editor-layer.ws[data-ed-demo] .natlp-row[data-native-drop-edge="below"] { box-shadow: inset 0 -2px var(--accent-ui,currentColor); }
.editor-layer.ws[data-ed-demo] .natlp-row[data-native-row-dragging] { opacity: .65; }
/* The current editor shell owns the narrow viewport inset. */
@media (max-width:649px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:not([data-ed-operation-open]) .ws-canvas {left:12px}
}

.editor-layer.ws[data-ed-demo] .ws [data-wf-detail="builtin-flux2"] .ed-wf-tiles {grid-template-columns:repeat(4,minmax(0,1fr))}

/* Short narrow windows scroll recipe and composer together instead of
   compressing the template body to a few pixels. */
@media (max-width:649px) and (max-height:700px) {
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view="detail"]) .ed-rail {display:block;overflow:auto;overscroll-behavior:contain;pointer-events:auto}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open] .ed-wf-mount,
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open] .ed-wf-panel {display:block;height:auto;overflow:visible}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open] .ed-wf-mount .ed-wf-body {height:auto;min-height:0;max-height:none;overflow:visible;flex:none}
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open] .ed-composer {height:auto;max-height:none;overflow:visible;margin-top:10px}
}

/* The opening shell shares the canvas loading rhythm; the gate remains the exit surface. */
.editor-layer .ed-loading-gate .ed-opening-status { top:48px; padding:8px 12px; border-color:transparent; pointer-events:none; }

/* HW55/56: retain the existing actions and two left-side horizontal strips.
   The bottom action band is outside both the image and the result chain. */
.editor-layer.ws[data-ed-demo] .ed-navigation-controls {
  position:fixed; left:16px; top:32px; z-index:400;
  display:flex; align-items:center; gap:4px; padding:4px;
  border:1px solid var(--u6-line); border-radius:var(--r-ctl,6px);
  background:var(--u6-paper); pointer-events:auto;
}
.editor-layer.ws[data-ed-demo] .ed-navigation-controls > button {
  position:static; display:flex; align-items:center; justify-content:center;
  width:auto; min-width:32px; min-height:32px; padding:6px 8px;
  border:0; border-radius:4px; background:transparent; color:var(--u6-ink);
  font:inherit; font-size:12px; cursor:pointer;
}
.editor-layer.ws[data-ed-demo] .ed-navigation-controls > button:hover { background:var(--ctl-hover); }
.editor-layer.ws[data-ed-demo] .ed-navigation-controls > button:focus-visible { outline:2px solid var(--accent-ui); outline-offset:1px; }
.app-frame:has(.editor-layer[data-ed-demo]) .left-rail .bl-control { display:none; }
.app-frame:has(.editor-layer[data-ed-demo]) .canvas-shell > .left-rail { pointer-events:none; }
.app-frame:has(.editor-layer[data-ed-demo]) .left-rail .bl-control > button {
  flex:1; width:auto; height:32px; min-height:32px;
}
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-toolbar,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-toolbar { bottom:60px; }
.editor-layer.ws[data-ed-demo] .ws .ed-toolbar > .ed-workflow-tools {
  position:static !important; width:32px;
  display:flex; flex-direction:column; align-items:center; gap:4px; padding:4px;
  border:1px solid var(--u6-line); border-radius:var(--r-ctl,6px);
  background:var(--u6-paper);
}
.editor-layer.ws[data-ed-demo] .ws .ed-workflow-tools > .ed-tsep { display:none; }
.editor-layer.ws[data-ed-demo] .ws .ed-workflow-tools > .ed-tool { grid-row:2; width:32px; height:32px; }
.editor-layer.ws[data-ed-demo] .ws .ed-workflow-tools > [data-ed-tool="workflow"] { grid-row:1; grid-column:3; margin-right:0; }
.editor-layer.ws[data-ed-demo]:not(.ed-composer-docked) .ws .ed-rail,
.editor-layer.ws[data-ed-demo].ed-composer-docked .ws .ed-rail { bottom:60px; }
.editor-layer.ws[data-ed-demo] .ws .ed-history { bottom:60px; }
.editor-layer.ws[data-ed-demo] .ws .ws-canvas { top:44px; bottom:192px; }
/* Keep reference controls in flow; the bounded composer owns vertical scrolling. */
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified > .ed-generation-references,
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified > .gen-composer {flex:0 0 auto;}

.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-references {max-height:none;overflow:hidden;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified > :is([data-ed-wf-rstat],[data-ed-draft-status],[data-ed-c-note]) {flex:0 0 auto;line-height:1.4;overflow-wrap:anywhere;}

/* HW59: one content inset and one scroll owner for recipe selection and input.
   Natural panel heights prevent the catalogue from painting through the composer. */
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail {
  display:flex; flex-direction:column; overflow:auto; overscroll-behavior:contain; pointer-events:auto;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount {
  display:flex; flex:1 0 auto; height:auto; min-height:0; min-width:0; width:100%; overflow:visible;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount .ed-wf-panel[data-wf-view] {
  flex:1 0 auto; height:auto; min-height:0; min-width:0; width:100%; padding:10px 12px; overflow:visible; box-sizing:border-box;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount .ed-wf-panel[data-wf-view] :is(.ed-wf-body,.ed-wf-listbody) {
  flex:0 0 auto; height:auto; min-height:0; max-height:none; overflow:visible; padding-inline:0;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount .ed-wf-panel[data-wf-view] :is(.ed-wf-dhead,.ed-wf-catrow) {padding-inline:0;}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-composer.ed-generation-unified {
  flex:0 0 auto; height:auto; max-height:none; overflow:visible; margin-top:0;
}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-generation-fields .gen-ctl {height:28px;align-items:center;}
.editor-layer.ws[data-ed-demo] .ws .ed-composer.ed-generation-unified .ed-generation-fields :is(select,.gen-model-trigger) {height:26px;box-sizing:border-box;}
@media (max-width:649px) {
  /* Leave the accepted return strip reachable at real browser zoom. */
  .editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail:has(.ed-wf-panel) {top:44px;}
}
.editor-layer.ws[data-ed-demo] .ws .ed-wf-head .ed-wf-close {margin-left:auto;}
/* A selected texture adds delete; keep every label inside its reference column. */
.editor-layer.ws[data-ed-demo] .ed-tx-panel .ed-role-sources {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
.editor-layer.ws[data-ed-demo] .ed-tx-panel .ed-role-sources [data-tx-remove] {grid-column:1/-1;}

/* HW59: bound the catalogue, not the entire recipe. Keep the prompt beside
   the image; the rail still scrolls naturally for expanded settings/zoom. */
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount:has(> :is([data-wf-detail="builtin-flux2"],[data-wf-detail="__ideogram-t2i"])),
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has(.ed-wf-panel[data-wf-view]) .ed-rail .ed-wf-mount .ed-wf-panel[data-wf-view]:is([data-wf-detail="builtin-flux2"],[data-wf-detail="__ideogram-t2i"]) {
  flex:0 0 auto;
}
.editor-layer.ws[data-ed-demo] .ws [data-wf-detail="builtin-flux2"] .ed-wf-tplbar {
  flex:0 0 auto; max-height:136px; overflow-y:auto; scrollbar-width:thin;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has([data-wf-detail="builtin-flux2"],[data-wf-detail="__ideogram-t2i"]) .ed-composer.ed-generation-unified {
  padding-block:8px; gap:4px;
}
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has([data-wf-detail="builtin-flux2"],[data-wf-detail="__ideogram-t2i"]) .ed-generation-unified .gen-composer .gen-prompt-box [data-ed-composer-input] {
  min-height:64px; height:64px; resize:vertical;
}
.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] .ed-t2i-poster-fields {
  padding-block:0; gap:4px;
}
.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] .ed-t2i :is(details,[data-t2i-refresh]) {
  margin-block:0;
}
.editor-layer.ws[data-ed-demo] .ws [data-wf-detail="builtin-flux2"] .rp-body > .rp-input {
  padding-block:4px;
}
.editor-layer.ws[data-ed-demo] .ws [data-wf-detail="builtin-flux2"] .rp-input h3 { margin-bottom:4px; }
.editor-layer.ws[data-ed-demo] .ws [data-wf-detail="builtin-flux2"] .xu-input-thumb { width:40px; height:40px; flex-basis:40px; }
.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] .ed-t2i details {
  padding-block:4px;
}
.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] .ed-t2i details > summary {
  min-height:32px; display:list-item; align-content:center;
}
.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] .ed-t2i [data-t2i-results]:empty { display:none; }
/* Empty status regions must not reserve an extra row between task controls. */
.editor-layer.ws[data-ed-demo] .ws[data-ed-wf-open]:has([data-wf-detail="builtin-flux2"],[data-wf-detail="__ideogram-t2i"]) .ed-composer.ed-generation-unified > :is([data-ed-wf-rstat],[data-ed-draft-status],[data-ed-c-note]):empty {
  display:none;
}

.editor-layer.ws[data-ed-demo] [data-wf-detail="__ideogram-t2i"] [data-ed-t2i-mount] .ed-t2i { padding-block:0; }
/* Match the central preview's lower edge to the image stage above history. */
.editor-layer.ws[data-ed-demo].ed-poster-mode .ed-poster-layout-preview { top:44px; bottom:192px; }

/* The requested result chain stays thumbnail-only, including hover and focus. */
.editor-layer.ws[data-ed-demo] .ws .ed-history .ed-hist-label,
.editor-layer.ws[data-ed-demo] .ws .ed-history .ed-hist-detail,
.editor-layer.ws[data-ed-demo] .ws .ed-history .ed-hist-flag,
.editor-layer.ws[data-ed-demo] .ws .ed-history .ed-hist-item:is(:hover,:focus-visible) :is(.ed-hist-label,.ed-hist-detail,.ed-hist-flag) { display:none; }
