:root{--red:#8f170f;--bright:#bd3022;--bg:#bcbcbc;--panel:#d2d2d2;--white:#fff;--text:#171717;--shadow:#707070;--field:#f4f4f4}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:12px Arial,Helvetica,sans-serif}button,a,input{font:inherit}button,.button{background:var(--panel);color:var(--text);border:0;box-shadow:inset 1px 1px var(--white),inset -1px -1px #555,inset 2px 2px #eee,inset -2px -2px #999;padding:8px 12px;cursor:pointer;text-decoration:none;display:inline-block}button:active{box-shadow:inset 2px 2px #555}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px dashed var(--red);outline-offset:3px}header{display:flex;align-items:center;padding:10px 24px;border-bottom:2px solid #7b7b7b;gap:12px;background:linear-gradient(#eee,#c4c4c4)}header img{height:36px;width:36px;object-fit:contain}header strong{letter-spacing:2px;font-size:17px}.header-right{margin-left:auto;display:flex;align-items:center;gap:20px;font-size:10px;letter-spacing:1px}main{max-width:1040px;margin:28px auto 105px;padding:0 20px}.window{padding:3px;background:var(--panel);box-shadow:inset 1px 1px white,inset -1px -1px #444,inset 2px 2px #eee,inset -2px -2px #888;margin-bottom:14px}.titlebar{background:linear-gradient(90deg,#64100b,var(--red),#ba5246);color:white;font-weight:bold;display:flex;justify-content:space-between;align-items:center;padding:5px 7px;min-height:24px;font-size:11px}.titlebar>span:last-child{font-size:10px;letter-spacing:2px}.featured-content{padding:14px;display:flex;gap:16px}.cover{width:148px;flex-shrink:0;box-shadow:inset 2px 2px #555;padding:3px;background:#aaa}.cover img{width:100%;height:150px;object-fit:cover;filter:grayscale(1)}.feature-info{flex:1;min-width:0}.eyebrow{font-size:10px;letter-spacing:1px;color:#555;margin:3px 0 5px}h1{font-size:36px;letter-spacing:-1.5px;margin:0 0 10px;line-height:1.05}.tags{display:flex;gap:5px;flex-wrap:wrap}.tags span{font-size:9px;background:#eee;border:1px solid #aaa;padding:3px 5px}.feature-actions{display:flex;gap:6px;margin:10px 0}.accent,button.active{background:var(--red);color:white}.scope{height:39px;background:#161616;padding:4px 5px 0;display:flex;gap:3px;align-items:end;border:2px inset #eee;overflow:hidden}.scope i{flex:1;background:linear-gradient(to top,#72120c,#bf493c,#f2b5ad);min-width:2px;height:var(--height);animation:bounce 1.7s ease-in-out infinite alternate;animation-delay:var(--delay)}@keyframes bounce{to{height:15%}}.screen{display:none;padding:0 14px 14px}.screen.open{display:block}.screen video{display:block;width:100%;max-height:440px;background:black}.tabs{display:flex;gap:4px;margin:20px 0 0}.tabs button{font-size:10px;font-weight:bold;padding:9px 16px}.tabs button.active{background:var(--panel);color:var(--red);box-shadow:inset 1px 1px white,inset -1px 0 #777;border-top:3px solid var(--red)}.tabs+section{margin-top:0}.browser-content{padding:14px 12px}.search{display:flex;gap:15px;align-items:center;font-size:10px}.search input{flex:1;background:var(--field);border:2px inset #eee;padding:7px 8px;border-radius:0;color:var(--text)}.filter-label{font-size:9px;color:#666;margin:13px 0 6px}.filters{display:flex;gap:5px;flex-wrap:wrap}.filters button{font-size:9px;font-weight:bold;padding:7px 10px}.archive-toolbar{display:flex;gap:14px;align-items:center;padding:10px;font-size:9px;color:#666}.badge{background:var(--red);color:white;padding:4px 6px;font-weight:bold}.table-head,.project{display:grid;grid-template-columns:35px 1fr 145px 40px;gap:8px;align-items:center}.table-head{font-size:9px;padding:7px 12px;background:#bebebe;border-top:1px solid #999;border-bottom:1px solid #999;color:#555}.project{padding:15px 12px;background:var(--field);border-bottom:1px solid #aaa;cursor:pointer;min-height:66px}.project:nth-child(even){background:#e5e5e5}.project:hover{background:#edd3d0}.project.selected{background:var(--red);color:white}.project .number{font-size:10px}.project strong{display:block;font-size:13px;margin-bottom:5px}.project small{font-size:9px;opacity:.65}.project .discipline{font-size:10px}.star{background:transparent;box-shadow:none;font-size:18px;padding:4px;color:var(--red)}.selected .star{color:white}.empty{padding:20px}.palette{display:flex;height:12px;border:2px inset white;margin-top:20px}.palette i{flex:1;background:#4f0c08}.palette i:nth-child(2){background:#76120c}.palette i:nth-child(3){background:#a42015}.palette i:nth-child(4){background:#c8584c}.palette i:nth-child(5){background:#f2f2f2}.palette i:nth-child(6){background:#c0c0c0}.palette i:nth-child(7){background:#7b7b7b}.palette i:nth-child(8){background:#191919}footer{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;font-size:9px;color:#555;padding:22px 0}footer a{color:inherit}.player{position:fixed;bottom:0;left:0;right:0;display:flex;align-items:center;gap:20px;background:linear-gradient(#ddd,#c0c0c0);box-shadow:inset 0 2px white;border-top:1px solid #777;padding:12px 20px;z-index:10}.now-playing{display:flex;gap:9px;align-items:center;min-width:230px}.mini-icon{background:var(--red);color:white;font-weight:bold;font-style:italic;display:grid;place-items:center;width:38px;height:38px;border:2px inset white}.now-playing strong{font-size:11px}.now-playing small{display:block;font-size:8px;color:#666;margin-top:5px;letter-spacing:1px}.transport{display:flex;gap:3px}.transport button{padding:7px 10px}.timeline{display:flex;align-items:center;gap:8px;flex:1;font-size:9px}.timeline input{width:100%}input[type=range]{accent-color:var(--red);height:12px;cursor:pointer}.volume{display:flex;gap:8px;align-items:center;font-size:9px}.volume input{width:70px}.player-brand{font-size:10px;font-weight:bold;letter-spacing:1px}.about-content{padding:25px;line-height:1.8}.about h2{margin-top:0}[hidden]{display:none!important}body.dark{--bg:#292727;--panel:#464242;--text:#f2eded;--field:#302d2d;--white:#999}body.dark header,body.dark .player{background:linear-gradient(#514b4b,#393434)}body.dark .project:nth-child(even){background:#3b3535}body.dark .eyebrow,body.dark .filter-label,body.dark footer,body.dark .archive-toolbar,body.dark .now-playing small{color:#bbb}body.dark .tags span,body.dark .table-head{background:#514747;color:#ddd}body.dark .project:hover{background:#65413e}@media(max-width:750px){header{padding:9px 12px}.header-right{font-size:0;gap:0}main{padding:0 10px;margin-top:15px}.featured-content{gap:10px;padding:10px}.cover{width:86px}.cover img{height:122px}h1{font-size:26px}.eyebrow{font-size:8px}.tags span{font-size:7px}.feature-actions{flex-wrap:wrap}.feature-actions button,.feature-actions a{font-size:9px}.table-head,.project{grid-template-columns:24px 1fr 90px 28px;gap:5px}.project .discipline{font-size:8px}.player{gap:10px;flex-wrap:wrap;padding:8px 10px}.now-playing{min-width:0;flex:1}.transport button{padding:7px 9px}.timeline{flex-basis:100%;order:3}.volume,.player-brand{display:none}.scope{height:30px}footer{gap:10px}.filters button{padding:8px;font-size:8px}}@media(prefers-reduced-motion:reduce){.scope i{animation:none}}
/* Restored profile, services, and native Pic-Time portfolio. */
.project-open{box-shadow:none;background:transparent;color:inherit;display:flex;align-items:center;gap:12px;text-align:left;padding:0;min-width:0}.project-open:hover{color:inherit}.project-open img{width:52px;height:40px;object-fit:cover;border:2px inset #eee;flex-shrink:0}.project-open strong{overflow-wrap:anywhere}.profile-intro{display:flex;align-items:center;gap:24px}.profile-photo{width:135px;height:165px;object-fit:cover;border:3px inset #eee}.stats{display:flex;margin:24px 0;border:2px inset #eee;background:var(--field)}.stats>div{flex:1;padding:16px;text-align:center}.stats strong{display:block;font-size:25px;color:var(--red)}.stats span{font-size:10px}.about-content h3{background:linear-gradient(90deg,var(--red),#ad4b40);color:white;padding:7px 10px;font-size:12px;margin:25px 0 12px}.info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.info-grid article{border:2px inset #eee;background:var(--field);padding:15px}.info-grid small{font-size:8px}.info-grid h4{font-size:16px;margin:8px 0}.gear{margin:0}.gear>div{display:grid;grid-template-columns:190px 1fr;gap:15px;padding:12px;border-bottom:1px solid #999;background:var(--field)}.gear dt{font-weight:bold}.gear dd{margin:0}.service-item{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:14px;border-bottom:1px solid #aaa;background:var(--field)}.service-item h4{font-size:13px;margin:0 0 4px}.service-item p{margin:0}.service-price{font-weight:bold;white-space:nowrap;color:var(--red);font-size:15px}.service-price small{display:block;text-align:right;font-size:9px;color:var(--text);font-weight:normal}.embed-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px}.pictime{margin-top:22px}.pictime iframe{display:block;border:0;width:100%;height:920px;background:#fff}#photo-viewer{display:block;width:100%;max-height:600px;object-fit:contain;background:#222}#media-caption{margin:0;padding:9px;background:var(--field);font-size:10px}.tabs{flex-wrap:wrap}.screen video[hidden]{display:none!important}.about-content p{max-width:780px}.dark .service-price{color:#efafa7}.dark .stats strong{color:#efafa7}@media(max-width:750px){.about-content{padding:15px}.profile-intro{gap:14px;align-items:flex-start}.profile-photo{width:85px;height:115px}.profile-intro h2{font-size:18px}.profile-intro p{margin:5px 0}.info-grid{grid-template-columns:1fr}.gear>div{grid-template-columns:1fr;gap:3px}.service-item{padding:10px;gap:10px}.service-price{font-size:12px}.embed-toolbar{align-items:flex-start;flex-direction:column}.project-open{gap:7px}.project-open img{width:35px;height:35px}.project-open strong{font-size:11px}.tabs button{padding:9px 11px}.pictime iframe{height:700px}}

.table-head,.project{grid-template-columns:35px 1fr 145px 75px}.project-actions{display:flex;align-items:center;gap:6px}.rename{font-size:16px;padding:4px 6px}.rename-dialog{width:min(440px,calc(100% - 30px));color:var(--text);border:0;margin:auto}.rename-dialog::backdrop{background:rgba(0,0,0,.55)}.rename-dialog form{padding:18px}.rename-dialog label{font-size:10px;display:block;margin-bottom:8px}.rename-dialog input{width:100%;background:var(--field);color:var(--text);border:2px inset #eee;padding:10px}.rename-dialog p{font-size:11px;line-height:1.6;color:var(--text)}.rename-controls{display:flex;gap:7px;justify-content:flex-end}.rename-controls button{font-size:10px}@media(max-width:750px){.table-head,.project{grid-template-columns:20px 1fr 68px 58px}.project-actions{gap:2px}.rename{padding:4px}.project .discipline{overflow-wrap:anywhere}.table-head{font-size:8px}}
.admin-link{font-size:9px;padding:4px 8px}.admin-dialog{width:min(800px,calc(100% - 24px));max-height:85vh;border:0;margin:auto;color:var(--text)}.admin-dialog::backdrop{background:rgba(0,0,0,.6)}.admin-body{padding:20px;overflow:auto;max-height:calc(85vh - 35px)}.admin-dialog h2{font-size:18px}.admin-dialog input,.admin-dialog textarea{width:100%;padding:9px;margin:8px 0 14px;color:var(--text);background:var(--field);border:2px inset #eee}.admin-dialog textarea{min-height:95px;resize:vertical}.admin-field{display:block;font-size:11px}.admin-toolbar{display:flex;justify-content:space-between;align-items:center}.admin-dialog h3{background:var(--red);color:#fff;padding:8px}.admin-dialog .titlebar button{padding:2px 7px}.admin-dialog #admin-message{line-height:1.6}.table-head,.project{grid-template-columns:35px 1fr 145px 40px}@media(max-width:750px){.table-head,.project{grid-template-columns:20px 1fr 80px 28px}}
/* Waveform panel follows the light and dark desktop surfaces. */
.scope{background:linear-gradient(180deg,#e2e2e2,#cecece);border:2px inset #9c9c9c;box-shadow:inset 1px 1px 3px rgba(0,0,0,.22)}
.scope i{background:linear-gradient(to top,#72120c 0%,#bd2a1d 50%,#eb685b 100%);border-radius:1px 1px 0 0}
body.dark .scope{background:linear-gradient(180deg,#2c2727,#1e1b1b);border-color:#635959;box-shadow:inset 1px 1px 3px rgba(0,0,0,.5)}
body.dark .scope i{background:linear-gradient(to top,#8f170f 0%,#d83424 50%,#ffa599 100%)}

/* Compact gallery preview; the embedded page scrolls inside the frame. */
.pictime iframe{width:100%;height:auto;aspect-ratio:16 / 9;min-height:0;}
/* A single Pic-Time portfolio needs only a compact, centred preview. */
.pictime iframe{width:50%;margin-inline:auto;}

/* Fill the player portrait frame with the original red photograph. */
.cover{position:relative;overflow:hidden;min-height:150px;}
.cover img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);object-fit:cover;object-position:center;filter:none;}
@media(max-width:750px){.cover{min-height:122px;}}

/* Audio analysis controls bar heights; no decorative idle animation. */
.scope i{animation:none;transition:none;height:2px;}
/* An uncluttered workspace for the administrator, independent of the public theme. */
.admin-dialog{width:min(1120px,calc(100% - 32px));max-height:94vh;background:#f5f7fa;color:#202733;border-radius:12px;box-shadow:0 20px 80px #0006;padding:0;font:14px Arial,sans-serif}
.admin-dialog .titlebar{background:#202b3b;padding:16px 22px;font-size:15px;letter-spacing:0;position:sticky;top:0;z-index:2}
.admin-dialog .titlebar button{background:#ffffff22;color:white;box-shadow:none;border-radius:5px;font-size:20px}
.admin-body{padding:24px 32px;max-height:calc(94vh - 60px);overflow:auto}
.admin-dialog h2{font-size:24px;margin:10px 0}.admin-dialog h3{background:transparent;color:#202733;border-bottom:1px solid #cdd5e0;font-size:18px;padding:20px 0 12px;margin:12px 0 18px}
.admin-dialog input,.admin-dialog textarea{background:white;color:#202733;border:1px solid #bcc7d5;border-radius:6px;padding:12px;font-size:14px;margin:8px 0;box-shadow:none}
.admin-dialog textarea{min-height:130px;line-height:1.6}.admin-field{font-size:13px;margin-bottom:18px}.admin-field>span{font-weight:600}.admin-project-card{display:flex;align-items:center;gap:20px;background:white;border:1px solid #d9e0e8;padding:16px;border-radius:9px;margin-bottom:12px}.admin-project-card img{width:180px;aspect-ratio:16/9;object-fit:cover;background:#e4e8ed;border-radius:6px;flex-shrink:0}.admin-project-card>div{flex:1;min-width:0}.admin-project-card small{display:block;color:#657286;font-size:11px;margin-top:6px}.admin-dialog button{box-shadow:none;border:1px solid #bdc8d5;background:#fff;color:#202733;border-radius:6px;padding:10px 16px;font-size:13px}.admin-dialog button.accent{background:#8f170f;color:#fff;border-color:#8f170f}.admin-toolbar{position:sticky;top:-24px;padding:12px 0;background:#f5f7fa;z-index:1}.admin-dialog #admin-message{color:#394960}.admin-dialog #admin-editor>button[type=submit]{position:sticky;bottom:0;box-shadow:0 2px 12px #0002;margin:15px 0}
@media(max-width:600px){.admin-body{padding:16px}.admin-project-card{gap:12px;padding:12px}.admin-project-card img{width:100px}.admin-dialog{width:calc(100% - 16px)}.admin-toolbar{top:-16px}}

.feature-actions{flex-wrap:wrap;}

.table-head,.project{grid-template-columns:35px 1fr 145px}.admin-favorite{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:13px;color:#35465b}.admin-dialog .admin-favorite input{width:16px;height:16px;margin:0;accent-color:#8f170f}@media(max-width:750px){.table-head,.project{grid-template-columns:20px 1fr 80px}}
/* Administrator workspace uses the same desktop palette as the portfolio. */
.admin-dialog{background:var(--panel);color:var(--text);border-radius:0;padding:3px;box-shadow:inset 1px 1px var(--white),inset -1px -1px #444,inset 2px 2px #eee,inset -2px -2px #888,0 20px 80px #0006}
.admin-dialog .titlebar{background:linear-gradient(90deg,#64100b,var(--red),#ba5246);padding:10px 14px;font-size:12px}
.admin-dialog .titlebar button,.admin-dialog button{background:var(--panel);color:var(--text);border:0;border-radius:0;box-shadow:inset 1px 1px var(--white),inset -1px -1px #555,inset 2px 2px #eee,inset -2px -2px #999}
.admin-dialog button.accent{background:var(--red);color:white}
.admin-toolbar{background:var(--panel)}
.admin-dialog h3{background:linear-gradient(90deg,#64100b,var(--red),#ba5246);color:white;border:0;padding:8px 12px;font-size:13px}
.admin-project-card{background:var(--field);border:2px inset #eee;border-radius:0}
.admin-project-card img{border:2px inset #eee;border-radius:0;background:var(--panel)}
.admin-dialog input,.admin-dialog textarea{background:var(--field);color:var(--text);border:2px inset #eee;border-radius:0}
.admin-project-card small,.admin-favorite,.admin-dialog #admin-message{color:var(--text)}
.admin-dialog button:hover{opacity:.8;transition:opacity 160ms steps(3,end)}
@media(prefers-reduced-motion:reduce){.admin-dialog button:hover{transition:none}}
/* Explicit admin title colour in both themes. */
.admin-dialog .titlebar{background:#8f170f;background-image:linear-gradient(90deg,#64100b,#8f170f,#ba5246);color:#fff;}

#save-notification{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:1000;padding:14px 22px;background:var(--red);color:white;font-size:13px;font-weight:bold;border:2px outset #e3b2ab;box-shadow:3px 3px 0 #0003;max-width:calc(100% - 24px);text-align:center;}

.project-subtitle{display:block;font-size:11px;margin:0 0 5px;opacity:.85;}.admin-credit{display:block;margin-top:12px;font-size:12px;}

/* Edge-to-edge desktop, compact proportional mobile layout. */
main{max-width:none;width:100%;margin:0 0 100px;padding:0;}
.featured{margin-top:0;}
.featured-content{align-items:flex-start;}
.cover{aspect-ratio:3 / 4;min-height:0;align-self:flex-start;flex-shrink:0;}
.feature-info{min-width:0;}
.screen video{height:auto;max-width:100%;object-fit:contain;}
.project-open span{min-width:0;}
@media(max-width:750px){
 header{padding:6px 8px;gap:8px;}header img{width:25px;height:25px;}header strong{font-size:12px;letter-spacing:1px;}.header-right button{padding:6px 8px;}
 main{margin:0 0 90px;padding:0;}
 .window{margin-bottom:8px;}.titlebar{padding:4px 6px;min-height:21px;font-size:10px;}.titlebar>span:last-child{font-size:8px;}
 .featured-content{padding:8px;gap:8px;}.cover{width:64px;min-height:0;}.cover img{height:calc(100% - 6px);}
 .eyebrow{font-size:7px;letter-spacing:.4px;margin:0 0 4px;}h1{font-size:21px;letter-spacing:-.7px;margin-bottom:7px;}
 .tags{gap:3px;}.tags span{font-size:7px;padding:2px 3px;}.feature-actions{gap:4px;margin:7px 0;}.feature-actions button,.feature-actions a{font-size:8px;padding:6px 7px;}.scope{height:38px;min-height:38px;gap:1.5px;padding:4px 4px 0;margin-top:10px;}
 .tabs{margin-top:10px;gap:3px;}.tabs button{font-size:9px;padding:7px 9px;}
 .browser-content{padding:9px 8px;}.search{gap:8px;font-size:9px;}.search input{padding:6px;min-width:0;}.filter-label{margin:9px 0 5px;}.filters{gap:4px;}.filters button{padding:6px;font-size:7px;}
 .table-head,.project{grid-template-columns:19px minmax(0,1fr) 72px;gap:5px;padding-inline:8px;}.project{padding-block:9px;min-height:52px;}.project-open img{width:38px;height:29px;}.project strong{font-size:10px;margin-bottom:3px;}.project small{font-size:8px;}.project-subtitle{font-size:9px;margin-bottom:3px;}.project .discipline{font-size:7px;}
 .archive-toolbar{padding:7px;font-size:8px;gap:8px;}.badge{font-size:8px;}
 .player{padding:6px 8px;gap:7px;}.mini-icon{width:29px;height:29px;}.now-playing{min-width:0;}.now-playing>div{min-width:0;}.now-playing strong{display:block;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100vw - 155px);}.now-playing small{font-size:7px;margin-top:3px;}.transport{gap:2px;}.transport button{padding:6px 7px;font-size:10px;}.timeline{gap:6px;}
}

/* Fixed vector controls never use platform emoji glyphs. */
.ui-icon{width:1em;height:1em;display:inline-block;vertical-align:-.12em;fill:currentColor;flex-shrink:0;}
.featured-content{display:grid;grid-template-columns:148px minmax(0,1fr);align-items:stretch;}
.cover{width:100%;aspect-ratio:auto;align-self:stretch;min-height:0;}
.feature-actions{flex-wrap:wrap;}
.scope{width:100%;min-width:0;}
.scope i{min-width:0;}
.player .now-playing{flex:0 1 280px;min-width:0;}
.now-playing>div{min-width:0;}
.now-playing strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.transport{flex-shrink:0;}
.timeline{min-width:0;}
.timeline input{min-width:0;}
@media(min-width:751px) and (max-width:1050px){.player{gap:10px;}.player-brand{display:none;}.player .now-playing{flex-basis:210px;}}
@media(max-width:750px){
 .featured-content{grid-template-columns:64px minmax(0,1fr);}
 .feature-info{display:flex;flex-direction:column;}
 .scope{margin-top:10px;flex-shrink:0;height:38px;min-height:38px;width:100%;}
 .player .now-playing{flex:1;}
 .screen{padding:0 8px 8px;}
}

/* Keep growing archives inside a compact, keyboard-accessible viewport. */
#projects{max-height:clamp(240px,45vh,420px);overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;scrollbar-color:var(--red) var(--panel);scrollbar-width:thin;}
#projects:focus-visible{outline:2px dashed var(--red);outline-offset:-2px;}
#projects::-webkit-scrollbar{width:10px;}
#projects::-webkit-scrollbar-track{background:var(--panel);}
#projects::-webkit-scrollbar-thumb{background:var(--red);border:2px solid var(--panel);}
@media(max-width:750px){#projects{max-height:clamp(180px,38svh,300px);}}

/* Invisible scrollbars retain wheel, touch, and keyboard scrolling. */
html,body,#projects{scrollbar-width:none;}
#projects{scrollbar-gutter:auto;}
html::-webkit-scrollbar,body::-webkit-scrollbar,#projects::-webkit-scrollbar{display:none;width:0;height:0;}
/* Button hover states snap immediately, with no interpolated frames. */
@media(hover:hover) and (prefers-reduced-motion:no-preference){
 body>header button,main button:not(.project-open),main a.button,footer button,.player button,.admin-dialog button{
  transition:none;
  transform-origin:center;
 }
 body>header button:hover,main button:not(.project-open):hover,main a.button:hover,footer button:hover,.player button:hover,.admin-dialog button:hover{
  opacity:.78;transform:translate(2px,-2px) scale(1.04);
 }
}

/* Match unused media space to the active theme. */
.screen video,#photo-viewer{background:#fff;}
body.dark .screen video,body.dark #photo-viewer{background:var(--bg);}

/* Preserve the same inset rectangular spectrum on desktop and phones. */
.scope{height:39px;min-height:39px;max-height:39px;flex:0 0 39px;border-radius:0;padding:4px 5px 0;gap:2px;}
.scope i{flex:1 1 0;min-width:2px;border-radius:0;}
.cover img{display:block;object-fit:cover;}

/* Center transport above the seek bar at every viewport width. */
.player{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:"track controls volume" "timeline timeline timeline";column-gap:16px;row-gap:8px;padding:10px 20px calc(10px + env(safe-area-inset-bottom,0px));}
.player .now-playing{grid-area:track;min-width:0;}
.player .mini-icon{flex-shrink:0;}
.player .now-playing strong{max-width:100%;}
.player .transport{grid-area:controls;justify-self:center;justify-content:center;}
.player .timeline{grid-area:timeline;width:min(100%,760px);justify-self:center;order:initial;}
.player .volume{grid-area:volume;justify-self:end;}
.player .player-brand{display:none;}
main{margin-bottom:calc(125px + env(safe-area-inset-bottom,0px));}
@media(max-width:600px){
 .player{grid-template-areas:"track track track" ". controls ." "timeline timeline timeline";padding:7px 10px calc(7px + env(safe-area-inset-bottom,0px));row-gap:5px;column-gap:8px;}
 .player .now-playing{justify-self:start;width:100%;}
 .player .now-playing>div{flex:1;}
 .player .volume{display:none;}
 .player .transport button{min-width:32px;padding:7px 9px;}
 main{margin-bottom:calc(150px + env(safe-area-inset-bottom,0px));}
}

/* Larger transport targets on touch screens and desktop. */
.player .transport{gap:6px;}
.player .transport button{min-width:48px;min-height:44px;padding:10px 14px;font-size:18px;}
#photo-viewer{height:min(55vh,520px);object-fit:contain;}
@keyframes photo-glitch{0%{transform:translateX(-2px);filter:contrast(1.08);clip-path:inset(0 0 1% 0);}35%{transform:translateX(2px);filter:contrast(1);clip-path:inset(1% 0 0 0);}70%{transform:translateX(-1px);filter:contrast(1.04);clip-path:inset(0);}100%{transform:none;filter:none;clip-path:inset(0);}}
@media(prefers-reduced-motion:no-preference){#photo-viewer.photo-glitch{animation:photo-glitch 180ms steps(2,end);}}
@media(max-width:600px){main{margin-bottom:calc(165px + env(safe-area-inset-bottom,0px));}}

/* Explicit vector dimensions keep the theme icon visible at every breakpoint. */
#theme{display:inline-grid;place-items:center;width:36px;height:36px;padding:8px;font-size:16px;line-height:1;flex-shrink:0;}
#theme svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
#theme .theme-sun,body.dark #theme .theme-moon{display:none;}
body.dark #theme .theme-sun{display:block;}

/* Photo sections play as compact collages, preserving each image's proportions. */
#photo-viewer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:5px;padding:5px;height:min(60vh,560px);overflow:hidden;}
#photo-viewer[data-count="1"]{grid-template-columns:1fr;}
#photo-viewer[data-count="3"]>img:first-child{grid-row:span 2;}
#photo-viewer img{display:block;width:100%;height:100%;min-height:0;object-fit:contain;}
.photo-load-error{display:grid;place-items:center;padding:12px;text-align:center;color:var(--text);}
@keyframes photo-glitch{0%{opacity:.55;transform:translateX(-2px);filter:contrast(1.06);}35%{opacity:.8;transform:translateX(1px);}70%{opacity:.95;transform:translateX(-1px);}100%{opacity:1;transform:none;filter:none;}}
@media(max-width:600px){#photo-viewer{height:min(48svh,420px);gap:3px;padding:3px;}}

/* Tight, proportion-aware photo rows: no fixed-height letterboxing or stretching. */
#photo-viewer{display:flex;flex-direction:column;gap:3px;padding:0;height:auto;max-height:none;width:min(100%,calc(68svh * var(--collage-ratio,1)));margin-inline:auto;overflow:hidden;background:transparent;}
body.dark #photo-viewer{background:transparent;}
.collage-row{display:grid;gap:3px;width:100%;min-height:0;}
#photo-viewer .collage-row img{width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;}
@media(max-width:600px){#photo-viewer{height:auto;max-height:none;gap:2px;padding:0;width:min(100%,calc(60svh * var(--collage-ratio,1)));}.collage-row{gap:2px;}}

/* Photo library uses the same red and gray controls as the video editor. */
.admin-tabs{display:flex;gap:8px;margin:16px 0}.admin-tabs button{min-width:110px}
.admin-dialog select{display:block;width:100%;min-width:0;background:var(--field);color:var(--text);border:2px inset #eee;padding:10px;margin:8px 0;font:inherit}
.admin-dialog label{min-width:0}.admin-dialog input:not([type=checkbox]){width:100%;box-sizing:border-box}
.photo-folder-tools{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:12px 0}.photo-folder-tools label{flex:1;min-width:180px}.photo-folder-tools button{margin-bottom:8px}
.photo-upload{padding:16px;background:var(--field);border:2px inset #eee;margin:18px 0}.photo-upload small{display:block;line-height:1.5}
.admin-photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.admin-photo-card{min-width:0;padding:12px;border:2px inset #eee;background:var(--field)}
.admin-photo-card>img{width:100%;height:180px;object-fit:contain;background:var(--panel);display:block;margin-bottom:12px}
.admin-photo-card>label{display:block;font-size:12px}.admin-photo-card>label.admin-favorite{display:flex}.admin-photo-card>small{display:block;margin-top:12px;opacity:.75}
.photo-card-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.photo-card-actions button{font-size:11px;padding:8px}
.admin-dialog button:disabled{opacity:.45;cursor:default;transform:none}
@media(max-width:600px){.admin-photo-grid{grid-template-columns:1fr}.photo-folder-tools{gap:6px}.photo-folder-tools label{flex-basis:100%}.admin-tabs button{flex:1}.admin-dialog input[type=file]{font-size:12px;padding:8px}}

/* Folders are visible destinations; choosing media happens in a focused dialog. */
.admin-folder-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:14px}.admin-folder-card{padding:14px;border:2px inset #eee;background:var(--field);min-width:0}.admin-folder-card h4{font-size:17px;margin:12px 0 6px}.admin-folder-card p{margin:8px 0}.admin-folder-card small{display:block;line-height:1.5;overflow-wrap:anywhere}
.folder-preview{display:grid;grid-template-columns:repeat(2,1fr);gap:3px;height:145px;overflow:hidden;background:var(--panel)}.folder-preview img,.folder-preview video{width:100%;height:100%;min-height:0;object-fit:cover}
.folder-dialog{width:min(1000px,calc(100% - 24px));max-height:94svh}.folder-dialog::backdrop{background:#0008}.folder-dialog .admin-body{max-height:calc(94svh - 55px)}.folder-media-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:10px}.folder-media-choice{padding:10px;border:2px inset #eee;background:var(--field);min-width:0}.folder-media-choice.picked{outline:2px solid var(--red);outline-offset:-2px}.folder-media-choice>img,.folder-media-choice>video,.admin-photo-card>video{width:100%;height:145px;object-fit:contain;display:block;background:var(--panel)}.folder-media-choice small{display:block;font-size:11px;line-height:1.5}.folder-media-choice>label:not(.admin-favorite){display:block;font-size:11px;margin-top:10px}.folder-dialog-actions{position:sticky;bottom:-20px;background:var(--panel);padding:14px 0;display:flex;gap:8px;flex-wrap:wrap}.folder-dialog [role=status]{font-size:12px;overflow-wrap:anywhere}
#photo-viewer.mixed-collage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.2fr) minmax(0,1fr);align-items:center;gap:3px;width:min(100%,1100px);height:auto;padding:0;overflow:visible}
#photo-viewer.mixed-collage[data-sides="0"]{grid-template-columns:minmax(0,1fr);max-width:760px}#photo-viewer.mixed-collage[data-sides="1"]{grid-template-columns:minmax(0,1fr) minmax(0,2.2fr)}
.collage-center,.collage-surround{display:flex;flex-direction:column;gap:3px;min-width:0}.collage-video-tile{position:relative;aspect-ratio:16/9;max-height:60svh;min-height:0;width:100%}.collage-video-tile video{display:block!important;width:100%!important;height:100%!important;max-height:60svh;object-fit:contain}.collage-video-error{position:absolute;inset:0;display:grid;place-items:center;background:var(--panel);font-size:12px}.collage-video-error[hidden]{display:none}
#photo-viewer .collage-surround img{width:100%;height:auto;max-height:30svh;object-fit:contain}#photo-viewer.mixed-collage.photo-glitch{animation:none}#photo-viewer.mixed-collage.photo-glitch .collage-surround{animation:photo-glitch 180ms steps(2,end)}
@media(max-width:600px){.admin-folder-grid{grid-template-columns:1fr}.folder-media-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.folder-media-choice{padding:7px}.folder-media-choice>img,.folder-media-choice>video{height:110px}.folder-media-choice input:not([type=checkbox]){padding:7px;font-size:12px}.folder-dialog-actions{bottom:-16px}.folder-dialog .admin-body{padding:14px}.folder-dialog .photo-upload{padding:10px}#photo-viewer.mixed-collage{gap:2px;grid-template-columns:minmax(0,1fr) minmax(0,2.6fr) minmax(0,1fr)}.collage-center,.collage-surround{gap:2px}}
@media(prefers-reduced-motion:reduce){#photo-viewer.mixed-collage.photo-glitch .collage-surround{animation:none}}

#photo-viewer.mixed-collage{width:min(100%,1100px,calc(60svh * var(--mixed-ratio,1.7)))}#photo-viewer .collage-surround img{max-height:none}
