/* PsicoMoodle — cabeçalho mobile deliberado, sem reduzir o desktop.
   Hierarquia: identidade -> semestre/matérias -> 5 destinos -> opções secundárias. */
.nav-label-short{display:none}
.mobile-subject-slot,.mobile-secondary-actions{display:none}
@media(max-width:760px){
 #siteSidebar{
  display:grid!important;
  grid-template-columns:minmax(0,1.06fr) minmax(0,.94fr);
  grid-template-areas:"brand brand" "semester subjects" "nav nav" "more more" "extra extra";
  gap:7px 10px;
  align-content:start;align-items:center;
  width:100%;min-width:0;max-width:100%;
  padding:11px max(12px,env(safe-area-inset-right)) 8px
    max(12px,env(safe-area-inset-left));
  border-bottom:1px solid var(--line);
  box-shadow:0 5px 17px rgba(30,22,69,.07);
  overflow:visible!important;
 }
 #siteSidebar>.logo,#siteSidebar>.sidebar-appearance,
 #siteSidebar>.navlbl,#siteSidebar>.sidebarfoot{display:none!important}
 #siteSidebar>.mobile-brand{
  grid-area:brand;display:flex!important;align-items:center;justify-content:space-between;
  min-width:0;width:100%;min-height:46px;gap:10px;
  padding:0 0 3px;margin:0;flex-wrap:nowrap;
 }
 #siteSidebar .mobile-identity{
  display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;
 }
 #siteSidebar .mobile-identity .mobile-brand-mark.psychology-mark{
  flex:0 0 43px;width:43px;height:43px;min-width:43px;
  border-radius:13px;display:grid;place-items:center;
  background:linear-gradient(145deg,#5042a5,#8772d7);
  color:#fff;font:normal 30px/1 Georgia,serif;letter-spacing:-2px;
  box-shadow:0 3px 9px rgba(82,57,169,.16);
 }
 #siteSidebar .mobile-heading{
  min-width:0;max-width:none;flex:1 1 auto;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;
 }
 #siteSidebar .mobile-heading strong,
 #siteSidebar .mobile-brand .mobile-heading strong{
  display:block;flex:none;max-width:100%;width:auto;min-width:0;
  font-size:clamp(17px,4.5vw,20px)!important;
  font-weight:860;letter-spacing:-.055em;line-height:1.12;
  color:var(--ink)!important;white-space:nowrap!important;
  word-break:normal!important;overflow-wrap:normal!important;
 }
 #siteSidebar .mobile-heading span{
  display:block;color:var(--muted);font-size:10.5px;line-height:1.2;
  white-space:nowrap;font-weight:530;letter-spacing:.01em;
 }
 #siteSidebar .mobile-brand-actions{
  flex:0 0 auto;display:flex;align-items:center;gap:7px;
 }
 #siteSidebar .mobile-brand-actions :is(.mobile-theme-toggle,.mobile-profile-button){
  display:grid!important;place-items:center;
  flex:0 0 40px;width:40px;height:40px;min-width:40px;min-height:40px;
  padding:0;margin:0;border:1px solid var(--line);border-radius:12px;
  background:var(--soft);color:var(--ink);font-size:20px;
  box-shadow:none;line-height:1;
 }
 #siteSidebar .mobile-brand-actions .mobile-theme-toggle .theme-toggle-text{display:none!important}
 #siteSidebar .mobile-brand-actions .mobile-profile-button svg{width:21px;height:21px}
 #siteSidebar>.semester-selector{
  grid-area:semester;display:block!important;
  width:100%;min-width:0;max-width:100%;
  padding:0;margin:0;background:transparent!important;border:0!important;
  z-index:76;
 }
 #siteSidebar #semesterCurrent{
  width:100%;max-width:100%;min-height:47px;height:47px;
  padding:7px 10px;gap:8px;border-radius:12px;
  box-shadow:none;
 }
 #siteSidebar #semesterCurrent .semester-current-icon{
  flex:0 0 26px;width:26px;height:26px;font-size:17px;border-radius:8px;
 }
 #siteSidebar #semesterCurrent .semester-current-caption{display:none}
 #siteSidebar #semesterCurrent .semester-current-copy{display:block;flex:1;min-width:0}
 #siteSidebar #semesterCurrent .semester-current-copy strong{
  font-size:12.5px;line-height:1.3;font-weight:810;white-space:nowrap;
 }
 #siteSidebar #semesterCurrent .semester-chevron{flex:0 0 15px;width:15px}
 #siteSidebar>.mobile-subject-slot{
  grid-area:subjects;display:block!important;min-width:0;width:100%;
 }
 #siteSidebar>.mobile-subject-slot #mobileSubjectToggle{
  width:100%;min-width:0;max-width:100%;height:47px;min-height:47px;
  margin:0;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;
  border:1px solid var(--line);border-radius:12px;
  background:var(--paper);color:var(--ink);
  font-size:13px;font-weight:750;line-height:1.2;
  white-space:nowrap;box-shadow:none;
 }
 #mobileSubjectToggle>span{font-size:21px;color:var(--muted);line-height:1}
 #siteSidebar>#nav.menu{
  grid-area:nav;display:flex!important;flex-wrap:wrap!important;
  align-items:stretch;justify-content:space-between;
  min-width:0;width:100%;max-width:100%;
  gap:6px;margin:1px 0 0;padding:0;
  overflow:visible!important;scroll-snap-type:none;
  background:transparent;
 }
 #siteSidebar #nav .sidebtn:nth-child(-n+5){
  box-sizing:border-box;display:flex;flex:0 0 calc((100% - 24px)/5);
  min-width:0;max-width:none;width:auto;min-height:60px;height:auto;
  padding:7px 2px 6px;gap:4px;
  flex-direction:column;align-items:center;justify-content:center;
  border:1px solid transparent;border-radius:12px;
  background:transparent;color:var(--muted);
  font-size:10.5px;font-weight:710;line-height:1.2;
  text-align:center;white-space:normal;overflow:hidden;
  scroll-snap-align:unset;
 }
 #siteSidebar #nav .sidebtn:nth-child(-n+5) svg{
  display:block;width:20px;height:20px;min-width:20px;flex:0 0 20px;
 }
 #siteSidebar #nav .sidebtn:nth-child(-n+5).active{
  background:color-mix(in srgb,var(--blue) 12%,var(--paper));
  border-color:color-mix(in srgb,var(--blue) 30%,var(--line));
  color:var(--blue);box-shadow:none;
 }
 #siteSidebar #nav .sidebtn:nth-child(-n+5) .nav-label{
  display:block;max-width:100%;min-width:0;line-height:1.2;
  font-size:10.5px;white-space:nowrap;
  text-overflow:ellipsis;overflow:hidden;font-weight:730;
 }
 #siteSidebar #nav .sidebtn .nav-label-full{display:none}
 #siteSidebar #nav .sidebtn .nav-label-short{display:block}
 #siteSidebar #nav .sidebtn:nth-child(n+6){display:none!important}
 #siteSidebar.nav-expanded #nav .sidebtn:nth-child(n+6):not([hidden]){
  display:flex!important;
  flex:1 1 calc(50% - 6px);min-width:0;max-width:calc(50% - 3px);
  min-height:47px;width:auto;padding:10px 12px;gap:9px;
  flex-direction:row;justify-content:flex-start;align-items:center;
  border-radius:11px;border:1px solid var(--line);
  background:var(--paper);font-size:12px;line-height:1.35;
  color:var(--ink);text-align:left;white-space:normal;
 }
 #siteSidebar.nav-expanded #nav .sidebtn:nth-child(n+6) svg{
  width:19px;height:19px;min-width:19px;flex:0 0 19px;
 }
 #siteSidebar #nav [hidden]{display:none!important}
 #siteSidebar>.mobile-nav-more{
  grid-area:more;display:flex!important;align-items:center;justify-content:center;
  justify-self:center;width:auto;min-width:115px;max-width:100%;
  min-height:28px;margin:-3px 0 0;padding:3px 12px 4px;
  color:var(--muted);font-size:11px;font-weight:740;
  border-radius:9px;background:transparent;
 }
 #siteSidebar>.mobile-nav-more svg{width:15px;height:15px}
 #siteSidebar>.mobile-secondary-actions{
  grid-area:extra;display:none;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;min-width:0;width:100%;padding:0 0 3px;margin:0;
 }
 #siteSidebar.nav-expanded>.mobile-secondary-actions{display:grid!important}
 #siteSidebar .mobile-secondary-actions :is(.mobile-report-button,.mobile-members-toggle){
  display:flex!important;flex:none;width:100%!important;max-width:100%;min-width:0!important;
  height:auto!important;min-height:45px!important;padding:9px 10px!important;
  align-items:center;justify-content:center;gap:8px;
  border:1px solid var(--line);border-radius:11px;
  background:var(--paper);color:var(--ink);
  font-size:11.5px;font-weight:730;line-height:1.3;text-align:center;
  box-shadow:none;margin:0;
 }
 #siteSidebar .mobile-secondary-actions :is(.mobile-report-button,.mobile-members-toggle) svg{
  flex:0 0 18px;width:18px;height:18px;
 }
 #siteSidebar .mobile-secondary-actions .mobile-members-toggle svg{transform:none!important}
 #siteSidebar .mobile-secondary-actions button span{min-width:0;overflow-wrap:anywhere}
 #siteSidebar #subjectNav.menu{
  max-height:min(55dvh,420px);padding:10px;gap:8px;
  border-radius:14px;border:1px solid var(--line);
  background:var(--paper);box-shadow:0 16px 36px #18133425;
 }
 #siteSidebar.mobile-open #subjectNav.menu{display:grid!important;grid-template-columns:1fr 1fr}
 #siteSidebar #subjectNav .sidebtn{min-height:49px;padding:10px;line-height:1.4}
 #siteSidebar :is(button,.sidebtn):focus-visible{
  outline:3px solid color-mix(in srgb,var(--blue) 55%,#fff);
  outline-offset:2px;
 }
 html[data-theme="dark"] #siteSidebar{
  background:#1b1d31!important;border-bottom-color:#3a3953;
  box-shadow:0 5px 20px #0b0c1b45;
 }
 html[data-theme="dark"] #siteSidebar .mobile-heading strong,
 html[data-theme="dark"] #siteSidebar .mobile-brand .mobile-heading strong{
  color:#f4f1ff!important;
 }
 html[data-theme="dark"] #siteSidebar .mobile-heading span{color:#b8b3d1!important}
 html[data-theme="dark"] #siteSidebar .mobile-brand-actions :is(.mobile-theme-toggle,.mobile-profile-button){
  background:#292941!important;border-color:#4c4568!important;color:#ebe5ff!important;
 }
 html[data-theme="dark"] #siteSidebar>.mobile-subject-slot #mobileSubjectToggle,
 html[data-theme="dark"] #siteSidebar .mobile-secondary-actions :is(.mobile-report-button,.mobile-members-toggle){
  background:#292941!important;border-color:#504868!important;color:#eee8fb!important;
 }
 html[data-theme="dark"] #siteSidebar #nav .sidebtn:nth-child(-n+5){
  background:transparent;color:#c6c1dc;
 }
 html[data-theme="dark"] #siteSidebar #nav .sidebtn:nth-child(-n+5).active{
  background:#383052!important;border-color:#665488!important;color:#e9dcff!important;
 }
 html[data-theme="dark"] #siteSidebar #nav .sidebtn:nth-child(n+6):not([hidden]){
  background:#28283f;border-color:#47415f;color:#e6dff7;
 }
 html[data-theme="dark"] #siteSidebar #subjectNav.menu{
  background:#24243b!important;border-color:#49425e!important;
 }
 /* O header ocupa menos espaço que a antiga grade; chats respeitam altura útil. */
 .app>.main:has(>.tz-shell),.app:has(>.main .dm-shell)>.main{padding-top:9px}
 .main>.tz-shell,.dm-shell{height:calc(100dvh - 222px);min-height:360px}
}
@media(max-width:370px){
 #siteSidebar{column-gap:7px;row-gap:6px}
 #siteSidebar .mobile-identity{gap:8px}
 #siteSidebar .mobile-identity .mobile-brand-mark.psychology-mark{
  flex-basis:39px;min-width:39px;width:39px;height:39px;font-size:27px;
 }
 #siteSidebar .mobile-heading strong{font-size:16px!important}
 #siteSidebar .mobile-brand-actions{gap:5px}
 #siteSidebar .mobile-brand-actions :is(.mobile-theme-toggle,.mobile-profile-button){
  flex-basis:36px;width:36px;height:38px;min-width:36px;min-height:38px;
 }
 #siteSidebar #semesterCurrent{gap:4px;padding:7px}
 #siteSidebar #semesterCurrent .semester-current-icon{width:22px;height:22px;flex-basis:22px}
 #siteSidebar #semesterCurrent .semester-current-copy strong{font-size:11.5px}
 #siteSidebar>.mobile-subject-slot #mobileSubjectToggle{padding:7px 9px;font-size:12px}
 #siteSidebar #nav .sidebtn:nth-child(-n+5){min-height:58px;padding-inline:1px;gap:3px}
 #siteSidebar #nav .sidebtn:nth-child(-n+5) .nav-label{font-size:9.7px}
 #siteSidebar.nav-expanded #nav .sidebtn:nth-child(n+6):not([hidden]){font-size:11px}
}
@media(min-width:761px){
 .mobile-subject-slot,.mobile-secondary-actions{display:none!important}
}