/* محاكاة قسم — page styles on top of ../kit.css and sim.css (09-kufi: radius 0, tone steps, red = the run action only).
   All colours are kit tokens, so light and dark follow the theme button. Text colours are solid (no alpha). */
.sim-hero h1{ max-width:22ch; }
.chain{ list-style:none; margin:24px 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:4px; counter-reset:c; }
.chain li{ background:var(--paper-2); padding:14px 16px; display:grid; gap:4px; counter-increment:c; }
.chain li b{ font:800 18px/1.4 var(--f-display); }
.chain li b::before{ content:counter(c) " · "; }
.chain li span{ font-size:15px; color:var(--ink-2); line-height:1.5; }
.chain code, .limits code{ font:600 14px/1.4 ui-monospace, Menlo, monospace; }

/* policies */
.pol-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:8px; }
.pol{ display:flex; flex-direction:column; align-items:flex-start; gap:8px; min-height:120px; padding:18px 20px; border:0; background:var(--paper); color:var(--ink); text-align:start; cursor:pointer; font:400 var(--t-note)/1.55 var(--f-text); transition:background .15s var(--ease); }
.pol b{ font:800 19px/1.4 var(--f-display); }
.pol span{ color:var(--ink-2); }
.pol:hover{ background:var(--paper-3); }
.pol[aria-pressed="true"]{ background:var(--ink); color:var(--paper); }
.pol[aria-pressed="true"] span{ color:var(--paper); }
.pol:focus-visible, .pupil:focus-visible, .vid:focus-visible{ outline:3px solid var(--action, #1739A8); outline-offset:2px; }
.knob .seed{ width:100%; min-height:48px; padding:8px 12px; border:0; background:var(--paper-2); color:var(--ink); font:700 19px/1.2 var(--f-text); border-radius:0; }

/* results table: one column per policy, the selected one in ink */
.res-meta{ margin:0 0 12px; color:var(--ink-2); font-size:var(--t-note); line-height:1.7; }
.res-meta .tag-sim{ min-height:26px; font-size:13px; margin-inline-end:6px; }
.res-tbl{ min-width:760px; }
.res-tbl th[scope="row"]{ white-space:normal; font:600 16px/1.45 var(--f-text); color:var(--ink); background:var(--paper-2); padding:12px 16px; min-width:220px; }
.res-tbl th[scope="row"] small{ display:block; margin-top:2px; font-size:14px; color:var(--ink-2); font-weight:400; }
.res-tbl tr.grp th{ background:transparent; padding:18px 4px 4px; font:800 18px/1.3 var(--f-display); color:var(--ink); }
.res-tbl td, #fair td{ text-align:center; padding:10px 12px; }
.res-tbl td .v, #fair td .v{ display:block; font:800 22px/1.2 var(--f-display); direction:ltr; }
.res-tbl td .b{ display:block; font-size:14px; color:var(--ink-2); direction:ltr; white-space:nowrap; }
.tbl th.pc{ text-align:center; }
.tbl th.pc.on{ background:var(--ink); color:var(--paper); }
.tbl td.on{ background:var(--paper-3); }
.tbl tbody tr:hover td.on{ background:var(--paper-3); }
#fair{ min-width:640px; }
#fair th[scope="row"]{ white-space:normal; font:600 16px/1.45 var(--f-text); color:var(--ink); background:var(--paper-2); padding:12px 16px; }
#fair td .v{ font-size:19px; }
.cap{ font-size:15px; color:var(--ink-2); line-height:1.7; margin-top:10px; max-width:80ch; }

.panel2{ margin-top:32px; background:var(--paper-2); padding:clamp(16px,2.4vw,28px); }
.panel2 h3{ font-size:clamp(19px,1.6vw,23px); margin-bottom:12px; }
.panel2 .tbl td{ background:var(--paper); }
.panel2 .tbl td.on{ background:var(--paper-3); }
.panel2 #fair th[scope="row"]{ background:var(--paper); }
.legend2{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-bottom:6px; font-size:15px; color:var(--ink-2); }
.legend2 span{ display:inline-flex; align-items:center; gap:8px; }
.legend2 svg{ width:26px; height:14px; flex:none; }
.chart2 svg{ display:block; width:100%; height:auto; font-family:var(--f-text); }
.chart2 text{ fill:var(--ink-2); font-size:13px; }
.chart2 .t-strong{ fill:var(--ink); font-weight:700; font-size:12px; }
.chart2 .exam{ fill:var(--ink); font-weight:700; }
.chart2 .grid{ stroke:var(--paper-3); stroke-width:1; }
.chart2 .vac{ fill:var(--paper); }
.chart2 .term{ stroke:var(--ink-3); stroke-width:1; stroke-dasharray:3 3; }
.band-s{ fill:var(--paper-3); }
.band-b{ fill:var(--paper); }
.line-s{ fill:none; stroke:var(--ink); stroke-width:3; }
.line-b{ fill:none; stroke:var(--ink-3); stroke-width:2; stroke-dasharray:6 4; }
.kpi-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:4px; }
.kpi2{ background:var(--paper); padding:16px 18px; display:grid; gap:4px; }
.kpi2 .v{ font:800 34px/1.1 var(--f-display); }
.kpi2 .l{ font:700 16px/1.4 var(--f-text); }
.kpi2 .d{ font-size:14px; color:var(--ink-2); line-height:1.5; }

/* the class */
.cls-leg{ display:flex; flex-wrap:wrap; gap:8px 20px; margin:12px 0; font-size:15px; color:var(--ink-2); }
.cls-leg span{ display:inline-flex; align-items:center; gap:8px; }
.cls-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:4px; }
.pupil{ display:grid; justify-items:start; gap:8px; min-height:104px; padding:12px 14px; border:0; background:var(--paper); color:var(--ink); cursor:pointer; text-align:start; font:400 15px/1.3 var(--f-text); }
.pupil:hover{ background:var(--paper-3); }
.pupil b{ font:800 18px/1.2 var(--f-display); }
.pupil .nohelp{ color:var(--ink-2); }
.dots{ display:flex; gap:6px; }
.dot{ display:inline-block; width:16px; height:16px; border-radius:999px; box-sizing:border-box; flex:none; }
.dot.hi{ background:var(--green); }
.dot.mid{ background:var(--paper); box-shadow:inset 0 0 0 3px var(--amber); }
.dot.lo{ background:var(--amber); }

