/* Final safety/accessibility layer. Keep geometry overrides conservative: mockup-refine.css owns the approved composition. */
html,body{max-width:100%;overflow-x:clip}
body{min-width:320px}
main,section,header,footer{min-width:0}
.shell{max-width:100%}
img{max-width:100%;height:auto}
button,a,input,textarea,summary{-webkit-tap-highlight-color:transparent}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid rgba(255,106,25,.58);outline-offset:3px}
.site-header a:focus-visible,.hero a:focus-visible,.final-cta a:focus-visible,.site-footer a:focus-visible{outline-color:#ff8b4b}
.button{cursor:pointer}
.button:active{transform:translateY(0)}
.ui-preview{contain:paint}
.system-card,.feature-widget,.widget-card,.integration-card,.case-card,.constructor-card{min-width:0}
.system-card__head strong,.feature-widget__copy,.widget-card p,.integration-card,.case-card,.constructor-card{overflow-wrap:anywhere}
.contact-form__consent a{color:#4934c7;text-decoration:underline;text-underline-offset:2px}
.contact-form__consent a:hover{color:#2f209f}
.site-footer__legal a{display:block;color:#a9b2c6;font-size:9px;line-height:1.65}
.site-footer__legal a:hover{color:#fff}

/* The colored outlines in the approved mockup are section-diagram annotations, not UI. */
.site-header{border-top:0!important;border-bottom:0!important}
.site-header::after{display:none!important}
.hero,.process-breaks,.widgets-section,.architecture-band,.ecosystem,.final-cta,.site-footer{border-top:0!important;border-bottom:0!important}
.architecture-row .system-constructor,.architecture-row .order-path{border:0!important}
.custom-tool-strip{border-top:0!important}

/* A standalone 404 that remains visually part of the site. */
.error-page{min-height:100svh;background:#01031b;color:#fff;display:grid;place-items:center;padding:28px}
.error-page__main{width:min(650px,100%);padding:44px;border:1px solid rgba(255,255,255,.13);border-radius:20px;background:radial-gradient(circle at 80% 10%,rgba(88,34,211,.18),transparent 35%),#07112f;box-shadow:0 30px 80px rgba(0,0,0,.28)}
.error-page__main .brand{margin-bottom:50px}
.error-page__main h1{margin:10px 0 14px;font-size:clamp(38px,7vw,68px);line-height:1;letter-spacing:-.045em}
.error-page__main>p:not(.eyebrow){max-width:510px;margin:0 0 28px;color:#c7cddd;font-size:17px;line-height:1.6}
.error-page__actions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:24px}
.error-page__links{display:flex;flex-wrap:wrap;gap:10px 22px;padding-top:18px;border-top:1px solid rgba(255,255,255,.1)}
.error-page__links a{color:#bfc7dc;font-size:14px;font-weight:650;text-decoration:underline;text-decoration-color:rgba(255,255,255,.28);text-underline-offset:4px}
.error-page__links a:hover{color:#fff;text-decoration-color:#ff6a19}

/* Legal pages use the same visual language but stay intentionally text-first. */
.legal-page{background:#f7f8fc;color:#15192a}
.legal-header{position:sticky;top:0;z-index:20;background:#01031b;color:#fff;border-bottom:3px solid #ff5b0a}
.legal-header__inner{min-height:70px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.legal-header .brand-mark{width:34px;height:34px}.legal-header .brand-name{font-size:20px}
.legal-header .button{min-height:38px;font-size:12px}
.legal-content{width:min(880px,calc(100vw - 40px));padding-top:58px;padding-bottom:84px}
.legal-content h1{max-width:760px;margin:10px 0 18px;font-size:clamp(36px,5vw,56px);line-height:1.04;letter-spacing:-.04em}
.legal-content__lead{max-width:760px;margin:0 0 38px;color:#5e6676;font-size:18px;line-height:1.6}
.legal-content section{padding:24px 0;border-top:1px solid #dfe3eb}
.legal-content section:first-of-type{border-top:0}
.legal-content h2{margin:0 0 10px;font-size:21px;line-height:1.25;letter-spacing:-.02em}
.legal-content p{margin:8px 0;color:#4e5667;font-size:15px;line-height:1.7}
.legal-content a{color:#3d2db1;text-decoration:underline;text-underline-offset:2px}
.legal-content strong{color:#202638}
.legal-content__updated{margin-top:24px!important;color:#8a91a0!important;font-size:13px!important}

/* Make sticky navigation/anchor targets predictable and avoid hidden focused content. */
[id]{scroll-margin-top:calc(var(--header-h) + 16px)}
.contact-dialog[open]{animation:dialog-in .16s ease-out}
@keyframes dialog-in{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}

/* Approved deal-card visual: keep one stable amoCRM composition and layer page-specific context around it. */
.catalog-page .catalog-visual>.catalog-crm,
.catalog-page .catalog-media-frame>.catalog-crm{display:block!important;width:100%;min-height:0!important;aspect-ratio:700/381;background:#edf0f3 url('/assets/screens/crm-deal-template.webp') center/cover no-repeat!important;border-color:rgba(40,52,68,.18);box-shadow:0 22px 45px rgba(0,0,0,.16);}
.catalog-page .catalog-visual>.catalog-crm>* ,
.catalog-page .catalog-media-frame>.catalog-crm>*{visibility:hidden!important}
.catalog-page .catalog-media-frame>.catalog-crm{margin:0!important;border-radius:14px}

@media(max-width:980px){
  .mobile-nav{max-height:calc(100svh - var(--header-h) - 12px);overflow:auto}
  .hero-system{max-width:760px;width:100%;margin-inline:auto}
  .architecture-row,.ecosystem__grid,.how-faq__grid{min-width:0}
}
@media(max-width:640px){
  .error-page{padding:14px}.error-page__main{padding:28px 20px}.error-page__main .brand{margin-bottom:34px}
  .error-page__actions{display:grid;grid-template-columns:1fr}.error-page__links{gap:12px 18px}
  .hero__copy{min-width:0}.hero h1{overflow-wrap:normal;word-break:normal}
  .hero__stats div{min-width:0}
  .hero-system{width:100%;max-width:100%;overflow:hidden}
  .hero-system .system-card{max-width:100%}
  .widgets-feature-grid,.widgets-grid,.constructor-grid,.integration-grid,.case-mini-grid,.work-steps{min-width:0}
  .button{max-width:100%;white-space:normal;text-align:center}
  .legal-header__inner{min-height:64px}.legal-header .button{padding-inline:11px;font-size:11px}.legal-content{width:calc(100vw - 28px);padding-top:38px;padding-bottom:60px}.legal-content__lead{font-size:16px}.legal-content section{padding:20px 0}
  .catalog-page .catalog-visual>.catalog-crm{aspect-ratio:700/381}
}
@media(prefers-reduced-motion:reduce){.contact-dialog[open]{animation:none}}

/* Lighthouse hardening: preserve the visual design while meeting WCAG target/contrast checks. */
.site-footer a:not(.brand){min-height:24px;padding-block:4px;display:flex;align-items:center}
.site-footer__legal a{display:flex}
.button--outline-orange{color:#ad3f0d}
.constructor-footer{color:#6f675f}
.ai-rules .ai-business__kicker{color:#4936a5!important;background:#f1edff!important;border-color:#cfc6f3!important}
.ai-rule-card span{color:#61697a!important}
.content-caption,.content-caption a{color:#5f6678!important}
.content-scenario__route{color:#b3430c!important}
.content-step p{color:#687080!important}
.catalog-flow__item p{color:#687080!important}
.catalog-media-frame__bar span{color:#636b7d!important}
