/* DAS KMU v9.2 — final chat/nav stabilization */
.chat-page [hidden]{display:none!important}

@media(max-width:820px){
  .bottom-nav.bottom-nav-auth{grid-template-columns:repeat(6,minmax(0,1fr))!important}
  .bottom-nav.bottom-nav-guest{grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .bottom-nav.bottom-nav-guest a,.bottom-nav.bottom-nav-auth a{justify-content:center;align-items:center;min-width:0}
  .bottom-nav.bottom-nav-guest .bottom-nav-icon,.bottom-nav.bottom-nav-auth .bottom-nav-icon{margin-inline:auto}

  body.chat-page{overflow:hidden!important;padding-bottom:0!important}
  .chat-page .topbar{position:fixed!important;top:0;left:0;right:0;z-index:100}
  .chat-page main{height:100dvh!important;padding-top:64px!important;padding-bottom:calc(78px + env(safe-area-inset-bottom))!important;overflow:hidden!important}
  .chat-page .section-tight,.chat-page .section-tight>.container{height:100%!important;min-height:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
  .chat-page .chat-shell{display:block!important;height:100%!important;min-height:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;background:var(--surface)!important}
  .chat-page .chat-sidebar{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;border:0!important;background:var(--surface)!important}
  .chat-page .chat-main{display:none!important;height:100%!important;min-height:0!important;overflow:hidden!important;background:var(--surface)!important}
  .chat-page .chat-shell.chat-open-mobile .chat-sidebar{display:none!important}
  .chat-page .chat-shell.chat-open-mobile .chat-main{display:flex!important;flex-direction:column!important}
  .chat-page .chat-empty-state{display:none!important}
  .chat-page .chat-conversation{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important}
  .chat-page .chat-conversation[hidden]{display:none!important}

  .chat-page .chat-sidebar-head{position:relative!important;top:auto!important;flex:0 0 auto!important;padding:18px 14px 12px!important;background:var(--surface)!important;border-bottom:1px solid var(--border)!important;box-shadow:none!important}
  .chat-page .chat-sidebar-title-row{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:12px!important}
  .chat-page .chat-sidebar-title-row>span:first-child{display:grid;gap:2px}
  .chat-page .chat-sidebar-title-row b{font-size:22px;line-height:1.1}
  .chat-page .chat-sidebar-tools{display:block!important;margin-top:12px!important}
  .chat-page .chat-search{display:block!important;width:100%!important}
  .chat-page .chat-search .input{display:block!important;width:100%!important;min-height:46px!important;padding-left:42px!important;font-size:16px!important;background:var(--surface-2)!important}
  .chat-page .chat-focus-btn{display:none!important}
  .chat-page .chat-user-list{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:8px 10px 18px!important;-webkit-overflow-scrolling:touch}
  .chat-page .chat-user{min-height:68px!important;padding:10px!important;border-radius:16px!important}

  .chat-page .chat-conversation-head{position:relative!important;top:auto!important;display:grid!important;grid-template-columns:42px 42px minmax(0,1fr)!important;gap:10px!important;align-items:center!important;min-height:64px!important;padding:10px 12px!important;flex:0 0 auto!important;background:var(--surface)!important;border-bottom:1px solid var(--border)!important}
  .chat-page .chat-back{display:grid!important;width:42px!important;height:42px!important}
  .chat-page .chat-conversation-head .avatar{grid-column:2!important;width:42px!important;height:42px!important}
  .chat-page .chat-conversation-head>div{grid-column:3!important;min-width:0!important}
  .chat-page .chat-messages{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding:14px 11px 18px!important;background:color-mix(in srgb,var(--surface-2) 76%,var(--surface))!important}
  .chat-page .chat-bubble{max-width:86%!important}
  .chat-page .chat-composer{position:relative!important;flex:0 0 auto!important;display:grid!important;grid-template-columns:minmax(0,1fr) 48px!important;gap:8px!important;padding:9px 10px max(10px,env(safe-area-inset-bottom))!important;background:var(--surface)!important;border-top:1px solid var(--border)!important}
  .chat-page .chat-composer textarea{min-height:46px!important;max-height:100px!important}
  .chat-page .chat-send-btn{width:48px!important;min-width:48px!important;height:46px!important;padding:0!important}
  .chat-page .chat-send-btn span{display:none!important}
  .chat-page .chat-send-btn b{font-size:20px!important}
}

@media(min-width:821px){
  .chat-page .section-tight{padding-top:18px!important}
  .chat-page .chat-shell{display:grid!important;grid-template-columns:360px minmax(0,1fr)!important;height:calc(100vh - 185px)!important;min-height:610px!important;max-height:780px!important;overflow:hidden!important;border-radius:24px!important}
  .chat-page .chat-sidebar{display:flex!important;flex-direction:column!important;min-height:0!important}
  .chat-page .chat-main{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
  .chat-page .chat-empty-state{display:grid!important;flex:1 1 auto!important;min-height:0!important}
  .chat-page .chat-empty-state[hidden]{display:none!important}
  .chat-page .chat-conversation{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;min-height:0!important}
  .chat-page .chat-conversation[hidden]{display:none!important}
  .chat-page .chat-sidebar-head{position:relative!important;padding:16px!important}
  .chat-page .chat-sidebar-tools{display:block!important}
  .chat-page .chat-focus-btn{display:none!important}
  .chat-page .chat-user-list{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}
  .chat-page .chat-conversation-head{position:relative!important;flex:0 0 auto!important}
  .chat-page .chat-messages{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}
  .chat-page .chat-composer{flex:0 0 auto!important}
}
