/* ============================================================
   ANDISHEH R32.71.5 — FINAL READABILITY & TYPOGRAPHY PASS
   Purpose: contrast, proportional type, collision prevention.
   Scope: visual/text only. No layout/business logic changes.
   ============================================================ */
:root{
  --r32715-ink:#17384d;
  --r32715-ink-strong:#0d2d43;
  --r32715-muted:#557184;
  --r32715-muted-2:#6a8292;
  --r32715-light:#f8fbfd;
  --r32715-light-muted:#d3e3ec;
  --r32715-line:#d8e4eb;
}

/* ---------- type geometry: prevent collisions without changing site architecture ---------- */
html[dir="rtl"] body{
  text-rendering:optimizeLegibility!important;
  -webkit-font-smoothing:antialiased;
  font-kerning:normal;
}
html[dir="rtl"] body :where(h1,h2,h3,h4,h5,h6){
  line-height:1.45!important;
  overflow-wrap:break-word;
  word-break:normal;
  margin-block-start:0;
}
html[dir="rtl"] body :where(p,label,small,li,td,th){
  line-height:1.72!important;
  overflow-wrap:break-word;
  word-break:normal;
}
html[dir="rtl"] body :where(.panel-head,.topbar,.top-actions,.parent-actions,.executive-top,.executive-top-actions,.r3271-title,.r3271-grid,.r3253-pta-grid,.r32711-candidate-body,.r3269-election-layout,.r3268-card-head,.r3268-event-head)>*{
  min-width:0!important;
}

/* ---------- controls: text must fit its box ---------- */
html[dir="rtl"] body :where(button,.btn,.r3268-btn,.r3250-role-btn,.top-action-card,.quick-open,.icon-btn){
  line-height:1.45!important;
  text-align:center;
  max-width:100%;
}
html[dir="rtl"] body :where(button,.btn,.r3268-btn,.r3250-role-btn,.top-action-card){
  min-height:40px;
  padding-block:8px;
}
html[dir="rtl"] body :where(input,select,textarea){
  font-size:14px!important;
  line-height:1.55!important;
}
html[dir="rtl"] body label{
  font-size:13px!important;
  line-height:1.7!important;
}

/* ---------- light surfaces: guaranteed dark readable copy ---------- */
body :where(.panel,.r3271-tile,.r3271-welcome-main,.r3271-news-item,.r3268-card,.r3268-event,.r3268-option,.r3253-candidate,.r32711-home-candidates,.r3269-candidate,.guidance-manager-card,.r8-account-row){
  color:var(--r32715-ink)!important;
}
body :where(.panel,.r3271-tile,.r3271-welcome-main,.r3271-news-item,.r3268-card,.r3268-event,.r3268-option,.r3253-candidate,.r32711-home-candidates,.r3269-candidate,.guidance-manager-card,.r8-account-row)
:is(h1,h2,h3,h4,h5,h6,b,strong,label){
  color:var(--r32715-ink-strong)!important;
  -webkit-text-fill-color:var(--r32715-ink-strong)!important;
  opacity:1!important;
}
body :where(.panel,.r3271-tile,.r3271-welcome-main,.r3271-news-item,.r3268-card,.r3268-event,.r3268-option,.r3253-candidate,.r32711-home-candidates,.r3269-candidate,.guidance-manager-card,.r8-account-row)
:is(p,small,.hint,.muted){
  color:var(--r32715-muted)!important;
  -webkit-text-fill-color:var(--r32715-muted)!important;
  opacity:1!important;
}

/* ---------- dark surfaces: guaranteed light readable copy ---------- */
body :where(.sidebar,.login-story,.auth-brand,.student-login-visual,.r3268-topbar,.r3268-hero,.r3269-vote-dock,.r32711-home-vote-card,.r3268-home-entry){
  color:var(--r32715-light)!important;
}
body :where(.sidebar,.login-story,.auth-brand,.student-login-visual,.r3268-topbar,.r3268-hero,.r3269-vote-dock,.r32711-home-vote-card,.r3268-home-entry)
:is(h1,h2,h3,h4,h5,h6,b,strong,label){
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  opacity:1!important;
}
body :where(.sidebar,.login-story,.auth-brand,.student-login-visual,.r3268-topbar,.r3268-hero,.r3269-vote-dock,.r32711-home-vote-card,.r3268-home-entry)
:is(p,small,.hint,.muted){
  color:var(--r32715-light-muted)!important;
  -webkit-text-fill-color:var(--r32715-light-muted)!important;
  opacity:1!important;
}

