.gallery > .prj{ position:absolute; inset:0; overflow:auto; -webkit-overflow-scrolling:touch; background:#e4e2e7; }
.gallery[data-mode="projects"] > .gal-bar,
.gallery[data-mode="projects"] > .gal-scroll,
.gallery[data-mode="projects"] > .gal-sel-bar,
.gallery[data-mode="projects"] > .gal-error,
.gallery[data-mode="projects"] > .gal-build,
.gallery[data-mode="projects"] > .studio{ display:none; }
.gallery:not([data-mode="projects"]) > .prj{ display:none; }
.prj .brand{ border:0; padding:0; min-height:0; background:none; }
.prj .tile{ display:block; flex-direction:row; gap:normal; margin:0; background-image:none; }
.prj{--paper:#f4f3f5;--ink:#222327;--pink:#ff498c;--line:#dedde3;--muted:#656875}
.prj *{box-sizing:border-box}
.prj{margin:0;background:#e4e2e7;color:var(--ink);font:14px/1.45 Arial,sans-serif}
.prj button,.prj input,.prj select{font:inherit;color:inherit}
.prj button{cursor:pointer}
.prj button:focus-visible,.prj input:focus-visible,.prj select:focus-visible{outline:3px solid #00a6d3;outline-offset:3px}
.prj button{background:transparent;border:1px solid var(--line);border-radius:5px;padding:10px 14px;min-height:42px}
.prj button:hover{background:#e9e7ec}
.prj button svg{width:19px;height:19px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.7}
.prj .icon{padding:10px;border:0}
.prj .primary{background:var(--pink);border-color:var(--pink);color:#222327;font-weight:600}
.prj .primary:hover{background:#ff75a7}
.prj .danger{color:#b0204d}
.prj .display,.prj h1,.prj h2,.prj .brand,.prj .cover-label{font-family:var(--font-cond);font-weight:800}
.prj h1{font-size:48px;line-height:1.05;margin:0 0 8px}
.prj h2{font-size:30px;margin:0 0 20px}
.prj .brand{font-size:28px;text-transform:uppercase;text-decoration:none;color:var(--ink)}
.prj .shell{max-width:1500px;margin:24px auto;background:var(--paper);min-height:calc(100dvh - 48px);border-radius:12px;box-shadow:0 3px 20px #22232712;overflow:hidden}
.prj .topbar{min-height:78px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:16px 30px}
.prj .search{display:flex;align-items:center;gap:9px;background:#eae9ee7a;border:1px solid var(--line);padding:0 12px;border-radius:5px;max-width:300px;flex:1;min-width:80px}
.prj .search svg{width:18px;fill:none;stroke:currentColor;stroke-width:1.6}
.prj .search input{border:0;background:transparent;outline:none;width:100%;height:41px}
.prj .spacer{flex:1}
.prj .content{padding:28px 32px 42px}
.prj .heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:26px}
.prj .muted{color:var(--muted);font-size:13px}
.prj .view-tools{display:flex;align-items:center;gap:6px}
.prj .view-tools select{border:0;background:transparent;padding:10px;max-width:150px}
.prj .grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px 25px}
.prj .tile{position:relative;min-width:0}
.prj .tile .hit{display:block;width:100%;border:0;text-align:left;padding:0;background:none}
.prj .cover{position:relative;aspect-ratio:1.48;background:linear-gradient(120deg,#3b3d40,#202124);border-radius:8px;box-shadow:0 5px 8px #22232728,inset 0 0 0 1px #ffffff30;overflow:hidden;transition:transform .18s,box-shadow .18s}
.prj .hit:hover .cover{transform:translateY(-3px);box-shadow:0 8px 15px #22232735}
.prj .cover:after{content:'';position:absolute;inset:0;pointer-events:none;opacity:.16;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.7' d='M0 0h120v120H0z'/%3E%3C/svg%3E")}
.prj .spine{position:absolute;left:0;top:0;bottom:0;width:8%;background:linear-gradient(90deg,#17181b,#323336 55%,#151618 60%,#36373a);border-right:1px solid #777}
.prj .pattern{background-color:#d9d6de;background-repeat:repeat;background-size:var(--prj-tile,200px)}
.prj .pattern[data-pat]{background-image:var(--k-swatch,none),var(--kami-print,none);background-size:var(--prj-tile,200px),cover;background-repeat:repeat,no-repeat;background-position:0 0,center;background-blend-mode:multiply}
.prj .cover .pattern{position:absolute;left:8%;top:0;bottom:0;width:34%}
.prj .cover-label{position:absolute;z-index:2;left:12%;top:34%;width:44%;padding:10px 12px;background:#f5f3ed;transform:rotate(-4deg);font-size:clamp(20px,2.2vw,34px);line-height:.98;box-shadow:0 2px 3px #0002;text-transform:uppercase;overflow-wrap:anywhere}
.prj .cover img{position:absolute;right:6%;top:13%;height:73%;width:35%;object-fit:cover;border:7px solid #f8f7f4;box-shadow:0 2px 5px #0005}
.prj .meta{padding:11px 2px 0;display:flex;align-items:start;justify-content:space-between;gap:5px}
.prj .name{font-weight:600;display:block;overflow-wrap:anywhere}
.prj .meta .icon{margin:-8px -8px 0 0}
.prj .project .name{font-family:var(--font-cond);font-size:19px;text-transform:uppercase}
.prj .selected .cover,.prj .selected .art,.prj .selected .pocket{outline:3px solid var(--pink);outline-offset:3px}
.prj .check{position:absolute;top:10px;right:10px;background:var(--paper);border-radius:50%;z-index:4;width:26px;height:26px;display:grid;place-items:center;box-shadow:0 1px 5px #0003}
.prj .selected .check{background:var(--pink)}
.prj .notebook{border:12px solid #292b2e;padding-left:25px;background-color:var(--paper);position:relative;border-radius:12px}
.prj .binding{position:absolute;width:25px;left:0;top:0;bottom:0}
.prj .book-layout{display:grid;grid-template-columns:235px minmax(0,1fr);min-height:calc(100dvh - 72px)}
.prj .sidebar{padding:24px 16px;border-right:1px solid var(--line);background:#efedf13b}
.prj .tape{display:inline-block;background:#ffd2e2;padding:8px 13px;font:800 29px/1.05 var(--font-cond);transform:rotate(-3deg);margin:14px 0 25px;text-transform:uppercase;box-shadow:0 2px 3px #0001;overflow-wrap:anywhere}
.prj .sidebar-label{font-size:11px;letter-spacing:1.3px;color:var(--muted);margin:18px 0 12px}
.prj .tree-row{display:flex;align-items:center;border-radius:4px}
.prj .tree-row button{border:0;text-align:left;min-height:40px;padding:8px 6px}
.prj .tree-row .tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prj .tree-row.active{background:#262832;color:white}
.prj .tree-row small{margin-left:auto;font-size:11px}
.prj .tree-row button:hover{background:#9992}
.prj .tree-row svg{width:16px}
.prj .tree-more{opacity:0}
.prj .tree-row:hover .tree-more,.prj .tree-more:focus{opacity:1}
.prj .recent{border-top:1px solid var(--line);margin-top:28px;padding-top:12px}
.prj .recent button{display:flex;gap:10px;border:0;text-align:left;width:100%;font-size:12px;padding:8px 0}
.prj .recent img{width:50px;height:62px;object-fit:cover;border:3px solid white}
.prj .book-main{min-width:0}
.prj .book-main .topbar{padding:15px 22px;flex-wrap:wrap;gap:7px}
.prj .crumbs{display:flex;align-items:center;gap:3px;min-width:0;flex-wrap:wrap}
.prj .crumbs button{border:0;padding:5px 6px;min-height:32px;font-size:12px}
.prj .crumbs button:last-child{font-weight:600}
.prj .crumbs span{color:#9b99a4}
.prj .book-main .content{padding:25px}
.prj .art{aspect-ratio:.9;display:flex;align-items:flex-end;justify-content:center;container-type:size}
.prj .art-frame{box-sizing:content-box;--fw:min(calc(100cqw - 14px),calc((100cqh - 14px) * var(--ar)));width:var(--fw);height:calc(var(--fw) / var(--ar));background:#fff;border:7px solid #fcfbf9;box-shadow:0 1px 3px #2223;overflow:hidden}
.prj .art img{width:100%;height:100%;object-fit:cover;display:block}
.prj .pocket{aspect-ratio:.9;background:#d7e6f5;position:relative;overflow:hidden;border:6px solid white;box-shadow:0 1px 3px #2223}
.prj .pocket img{position:absolute;width:55%;height:60%;object-fit:cover;top:10%;left:20%;transform:rotate(-9deg);border:5px solid white}
.prj .pocket img+img{transform:rotate(9deg);left:30%}
.prj .pocket-front{position:absolute;inset:46% 0 0;background:linear-gradient(#accee9,#9dc1e0);border-radius:8px 8px 0 0;padding:22px 14px 12px;display:flex;flex-direction:column;justify-content:end}
.prj .pocket-front:before{content:'';position:absolute;top:-12px;left:0;width:45%;height:18px;background:#accee9;border-radius:6px 6px 0 0}
.prj .selectionbar{background:#ffd2e2;padding:10px 16px;display:flex;align-items:center;gap:8px;border-radius:5px;margin-bottom:20px;flex-wrap:wrap}
.prj .selectionbar button{background:#fff9}
.prj .empty{text-align:center;padding:80px 20px;border:1px dashed #c4c0cb;border-radius:8px;grid-column:1/-1}
.prj .empty h2{margin:8px}
.prj .mobile-title,.prj .drawer-toggle{display:none}
.prj .list.grid,.prj .book-main .list.grid,.prj .projects.list.grid{grid-template-columns:1fr}
.prj .list .tile{display:flex;align-items:center;gap:16px;border-bottom:1px solid var(--line);padding-bottom:15px}
.prj .list .hit{width:130px;flex-shrink:0}
.prj .list .meta{flex:1}
.prj .list .cover-label{font-size:13px;padding:5px}
.prj .list .cover img{border-width:3px}
.prj .list .art,.prj .list .pocket{height:105px;aspect-ratio:1.2}
.prj .list .pocket-front{padding:5px;font-size:10px}
.prj .list .pocket-front small{display:none}
.prj dialog{border:0;border-radius:12px;padding:28px;background:var(--paper);color:var(--ink);width:min(480px,calc(100vw - 32px));max-height:90dvh;box-shadow:0 20px 80px #0004}
.prj dialog::backdrop{background:#16182080;backdrop-filter:blur(4px)}
.prj dialog label{display:block;margin:16px 0 7px}
.prj dialog input,.prj dialog select{width:100%;padding:12px;border:1px solid #cbc8d0;border-radius:5px;background:white}
.prj dialog footer{display:flex;justify-content:end;gap:8px;margin-top:24px}
.prj dialog.preview{width:min(920px,94vw)}
.prj .preview img{display:block;max-height:67dvh;max-width:100%;margin:15px auto;object-fit:contain}
.prj .dialog-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.prj .dialog-top h2{margin:0}
.prj .menu-actions{display:grid;gap:8px;margin-top:20px}
.prj .menu-actions button{text-align:left}
.prj .swatches{display:flex;gap:10px;margin-top:12px}
.prj .swatches button{width:45px;height:45px}
.prj .swatches .chosen{outline:3px solid var(--pink);outline-offset:2px}
.prj .prj-toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#222327;color:white;border-radius:7px;padding:12px 20px;z-index:20;transition:.2s;max-width:90vw}
.prj .prj-toast.show{opacity:1;transform:translate(-50%,0)}
.prj .drawer-shade{display:none}
.prj .drawer-close{display:none}
.prj .save-note{font-size:11px;color:var(--muted);padding-top:30px;text-align:center}
@media(min-width:1400px){
  .prj .book-main .grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:1100px){
  .prj .shell{margin:0;border-radius:0;min-height:100dvh}
  .prj .book-layout{grid-template-columns:210px minmax(0,1fr)}
  .prj .book-main .topbar .search{max-width:170px}
  .prj .topbar{padding:16px 24px}
  .prj .notebook{border-width:7px}
  .prj .cover-label{font-size:27px}
  .prj .grid{gap:25px 20px}
}
@media(max-width:900px) and (orientation:portrait),(max-width:740px),(max-height:550px){
  .prj .book-layout{display:block;min-height:100dvh}
  .prj .sidebar{display:none;position:fixed;left:0;top:0;bottom:0;width:min(300px,85vw);z-index:12;background:var(--paper);overflow:auto;padding:22px}
  .prj .sidebar.open{display:block}
  .prj .drawer-shade.open{display:block;position:fixed;inset:0;background:#0006;z-index:11}
  .prj .drawer-close{display:block;float:right}
  .prj .drawer-toggle,.prj .mobile-title{display:inline-block}
  .prj .mobile-title{font:800 25px var(--font-cond);background:#ffd2e2;padding:5px 10px;text-transform:uppercase;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:rotate(-2deg)}
  .prj .book-main .topbar{padding:12px 15px}
  .prj .book-main .topbar>.crumbs{width:100%;order:5}
  .prj .book-main .topbar>.search{margin-left:auto}
  .prj .book-main .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .prj .notebook{border:0;padding-left:16px;border-radius:0}
  .prj .binding{width:16px}
  .prj .book-main .content{padding:20px 16px}
  .prj .book-main .topbar .import{display:none}
  .prj .tree-more{opacity:1}
  .prj .grid.projects{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .prj h1{font-size:40px}
  .prj .content{padding:24px 20px}
  .prj .topbar{padding:14px 20px;gap:6px}
  .prj .brand{font-size:26px}
  .prj .topbar>.search{max-width:44px;flex:0 0 44px;padding:0 11px;cursor:text}
  .prj .topbar>.search input{width:0}
  .prj .topbar>.search:focus-within{position:absolute;left:20px;right:20px;max-width:none;background:var(--paper);z-index:6}
  .prj .topbar>.search:focus-within input{width:100%}
  .prj .grid.projects{grid-template-columns:1fr;gap:28px}
  .prj .cover-label{font-size:32px}
  .prj .heading{margin-bottom:20px;align-items:end}
  .prj .view-tools{gap:0}
  .prj .view-tools select{max-width:106px;font-size:12px;padding:8px}
  .prj .view-tools .icon{padding:8px}
  .prj .topbar .select-text{font-size:12px;padding:8px}
  .prj .topbar .primary{font-size:12px;padding:10px}
  .prj .topbar .primary .wide{display:none}
  .prj .mobile-title{font-size:23px;max-width:140px}
  .prj .book-main .topbar>.search{max-width:40px}
  .prj .book-main .topbar>.search:focus-within{max-width:none}
  .prj .book-main .topbar .select-text{display:none}
  .prj .book-main .grid{gap:23px 13px}
  .prj .book-main .name{font-size:13px}
  .prj .book-main .muted{font-size:11px}
  .prj .art{border-width:4px}
  .prj .pocket{border-width:4px}
  .prj .pocket-front{padding:12px 10px}
  .prj .book-main .heading h1{font-size:38px}
  .prj .meta{padding-top:8px}
  .prj .book-main .view-tools .listbtn{display:none}
  .prj .selectionbar{padding:10px;font-size:12px}
  .prj .selectionbar button{padding:7px}
  .prj .save-note{font-size:10px}
}
@media(max-height:550px) and (orientation:landscape){
  .prj .topbar{min-height:56px;padding:8px 22px}
  .prj .content{padding:18px 24px}
  .prj .heading{margin-bottom:15px}
  .prj h1{font-size:32px}
  .prj .grid.projects{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
  .prj .cover-label{font-size:22px}
  .prj .book-main .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .prj .book-main .topbar>.crumbs{order:0;width:auto;flex:1}
  .prj .book-main .topbar .search{max-width:44px}
  .prj .book-main .topbar .search input{width:0}
  .prj .book-main .topbar .search:focus-within{max-width:180px}
  .prj .book-main .topbar .search:focus-within input{width:100%}
  .prj .book-main .topbar .mobile-title{font-size:21px}
  .prj .book-main .content{padding-top:12px}
  .prj .book-main .heading{margin-bottom:12px}
  .prj .art,.prj .pocket{aspect-ratio:1.1}
}
