.template-workspace{height:calc(100dvh - 100px);min-height:0;display:flex;flex-direction:column;gap:12px;color:#1b2d44;overflow:hidden}
.catalog-frame.template-workspace{gap:.55rem}
.catalog-frame.template-workspace .template-catalog-filter{display:flex;align-items:end;gap:.45rem;flex-wrap:wrap;flex:1;min-width:0}
.catalog-frame.template-workspace .template-catalog-filter label{display:grid;gap:.2rem;font-size:.74rem;color:#61758f;min-width:125px}
.catalog-frame.template-workspace .template-catalog-filter label:first-child{flex:1;min-width:180px}
.catalog-frame.template-workspace .template-catalog-filter a{align-self:center;color:#28588c}
.catalog-frame.template-workspace .catalog-frame-rows{grid-template-columns:minmax(0,1fr)}
.catalog-frame.template-workspace[data-catalog-view=tiles] .catalog-frame-rows{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.catalog-frame.template-workspace[data-catalog-view=compact] .catalog-frame-rows{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.25rem}
.catalog-frame.template-workspace[data-catalog-view=list] .template-entry{min-height:70px}
.catalog-frame.template-workspace[data-catalog-view=tiles] .template-entry{min-height:120px}
.catalog-frame.template-workspace[data-catalog-view=compact] .template-entry{min-height:38px;padding:.3rem .45rem}
.catalog-frame.template-workspace .template-entry button{align-self:center;white-space:nowrap}
.catalog-frame.template-workspace .template-entry-select{display:flex;align-items:center}
.catalog-frame.template-workspace .catalog-inspector dl{display:grid;grid-template-columns:minmax(75px,1fr) minmax(0,1.5fr)}
.template-workspace button,.template-workspace select,.template-workspace input,.template-workspace textarea{font:inherit}
.template-workspace button{border:1px solid #cbd9e9;background:#fff;color:#28588c;border-radius:8px;padding:.5rem .72rem;cursor:pointer}
.template-workspace button:hover{background:#edf5ff}.template-workspace button:disabled{opacity:.55;cursor:not-allowed}
.template-workspace input,.template-workspace select,.template-workspace textarea{border:1px solid #cbd9e9;border-radius:7px;padding:.5rem;color:#1c2e46;background:#fff;min-width:0}
.template-page-head{display:flex;align-items:end;justify-content:space-between;gap:12px;flex:none}
.template-page-head small{color:#3a70b3;letter-spacing:.12em;font-size:.71rem;font-weight:700}
.template-page-head h1{margin:.15rem 0;font-size:1.85rem}.template-page-head p{margin:.1rem 0;color:#61758f}
.template-page-actions{display:flex;align-items:end;gap:.5rem;flex-wrap:wrap}
.template-more-actions,.template-more-actions-list{display:contents}.template-more-trigger{display:none}
.template-scope-switch{display:flex;align-items:center;border:1px solid #cbd9e9;border-radius:8px;overflow:hidden}
.template-scope-switch a{padding:.5rem .65rem;color:#35689f;text-decoration:none;white-space:nowrap}
.template-scope-switch a.is-active{background:#3979d4;color:#fff;font-weight:700}
.template-area-note{padding:8px 11px;background:#eaf3ff;border:1px solid #d3e3f6;border-radius:8px;color:#365a83;font-size:.83rem}
.template-page-actions label{display:grid;color:#60758d;font-size:.77rem}.template-page-actions select{min-width:190px}
.template-page-actions [data-template-new=template],.template-editor footer [data-template-save]{background:#3979d4;border-color:#3979d4;color:#fff;font-weight:700}
.template-explorer{display:grid;grid-template-columns:215px minmax(0,1fr) 265px;gap:10px;flex:1;min-height:0}
.template-sidebar,.template-main,.template-inspector{background:#fff;border:1px solid #dce5ef;border-radius:12px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.template-sidebar{padding:12px}.template-sidebar h2{font-size:1rem;margin:0 0 10px}
.template-sidebar a{display:block;text-decoration:none;padding:7px 9px;border-radius:8px;color:#3f5d80;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.template-sidebar a:hover,.template-sidebar a.is-active{background:#e9f2ff;color:#245fa7;font-weight:700}
.template-tree-section{border-top:1px solid #e6edf5;margin-top:10px;padding-top:10px}.template-tree-section>strong{font-size:.8rem;color:#61758f}.template-tree-section>small{display:block;color:#8795a8;margin:8px}
.template-tree-node{padding-left:0}.template-tree-node.depth-1{padding-left:13px}.template-tree-node.depth-2{padding-left:26px}.template-tree-node.depth-3{padding-left:39px}.template-tree-node.depth-4{padding-left:52px}.template-tree-node.depth-5,.template-tree-node.depth-6,.template-tree-node.depth-7,.template-tree-node.depth-8,.template-tree-node.depth-9,.template-tree-node.depth-10,.template-tree-node.depth-11,.template-tree-node.depth-12{padding-left:65px}
.template-tree-row{display:flex;align-items:center;min-width:0}.template-tree-row>a{flex:1;min-width:0}.template-workspace .template-tree-row>button{border:0;padding:3px;width:22px;flex:none;background:transparent;color:#597ba4}.template-tree-spacer{width:22px;flex:none}
.template-main{display:flex;flex-direction:column}.template-toolbar{padding:11px;border-bottom:1px solid #e6edf5;flex:none}.template-toolbar form{display:flex;align-items:end;gap:7px;flex-wrap:wrap}
.template-toolbar label{display:grid;gap:2px;color:#61758f;font-size:.72rem;flex:1 1 125px}.template-toolbar form>.template-search-label{flex:2 1 230px}
.template-extra-filters{display:contents}
.template-filter-trigger,.template-folder-trigger,.template-sidebar-close{display:none}
.template-toolbar button{background:#3979d4;border-color:#3979d4;color:#fff}
.template-breadcrumbs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 13px;color:#8290a2;font-size:.83rem;flex:none}
.template-breadcrumbs a{color:#2d66aa}.template-breadcrumbs .template-up{margin-left:auto}
.template-search-context{margin:0 13px 7px;color:#60758d;font-size:.8rem}
.template-results-head{display:flex;justify-content:space-between;gap:8px;padding:8px 13px;background:#f7f9fc;font-size:.86rem;color:#344b68;flex:none}
.template-results-head span{color:#7a8a9e}.template-results{padding:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));align-content:start;gap:10px;flex:1;overflow:auto;min-height:0}
.template-inspector-open,.template-inspector-head,.template-inspector-backdrop{display:none}
.template-entry{border:1px solid #dce5ef;border-radius:10px;padding:11px;display:flex;gap:8px;align-items:flex-start;cursor:pointer;min-width:0;min-height:100px}
.template-entry:hover,.template-entry:focus-visible,.template-entry.is-selected{border-color:#3979d4;background:#f5f9ff;outline:0}
.template-entry-icon{font-size:1.45rem}.template-entry>div{min-width:0;flex:1}.template-entry strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.template-entry small,.template-entry-status{display:block;color:#70839a;font-size:.72rem;margin-top:4px;line-height:1.3}
.template-entry>a{align-self:end;font-size:.75rem;white-space:nowrap}.template-empty{color:#788a9f;padding:22px}
.template-pages{display:flex;align-items:center;justify-content:center;gap:20px;border-top:1px solid #e6edf5;padding:9px;flex:none}.template-pages [aria-disabled=true]{pointer-events:none;opacity:.45}
.template-inspector{padding:14px}.template-inspector small{color:#3a70b3;letter-spacing:.1em;font-weight:700}.template-inspector h2{font-size:1.2rem;overflow-wrap:anywhere;margin:6px 0}.template-inspector p{color:#70839a}
.template-inspector dl{display:grid;grid-template-columns:1fr;gap:3px}.template-inspector dt{color:#788a9f;font-size:.73rem}.template-inspector dd{margin:0 0 9px;overflow-wrap:anywhere}.template-long-id{font-size:.77rem}
.template-inspector button{width:100%;margin-top:12px}
.template-editor-backdrop{position:fixed;inset:0;background:#142a4866;z-index:120}
.template-editor{position:fixed;z-index:121;right:0;top:0;bottom:0;width:min(700px,100vw);display:flex;flex-direction:column;background:#fff;box-shadow:-10px 0 35px #172e4b33;min-height:0}
.template-editor header,.template-editor footer{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:14px 18px;border-bottom:1px solid #e2eaf4;flex:none}
.template-editor header h2{margin:3px 0}.template-editor header small{color:#6380a2}.template-editor footer{border-bottom:0;border-top:1px solid #e2eaf4;justify-content:flex-start;flex-wrap:wrap}
.template-editor-scroll{overflow:auto;min-height:0;padding:12px 18px;overscroll-behavior:contain;scrollbar-width:thin}.template-editor-scroll form{display:grid;gap:14px}
.template-copy-dialog .template-editor-scroll{display:grid;align-content:start;gap:12px}.template-copy-dialog .template-editor-scroll p{margin:0;overflow-wrap:anywhere}.template-copy-dialog .template-editor-scroll section{border-top:1px solid #e2eaf4;padding-top:10px;display:grid;gap:7px}.template-copy-targets{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px}.template-copy-targets label{display:flex;align-items:center;gap:8px;border:1px solid #dce5ef;border-radius:8px;padding:8px;cursor:pointer}.template-copy-targets input{width:auto;margin:0}
.template-editor label{display:grid;gap:4px;font-size:.82rem;color:#5d728b}.template-editor textarea{width:100%;resize:vertical}.template-editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.template-editor-grid .template-checkbox{display:flex;align-items:center;gap:8px}.template-editor-grid .template-checkbox input{width:auto}
.template-hint{color:#687e98;font-size:.82rem;line-height:1.45}.template-variant-list{display:grid;gap:10px}.template-variant{border:1px solid #dce5ef;border-radius:10px;display:grid;gap:10px;padding:12px;min-width:0}
.template-variant legend{font-weight:700;color:#2c527d}.template-variant-head{display:flex;align-items:end;justify-content:space-between;gap:8px}.template-variant-head label{flex:1}
.template-variant-head>div{display:flex;gap:4px;flex-wrap:wrap}.template-variant-head>div button{white-space:nowrap}
.template-variant-media{display:grid;gap:7px;border-top:1px solid #e2eaf4;padding-top:9px}
.template-variant-media>button{justify-self:start}.template-variant-attachment{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px;background:#f7f9fc;border-radius:7px;overflow-wrap:anywhere}
.template-variant-attachment small{display:block;color:#61758f;font-size:.75rem}
.template-fallbacks{display:grid;gap:6px;padding:10px;border-radius:8px;background:#f5f8fc}.template-fallbacks>strong{font-size:.8rem}.template-fallbacks p,.template-fallbacks small{margin:0;color:#788a9f;font-size:.76rem}.template-fallbacks button{justify-self:start}
.template-warning{border:1px solid #f3d99a;background:#fff7e5;color:#795b19;border-radius:8px;padding:8px;font-size:.8rem}
.template-editor-tools{display:grid;gap:8px;border-top:1px solid #e5edf6;margin-top:18px;padding-top:12px}.template-editor-tools h3{margin:0;font-size:1rem}.template-editor-tools>button{justify-self:start}.template-editor-tools details{border:1px solid #e3eaf2;border-radius:8px;padding:8px}.template-editor-tools details textarea{width:100%}
.template-editor-result{white-space:pre-wrap;overflow-wrap:anywhere}
.template-media-picker{border:1px solid #d4e0ed;border-radius:13px;width:min(760px,94vw);max-height:85dvh;box-shadow:0 15px 50px #142a4866;color:#1b2d44;padding:0;overflow:hidden}
.template-media-picker::backdrop{background:#142a4866}.template-media-picker header,.template-media-picker footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#fff;border-bottom:1px solid #e2eaf4}
.template-media-picker header h2{margin:2px 0;font-size:1.2rem}.template-media-picker header small{color:#61758f}.template-media-picker>p,.template-media-picker>label{display:block;margin:10px 16px}.template-media-picker>label input{display:block;width:100%;box-sizing:border-box;margin-top:5px}
.template-media-picker input,.template-media-picker button{font:inherit}.template-media-picker button{border:1px solid #cbd9e9;background:#fff;color:#28588c;border-radius:8px;padding:.45rem .7rem;cursor:pointer}.template-media-picker button:disabled{opacity:.5;cursor:not-allowed}
.template-media-picker-list{overflow:auto;max-height:48dvh;margin:0 16px;border:1px solid #e1e9f2;border-radius:8px}.template-media-option{display:flex;gap:10px;padding:10px;border-bottom:1px solid #e6edf5;cursor:pointer}.template-media-option:last-child{border-bottom:0}.template-media-option.is-unavailable{opacity:.65}.template-media-option>span{min-width:0;overflow-wrap:anywhere}.template-media-option small{display:block;color:#657c96;font-size:.77rem}.template-media-copy-list{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.template-media-copy-list small{padding:2px 5px;border-radius:5px;background:#f1f4f8}.template-media-copy-list .is-ready{color:#176634;background:#e9f7ed}.template-media-copy-list .is-missing{color:#99582d;background:#fff1e8}
.template-media-picker footer{border-top:1px solid #e2eaf4;border-bottom:0;margin-top:10px}.template-media-picker [data-picker-add]{background:#3979d4;color:#fff}
@media(min-width:1051px) and (max-width:1450px){.template-explorer{grid-template-columns:200px minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(120px,25%)}.template-sidebar{grid-row:1/3}.template-inspector{grid-column:2;grid-row:2}}
@media(max-width:1050px){
  .template-explorer{grid-template-columns:200px minmax(0,1fr)}
  .template-workspace .template-inspector-backdrop{position:fixed;inset:0;z-index:69;padding:0;border:0;border-radius:0;
    display:block;background:#142a4866}
  .template-workspace .template-inspector-backdrop:hover{background:#142a4866}
  .template-inspector{position:fixed;right:0;top:0;bottom:0;z-index:70;width:min(520px,100vw);
    border-radius:0;box-shadow:-10px 0 30px #172e4b33;visibility:hidden;transform:translateX(110%)}
  .template-inspector.is-open{visibility:visible;transform:none}
  .template-inspector-head{display:flex;align-items:center;gap:.55rem;position:sticky;top:-14px;z-index:1;
    padding:14px 0;background:#fff;border-bottom:1px solid #e2eaf4}
  .template-inspector-head strong{color:#344b68}
  .template-inspector-open{display:inline-flex;padding:.3rem .5rem!important;font-size:.76rem!important}
}
@media(max-width:700px){
  .template-workspace{height:calc(100dvh - 82px)}
  .template-page-head{align-items:start;flex-direction:column}
  .template-page-actions{width:100%;flex-wrap:nowrap;align-items:end;min-width:0}
  .template-page-actions label{flex:1;min-width:0}.template-page-actions select{min-width:0;width:100%}
  .template-more-actions{display:block;position:relative;flex:none;z-index:8}
  .template-more-trigger{display:block}
  .template-more-actions-list{display:none}
  .template-more-actions.is-open .template-more-actions-list{display:grid;gap:5px;position:absolute;right:0;top:100%;
    width:min(240px,calc(100vw - 32px));max-height:min(220px,55dvh);overflow:auto;padding:8px;
    border:1px solid #cbd9e9;border-radius:8px;background:#fff;box-shadow:0 8px 24px #071c3630}
  .template-more-actions-list button{text-align:left}
  .template-explorer{display:flex;flex-direction:column}
  .template-sidebar{position:fixed;left:0;top:0;bottom:0;z-index:60;width:min(280px,90vw);
    max-height:none;visibility:hidden;transform:translateX(-110%);box-shadow:10px 0 28px #071c3630}
  .template-sidebar.is-open{visibility:visible;transform:none}
  .template-sidebar-close{display:block;margin:0 0 8px auto}
  .template-main{flex:1;overflow:hidden}
  .template-toolbar{position:relative;z-index:4}
  .template-toolbar form{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:end}
  .template-toolbar .template-search-label{min-width:0;flex:none}
  .template-toolbar .template-extra-filters{display:none}
  .template-toolbar.is-filters-open .template-extra-filters{display:flex;flex-direction:column;
    position:absolute;left:0;right:0;top:100%;z-index:5;max-height:130px;overflow:auto;
    padding:8px;background:#fff;border:1px solid #cbd9e9;border-radius:0 0 9px 9px;
    box-shadow:0 8px 24px #071c3630}
  .template-toolbar .template-extra-filters label{width:100%;flex:none}
  .template-filter-trigger,.template-folder-trigger{display:inline-flex}
  .template-breadcrumbs{flex-wrap:nowrap;white-space:nowrap;overflow-x:auto}
  .template-editor-grid{grid-template-columns:1fr}.template-editor footer button{flex:1}
  .template-entry{min-height:90px}
}
@media(max-width:700px) and (max-height:600px){
  .template-workspace{gap:6px}
  .template-page-head{gap:4px}
  .template-page-head h1{font-size:1.5rem}
  .template-page-head p{display:none}
  .template-page-actions{gap:4px}
  .template-page-actions label{flex:1;min-width:0}
  .template-page-actions select,.template-page-actions>button,.template-more-trigger{font-size:.75rem;padding:.36rem .42rem}
  .template-page-actions>button{flex:none;white-space:nowrap}
  .template-area-note{padding:4px 7px;font-size:.74rem;line-height:1.3;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .template-toolbar{padding:5px 7px}
  .template-toolbar form{gap:4px}
  .template-toolbar label{font-size:.66rem}
  .template-toolbar input,.template-toolbar button{padding:.28rem .42rem;font-size:.76rem}
  .template-breadcrumbs{padding:5px 7px;font-size:.77rem}
  .template-results-head{padding:5px 7px;font-size:.78rem}
}
