/* Nimantron public mobile hardening — narrow Android/iPhone widths. */
@media (max-width:820px){
  /* Keep the monogram truly centered even though left/right controls differ in width. */
  .site-header .navbar{position:relative}
  .site-header .brand-lockup{
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    transform:translate(-50%,-50%)!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }

  /* Sticky template filters should sit below the current mobile header. */
  .template-filter-shell{top:72px!important}

  /* Template details currently use an inline desktop two-column grid. */
  .page-hero>.container[style*="grid-template-columns:1fr .8fr"]{
    grid-template-columns:1fr!important;
    gap:22px!important;
  }
  .page-hero .template-preview[style*="height:390px"]{height:320px!important}

  .template-meta-top{min-width:0}
  .template-meta h3,.page-hero h1,.section-head h2{overflow-wrap:anywhere}
  .template-meta .pill{flex:0 1 auto}
  .public-total-bar .btn{max-width:100%;white-space:normal;text-align:center}
  .public-price-builder,.pricing-calculator{min-width:0}
  .pricing-calc-fields select,.pricing-calc-fields input{min-width:0}
  #publicPriceSummary,#pricingBreakdown span{overflow-wrap:anywhere}
}

@media (max-width:420px){
  .container{width:calc(100% - 24px)!important}

  .page-hero{padding:42px 0 28px!important}
  .page-hero h1{
    font-size:clamp(36px,11.5vw,44px)!important;
    line-height:.97!important;
    letter-spacing:-1px!important;
  }
  .page-hero p{font-size:13px;line-height:1.65}

  .hero{padding:46px 0 52px!important}
  .hero h1{
    font-size:clamp(40px,12.5vw,48px)!important;
    line-height:.96!important;
    letter-spacing:-1.3px!important;
  }
  .hero-copy>p{font-size:13.5px!important;line-height:1.7!important}
  .hero-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
  .hero-actions .btn{width:100%;min-width:0;padding:0 11px;font-size:11.5px;white-space:normal;text-align:center}
  .hero-proof{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px!important;margin-top:26px!important}
  .hero-proof>div{min-width:0}
  .hero-proof>div:last-child{grid-column:1/-1}
  .hero-art{min-height:410px!important}
  .hero-card{width:min(260px,calc(100% - 24px))!important;padding:22px 18px!important}
  .hero-card h3{font-size:34px!important}

  .section{padding:54px 0!important}
  .section-head{margin-bottom:28px!important}
  .section-head h2{font-size:clamp(32px,10vw,40px)!important;line-height:1.03!important}
  .section-head p{font-size:12px;line-height:1.65}
  .eyebrow{font-size:9.5px!important;letter-spacing:1.5px!important}

  .template-preview{height:280px!important}
  .template-meta{padding:16px!important}
  .template-meta-top{flex-direction:column;align-items:flex-start!important;gap:7px!important}
  .template-meta .pill{max-width:100%!important}
  .card-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important}
  .card-actions .btn{width:100%;min-width:0;padding:0 8px;font-size:10.5px}

  .template-filter-shell{margin-left:0!important;margin-right:0!important}
  .template-filter-label{flex-wrap:wrap}
  .template-filter-label strong{max-width:100%;overflow:hidden;text-overflow:ellipsis}

  .workflow-visual{padding:12px!important;border-radius:20px!important}
  .mini-main{padding:14px!important}
  .mini-top{align-items:flex-start!important;gap:8px!important}
  .mini-stats{gap:6px!important}
  .mini-stat{padding:10px 8px!important}
  .mini-order{padding:12px!important}
  .mini-order-head{gap:7px!important}

  /* Feature lists should stay compact on phones: two columns rather than one tall card per row. */
  .feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .feature{min-width:0;min-height:116px;padding:12px 11px!important;border-radius:14px!important}
  .feature i{font-size:16px!important}
  .feature b{font-size:11px!important;line-height:1.25!important;margin-top:7px!important}
  .feature span{font-size:9px!important;line-height:1.45!important;margin-top:4px!important;overflow-wrap:anywhere}

  .pricing-formula-strip{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:6px 8px!important;
    width:100%!important;
    overflow:visible!important;
  }
  .pricing-formula-strip span,.pricing-formula-strip strong{white-space:normal}
  .pricing-calc-fields,.pricing-calc-total{padding:14px!important}
  .price-panel{padding:15px!important}
  .delivery-price-grid label{grid-template-columns:minmax(0,1fr) 88px!important;gap:8px!important}
  .public-total-bar{padding:16px!important}
  .public-total-bar strong{font-size:27px!important}

  .site-footer .footer-bottom{display:grid!important;grid-template-columns:1fr!important;text-align:left!important}
}

