/* Owner visual final polish: mobile composition only; KI behavior untouched. */
@media (max-width:900px){
  .viewport-shell{display:block;width:100%;overflow-x:hidden}
  .stage{width:100%;height:auto;min-height:100vh;transform:none!important;margin:0;overflow:hidden}
  .stage-photo{background-size:cover;background-position:center top}
  .stage-wash{background:linear-gradient(180deg,rgba(239,248,250,.18),rgba(240,247,244,.32) 48%,rgba(238,244,239,.76) 100%)}
  .topbar{position:relative;left:0;top:0;width:100%;height:78px;min-height:78px;padding:8px 14px;gap:10px;border-radius:0;box-sizing:border-box;z-index:50}
  .brand{flex:1;min-width:0;width:auto;height:62px}
  .brand-original-logo{width:184px;height:62px;object-fit:contain}
  .top-tabs,.top-actions{display:none!important}
  .mobile-menu-toggle{display:inline-flex;flex:0 0 auto;height:46px;padding:0 14px;border:1px solid rgba(21,91,73,.18);border-radius:12px;background:rgba(255,255,255,.9);color:#123b36;font-weight:700}
  .left-rail{display:none!important}
  .main-content{position:relative;left:0;top:0;width:100%;height:auto;margin:0;padding:18px 14px 0;box-sizing:border-box;z-index:9}
  .hero-copy{order:0}
  .public-flow-section{order:1}
  .public-categories-section{order:2}
  .hero-copy{position:relative;left:0;top:0;width:auto;height:auto;margin:0;padding:28px 20px 24px;border-radius:24px;background:linear-gradient(120deg,rgba(255,255,255,.84),rgba(255,255,255,.42));box-shadow:0 16px 36px rgba(26,77,57,.13)}
  .hero-copy h1{font-size:clamp(2.35rem,10.5vw,3.5rem);line-height:1.02;max-width:100%;margin:0 0 14px}
  .hero-copy>p{font-size:1.06rem;line-height:1.45;margin:0 0 18px}
  .hero-search{width:100%;height:60px;margin-top:12px;box-sizing:border-box}
  .hero-search input{min-width:0;font-size:15px}
  .hero-search button{height:48px;padding-inline:18px}
  .filter-row{gap:8px;margin-top:12px}
  .filter-pill{flex:1 1 calc(50% - 8px);min-width:0;height:44px;padding-inline:10px;font-size:12px}
  .swiss-network-overlay{right:-125px;top:105px;width:540px;height:390px;opacity:.46!important}
  .public-flow-section,.public-categories-section{position:relative;margin:22px 0 0;padding:24px 20px;border-radius:24px}
  .flow-steps{grid-template-columns:1fr}
  .category-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .category-row a{min-height:70px;padding:16px 12px 16px 80px;font-size:1rem}
  .category-row a:before{width:58px;height:50px}
  .ai-panel{position:relative;left:auto;top:auto;width:auto;margin:22px 14px 0;padding:24px 20px;display:flex!important;order:3;min-height:0;box-sizing:border-box}
  .ai-actions{grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .ai-actions button{min-height:48px;height:auto;padding:10px 8px}
  .ai-input{width:100%;height:54px;box-sizing:border-box}
  .trust-bar{position:relative;left:auto;bottom:auto;width:auto!important;margin:16px 14px 24px}
}
@media(max-width:520px){
  .brand-original-logo{width:176px;height:58px}
  .mobile-menu-toggle{height:44px;padding-inline:12px}
  .hero-copy{padding:24px 18px 20px}
  .hero-copy h1{font-size:clamp(2.18rem,10.2vw,3.2rem)}
  .hero-search{height:58px}
  .category-row{grid-template-columns:1fr}
  .ai-actions{grid-template-columns:1fr}
}

/* Explicit containment guard for narrow owner-review viewports. */
@media (max-width:900px){
  .hero-search{max-width:100%;min-width:0;overflow:visible}
  .hero-search input{min-width:0;max-width:100%}
  .hero-search button{flex:0 0 auto;max-width:42%}
  .filter-row{width:100%;max-width:100%;min-width:0}
  .filter-pill{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
}

/* Final contained open-menu treatment: one panel, no escaping overlays. */
@media (max-width:900px){
  .topbar.menu-open{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:'brand toggle' 'menu menu' 'actions actions';
    align-items:center;
    row-gap:8px;
    height:auto!important;
    min-height:78px;
    padding:8px 14px 12px;
    background:rgba(255,255,255,.98)!important;
    border:1px solid rgba(21,91,73,.16);
    border-radius:0 0 18px 18px;
    box-shadow:0 14px 30px rgba(20,65,52,.18);
  }
  .topbar.menu-open .brand{grid-area:brand}
  .topbar.menu-open .mobile-menu-toggle{grid-area:toggle}
  .topbar.menu-open .top-tabs{
    grid-area:menu;
    display:grid!important;
    position:static!important;
    width:100%!important;
    max-width:100%!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
    padding:8px!important;
    box-sizing:border-box!important;
    height:auto!important;
    min-height:0!important;
    background:rgba(245,250,247,.98)!important;
    border:1px solid rgba(21,91,73,.14)!important;
    border-radius:14px!important;
    box-shadow:none!important;
  }
  .topbar.menu-open .top-tab{width:100%;height:42px;min-width:0;justify-content:flex-start;padding:0 12px;font-size:13px}
  .topbar.menu-open .locale-pill{width:100%;height:36px;justify-content:flex-start;padding-left:12px}
  .topbar.menu-open .top-actions{
    grid-area:actions;
    display:grid!important;
    position:static!important;
    width:100%!important;
    max-width:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:0!important;
    height:auto!important;
    min-height:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .topbar.menu-open .top-actions .icon-btn{display:none!important}
  .topbar.menu-open .top-actions .cta{width:100%;min-width:0;height:46px;padding:0 10px;justify-content:center;font-size:12px}
}
