/* p3-school.css · KAN-1740 build (redesign phase 3, Samer 12 Nov: direct redesign, no switch, same content, same order).
   /school (school.html) on the design system, after d1-school.css. Mockup phase3/05. Tokens only.
   One primary on the home: «نسخ رابط الدعوة». Requests: tonal «وافق» + quiet «رفض». No price anywhere (plus.md). */
body.nb-tp{background:var(--section-alt);color:var(--ink)}
.nb-tp .wrap{padding-top:0}
/* AppBar: opaque section-alt, hairline under it, full bleed, sticky */
.nb-tp .top{position:sticky;top:0;z-index:7;min-height:56px;margin:0 0 var(--space-2);padding:6px 0;border:0;border-radius:0;background:var(--section-alt);
  box-shadow:0 0 0 100vmax var(--section-alt),0 1px 0 100vmax var(--hairline);clip-path:inset(0 -100vmax -1px -100vmax)}
.nb-tp .logo{font-size:18px;line-height:24px;font-weight:600;gap:var(--space-2);min-height:var(--tap-min)}
.nb-tp .logo img{width:28px;height:28px}
.nb-tp .top-r{gap:var(--space-2)}
.nb-tp .icon-btn,.nb-tp .acct-btn{min-height:var(--tap-min);border-radius:var(--radius-md);border:1px solid var(--hairline);background:var(--surface);color:var(--ink)}
.nb-tp .acct-btn{font-weight:500}
/* Page head: school name + its source line */
.nb-tp main>h1{padding-top:var(--space-5);font-size:24px;line-height:34px;font-weight:600}
.nb-tp main>h1+.muted{margin-top:var(--space-1);font-size:13px;line-height:20px;color:var(--ink-muted)}
@media (min-width:900px){.nb-tp main>h1{font-size:32px;line-height:44px}}
.nb-tp h2{font-size:19px;line-height:28px;font-weight:600}
.nb-tp .muted{color:var(--ink-secondary)}
/* Cards on surface; the Metric group never sunken straight on the band */
.nb-tp .card{padding:var(--space-5);border:1px solid var(--hairline);border-radius:var(--radius-lg);background:var(--surface);box-shadow:none}
.nb-tp .card.list{padding-block:0}
.nb-tp .card.soft{background:var(--surface);border-color:var(--hairline)}
.nb-tp .kpis.nb-card-sunken{background:var(--surface);border:1px solid var(--hairline)}
.nb-tp .sec-h{margin:var(--space-6) 0 var(--space-3)}
.nb-tp .sec-h h2{font-size:19px;line-height:28px}
/* «ملخص الأسبوع»: neutral bullets */
.nb-tp .brief li{font-weight:400;font-size:15px;line-height:24px;padding:var(--space-1) 0}
.nb-tp .brief .dot{background:var(--ink-muted)}
/* Meter / BarList: 8px brand line on sunken; the seats over the line = caution, never red */
.nb-tp .bar{height:8px;background:var(--surface-sunken)}
.nb-tp .bar>i{background:var(--brand)}
.nb-tp .bar>i.low{background:var(--caution)}
.nb-tp .pct{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ink)}
.nb-tp .li{border-bottom-color:var(--hairline)}
.nb-tp .nm{font-size:16px;line-height:24px;font-weight:500;color:var(--ink)}
/* Buttons: one primary per screen; requests tonal «وافق» + quiet «رفض»; the rest secondary */
.nb-tp .btn{min-height:var(--control-h);border-radius:var(--radius-md);font-size:15px;line-height:22px;font-weight:500;border:1px solid transparent}
.nb-tp .btn-p{background:var(--action);color:var(--on-action)}
.nb-tp .btn-s{background:var(--surface);color:var(--ink);border-color:var(--border-strong)}
.nb-tp .btn-s:hover{background:var(--surface-sunken)}
.nb-tp .btn-sm{min-height:var(--tap-min)}
.nb-tp [data-ok]{background:var(--brand-tint);color:var(--action);border-color:transparent}
.nb-tp [data-no]{background:transparent;color:var(--action);border-color:transparent}
.nb-tp .link{color:var(--action)}
/* the destination cards (results file, monthly report, my classes, guide): their link is secondary, not a grey slab */
.nb-tp #h-file,.nb-tp #h-report,.nb-tp #guideCard .btn,.nb-tp #my-retry{display:inline-flex;width:auto;padding-inline:var(--space-5)}
/* Tab bar (phone): surface, hairline top, current = action + 2px line; the count on action */
.nb-tp .tabs{background:var(--surface);border-top:1px solid var(--hairline);padding:0 var(--space-2) env(safe-area-inset-bottom,0px)}
.nb-tp .tabs .tab{position:relative;min-height:60px;font-size:13px;line-height:18px;font-weight:500;color:var(--ink-muted);background:none;border-radius:0}
.nb-tp .tabs .tab[aria-current=page]{color:var(--action);background:none}
.nb-tp .tabs .tab[aria-current=page]::before{content:"";position:absolute;top:0;inset-inline:calc(50% - 16px);height:2px;border-radius:0 0 2px 2px;background:var(--action)}
.nb-tp .tab:focus-visible{outline:2px solid var(--action);outline-offset:-4px}
/* Desktop from 1024px: the tab bar becomes a side rail on the start side */
@media (min-width:1024px){
  /* the column keeps its place before and after the tabs appear (no layout shift when the home loads) */
  body.nb-tp .wrap,body.nb-tp.nb-g3.has-tabs .wrap{max-width:calc(var(--content-max) + 64px);padding-inline:32px;padding-inline-start:calc(32px + 232px + 48px)}
  body.nb-tp .wrap>.top{margin-inline-start:calc(-232px - 48px)}
  .nb-tp .tabs{left:auto;right:auto;inset-inline-start:calc(max(0px, (100vw - var(--content-max) - 64px) / 2) + 32px);top:80px;bottom:auto;width:232px;padding:var(--space-5) 0 0;border:0;background:transparent}
  .nb-tp .tabs-in{display:flex;flex-direction:column;gap:var(--space-1);max-width:none}
  .nb-tp .tabs .tab{flex-direction:row;justify-content:flex-start;gap:var(--space-3);min-height:48px;padding-inline:var(--space-4);border-radius:var(--radius-md);font-size:15px;line-height:22px;color:var(--ink-secondary)}
  .nb-tp .tabs .tab:hover{background:var(--surface-sunken)}
  .nb-tp .tabs .tab[aria-current=page]{background:var(--brand-tint);color:var(--action)}
  .nb-tp .tabs .tab[aria-current=page]::before{display:none}
}
@media print{.nb-tp .top{box-shadow:none;clip-path:none}}
/* request rows: name + caption at the start, the two row actions at the end (DOM order kept) */
.nb-tp .li:has(>.grid2>[data-ok]){display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:var(--space-3);align-items:center;min-height:64px}
.nb-tp .li:has(>.grid2>[data-ok])>.nm{grid-column:1}
.nb-tp .li:has(>.grid2>[data-ok])>p{grid-column:1;margin:0;font-size:13px;line-height:20px;color:var(--ink-muted)}
.nb-tp .li:has(>.grid2>[data-ok])>.grid2{grid-column:2;grid-row:1 / span 2;display:flex;gap:var(--space-2);margin:0}
.nb-tp .li>.grid2>[data-ok],.nb-tp .li>.grid2>[data-no]{width:auto;padding-inline:var(--space-4)}
/* KAN-2057 (Design review, monthly report): list bullets are brand, not green: green means a right answer only, and the weakest-skills list was drawing green dots */
.nb-tp .ctx-l li::before{background:var(--brand)}
/* KAN-2057 L5: under 420px the request's actions get their own row under the text, so the text column keeps the full width (no 3-line wrap, no orphan «1») */
@media (max-width:419px){
  .nb-tp .li:has(>.grid2>[data-ok]){grid-template-columns:minmax(0,1fr);row-gap:var(--space-3);padding-block:var(--space-3)}
  .nb-tp .li:has(>.grid2>[data-ok])>.grid2{grid-column:1;grid-row:auto}
}
/* «إيقاف كل روابط الدعوة» confirm: tonal yes + quiet no (the invite card keeps its one primary) */
.nb-tp #h-stop-y{background:var(--brand-tint);color:var(--action);border-color:transparent}
.nb-tp #h-stop-n{background:transparent;color:var(--action);border-color:transparent}
/* Toast on deep with an underlined undo */
.nb-tp .toast{background:var(--deep);color:var(--on-deep);border-radius:var(--radius-md);min-height:48px;box-shadow:var(--shadow-overlay)}
.nb-tp .toast .link,.nb-tp .toast button{color:var(--on-deep);text-decoration:underline;text-underline-offset:3px;font-weight:600}

