/* Shared layout for student/admin screens. Legacy inline grids are explicitly marked. */
.is-portal *, .is-portal *::before, .is-portal *::after { box-sizing:border-box; }
.is-portal main, .is-portal .wrap { min-width:0; }
.is-portal input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.is-portal select, .is-portal textarea { max-width:100%; min-width:0; font:inherit; }
.is-portal textarea { resize:vertical; }
.is-portal .form-control { border:1px solid #a8b5ad; border-radius:10px; padding:.65rem .75rem; background:#fff; color:#26362e; }
.is-portal fieldset { min-width:0; }
.is-portal :focus-visible { outline:3px solid #315b91; outline-offset:3px; }
.portal-table-scroll { max-width:100%; overflow:auto; overscroll-behavior-x:contain; }
.is-portal .subnav { flex-wrap:wrap; overflow:visible; }
.is-portal .subnav .menu-toggle { display:none; }
.portal-dialog-open { overflow:hidden; }
#classModal, #studentClassModal { overscroll-behavior:contain; }
#classModal div, #studentClassModal div { min-width:0; overflow-wrap:anywhere; }
#classModal > div:first-child, #studentClassModal > div:first-child { position:sticky; top:0; background:#fff; z-index:2; }
#closeClassModal, #closeStudentClassModal { min-width:44px; min-height:44px; flex-shrink:0; }
#modalStudents a { display:inline-flex; align-items:center; min-height:44px; padding:.35rem .5rem; border:1px solid #c9d8cf; border-radius:8px; color:#315a48; text-decoration:none; }
@media(max-width:960px) {
  .sh-header .sh-header__wrap { position:relative; padding:.6rem .8rem; gap:.5rem; flex-wrap:wrap; }
  .sh-header .sh-logo img, .sh-header.is-scrolled .sh-logo img { height:56px; width:auto; max-width:100%; }
  .sh-header .sh-logo { min-width:0; flex:1; }
  .sh-header .sh-nav__toggle { min-width:44px; min-height:44px; }
  .sh-header .sh-nav { position:absolute; top:100%; max-height:calc(100dvh - 80px); overflow-y:auto; }
  .sh-header .sh-nav .nav-link { display:flex; align-items:center; min-height:44px; }
  .sh-header .sh-actions { flex-wrap:wrap; justify-content:flex-end; min-width:0; }
  .sh-header .sh-actions a { min-height:44px; display:inline-flex; align-items:center; overflow-wrap:anywhere; }
  .aiMain, #aiInput { min-width:0; }
  #aiOverlay { height:100dvh; }
  #aiForm button { padding:0 1rem; }
}
@media(max-width:767px) {
  .is-portal .sh-header { position:relative; transform:none; }
  .is-portal main, .is-portal .wrap { width:100%; max-width:100%; padding:0 1rem !important; margin:1rem auto 2rem !important; }
  .is-portal main main { padding:0 !important; }
  .is-portal h1 { font-size:1.65rem; line-height:1.2; overflow-wrap:anywhere; }
  .is-portal h2 { font-size:1.3rem; line-height:1.3; overflow-wrap:anywhere; }
  .is-portal p, .is-portal dd, .is-portal label, .is-portal td { overflow-wrap:anywhere; }
  .is-portal .portal-stack { grid-template-columns:minmax(0,1fr) !important; }
  .is-portal .portal-stack > * { min-width:0; grid-column:1 / -1 !important; }
  .is-portal .portal-week-strip { display:flex !important; overflow-x:auto; gap:.5rem; padding-bottom:.5rem; }
  .is-portal .portal-week-strip > * { flex:0 0 76px; }
  .is-portal form { min-width:0 !important; max-width:100%; }
  .is-portal form > div, .is-portal form > label { min-width:0 !important; max-width:100%; }
  .is-portal input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .is-portal select, .is-portal textarea { width:100%; min-width:0 !important; font-size:16px !important; min-height:44px; }
  .is-portal input[type=checkbox], .is-portal input[type=radio] { width:20px; height:20px; vertical-align:middle; flex-shrink:0; }
  .is-portal button, .is-portal .btn, .is-portal [class^=btn-], .is-portal .pill { min-height:44px; max-width:100%; white-space:normal; line-height:1.4; }
  .is-portal form[method=get], .is-portal form[method="GET"] { flex-wrap:wrap; }
  .is-portal .subnav { position:relative; display:flex; flex-wrap:wrap; gap:.5rem; width:100%; margin:0 0 1rem; padding:.75rem 1rem; }
  .is-portal .subnav > .pill { flex:1 1 140px; margin:0; justify-content:center; }
  .is-portal .subnav.portal-nav-ready .menu-toggle { display:flex; position:static; flex:1 0 100%; align-items:center; justify-content:space-between; padding:.65rem .9rem; font:inherit; color:#263e33; }
  .is-portal .subnav.portal-nav-ready:not(.is-open) > .pill { display:none; }
  .is-portal .portal-table-scroll { overflow:visible; max-height:none !important; }
  .is-portal table:not(.portal-cards) { display:block; max-width:100%; min-width:0 !important; overflow-x:auto; }
  .is-portal table.portal-cards { display:block; width:100%; min-width:0 !important; border:0; }
  .is-portal .portal-cards thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .is-portal .portal-cards tbody { display:block; }
  .is-portal .portal-cards tbody > tr { display:block; margin:.8rem 0; padding:.6rem; border:1px solid #d9e2dc !important; border-radius:12px; background:#fff; }
  .is-portal .portal-cards tbody > tr > td { display:grid; grid-template-columns:minmax(0,1fr); gap:.2rem; width:100%; min-width:0 !important; padding:.5rem !important; text-align:left !important; white-space:normal !important; border:0; }
  .is-portal .portal-cards td::before { content:attr(data-label); color:#53645b; font-size:.85rem; font-weight:700; }
  .is-portal .portal-cards td[colspan]::before { content:none; }
  .is-portal .portal-cards td > form { margin:.25rem 0; }
  .is-portal .portal-cards td > a { display:inline-flex; align-items:center; min-height:44px; justify-self:start; margin:.2rem 0; }
  .is-portal .card { min-width:0; padding:1rem; }
  .is-portal .reg-form, .is-portal .reg-side { padding:1rem; min-width:0; }
  .is-portal main > section > a[class*=btn-] { margin:.25rem .25rem .25rem 0; }
  .is-portal .pricing-matrix__sets { min-width:0; }
  .is-portal .pricing-v2__grid { grid-template-columns:minmax(0,1fr) !important; }
  .is-portal .price-card__cta { flex-wrap:wrap; }
  #classModal, #studentClassModal { top: max(.5rem, env(safe-area-inset-top)) !important; left:.5rem !important; transform:none !important; width:calc(100% - 1rem) !important; max-height:calc(100vh - 1rem) !important; max-height:calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; }
  #classModal a, #studentClassModal a { white-space:normal; overflow-wrap:anywhere; }
  .is-portal .footer-bottom { padding:1rem; overflow-wrap:anywhere; }
}
@media(max-width:380px) {
  .is-portal .week-nav { position:static; }
  .is-portal .week-controls { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .is-portal .week-controls a:nth-child(4) { grid-column:1 / -1; }
}
