/* OKUSOCIAL V40 — clean mobile layer
   This file intentionally overrides the accumulated legacy mobile rules in app-v35.css.
   Desktop is left untouched. */
@media (max-width: 700px){
  :root{--ok-red:#701322;--ok-soft:#f8eef0;--ok-bg:#f7f7f9;--ok-line:#e5e5ea;--ok-text:#17171a;--ok-muted:#77777f}
  html,body{width:100%;max-width:100%;overflow-x:hidden!important}
  body{background:var(--ok-bg)!important;color:var(--ok-text)!important;padding-bottom:calc(84px + env(safe-area-inset-bottom))!important}

  /* Header */
  .topbar{
    position:sticky!important;top:0!important;z-index:1000!important;
    width:100%!important;height:88px!important;min-height:88px!important;
    padding:14px 16px!important;
    background:#fff!important;border-bottom:1px solid var(--ok-line)!important;
    display:flex!important;align-items:center!important;gap:12px!important;
  }
  .brand{display:flex!important;align-items:center!important;gap:11px!important;min-width:0!important;font-size:22px!important;font-weight:900!important;letter-spacing:-.8px!important}
  .brand-mark{width:48px!important;height:48px!important;border-radius:14px!important;font-size:23px!important;flex:0 0 48px!important}
  .brand-word{display:inline!important;white-space:nowrap!important;overflow:visible!important}
  .search-desktop{display:none!important}
  .top-actions{margin-left:auto!important;display:flex!important;align-items:center!important;gap:8px!important}
  .top-actions .btn{display:none!important}
  .mobile-search{display:flex!important;width:54px!important;height:54px!important;border-radius:16px!important;align-items:center!important;justify-content:center!important;background:#f8eef0!important;color:var(--ok-red)!important}
  .mobile-search .icon{width:27px!important;height:27px!important}

  /* Page container */
  .site-shell{width:100%!important}
  .content{width:100%!important;max-width:none!important;margin:0!important;padding:0 16px 30px!important}

  /* Home / common headings */
  .home-intro{padding:34px 6px 18px!important}
  .eyebrow{font-size:11px!important;letter-spacing:3px!important;margin-bottom:9px!important;color:#925765!important;opacity:1!important}
  .home-intro h1,.messages-page-head h1{font-size:42px!important;line-height:1.05!important;letter-spacing:-1.8px!important;font-weight:850!important}
  .home-intro p{font-size:17px!important;line-height:1.45!important;color:#85858d!important;margin:12px 0 0!important}
  .section-head{margin:18px 6px 12px!important}
  .section-head h2{font-size:22px!important}
  .section-head h1{font-size:42px!important;letter-spacing:-1.8px!important}
  .section-head .meta{font-size:14px!important}

  /* Compose card */
  .home-compose{margin:4px 4px 24px!important;width:calc(100% - 8px)!important;min-height:84px!important;padding:14px 16px!important;border:1px solid #eadfe2!important;border-radius:18px!important;background:#fff!important;box-shadow:0 3px 14px rgba(25,20,25,.04)!important}
  .home-compose .compose-plus{width:56px!important;height:56px!important;flex:0 0 56px!important;border-radius:16px!important;font-size:31px!important}
  .home-compose strong{font-size:16px!important}
  .home-compose small{font-size:13px!important;line-height:1.35!important}
  .compose-arrow{font-size:28px!important}

  /* Feed */
  .text-feed{border:0!important;border-radius:0!important;background:transparent!important;overflow:visible!important}
  .feed-post{position:relative!important;margin:0 4px 14px!important;padding:18px 16px 14px!important;border:1px solid var(--ok-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:0 2px 10px rgba(20,20,25,.025)!important;overflow:visible!important}
  .feed-author-row{padding-right:42px!important;margin-bottom:14px!important;gap:10px!important}
  .feed-avatar{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .feed-author-copy{min-width:0!important}
  .feed-meta-author{font-size:14px!important;line-height:1.2!important}
  .feed-author-bio{max-width:220px!important;font-size:11px!important}
  .feed-submeta{font-size:11px!important}
  .feed-title{font-size:20px!important;line-height:1.28!important;letter-spacing:-.3px!important;margin-bottom:8px!important;font-weight:850!important}
  .feed-body{font-size:15px!important;line-height:1.55!important;color:#5f5f66!important}
  .feed-actions,
  .profile-post-actions,
  .post-social-actions{
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;
    gap:24px!important;margin-top:16px!important;padding-top:12px!important;border-top:1px solid #ededf0!important;
  }
  .feed-actions .like-static,.feed-actions .feed-comment-action,
  .profile-post-actions .like-static,.profile-post-actions>a,
  .post-social-actions .ajax-like,.post-social-actions .post-action-comment{
    display:inline-flex!important;align-items:center!important;width:auto!important;min-width:0!important;
    padding:2px 0!important;gap:7px!important;color:#777!important;font-size:13px!important;background:transparent!important;border:0!important;
  }
  .feed-actions .icon,.profile-post-actions .icon,.post-social-actions .icon{width:22px!important;height:22px!important}

  /* Discover: repair the collapsed title layout */
  .tabs{display:flex!important;gap:28px!important;margin:0 4px 16px!important;border-bottom:1px solid var(--ok-line)!important}
  .tabs a{padding:0 0 12px!important;font-size:17px!important}
  .question-list{display:block!important;border:0!important;border-radius:0!important;background:transparent!important;overflow:visible!important}
  .question-list .q{
    position:relative!important;display:block!important;width:100%!important;min-width:0!important;
    margin:0 4px 14px!important;padding:18px 16px!important;
    border:1px solid var(--ok-line)!important;border-radius:18px!important;background:#fff!important;
    overflow:visible!important;box-sizing:border-box!important;
  }
  .question-list .q-main{
    display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;column-gap:12px!important;
    width:100%!important;min-width:0!important;padding:0 34px 0 0!important;box-sizing:border-box!important;
    align-items:start!important;
  }
  .question-list .q-main>.avatar{width:44px!important;height:44px!important;grid-column:1!important}
  .question-list .q-copy{display:block!important;min-width:0!important;width:auto!important;overflow:hidden!important}
  .question-list .q-title{display:block!important;width:100%!important;min-width:0!important;margin:0 0 7px!important;
    font-size:18px!important;line-height:1.3!important;font-weight:850!important;overflow-wrap:anywhere!important;word-break:normal!important}
  .question-list .q-author-line{font-size:13px!important;line-height:1.3!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .question-list .q-bio{max-width:100%!important;font-size:11px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .question-list .q-submeta{font-size:11px!important;margin-top:4px!important}
  .question-list .q-side{
    position:absolute!important;left:16px!important;right:16px!important;bottom:12px!important;
    display:flex!important;align-items:center!important;gap:20px!important;padding:0!important;
  }
  .question-list .q-side .like-static{font-size:12px!important}
  .question-list .q-side .q-arrow{margin-left:auto!important;font-size:24px!important;padding:0!important}
  .question-list .q > .post-manage{top:10px!important;right:10px!important;z-index:20!important}
  .question-list .q-main{padding-bottom:28px!important}

  /* Messages */
  .messages-page-head{display:block!important;margin:34px 0 18px!important}
  .messages-page-head .eyebrow{margin-bottom:10px!important}
  .messages-page-head h1{font-size:42px!important}
  .messages-page-head p{font-size:16px!important;line-height:1.45!important;max-width:330px!important;margin:12px 0 0!important}
  #ok-v31-inbox{width:100%!important;margin:0!important;border-radius:18px!important;border:1px solid var(--ok-line)!important;background:#fff!important;overflow:hidden!important;box-shadow:none!important}
  .messages-route #ok-v31-inbox .ok-v31-row{height:76px!important;min-height:76px!important;max-height:76px!important;padding:10px 14px!important;grid-template-columns:48px minmax(0,1fr) auto!important;column-gap:12px!important}
  .messages-route #ok-v31-inbox .ok-v31-photo,.messages-route #ok-v31-inbox .ok-v31-photo img{width:48px!important;height:48px!important;min-width:48px!important;max-width:48px!important;min-height:48px!important;max-height:48px!important}
  .messages-route #ok-v31-inbox .ok-v31-copy{height:auto!important;max-height:none!important}
  .messages-route #ok-v31-inbox .ok-v31-username{font-size:14px!important}
  .messages-route #ok-v31-inbox .ok-v31-preview{font-size:12px!important}
  .messages-route #ok-v31-inbox .ok-v31-side{min-width:38px!important}
  .messages-route #ok-v31-inbox .ok-v31-time{font-size:10px!important}
  .messages-route #ok-v31-inbox .messages-empty{min-height:250px!important;height:auto!important;padding:42px 20px!important}
  .messages-empty strong{font-size:18px!important}
  .messages-empty span{font-size:13px!important;line-height:1.55!important}

  /* Footer */
  .site-footer{width:100%!important;margin:24px 0 10px!important;padding:16px 14px!important;border-radius:16px!important;font-size:11px!important;line-height:1.45!important;background:#fff!important;text-align:center!important}

  /* Bottom navigation */
  .bottom-nav{
    position:fixed!important;left:0!important;right:0!important;bottom:0!important;width:100%!important;height:78px!important;min-height:78px!important;
    padding:5px 7px calc(5px + env(safe-area-inset-bottom))!important;display:flex!important;align-items:stretch!important;
    background:rgba(255,255,255,.98)!important;border:0!important;border-top:1px solid var(--ok-line)!important;border-radius:0!important;
    box-shadow:0 -7px 24px rgba(20,20,25,.08)!important;transform:none!important;z-index:9999!important;
  }
  .bottom-nav .nav-item{flex:1 1 0!important;width:auto!important;max-width:none!important;height:66px!important;padding:3px 2px!important;border-radius:15px!important;gap:4px!important;color:#727278!important;font-size:11px!important;font-weight:750!important}
  .bottom-nav .nav-item.active{background:#f8eef0!important;color:var(--ok-red)!important}
  .bottom-nav .nav-item .icon{width:23px!important;height:23px!important;flex:0 0 23px!important}
  .bottom-nav .nav-item span{font-size:11px!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
  .bottom-nav .nav-count,.bottom-nav .nav-with-badge .nav-count{top:3px!important;right:calc(50% - 24px)!important}
}

@media(max-width:390px){
  .topbar{padding-left:13px!important;padding-right:13px!important}
  .brand{font-size:20px!important}.brand-mark{width:44px!important;height:44px!important;flex-basis:44px!important}
  .mobile-search{width:50px!important;height:50px!important}
  .content{padding-left:12px!important;padding-right:12px!important}
  .home-intro{padding-left:4px!important;padding-right:4px!important}
  .home-intro h1,.section-head h1,.messages-page-head h1{font-size:38px!important}
  .feed-post,.question-list .q{margin-left:0!important;margin-right:0!important}
}
