.modal.template-editor-modal{width:min(1240px,calc(100vw - 40px));height:min(850px,calc(100dvh - 40px));max-height:calc(100dvh - 40px)}.template-editor-modal .modal-body{display:flex;flex-direction:column;min-height:0;flex:1;padding:16px 20px 12px;gap:11px;overflow:hidden}.template-editor-info{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-shrink:0}.template-editor-info>div{min-width:0}.template-editor-info b{display:block;font-size:13px;color:#365743}.template-editor-info small{display:block;margin-top:5px;font-size:10px;color:#8b9e91;overflow-wrap:anywhere}.template-editor-info>span{font-size:11px;color:#93a293;white-space:nowrap}.template-editor-workspace{display:grid;grid-template-columns:220px minmax(0,1fr);flex:1;min-height:0;overflow:hidden;border:1px solid #dfe8e2;border-radius:8px}.template-editor-sidebar{display:flex;flex-direction:column;min-height:0;gap:9px;padding:12px;background:#f6f9f7;border-right:1px solid #e1eae4}.template-editor-search{display:grid;gap:8px;font-size:11px;color:#708b78}.template-editor-search input{height:34px!important;font-size:12px!important;padding:0 9px!important}.template-editor-file-list{flex:1;min-height:0;overflow:auto}.template-editor-file{width:100%;display:flex;align-items:center;gap:6px;padding:9px 7px;border:0;background:transparent;border-radius:5px;font:inherit;font-size:11px;color:#647f6d;text-align:left;cursor:pointer}.template-editor-file:hover{background:#eaf1ec}.template-editor-file[aria-pressed=true]{background:#e1eee5;color:#225b3a}.template-file-type{font-size:8px;color:#92a497;width:29px;flex-shrink:0}.template-file-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}.template-editor-file.dirty .template-file-name:after{content:' ●';font-size:9px;color:#b38238}.template-file-readonly{font-size:8px;color:#9caaa0}.template-editor-main{display:flex;flex-direction:column;min-height:0;min-width:0;background:#fff}.template-editor-filebar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 14px;border-bottom:1px solid #e5ece7;min-height:40px}.template-editor-filebar strong{font-size:12px;font-weight:500;color:#496951;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-editor-filebar>span{font-size:10px;color:#91a194;white-space:nowrap}.template-editor-code{display:flex;flex:1;min-height:0;min-width:0;overflow:hidden}.template-editor-code pre{width:46px;flex:0 0 46px;margin:0!important;padding:13px 9px 13px 4px!important;background:#f7f9f8;color:#b0bcb4;line-height:21px!important;font:12px/21px Consolas,"SFMono-Regular",monospace!important;text-align:right;overflow:hidden;border-right:1px solid #edf1ef;user-select:none;box-sizing:border-box}.template-editor-code textarea{flex:1;width:0;min-width:0;min-height:0;height:100%;padding:13px!important;margin:0!important;border:0!important;border-radius:0!important;resize:none!important;outline:0!important;box-shadow:none!important;background:white!important;font:12px/21px Consolas,"SFMono-Regular",monospace!important;line-height:21px!important;color:#364e42;tab-size:2;overflow:auto;white-space:pre}.template-editor-resource{padding:24px;font-size:12px;color:#8d9e92;line-height:1.9}.template-editor-status{display:flex;justify-content:space-between;gap:10px;padding:8px 12px;font-size:10px;color:#9aa99e;background:#fafcfb;border-top:1px solid #edf1ef}.template-editor-message{margin:0!important;font-size:12px;line-height:1.6;color:#846e4f;overflow-wrap:anywhere;flex-shrink:0}.template-editor-message:empty{display:none}.template-editor-note{margin:0!important;font-size:10px;color:#94a398;line-height:1.6;flex-shrink:0}.template-editor-modal .modal-footer{gap:8px;flex-shrink:0}.template-editor-modal [hidden]{display:none!important}
@media(max-width:760px){.modal.template-editor-modal{width:calc(100vw - 16px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}.template-editor-modal .modal-header{padding:15px 16px}.template-editor-modal .modal-body{padding:12px;gap:9px}.template-editor-info{align-items:flex-start;gap:8px}.template-editor-info b{font-size:12px}.template-editor-info>span{font-size:10px;max-width:90px;white-space:normal;text-align:right}.template-editor-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:130px minmax(0,1fr)}.template-editor-sidebar{border-right:0;border-bottom:1px solid #e1eae4;padding:8px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:34px minmax(0,1fr);gap:6px}.template-editor-search{display:block}.template-editor-search>span{display:none}.template-editor-search input{font-size:16px!important}.template-editor-file-list{grid-column:1/-1;display:flex;align-items:flex-start;gap:5px;overflow:auto}.template-editor-file{width:auto;min-width:100px;max-width:230px;height:36px;flex-shrink:0;padding:7px}.template-editor-filebar{padding:8px 10px;min-height:34px}.template-editor-code textarea{font-size:16px!important;line-height:24px!important;padding:9px!important}.template-editor-code pre{font-size:12px!important;line-height:24px!important;padding-top:9px!important;width:35px;flex-basis:35px}.template-editor-status{font-size:9px;padding:6px 8px}.template-editor-status>span:last-child{display:none}.template-editor-modal .modal-footer{padding:10px 12px;gap:6px}.template-editor-modal .modal-footer .btn{font-size:11px;padding-left:9px;padding-right:9px;min-height:34px}.template-editor-note{font-size:9px}}

/* Hierarchical template file browser */
.template-tree-branch,.template-tree-children{min-width:0}.template-editor-file-list[role=tree]{display:block;overflow:auto}.template-editor-folder{display:flex;align-items:center;gap:7px;width:100%;min-height:33px;border:0;border-radius:5px;padding:8px 7px 8px calc(8px + var(--tree-depth,0)*14px);background:transparent;color:#526f5d;font:inherit;font-size:11px;text-align:left;cursor:pointer}.template-editor-folder:hover{background:#eaf1ec}.template-editor-folder:focus-visible,.template-editor-file-list .template-editor-file:focus-visible{outline:2px solid #8cb49a;outline-offset:-2px}.template-folder-chevron{width:5px;height:5px;border-right:1.4px solid #8ba591;border-bottom:1.4px solid #8ba591;transform:rotate(-45deg);flex-shrink:0;transition:transform .12s}.template-editor-folder[aria-expanded=true] .template-folder-chevron{transform:translateY(-1px) rotate(45deg)}.template-folder-icon{width:15px;height:15px;color:#b0904a;flex-shrink:0}.template-folder-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.template-folder-count{font-size:9px;font-weight:400;color:#a2afa6;margin-left:2px}.template-editor-folder.dirty .template-folder-name:after{content:' ●';font-size:8px;color:#b38238}.template-editor-file-list .template-editor-file{padding-left:calc(8px + var(--tree-depth,0)*14px);min-width:0;max-width:none;width:100%;min-height:33px}.template-editor-file-list .template-file-type{width:26px;font-size:8px}.template-editor-file-list .template-file-name{min-width:0}
@media(max-width:760px){.template-editor-workspace{grid-template-rows:180px minmax(0,1fr)}.template-editor-file-list[role=tree]{display:block;min-height:0;overflow:auto}.template-editor-file-list .template-editor-file{width:100%;min-width:0;max-width:none;height:auto;min-height:32px;flex-shrink:1;padding-top:7px;padding-bottom:7px}.template-editor-folder{min-height:32px;padding-top:7px;padding-bottom:7px;font-size:11px}.template-editor-file-list .template-file-name{flex:1}}

@media(max-width:760px){.template-editor-sidebar>.template-editor-search{grid-column:1;grid-row:1}.template-editor-sidebar>#template-editor-new{grid-column:2;grid-row:1;margin:0}.template-editor-sidebar>.template-editor-file-list{grid-column:1/-1;grid-row:2}}
