/* KIFARU final topbar cleanup */
html body .tb-btns{display:none!important;visibility:hidden!important;width:0!important;height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}
html body .topbar{height:auto!important;min-height:52px!important;align-items:center!important;gap:10px!important;flex-wrap:nowrap!important;overflow:hidden!important}
html body .topbar input{height:30px!important;min-height:30px!important;width:118px!important;max-width:118px!important;font-size:12px!important;padding:5px 8px!important;border-radius:7px!important;line-height:1!important;margin:0!important}
html body .topbar button,html body .topbar .btn,html body .topbar .btn-pri,html body .topbar .btn-ghost{height:30px!important;min-height:30px!important;max-height:30px!important;font-size:12px!important;padding:5px 10px!important;border-radius:7px!important;line-height:1!important;white-space:nowrap!important;margin:0 2px!important;transform:none!important}
html body .kifaru-auth,html body .kifaru-inline-auth{margin-left:auto!important;position:static!important;display:flex!important;align-items:center!important;gap:6px!important;padding:5px 7px!important;border-radius:10px!important;max-width:620px!important;height:auto!important;min-height:38px!important}
html body .kifaru-inline-auth input{height:30px!important;width:118px!important;font-size:12px!important}
html body .kifaru-inline-auth button{height:30px!important;min-height:30px!important;font-size:12px!important;padding:5px 10px!important}

/* Mobile and installable-app shell hardening */
html,body{min-height:100%!important;overscroll-behavior:none}
html body .app{height:100dvh!important;min-height:100dvh!important}
html body button,
html body .btn,
html body .ni,
html body .tab,
html body .kbtn{min-height:44px!important}
html body input,
html body select,
html body textarea{font-size:16px!important}

@media(max-width:1100px){
  html body .g4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .g3,
  html body .g2,
  html body .ing-grid,
  html body .store-grid,
  html body .pe-grid{grid-template-columns:1fr!important}
  html body .pipeline,
  html body .tier-row,
  html body .admin-tabs{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  html body .pip-arrow{display:none!important}
}

@media(max-width:780px){
  html body .app{display:block!important;height:auto!important;min-height:100dvh!important;overflow:visible!important}
  html body .sb{
    position:sticky!important;top:0!important;z-index:60!important;width:100%!important;min-width:0!important;
    max-height:88px!important;display:flex!important;flex-direction:row!important;align-items:center!important;
    overflow-x:auto!important;overflow-y:hidden!important;border-right:0!important;border-bottom:1px solid var(--bdr)!important;
  }
  html body .logo-area{min-width:76px!important;padding:10px 12px!important;border-bottom:0!important;border-right:1px solid var(--bdr)!important}
  html body .logo-icon{width:36px!important;height:36px!important}
  html body .sb-label,
  html body .sb-foot,
  html body .logo-word,
  html body .logo-tagline,
  html body .acronym-row,
  html body .ni span,
  html body .nbadge{display:none!important}
  html body .ni{min-width:48px!important;margin:0 3px!important;padding:10px!important;justify-content:center!important}
  html body .main{overflow:visible!important;min-height:calc(100dvh - 88px)!important}
  html body .topbar{
    position:sticky!important;top:88px!important;z-index:55!important;flex-wrap:wrap!important;overflow:visible!important;
    padding:10px 12px!important;gap:8px!important;
  }
  html body .tb-title{width:100%!important;flex-basis:100%!important;font-size:15px!important}
  html body .tb-title span{display:block!important;margin:2px 0 0!important}
  html body .searchbar{width:100%!important;min-width:0!important;order:3!important}
  html body .topbar input,
  html body .kifaru-inline-auth input{width:100%!important;max-width:none!important;height:40px!important}
  html body .kifaru-auth,
  html body .kifaru-inline-auth{
    margin-left:0!important;width:100%!important;max-width:none!important;flex-wrap:wrap!important;order:4!important;
  }
  html body .kifaru-inline-auth button{flex:1 1 96px!important;height:40px!important}
  html body .content{overflow:visible!important;padding:14px 12px!important}
  html body .card{padding:16px!important;border-radius:10px!important}
  html body .card-h{align-items:flex-start!important;gap:10px!important;flex-direction:column!important}
  html body .tabs{overflow-x:auto!important;white-space:nowrap!important}
  html body .tab{flex:0 0 auto!important}
  html body .role-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html body .email-row{flex-direction:column!important}
  html body .lc{width:min(460px,100%)!important;border-radius:12px!important}
  html body .lc-head,
  html body .lc-body{padding-left:18px!important;padding-right:18px!important}
  html body .modal{width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important}
}

@media(max-width:520px){
  html body .g4,
  html body .g3,
  html body .ch-grid,
  html body .checks{grid-template-columns:1fr!important}
  html body .stat-val{font-size:24px!important}
  html body .src-hdr,
  html body .chain-hdr,
  html body .user-row,
  html body .chain-actions{align-items:stretch!important;flex-direction:column!important}
  html body .badge,
  html body .chain-status{width:max-content!important}
  html body .toast{min-width:0!important;max-width:calc(100vw - 24px)!important}
}
