.edit-workbench { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:16px; min-width:0; margin:0 0 16px; padding:12px 16px; border:1px solid var(--soft-line,var(--line)); border-radius:12px; background:var(--side); }
.workbench-heading { display:flex; grid-column:1; grid-row:1; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.workbench-heading strong { margin-right:auto; font-size:16px; line-height:1.5; }
.workbench-heading .text-button { min-height:44px; padding:8px 12px; border-radius:8px; font-size:14px; }
.workbench-heading .text-button:hover:not(:disabled) { background:var(--surface); }
.workbench-changes,.preset-list,.preset-preview-list { list-style:none; padding:0; margin:12px 0; }
.workbench-changes { grid-column:1/-1; max-height:216px; margin:8px 0 0; overflow:auto; scrollbar-gutter:stable; scrollbar-width:thin; }
.workbench-changes:has(> li.subtle:only-child) { display:none; }
.workbench-changes li,.preset-preview-list li { display:flex; align-items:center; gap:12px; min-height:52px; padding:12px 0; border-top:1px solid var(--soft-line,var(--line)); font-size:14px; }
.workbench-changes input,.preset-preview-list input { flex:none; width:20px; height:20px; min-height:20px; margin:0; accent-color:var(--accent); }
.workbench-change-caption,.preset-preview-list li>div { flex:1; min-width:0; }
.workbench-change-caption span,.workbench-change-caption small,.preset-preview-list span,.preset-preview-list small { display:block; overflow-wrap:anywhere; }
.workbench-change-caption small,.preset-preview-list small { max-height:88px; overflow:auto; margin-top:4px; color:var(--muted); font-size:13px; line-height:1.5; white-space:pre-wrap; }
.workbench-change-caption small.form-error { color:var(--accent); }
.workbench-changes .text-button { flex:none; max-width:152px; min-height:44px; padding-inline:8px; font-size:13px; text-align:right; }
.workbench-presets { grid-column:1/-1; min-width:0; margin-top:12px; border-top:1px solid var(--soft-line,var(--line)); }
.workbench-presets:not([open]) { grid-column:2; grid-row:1; margin-top:0; border-top:0; }
.workbench-presets summary { min-height:44px; padding:10px 0; font-size:14px; line-height:24px; font-weight:700; cursor:pointer; }
.workbench-presets summary::marker { color:var(--muted); }
.workbench-presets p { max-width:80ch; font-size:14px; line-height:1.6; }
.preset-create { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:16px; }
.preset-create input { flex:1 1 220px; min-width:0; max-width:440px; min-height:44px; font-size:15px; background:var(--page); }
.preset-create .button { min-height:44px; font-size:14px; }
.preset-list { margin-bottom:0; }
.preset-list li { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:8px 0; border-top:1px solid var(--soft-line,var(--line)); font-size:14px; }
.preset-list li>span { min-width:0; margin-right:auto; overflow-wrap:anywhere; }
.preset-list .text-button { min-height:44px; font-size:14px; }
.preset-dialog { width:min(800px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); overflow:auto; padding:24px; border:1px solid var(--soft-line,var(--line)); border-radius:14px; background:var(--side); color:var(--text); }
.preset-dialog::backdrop { background:var(--scrim); }
.preset-dialog h2 { margin-bottom:8px; font-size:24px; line-height:1.3; overflow-wrap:anywhere; }
.preset-dialog>.subtle { font-size:14px; line-height:1.6; }
.preset-targets { display:grid; gap:16px; margin:20px 0; }
.preset-target { display:grid; grid-template-columns:minmax(120px,1fr) minmax(160px,2fr); align-items:center; gap:12px; font-size:14px; }
.preset-target select { min-width:0; width:100%; min-height:44px; font-size:15px; background:var(--page); }
.preset-preview-list { max-height:45dvh; overflow:auto; scrollbar-width:thin; }
.preset-dialog .dialog-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; margin-top:20px; }
.preset-dialog .dialog-actions .button { min-height:44px; font-size:15px; }
@media(max-width:600px) {
  .edit-workbench { grid-template-columns:minmax(0,1fr); padding:10px 12px; }
  .workbench-heading { flex-wrap:nowrap; gap:4px; }
  .workbench-heading strong { min-width:0; margin-right:auto; font-size:14px; overflow-wrap:anywhere; }
  .workbench-heading .text-button { flex:none; min-width:44px; padding:8px 6px; font-size:13px; }
  .workbench-presets:not([open]) { grid-column:1; grid-row:auto; }
  .workbench-changes li { flex-wrap:wrap; align-items:flex-start; }
  .workbench-changes input { margin-top:4px; }
  .workbench-changes .text-button { margin-left:32px; max-width:none; padding:4px 0; }
  .preset-create input { flex-basis:100%; max-width:none; }
  .preset-create .button { width:100%; }
  .preset-target { grid-template-columns:minmax(0,1fr); gap:8px; }
  .preset-dialog { padding:20px 16px; max-height:calc(100dvh - 24px); }
  .preset-dialog h2 { font-size:22px; }
}
