:root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#eef2f6;color:#16212d;line-height:1.5}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:radial-gradient(circle at top left,#fffffff2,#ffffffb8 28%,#e8eef5e6 72%),#eef2f6;overflow-x:hidden}button,input,textarea,select{font:inherit}button{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.5rem;border:1px solid #1f6feb;border-radius:6px;padding:.55rem .9rem;background:#1d5fd0;color:#fff;cursor:pointer;font-weight:650;white-space:nowrap}button:hover:not(:disabled){background:#174da9}button:disabled{opacity:.58;cursor:not-allowed}button.secondary{border-color:#c5ced8;background:#fff;color:#17202a}button.text-button{border-color:transparent;background:transparent;color:#174da9;justify-content:flex-start;padding:0;min-height:2rem}button.text-button:hover:not(:disabled){background:transparent;text-decoration:underline}button.secondary:hover:not(:disabled),.icon-button:hover:not(:disabled){background:#edf3fb}input,textarea,select{width:100%;border:1px solid #c2ccd7;border-radius:6px;background:#fff;color:#16212d;padding:.65rem .75rem}input:focus,textarea:focus,select:focus{border-color:#1d5fd0;box-shadow:0 0 0 3px #1d5fd024;outline:none}textarea{resize:vertical}label{display:grid;gap:.35rem;font-weight:650}code{font-family:Cascadia Mono,Consolas,monospace}.auth-shell,.loading-screen{display:grid;min-height:100vh;place-items:center;padding:1rem}.auth-panel{display:grid;gap:1rem;width:min(430px,100%);border:1px solid #d2dae4;border-radius:8px;background:#fff;padding:1.4rem;box-shadow:0 16px 40px #17202a1a}.auth-panel h1,.topbar h1,.sidebar h2,.template-list h2,.editor h2{margin:0}.eyebrow{margin:0 0 .15rem;color:#5d6d7e;font-size:.78rem;font-weight:750;letter-spacing:0;text-transform:uppercase}.auth-actions,.account-area,.import-export,.list-toolbar,.editor-header,.row-actions{display:flex;align-items:center;gap:.55rem}.auth-actions{justify-content:flex-end}.app-shell{display:grid;grid-template-rows:auto auto 1fr;min-height:100vh}.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;width:min(calc(100% - 2rem),1700px);margin:1rem auto 0;border-bottom:1px solid #d4dde7;border-radius:18px;background:#fff;padding:1rem 1.25rem;box-shadow:0 8px 24px #16212d0f}.account-area{flex-wrap:wrap;justify-content:flex-end}.import-export{flex-wrap:wrap}.signed-in{max-width:16rem;overflow:hidden;color:#4d5d6c;text-overflow:ellipsis;white-space:nowrap}.notice{width:min(calc(100% - 2rem),1700px);margin:.75rem auto 0;border-radius:6px;padding:.65rem .8rem;font-weight:650}.notice.error{border:1px solid #f0a7a7;background:#fff1f1;color:#9b1c1c}.notice.success{border:1px solid #9ed2b0;background:#eefaf1;color:#146c2e}.workspace{display:grid;grid-template-columns:260px minmax(0,1fr);gap:1rem;min-height:0;width:min(calc(100% - 2rem),1700px);margin:1rem auto 1.25rem}.sidebar,.template-list{min-height:calc(100vh - 8.75rem);border:1px solid #d4dde7;border-radius:8px;background:#fff;box-shadow:0 12px 30px #16212d0f}.sidebar{overflow:hidden}.template-list{display:grid;grid-template-rows:auto auto 1fr;justify-self:center;width:min(100%,1400px);overflow:hidden}.sidebar-header,.panel-heading{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e2e8ef;padding:.95rem}.panel-heading{min-height:4.25rem}.panel-heading h2{display:inline-flex;align-items:baseline;gap:.45rem;font-size:1.05rem;font-weight:750;letter-spacing:-.01em}.template-count{display:inline-flex;align-items:center;min-width:2.1rem;justify-content:center;border-radius:999px;background:#edf4ff;color:#174da9;font-size:.82rem;font-weight:750;line-height:1;padding:.22rem .5rem}.folder-nav{display:grid;gap:.35rem;padding:.65rem}.folder-row-wrap{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;gap:.25rem;align-items:center}.folder-row{display:grid;grid-template-columns:auto 1fr auto;gap:.55rem;width:100%;min-width:0;border:1px solid transparent;background:transparent;color:#22313f;justify-content:start;text-align:left}.folder-row-wrap{border-radius:8px;transition:background-color .16s ease,box-shadow .16s ease,transform .16s ease}.folder-row-wrap.drop-target{background:#1d5fd012;box-shadow:inset 0 0 0 1px #91baf2}.folder-row-wrap.drop-target .folder-row,.folder-row.drop-target{background:#eaf2ff;border-color:#91baf2}.folder-row.drop-target{cursor:copy}.folder-row span,.template-title,.template-preview,.tag-line{min-width:0;overflow:hidden;text-overflow:ellipsis}.folder-row span{white-space:nowrap}.folder-row strong{color:#607284;font-size:.83rem}.folder-row.active,.template-row.active{border-color:#91baf2;background:#eaf2ff}.folder-divider{height:1px;margin:.35rem 0;background:#e2e8ef}.folder-toggle,.folder-toggle-spacer{width:1.55rem;min-width:1.55rem;height:1.55rem;display:inline-flex;align-items:center;justify-content:center;border:0;padding:0;background:transparent;color:#607284}.folder-toggle{border-radius:999px}.folder-toggle:hover:not(:disabled){background:#edf3fb}.folder-children{display:grid;gap:.35rem;grid-column:1 / -1;margin-left:.25rem;padding-left:.45rem;border-left:1px solid #e7edf4}.icon-button{width:2.25rem;min-height:2.25rem;border-color:transparent;padding:0;background:transparent;color:#3a4a5a}.icon-button.danger{color:#a32828}.icon-button.favorite.on{color:#a96f00}.list-toolbar{border-bottom:1px solid #e2e8ef;padding:.85rem .95rem;flex-wrap:wrap}.search-box{position:relative;flex:1 1 18rem;display:block;min-width:14rem}.search-box svg{position:absolute;left:.65rem;top:.72rem;color:#718295}.search-box input{padding-left:2.2rem}.templates-scroll{overflow:auto;min-height:0;padding:1rem}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-content:start;min-width:0}.template-card{display:grid;grid-template-rows:auto 1fr;overflow:hidden;border:1px solid #dfe7f1;border-radius:16px;background:#fff;cursor:grab;transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease,transform .16s ease;min-width:0}.template-card:active{cursor:grabbing}.template-card-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.85rem;align-items:start;padding:.9rem .95rem .75rem}.template-card-main{display:flex;flex-direction:column;gap:.3rem;align-items:flex-start;min-width:0;border:0;background:transparent;color:#17202a;text-align:left;width:100%;padding:0}.template-card-main:hover:not(:disabled){background:transparent}.template-card-title{display:-webkit-box;overflow:hidden;white-space:normal;word-break:break-word;overflow-wrap:anywhere;line-height:1.25;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:1rem;font-weight:780}.template-card-preview,.template-card-tags,.empty-small,.empty-state{color:#657789;font-size:.9rem}.template-card-preview{display:-webkit-box;overflow:hidden;white-space:normal;word-break:break-word;overflow-wrap:anywhere;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:6}.template-card-tags{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-card-actions{display:flex;align-items:flex-start;gap:.25rem;flex-shrink:0;align-self:flex-start;padding-top:.05rem}.drag-handle{width:2rem;min-width:2rem;height:2rem;border-color:transparent;padding:0;border-radius:999px;background:#f4f7fb;color:#677789;align-self:flex-start}.drag-handle:hover:not(:disabled){background:#e9eff8}.drag-handle.spacer{visibility:hidden}.template-card.active{border-color:#87aee7;background:linear-gradient(180deg,#edf4ff,#eaf1ff);box-shadow:0 10px 22px #1d5fd014}.template-card.dragging{border-style:dashed;opacity:.72;box-shadow:0 10px 22px #1d5fd01f}.template-card:hover{border-color:#c8d7ea;box-shadow:0 10px 18px #16212d0d;transform:translateY(-1px)}.template-card.drag-over{border-color:#91baf2;box-shadow:0 0 0 1px #91baf259,0 12px 24px #1d5fd01a}.template-card-actions .icon-button{width:2rem;min-height:2rem}.empty-state-card{margin:0 0 1rem;border:1px dashed #c7d2de;border-radius:12px;background:linear-gradient(180deg,#fafcff,#f5f8fc);padding:1rem}.empty-state-card.subtle{background:#fbfdff}.empty-state-title{margin:0 0 .25rem;color:#203040;font-weight:750}.empty-state{margin:0;line-height:1.5}.editor-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;justify-content:flex-end;background:#11182757;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);padding:1.25rem}.editor-drawer{display:flex;flex-direction:column;width:min(680px,calc(100vw - 2.5rem));max-width:100%;min-height:0;border:1px solid #d4dde7;border-radius:20px;background:#fff;box-shadow:0 24px 80px #0b12203d;overflow:hidden;animation:drawer-in .18s ease-out}.editor-drawer form{display:flex;flex-direction:column;min-height:0}.editor-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;border-bottom:1px solid #e2e8ef;padding:1.2rem 1.2rem 1rem}.editor-body{display:grid;gap:1rem;overflow:auto;padding:1.2rem}.editor-footer{display:flex;justify-content:flex-end;gap:.65rem;border-top:1px solid #e2e8ef;padding:1rem 1.2rem 1.2rem}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.checkbox-row{display:flex;align-items:center;gap:.55rem}.checkbox-row input{width:auto}.hidden-input{display:none}@media(max-width:980px){.topbar{align-items:flex-start;flex-direction:column;width:calc(100% - 1.25rem)}.workspace{grid-template-columns:1fr;width:calc(100% - 1.25rem)}.sidebar,.template-list{min-height:auto;border-radius:8px}.templates-scroll{max-height:none}.editor-backdrop{padding:0}.editor-drawer{width:100vw;height:100vh;border-radius:0}}@media(max-width:620px){.account-area,.import-export,.list-toolbar,.editor-header{align-items:stretch;flex-direction:column;width:100%}.template-grid,.form-grid{grid-template-columns:1fr}}@media(min-width:1680px){.template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}.workspace{grid-template-columns:clamp(320px,24vw,400px) minmax(0,1fr);align-items:stretch}.library-sidebar{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;min-width:320px;max-width:420px;overflow:hidden;border:1px solid #d4dde7;border-radius:16px;background:#fff;box-shadow:0 12px 30px #16212d0f}.library-sidebar .folder-nav{overflow-y:auto;overflow-x:hidden;display:grid;align-content:start;gap:.2rem;min-width:0;padding:.7rem .7rem .85rem}.sidebar-footer{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.75rem;border-top:1px solid #e2e8ef;padding:.75rem .85rem;background:linear-gradient(180deg,#fcfdff,#f8fbff)}.sidebar-footer-title{margin:0;color:#5d6d7e;font-size:.78rem;font-weight:750;letter-spacing:.02em;text-transform:uppercase}.import-export-panel{position:relative;display:flex;justify-content:flex-end;min-width:0}.backup-menu{position:relative}.backup-menu summary,.folder-actions-menu summary{list-style:none}.backup-menu summary::-webkit-details-marker,.folder-actions-menu summary::-webkit-details-marker{display:none}.backup-menu summary{display:inline-flex;align-items:center;gap:.35rem;min-height:2.25rem;border:1px solid #c5ced8;border-radius:6px;background:#fff;color:#17202a;cursor:pointer;font-weight:700;padding:.45rem .65rem}.backup-menu summary:hover{background:#edf3fb}.backup-menu-list,.folder-actions-popover{position:absolute;z-index:20;display:grid;gap:.25rem;min-width:11rem;border:1px solid #d4dde7;border-radius:8px;background:#fff;padding:.35rem;box-shadow:0 14px 34px #16212d29}.backup-menu-list{right:0;bottom:calc(100% + .45rem)}.backup-menu-list button,.folder-actions-popover button{justify-content:flex-start;min-height:2.05rem;width:100%;border-color:transparent;background:transparent;color:#22313f;padding:.4rem .55rem;font-weight:650;text-align:left}.backup-menu-list button:hover:not(:disabled),.folder-actions-popover button:hover:not(:disabled){background:#edf3fb}.folder-actions-popover button.danger{color:#9b1c1c}.import-export-panel button{min-height:2.1rem;justify-content:flex-start}.main-panel-header{display:grid;gap:.85rem;border-bottom:1px solid #e2e8ef;padding:1rem 1rem .9rem}.view-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;min-width:0}.view-title-block{display:grid;gap:.25rem;min-width:0}.main-toolbar-title{display:flex;align-items:center;gap:.6rem;min-width:0}.main-toolbar-title h2{margin:0;min-width:0;font-size:1.2rem;font-weight:800;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.view-toolbar-row{display:flex;align-items:center;gap:.75rem;min-width:0}.toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:.65rem;flex:0 0 auto;min-width:0}.search-control{flex:1 1 auto;min-width:17.5rem}.sort-box{display:grid;align-items:center;grid-template-columns:auto minmax(10rem,12rem);gap:.45rem;width:auto;min-width:0;color:#5d6d7e;font-size:.88rem;font-weight:700}.sort-box select{min-width:0;height:2.5rem;padding-top:.5rem;padding-bottom:.5rem}.search-control input{height:2.5rem}.view-toggle{display:inline-flex;flex:0 0 auto;padding:.2rem;border:1px solid #d4dde7;border-radius:6px;background:#f5f8fc;gap:.2rem}.toggle-chip{border-color:transparent;background:transparent;color:#476072;min-height:2rem;padding:.35rem .85rem;border-radius:5px}.toggle-chip:hover:not(:disabled){background:#edf3fb}.toggle-chip.active{background:#fff;color:#174da9;box-shadow:0 4px 12px #174da91f}.new-template-button{flex:0 0 auto;padding-inline:1rem;box-shadow:0 8px 20px #1d5fd024}.tag-filter-row{display:flex;align-items:center;gap:.5rem;overflow-x:auto;padding:.85rem 1rem .1rem;scrollbar-width:thin}.tag-chip{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;border:1px solid #d4dde7;border-radius:999px;background:#f7f9fc;color:#3a4a5a;padding:.45rem .75rem;min-height:2.15rem;font-weight:650}.tag-chip strong{color:#5d6d7e;font-size:.8rem}.tag-chip.active{border-color:#87aee7;background:#edf4ff;color:#174da9}@media(max-width:1100px){.view-toolbar-row{flex-wrap:wrap}.search-control{flex-basis:100%;min-width:min(100%,17.5rem)}.toolbar-actions{flex:1 1 auto;justify-content:flex-start;flex-wrap:wrap}}.template-list{width:100%;justify-self:stretch;min-width:0}.templates-scroll{min-width:0}.template-grid{grid-template-columns:repeat(2,minmax(14.5rem,1fr));gap:.5rem}.template-grid.list-mode{grid-template-columns:1fr}.template-card{position:relative;grid-template-columns:minmax(0,1fr);gap:0;padding:0;border-radius:8px;cursor:default}.template-card.grid-card{min-height:11.45rem}.template-card.list-card{min-height:0}.template-card-main{align-self:stretch;gap:.42rem;min-height:100%;padding:.72rem 2.35rem .58rem .68rem}.template-card-heading{display:grid;grid-template-columns:.45rem minmax(0,1fr);gap:.42rem;align-items:start;width:100%}.template-card-dot{width:.38rem;height:.38rem;margin-top:.28rem;border-radius:999px;background:#246b1d}.template-card-title{display:-webkit-box;overflow:hidden;white-space:normal;word-break:break-word;overflow-wrap:anywhere;line-height:1.16;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:.86rem;font-weight:800;color:#121a23}.template-card-preview{display:-webkit-box;overflow:hidden;white-space:normal;word-break:break-word;overflow-wrap:anywhere;line-height:1.42;margin-top:.04rem;-webkit-box-orient:vertical;-webkit-line-clamp:5;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:.76rem;color:#27313b}.template-card.list-card .template-card-preview{-webkit-line-clamp:10}.template-card-tags{display:flex;flex-wrap:wrap;gap:.22rem;max-width:100%;max-height:1.55rem;overflow:hidden;margin-top:auto}.template-tag-pill{display:inline-flex;align-items:center;border-radius:4px;background:#dff2c5;color:#1f5d18;padding:.12rem .34rem;font-size:.64rem;font-weight:750;line-height:1.25;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-tag-pill.subtle{background:#f2f1eb;color:#68706b}.template-card-actions{position:absolute;top:.42rem;right:.42rem;z-index:2;display:flex;flex-direction:row-reverse;align-items:center;gap:.08rem;margin-left:0}.template-card-actions .icon-button{width:1.55rem;min-height:1.55rem;opacity:0;pointer-events:none;color:#65717d;background:#ffffffd1;border-color:transparent;transform:translate(.2rem)}.template-card-actions .icon-button.favorite{opacity:1;pointer-events:auto;transform:none}.template-card:hover .template-card-actions .icon-button,.template-card:focus-within .template-card-actions .icon-button{opacity:1;pointer-events:auto;transform:none}.template-card-actions .icon-button.favorite.on svg{fill:currentColor}.template-card.active{border-left:2px solid #ff9800;box-shadow:none}.template-card.dragging{cursor:grabbing}.drag-handle{position:absolute;top:.45rem;left:.35rem;z-index:3;width:1.45rem;min-width:1.45rem;height:1.45rem;min-height:1.45rem;opacity:0;background:#ffffffe6}.template-card:hover .drag-handle:not(:disabled),.template-card:focus-within .drag-handle:not(:disabled){opacity:1}.drag-handle.spacer{display:none}.folder-row-actions{display:inline-flex;align-items:center;justify-content:center;min-width:2rem}.folder-actions-menu{position:relative}.folder-actions-menu summary{display:inline-flex;align-items:center;justify-content:center;width:1.9rem;min-height:1.9rem;border-radius:999px;color:#607284;cursor:pointer;opacity:0}.folder-row-wrap:hover .folder-actions-menu summary,.folder-row-wrap:focus-within .folder-actions-menu summary,.folder-actions-menu[open] summary{opacity:1}.folder-actions-menu summary:hover{background:#edf3fb;color:#22313f}.folder-actions-popover{top:calc(100% + .25rem);right:0}.folder-row-wrap{grid-template-columns:24px minmax(0,1fr) 32px;gap:.35rem;min-width:0}.folder-row{grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:.5rem;min-height:2.55rem;min-width:0;border-radius:8px;padding:.35rem .5rem .35rem .75rem;font-size:.92rem}.folder-row.static{min-height:2.55rem;background:#f7f9fc;font-weight:750}.folder-row.static+.folder-row.static{margin-top:.2rem}.folder-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:anywhere}.folder-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;border-radius:999px;background:#eef4ff;color:#53677a;font-size:.76rem;line-height:1;padding:.22rem .45rem}.folder-row.active .folder-count{background:#fff;color:#174da9}.folder-toggle,.folder-toggle-spacer{width:1.5rem;min-width:1.5rem;height:1.5rem}.folder-toggle-spacer{opacity:0}.folder-children{gap:.2rem;margin-left:.72rem;padding-left:.35rem}.editor-drawer{width:min(720px,calc(100vw - 2.5rem))}@media(max-width:980px){.workspace{grid-template-columns:1fr}.library-sidebar{min-height:auto}.view-title-row{align-items:flex-start}.view-toggle{justify-content:space-between}.toggle-chip{flex:1 1 50%}}@media(max-width:620px){.view-title-row{flex-wrap:wrap}.new-template-button{margin-left:auto}.toolbar-actions,.sort-box,.view-toggle{width:100%}.sort-box,.import-export-panel,.template-grid,.template-grid.list-mode{grid-template-columns:1fr}.template-card{grid-template-columns:minmax(0,1fr)}.template-card-actions{grid-column:auto;margin-left:0;justify-content:flex-start}.folder-row-actions{opacity:1;pointer-events:auto;transform:none}}@media(min-width:1680px){.template-grid:not(.list-mode){grid-template-columns:repeat(3,minmax(0,1fr))}}@keyframes drawer-in{0%{transform:translate(16px);opacity:0}to{transform:translate(0);opacity:1}}
