@media (max-width: 820px){
  html,body{margin:0!important;width:100%!important;max-width:100%!important;overflow-x:hidden!important;background:#f6f8fb!important;font-size:14px!important}
  *,*::before,*::after{box-sizing:border-box!important;max-width:100%}
  .sidebar{display:none!important}
  body.app-shell{display:block!important;padding:0 0 104px!important;min-height:100dvh!important;overflow-x:hidden!important}
  .main-area{margin:0!important;width:100%!important;max-width:100%!important;min-height:100dvh!important;overflow-x:hidden!important}
  .app-header{position:sticky!important;top:0!important;z-index:900!important;width:100%!important;height:auto!important;display:flex!important;align-items:center!important;gap:8px!important;padding:10px!important;background:rgba(246,248,251,.97)!important;border-bottom:1px solid #e2e8f0!important;overflow:hidden!important}
  .search-box{flex:1 1 auto!important;min-width:0!important;max-width:none!important;height:40px!important;border-radius:14px!important;padding:0 10px!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important}
  .search-box input{min-width:0!important;width:100%!important;padding:0!important;font-size:13px!important}.search-box input::placeholder{color:transparent!important;font-size:0!important}
  .header-actions{flex:0 0 auto!important;display:flex!important;gap:6px!important;max-width:44px!important;overflow:hidden!important}.header-actions .icon-btn,.logout-link{display:none!important}.user-chip{width:40px!important;height:40px!important;padding:0!important;border-radius:14px!important;display:grid!important;place-items:center!important}.user-chip>span:not(.chip-avatar),.user-chip em{display:none!important}.chip-avatar{width:34px!important;height:34px!important}
  .content-wrap{width:100%!important;max-width:100%!important;margin:0!important;padding:12px 12px 16px!important;overflow-x:hidden!important}
  .content-wrap>*{width:100%!important;max-width:100%!important;min-width:0!important}
  h1{font-size:24px!important;line-height:1.12!important;letter-spacing:-.4px!important}h2{font-size:18px!important;line-height:1.18!important}h3{font-size:15px!important;line-height:1.2!important}p,small,a,li,label,input,textarea,select,button{font-size:12px!important;line-height:1.35!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important}
  .tav-home,.grid,.calendar-grid,.inst-grid,.inst-grid.three,.inst-stats,.right-rail,.cards,.calendar-page,.institutional-page{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow:visible!important}
  .welcome-row,.feed-head{display:block!important;margin-bottom:12px!important}.welcome-row h1{font-size:23px!important}.welcome-row p{font-size:12px!important}
  .today-grid{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;width:100%!important;margin-bottom:16px!important}.day-card{width:100%!important;min-height:68px!important;padding:11px!important;border-radius:16px!important;display:flex!important;gap:9px!important;align-items:center!important;overflow:hidden!important}.day-icon{width:34px!important;height:34px!important;border-radius:13px!important;font-size:17px!important;flex:0 0 34px!important}.day-card b{font-size:20px!important}.day-card>span:last-child{min-width:0!important}
  .feed-tabs{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;width:100%!important;overflow-x:auto!important;padding-bottom:4px!important}.feed-tabs span{flex:0 0 auto!important;font-size:10px!important;padding:6px 9px!important;white-space:nowrap!important}.feed-item{display:grid!important;grid-template-columns:38px minmax(0,1fr)!important;gap:10px!important;width:100%!important;padding:12px!important;border-radius:16px!important;overflow:hidden!important}.feed-icon{width:38px!important;height:38px!important;border-radius:14px!important;font-size:18px!important}.feed-thumb{display:none!important}
  .widget,.panel,.card,.mini-card,.profile-hero,.inst-hero,.inst-card,.calendar-event{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;padding:12px!important;border-radius:16px!important;overflow:hidden!important}.widget{margin-bottom:12px!important}.widget-head{gap:8px!important}.widget-head h3{font-size:15px!important}.quick-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}.quick-grid a{min-width:0!important;padding:10px 4px!important;font-size:10px!important}
  .profile-hero{display:grid!important;grid-template-columns:56px minmax(0,1fr)!important;gap:10px!important;align-items:start!important}.avatar{width:56px!important;height:56px!important;border-radius:18px!important;font-size:24px!important}.profile-hero h1{font-size:21px!important}.profile-hero>div:last-child{min-width:0!important}.metrics{display:flex!important;flex-wrap:wrap!important;gap:5px!important}.metrics span{font-size:10px!important;padding:5px 7px!important;max-width:100%!important}.tenure-stars.title-stars{font-size:13px!important;max-width:100px!important}
  input,textarea,select,button{width:100%!important;max-width:100%!important}.inline,.inline-form,.table-actions{display:flex!important;flex-wrap:wrap!important}.inline input{width:auto!important}table{display:block!important;width:100%!important;overflow-x:auto!important}
  .calendar-event{display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;gap:9px!important}.calendar-icon{width:34px!important;height:34px!important;border-radius:12px!important;font-size:16px!important}.calendar-event>div{min-width:0!important}.calendar-desc{font-size:11px!important}.person-row,.event-row,.unit-row{min-width:0!important;max-width:100%!important;gap:9px!important}.person-row span:last-child,.event-row span:last-child,.unit-row span:last-child{min-width:0!important;max-width:100%!important}.mini-person{width:42px!important;height:42px!important;flex:0 0 42px!important;font-size:11px!important}.birthday-list .birthday-row .mini-person{width:44px!important;height:44px!important;flex-basis:44px!important}
  .mobile-bottom-nav{position:fixed!important;left:12px!important;right:12px!important;bottom:8px!important;z-index:1200!important;width:auto!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;padding:6px!important;border-radius:20px!important;background:rgba(255,255,255,.98)!important;border:1px solid #e2e8f0!important;box-shadow:0 -10px 28px rgba(15,23,42,.12)!important}.mobile-bottom-nav a{height:48px!important;min-width:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;border-radius:14px!important;color:#64748b!important;text-decoration:none!important}.mobile-bottom-nav a span{font-size:18px!important}.mobile-bottom-nav a b{font-size:9px!important;white-space:nowrap!important}.mobile-bottom-nav a.active{background:#eaf2ff!important;color:#1d4ed8!important}
}

@media (max-width: 820px){
  .widget,.panel,.card,.mini-card,.profile-hero,.inst-hero,.inst-card,.calendar-event,.feed-item,.day-card{overflow:visible!important}
  .widget-head,.profile-hero p,.profile-hero h1,.metrics,.metrics span,.calendar-event h3,.calendar-event p,.calendar-event small,.card h3,.card p,.card small,.card a,.mini-card h3,.mini-card p,.mini-card small,.mini-card a,.feed-item h3,.feed-item p,.feed-tabs,.person-row b,.person-row small{min-width:0!important;max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;word-break:break-word!important;overflow-wrap:anywhere!important}
  .widget-head{display:flex!important;align-items:flex-start!important;flex-wrap:wrap!important}.widget-head h2,.widget-head h3,.widget-head small,.widget-head a{min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .feed-tabs{overflow-x:auto!important;display:flex!important;flex-wrap:nowrap!important}.feed-tabs span{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}
  .calendar-event>div,.feed-item>div,.card>*,.mini-card>*,.panel>*{min-width:0!important;max-width:100%!important}
  a[href*="download"],a.button-link,.card a{word-break:break-all!important;overflow-wrap:anywhere!important}
  .mobile-bottom-nav{overflow:visible!important}.mobile-bottom-nav a{overflow:hidden!important}
}

@media (max-width: 820px){
  body.app-shell{padding-bottom:128px!important}.content-wrap{padding-bottom:120px!important}.calendar-page,.cards,.panel{padding-bottom:8px!important}
  .calendar-event small,.calendar-event p,.calendar-event h3,.widget-head small,.card a,.card small,.mini-card small{display:block!important;width:100%!important;max-width:100%!important;white-space:normal!important;word-break:break-all!important;overflow-wrap:anywhere!important;overflow:visible!important;text-overflow:clip!important}
  .calendar-event p.calendar-desc{word-break:break-word!important}.card a[href],.mini-card a[href]{line-break:anywhere!important}
}

@media (max-width: 820px){
  /* Cards do topo no mobile: grade compacta estilo Atalhos rápidos */
  .today-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;width:100%!important;margin-bottom:16px!important}
  .today-grid .day-card{min-height:96px!important;padding:12px 8px!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:7px!important}
  .today-grid .day-icon{width:42px!important;height:42px!important;border-radius:15px!important;font-size:20px!important;flex:0 0 42px!important}
  .today-grid .day-card b{font-size:22px!important;line-height:1!important;margin-bottom:2px!important}
  .today-grid .day-card span{font-size:11px!important;line-height:1.15!important;text-align:center!important}
  .today-grid .day-card>span:last-child{display:block!important;width:100%!important;min-width:0!important}
  .today-grid .day-card:last-child:nth-child(odd){grid-column:1 / -1!important;min-height:78px!important;flex-direction:row!important;text-align:left!important;justify-content:flex-start!important;padding-left:14px!important;padding-right:14px!important}
  .today-grid .day-card:last-child:nth-child(odd)>span:last-child{text-align:left!important}
}

@media(max-width:820px){.quick-edit-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.quick-edit-card{min-height:104px!important;padding:12px 8px!important}.quick-edit-icon{font-size:24px!important}.form-actions-row{display:grid!important;grid-template-columns:1fr!important}}

@media(max-width:820px){.form-grid-3{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}.certificate-panel{border-left:0!important}.certificate-card{border-left-width:4px!important}.certificate-review-form{padding-top:10px!important;border-top:1px solid #eef2f7!important}}

@media(max-width:820px){.certificate-panel .muted{display:block!important;width:100%!important;max-width:100%!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;padding-right:2px!important}.certificate-panel{overflow:visible!important}}

/* Benefícios mobile — evitar corte lateral e botão escondido pela barra inferior */
@media(max-width:820px){
  .benefits-source-panel,.benefit-request-panel{overflow:visible!important;box-sizing:border-box!important}
  .benefit-policy-grid{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;width:100%!important;max-width:100%!important;overflow:visible!important}
  .benefit-policy-box{width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:12px!important;overflow:visible!important}
  .benefit-policy-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;align-items:start!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;font-size:12px!important}
  .benefit-policy-row span{min-width:0!important;overflow-wrap:anywhere!important;word-break:normal!important}
  .benefit-policy-row strong{white-space:normal!important;text-align:right!important;font-size:12px!important;max-width:92px!important;line-height:1.2!important}
  .benefit-payment-row,.benefit-policy-note{width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow-wrap:anywhere!important}
  .benefit-request-form{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;width:100%!important;max-width:100%!important;padding-bottom:96px!important}
  .benefit-request-form label,.benefit-request-form input,.benefit-request-form select,.benefit-request-form textarea,.benefit-request-form button{width:100%!important;max-width:100%!important;box-sizing:border-box!important}
  .benefit-request-form button{display:block!important;margin-top:4px!important;margin-bottom:28px!important;min-height:44px!important}
  .benefit-requests-list{padding-bottom:96px!important}
}

/* Hotfix Benefícios mobile v2 — prioridade máxima contra corte/overlay */
@media(max-width:820px){
  .benefits-source-panel,.benefit-request-panel{padding-left:12px!important;padding-right:12px!important;margin-bottom:14px!important}
  .benefit-policy-box{padding:10px!important;border-radius:14px!important}
  .benefit-policy-box h3{font-size:11px!important;margin-bottom:8px!important;line-height:1.2!important}
  .benefit-policy-row{display:block!important;padding:7px 0!important;font-size:11.5px!important;line-height:1.25!important;overflow:visible!important}
  .benefit-policy-row span{display:block!important;width:100%!important;max-width:100%!important;margin-bottom:3px!important}
  .benefit-policy-row strong{display:block!important;width:100%!important;max-width:100%!important;text-align:left!important;font-size:12px!important;white-space:normal!important;color:#10b981!important}
  .benefit-payment-row{font-size:11.5px!important;padding:7px 0!important;line-height:1.3!important}
  .benefit-policy-note{font-size:11px!important;padding:8px!important;margin-top:8px!important;line-height:1.3!important}
  .benefit-request-panel h2{font-size:17px!important;margin-bottom:4px!important}
  .benefit-request-panel .muted{font-size:11.5px!important;line-height:1.3!important;margin-bottom:8px!important}
  .benefit-request-form{grid-template-columns:1fr 1fr!important;gap:8px!important;padding-bottom:140px!important}
  .benefit-request-form label{font-size:11px!important;gap:4px!important}
  .benefit-request-form label:first-of-type,
  .benefit-request-form label:nth-of-type(2),
  .benefit-request-form label:nth-of-type(6),
  .benefit-request-form textarea,
  .benefit-request-form button{grid-column:1/-1!important}
  .benefit-request-form input,.benefit-request-form select{min-height:38px!important;padding:8px!important;font-size:12px!important}
  .benefit-request-form textarea{min-height:54px!important;font-size:12px!important}
  .benefit-request-form button{position:relative!important;z-index:1!important;min-height:42px!important;margin-bottom:80px!important}
}
@media(max-width:360px){.benefit-request-form{grid-template-columns:1fr!important}.benefit-request-form label{grid-column:1/-1!important}}

/* Mobile UX v2 — TavIntra — 2026-06-11
   Passada final por cima dos hotfixes antigos: mais área útil, 5 atalhos reais,
   cards legíveis e chat em tela cheia no celular. */
@media (max-width: 820px){
  html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important;background:#f6f8fb!important}
  body.app-shell{padding-bottom:104px!important;min-height:100dvh!important}
  .main-area{width:100%!important;max-width:100%!important;margin:0!important;overflow-x:hidden!important}
  .content-wrap{width:100%!important;max-width:480px!important;margin:0 auto!important;padding:14px 12px 24px!important;overflow:visible!important}
  .content-wrap>*{width:100%!important;max-width:100%!important;min-width:0!important}

  .app-header{height:auto!important;min-height:60px!important;padding:10px 12px!important;gap:8px!important;display:flex!important;flex-direction:row!important;align-items:center!important;background:rgba(246,248,251,.98)!important;backdrop-filter:blur(14px)!important;overflow:visible!important}
  .search-box{height:42px!important;min-width:0!important;flex:1 1 auto!important;max-width:none!important;border-radius:16px!important;background:#fff!important;box-shadow:0 4px 14px rgba(15,23,42,.04)!important}
  .search-box input{font-size:13px!important;min-width:0!important}.search-box input::placeholder{color:transparent!important;font-size:0!important}
  .header-actions{flex:0 0 auto!important;display:flex!important;gap:6px!important;max-width:none!important;overflow:visible!important}
  .header-actions .icon-btn{display:grid!important;width:40px!important;height:40px!important;flex:0 0 40px!important;border-radius:15px!important;background:#fff!important}
  .header-actions .icon-btn[title="Ajuda"]{display:none!important}
  .user-chip{display:grid!important;place-items:center!important;width:40px!important;height:40px!important;flex:0 0 40px!important;padding:0!important;border-radius:15px!important;background:#fff!important}
  .user-chip>span:not(.chip-avatar),.user-chip em{display:none!important}.chip-avatar{width:34px!important;height:34px!important}
  .user-menu-panel{position:fixed!important;right:12px!important;top:62px!important;width:min(260px,calc(100vw - 24px))!important;z-index:1500!important}

  .mobile-bottom-nav{position:fixed!important;left:10px!important;right:10px!important;bottom:8px!important;width:auto!important;height:auto!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important;padding:6px!important;border-radius:22px!important;background:rgba(255,255,255,.985)!important;border:1px solid #e2e8f0!important;box-shadow:0 -12px 30px rgba(15,23,42,.14)!important;z-index:1200!important;backdrop-filter:blur(16px)!important}
  .mobile-bottom-nav a{width:auto!important;max-width:none!important;min-width:0!important;height:50px!important;padding:4px 1px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;border-radius:16px!important;color:#64748b!important;text-decoration:none!important;overflow:hidden!important}
  .mobile-bottom-nav a span{font-size:18px!important;line-height:1!important}.mobile-bottom-nav a b{font-size:8.6px!important;line-height:1!important;white-space:nowrap!important;letter-spacing:-.15px!important}.mobile-bottom-nav a.active{background:#eaf2ff!important;color:#1d4ed8!important;box-shadow:inset 0 0 0 1px #bfdbfe!important}

  .welcome-row{margin:2px 0 14px!important}.welcome-row h1{font-size:25px!important;line-height:1.08!important;letter-spacing:-.7px!important}.welcome-row p{font-size:12.5px!important;line-height:1.35!important}
  .today-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-bottom:16px!important}
  .today-grid .day-card{min-height:98px!important;padding:12px 8px!important;border-radius:20px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:7px!important;background:#fff!important;box-shadow:0 8px 22px rgba(15,23,42,.06)!important;overflow:visible!important}
  .today-grid .day-card:last-child:nth-child(odd){grid-column:1/-1!important;min-height:78px!important;flex-direction:row!important;text-align:left!important;justify-content:flex-start!important;padding:12px 14px!important}
  .today-grid .day-icon{width:42px!important;height:42px!important;border-radius:16px!important;font-size:20px!important;flex:0 0 42px!important}.today-grid .day-card b{font-size:22px!important;line-height:1!important}.today-grid .day-card span{font-size:11px!important;line-height:1.15!important}

  .feed-head{display:block!important;margin:0 0 10px!important}.feed-head h2{font-size:19px!important;margin:0 0 8px!important}.feed-tabs{display:flex!important;gap:6px!important;overflow-x:auto!important;flex-wrap:nowrap!important;padding:0 0 5px!important}.feed-tabs span{flex:0 0 auto!important;font-size:10.5px!important;padding:7px 10px!important;white-space:nowrap!important;border-radius:999px!important}
  .feed-item{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:10px!important;padding:13px!important;border-radius:20px!important;overflow:visible!important}.feed-icon{width:42px!important;height:42px!important;border-radius:16px!important;font-size:19px!important}.feed-thumb{display:none!important}.feed-item h3{font-size:15px!important;line-height:1.25!important}.feed-item p{font-size:12.5px!important;line-height:1.4!important}.feed-tag{font-size:10px!important}
  .right-rail{display:block!important;margin-top:14px!important}.widget,.panel,.card,.mini-card,.profile-hero,.inst-card,.calendar-event{border-radius:20px!important;padding:14px!important;overflow:visible!important;box-shadow:0 8px 22px rgba(15,23,42,.05)!important}.widget{margin-bottom:12px!important}.quick-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}.quick-grid a{min-height:62px!important;padding:10px 6px!important;border-radius:16px!important;font-size:11px!important}
  input,textarea,select,button,.button-link{min-height:42px!important;border-radius:14px!important;font-size:13px!important}button,.button-link{padding:10px 12px!important}.inline,.inline-form,.table-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}.inline-form button,.table-actions button{width:100%!important}
  table{display:block!important;width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}th,td{font-size:12px!important;padding:10px!important}

  .tav-chat-fab{right:16px!important;bottom:82px!important;width:54px!important;height:54px!important;z-index:1190!important}
  .tav-chat-widget,.tav-chat-widget.expanded{position:fixed!important;left:0!important;right:0!important;top:0!important;bottom:0!important;width:100vw!important;height:100dvh!important;max-height:none!important;border-radius:0!important;border:0!important;z-index:1600!important}
  .tav-chat-widget.open{display:flex!important}.tav-chat-head{height:58px!important;padding:10px 12px!important}.tav-chat-toolbar{height:52px!important;padding:8px!important}.tav-chat-body,.tav-chat-widget.expanded .tav-chat-body{display:grid!important;grid-template-columns:118px 0 minmax(0,1fr)!important;min-height:0!important}.tav-chat-resizer{display:none!important}.tav-chat-conversations{min-width:0!important}.tav-chat-conv{padding:7px 5px!important;gap:5px!important}.tav-chat-avatar{width:34px!important;height:34px!important;flex-basis:34px!important}.tav-chat-conv-text strong{font-size:10.8px!important}.tav-chat-conv-text small,.tav-chat-conv-text em{font-size:9px!important}.tav-chat-room-head strong{max-width:calc(100vw - 190px)!important;font-size:13px!important}.tav-chat-room-head small{max-width:calc(100vw - 190px)!important}.tav-chat-messages{padding:10px!important}.tav-chat-msg{max-width:92%!important}.oc-chat-compose{padding:8px!important;gap:5px!important}.oc-chat-field textarea{font-size:13px!important;min-height:38px!important}.tav-chat-sticker-panel{max-width:calc(100vw - 132px)!important}
}
@media (max-width: 360px){
  .content-wrap{padding-left:10px!important;padding-right:10px!important}.mobile-bottom-nav{left:6px!important;right:6px!important}.mobile-bottom-nav a b{font-size:7.8px!important}.mobile-bottom-nav a span{font-size:17px!important}.today-grid{grid-template-columns:1fr!important}.today-grid .day-card:last-child:nth-child(odd){grid-column:auto!important}.tav-chat-body,.tav-chat-widget.expanded .tav-chat-body{grid-template-columns:104px 0 minmax(0,1fr)!important}
}

/* mobile-chat-v3 — chat como app: lista -> conversa, sem coluna espremida */
@media (max-width: 820px){
  body:has(.tav-chat-widget.open){overflow:hidden!important;touch-action:none!important}
  body:has(.tav-chat-widget.open) .mobile-bottom-nav{display:none!important}
  body:has(.tav-chat-widget.open) .tav-chat-fab{display:none!important}

  .tav-chat-widget,
  .tav-chat-widget.expanded{
    position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;
    max-width:none!important;max-height:none!important;border-radius:0!important;border:0!important;
    background:#f4f6fa!important;z-index:2200!important;overflow:hidden!important
  }
  .tav-chat-widget.open{display:flex!important;flex-direction:column!important}
  .tav-chat-head{
    height:58px!important;min-height:58px!important;padding:8px 12px!important;
    background:#1E3A8A!important;color:#fff!important;box-shadow:0 4px 16px rgba(15,23,42,.18)!important;z-index:3!important
  }
  .tav-chat-head strong{font-size:16px!important}.tav-chat-head small{font-size:11px!important;color:#dbeafe!important}
  .tav-chat-head-actions button{width:36px!important;height:36px!important;border-radius:12px!important;font-size:19px!important}
  #tav-chat-expand-btn{display:none!important}

  .tav-chat-toolbar{
    height:58px!important;min-height:58px!important;padding:9px 10px!important;background:#fff!important;
    border-bottom:1px solid #e5eaf1!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;gap:7px!important
  }
  .tav-chat-toolbar input{height:40px!important;border-radius:16px!important;background:#f8fafc!important;font-size:14px!important;padding:9px 12px!important}
  .tav-chat-toolbar button{height:40px!important;min-height:40px!important;border-radius:14px!important;font-size:12px!important;padding:0 10px!important}

  .tav-chat-body,
  .tav-chat-widget.expanded .tav-chat-body{
    flex:1 1 auto!important;min-height:0!important;height:auto!important;display:grid!important;
    grid-template-columns:1fr!important;grid-template-rows:1fr!important;background:#fff!important;overflow:hidden!important
  }
  .tav-chat-resizer{display:none!important}
  .tav-chat-conversations{
    display:block!important;width:100%!important;height:100%!important;min-width:0!important;overflow-y:auto!important;
    border-right:0!important;background:#fff!important;-webkit-overflow-scrolling:touch!important;padding:4px 0 10px!important
  }
  .tav-chat-room{display:none!important;min-width:0!important;height:100%!important;background:#f4f6fa!important;overflow:hidden!important}
  .tav-chat-widget.room-active .tav-chat-toolbar,
  .tav-chat-widget.room-active .tav-chat-conversations{display:none!important}
  .tav-chat-widget.room-active .tav-chat-room{display:flex!important;flex-direction:column!important}

  .tav-chat-conv{
    min-height:70px!important;width:100%!important;padding:10px 14px!important;gap:11px!important;
    border-bottom:1px solid #eef2f7!important;background:#fff!important;border-radius:0!important
  }
  .tav-chat-conv.active,.tav-chat-conv:hover{background:#f8fbff!important}
  .tav-chat-avatar{width:48px!important;height:48px!important;flex:0 0 48px!important;font-size:15px!important}
  .tav-chat-conv-text strong{font-size:15px!important;line-height:1.15!important;max-width:calc(100vw - 104px)!important}
  .tav-chat-conv-text small{font-size:12px!important;line-height:1.15!important;margin-top:3px!important;max-width:calc(100vw - 104px)!important}
  .tav-chat-conv-text em{font-size:12.5px!important;line-height:1.2!important;margin-top:5px!important;max-width:calc(100vw - 104px)!important;color:#475569!important}
  .tav-chat-conv>b{right:14px!important;top:14px!important;min-width:20px!important;height:20px!important;font-size:10px!important;background:#ef4444!important}

  .tav-chat-room-head{
    height:58px!important;min-height:58px!important;padding:8px 10px!important;background:#fff!important;border-bottom:1px solid #e5eaf1!important;
    display:flex!important;align-items:center!important;gap:9px!important;box-shadow:0 1px 0 rgba(15,23,42,.03)!important;z-index:2!important
  }
  .tav-chat-mobile-back{
    display:grid!important;place-items:center!important;width:40px!important;height:40px!important;min-width:40px!important;border:0!important;
    border-radius:14px!important;background:#eff6ff!important;color:#1E3A8A!important;font-size:30px!important;line-height:1!important;padding:0!important
  }
  .tav-chat-room-head>span{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .tav-chat-room-head strong{font-size:15px!important;max-width:calc(100vw - 150px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .tav-chat-room-head small{font-size:11px!important;max-width:calc(100vw - 150px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

  .tav-chat-messages{
    flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;
    padding:12px 10px 14px!important;background:#eef2f7!important;gap:8px!important
  }
  .tav-chat-msg{max-width:84%!important;border-radius:16px 16px 16px 5px!important;padding:8px 10px!important;font-size:14px!important}
  .tav-chat-msg.mine{border-radius:16px 16px 5px 16px!important;background:#dbeafe!important}
  .tav-chat-msg p{font-size:14px!important;line-height:1.35!important}.tav-chat-msg small{font-size:10.5px!important}

  .tav-chat-room .oc-chat-compose{
    position:relative!important;bottom:auto!important;left:auto!important;right:auto!important;flex:0 0 auto!important;
    min-height:58px!important;padding:8px 9px calc(8px + env(safe-area-inset-bottom))!important;background:#fff!important;
    border-top:1px solid #e5eaf1!important;display:flex!important;align-items:flex-end!important;gap:7px!important;z-index:3!important
  }
  .tav-chat-room .oc-chat-icon{width:36px!important;height:40px!important;min-width:36px!important;flex:0 0 36px!important;border-radius:14px!important;background:#f8fafc!important;font-size:17px!important}
  .tav-chat-room .oc-chat-field{min-height:40px!important;border-radius:18px!important;background:#f8fafc!important;padding:0 38px 0 10px!important;flex:1 1 auto!important;min-width:0!important}
  .tav-chat-room .oc-chat-field textarea#tav-chat-message{min-height:40px!important;height:40px!important;max-height:96px!important;font-size:14px!important;line-height:1.25!important;padding:10px 4px!important;background:transparent!important}
  .tav-chat-room .oc-chat-emoji,.tav-chat-room .oc-chat-sticker{width:28px!important;height:28px!important;min-width:28px!important;right:5px!important;top:6px!important;font-size:15px!important}
  .tav-chat-room .oc-chat-send{display:grid!important;width:40px!important;height:40px!important;min-width:40px!important;border-radius:16px!important;font-size:15px!important}
  .tav-chat-room .tav-chat-sticker-panel{left:8px!important;right:8px!important;bottom:64px!important;width:auto!important;max-width:none!important;max-height:min(430px,calc(100dvh - 210px))!important}
  .tav-chat-room .tav-chat-emoji-panel{right:8px!important;bottom:64px!important}
}

@media (max-width: 360px){
  .tav-chat-conv{padding:9px 10px!important}.tav-chat-avatar{width:44px!important;height:44px!important;flex-basis:44px!important}
  .tav-chat-conv-text strong{font-size:14px!important}.tav-chat-room .oc-chat-icon{width:32px!important;min-width:32px!important}.tav-chat-room .oc-chat-send{width:36px!important;min-width:36px!important}
}
@media (max-width: 820px){
  body.tav-chat-open-mobile{overflow:hidden!important;touch-action:none!important}
  body.tav-chat-open-mobile .mobile-bottom-nav{display:none!important}
  body.tav-chat-open-mobile .tav-chat-fab{display:none!important}
}

/* mobile-chat-v4 — integra botão voltar do celular com etapas internas do chat */
@media (max-width: 820px){
  .tav-chat-widget.open:not(.room-active) .tav-chat-room{display:none!important}
  .tav-chat-widget.open:not(.room-active) .tav-chat-toolbar,
  .tav-chat-widget.open:not(.room-active) .tav-chat-conversations{display:block!important}
}

/* dark-contrast-v2 mobile */
@media (max-width: 820px){
  html[data-theme="dark"] .app-header{background:rgba(8,17,31,.96)!important}
  html[data-theme="dark"] .search-box,
  html[data-theme="dark"] .header-actions .icon-btn,
  html[data-theme="dark"] .user-chip{background:#0b1220!important;color:#e5edf7!important;border-color:#243247!important}
  html[data-theme="dark"] .tav-chat-widget.room-active .tav-chat-room-head,
  html[data-theme="dark"] .tav-chat-widget.open:not(.room-active) .tav-chat-toolbar,
  html[data-theme="dark"] .tav-chat-conv{background:#0b1220!important;color:#e5edf7!important;border-color:#243247!important}
  html[data-theme="dark"] .tav-chat-conv-text em{color:#a8b3c5!important}
}

/* chat-input-contrast-v3 mobile */
@media (max-width: 820px){
  html[data-theme="dark"] .tav-chat-room .oc-chat-field textarea#tav-chat-message{
    color:#f8fafc!important;
    -webkit-text-fill-color:#f8fafc!important;
  }
  html[data-theme="dark"] .tav-chat-room .oc-chat-field textarea#tav-chat-message::placeholder{
    color:#cbd5e1!important;
    opacity:1!important;
  }
  html[data-theme="dark"] .tav-chat-room .oc-chat-field{
    background:#111c2e!important;
    border:1px solid #334155!important;
  }
}

/* stickers-refine-v1 — mais área útil e abas mais compactas no mobile */
@media (max-width: 820px){
  .tav-chat-room .tav-chat-sticker-panel,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-chat-sticker-panel{
    left:8px!important;
    right:8px!important;
    bottom:64px!important;
    width:auto!important;
    max-width:none!important;
    height:min(500px, calc(100dvh - 188px))!important;
    max-height:min(500px, calc(100dvh - 188px))!important;
    min-height:390px!important;
    padding:7px!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
    overflow:hidden!important;
  }
  .tav-chat-room .tav-sticker-search{
    gap:5px!important;
  }
  .tav-chat-room .tav-sticker-search input{
    height:32px!important;
    min-height:32px!important;
    font-size:12px!important;
    padding:6px 9px!important;
    border-radius:10px!important;
  }
  .tav-chat-room .tav-sticker-manage-mini{
    width:32px!important;
    height:32px!important;
    min-height:32px!important;
    border-radius:10px!important;
    font-size:18px!important;
  }
  .tav-chat-room .tav-sticker-tabs-strip{
    gap:4px!important;
    padding:1px 0 5px!important;
    overflow-x:auto!important;
    scrollbar-width:none!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .tav-chat-room .tav-sticker-tabs-strip::-webkit-scrollbar{display:none!important}
  .tav-chat-room .tav-sticker-tabs-strip button,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-sticker-tabs-strip button{
    height:24px!important;
    min-height:24px!important;
    padding:0 6px!important;
    gap:3px!important;
    font-size:10px!important;
    line-height:1!important;
    border-radius:999px!important;
    flex:0 0 auto!important;
    max-width:92px!important;
  }
  .tav-chat-room .tav-sticker-tabs-strip button span{
    font-size:11px!important;
  }
  .tav-chat-room .tav-sticker-tabs-strip button em{
    font-size:8.5px!important;
    margin-left:1px!important;
  }
  .tav-chat-room .tav-sticker-grid,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-sticker-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    padding:1px 2px 8px 0!important;
  }
  .tav-chat-room .tav-sticker-card,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-sticker-card{
    height:68px!important;
    min-height:68px!important;
    border-radius:12px!important;
    padding:4px!important;
  }
  .tav-chat-room .tav-sticker-card img,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-sticker-card img{
    width:48px!important;
    height:48px!important;
    max-width:48px!important;
    max-height:48px!important;
  }
  .tav-chat-room .tav-sticker-card .emoji{
    font-size:34px!important;
  }
}
@media (max-width: 360px){
  .tav-chat-room .tav-sticker-grid,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-sticker-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .tav-chat-room .tav-chat-sticker-panel,
  .tav-chat-widget:not(.expanded) .tav-chat-room .tav-chat-sticker-panel{height:min(470px, calc(100dvh - 188px))!important;min-height:360px!important}
}

/* institutional-dark-v4 mobile */
@media (max-width: 820px){
  html[data-theme="dark"] .institutional-page :is(p,li,small,.unit-info small,.inst-card p,.inst-card li){
    color:#cbd5e1!important;
    -webkit-text-fill-color:#cbd5e1!important;
  }
  html[data-theme="dark"] .institutional-page :is(h1,h2,h3,.unit-row b,.inst-unit-name){
    color:#f8fafc!important;
    -webkit-text-fill-color:#f8fafc!important;
  }
}

/* calendar-dark-v5 mobile */
@media (max-width: 820px){
  html[data-theme="dark"] .calendar-page :is(h1,h2,h3,.calendar-event h3,.birthday-row b){
    color:#f8fafc!important;
    -webkit-text-fill-color:#f8fafc!important;
  }
  html[data-theme="dark"] .calendar-page :is(p,small,.calendar-event p,.calendar-event small,.calendar-desc,.birthday-row small){
    color:#cbd5e1!important;
    -webkit-text-fill-color:#cbd5e1!important;
  }
  html[data-theme="dark"] .calendar-page .calendar-event,
  html[data-theme="dark"] .calendar-page .birthday-row{
    background:#0f172a!important;
    border-color:#334155!important;
  }
}