/* KAN-1898 (Samer 12 Nov): signed out, /school was one card off-centre on a wide screen («لحظة…», then the sign-in card).
   The message view (#v-msg: signed out, not public yet, request sent) and the loading card now sit on a section-alt band
   with the graph-paper texture; from 1024px the signed-out card is two columns: what the school gets (the page's own
   ctx block) beside the sign-in ways. The tab-rail space is kept only while the home can still load (no shift then). */
.nb-tp #v-loading{display:flex;align-items:center;justify-content:center;gap:var(--space-3);min-height:160px;color:var(--ink-muted)}
.nb-tp #v-loading::before{content:"";width:24px;height:24px;border-radius:var(--radius-full);border:3px solid var(--hairline);border-top-color:var(--action);animation:nbspin 900ms linear infinite}
@keyframes nbspin{to{transform:rotate(1turn)}}
@media (prefers-reduced-motion:reduce){.nb-tp #v-loading::before{animation:none}}
body.nb-tp:has(.wrap>#v-msg:not([hidden])),body.nb-tp:has(.wrap>#v-loading:not([hidden])){background-color:var(--section-alt);background-image:linear-gradient(var(--hairline) 1px,transparent 1px),linear-gradient(90deg,var(--hairline) 1px,transparent 1px);background-size:32px 32px}
.nb-tp .wrap>#v-msg:not([hidden]),.nb-tp .wrap>#v-loading:not([hidden]){box-shadow:var(--shadow-raised)}
@media (min-width:1024px){
  body.nb-tp .wrap:has(>#v-msg:not([hidden])){padding-inline-start:32px}
  body.nb-tp .wrap:has(>#v-msg:not([hidden]))>.top{margin-inline-start:0}
  .nb-tp .wrap>#v-msg:not([hidden]){display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:auto auto 1fr;column-gap:var(--space-8);align-items:start;margin-top:var(--space-7);padding:var(--space-8);text-align:start;border-radius:var(--radius-xl);background:var(--surface);box-shadow:var(--shadow-raised)}
  .nb-tp #v-msg:not([hidden])>.ico{grid-column:1;margin:0 0 var(--space-4)}
  .nb-tp #v-msg:not([hidden])>h1{grid-column:1;margin:0;font-size:32px;line-height:44px}
  .nb-tp #v-msg:not([hidden])>#msg-p{grid-column:1;margin-top:var(--space-3);font-size:18px;line-height:30px}
  .nb-tp #v-msg:not([hidden])>#msg-act{grid-column:2;grid-row:1 / -1;margin:0}
  /* KAN-1899 B8: signed out at 1440 the start column held the icon, title and one line over ~450px of empty card; that group now
     sits in the vertical middle of the card, beside the sign-in column */
  .nb-tp .wrap>#v-msg:not([hidden]):has(#msg-act>*){grid-template-rows:1fr auto auto 1fr}
  .nb-tp #v-msg:not([hidden]):has(#msg-act>*)>.ico{grid-row:2}
  .nb-tp #v-msg:not([hidden]):has(#msg-act>*)>h1{grid-row:3}
  .nb-tp #v-msg:not([hidden]):has(#msg-act>*)>#msg-p{grid-row:4;align-self:start}
  .nb-tp #v-msg #msg-act>.card{margin:0 0 var(--space-4)}
  .nb-tp #v-msg #msg-act>.btn{width:100%}
  .nb-tp .wrap>#v-msg:not([hidden]):not(:has(#msg-act>*)){grid-template-columns:minmax(0,1fr);max-width:720px;margin-inline:auto}
}
