/* Shared current resource library. */
/* Editor overlay reuses the library's tabs, controls and cards. It never resizes the canvas. */
.resource-drawer{position:fixed;inset:0 0 0 auto;margin:0;padding:0;width:min(640px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;border:0;border-left:1px solid var(--line);background:var(--app-surface);color:var(--ink);box-shadow:var(--app-shadow-overlay);overflow:hidden;z-index:240}
.resource-drawer[open]{display:flex;flex-direction:column;animation:resource-drawer-in .16s ease-out}
.resource-drawer .workspace-header{--workspace-header-inset:16px;flex-shrink:0}
.resource-drawer h2{font-size:var(--type-body-emphasis);margin:0 0 4px;line-height:1.5}
.resource-drawer .resource-page{flex:1;min-height:0;width:100%;margin:0;padding:var(--space-3) var(--space-4);display:flex;flex-direction:column;overflow:hidden}
.resource-drawer .resource-page> :not(.resource-list){flex-shrink:0}
.resource-drawer .resource-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.resource-drawer .resource-target{align-items:center;flex-direction:row;flex-wrap:wrap;gap:var(--space-2) var(--space-3);background:transparent;padding:0;margin-bottom:var(--space-3);border-radius:0}
.resource-drawer .resource-target-copy{flex:1 1 240px;min-width:0}
.resource-drawer .resource-target-copy>span{display:block;color:var(--muted);font-size:var(--type-helper);overflow-wrap:anywhere}
.resource-drawer .resource-target strong{display:block;overflow-wrap:anywhere}
.resource-add{justify-content:flex-end;margin-bottom:16px}.resource-add:empty{display:none}
.resource-drawer .resource-target>.resource-add{flex:none;max-width:100%;margin:0 0 0 auto}
.resource-drawer .resource-filter-row{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2);margin-bottom:var(--space-2)}
.resource-drawer .resource-filter-row>.resource-media-filter{flex:1 1 auto;min-width:0;margin:0;flex-wrap:wrap}
.resource-drawer .resource-filter-row>select{flex:1 1 160px;min-width:160px;max-width:100%;width:auto}
.resource-drawer .resource-toolbar{flex-wrap:wrap}
.resource-drawer .resource-toolbar>select,.resource-drawer .resource-toolbar>input:not([type=search]){width:calc(50% - 5px)}
.resource-drawer .resource-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.resource-drawer>footer{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);flex-shrink:0;padding:var(--space-3) var(--space-4);background:var(--workspace-surface);border-top:1px solid var(--line);font-size:var(--type-body-sm);color:var(--muted)}
.resource-drawer>footer{flex-wrap:wrap;gap:var(--space-2)}
.resource-drawer>footer [data-asset-selected],.resource-drawer>footer [data-asset-status]{flex-basis:100%;margin:0;overflow-wrap:anywhere}
.resource-drawer>footer [data-asset-selected]{color:var(--ink);font-weight:500}
.resource-drawer .resource-card:has(>.resource-card-select[aria-pressed=true]){border-color:var(--interaction-line-hover);background:var(--control-selected)}
.resource-drawer .resource-card-select[aria-pressed=true]{background:transparent}
.resource-drawer .resource-card-select.is-dragging{opacity:.5}
.resource-drawer>footer small{margin-left:auto;white-space:nowrap}
@keyframes resource-drawer-in{from{translate:24px 0}to{translate:0 0}}
@media(prefers-reduced-motion:reduce){.resource-drawer[open]{animation:none}}
@media(max-width:620px){.resource-drawer .workspace-header{--workspace-header-inset:16px}.resource-drawer .resource-page{padding:16px}.resource-drawer>footer{padding:12px 16px}.resource-drawer .resource-tabs button{padding:10px 8px}}
@media(max-width:420px){.resource-drawer .resource-grid{grid-template-columns:minmax(0,1fr)}}
.resource-page{--resource-filter-offset:-6px;padding-block:30px 60px}
.resource-tabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin:0 0 var(--space-5);overflow:auto}
.resource-tabs button{white-space:nowrap;border:0;border-bottom:2px solid transparent;background:transparent;padding:13px 15px;color:var(--muted);font-size:var(--type-button)}
.resource-tabs button[aria-selected=true]{color:var(--control-text);border-color:var(--control-text);font-weight:700}
.resource-media-filter{display:inline-flex;gap:2px;margin:var(--resource-filter-offset) 0 14px;padding:3px;border:1px solid var(--line);border-radius:var(--radius-control);background:var(--app-surface-subtle)}
.resource-media-filter button{border:0;border-radius:5px;padding:6px 12px;background:transparent;color:var(--muted);font-size:var(--type-button);cursor:pointer}
.resource-media-filter button[aria-pressed=true]{background:var(--app-surface);color:var(--control-text);font-weight:700;box-shadow:0 1px 3px #0002}
.resource-target{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);background:var(--app-surface-subtle);padding:12px 16px;border-radius:var(--radius-row);margin:0 0 18px;font-size:var(--type-body-sm)}
.resource-page>.resource-context-row{min-height:0;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:var(--space-3);padding:7px 0;margin:0 0 var(--space-4);background:transparent;border-radius:0}
.resource-context-row strong{flex:1;min-width:0;font-size:var(--type-panel-title);color:var(--ink)}
.resource-context-row>.btn{flex:none;margin-left:auto}
.resource-media-action{min-width:148px}
#dialog[data-asset-management]{width:min(560px,calc(100vw - 32px));border:1px solid var(--line);border-radius:var(--radius-control);background:var(--workspace-surface,var(--app-surface));box-shadow:var(--app-shadow-overlay)}
#dialog[data-asset-management] .dialog-body{padding:22px;display:grid;gap:12px}
#dialog[data-asset-management] .dialog-body .field{margin:0}
#dialog[data-asset-management] .dialog-body .field :is(input,select){min-height:var(--workspace-control-height)}
#dialog[data-asset-management] .dialog-body .help{margin:0}
#dialog[data-asset-management]>footer{justify-content:space-between;align-items:center;gap:var(--space-3);background:var(--workspace-surface,var(--app-surface))}
.asset-dialog-secondary{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap}
@media(max-width:520px){#dialog[data-asset-management]>footer{align-items:stretch;flex-direction:column}#dialog[data-asset-management]>footer>.btn{align-self:flex-end}}
.resource-target label{display:flex;align-items:center;gap:var(--space-3);min-width:0}
.resource-target select{max-width:350px;min-width:120px;height:34px}
.resource-target span{color:var(--muted)}
.resource-toolbar{display:flex;gap:var(--space-2);margin:0 0 20px}
.resource-toolbar>.dps-search-form{flex:1 1 260px}
.resource-drawer .resource-toolbar>.dps-search-form{flex-basis:100%}
.resource-toolbar>select{width:160px}.resource-toolbar>input:not([type=search]){width:170px}
.resource-page input:not([type=checkbox]):not([type=color]):not([type=search]),.resource-page select{border:1px solid var(--control-border);border-radius:var(--radius-single);padding:10px 12px;background:var(--app-surface);font:var(--type-body) var(--font-ui);color:var(--ink);min-height:40px}
.resource-page input:focus-visible,.resource-page select:focus-visible{outline:2px solid var(--control-focus);outline-offset:2px}
.resource-page>.field>input{width:100%;margin-top:8px}.resource-page>.field{margin:0 0 18px}
.resource-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:var(--space-4);align-items:start}
.resource-card{background:var(--app-surface);border:1px solid var(--line);border-radius:var(--radius-panel);overflow:hidden;min-width:0}
.resource-card-select{display:block;width:100%;min-width:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:inherit;cursor:pointer}
.resource-card-select:hover:not(:disabled){background:var(--control-hover)}
.resource-card-select:active:not(:disabled){background:var(--control-selected)}
.resource-card-select:disabled{cursor:not-allowed}
.resource-card-select .resource-card-body{padding-bottom:0}
.resource-card-body.resource-card-actions{padding-top:var(--space-2)}
.resource-image{height:190px;background:repeating-conic-gradient(var(--app-surface-subtle) 0% 25%,var(--app-surface) 0% 50%) 50% / 16px 16px;display:flex;align-items:center;justify-content:center}
.resource-image img{width:100%;height:100%;object-fit:contain}
.resource-image-open{width:100%;padding:0;border:0;cursor:zoom-in}
.resource-image-open:focus-visible{outline:2px solid var(--control-focus);outline-offset:-3px}
.asset-original-preview{display:grid;justify-items:center;gap:var(--space-3);min-width:0}
.asset-original-preview>strong{max-width:100%;overflow-wrap:anywhere;justify-self:start}
.asset-original-preview img{display:block;max-width:100%;max-height:min(65dvh,680px);width:auto;height:auto;object-fit:contain}
.asset-original-preview small{justify-self:start;color:var(--muted)}
#dialog[data-asset-management]:has(.asset-original-preview){width:min(900px,calc(100vw - 32px))}
#dialog[data-asset-management]:has(.asset-original-preview) .dialog-body{max-height:calc(100dvh - 150px);overflow:auto}
.resource-card-body{padding:var(--space-4);display:flex;flex-direction:column;gap:8px}
.resource-card-body strong{font-size:var(--type-panel-title);line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.resource-card-body small{color:var(--muted);font-size:var(--type-meta);line-height:1.5;overflow-wrap:anywhere}
.resource-card-body .actions{margin-top:5px;gap:6px;flex-wrap:wrap}
.resource-card-body .btn.small{padding:7px 9px}
.resource-empty{grid-column:1/-1;text-align:center;padding:65px 20px;border:1px dashed var(--line);border-radius:var(--radius-panel);line-height:1.9;font-size:var(--type-body);color:var(--muted)}
.resource-page>.help{margin-top:18px}.resource-disabled{background:var(--app-surface-subtle)}
.font-grid{grid-template-columns:repeat(auto-fill,minmax(270px,1fr))}
.font-list-guide{font-size:var(--type-helper);color:var(--app-muted);margin-bottom:16px;overflow-wrap:anywhere;text-align:right}
.font-selected-count{font-weight:var(--weight-semibold)}
.font-current-note{font-size:var(--type-body-sm);line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.font-card{position:relative}.font-card-top{display:flex;justify-content:space-between;align-items:center;padding:7px 12px;background:var(--app-surface-subtle);font-size:var(--type-meta);color:var(--app-muted)}
.font-drag-handle{border:0;background:transparent;padding:2px 10px;border-radius:var(--radius-single);font-size:23px;line-height:1;cursor:grab;color:var(--app-muted);user-select:none;touch-action:none}
.font-drag-handle:active{cursor:grabbing}.font-drag-handle:focus-visible{outline:2px solid var(--control-focus);outline-offset:2px}.font-drag-handle:disabled{cursor:wait}
.font-card.font-dragging{opacity:.35}.font-card.font-drop-before{box-shadow:-4px 0 0 var(--control-text)}.font-card.font-drop-after{box-shadow:4px 0 0 var(--control-text)}
.font-star[aria-pressed=true]{color:var(--app-warning);background:var(--app-warning-soft);border-color:var(--app-warning)}.font-star:disabled{opacity:.35}
.font-card .font-preview{padding-top:10px;height:130px}
.font-preview{height:140px;display:flex;align-items:center;padding:var(--space-6);background:var(--app-surface-subtle);font-size:25px;line-height:1.6;overflow:hidden;overflow-wrap:anywhere;border-bottom:1px solid var(--line)}
.font-license{font:var(--type-body-sm)/1.8 var(--font-ui);white-space:pre-wrap;max-height:330px;overflow:auto;padding:var(--space-4);background:var(--app-surface-subtle);border-radius:7px}
.brand-palette{margin:0 0 24px;padding:18px;background:var(--app-surface);border:1px solid var(--line);border-radius:9px}
.brand-palette h2{font-size:var(--type-section-title);margin:0 0 12px}.brand-colors{display:flex;flex-wrap:wrap;gap:10px}
.brand-color{display:flex;align-items:center;gap:6px;padding:5px;border:1px solid var(--line);border-radius:6px}
.brand-swatch{width:32px;height:32px;border:1px solid #0002;border-radius:4px}.brand-color>button:last-child{border:0;background:transparent;color:var(--muted);padding:6px}
@media(max-width:1000px){.resource-page{padding-block:25px}.resource-target{align-items:start;flex-direction:column}.resource-context-row{align-items:center;flex-direction:row}.resource-target select{max-width:300px}}
@media(max-width:620px){.resource-toolbar{flex-wrap:wrap}.resource-toolbar>select,.resource-toolbar>input:not([type=search]){width:calc(50% - 5px)}.resource-page{padding-block:20px}.resource-grid{grid-template-columns:minmax(0,1fr)}.resource-target label{flex-direction:column;align-items:start}.resource-target select{max-width:100%;width:100%}.resource-tabs button{padding:10px;font-size:var(--type-button)}}
/* Compact font controls share spacing tokens without shrinking service type or click targets. */
.resource-drawer .resource-page--fonts .resource-tabs{margin-bottom:var(--space-2)}
.resource-page--fonts .font-library-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--space-2) var(--space-6);margin-bottom:var(--space-1)}
.resource-page--fonts.app-content>.font-library-controls{align-items:flex-start;margin-top:var(--resource-filter-offset)}
.resource-page--fonts .font-library-controls>.resource-toolbar{flex:1 1 300px;min-width:0;width:100%;max-width:420px;flex-wrap:nowrap;gap:var(--space-2);margin:0}
.resource-page--fonts .font-library-controls>.resource-media-filter{flex:none;margin:0;max-width:100%;flex-wrap:wrap}
.resource-page--fonts>.font-list-guide{margin-bottom:var(--space-1)}
.resource-page--fonts>.field{gap:var(--space-1);margin-bottom:var(--space-1)}
.resource-page--fonts>.field>input{margin-top:0}
.resource-drawer .resource-page--fonts>.resource-target{margin-bottom:var(--space-2)}

/* Resource Connections: shared service frame, catalog rows and inline detail. */
.resource-connections-page{font-size:var(--type-body);line-height:var(--leading-body,1.6)}
.resource-catalog-panel>.resource-section-title{margin:0 0 var(--space-2);font-size:var(--type-section-title)}
.resource-catalog-panel>.resource-catalog-description{margin:0 0 var(--space-5);color:var(--muted)}
.resource-catalog>.dps-search-form{max-width:440px;margin-bottom:var(--space-4)}
.resource-catalog>.resource-media-filter{margin:0 0 var(--space-4);flex-wrap:wrap;max-width:100%}
.resource-catalog-count{margin:0 0 var(--space-3);color:var(--muted)}
.resource-provider-status{display:flex;flex-direction:column;align-items:flex-start;gap:var(--space-1)}
.resource-provider-status>.control-switch{min-width:0;max-width:100%;justify-content:space-between;padding-inline:var(--space-1);gap:var(--space-1);flex-wrap:wrap}
.resource-provider-status{min-width:0;max-width:100%}
.resource-provider-status .resource-catalog-status{white-space:normal}
.resource-provider-status .resource-catalog-status{font-size:var(--type-helper);line-height:1.5}
.resource-catalog-table{width:100%;table-layout:fixed;border-collapse:collapse;text-align:left;background:var(--app-surface);border-block:1px solid var(--line)}
.resource-catalog-table th,.resource-catalog-table td{padding:var(--space-3) var(--space-4);vertical-align:middle;overflow-wrap:anywhere;border-bottom:1px solid var(--line)}
.resource-catalog-table thead th{font-size:var(--type-body-sm);font-weight:var(--weight-semibold);color:var(--muted);background:var(--app-surface-subtle)}
.resource-catalog-table thead th:first-child{width:23%}
.resource-catalog-table thead th:last-child{width:20%}
.resource-library-row{cursor:pointer}
.resource-library-row:hover,.resource-library-row:focus-within{background:var(--control-hover)}
.resource-library-row[data-expanded=true]{background:var(--control-selected)}
.resource-library-row th>.btn{display:block;width:100%;min-height:var(--workspace-control-height);padding:0;border:0;border-radius:var(--radius-single);background:transparent;color:inherit;text-align:left;font-size:var(--type-body);font-weight:var(--weight-semibold);white-space:normal}
.resource-library-row th>.btn:focus-visible{outline:2px solid var(--control-focus);outline-offset:3px}
.resource-library-row td>small{display:block;margin-top:var(--space-1);font-size:var(--type-meta);color:var(--muted)}
.resource-catalog-status{font-size:var(--type-meta);color:var(--muted)}
.resource-license-note{margin:var(--space-2) 0 0}
.resource-library-row [data-extension-summary]{font-size:var(--type-meta);color:var(--muted)}
.resource-custom-row{border-top:1px solid var(--line)}
.resource-catalog-table .resource-library-detail-row>td{padding:0;background:var(--app-surface-subtle)}
.resource-library-detail{padding:var(--space-5);overflow-wrap:anywhere}
.resource-library-detail h4{margin:0;font-size:var(--type-panel-title)}
.resource-library-detail h5{margin:var(--space-4) 0 var(--space-2);font-size:var(--type-body)}
.resource-library-detail dl{margin:var(--space-4) 0}
.resource-library-detail dl>div{display:grid;grid-template-columns:85px minmax(0,1fr);gap:var(--space-3);margin-top:var(--space-2)}
.resource-library-detail dt{color:var(--muted)}
.resource-library-detail dd{margin:0}
.resource-library-detail ul{padding-left:var(--space-5);margin:0}
.resource-library-detail a{color:var(--app-accent);text-underline-offset:3px}
.resource-library-detail a:focus-visible{outline:2px solid var(--control-focus);outline-offset:3px}
.resource-library-flow{font-weight:var(--weight-semibold)}
.resource-library-detail-row>td>.extension-settings{margin:0;border:0;border-radius:0;background:transparent}
.resource-page>[data-icon-presets]{margin-top:var(--space-6)}
@media(max-width:750px){.resource-catalog-panel{padding:var(--space-4)}.resource-catalog-table thead th:first-child{width:30%}.resource-catalog-table thead th:last-child{width:24%}.resource-catalog-status{white-space:nowrap}.resource-catalog-table th,.resource-catalog-table td{padding:var(--space-3)}.resource-library-detail{padding:var(--space-4)}.resource-catalog>.dps-search-form{max-width:none}}

/* Verified local provider choices reuse existing search, button and Library surfaces. */
.resource-lucide{container:lucide-picker / inline-size;min-width:0;padding:var(--space-3) 0;border-bottom:1px solid var(--line);margin-bottom:var(--space-3)}
.resource-lucide-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2)}
.resource-lucide-header>strong{min-width:0}
.resource-lucide-header>.btn{flex:none;margin-inline-start:auto}
.resource-lucide>.dps-search-form{width:100%;max-width:none}
.resource-lucide-categories{display:flex;gap:var(--space-2);overflow-x:auto;margin:var(--space-3) 0;padding:var(--space-1);scroll-padding-inline:var(--space-1)}
.resource-lucide-categories>.btn{flex:0 0 auto;white-space:nowrap}
.resource-lucide-categories>.btn[aria-selected=true]{background:var(--control-selected);border-color:var(--control-text)}
.resource-lucide-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--space-1);margin-top:var(--space-3)}
.resource-lucide-grid{--lucide-card-height:calc(42px + var(--space-2)*2 + var(--space-1) + var(--type-helper)*5.2);--lucide-page-rows:48;display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));grid-auto-rows:var(--lucide-card-height);align-content:start;gap:var(--space-2)}
/* An enabled previous/next action means multiple pages. Reserve 48 slots without
 * placeholder cards; single-page/empty results retain their actual row count.
 * Container thresholds follow the existing 92px minimum + 8px spacing token. */
