/* Castyra mobile enhancements. Original content and account behaviour are retained. */
html{scroll-padding-top:24px;-webkit-text-size-adjust:100%}
body{padding-bottom:env(safe-area-inset-bottom,0px)}
.castyra-install-tip{margin:16px auto;padding:14px 18px;max-width:1052px;border:1px solid #ded7cd;border-radius:14px;background:#fff;color:#17365d;display:flex;align-items:center;justify-content:space-between;gap:14px;font:14px/1.45 system-ui,-apple-system,sans-serif}
.castyra-install-tip a{color:#17365d;font-weight:700;white-space:nowrap;padding:9px 0;min-height:44px;display:inline-flex;align-items:center}
.castyra-install-tip button{min-height:44px;min-width:44px;border:0;border-radius:8px;background:#f1eee8;color:#17365d;font-size:20px;cursor:pointer}
@media(max-width:700px){
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}
 button,.button,[role=button]{touch-action:manipulation}
 button:not(.links button):not(.langbtn),.button,[role=button]{min-height:44px}
 header{gap:12px;flex-wrap:wrap;padding-top:max(20px,env(safe-area-inset-top,0px));padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
 header select{min-height:44px;max-width:100%}
 main{min-width:0}main>.card{width:100%}
 .projects{grid-template-columns:minmax(0,1fr)}
 .workspace-head{flex-wrap:wrap}.workspace-head>*{min-width:0;max-width:100%}
 .card,.project,.empty{overflow-wrap:anywhere}
 .castyra-install-tip{margin:12px 16px;font-size:13px;flex-wrap:wrap}
 .castyra-install-tip span{flex:1;min-width:150px}
 .castyra-install-tip a{white-space:normal}
 .public-nav{flex-wrap:wrap;height:auto;padding:12px 16px;gap:10px}
 .public-nav .public-logo{width:146px;max-width:48vw;height:36px}
 .public-nav .public-links{width:100%;order:3;overflow-x:auto;gap:20px;padding:6px 0;white-space:nowrap;-webkit-overflow-scrolling:touch}
 .public-nav .public-links a{min-height:44px;display:inline-flex;align-items:center}
 .public-nav .top-tools{flex-wrap:wrap;gap:6px;max-width:100%}
 .public-nav .language-switch{max-width:100%;flex-wrap:wrap}
 .public-nav .lang-select{max-width:100%;min-width:100px}
 .public-nav .hemus-about-btn{white-space:normal}
 .public-nav .public-signin,.public-nav .public-cta{white-space:normal}
 .castyra-demo-entry-card{max-height:calc(100dvh - 24px)}
 .modal,.overlay{overscroll-behavior:contain}
}
@media(display-mode:standalone){
 .castyra-install-tip{display:none!important}
 .public-nav{padding-top:max(12px,env(safe-area-inset-top,0px))}
}

@media(max-width:700px){
 html body .hero.hero-banner-only{grid-template-columns:minmax(0,1fr)!important;height:auto!important;min-height:0!important;gap:14px!important;padding:16px 0!important}
 html body .hero.hero-banner-only .hero-banner-content{width:100%;min-width:0;padding:0 12px 12px;order:2}
 html body .hero.hero-banner-only .hero-banner-copy{width:100%;min-width:0;max-width:100%;font-size:18px;line-height:1.45}
 html body .hero.hero-banner-only .hero-ai-strip{order:1;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;aspect-ratio:20/11}
 html body .hero-banner-content .workflow-demo-banner{width:100%;align-self:stretch;justify-content:flex-start}
 html body .stage .stagebar{height:auto;flex-wrap:wrap;min-width:0}
 html body .stage .stagebar .stage-actions{min-width:0;max-width:100%;flex-wrap:wrap;margin-left:0;flex-shrink:1}
 input:not([type=checkbox]):not([type=radio]),select,textarea{min-height:44px}
}
/* Homepage banner: preserve the existing desktop height. */
@media(min-width:701px){
 html body .hero.hero-banner-only{position:relative;grid-template-columns:clamp(220px,24vw,320px) minmax(0,1fr) 96px!important;gap:20px!important;height:184px!important;min-height:184px!important;max-height:184px!important;align-items:center!important}
 html body .hero.hero-banner-only .hero-banner-content{padding:4px 0!important;gap:10px;align-items:stretch;max-height:176px}
 html body .hero.hero-banner-only .hero-banner-content .workflow-demo-banner{align-self:center!important;justify-content:center!important;width:100%!important;order:0}
 html body .hero.hero-banner-only .hero-banner-content .workflow-demo-banner button{text-align:center;margin:0 auto;min-height:36px}
 html body .hero.hero-banner-only .hero-banner-copy{font-size:clamp(17px,1.7vw,24px);line-height:1.3;order:1}
}
.castyra-iphone-link{order:3;align-self:center;justify-self:center;display:flex;flex-direction:column;align-items:center;gap:4px;text-decoration:none;color:#17365d;max-width:96px}
.castyra-iphone-frame{display:block;position:relative;flex:none;width:74px;height:156px;padding:3px;background:#151719;border:1px solid #4b4e51;border-radius:15px;box-shadow:0 5px 12px #12253b28;transition:transform .18s ease}
.castyra-iphone-frame:before{content:'';position:absolute;z-index:2;top:6px;left:50%;transform:translateX(-50%);width:23px;height:6px;background:#151719;border-radius:9px}
.castyra-iphone-frame > img{display:block;width:100%;height:100%;object-fit:cover;object-position:top;border-radius:11px;background:#f7f5f1}
.castyra-iphone-label{font:650 10px/1.2 system-ui,-apple-system,sans-serif;letter-spacing:.015em;text-align:center}
.castyra-iphone-link:hover .castyra-iphone-frame{transform:translateY(-2px)}
.castyra-iphone-link:focus-visible{outline:3px solid #b49754;outline-offset:5px;border-radius:14px}
@media(min-width:701px) and (max-width:980px){
 html body .hero.hero-banner-only{grid-template-columns:200px minmax(0,1fr) 82px!important;gap:14px!important}
 html body .hero.hero-banner-only .hero-banner-copy{font-size:16px}
 html body .hero.hero-banner-only .hero-banner-content .workflow-demo-banner button{font-size:12px;padding:7px 10px}
}
@media(max-width:700px){
 html body .hero.hero-banner-only{grid-template-columns:minmax(0,1fr) 74px!important;grid-template-areas:'video phone' 'copy copy';column-gap:12px!important}
 html body .hero.hero-banner-only .hero-ai-strip{grid-area:video}
 html body .hero.hero-banner-only .hero-banner-content{grid-area:copy}
 html body .hero.hero-banner-only .hero-banner-content .workflow-demo-banner{width:100%;justify-content:center;align-self:center}
 .castyra-iphone-link{grid-area:phone;max-width:74px;margin-right:6px}
 .castyra-iphone-frame{width:62px;height:132px;border-radius:13px}
 .castyra-iphone-frame > img{border-radius:9px}
 .castyra-iphone-label{font-size:9px}
}
@media(prefers-reduced-motion:reduce){.castyra-iphone-frame{transition:none}.castyra-iphone-link:hover .castyra-iphone-frame{transform:none}}
@media(min-width:701px){
 html body .hero.hero-banner-only .hero-banner-content{height:176px;padding-top:44px!important;justify-content:center}
 html body .hero.hero-banner-only .hero-banner-content .workflow-demo-banner{position:absolute;top:20px;left:50%;transform:translateX(-50%);width:auto!important;max-width:calc(100% - 32px);margin:0}
}

.castyra-phone-ad{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:100%;height:100%;overflow:hidden;border-radius:11px;padding:13px 3px 7px;color:#fff;background:radial-gradient(ellipse at 85% 100%,#9a763655,transparent 65%),linear-gradient(150deg,#071d36,#1b416a);text-align:center;box-sizing:border-box}
.castyra-phone-ad .castyra-phone-ad-logo{display:block;width:27px;height:27px;flex:none;object-fit:contain;background:#f7f5f1;border-radius:7px;box-shadow:0 0 14px #dcc69222}
.castyra-phone-ad-name{font:850 9px/1 system-ui,-apple-system,sans-serif;letter-spacing:.045em;color:#fff}
.castyra-phone-ad-kicker{font:650 4.5px/1 system-ui,-apple-system,sans-serif;letter-spacing:.17em;color:#d5b77a;margin-top:-3px}
.castyra-phone-tagline{font:700 7px/1.35 system-ui,-apple-system,sans-serif;white-space:pre-line;color:#f8f6f0;margin-top:2px}
.castyra-phone-ad-divider{display:block;width:18px;height:1px;background:#c7a76a;margin:0}
.castyra-phone-cta{display:block;padding:4px 3px;max-width:100%;font:750 4.8px/1.2 system-ui,-apple-system,sans-serif;color:#102d4a;background:#d6ba81;border-radius:4px;white-space:nowrap}
.castyra-phone-ad-footer{font:500 4px/1 system-ui,-apple-system,sans-serif;letter-spacing:.05em;color:#d9dfe6}
@media(max-width:700px){.castyra-phone-ad{gap:4px;border-radius:9px;padding-top:11px}.castyra-phone-ad .castyra-phone-ad-logo{width:22px;height:22px;border-radius:6px}.castyra-phone-ad-name{font-size:7.7px}.castyra-phone-tagline{font-size:6px}.castyra-phone-cta{font-size:4.2px}}
/* The close control is outside the scrollable dialog content. */
html body #castyraDemoEntryOverlay{top:var(--castyra-dialog-top,0px)!important;bottom:auto!important;height:var(--castyra-dialog-height,100vh)!important;height:var(--castyra-dialog-height,100dvh)!important;max-height:var(--castyra-dialog-height,100dvh)!important;box-sizing:border-box;padding:12px!important;align-items:center!important;overflow:hidden!important}
html body #castyraDemoEntryOverlay .castyra-demo-entry-card{display:flex;flex-direction:column;width:min(860px,100%);min-height:0;max-height:calc(var(--castyra-dialog-height,100vh) - 24px)!important;max-height:min(720px,calc(var(--castyra-dialog-height,100dvh) - 24px))!important;overflow:hidden!important}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:8px 14px;border-bottom:1px solid #e8e3dc;background:#fff;z-index:5}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar .castyra-demo-langbar{position:static;max-width:calc(100% - 60px);overflow:visible;box-shadow:none;margin:0;flex:1}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar .castyra-demo-lang-select{font-size:16px;min-height:44px;width:100%;max-width:240px}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar #castyraDemoClose{position:static;display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;min-width:44px;margin:0;transform:none!important;color:#17365d;background:#f7f5f1;border:1px solid #d8dce2;border-radius:12px;font-size:26px;z-index:6}
html body #castyraDemoEntryOverlay .castyra-demo-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html body #castyraDemoEntryOverlay .castyra-demo-entry-head{padding:20px 24px 18px}
html body #castyraDemoEntryOverlay .castyra-demo-entry-card h2{padding-top:0!important;margin:0 0 10px!important;font-size:26px}
@media(max-width:760px){
 html body #castyraDemoEntryOverlay{padding:10px!important}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-card{max-height:min(620px,calc(var(--castyra-dialog-height,100dvh) - 20px))!important;border-radius:20px}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-head{padding:18px 18px 16px}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-card h2{font-size:22px;line-height:1.15}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-intro{font-size:13px;line-height:1.5}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-body{padding:16px 18px}
 html body #castyraDemoEntryOverlay .castyra-demo-entry-foot{padding:0 18px 20px}
}
/* Photographic hand and phone blend directly into the banner background. */
.castyra-hand-link{position:relative;isolation:isolate;width:166px;max-width:166px;height:176px;gap:0;align-items:center;justify-content:center;overflow:hidden}
.castyra-hand-image{display:block;position:absolute;z-index:-1;right:0;top:0;width:166px;height:176px;object-fit:contain;object-position:right center;-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 86%,transparent 100%);mask-image:linear-gradient(to bottom,#000 0%,#000 86%,transparent 100%)}
.castyra-hand-caption{position:absolute;left:0;bottom:2px;display:flex;flex-direction:column;gap:2px;max-width:88px;padding:5px 4px;color:#17365d;background:linear-gradient(90deg,#fbfaf7f5,#fbfaf7cc,transparent);text-align:left}
.castyra-hand-caption strong{font:800 11px/1.1 system-ui,-apple-system,sans-serif;letter-spacing:-.02em}
.castyra-hand-caption .castyra-iphone-label{font:600 8px/1.25 system-ui,-apple-system,sans-serif;text-align:left;white-space:normal}
@media(min-width:981px){html body .hero.hero-banner-only{grid-template-columns:clamp(220px,24vw,320px) minmax(0,1fr) 166px!important;gap:18px!important}.castyra-hand-link{justify-self:end}}
@media(min-width:701px) and (max-width:980px){html body .hero.hero-banner-only{grid-template-columns:190px minmax(0,1fr) 128px!important;gap:12px!important}.castyra-hand-link{width:128px;max-width:128px}.castyra-hand-image{width:128px}}
@media(max-width:700px){html body .hero.hero-banner-only{grid-template-columns:minmax(0,1fr) 110px!important}.castyra-hand-link{width:110px;max-width:110px;height:146px;margin-right:0}.castyra-hand-image{width:110px;height:146px}.castyra-hand-caption{bottom:0;max-width:78px}.castyra-hand-caption strong{font-size:10px}.castyra-hand-caption .castyra-iphone-label{font-size:7px}}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar .castyra-demo-langbar{position:relative!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important}
html body #castyraDemoEntryOverlay .castyra-demo-toolbar .castyra-demo-lang-select{padding-left:30px!important;padding-right:25px!important}
@media(max-width:760px){html body #castyraDemoEntryOverlay .castyra-demo-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%;min-width:0}html body #castyraDemoEntryOverlay .castyra-demo-actions .castyra-demo-btn{min-width:0;white-space:normal;min-height:44px;padding:10px 8px;font-size:11px;line-height:1.3}}

/* Keep the demo language control beside its close button at every screen size. */
#castyraDemoEntryOverlay .castyra-demo-toolbar{display:flex!important;justify-content:flex-end!important;align-items:center!important;gap:12px!important;}
#castyraDemoEntryOverlay #castyraDemoLangbar{flex:0 1 190px!important;width:190px!important;max-width:calc(100% - 56px)!important;min-width:0!important;margin-left:auto!important;}
#castyraDemoEntryOverlay #castyraDemoLanguageSelect{width:100%!important;min-width:0!important;box-sizing:border-box!important;}
