
/* EduMin v2 — estrutural, estilos exclusivos da plataforma Nexos Professor */
body.portal-ready{--portal-bg:#f6f7fb;--portal-border:#e9ebf3;--portal-ink:#263450;background:#f6f7fb}
#portalRoot .portal-sidebar{
  width:264px;background:#fff;border-right:1px solid #e7eaf2;padding:0;
  gap:0;min-width:0;box-shadow:4px 0 20px #2637580a
}
body.portal-ready #portalRoot{grid-template-columns:264px minmax(0,1fr)}
#portalRoot .portal-brand{
  height:84px;margin:0;padding:17px 18px;border-bottom:1px solid #e8ecf6;
  background:#fff;display:flex;gap:11px
}
#portalRoot .portal-brand span:last-child{font-size:16px;font-weight:850;line-height:1.25}
#portalRoot .portal-brand small{display:block;margin-top:3px;font-size:11px;color:#8290a7}
#portalRoot .portal-mark{width:43px;height:43px;flex:none;border-radius:9px;font-size:25px;background:#6266f1}
#portalRoot .portal-nav{padding:17px 12px;display:flex;flex:1;flex-direction:column;gap:4px;min-height:0;overflow-y:auto}
#portalRoot .portal-nav-heading{
  display:block;color:#a1aabb;font-size:9px;letter-spacing:.12em;font-weight:850;
  margin:12px 10px 7px;padding:0
}
#portalRoot .portal-nav-heading:first-child{margin-top:0}
#portalRoot .portal-nav button{font-size:13px;min-height:43px;flex-shrink:0;border-radius:7px;gap:11px;padding:10px 12px}
#portalRoot .portal-nav button span:first-child{font-size:19px!important;width:22px!important}
#portalRoot .portal-nav button.active{background:#ebeeff;color:#4d59d3;box-shadow:inset 3px 0 #5e66ed}
#portalRoot .portal-nav button.active:before{display:none}
#portalRoot .portal-credit-panel{margin:9px 12px 12px;border-radius:10px;flex:none}
#portalRoot .portal-bottom{margin:0 12px;padding:14px 0 16px;flex:none}
#portalRoot .portal-main{padding:27px clamp(22px,3vw,44px) 50px}
#portalRoot .portal-wrap{max-width:1490px}
#portalRoot .portal-top{
  margin:0 0 24px;padding:0 0 18px;min-height:49px;
  align-items:center;border-bottom:1px solid #e5e9f0
}
#portalRoot .portal-top .cap{font-size:12px;letter-spacing:.025em;color:#43536d;text-transform:none}
#portalRoot .portal-status{background:#f2f3ff;border-color:#dee2ff;color:#4a58ce}
#portalRoot .portal-h1{color:#22324d;font-size:clamp(26px,2.8vw,38px);font-weight:800}
#portalRoot .portal-sub{font-size:13px;max-width:750px}
#portalRoot .portal-metrics{gap:14px;margin-bottom:16px}
#portalRoot .portal-metric{min-height:128px;padding:18px 19px;border-radius:8px}
#portalRoot .portal-metric-icon{width:37px;height:37px}
#portalRoot .portal-metric-value{font-size:34px;margin:4px 0}
#portalRoot .portal-metric-note{opacity:.91}
#portalRoot .portal-grid{gap:16px}
#portalRoot .portal-feature{grid-column:span 8;background:linear-gradient(118deg,#575ee2,#7047c5);min-height:226px;position:relative;overflow:hidden}
#portalRoot .portal-feature:after{
  content:"";position:absolute;right:-35px;top:-90px;width:260px;height:260px;border-radius:50%;
  border:44px solid rgba(255,255,255,.085);pointer-events:none
}
#portalRoot .portal-feature :is(h2,p,button){position:relative;z-index:1}
#portalRoot .portal-library-card{grid-column:span 4}
#portalRoot .portal-card{border-radius:10px;box-shadow:0 4px 20px #2137580c}
#portalRoot .portal-special-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
#portalRoot .portal-special-btn{min-height:124px;padding:17px;border-radius:9px;transition:transform .15s ease,box-shadow .15s ease}
#portalRoot .portal-special-btn:hover{transform:translateY(-2px);box-shadow:0 9px 20px #435abb1e}
#portalRoot .portal-insights{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px;margin-bottom:17px}
#portalRoot .portal-insight{
  border:1px solid #e8ebf3;border-radius:10px;background:#fff;
  padding:17px 19px;box-shadow:0 4px 20px #2033540c;min-width:0
}
#portalRoot .portal-insight h2{font-size:15px;margin:0 0 4px;color:#27364f}
#portalRoot .portal-insight p{font-size:11px;margin:0;color:#8490a3}
#portalRoot .portal-trend{display:flex;align-items:stretch;gap:10px;height:154px;margin-top:16px;border-bottom:1px solid #edf0f6;padding:0 3px}
#portalRoot .portal-trend-col{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;gap:5px}
#portalRoot .portal-trend-col b{font-size:10px;color:#64728c;font-weight:700}
#portalRoot .portal-trend-track{flex:1;min-height:56px;position:relative;width:min(100%,43px);border-radius:5px 5px 0 0;background:#f0f2f8}
#portalRoot .portal-trend-track i{position:absolute;inset:auto 0 0;height:var(--height);border-radius:5px 5px 0 0;background:#5368df}
#portalRoot .portal-trend-col:nth-child(even) .portal-trend-track i{background:#9778e9}
#portalRoot .portal-trend-col small{font-size:10px;color:#8793a6;margin-bottom:5px}
#portalRoot .portal-categories{margin-top:18px;display:grid;gap:15px}
#portalRoot .portal-category{display:grid;gap:5px}
#portalRoot .portal-category-line{display:flex;justify-content:space-between;gap:9px;font-size:11px;color:#66748c}
#portalRoot .portal-category-line b{color:#263550}
#portalRoot .portal-category-line span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#portalRoot .portal-category-track{background:#edf0f8;height:8px;border-radius:99px;overflow:hidden}
#portalRoot .portal-category-track i{display:block;width:var(--width);height:100%;border-radius:99px;background:#5e6ee6}
#portalRoot .portal-category:nth-child(2) i{background:#9c78e4}
#portalRoot .portal-category:nth-child(3) i{background:#edb04a}
#portalRoot .portal-category:nth-child(4) i{background:#34a7a3}
#portalRoot .portal-drawer-head,#portalRoot .portal-menu-backdrop{display:none}
@media(max-width:1100px){
 body.portal-ready #portalRoot{grid-template-columns:238px minmax(0,1fr)}
 #portalRoot .portal-sidebar{width:238px}
 #portalRoot .portal-insights{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #portalRoot .portal-special-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
 body.portal-ready #portalRoot{display:block;min-height:100dvh;width:100%}
 body.portal-ready.portal-menu-open{overflow:hidden!important;touch-action:none}
 #portalRoot .portal-sidebar{display:none!important}
 #portalRoot .portal-sidebar.open{
   display:flex!important;position:fixed;z-index:10080;top:0;left:0;bottom:0;
   width:min(330px,88vw);height:100dvh;min-height:0;max-height:100dvh;
   padding:0!important;gap:0;overflow:hidden;transform:none;box-shadow:20px 0 65px #0e1c3b35;
 }
 #portalRoot .portal-drawer-head{
   display:flex;align-items:center;justify-content:space-between;
   order:0;padding:calc(12px + env(safe-area-inset-top,0px)) 16px 10px;
   color:#6e7d96;font-size:11px;letter-spacing:.08em;font-weight:850;border-bottom:1px solid #edf0f5;
 }
 #portalRoot #portalClose{
   width:42px;height:42px;border:1px solid #e6eaf4;border-radius:10px;
   display:grid;place-items:center;font-size:24px;background:#fff;color:#43536f;cursor:pointer;
 }
 #portalRoot .portal-brand{height:72px;min-height:72px;padding:14px 18px;order:1;border-bottom:1px solid #e9edf4}
 #portalRoot .portal-nav{order:2;padding:12px 13px;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 #portalRoot .portal-nav button{min-height:46px;font-size:14px}
 #portalRoot .portal-credit-panel{order:3;margin:8px 13px 9px;padding:10px!important;flex:none}
 #portalRoot .portal-bottom{order:4;padding:10px 0 calc(12px + env(safe-area-inset-bottom,0px));margin:0 13px;flex:none}
 #portalRoot .portal-bottom .portal-identity{padding:8px 10px}
 #portalRoot .portal-bottom .portal-btn{padding:8px!important;min-height:35px}
 #portalRoot .portal-menu-backdrop:not([hidden]){
   display:block;position:fixed;z-index:10070;inset:0;width:100%;height:100dvh;
   background:rgba(13,22,42,.55);border:0;cursor:pointer
 }
 #portalRoot .portal-main{padding:calc(72px + env(safe-area-inset-top,0px)) 12px 25px;min-width:0}
 #portalRoot .portal-mobile-head{
   display:flex;position:fixed;z-index:1010;top:0;left:0;right:0;
   min-height:calc(59px + env(safe-area-inset-top,0px));height:auto;
   margin:0;padding:calc(8px + env(safe-area-inset-top,0px)) 12px 8px;
   background:#fff;border-bottom:1px solid #e5eaf3;box-shadow:0 3px 13px #24375b0b;
   gap:9px;justify-content:flex-start
 }
 #portalRoot #portalMenu{
   width:44px;height:43px;min-width:44px;flex:none;
   background:#eef0ff;border:1px solid #e0e4fc;color:#5664db;
   border-radius:10px;font-size:23px;padding:0;display:grid;place-items:center
 }
 #portalRoot .portal-mobile-head strong{font-size:clamp(13px,4vw,16px);flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 #portalRoot .portal-mobile-head .portal-support-widget{margin-left:auto}
 #portalRoot .portal-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 #portalRoot .portal-metric{min-height:109px;padding:12px}
 #portalRoot .portal-metric-icon{width:29px;height:29px;margin-bottom:-25px}
 #portalRoot .portal-metric-value{font-size:27px}
 #portalRoot .portal-insights{grid-template-columns:minmax(0,1fr);gap:10px}
 #portalRoot .portal-insight{padding:15px}
 #portalRoot #pHome .portal-grid>.portal-card{grid-column:1/-1}
 #portalRoot #pHome .portal-card{padding:17px}
 #portalRoot .portal-feature{min-height:0}
 #portalRoot .portal-feature h2{font-size:21px}
 #portalRoot #pHome .portal-special-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #portalRoot .portal-special-btn{min-height:111px;padding:12px}
 body.portal-ready.portal-agent-open #portalRoot .portal-main{padding-top:calc(67px + env(safe-area-inset-top,0px))!important}
 body.portal-ready.portal-agent-open #portalRoot #pAgent>.portal-chat-host{max-width:100%}
}
@media(prefers-reduced-motion:reduce){#portalRoot .portal-special-btn{transition:none}}

/* BUGFIX 2026-10-18: IA quota panel must never obscure sidebar navigation.
   On mobile it is collapsed by default, expands in document flow and remains scrollable. */
#portalRoot .portal-credit-toggle{display:none}
@media(max-width:760px){
 #portalRoot .portal-main{
   padding:0 12px calc(24px + env(safe-area-inset-bottom,0px))!important;
   min-height:0!important;
 }
 #portalRoot .portal-mobile-head{
   position:relative!important;
   top:auto!important;left:auto!important;right:auto!important;
   margin:0 -12px 15px!important;
   height:auto!important;min-height:60px!important;
   padding:calc(7px + env(safe-area-inset-top,0px)) 12px 8px!important;
   flex:0 0 auto;
   box-shadow:0 2px 9px rgba(32,48,80,.07);
 }
 body.portal-ready.portal-agent-open #portalRoot .portal-main{
   padding:0 12px calc(8px + env(safe-area-inset-bottom,0px))!important;
 }
 #portalRoot .portal-sidebar.open{
   display:flex!important;flex-direction:column!important;
   padding:0!important;overflow:hidden!important;
   height:100dvh!important;max-height:100dvh!important;
   box-sizing:border-box!important;
 }
 #portalRoot .portal-sidebar.open .portal-drawer-head,
 #portalRoot .portal-sidebar.open .portal-brand{flex:0 0 auto!important}
 #portalRoot .portal-sidebar.open .portal-nav{
   order:2;display:flex!important;flex:1 1 auto!important;
   min-height:80px!important;max-height:none!important;
   overflow-y:auto!important;overflow-x:hidden!important;
   -webkit-overflow-scrolling:touch;overscroll-behavior:contain;
   padding:8px 13px 10px!important;
 }
 #portalRoot .portal-sidebar.open .portal-nav button{flex:0 0 auto;min-height:43px!important}
 #portalRoot .portal-credit-toggle{
   order:3;display:flex;flex:0 0 auto!important;align-items:center;justify-content:space-between;
   margin:0 13px 6px;padding:10px 12px;
   min-height:42px;max-height:42px;width:calc(100% - 26px);
   border:1px solid #dfe3f3;border-radius:8px;
   background:#f6f6ff;color:#4d52bd;font:750 12px/1.25 system-ui,sans-serif;
   cursor:pointer;
 }
 #portalRoot .portal-credit-chevron{font-size:22px;line-height:1;transition:transform .15s}
 #portalRoot .portal-credit-toggle[aria-expanded="true"] .portal-credit-chevron{transform:rotate(180deg)}
 #portalRoot .portal-sidebar.open .portal-credit-panel{
   display:none!important;position:static!important;order:4;flex:none!important;
   min-height:0!important;max-height:min(160px,24dvh)!important;
   margin:0 13px 8px!important;padding:10px 12px!important;
   overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;
   box-shadow:none!important;
 }
 #portalRoot .portal-sidebar.open .portal-credit-panel.is-open{
   display:flex!important;flex-direction:column!important;
 }
 #portalRoot .portal-sidebar.open .portal-bottom{
   order:5;flex:0 0 auto!important;margin:0 13px!important;
   padding:9px 0 calc(9px + env(safe-area-inset-bottom,0px))!important;
   min-height:0!important;max-height:175px!important;overflow-y:auto!important;
 }
 #portalRoot .portal-sidebar.open .portal-bottom .portal-btn{
   min-height:36px!important;margin-top:6px!important;padding:8px!important;
 }
 #portalRoot .portal-sidebar.open .portal-bottom .portal-identity{padding:7px 9px!important}
 #portalRoot .portal-sidebar.open #portalCreditAvailable{font-size:17px}
 #portalRoot #pAgent:not([hidden]){min-height:0!important}
 #portalRoot #pAgent>.portal-chat-host{
   height:clamp(280px,calc(100dvh - 205px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)),740px)!important;
   min-height:0!important;max-height:none!important;
   margin-bottom:0!important;
 }
 #portalRoot .portal-support-panel{
   top:calc(60px + env(safe-area-inset-top,0px))!important;
   max-height:calc(100dvh - 76px - env(safe-area-inset-top,0px))!important;
 }
 #portalRoot .portal-mobile-head #portalSupportOpen,#portalRoot #portalMenu{
   flex:0 0 43px!important;width:43px!important;height:43px!important;
   min-height:43px!important;min-width:43px!important;
 }
 #portalRoot .portal-mobile-head strong{font-size:clamp(12px,3.7vw,15px)!important}
 #portalRoot :is(.portal-view button,.portal-view input,.portal-view textarea):focus-visible{
   outline:2px solid #6872f5;outline-offset:2px;
 }
}
@media(max-width:760px) and (max-height:600px){
 #portalRoot .portal-sidebar.open .portal-brand{height:55px!important;min-height:55px!important;padding:7px 13px!important}
 #portalRoot .portal-sidebar.open .portal-drawer-head{padding:calc(4px + env(safe-area-inset-top,0px)) 14px 4px!important}
 #portalRoot .portal-sidebar.open .portal-nav{min-height:70px!important}
 #portalRoot .portal-sidebar.open .portal-bottom{max-height:128px!important}
}
@media(prefers-reduced-motion:reduce){#portalRoot .portal-credit-chevron{transition:none}}
