/* Prism 19: responsive layout patches; no changes to backend or document models. */
*, *::before, *::after { box-sizing:border-box; }
html { min-width:0; width:100%; }
body { max-width:100%; }
body:has(>header .home-more) {overflow-x:clip!important;}
img, video, svg { max-width:100%; }
[hidden] { display:none!important; }
/* The index drop-down was previously positioned relative to an off-screen item. */
@media (max-width:780px) {
 body>header:has(.home-more) {position:relative!important;width:100%!important;max-width:100%!important;display:flex!important;align-items:center!important;gap:6px!important;padding-inline:9px!important;overflow:visible!important;isolation:isolate;}
 body>header:has(.home-more) .brand {min-width:35px!important;flex:0 0 35px!important;margin-right:auto!important;}
 body>header:has(.home-more) .brand img {width:35px;height:35px;}
 body>header:has(.home-more) .nav {display:none!important;}
 body>header:has(.home-more) .home-more {flex:0 0 auto!important;order:2!important;margin:0!important;position:static!important;}
 body>header:has(.home-more) .home-more summary {width:40px!important;height:40px!important;min-width:40px!important;display:grid!important;place-items:center!important;font-size:0!important;border-radius:12px!important;padding:0!important;}
 body>header:has(.home-more) .home-more summary::before {content:'☰';font-size:22px!important;line-height:1!important;}
 body>header:has(.home-more) .home-more-panel {
   position:fixed!important;inset:calc(64px + env(safe-area-inset-top)) 10px auto 10px!important;
   top:calc(64px + env(safe-area-inset-top))!important;left:10px!important;right:10px!important;
   width:auto!important;max-width:none!important;min-width:0!important;
   height:auto!important;max-height:min(78dvh,calc(100dvh - 85px))!important;
   padding:10px!important;overflow-x:hidden!important;overflow-y:auto!important;
   display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important;
   overscroll-behavior:contain;z-index:9999!important;transform:none!important;
   border-radius:16px!important;background:#1d172f!important;box-shadow:0 15px 65px #000d!important;
 }
 body>header:has(.home-more) .home-more:not([open]) .home-more-panel {display:none!important;}
 body>header:has(.home-more) .home-more-panel a {min-width:0!important;margin:0!important;padding:11px 9px!important;font-size:12px!important;line-height:1.35!important;white-space:normal!important;overflow-wrap:break-word!important;}
 body>header:has(.home-more) .home-open-editor {order:3!important;margin:0!important;white-space:nowrap!important;}
 body>header:has(.home-more) .v11-navbar {order:4!important;margin:0!important;max-width:unset!important;}
 body>header:has(.home-more) #v11SearchToggle,body>header:has(.home-more) #v11Bell {display:none!important;}
 body>header:has(.home-more) .v11-mini span {display:none!important;}
 .v11-dropdown {position:fixed!important;top:calc(65px + env(safe-area-inset-top))!important;right:8px!important;left:auto!important;width:min(330px,calc(100vw - 16px))!important;min-width:0!important;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 80px)!important;overflow-y:auto!important;}
 .hero,.wrap,.section,.banner,.cards,.listgrid {min-width:0!important;max-width:100%!important;}
 .hero {padding-inline:16px!important;}
 .hero .mock {width:100%!important;max-width:100%!important;overflow:hidden;}
 .hero-actions {display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
 .hero-actions > * {max-width:100%;}
 .community-header {display:flex;flex-wrap:wrap;gap:8px;padding:8px 10px!important;max-width:100%;min-width:0;}
 .community-header nav {display:flex;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none;}
 .community-header nav a {white-space:nowrap;}
 .community-layout {display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;padding-inline:10px!important;gap:12px!important;}
 .community-side,.feed,.community-layout .panel {width:100%!important;max-width:100%!important;min-width:0!important;}
 .feedhead {display:flex;flex-wrap:wrap!important;gap:8px!important;}
 .masonry {grid-template-columns:repeat(auto-fill,minmax(min(100%,210px),1fr))!important;}
 .creator-main,.creator-profile-shell,.creator-layout,.creator-gallery {min-width:0!important;max-width:100%!important;}
 .creator-actions{flex-wrap:wrap;}
 .creator-layout {grid-template-columns:minmax(0,1fr)!important;}
 .creator-profile-top{flex-wrap:wrap;}
 .community-header .v11-navbar {margin-left:auto!important;}
 dialog, [role=dialog] {max-width:calc(100vw - 18px)!important;}
}
@media(max-width:420px){
 body>header:has(.home-more) {height:60px!important;min-height:60px!important;gap:4px!important;padding-inline:6px!important;}
 body>header:has(.home-more) .brand {min-width:31px!important;flex-basis:31px!important;}
 body>header:has(.home-more) .brand img {width:31px;height:31px;}
 body>header:has(.home-more) .home-more summary {width:37px!important;height:37px!important;min-width:37px!important;}
 body>header:has(.home-more) .home-open-editor {padding:8px!important;font-size:11px!important;min-height:36px!important;max-width:100px!important;}
 body>header:has(.home-more) .home-open-editor::before {content:none!important;}
 body>header:has(.home-more) .v11-nav-btn {padding:5px!important;min-height:36px!important;}
 body>header:has(.home-more) .home-more-panel {top:calc(60px + env(safe-area-inset-top))!important;}
 .community-header .brand small {display:none;}
 .community-header nav {order:5;width:100%;}
 .community-header #publish {font-size:12px;padding:8px;}
 .creator-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
 .creator-title {min-width:0!important;overflow-wrap:anywhere;}
 .creator-main {padding-inline:8px!important;}
 .creator-actions button{font-size:12px;}
}
@media(max-width:345px){
 body>header:has(.home-more) .home-open-editor {max-width:78px!important;font-size:0!important;}
 body>header:has(.home-more) .home-open-editor::before {content:'Editar';font-size:11px!important;}
 body>header:has(.home-more) .home-more-panel {grid-template-columns:minmax(0,1fr)!important;}
}
/* Photo editor: retain every function but move essential actions into mobile toolbar. */
.prism-mobile-photo-actions {display:none;}
@media(max-width:780px){
 .app {width:100%!important;height:100dvh!important;min-height:0!important;overflow:hidden!important;grid-template-rows:60px minmax(0,1fr) 23px!important;}
 .app .top {display:flex!important;flex-wrap:nowrap!important;align-items:center!important;min-height:60px!important;height:60px!important;max-height:60px!important;padding:5px 7px!important;gap:6px!important;overflow:visible!important;}
 .app .top > button#controlsToggle {display:none!important;}
 .app .top > .brand {display:flex!important;flex:0 0 34px!important;width:34px!important;max-width:34px!important;margin:0!important;}
 .app .top > .brand img {width:34px;height:34px;}
 .app .top > .brand div {display:none!important;}
 .app .top > :not(.brand):not(.prism-mobile-photo-actions), .app .top > button, .app .top > .top-center, .app .top > .top-right {display:none!important;}
 .prism-mobile-photo-actions {display:flex!important;flex:1;min-width:0;align-items:center;justify-content:space-evenly;gap:3px;}
 .prism-mobile-photo-actions button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;flex:1;max-width:65px;height:48px;padding:3px 2px!important;border-radius:10px;font-size:10px!important;line-height:1.15;white-space:nowrap;}
 .prism-mobile-photo-actions button .lucide,.prism-mobile-photo-actions button svg {width:18px;height:18px;}
 .prism-mobile-photo-actions button.prism-primary {background:linear-gradient(130deg,#8b8dff,#e68bc4);color:#110d1c;font-weight:800;}
 .app .work {display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) 62px!important;min-height:0!important;min-width:0!important;position:relative!important;overflow:hidden!important;}
 .app .work .stage {grid-column:1!important;grid-row:1!important;min-width:0!important;min-height:0!important;overflow:hidden!important;}
 .app .work .tools {grid-column:1!important;grid-row:2!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;overflow-x:auto!important;overflow-y:hidden!important;max-width:100%!important;width:100%!important;min-width:0!important;height:62px!important;padding:4px 7px!important;gap:7px!important;touch-action:pan-x!important;scrollbar-width:thin;}
 .app .work .tools .tool {flex:0 0 52px!important;width:52px!important;min-height:50px!important;height:50px!important;padding:3px!important;}
 .app .work .tools .tool span {font-size:9px!important;}
 .app .work .sidebar.left,.app .work .sidebar.right {display:block!important;position:fixed!important;top:calc(60px + env(safe-area-inset-top))!important;bottom:calc(85px + env(safe-area-inset-bottom))!important;height:auto!important;max-height:none!important;width:min(340px,calc(100vw - 32px))!important;min-width:0!important;max-width:none!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;z-index:130!important;transition:transform .2s ease,visibility .2s ease!important;box-shadow:0 22px 56px #000c!important;visibility:hidden!important;}
 .app .work .sidebar.left {left:0!important;right:auto!important;transform:translateX(-105%)!important;}
 .app .work .sidebar.right {right:0!important;left:auto!important;transform:translateX(105%)!important;}
 .app .work .sidebar.left.open,.app .work .sidebar.right.open {visibility:visible!important;transform:translateX(0)!important;}
 .app .stagebar {flex:0 0 auto;min-width:0;max-width:100%;overflow-x:auto!important;overflow-y:hidden!important;flex-wrap:nowrap!important;gap:5px!important;white-space:nowrap!important;padding:5px 7px!important;scrollbar-width:none;}
 .app .viewport {min-height:0!important;min-width:0!important;flex:1!important;padding:6px!important;overflow:hidden!important;}
 .app .canvas-holder {max-width:100%!important;max-height:100%!important;}
 .app canvas#artboard {max-width:100%!important;max-height:100%!important;}
 .app .foot {height:23px!important;min-height:23px!important;overflow:hidden!important;font-size:9px!important;padding:0 6px!important;}
 .app .help-fab,body:has(.app) #prismHelpOpen {right:6px!important;bottom:calc(99px + env(safe-area-inset-bottom))!important;font-size:0!important;padding:8px!important;min-width:38px;min-height:38px;max-width:42px;overflow:hidden;}
 .app .help-fab svg {width:20px;height:20px;}
 .app .v11-publish-shortcut {bottom:80px!important;left:8px!important;padding:7px 9px!important;max-width:110px;font-size:10px!important;}
 .prism-photo-shade {position:fixed;inset:60px 0 85px;z-index:120;background:#0704109e;display:none;}
 .prism-photo-shade.open {display:block;}
}
/* The video editor uses a finite-height stage and timeline; the tools slide over rather than push it away. */
.prism-video-tools-toggle,.prism-video-panel-close,.prism-video-shade {display:none;}
@media(max-width:820px){
 body:has(.topbar .tabs) {height:100dvh!important;min-height:0;max-width:100%;overflow:hidden!important;}
 .topbar {flex:0 0 auto!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:4px!important;padding:6px!important;min-height:0!important;max-height:125px!important;overflow:visible!important;}
 .topbar > h1,.topbar > div:has(h1) {min-width:0!important;max-width:120px!important;}
 .topbar h1 {font-size:12px!important;white-space:nowrap!important;text-overflow:ellipsis;overflow:hidden!important;}
 .topbar .tabs {display:flex!important;flex:0 0 100%!important;order:20!important;margin:0!important;width:100%!important;max-width:100%!important;min-width:0!important;flex-wrap:nowrap!important;overflow-x:auto!important;overscroll-behavior-x:contain;scrollbar-width:thin;gap:4px!important;padding:3px 0!important;}
 .topbar .tabs .tab-btn {flex:0 0 auto!important;min-width:auto!important;padding:8px 10px!important;font-size:11px!important;white-space:nowrap!important;}
 .topbar .spacer {flex:1!important;min-width:0!important;}
 .topbar #exportBtn {font-size:11px!important;padding:9px 8px!important;white-space:nowrap!important;order:4!important;}
 .topbar #exportQuality,.topbar #videoRatio,.topbar #vTheme,.topbar .back {display:none!important;}
 .prism-video-tools-toggle {display:inline-flex!important;align-items:center;justify-content:center;min-width:43px;min-height:38px;font-size:11px!important;padding:6px 9px!important;order:3;white-space:nowrap;}
 .body-wrap {position:relative!important;flex:1!important;display:grid!important;grid-template-rows:minmax(0,1fr) minmax(160px,28dvh)!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-height:0!important;max-height:100%!important;overflow:hidden!important;}
 .body-wrap .stage-area {grid-row:1!important;grid-column:1!important;min-height:0!important;max-height:100%!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
 .body-wrap .stage-toolbar {flex:0 0 auto!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;padding:7px!important;}
 .body-wrap .stage-wrap {flex:1!important;min-height:0!important;min-width:0!important;width:100%!important;max-width:100%!important;padding:6px!important;overflow:hidden!important;display:flex;align-items:center;justify-content:center;}
 .body-wrap .stage-wrap canvas {max-width:100%!important;max-height:100%!important;object-fit:contain!important;}
 .body-wrap .tl-wrap {grid-row:2!important;grid-column:1!important;height:100%!important;min-height:0!important;max-height:100%!important;width:100%!important;min-width:0!important;overflow-x:auto!important;overflow-y:auto!important;touch-action:pan-x pan-y;}
 .body-wrap .side-panel {position:absolute!important;z-index:140!important;top:0!important;left:0!important;bottom:0!important;max-height:none!important;height:100%!important;width:min(350px,calc(100vw - 28px))!important;max-width:none!important;overflow-y:auto!important;overscroll-behavior:contain;box-shadow:20px 0 55px #000b!important;display:block!important;transform:translateX(-105%);visibility:hidden;transition:transform .2s ease,visibility .2s ease;}
 .body-wrap.prism-video-panel-open .side-panel {transform:translateX(0)!important;visibility:visible!important;}
 .prism-video-panel-close {display:flex!important;margin:0 0 12px auto;padding:7px 11px!important;}
 .prism-video-shade {position:absolute;inset:0;z-index:130;background:#080614ad;display:none;}
 .body-wrap.prism-video-panel-open .prism-video-shade {display:block;}
 .v11-publish-shortcut {display:none!important;}
}
@media(max-width:370px){
 .topbar .mark {width:24px;height:24px;}
 .topbar h1 {font-size:11px!important;}
 .topbar .tab-btn {font-size:10px!important;}
 .body-wrap {grid-template-rows:minmax(0,1fr) minmax(145px,27dvh)!important;}
}
@media(max-height:600px) and (max-width:820px){
 .body-wrap {grid-template-rows:minmax(0,1fr) 138px!important;}
 .app .work {grid-template-rows:minmax(0,1fr) 55px!important;}
 .app .work .tools {height:55px!important;}
 .app .work .tools .tool {height:47px!important;min-height:47px!important;}
}
@media(prefers-reduced-motion:reduce){
 .app .work .sidebar,.body-wrap .side-panel,.home-more-panel {transition:none!important;animation:none!important;}
}

/* Tool properties retain access on narrow displays even when headers are compact. */
.prism-mobile-preferences {display:none;}
@media(max-width:780px){
 .prism-mobile-preferences {display:grid;gap:8px;border:1px solid #554374;background:#211b35;border-radius:11px;margin:0 0 12px;padding:11px;}
 .prism-mobile-preferences label {font-size:12px;color:#d5c5ef;display:grid;gap:6px;}
 .prism-mobile-preferences select {display:block!important;width:100%!important;max-width:100%;padding:9px!important;background:#211b35;color:white;}
 .prism-mobile-stage-controls {display:flex!important;align-items:center;gap:4px;margin-right:6px;flex:0 0 auto;}
 .prism-mobile-stage-controls button {padding:4px 9px!important;min-height:30px!important;border-radius:7px;font-size:15px;}
}
.prism-video-mobile-settings {display:none;}
@media(max-width:820px){
 .prism-video-mobile-settings {display:grid!important;gap:9px;padding:12px;margin:5px 0 15px;border:1px solid #58436e;background:#211a32;border-radius:12px;}
 .prism-video-mobile-settings label{font-size:12px;color:#ddd0f5;display:grid;gap:5px;}
 .prism-video-mobile-settings select {display:block!important;width:100%!important;max-width:100%!important;padding:10px!important;background:#2c243c!important;color:white!important;border:1px solid #665183!important;}
}