/* assumptions */
.assume dl{ display:grid; gap:4px; margin:0; }
.assume dl > div{ background:var(--paper-2); padding:14px 18px; display:grid; grid-template-columns:minmax(140px,220px) 1fr; gap:6px 18px; }
.assume dt{ font:700 17px/1.5 var(--f-text); }
.assume dd{ margin:0; color:var(--ink-2); line-height:1.65; }
@media (max-width:640px){ .assume dl > div{ grid-template-columns:1fr; } }
.limits{ margin:20px 0 0; padding-inline-start:20px; display:grid; gap:8px; max-width:80ch; color:var(--ink-2); line-height:1.7; }
.links{ display:flex; flex-wrap:wrap; gap:8px; margin-top:28px; }

/* profile sheet */
.pupil-sheet{ padding-top:0; }
.sheet-top{ position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; gap:12px; background:var(--paper); padding:16px 0 12px; }
.sheet-top h2{ font-size:var(--t-mid); }
.sheet-sub{ margin-top:10px; color:var(--ink-2); font-size:15px; line-height:1.6; }
.pupil-sheet h3{ display:flex; align-items:center; gap:10px; margin-top:24px; font-size:19px; }
.pupil-sheet h3 .n{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; background:var(--ink); color:var(--paper); font:800 16px/1 var(--f-display); flex:none; }
.prow-list{ display:grid; gap:4px; margin-top:10px; }
.prow{ background:var(--paper-2); padding:10px 14px; display:grid; gap:6px; }
.pk{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; }
.vid{ font:600 13px/1.4 ui-monospace, Menlo, monospace; color:var(--ink); background:var(--paper); padding:2px 6px; text-decoration:none; overflow-wrap:anywhere; }
a.vid{ text-decoration:underline; text-underline-offset:3px; }
.pl{ font:700 16px/1.4 var(--f-text); }
.pv{ font-size:16px; line-height:1.6; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
.pv b{ font:800 19px/1.2 var(--f-display); }
.pv .cnt, .pv .why{ color:var(--ink-2); font-size:14px; }
.pv .why{ flex-basis:100%; }
.marks{ display:inline-flex; flex-wrap:wrap; gap:3px; direction:ltr; }
.mk{ display:inline-grid; place-items:center; width:26px; height:26px; font:700 14px/1 var(--f-text); font-style:normal; background:var(--paper); color:var(--ink); }
.mk.l0, .mk.r0{ background:var(--amber-field); color:var(--amber-ink); }
.mk.l3, .mk.l2, .mk.r2{ background:var(--green-field); color:var(--green-ink); }
.cap2{ margin-top:8px; font-size:14px; color:var(--ink-2); line-height:1.6; }
.sheet-links{ margin-top:20px; font-size:16px; }
.sheet-links a{ color:var(--ink); text-underline-offset:3px; }
.pupil-sheet .tag-sim{ min-height:26px; font-size:13px; }
.pupil-sheet:not(.on){ visibility:hidden; }

/* phone results: outcome blocks with the four choices in a 2 × 2 grid */
.res-cards{ display:none; }
@media (max-width:700px){
  .res-wide{ display:none; }
  .res-cards{ display:grid; gap:4px; }
  .oc-h{ margin:18px 0 4px; font:800 19px/1.3 var(--f-display); }
  .oc{ background:var(--paper-2); padding:12px; }
  .oc-l{ font:700 16px/1.45 var(--f-text); margin-bottom:8px; }
  .oc-l small{ display:block; font-weight:400; font-size:14px; color:var(--ink-2); }
  .oc-g{ display:grid; grid-template-columns:1fr 1fr; gap:4px; }
  .oc-c{ background:var(--paper); padding:8px 10px; display:grid; gap:2px; }
  .oc-c.on{ background:var(--ink); color:var(--paper); }
  .oc-c.on .b, .oc-c.on .oc-p{ color:var(--paper); }
  .oc-p{ font-size:14px; color:var(--ink-2); }
  .oc-c .v{ font:800 22px/1.2 var(--f-display); direction:ltr; text-align:end; }
  .oc-c .b{ font-size:13px; color:var(--ink-2); direction:ltr; text-align:end; }
}
.takeaway{ background:var(--paper-2); padding:14px 18px; margin:0 0 16px; font:600 17px/1.75 var(--f-text); max-width:90ch; box-shadow:inset -6px 0 0 var(--ink); }

/* «ماذا لو»: the same pupil under each choice (sheet) and the same class under another choice (panel) */
.wi-wrap{ margin-top:10px; }
.wi-tbl{ width:100%; min-width:0; table-layout:fixed; }
.wi-tbl th, .wi-tbl td{ padding:8px 6px; text-align:center; vertical-align:top; font-size:15px; }
.wi-tbl thead th{ font:700 14px/1.3 var(--f-text); color:var(--ink-2); background:transparent; }
.wi-tbl th[scope="row"]{ text-align:start; font:700 15px/1.35 var(--f-text); color:var(--ink); background:var(--paper-2); width:24%; }
.wi-tbl th[scope="row"] small, .wi-tbl td small{ display:block; font:400 13px/1.35 var(--f-text); color:var(--ink-2); margin-top:2px; }
.wi-tbl td{ background:var(--paper-2); }
.wi-tbl td b{ font:800 17px/1.2 var(--f-display); display:block; }
.wi-tbl tr.on th[scope="row"], .wi-tbl tr.on td{ background:var(--ink); color:var(--paper); }
.wi-tbl tr.on small{ color:var(--paper); }
.wi-tbl thead th:nth-child(5){ width:22%; }
.wi-line{ margin-top:10px; font:700 16px/1.6 var(--f-text); }
.wi-why a, .cap.wi-why a{ color:var(--ink); text-underline-offset:3px; }
.wi-panel .wi-alt{ margin-bottom:12px; background:var(--paper); }
.wi-q{ font:600 17px/1.6 var(--f-text); margin-bottom:12px; max-width:80ch; }
.wi-panel .kpi-row{ grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.wi-leg{ margin-top:16px; }
.wi-sw{ display:inline-block; width:14px; height:14px; }
.wi-sw.up, .wi-up{ background:var(--ink); fill:var(--ink); }
.wi-sw.dn, .wi-dn{ background:var(--amber); fill:var(--amber); }
.wi-sw.eq{ background:var(--ink-3); height:3px; }
.wi-eq{ fill:var(--ink-3); }
.wi-chart .zero{ stroke:var(--ink); stroke-width:1.5; }
.wi-chart .hit{ fill:transparent; }
.wi-bar:hover .hit{ fill:var(--paper-3); }
.wi-details{ margin-top:12px; }
.wi-details summary{ cursor:pointer; font:700 16px/1.5 var(--f-text); min-height:44px; display:flex; align-items:center; }
.wi-list td{ text-align:center; background:var(--paper); }
.wi-list th[scope="row"]{ background:var(--paper); }
@media (max-width:420px){ .wi-tbl th, .wi-tbl td{ padding:6px 3px; font-size:14px; } .wi-tbl td b{ font-size:15px; } }
.wi-chart svg{ direction:ltr; }
@media (max-width:560px){
  .wi-tbl, .wi-tbl tbody, .wi-tbl thead{ display:block; }
  .wi-tbl tr{ display:grid; grid-template-columns:repeat(5,1fr); gap:0; margin-bottom:4px; }
  .wi-tbl thead tr{ margin-bottom:2px; }
  .wi-tbl thead th:first-child{ display:none; }
  .wi-tbl thead th:nth-child(5){ width:auto; }
  .wi-tbl th[scope="row"]{ grid-column:1 / -1; width:auto; display:flex; gap:8px; align-items:baseline; padding:8px 10px 2px; }
  .wi-tbl th[scope="row"] small{ display:inline; margin:0; }
}

/* «ماذا لو» under the sheet's sticky title (25 Nov 2026): the column headers stick just below the bar instead of
   sliding under it. The table fits the width (table-layout:fixed), so its wrapper needs no horizontal scroll, which
   would otherwise break position:sticky. --st-h is the bar's measured height (pupils-app.js), 64px before it is measured. */
.pupil-sheet .wi-wrap{ overflow:visible; }
.pupil-sheet .wi-tbl thead th{ position:sticky; top:var(--st-h, 64px); z-index:1; background:var(--paper); box-shadow:0 2px 0 var(--ink-3, #8A8A86); }
.pupil-sheet h3{ scroll-margin-top:calc(var(--st-h, 64px) + 8px); }
