/* Platform-wide text balance: no orphan word on its own line in titles, buttons and descriptions; card buttons centered. Exam/question content is not targeted. */
h1,h2,h3,h4,h5{text-wrap:balance}
button,[role=button],.card-elevate,summary{text-wrap:balance}
p,li,figcaption,td{text-wrap:pretty}
button.card-elevate{text-align:center;align-items:center}
button.card-elevate>div,button.card-elevate>span{text-align:center}
.q-text,.question-text,[data-qtext]{text-wrap:wrap}
/* Student "choose your track" page: equal cards, 3 per row on desktop, 2 centered, stacked on mobile */
.nb-trackgrid{display:flex!important;flex-wrap:wrap;justify-content:center;gap:24px!important;align-items:stretch;max-width:1190px;margin:16px auto 48px!important;padding:0 24px}
.nb-trackgrid>button{flex:0 1 360px;width:360px;max-width:100%;min-height:232px;padding:24px!important;border-radius:20px!important;justify-content:flex-start!important;gap:12px;box-shadow:0 1px 2px rgba(15,30,61,.08)}
.nb-trackgrid>button:hover{box-shadow:0 8px 18px rgba(15,30,61,.14)}
.nb-trackgrid>button>div{gap:10px}
.nb-trackgrid>button p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:13.5px}
.nb-trackgrid>button>span{margin-top:auto;font-size:14px}
.nb-trackgrid h3{font-size:clamp(14px,4vw,18px)!important;white-space:nowrap;margin-bottom:0}
button.card-elevate>div{display:flex;flex-direction:column;align-items:center;text-align:center}
.nb-trackgrid>button,[id^=gate-]{border:2px solid rgba(200,155,60,.55)!important}
.nb-trackgrid>button:hover,[id^=gate-]:hover{border-color:rgba(200,155,60,.9)!important}
.nb-trackgrid>button>span:last-child,[id^=gate-]>span:last-child{color:#a87f29!important;font-weight:900}
/* Centered cards platform-wide */
button.text-right.rounded-3xl,button.card-elevate{text-align:center!important}
button.text-right.rounded-3xl>div,button.card-elevate>div{align-items:center;text-align:center}
button.text-right.rounded-3xl p,button.card-elevate p{text-align:center}
.nb-subjcard h4,.nb-subjcard p,.nb-subjcard>div{text-align:center}
.nb-subjcard>button{margin-top:auto}
.portal-card{text-align:center}
.portal-card .flex.items-start.justify-between{justify-content:center}
.portal-card .flex.items-start.justify-between>.flex.items-center.gap-3{flex-direction:column;text-align:center}
.portal-card .flex-wrap.gap-1\.5{justify-content:center}
.portal-card h3{text-wrap:balance}
/* Centered portal/hub hero blocks */
.hero-pattern{text-align:center}
.hero-pattern>div:first-child{flex-direction:column!important;align-items:center!important;justify-content:center}
.hero-pattern>div:first-child>div{align-items:center;text-align:center;margin-inline:auto}
.hero-pattern>div:first-child .flex-wrap{justify-content:center}
.hero-pattern h1,.hero-pattern p{text-align:center;margin-inline:auto}
.hero-pattern .grid>div{text-align:center;align-items:center}
.hero-pattern .grid>div>.flex.items-center.justify-between{justify-content:center;gap:12px;flex-wrap:wrap}
.hero-pattern .grid>div .flex.items-baseline{justify-content:center}
/* Section titles, engine heroes */
#view-student h3.text-xl{text-align:center}
section:has(#summary-title){flex-direction:column!important;align-items:center!important;text-align:center}
section:has(#summary-title)>div{justify-content:center!important;text-align:center;width:100%}
section:has(#summary-title) .flex.items-start{flex-direction:column;align-items:center}
section:has(#summary-title) h1,section:has(#summary-title) p{text-align:center}
#view-student div.text-sm.font-black.text-navy-900.mb-4{text-align:center}
/* Teacher/admin entry: separate from the grade filter strip */
#filter-admin-wrap #filter-admin{flex:0 0 auto!important;min-width:0!important;border:1.5px solid rgba(200,155,60,.7);background:#fff;padding:8px 18px!important;border-radius:999px!important;font-size:12px!important;color:#0f1e3d}
#filter-admin-wrap #filter-admin:hover{background:#0f1e3d;color:#e7c866}
#grade-filter-nav.hidden+#filter-admin-wrap{display:none!important}
/* Compact portal/hub heroes */
.hero-pattern{padding:18px 22px!important;gap:14px!important}
.hero-pattern>*+*{margin-top:0!important}
.hero-pattern h1{font-size:clamp(20px,2.4vw,28px)!important;line-height:1.35!important;margin:0!important}
.hero-pattern p{font-size:13px!important;line-height:1.6!important}
.hero-pattern .grid{gap:10px!important}
.hero-pattern .grid>div{padding:10px 12px!important;gap:4px!important}
.hero-pattern .grid .text-2xl,.hero-pattern .grid .text-3xl{font-size:22px!important;line-height:1.2}
.hero-pattern>div:first-child{gap:10px!important}
.hero-pattern>div:first-child>div.space-y-3>*{margin-top:6px!important;margin-bottom:0!important}
/* Hero live-refresh: small icon button on the left */
.hero-pattern{position:relative}
.hero-pattern .nb-refresh-icon{position:absolute;top:14px;left:14px;width:38px;height:38px;padding:0!important;justify-content:center;border-radius:12px!important}
.hero-pattern .nb-refresh-icon>span:last-child{display:none}
.nb-home-btn{text-decoration:none}
.nb-home-btn{padding:8px 11px!important;gap:0!important}
/* Centered footers on inner pages */
footer:not(#contact-footer){text-align:center!important}
footer:not(#contact-footer)>div{flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important}
footer:not(#contact-footer) p,footer:not(#contact-footer) div{text-align:center}