@media (max-width:390px){
  .template-filter-shell{top:68px!important}
  .page-hero .template-preview[style*="height:390px"]{height:285px!important}
}

@media (max-width:360px){
  .nimantron-pwa-inner{grid-template-columns:32px minmax(0,1fr) auto 22px!important;gap:6px!important;padding-left:7px!important;padding-right:7px!important}
  .nimantron-pwa-icon{width:32px!important;height:32px!important}
  .nimantron-pwa-title{font-size:12.5px!important}
  .nimantron-pwa-subtitle{font-size:9.5px!important}
  .nimantron-pwa-install{padding:7px 8px!important;font-size:10.5px!important}
  .nimantron-pwa-close{width:22px!important;height:22px!important}

  .site-header .desktop-theme-toggle{width:40px!important;min-width:40px!important;padding:0!important;justify-content:center!important}
  .site-header .desktop-theme-toggle span{display:none!important}

  .hero-actions{grid-template-columns:1fr!important}
  .hero-proof{grid-template-columns:1fr!important}
  .hero-proof>div:last-child{grid-column:auto}
  .hero-art{min-height:390px!important}
  .hero-card{width:min(246px,calc(100% - 18px))!important}

  .template-filter-label{align-items:flex-start!important;flex-direction:column!important;gap:4px!important}
  .template-filter-label strong{white-space:nowrap;width:100%}
  .card-actions{grid-template-columns:1fr!important}
  .delivery-price-grid label{grid-template-columns:1fr!important}

  .feature-grid{gap:7px!important}
  .feature{min-height:112px;padding:11px 10px!important}
  .feature b{font-size:10.5px!important}
  .feature span{font-size:8.7px!important}

  .site-footer .footer-grid{grid-template-columns:1fr!important;gap:20px!important}
  .site-footer .footer-brand{grid-column:auto!important}
}

/* Auth pages share a separate guest layout. Keep them safe on very small phones. */
@media (max-width:340px){
  body.auth-page{padding-left:10px!important;padding-right:10px!important}
  .auth-wrap{margin-top:66px!important}
  .auth-brand{height:64px!important;margin-bottom:20px!important}
  .auth-brand-mark{width:62px!important;height:62px!important}
  .auth-card{padding:18px 14px!important;border-radius:18px!important}
  .auth-card h1{font-size:30px!important}
  .auth-card>p{font-size:11px!important}
  .auth-actions{align-items:stretch!important;flex-direction:column-reverse!important;gap:10px!important}
  .auth-actions .btn{width:100%!important}
  .auth-theme-toggle{right:10px!important;top:12px!important;min-height:36px!important}
  .foot{font-size:9px!important;line-height:1.5!important}
}

/* Live audit correction: site.css switches features to one column at <=600px.
   Keep the optional extras two-column across the entire public mobile breakpoint. */
@media (max-width:820px){
  #features .feature-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  #features .feature{
    min-width:0!important;
    min-height:118px!important;
    padding:13px 12px!important;
    border-radius:15px!important;
  }
  #features .feature i{font-size:16px!important}
  #features .feature b{font-size:11px!important;line-height:1.3!important;margin-top:7px!important;overflow-wrap:anywhere}
  #features .feature span{font-size:9px!important;line-height:1.45!important;margin-top:4px!important;overflow-wrap:anywhere}
}
@media (max-width:420px){
  #features .feature-grid{gap:8px!important}
  #features .feature{min-height:110px!important;padding:11px 10px!important}
  #features .feature b{font-size:10.5px!important}
  #features .feature span{font-size:8.7px!important;line-height:1.4!important}
}