/* ---------- public home right dashboard ---------- */
body.r319-root-home .r303-brand-lockup b{font-size:15px!important;line-height:1.45!important;color:#11364f!important}
body.r319-root-home .r303-brand-lockup small{font-size:10.5px!important;line-height:1.55!important;color:#537083!important;opacity:1!important}
body.r319-root-home .r319-home-nav a{
  min-height:48px!important;
  font-size:13px!important;
  line-height:1.55!important;
  gap:9px!important;
  white-space:normal!important;
}
body.r319-root-home .r319-home-nav a>span:not(.ico){
  min-width:0!important;
  white-space:normal!important;
  overflow-wrap:break-word!important;
}
body.r319-root-home .r319-home-nav .ico{flex:0 0 auto!important}

/* ---------- public role cards ---------- */
body.r319-root-home .r21p5-role-card h3{
  font-size:14px!important;
  line-height:1.45!important;
  color:#f9fcff!important;
  -webkit-text-fill-color:#f9fcff!important;
  margin:9px 10px 3px!important;
}
body.r319-root-home .r21p5-role-card p{
  font-size:10.5px!important;
  line-height:1.65!important;
  color:#d6e5ed!important;
  -webkit-text-fill-color:#d6e5ed!important;
  opacity:1!important;
  margin:0 10px 8px!important;
}
body.r319-root-home .r21p5-role-card>span{
  color:#f0bf55!important;
  -webkit-text-fill-color:#f0bf55!important;
  font-size:16px!important;
}
body.r319-root-home .r3250-role-btn{
  font-size:11.5px!important;
  line-height:1.45!important;
  white-space:normal!important;
}

/* ---------- candidates below panels: readable but still compact ---------- */
body.r319-root-home .r32711-home-candidates .r3253-pta-head small{
  font-size:9px!important;
  color:#157e6c!important;
  -webkit-text-fill-color:#157e6c!important;
  font-weight:800!important;
}
body.r319-root-home .r32711-home-candidates .r3253-pta-head h2{
  font-size:15px!important;
  color:#12384f!important;
  -webkit-text-fill-color:#12384f!important;
}
body.r319-root-home .r32711-home-candidates .r3253-pta-status{
  font-size:9px!important;
  color:#156c5b!important;
  -webkit-text-fill-color:#156c5b!important;
  white-space:nowrap!important;
}
body.r319-root-home .r32711-home-candidates .r3253-candidate-copy b{
  font-size:12.5px!important;
  line-height:1.45!important;
  color:#15384e!important;
  -webkit-text-fill-color:#15384e!important;
}
body.r319-root-home .r32711-home-candidates .r3253-candidate-copy span{
  font-size:9.5px!important;
  line-height:1.5!important;
  color:#536f80!important;
  -webkit-text-fill-color:#536f80!important;
}
body.r319-root-home .r32711-home-candidates .r3253-candidate-copy p{
  font-size:9px!important;
  line-height:1.55!important;
  color:#637b8a!important;
  -webkit-text-fill-color:#637b8a!important;
}
body.r319-root-home .r32711-home-candidates .r3253-pta-foot{
  font-size:8.5px!important;
  color:#617a89!important;
  -webkit-text-fill-color:#617a89!important;
}
body.r319-root-home .r32711-home-vote-copy h3{
  font-size:13px!important;
  line-height:1.5!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
body.r319-root-home .r32711-home-vote-copy :is(p,small,li){
  font-size:8.5px!important;
  line-height:1.55!important;
  color:#d8e8ee!important;
  -webkit-text-fill-color:#d8e8ee!important;
}
body.r319-root-home .r32711-home-vote-copy a{
  font-size:9.5px!important;
  line-height:1.45!important;
  color:#173547!important;
  -webkit-text-fill-color:#173547!important;
  font-weight:900!important;
}

/* ---------- unified dashboard hub ---------- */
.r3271-welcome-main small{font-size:11.5px!important;color:#627c8d!important}
.r3271-welcome-main h1{font-size:clamp(22px,2.2vw,27px)!important;line-height:1.45!important}
.r3271-welcome-main p{font-size:12.5px!important;line-height:1.75!important;color:#536f80!important}
.r3271-status-card b{font-size:17px!important;line-height:1.45!important}
.r3271-status-card span{font-size:11.5px!important;line-height:1.65!important;color:#d7e9e4!important}
.r3271-title h2{font-size:20px!important;line-height:1.45!important}
.r3271-title span{font-size:11px!important;line-height:1.6!important;color:#5f7889!important}
.r3271-tile b{font-size:15px!important;line-height:1.5!important;color:#15384e!important}
.r3271-tile small{font-size:11px!important;line-height:1.65!important;color:#60798a!important}
.r3271-news-item b{font-size:14px!important;line-height:1.55!important}
.r3271-news-item p{font-size:12px!important;line-height:1.72!important}
.r3271-news-item small{font-size:10.5px!important;line-height:1.55!important;color:#6c8392!important}
.r3271-backbar{font-size:13px!important;line-height:1.55!important}
.r3271-backbar button{font-size:12.5px!important}
.r3271-manager-strip a{font-size:13px!important;line-height:1.55!important}

/* ---------- manager / executive / parent / student dashboard typography ---------- */
.side-nav button{
  font-size:13.5px!important;
  line-height:1.55!important;
  min-height:43px!important;
  white-space:normal!important;
}
.nav-section-label{font-size:10.5px!important;line-height:1.55!important;color:#bcd2df!important;opacity:1!important}
.top-context h2{font-size:18px!important;line-height:1.45!important}
.top-context .eyebrow,.panel-head .eyebrow,.eyebrow{font-size:10.5px!important;line-height:1.55!important}
.page .panel h2,.page .panel h3,.parent-main .panel h2,.student-plan .panel h2,.executive-main .panel h2{
  font-size:17px!important;
  line-height:1.5!important;
}
.page .panel :is(p,.hint,small),.parent-main .panel :is(p,.hint,small),.student-plan .panel :is(p,.hint,small),.executive-main .panel :is(p,.hint,small){
  font-size:12px!important;
  line-height:1.72!important;
}
.soft-pill,.role-chip,.sync-status,.status-label{font-size:10.5px!important;line-height:1.45!important}
.kpi-grid b,.student-kpis b{line-height:1.35!important}
.kpi-grid small,.student-kpis small{font-size:10.5px!important;line-height:1.55!important}
.manager-quick :is(b,strong){font-size:13px!important;line-height:1.5!important}
.manager-quick :is(small,p){font-size:10.5px!important;line-height:1.65!important}

/* ---------- participation / PTA ---------- */
.r3268-brand b{font-size:15.5px!important}.r3268-brand span{font-size:11.5px!important;line-height:1.55!important}
.r3268-btn{font-size:12.5px!important;line-height:1.45!important}
.r3268-card-head h2{font-size:18px!important;line-height:1.5!important}
.r3268-card-head span{font-size:11.5px!important;line-height:1.55!important;color:#647d8d!important}
.r3268-form label{font-size:12.5px!important;line-height:1.65!important}
.r3268-list-item b{font-size:13px!important;line-height:1.55!important}
.r3268-list-item :is(small,p){font-size:11.5px!important;line-height:1.7!important}
.r3268-event h2{font-size:20px!important;line-height:1.45!important}
.r3268-event p{font-size:12.5px!important;line-height:1.72!important;color:#536f80!important}
.r3268-badge{font-size:11px!important;line-height:1.45!important}
.r3269-candidate :is(b,strong){font-size:13px!important;line-height:1.5!important;color:#15384e!important}
.r3269-candidate :is(p,small,span){line-height:1.65!important}
.r3269-vote-dock h3{font-size:18px!important;line-height:1.45!important;color:#fff!important}
.r3269-vote-dock :is(p,small,li,span){line-height:1.65!important}

/* ---------- tables and dense utility areas ---------- */
body table{font-size:12.5px!important}
body :where(td,th){line-height:1.6!important;padding-block:8px}
.empty-state{font-size:12px!important;line-height:1.7!important;color:#5c7484!important}
.toast,.r3268-toast{font-size:12.5px!important;line-height:1.6!important}

/* ---------- mobile: keep readable without reflow collisions ---------- */
@media(max-width:700px){
  html[dir="rtl"] body :where(button,.btn,.r3268-btn,.r3250-role-btn){font-size:12px!important}
  body.r319-root-home .r319-home-nav a{font-size:12px!important;min-height:44px!important}
  body.r319-root-home .r21p5-role-card h3{font-size:13px!important}
  body.r319-root-home .r21p5-role-card p{font-size:10px!important}
  .r3271-tile b{font-size:13px!important}.r3271-tile small{font-size:10px!important}
  .page .panel h2,.page .panel h3,.parent-main .panel h2,.student-plan .panel h2,.executive-main .panel h2{font-size:16px!important}
  body :where(input,select,textarea){font-size:16px!important}
}
