﻿/* PHASE 8C FIX2 — Mobile polish */

/* Native mobile portal menu: no JS race, one tap only */
.tl8d-portal-bar{
  min-height:62px;
  display:flex;
  align-items:center;
  gap:1rem;
  padding-top:.45rem;
  padding-bottom:.45rem
}
.tl8d-portal-brand{display:flex;align-items:center;gap:.5rem;flex:0 0 auto}
.tl8d-desktop-menu{display:flex;align-items:center;gap:1rem;flex:1 1 auto;min-width:0}
.tl8d-desktop-links{display:flex;align-items:center;gap:.25rem;flex:1 1 auto}
.tl8d-desktop-account{display:flex;align-items:center;gap:.55rem;flex:0 0 auto}
.tl8d-mobile-menu{display:none;margin-inline-start:auto;position:relative}
.tl8d-mobile-menu summary{
  list-style:none;cursor:pointer;width:42px;height:42px;
  border:1px solid var(--tl-border);border-radius:12px;background:#fff;
  color:var(--tl-green);display:grid;place-items:center;font-size:1.25rem;
  user-select:none;-webkit-tap-highlight-color:transparent
}
.tl8d-mobile-menu summary::-webkit-details-marker{display:none}
.tl8d-menu-close{display:none}
.tl8d-mobile-menu[open] .tl8d-menu-open{display:none}
.tl8d-mobile-menu[open] .tl8d-menu-close{display:inline}
.tl8d-mobile-panel{
  position:absolute;top:calc(100% + 8px);left:0;width:min(300px,88vw);
  background:#fff;border:1px solid var(--tl-border);border-radius:16px;
  box-shadow:0 18px 45px rgba(10,35,28,.16);padding:.75rem;z-index:1080
}
.tl8d-mobile-links{display:grid;grid-template-columns:1fr 1fr;gap:.45rem}
.tl8d-mobile-links a{
  text-decoration:none;text-align:center;padding:.65rem .5rem;border-radius:11px;
  border:1px solid var(--tl-border);color:var(--tl-navy);font-weight:700
}
.tl8d-mobile-links a.active{background:#f8edc6;color:var(--tl-navy);border-color:#f4df91}
.tl8d-mobile-account{
  display:grid;grid-template-columns:auto 1fr;align-items:center;gap:.5rem;
  margin-top:.7rem;padding-top:.7rem;border-top:1px solid var(--tl-border)
}
.tl8d-mobile-account form{margin:0}

/* Login on phone/tablet: simple, focused screen */
.tl8d-auth-mobile-brand{
  align-items:center;justify-content:center;gap:.55rem;
  margin-bottom:1rem;color:var(--tl-navy)
}
.tl8d-auth-mobile-brand .tl-brand-logo{max-height:52px}
.tl8d-auth-mobile-brand span{display:grid}
.tl8d-auth-mobile-brand small{font-size:.62rem;letter-spacing:.18em;color:var(--tl-gold)}
@media(max-width:991.98px){
  .tl8d-desktop-menu{display:none}
  .tl8d-mobile-menu{display:block}
  .tl-auth-layout{display:block!important;min-height:100dvh!important;background:#f7faf8!important}
  .tl-auth-visual{display:none!important}
  .tl-auth-content{
    min-height:100dvh!important;width:100%!important;max-width:none!important;
    padding:clamp(1rem,5vw,2rem)!important;
    display:flex!important;flex-direction:column!important;justify-content:center!important;
    align-items:center!important
  }
  .tl-auth-card{
    width:min(100%,440px)!important;max-width:440px!important;
    padding:1.25rem!important;border-radius:20px!important
  }
}
@media(max-width:575.98px){
  .tl8d-portal-bar{min-height:56px;padding-inline:.7rem!important}
  .tl8d-portal-brand .tl-brand-logo{max-height:36px!important}
  .tl8d-mobile-links{grid-template-columns:1fr}
  .tl8d-mobile-panel{position:fixed;top:64px;left:.5rem;right:.5rem;width:auto}
  .tl-auth-content{padding:1rem!important;justify-content:flex-start!important;padding-top:8vh!important}
  .tl-auth-card{padding:1rem!important;border-radius:18px!important}
  .tl-auth-title{font-size:1.45rem!important}
  .tl-auth-subtitle{font-size:.86rem!important;line-height:1.7!important}
}

/* Student Today cards: denser, subject + time + status */
.tl8d-today-class{
  grid-template-columns:minmax(90px,.8fr) minmax(120px,1.4fr) auto!important;
  gap:.65rem!important;
  min-height:0!important;
  padding:.85rem 1rem!important;
  align-items:center!important
}
.tl8d-today-class>div:nth-child(4){grid-column:1/-1}
.tl8d-today-class .fs-5{font-size:1rem!important}
.tl8d-today-class .badge{white-space:nowrap}
@media(max-width:575.98px){
  .tl8d-today-class{
    display:grid!important;
    grid-template-columns:88px 1fr auto!important;
    gap:.35rem .55rem!important;
    padding:.75rem!important;border-radius:15px!important
  }
  .tl8d-today-class .tl-today-class-time{
    font-size:.78rem!important;font-weight:800!important;align-self:center
  }
  .tl8d-today-class>div:nth-child(2){min-width:0}
  .tl8d-today-class>div:nth-child(2) .fw-bold{
    font-size:.92rem!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
  }
  .tl8d-today-class>div:nth-child(3){
    justify-self:start;align-self:center
  }
  .tl8d-today-class>div:nth-child(3) .badge{font-size:.65rem!important;padding:.3rem .45rem!important}
  .tl8d-today-class>div:nth-child(4){
    grid-column:1/-1!important
  }
  .tl8d-today-class>div:nth-child(4) .btn{width:100%}
}

/* Absolute horizontal-overflow safety for portal pages */
.tl-portal,.tl-portal-body,.tl8d-portal-bar{max-width:100vw;overflow-x:clip}
.tl-portal-body>.container-xl{max-width:100%;overflow-x:hidden}
