/* Shared command geometry and browse-row ownership. */
.media-param-grid .content-editor,.scene-field .content-editor,.entry-maintenance-fields .content-editor,.scene-ai-change .content-editor,.ai-pool-fields .content-editor,#modal-visual-editor .content-editor{box-sizing:border-box;width:100%;min-width:0;max-width:100%;border:0;border-bottom:1px solid var(--line2);border-radius:0;background:transparent;box-shadow:none;color:var(--text);font:inherit;font-size:16px;line-height:1.65;padding:8px 12px;min-height:44px;max-height:240px;field-sizing:content;resize:vertical;overflow:auto;transition:border-color .16s ease,box-shadow .16s ease}
.media-param-grid .content-editor:hover,.scene-field .content-editor:hover,.entry-maintenance-fields .content-editor:hover,.scene-ai-change .content-editor:hover,.ai-pool-fields .content-editor:hover,#modal-visual-editor .content-editor:hover{border-bottom-color:var(--muted)}
.media-param-grid .content-editor:focus-visible,.scene-field .content-editor:focus-visible,.entry-maintenance-fields .content-editor:focus-visible,.scene-ai-change .content-editor:focus-visible,.ai-pool-fields .content-editor:focus-visible,#modal-visual-editor .content-editor:focus-visible{outline:0;border-bottom-color:var(--accent);box-shadow:inset 0 -1px 0 var(--accent)}
@media(prefers-reduced-motion:reduce){.content-editor{transition:none}}
[hidden],[data-menu-command]{display:none!important}
.shared-action-menu{position:fixed;inset:auto;margin:0;width:240px;max-width:calc(100vw - 24px);padding:5px;border:1px solid var(--line2);border-radius:8px;background:var(--panel);color:var(--text);box-shadow:var(--shadow);overflow:auto}
.shared-action-menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:9px 11px;border:0;border-radius:4px;background:transparent;color:inherit;font:14px/1.4 var(--font-ui);text-align:left}
.scene-ai-field{border-left:2px solid var(--accent);padding:8px 10px;background:transparent;border-radius:0}.scene-ai-marker{display:flex;gap:6px;align-items:center;color:var(--accent);font-size:12px;line-height:1.5}.scene-ai-marker[hidden]{display:none}.scene-ai-marker svg,.scene-ai-command svg{width:16px;height:16px;flex:none}.scene-ai-command{display:inline-flex;align-items:center;gap:6px;background:var(--accent-bg);color:var(--accent)}
.scene-supplement-dialog input[type=checkbox]{width:18px;min-width:18px;max-width:18px;height:18px;flex:0 0 18px;margin:0;accent-color:var(--accent)}
.scene-supplement-dialog{width:min(960px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:18px;background:var(--panel);color:var(--text)}.scene-supplement-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:14px}.scene-supplement-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.scene-supplement-dialog h2{font-size:20px;margin:0}.scene-supplement-body{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:0;overflow:hidden;gap:18px}.supplement-list{overflow:auto;max-height:54dvh}.supplement-row{display:flex;align-items:center;gap:8px;padding:10px 6px;border-bottom:1px solid var(--line)}.supplement-row.active{background:var(--accent-bg)}.supplement-row>button{flex:1;min-width:0;text-align:left;background:none;border:0;color:inherit;font:inherit}.supplement-row strong,.supplement-row small{display:block;overflow-wrap:anywhere}.supplement-row strong{font-size:14px}.supplement-row small{font-size:12px;color:var(--soft);margin-top:4px}.supplement-preview{overflow:auto;min-width:0;max-height:54dvh}.supplement-preview h3{font-size:15px;margin:0 0 10px}.supplement-original{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:14px}.supplement-preview input:not([type=checkbox]),.supplement-preview textarea{width:100%;box-sizing:border-box;font-size:16px}.supplement-preview .scene-field>span{display:flex;align-items:center;gap:6px}.supplement-status{font-size:13px;overflow-wrap:anywhere;margin:0;color:var(--muted)}.scene-supplement-dialog>footer{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}.scene-supplement-dialog>footer button{min-height:44px;font-size:13px}@media(max-width:600px){.scene-supplement-dialog{padding:14px}.scene-supplement-body{grid-template-columns:minmax(0,1fr);gap:12px;overflow:auto}.supplement-list{max-height:150px}.supplement-preview{max-height:none;overflow:visible}.scene-supplement-dialog>footer button{flex:1;white-space:nowrap}}
.shared-action-menu button:hover,.shared-action-menu button:focus-visible{background:var(--accent-bg);outline:0}.shared-action-menu button:disabled{opacity:.4;cursor:default}.shared-action-menu button.danger-icon{color:var(--bad)}.shared-action-menu button.danger-icon:hover,.shared-action-menu button.danger-icon:focus-visible{color:var(--bad);background:color-mix(in srgb,var(--bad) 12%,var(--panel))}
.shared-action-menu svg{width:18px;height:18px;flex:none}
.lexi-select{display:inline-flex;position:relative;min-width:0;max-width:100%;width:100%;vertical-align:middle}
select.lexi-select-source{position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;padding:0!important;border:0!important;opacity:0;clip-path:inset(50%);pointer-events:none;appearance:none!important}
.lexi-select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;min-width:0;padding:9px 13px;border:1px solid var(--line2);border-radius:8px;background:var(--panel2);color:var(--text);font:600 14px/1.4 var(--font-ui);text-align:left;cursor:pointer}.lexi-select-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lexi-select-trigger>svg{width:18px;height:18px;flex:none}.lexi-select-trigger:hover,.lexi-select-trigger:focus-visible{border-color:var(--accent);background:var(--accent-bg)}.lexi-select-trigger:disabled{opacity:.45;cursor:default}
.shared-select-menu button{font-weight:600;min-height:44px}.shared-select-menu [aria-selected="true"]{color:var(--accent);background:var(--accent-bg)}
.shared-select-menu button>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-filter-trigger{border-radius:8px;min-height:44px;border-color:var(--line2)}.history-filter-trigger span,.history-filter-trigger b{font:600 14px/1.4 var(--font-ui)}.history-filter-menu{border-radius:8px}.history-filter-menu button{font:600 14px/1.4 var(--font-ui);min-height:44px}
.scene-filter-bar>.lexi-select{flex:0 1 170px;width:auto;min-width:120px}.folder-toolbar>.lexi-select{align-self:stretch}
.learning-selection-bar,.selection-session{display:flex;align-items:center;gap:12px;padding:0;margin-left:auto;flex-wrap:nowrap;justify-content:flex-end;min-width:0}
.learning-selection-bar>.selection-count,.selection-session>#history-selection-count{white-space:nowrap;font:500 13px/1.5 var(--font-ui);color:var(--muted)}
.selection-cancel{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 6px;border:0;border-radius:4px;background:none;color:var(--accent);font:500 13px/1.5 var(--font-ui);white-space:nowrap;cursor:pointer}.selection-cancel:hover,.selection-cancel:focus-visible{background:var(--accent-bg)}
.batch-selection-toolbar{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:8px 0;margin:0;border-block:1px solid var(--line);min-width:0;flex-wrap:nowrap}
.selection-controls,.selection-operations{display:flex;align-items:center;gap:6px;min-width:0}.selection-operations{border-left:1px solid var(--line2);padding-left:12px}
.batch-selection-toolbar .icon-btn{width:40px;height:40px;min-width:40px;flex:none}
.selection-all{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 4px;font:500 13px/1.5 var(--font-ui);white-space:nowrap;cursor:pointer}.selection-all input{width:18px;height:18px;margin:0;accent-color:var(--accent)}
.selection-header-active.action-row>:not(.selection-session),.selection-header-active .scene-actions>:not(.learning-selection-bar),.selection-header-active .folder-head-actions>:not(.learning-selection-bar){display:none!important}
.batch-selection-toolbar~.scene-workspace{margin-top:0}
.learning-selection-bar .icon-btn,.scene-organize-actions .icon-btn{width:40px;height:40px;min-width:40px;flex:none}
.section-head:has([data-select-mode][aria-pressed="true"]) .scene-actions>[data-scene-action],.folder-content-head:has([data-select-mode][aria-pressed="true"]) .folder-head-actions>button{display:none}
.scene-library-head .scene-actions:has([data-select-mode][aria-pressed="true"])>:not(.learning-selection-bar){display:none}
.history-item.selection-active,.history-item.selectable{display:grid;grid-template-columns:24px minmax(0,1fr);align-items:start;gap:10px}
.history-item.selection-active>.history-copy,.history-item.selectable>.history-copy{grid-column:2;grid-row:1;min-width:0}
.history-item.selection-active>.learning-row-check,.history-item.selectable>.history-select-btn{grid-column:1;grid-row:1;padding:4px 0;justify-content:center}
.history-item.selection-active>.history-actions,.history-item.selection-active>.scene-organize-actions{display:none}
.history-item.selection-active .history-word{padding-right:0;min-height:0}
.history-copy{min-width:0}.compact-date{color:var(--soft);font-size:12px;white-space:nowrap}.compact-date:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.scene-master .learning-selectable-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:center;min-width:0;border-bottom:1px solid var(--line)}
.scene-master .learning-selectable-row.active{background:var(--accent-bg);box-shadow:inset 3px 0 var(--accent)}
.scene-master .learning-selectable-row.selection-active{grid-template-columns:24px minmax(0,1fr)}
.scene-master .learning-selectable-row.selection-active>[data-list-favorite]{display:none}
.scene-master .scene-list-row{display:grid;grid-template-columns:56px minmax(0,1fr);align-items:start;gap:10px;min-height:76px;padding:10px 8px;border:0;box-shadow:none;background:none}
.scene-master .scene-list-row.active{box-shadow:none;background:none}
.scene-master .scene-thumb{width:56px;height:56px;border-radius:6px}
.scene-master .scene-list-copy{display:grid;gap:3px;min-width:0;align-content:start}
.scene-master .scene-list-copy strong,.scene-master .scene-list-copy>span{font-size:13px;line-height:18px;min-width:0}
.scene-master .scene-list-copy strong a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scene-master .scene-list-copy small{display:flex;gap:7px;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px}
.scene-master .scene-list-copy small>span{min-width:0;overflow:hidden;text-overflow:ellipsis}.scene-master .scene-list-copy small svg{width:12px;height:12px;flex:none}
#scene-hub .scene-browse-tools .scene-filter-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0;padding:0}
#scene-hub .scene-filter-bar select{appearance:auto;min-width:0;max-width:180px;min-height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:var(--panel2);color:var(--text);font:14px/1.4 var(--font-ui);flex:0 1 auto}
#scene-hub .scene-browse-tools{gap:10px;padding:10px 0 12px}
.scene-editor #scene-editor-form>footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 18px;background:var(--panel);border-top:1px solid var(--line)}
.scene-editor .scene-field-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}.scene-editor .scene-field-pair>.scene-field{min-width:0}
.scene-editor .scene-drop{padding:0;border:0;gap:10px}.scene-drop-target{display:grid;justify-items:center;align-content:center;gap:8px;width:100%;min-height:130px;padding:18px 12px;border:1px dashed var(--line2);border-radius:6px;background:var(--panel2);color:var(--text);font:inherit;text-align:center;cursor:pointer}.scene-drop-target>svg{width:26px;height:26px;color:var(--accent)}.scene-drop-target>strong{font-size:14px;font-weight:600}.scene-drop-target small{font-size:12px;line-height:1.5}.scene-drop-target:hover,.scene-drop-target:focus-visible,.dragging .scene-drop-target{background:var(--accent-bg);border-color:var(--accent)}
.scene-selection-highlight{position:fixed;inset:auto;margin:0;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:7px 12px;border:1px solid var(--line2);border-radius:6px;background:var(--panel);color:var(--text);font:600 13px/1.4 var(--font-ui);box-shadow:var(--shadow);cursor:pointer}.scene-selection-highlight:not(:popover-open){display:none!important}
.scene-editor .scene-editor-body{gap:16px}.scene-editor .scene-editor-section{gap:12px}.scene-editor .scene-editor-section+.scene-editor-section{padding-top:16px}.scene-editor .scene-source-fields{min-width:0}
.scene-editor footer>[data-scene-action="save"]{min-height:40px;white-space:nowrap;padding:9px 18px}.scene-editor footer>[data-editor-more]{width:40px;height:40px;min-width:40px}
.scene-editor footer>.scene-save-query{min-height:40px;min-width:176px;padding:9px 18px;transition:background-color 180ms,border-color 180ms,color 180ms}.scene-editor footer>.scene-save-query[data-active="true"]{color:var(--accent);background:var(--accent-bg);border-color:var(--accent)}
@media(max-width:600px){.scene-editor footer>.scene-save-query{flex:1;min-width:0;min-height:44px;white-space:normal;font-size:13px;padding:8px 10px}.scene-editor #scene-editor-form>footer{align-items:stretch}.scene-editor footer>[data-scene-action="save"]{font-size:13px;padding:8px 10px;white-space:normal}}
@media(prefers-reduced-motion:reduce){.scene-editor footer>.scene-save-query{transition:none}}
.home-compact-bar{position:fixed;top:4px;left:max(20px,calc((100vw - var(--max))/2 + 20px));right:max(20px,calc((100vw - var(--max))/2 + 20px));height:64px;box-sizing:border-box;z-index:960;display:flex;align-items:center;gap:7px;padding:8px 12px;border:1px solid var(--line);border-radius:32px;background:var(--panel);box-shadow:var(--shadow)}
.compact-query-summary{display:flex;align-items:center;gap:12px;flex:1;min-width:0;height:44px;padding:0 10px;border:0;background:transparent;color:var(--text);font:600 16px/1.4 var(--font-ui);text-align:left}.compact-query-summary>span{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.compact-query-summary small{color:var(--accent);font-size:12px;white-space:nowrap}.home-compact-bar .icon-btn{width:40px;height:40px;min-width:40px}
.compact-query-disclosure{display:grid;place-items:center;flex:none;width:28px;min-width:28px;height:44px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--muted)}.compact-query-disclosure svg{width:18px;height:18px}.compact-query-disclosure:hover,.compact-query-disclosure:focus-visible{background:var(--accent-bg);color:var(--accent)}
.home-compact-bar [data-home-run]{background:var(--accent-bg);border-color:var(--line2);color:var(--accent)}
.lookup-folder-trigger{grid-template-columns:18px auto minmax(0,1fr) auto}.lookup-folder-trigger>svg{width:18px;height:18px;flex:none;color:var(--accent)}
body.home-scrolled #view-home .workspace{display:block;padding-top:var(--home-sticky-height,82px)}
body.home-scrolled #view-home .result-pane{width:100%;height:auto;min-width:0;max-width:none;grid-column:1/-1}
body.home-scrolled #view-home .editor-pane:not(:popover-open){display:none!important}
body.home-scrolled #view-home .editor-pane:popover-open{position:fixed!important;inset:auto;top:var(--query-panel-top,76px)!important;left:auto;right:max(20px,calc((100vw - var(--max))/2 + 20px));width:min(880px,calc(100vw - 40px));min-height:0;max-height:min(420px,var(--query-panel-height,70dvh));margin:0;padding:12px;display:block;overflow:auto;border:1px solid var(--line2);border-radius:8px;background:var(--panel);color:var(--text);box-shadow:var(--shadow)}
body.home-scrolled #view-home .editor-pane .query-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
body.home-scrolled #view-home .editor-pane .query-shell{grid-column:1/-1;grid-row:auto;height:auto;min-height:0;border-radius:8px;box-shadow:none}
body.home-scrolled #view-home .editor-pane #query-input{height:44px;min-height:44px;max-height:136px;padding:10px 48px 10px 12px;font-size:16px;line-height:24px;white-space:pre-wrap;overflow:auto;resize:none}
body.home-scrolled #view-home .editor-pane .query-shell .clear-query-btn{top:8px;right:8px;transform:none}
body.home-scrolled #view-home .editor-pane .assist-fields,body.home-scrolled #view-home .editor-pane .lookup-folder-strip{position:static;grid-column:auto;grid-row:auto;width:auto;min-width:0;height:auto;min-height:42px;margin:0}
body.home-scrolled #view-home .editor-pane .assist-fields,body.home-scrolled #view-home .editor-pane .lookup-folder-trigger{border-radius:8px}
body.home-scrolled #view-home .editor-pane .query-actions,body.home-scrolled #view-home .editor-pane .lookup-options-toggle{display:none}
body.home-scrolled #view-home .editor-pane .lookup-queue{max-height:160px;overflow:auto;margin-top:10px}
@media(max-width:900px){
 .lookup-folder-trigger{grid-template-columns:18px minmax(0,1fr)}
 .lexi-select-trigger{font-size:16px}.scene-filter-bar>.lexi-select{flex:none;min-width:145px;max-width:190px}.scene-editor .scene-field-pair{grid-template-columns:minmax(0,1fr)}
 .folder-content-head.selection-header-active{grid-template-columns:minmax(0,1fr) auto;gap:8px}.folder-content-head.selection-header-active:has(>.folder-mobile-back){grid-template-columns:32px minmax(0,1fr) auto}
 .folder-content-head.selection-header-active .folder-head-actions{grid-column:-2;grid-row:1;justify-content:flex-end}.folder-content-head.selection-header-active>div:not(.folder-head-actions){min-width:0}
 .folder-content-head.selection-header-active h2{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-content-head.selection-header-active p{font-size:12px}
 .home-compact-bar{top:0;left:0;right:0;border-radius:0 0 12px 12px;height:64px;padding:8px;gap:3px}.home-compact-bar .icon-btn{width:44px;height:44px;min-width:44px}.compact-query-summary{padding:0 6px}.compact-query-summary small{max-width:64px;overflow:hidden;text-overflow:ellipsis}
 body.home-scrolled #view-home .editor-pane:popover-open{left:8px;right:8px;width:auto;padding:12px}
 body.home-scrolled #view-home .editor-pane .query-row{grid-template-columns:minmax(0,1fr)}
 .learning-selection-bar .icon-btn,.scene-organize-actions .icon-btn{min-height:44px;height:44px}
 #scene-hub .scene-browse-tools .scene-filter-bar{flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px}#scene-hub .scene-filter-bar select{flex:none;font-size:16px;max-width:170px}
 .scene-editor #scene-editor-form>footer{padding:10px 12px}.scene-editor footer>[data-scene-action="save"]{flex:1;min-height:44px}.scene-editor footer>[data-editor-more]{height:44px;min-width:44px}
}