.resource-lucide-grid:has(+ .resource-lucide-pagination>[data-action=extension-lucide-page]:not([aria-pressed]):enabled),.resource-lucide-grid[aria-busy=true]:empty{min-height:calc(var(--lucide-page-rows)*var(--lucide-card-height) + (var(--lucide-page-rows) - 1)*var(--space-2))}
.resource-lucide-grid[aria-busy=true],.resource-lucide-pagination[aria-disabled=true]{opacity:.6;cursor:progress}
@container lucide-picker (min-width:192px){.resource-lucide-grid{--lucide-page-rows:24}}
@container lucide-picker (min-width:292px){.resource-lucide-grid{--lucide-page-rows:16}}
@container lucide-picker (min-width:392px){.resource-lucide-grid{--lucide-page-rows:12}}
@container lucide-picker (min-width:492px){.resource-lucide-grid{--lucide-page-rows:10}}
@container lucide-picker (min-width:592px){.resource-lucide-grid{--lucide-page-rows:8}}
@container lucide-picker (min-width:692px){.resource-lucide-grid{--lucide-page-rows:7}}
@container lucide-picker (min-width:792px){.resource-lucide-grid{--lucide-page-rows:6}}
@container lucide-picker (min-width:992px){.resource-lucide-grid{--lucide-page-rows:5}}
@container lucide-picker (min-width:1192px){.resource-lucide-grid{--lucide-page-rows:4}}
@container lucide-picker (min-width:1592px){.resource-lucide-grid{--lucide-page-rows:3}}
@container lucide-picker (min-width:2392px){.resource-lucide-grid{--lucide-page-rows:2}}
@container lucide-picker (min-width:4792px){.resource-lucide-grid{--lucide-page-rows:1}}
@container lucide-picker (max-width:391px){.resource-lucide-pagination>.btn{padding-inline:var(--space-1)}.resource-lucide [data-lucide-results]{min-height:2lh}}
.resource-lucide-card{position:relative;min-width:0}
.resource-lucide .resource-lucide-option{position:relative;min-width:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:var(--space-2);gap:var(--space-1);white-space:normal}
.resource-lucide .resource-lucide-remove{position:absolute;top:var(--space-1);right:var(--space-1);width:24px;height:24px;min-height:0;padding:0;line-height:1}
.resource-lucide-option img{flex:none;object-fit:contain;background:#fff;border-radius:var(--radius);padding:4px;box-sizing:content-box}
.resource-lucide-name{display:flex;flex:none;align-items:center;justify-content:center;width:100%;height:5.2em;line-height:1.3;font-size:var(--type-helper);color:var(--control-muted);text-align:center;white-space:normal;overflow-wrap:anywhere}
.resource-lucide .btn.resource-lucide-option{border:1px solid var(--control-border);background:var(--control-surface)}
.resource-lucide .btn.resource-lucide-option:hover{background:var(--control-hover);border-color:var(--interaction-line-hover)}
.resource-lucide .btn.resource-lucide-option[data-registered=true]{border-color:var(--control-text)}
.resource-lucide .btn.resource-lucide-option[aria-pressed=true]{background:var(--control-selected)}
.resource-lucide .btn.resource-lucide-option:focus-visible{outline:2px dashed var(--control-focus);outline-offset:3px}
.resource-lucide-selected img{background:#fff;border-radius:var(--radius);padding:4px;box-sizing:content-box}
.resource-list-controls{display:flex;flex-wrap:wrap;gap:var(--space-2);min-width:0;width:100%}
.resource-list-control{flex:1 1 150px;min-width:0;margin:0}
.resource-list-control>select{width:100%;min-width:0}
.resource-filter-row{min-width:0}.resource-scope-note{margin:var(--space-1) 0 var(--space-2)}
.resource-lucide .font-license{max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
