/* V25 - phone-first installed-app enhancements. Existing V24 styles remain unchanged. */
.pwa-install-banner{position:fixed;z-index:48;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));max-width:510px;margin:auto;background:linear-gradient(125deg,var(--v50-bg-26192f,#26192f),var(--v50-bg-141017,#141017) 68%);border:1px solid var(--v50-border-7a3a9e,#7a3a9e);border-radius:16px;padding:13px 14px;box-shadow:0 15px 50px var(--v50-shadow-000000bb,#000b);display:flex;align-items:center;gap:11px;}
.pwa-install-banner img{width:49px;height:49px;border-radius:12px;flex:0 0 49px;}
.pwa-install-copy{min-width:0;flex:1;display:grid;gap:3px;}.pwa-install-copy strong{font-size:13px;line-height:1.35;}.pwa-install-copy span{font-size:11px;color:var(--v50-fg-beb2c6,#beb2c6);line-height:1.4;}
.pwa-install-btn{padding:10px 12px;background:var(--v50-bg-8e2acf,#8e2acf);color:var(--v50-fg-ffffff,#fff);border:0;border-radius:8px;font-size:12px;font-weight:750;min-height:43px;white-space:nowrap;}
.pwa-install-dismiss{background:transparent;color:var(--v50-fg-d4c4dd,#d4c4dd);font-size:21px;border:0;padding:5px;line-height:1;align-self:flex-start;}
.pwa-install-guide{position:fixed;z-index:90;inset:0;background:var(--v50-bg-000000bb,#000b);display:grid;place-items:center;padding:18px;}
.pwa-install-guide-card{width:min(100%,440px);background:var(--v50-bg-18121d,#18121d);border:1px solid var(--v50-border-784495,#784495);border-radius:15px;padding:27px 24px;box-shadow:0 30px 100px var(--v50-shadow-000000cc,#000c);}
.pwa-install-guide-card img{width:68px;height:68px;border-radius:16px;margin-bottom:14px;}
.pwa-install-guide-card h2{font-size:25px;line-height:1.15;letter-spacing:-.04em;margin:0 0 10px;}
.pwa-install-guide-card p{font-size:14px;line-height:1.65;color:var(--v50-fg-c8bbc9,#c8bbc9);margin:0 0 24px;}
.pwa-install-guide-card button{min-height:46px;width:100%;justify-content:center;}
.pwa-mobile-only{display:none;}
@media(max-width:700px){
  :root{scroll-padding-bottom:92px;}
  html{scroll-behavior:auto;}
  body{min-height:100dvh;}
  button,a,input,select,textarea{touch-action:manipulation;}
  input,select,textarea{font-size:16px!important;}
  .pwa-mobile-only{display:initial;}
  .topbar{min-height:70px;padding:12px 15px;}
  .top-actions{margin-left:auto;gap:8px;}
  .top-actions a.quiet{display:none;}
  .workspace{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));}
  /* The navigation bar remains available on every project screen. */
  .workspace .sidebar{position:fixed;bottom:0;left:0;right:0;z-index:30;border:0;border-top:1px solid var(--v50-border-52315b,#52315b);box-shadow:0 -12px 35px var(--v50-shadow-00000088,#0008);background:var(--v50-bg-100c14,#100c14);display:flex;gap:3px;align-items:stretch;justify-content:space-around;padding:8px 8px calc(9px + env(safe-area-inset-bottom,0px));overflow-x:auto;overscroll-behavior-x:contain;}
  .workspace .side-link{flex:1 1 0;min-width:0;max-width:180px;white-space:normal;line-height:1.25;text-align:center;font-size:10px;padding:7px 5px 5px;min-height:54px;display:flex;gap:4px;flex-direction:column;align-items:center;justify-content:center;border-radius:9px;}
  .workspace .side-link .symbol{width:auto;display:block;font-size:21px;line-height:1.1;}
  .workspace .side-link.active{border-color:var(--v50-border-513363,#513363);background:var(--v50-bg-24172d,#24172d);}
  .workspace .workspace-body{padding:22px 15px 40px;}
  .workspace-titlebar{margin-bottom:21px;}
  .workspace-titlebar h1{font-size:clamp(31px,9vw,39px);}
  .workspace-titlebar p{font-size:12px;line-height:1.55;}
  .project-summary{padding-bottom:17px;}
  .project-summary h2{font-size:clamp(31px,8vw,43px);}
  .project-topline{margin-bottom:11px;}
  .project-identity{flex-wrap:wrap;justify-content:flex-end;gap:7px;}
  .workspace-tabs{position:sticky;top:0;z-index:14;background:var(--v50-bg-070708,#070708);gap:20px;margin:0 -15px 18px;padding:0 15px;scrollbar-width:none;}
  .workspace-tabs::-webkit-scrollbar{display:none;}
  .workspace-tabs .tab{min-height:49px;padding:12px 1px;font-size:12px;}
  .pane-title h3{font-size:19px;}
  .message-stream{min-height:200px;max-height:48dvh;padding:12px;gap:10px;}
  .bubble{max-width:96%;padding:12px 13px;}
  .composer{position:sticky;bottom:calc(70px + env(safe-area-inset-bottom,0px));z-index:13;padding:11px;background:var(--v50-bg-171019,#171019);box-shadow:0 -10px 26px var(--v50-shadow-050306ae,#050306ae);}
  .composer textarea{min-height:65px;}
  .composer-footer{padding-top:8px;}
  .composer-footer .primary{min-height:44px;width:100%;justify-content:center;font-size:13px;}
  .project-card{min-height:185px;padding:21px;}
  .project-card-top{margin-bottom:24px;}
  .project-card h2{font-size:24px;}
  .signin-wrap{min-height:calc(100dvh - 90px);gap:28px;padding:30px 16px 50px;}
  .signin-copy h1{font-size:clamp(39px,10.5vw,56px);margin:22px 0;}
  .signin-copy>p{font-size:14px;}
  .signin-feature{font-size:12px;margin-top:12px;}
  .signin-panel{padding:23px 21px;}
  .stack-form input{min-height:49px;}
  .primary{min-height:45px;}
  .upload-area{gap:12px;}
  .upload-area input{max-width:100%;width:100%;}
  .file-item,.client-item,.approval-item,.timeline-item{padding:15px;}
  .file-actions{display:inline-flex;min-height:44px;align-items:center;}
  .modal-layer{padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px));}
  .modal-card{max-height:88dvh;padding:21px;}
  .portal-footer{padding-bottom:22px;}
  #toast{bottom:calc(91px + env(safe-area-inset-bottom,0px));left:12px;right:12px;max-width:none;}
  body.pwa-workspace-open .pwa-install-banner{bottom:calc(81px + env(safe-area-inset-bottom,0px));}
  body.pwa-workspace-open #toast{bottom:calc(94px + env(safe-area-inset-bottom,0px));}
  @media(display-mode:standalone){.portal-footer{padding-bottom:18px;}}
}
@media (min-width:701px){.pwa-install-banner{display:none!important;}}
@media (prefers-reduced-motion:reduce){.pwa-install-banner,.pwa-install-guide{transition:none;}}

/* V45: compact mobile messaging and top workspace menu. Desktop rules unchanged. */
.mobile-workspace-menu{display:none;}
@media(max-width:700px){
 :root{scroll-padding-bottom:18px;}
 body.mobile-portal-signed-in{--mobile-header-height:calc(64px + env(safe-area-inset-top,0px));scroll-padding-top:var(--mobile-header-height);}
 body.mobile-portal-signed-in .topbar{position:sticky;top:0;z-index:40;background:var(--v50-bg-09080b,#09080b);height:var(--mobile-header-height);min-height:var(--mobile-header-height);padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px;gap:8px;}
 body.mobile-portal-signed-in .topbar .identity{gap:8px;min-width:0;}
 body.mobile-portal-signed-in .topbar .identity img{width:34px;height:34px;}
 body.mobile-portal-signed-in .top-actions{gap:6px;}
 body.mobile-portal-signed-in .top-actions .quiet{white-space:nowrap;padding:8px 4px;min-height:44px;}
 .mobile-workspace-menu{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:0 0 44px;padding:0;border:1px solid var(--v50-border-624276,#624276);border-radius:8px;background:var(--v50-bg-201529,#201529);color:var(--v50-fg-d9a6ff,#d9a6ff);}
 .mobile-workspace-menu .menu-close,.mobile-workspace-menu[aria-expanded=true] .menu-bars{display:none;}
 .mobile-workspace-menu[aria-expanded=true] .menu-close{display:block;}
 .mobile-workspace-menu:focus-visible{outline:2px solid var(--v50-border-d18bf8,#d18bf8);outline-offset:2px;}
 .workspace{padding-bottom:env(safe-area-inset-bottom,0px);}
 .workspace .sidebar{display:none;position:fixed;top:var(--mobile-header-height,64px);bottom:auto;left:auto;right:8px;width:min(300px,calc(100% - 16px));max-height:calc(100dvh - var(--mobile-header-height,64px) - 12px - env(safe-area-inset-bottom,0px));z-index:39;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:5px;padding:12px;border:1px solid var(--v50-border-624276,#624276);border-radius:0 0 12px 12px;background:var(--v50-bg-100c14,#100c14);box-shadow:0 12px 35px var(--v50-shadow-000000bb,#000b);overflow:auto;overscroll-behavior:contain;}
 .workspace .sidebar.mobile-menu-open{display:flex;}
 .workspace .sidebar .side-label{display:block;padding:6px 10px 9px;}
 .workspace .sidebar .side-link{flex:none;width:100%;max-width:none;min-height:46px;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;text-align:left;gap:12px;padding:11px 12px;font-size:14px;}
 .workspace .sidebar .side-link .symbol{width:25px;text-align:center;flex-shrink:0;}
 .workspace .sidebar .guide-nav-copy{display:grid;gap:3px;}
 .workspace .sidebar .guide-nav-copy small{display:block;}
 .workspace-tabs{top:var(--mobile-header-height,0px);}
 .guide-section{scroll-margin-top:calc(var(--mobile-header-height,0px) + 12px);}
 .composer{bottom:env(safe-area-inset-bottom,0px);padding:9px;}
 #message-input{height:86px;min-height:72px;max-height:40dvh;padding:10px 12px;line-height:1.45;display:block;}
 .message-attach-bar{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;margin-top:7px;align-items:center;justify-content:stretch;}
 .message-attach-bar .secondary{min-height:40px;white-space:nowrap;font-size:11px;padding:7px 9px;}
 .message-attach-bar .tiny-note{font-size:10px;line-height:1.35;margin:0;overflow-wrap:normal;}
 .desktop-drop-hint{display:none;}
 .composer-link-help{font-size:10px;line-height:1.35;margin:6px 0 2px;overflow-wrap:anywhere;}
 .composer-link-help code{font-size:10px;}
 .composer-footer{padding-top:6px;}
 .composer-footer .notice-actions{display:flex;flex-direction:row;gap:8px;}
 .composer-footer .notice-actions button{flex:1;min-width:0;width:auto;min-height:44px;padding:8px 5px;justify-content:center;font-size:11px;}
 #toast,body.pwa-workspace-open #toast{bottom:calc(12px + env(safe-area-inset-bottom,0px));}
 body.pwa-workspace-open .pwa-install-banner{bottom:calc(12px + env(safe-area-inset-bottom,0px));}
}

/* V53: close the installation help without reaching the bottom of the card. */
.pwa-install-guide-card{position:relative;}
.pwa-install-guide-card #pwa-install-guide-x{position:absolute;right:12px;top:12px;width:44px;min-height:44px;}
