/*!
 * Midar (مدار) - School Management Platform
 * Copyright (c) 2026 Midar. All rights reserved.
 * Proprietary and confidential. Unauthorized copying or distribution is prohibited.
 */
@import url(./fonts.css);

:root {
  /* Safe areas (the clock, the Dynamic Island, the home indicator). 0 in an ordinary browser tab; the size of those
     areas in the installed app (viewport-fit=cover + black-translucent). Every fixed or sticky edge uses these. */
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --navy: #16244A; --teal: #0B7A75; --teal-soft: #E3F1F0; --amber: #F0A53A; --amber-soft: #FDF1E2;
  --bg: #F5F6F8; --ink: #1A2233; --muted: #5F6B7A; --line: #E3E7EC; --line-2: #D5DBE2; --red: #B8412F; --red-soft: #F8E7E4;
  --radius: 16px; --shadow: 0 1px 2px rgba(22, 36, 74, .04);
  --accent: var(--teal);
  --amber-ink: #8A5A00; --violet: #6B5B95; --violet-soft: #EFEBF7; --navy-soft: #EAEEF6;
}
body.owner { --accent: var(--navy); }
body.teacher { --accent: var(--teal); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { --gut: 16px; width: 100%; max-width: 960px; margin: 0 auto; padding: var(--gut); flex: 1; }
h1, h2, h3, .brand { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-weight: 700; }
h2 { font-size: 19px; margin: 0 0 12px; color: var(--navy); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.topbar { background: #fff; color: var(--navy); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 960px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .brand { font-size: 20px; line-height: 1.1; }
.topbar small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { height: 38px; width: auto; display: block; flex: none; }
.topbar .school { border-inline-start: 1px solid var(--line); padding-inline-start: 12px; min-width: 0; }
.topbar .school b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .school.with-logo { display: flex; align-items: center; gap: 10px; }
.topbar .school-text { min-width: 0; }
.school-logo { width: 38px; height: 38px; flex: none; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
@media (max-width: 480px) { .school-logo { width: 32px; height: 32px; } }
.hero-logo { height: 150px; width: auto; display: block; margin: 0 auto; }
@media (max-width: 719px) { .hero-logo { height: 126px; } }
.print-logo { height: 48px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 150px; }
.row > .btn, .row > .switch { flex: none; min-width: 0; }
@media (max-width: 480px) {
  .row:has(> .f:nth-child(3)) { flex-direction: column; align-items: stretch; }
  .row:has(> .f:nth-child(3)) > .f { width: 100%; min-width: 0; }
}
label.f { display: block; margin-bottom: 12px; }
[hidden] { display: none !important; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label.f.remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; cursor: pointer; }
label.f.remember-row input { margin: 0; width: 16px; height: 16px; flex: none; }
label.f.remember-row span { display: inline; margin-bottom: 0; font-size: 14px; color: var(--text, #1c1c1c); }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 12px; font: inherit; font-size: 15px; background: #fff; color: var(--ink); }
input[type=checkbox] { width: auto; }
label.f.pill { display: flex; align-items: center; justify-content: flex-start; gap: 10px; cursor: pointer; }
label.f.pill > input[type=checkbox], label.f.pill > input[type=radio] { width: 20px; height: 20px; min-height: 0; flex: none; margin: 0; accent-color: var(--accent); }
.ltr { direction: ltr; text-align: left; }

.btn { --b-bg: var(--accent); --b-fg: #fff; --b-bd: transparent; --b-hover: var(--b-bg);
  font: inherit; font-weight: 600; font-size: 14px; min-height: 42px; padding: 9px 18px; border-radius: 12px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--b-hover); filter: brightness(.96); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(11, 122, 117, .35); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }
.btn.primary { --b-bg: var(--accent); --b-fg: #fff; }
.btn.secondary { --b-bg: #fff; --b-fg: var(--accent); --b-bd: var(--accent); --b-hover: var(--teal-soft); }
.btn.ghost { --b-bg: #fff; --b-fg: var(--navy); --b-bd: var(--line-2); --b-hover: #F4F6F9; }
.btn.soft { --b-bg: var(--teal-soft); --b-fg: var(--teal); --b-hover: #D3EAE8; }
.btn.danger { --b-bg: #fff; --b-fg: var(--red); --b-bd: var(--red); --b-hover: #FDECEA; }
.btn.whatsapp { --b-bg: #1FA855; --b-fg: #fff; --b-hover: #188C46; }
.btn.contact { --b-bg: var(--navy); --b-fg: #fff; --b-hover: #0F1B38; }
.btn.open { --b-bg: #fff; --b-fg: var(--accent); --b-bd: var(--line); --b-hover: var(--teal-soft); }
.btn.copy { --b-bg: #F4F6F9; --b-fg: var(--ink); --b-bd: var(--line); --b-hover: #E8ECF2; }
.btn.copy.done { --b-bg: var(--teal-soft); --b-fg: var(--teal); --b-bd: var(--teal); }
.btn.trial { --b-bg: var(--amber); --b-fg: var(--navy); --b-hover: #E39A2F; }
.btn.sm { min-height: 36px; padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  position: sticky; top: var(--sat); z-index: 15;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(16, 38, 64, .05);
  margin: 0 calc(-1 * var(--gut, 16px)) 16px; padding: 8px calc(var(--gut, 16px) - 4px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs-layout:first-child > .tabs { margin-top: calc(-1 * var(--gut, 16px)); }
.tabs button {
  flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 70px; min-height: 54px; padding: 6px 10px; border: none; border-radius: 12px; background: none;
  font: inherit; font-size: 12px; line-height: 1.25; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tabs button .icon { flex: none; opacity: .85; }
.tabs button:hover { background: var(--bg); color: var(--ink); }
.tabs button.on { background: var(--teal-soft); color: var(--accent); font-weight: 700; }
.tabs button.on .icon { opacity: 1; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tabs-group { display: none; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: var(--navy); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

.bnav { display: none; }
@media (max-width: 1079px) {
  .tabs-layout > .tabs { display: none; }
  body.has-bnav { padding-bottom: calc(72px + var(--sab)); }
  .bnav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(22, 36, 74, .06);
    padding: 6px 4px calc(8px + var(--sab)); }
  .bnav-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 56px; padding: 4px 2px;
    border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .bnav-item .icon { width: 56px; height: 30px; padding: 5px 0; border-radius: 999px; box-sizing: border-box; transition: background .15s; }
  .bnav-item.on { color: var(--accent); }
  .bnav-item.on .icon { background: var(--teal-soft); }
  .bnav-item .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav-item .nav-badge { position: absolute; top: 0; inset-inline-start: calc(50% + 6px); }
  .bnav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
  .toast { bottom: calc(84px + var(--sab)); }
}
.tabs .nav-badge { margin-inline-start: auto; }

/* Phones: the menu button at the top right of the header, and the section drawer from the right (outline icons). */
.nav-menu-btn { display: none; }
.nav-sections { display: contents; }
.nav-section-search { width: 100%; min-width: 0; min-height: 40px; margin-bottom: 8px; }
.tabs-top .nav-section-search { display: none; }
@media (max-width: 1079px) {
  .nav-menu-btn { position: relative; display: grid; place-items: center; flex: none; width: 42px; height: 42px; margin-inline-end: 6px; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
  .nav-menu-btn.floating { position: fixed; top: calc(10px + var(--sat)); right: calc(12px + var(--sar)); z-index: 31; box-shadow: 0 4px 14px rgba(22, 36, 74, .12); }
  .nav-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-menu-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); border: 2px solid #fff; }
}
/* The drawer: four fifths of the screen from the right; the page moves aside as a rounded card under a light shade.
   Only transform, border-radius and the backdrop's opacity animate, with one duration and curve for both directions. */
:root { --nd-w: min(78vw, 330px); --nd-ease: cubic-bezier(.32, .72, 0, 1); --nd-t: .36s; }
dialog.navdrawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: var(--nd-w); max-width: var(--nd-w); height: 100%; max-height: 100%; padding: 0; border: 0;
  background: #fff; color: var(--ink); overflow: hidden; outline: none; animation: nd-in var(--nd-t) var(--nd-ease); will-change: transform; }
dialog.navdrawer.closing { animation: nd-out var(--nd-t) var(--nd-ease) forwards; }
dialog.navdrawer::backdrop { background: rgba(14, 22, 44, .16); animation: nd-fade var(--nd-t) var(--nd-ease); }
dialog.navdrawer.closing::backdrop { animation: nd-fade-out var(--nd-t) var(--nd-ease) forwards; }
@keyframes nd-in { from { transform: translateX(100%); } }
@keyframes nd-out { to { transform: translateX(100%); } }
@keyframes nd-fade { from { opacity: 0; } }
@keyframes nd-fade-out { to { opacity: 0; } }
#app.nd-page { position: fixed; top: var(--nd-top, 0px); bottom: 0; inset-inline: 0; overflow: hidden; z-index: 0; background: var(--bg);
  transform: translateX(0); clip-path: inset(var(--nd-clip, 0px) 0 0 0 round 0); will-change: transform;
  transition: transform var(--nd-t) var(--nd-ease), clip-path var(--nd-t) var(--nd-ease); }
html.nd-open #app.nd-page { transform: translateX(calc(-1 * var(--nd-w))); clip-path: inset(var(--nd-clip, 0px) 0 0 0 round 28px); }
html.nd-open, html.nd-open body { overflow: hidden; }
.nd-in { display: flex; flex-direction: column; height: 100%; padding: calc(16px + var(--sat)) calc(18px + var(--sar)) calc(14px + var(--sab)) 18px; }
.nd-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 14px; margin: 0 -18px; padding-inline: 22px; transition: box-shadow .2s; }
.nd-head.scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 12px -10px rgba(22, 36, 74, .25); }
.nd-brand { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.nd-brand > div { min-width: 0; }
.nd-mark { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.nd-brand b { display: block; font-size: 19px; color: var(--navy); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-brand small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-round { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #F4F6F9; color: var(--navy); display: grid; place-items: center; cursor: pointer; }
.nd-round:active { transform: scale(.94); }
.nd-round:focus:not(:focus-visible) { outline: none; }
.nd-search-row { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; padding: 0 14px; border-radius: 16px; background: #F4F6F9; color: var(--muted); }
.nd-search { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 11px 0; font: inherit; font-size: 15.5px; color: var(--ink); }
.nd-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.nd-list::-webkit-scrollbar { display: none; }
.nd-group { color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 14px 12px 4px; letter-spacing: .2px; }
.nd-sep { border: 0; border-top: 1px solid var(--line); margin: 10px 12px 0; }
.nd-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 50px; padding: 8px 12px; border: 0; border-radius: 16px; background: none;
  font: inherit; font-size: 17px; font-weight: 500; color: var(--ink); text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: nd-item .3s ease-out both; animation-delay: calc(80ms + var(--i, 0) * 14ms); transition: background .15s; }
@keyframes nd-item { from { opacity: 0; transform: translateX(8px); } }
.nd-item:hover, .nd-item:focus-visible { background: #F4F6F9; outline: none; }
.nd-item:active { background: #ECEFF4; }
.nd-item.on { background: #EEF1F5; font-weight: 700; color: var(--navy); }
.nd-item.on .nd-ic { color: var(--teal); }
.nd-ic { display: grid; place-items: center; width: 26px; color: var(--navy); flex: none; }
.nd-ic svg { stroke-width: 1.55; }
.nd-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-badge { min-width: 24px; padding: 0 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; }
.nd-none { color: var(--muted); text-align: center; padding: 20px 0; }
.nd-foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.nd-me { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: var(--navy);
  background: linear-gradient(140deg, #EAF3F2, #E3E9F4); border: 1px solid var(--line); }
.nd-ai { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; height: 52px; border: 0; border-radius: 99px; cursor: pointer;
  background: linear-gradient(120deg, #16244A 10%, #1D3B6B 55%, #0B7A75 120%); color: #fff; font: inherit; font-size: 16px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(22, 36, 74, .22); animation: nd-item .5s var(--nd-ease) both; animation-delay: 180ms; }
.nd-ai.on { background: var(--teal); }
.nd-ai:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  dialog.navdrawer, dialog.navdrawer.closing, dialog.navdrawer::backdrop, .nd-item, .nd-ai { animation: none; }
  #app.nd-page { transition: none; }
}

dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 86vh; padding: 0; border: 0; border-radius: 22px 22px 0 0; }
dialog.sheet::backdrop { background: rgba(22, 36, 74, .35); }
@media (min-width: 720px) { dialog.sheet { margin: auto; max-width: 640px; border-radius: 22px; } }
.sheet-in { padding: 16px 16px calc(20px + var(--sab)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-x { width: 44px; height: 44px; border: 0; background: var(--bg); border-radius: 12px; display: grid; place-items: center; color: var(--navy); cursor: pointer; }
.sheet-group h3 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 4px 8px; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sheet-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; min-height: 88px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: center; }
.sheet-item.on { border-color: var(--accent); background: var(--teal-soft); }
.sheet-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bg); color: var(--navy); }
.sheet-item.on .sheet-ic { background: #fff; color: var(--accent); }
.sheet-item .nav-badge { position: absolute; top: 6px; inset-inline-end: 6px; }

.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.sub { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--teal); background: var(--teal-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.amber { color: #8A5A00; background: var(--amber-soft); }
.badge.gray { color: var(--muted); background: var(--bg); }
.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; background: var(--teal-soft); }
.notice.warn { background: var(--amber-soft); }
.notice.err { background: var(--red-soft); color: var(--red); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; container-type: inline-size;
  display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow); }
.stat b { display: block; order: 1; font-size: clamp(16px, 13cqi, 26px); line-height: 1.3; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat .stat-l { order: 0; }
.stat .sub { order: 2; }

.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.bar > i { display: block; height: 100%; background: var(--accent); }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 20px; background: #fff; cursor: pointer; border: 1.5px solid currentColor; }
.chip.on { color: #fff !important; }

.switch { position: relative; width: 44px; height: 24px; border-radius: 12px; border: none; background: var(--line); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; }
.switch[aria-checked=true] { background: var(--teal); }
.switch[aria-checked=true]::after { right: 23px; }

.key { font-family: ui-monospace, Menlo, monospace; direction: ltr; display: inline-block; background: var(--amber-soft); border: 1px dashed var(--amber); padding: 2px 8px; border-radius: 6px; font-weight: 700; letter-spacing: 1px; }

table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; }
table.grid th { color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }

.auth-hero { background: var(--navy); color: #fff; padding: 36px 20px 70px; }
.auth-hero .in { max-width: 420px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.auth-hero .brand { font-size: 36px; }
.auth-card { max-width: 420px; width: calc(100% - 32px); margin: -40px auto 20px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 18px; box-shadow: 0 12px 30px rgba(22, 36, 74, .08); }
.auth-card > h2 { text-align: center; margin-bottom: 6px; }
.auth-card > .sub { text-align: center; margin-bottom: 16px; }

dialog { border: none; border-radius: 14px; padding: 0; width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(22, 36, 74, .45); }
dialog .d-in { padding: 18px; }
dialog:modal { max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
/* The drawer is a full-height panel at the screen's right edge, never a centred card. */
dialog.navdrawer:modal { inset: 0 0 0 auto; margin: 0; width: var(--nd-w); max-width: var(--nd-w); height: 100%; max-height: none; border-radius: 0; overflow: hidden; }
dialog .d-in > .row.spaced:last-child { position: sticky; bottom: -18px; background: #fff; margin: 0 -18px -18px; padding: 12px 18px 18px;
  border-top: 1px solid var(--line); z-index: 2; }
/* The one window: title and X on top, content, actions at the bottom (main, others, then destructive apart). */
dialog.dlg { border-radius: 18px; box-shadow: 0 24px 60px rgba(14, 23, 48, .22); }
dialog.dlg .d-in { padding: 0 18px 18px; }
.dlg-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -18px 14px; padding: 14px 18px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 17px; line-height: 1.5; color: var(--navy); min-width: 0; overflow-wrap: anywhere; }
.dlg-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; padding: 0; }
.dlg-x:hover { background: #F4F6F9; }
.dlg-x:focus-visible { outline: 3px solid rgba(11, 122, 117, .35); outline-offset: 2px; }
.dlg-foot { position: sticky; bottom: -18px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 16px -18px -18px; padding: 12px 18px calc(16px + var(--sab, 0px)); background: #fff; border-top: 1px solid var(--line); }
.dlg-foot > .btn { min-height: 44px; }
.dlg-gap { flex: 1 1 0; min-width: 8px; }
@media (max-width: 520px) { .dlg-foot > .btn:not(.sm) { flex: 1 1 auto; } .dlg-foot .dlg-gap { flex-basis: 100%; height: 0; } }

.class-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.class-card > h3 { margin: 0; padding: 12px 16px; background: var(--navy); color: #fff; font-size: 17px; display: flex; justify-content: space-between; }
.class-head { width: 100%; font: inherit; font-size: 17px; font-weight: 700; text-align: right; color: #fff; background: var(--navy);
  border: none; padding: 13px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.class-head:hover { filter: brightness(1.12); }
.class-head .icon { transition: transform .15s ease; opacity: .85; transform: rotate(-90deg); }
.class-head.open .icon { transform: rotate(0); }
.teachers { padding: 10px 14px 4px; border-bottom: 1px solid var(--line); }
.teachers h4 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.names button { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.linkish { font: inherit; background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }
.names { list-style: none; margin: 0; padding: 6px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.names button { font: inherit; width: 100%; text-align: right; padding: 10px; background: none; border: none; border-radius: 8px; cursor: pointer; color: var(--ink); }
.names button:hover { background: var(--teal-soft); }

.profile-head { background: var(--navy); color: #fff; border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.profile-head h1 { margin: 0; font-size: 26px; }
.profile-head .kpis { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.profile-head .kpis b { display: block; font-size: 22px; color: var(--amber); }

.toast { position: fixed; bottom: calc(20px + var(--sab)); left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.toast.err { background: var(--red); }

footer.dev { text-align: center; padding: 14px; font-size: 12px; color: var(--muted); }
.hidden { display: none !important; }

@media print {
  @page { margin: 0; }
  body { padding: 12mm 12mm 14mm !important; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .topbar, .tabs, .btn, footer.dev { display: none !important; }
  body { background: #fff; }
  .tabs-layout { display: block !important; }
  main { max-width: none !important; padding: 0 !important; margin: 0 !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.loading { text-align: center; padding: 40px; }
.notfound { text-align: center; padding-top: 80px; }

.auth-hero .role { font-size: 17px; margin: 10px 0 0; opacity: .92; letter-spacing: .3px; }
.version-conflict { outline: 2px solid var(--red); }
.muted-row { opacity: .6; }
.pill { display: inline-flex; align-items: center; gap: 6px; }
.small { font-size: 12px; }
.spaced { margin-top: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.toolbar > input, .toolbar > select { flex: 1; min-width: 160px; }
.danger-text { color: var(--red); }
.print-only { display: none; }
@media print { .print-only { display: block; } }

.sec-title { margin: 16px 0 6px; font-size: 16px; color: var(--navy); }
.bank-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #FBFCFD; }
.bank-card .line:first-of-type { border-top: none; }
.key { word-break: break-all; max-width: 100%; }
.key.plain { font-family: inherit; letter-spacing: 0; direction: rtl; }
.pill { flex-wrap: wrap; justify-content: flex-end; }

.blank-home { display: flex; align-items: center; justify-content: center; min-height: 72vh; }
.blank-home .hero-logo { height: 190px; }
.handover { line-height: 2; }
.handover .line { border-top: 1px dashed var(--line); }

table.timetable th, table.timetable td { text-align: center; vertical-align: middle; min-width: 92px; }
table.timetable tbody th { text-align: right; white-space: nowrap; background: var(--bg); }
table.timetable tr.today { background: var(--amber-soft); }
table.timetable select { padding: 4px; font-size: 12px; }
.muted { color: var(--muted); }
.report { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.report header { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.report h2 { margin: 0; }
.report .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; margin-bottom: 12px; }
.report .total { display: flex; gap: 20px; flex-wrap: wrap; background: var(--teal-soft); padding: 12px; border-radius: 10px; margin-top: 12px; }
.report .total b { display: block; font-size: 20px; color: var(--navy); }
.report .sign { display: flex; justify-content: space-between; margin-top: 28px; color: var(--muted); font-size: 13px; }
@media print {
  .report { border: none; box-shadow: none; page-break-after: always; }
  .panel, .stats, .toolbar { box-shadow: none; }
}
.mk-hero { background: var(--navy); color: #fff; padding: 46px 20px 54px; text-align: center; }
.mk-hero h1 { font-size: 30px; margin: 18px 0 6px; }
.mk-hero p { opacity: .9; margin: 0 auto; max-width: 560px; }
.mk-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.mk-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.mk-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--navy); }
.mk-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.mk-price { text-align: center; }
.mk-price .amount { font-size: 26px; font-weight: 800; color: var(--teal); }
.mk-price ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; line-height: 2; }
.mk-section { max-width: 960px; margin: 0 auto; padding: 26px 16px; }
.mk-section > h2 { text-align: center; margin-bottom: 16px; }

.att-head { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 720px) { .att-head { grid-template-columns: 1fr 1fr; } }
.att-date .f { margin-bottom: 6px; }
.att-day-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 12px; }
.att-day { font-size: 13px; color: var(--muted); text-align: center; flex: 1; }
.att-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.att-count { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 13px; background: var(--bg); color: var(--muted); }
.att-count b { font-size: 15px; }
.att-count.s-present { background: var(--teal-soft); color: var(--teal); }
.att-count.s-absent { background: var(--red-soft); color: var(--red); }
.att-count.s-late { background: var(--amber-soft); color: var(--amber-ink); }
.att-count.s-excused { background: var(--violet-soft); color: var(--violet); }
.att-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.att-tools input { flex: 1; min-width: 160px; }
.att-hint { margin: 0 0 8px; font-size: 13px; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-row { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.att-row.dirty { border-color: var(--accent); box-shadow: 0 0 0 2px var(--teal-soft); }
.att-no { color: var(--muted); font-size: 12px; text-align: center; }
.att-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.att-name b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name small { font-size: 12px; color: var(--muted); }
.att-seg { display: inline-grid; grid-template-columns: repeat(4, auto); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.att-seg .seg { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; min-width: 56px; background: #fff; border: none; border-inline-start: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.att-seg .seg:first-child { border-inline-start: none; }
.att-seg .seg.on.s-present { background: var(--teal); color: #fff; }
.att-seg .seg.on.s-absent { background: var(--red); color: #fff; }
.att-seg .seg.on.s-late { background: var(--amber); color: #fff; }
.att-seg .seg.on.s-excused { background: var(--violet); color: #fff; }
.att-bar { position: sticky; bottom: 0; z-index: 5; margin: 12px -4px -4px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--navy); color: #fff; border-radius: 12px; box-shadow: 0 -4px 16px rgba(16,38,64,.15); font-weight: 600; }
.att-bar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
@media (max-width: 719px) {
  .att-row { grid-template-columns: 22px 34px minmax(0, 1fr); row-gap: 8px; }
  .att-seg { grid-column: 1 / -1; display: grid; width: 100%; }
  .att-seg .seg { min-width: 0; padding: 10px 4px; min-height: 42px; }
}
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.quick-name { font: inherit; font-size: 15px; font-weight: 600; padding: 14px 10px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink); text-align: center; }
.quick-name[data-state="present"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.quick-name[data-state="absent"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.quick-name[data-state="late"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-ink); }
.quick-name[data-state="excused"] { border-color: var(--violet); background: var(--violet-soft); color: var(--violet); }

body { padding: var(--sat) var(--sar) var(--sab) var(--sal); }

@media (max-width: 719px) {
  main { --gut: 12px; }
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn.sm { min-height: 38px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  input[type=checkbox], input[type=radio] { min-height: 0; }
  .panel { padding: 14px; }
  .line { padding: 12px 0; }
  .row > * { min-width: 100%; }
  .row > .btn, .row > .switch { min-width: 0; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .topbar .in { padding: 10px 12px; }
  .brand-logo { height: 32px; }
  table.grid { font-size: 13px; }
}

@media (min-width: 720px) {
  main { --gut: 20px; max-width: 1120px; }
  .topbar .in { max-width: 1120px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

@media (min-width: 1080px) {
  .nav-sections { display: flex; flex-direction: column; gap: 1px; }
  .tabs-top .nav-sections { flex-direction: row; }
  .tabs-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: start; }
  .tabs-layout > .tabs {
    flex-direction: column; gap: 1px; overflow: visible; padding: 10px; margin: 0;
    position: sticky; top: calc(16px + var(--sat)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
    max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; backdrop-filter: none;
  }
  .tabs-layout > .tabs .tabs-group { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 12px 12px 4px; }
  .tabs-layout > .tabs .tabs-group:first-child { padding-top: 2px; }
  .tabs-layout > .tabs button {
    width: 100%; min-width: 0; min-height: 40px; flex-direction: row; justify-content: flex-start; gap: 10px;
    padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--ink); border-radius: 10px; text-align: start; position: relative;
  }
  .tabs-layout > .tabs button .icon { color: var(--muted); }
  .tabs-layout > .tabs button.on { background: var(--accent); color: #fff; font-weight: 600; }
  .tabs-layout > .tabs button.on .icon { color: #fff; }
  .cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .cols-2 > * { min-width: 0; }
}
@media (min-width: 1400px) {
  main { max-width: 1280px; }
  .topbar .in { max-width: 1280px; }
}

@media (display-mode: window-controls-overlay) {
  .topbar { position: sticky; top: 0; z-index: 20; -webkit-app-region: drag; }
  .topbar .btn { -webkit-app-region: no-drag; }
}
@media (display-mode: standalone) {
  .install-hint { display: none !important; }
}

.top-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.install-ic { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--navy); transition: transform .15s, background .15s; }
.install-ic:hover { background: var(--teal-soft); }
.install-ic:active { transform: scale(.94); }
.install-ic[hidden] { display: none; }
.install-ic.on-dark { background: #fff; border-color: var(--line-2); color: var(--navy); }
.install-ic.on-dark:hover { background: var(--bg); }
.install-ic.floating { position: fixed; top: calc(12px + var(--sat)); left: 12px; z-index: 50; box-shadow: 0 4px 14px rgba(16,38,64,.15); }
.icon { vertical-align: middle; flex: none; }
.install-steps ol { padding-inline-start: 18px; line-height: 2.1; }
@media print { .install-ic { display: none !important; } }

.chart { max-width: 100%; height: auto; display: block; }
.chart-value { font-size: 11px; fill: var(--ink); font-family: inherit; font-weight: 700; }
.chart-label { font-size: 11px; fill: var(--muted); font-family: inherit; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.alert-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; }
.alert-card b { font-size: 22px; }
.alert-card.warn { border-color: var(--amber); background: var(--amber-soft); }
.alert-card.bad { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.search-result { display: block; width: 100%; text-align: right; background: none; border: none; border-top: 1px solid var(--line); padding: 10px 0; font: inherit; cursor: pointer; }
.search-result:hover { background: var(--teal-soft); }
.welcome-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border-radius: 14px; background: var(--teal-soft); border: 1px solid rgba(15,118,110,.15); }
.welcome-card .t-info b { font-size: 17px; color: var(--navy); white-space: normal; }
.t-avatar.lg { width: 64px; height: 64px; font-size: 24px; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.t-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.t-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.t-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; background: var(--teal-soft); }
.t-avatar.ph { display: grid; place-items: center; color: var(--accent); font-weight: 700; font-size: 18px; }
.t-info { min-width: 0; display: flex; flex-direction: column; }
.t-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-info small { color: var(--muted); font-size: 12px; line-height: 1.5; }
@media print { .t-card { break-inside: avoid; } }
img.doc-school-logo { object-fit: contain; width: auto; max-width: 140px; }
.logo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview { width: 120px; height: 120px; flex: none; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: grid; place-items: center; padding: 10px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.empty { border-style: dashed; color: var(--muted); font-size: 13px; background: var(--bg); }
.logo-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.lvl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; background: var(--teal); }
.lvl-dot.urgent { background: var(--red); } .lvl-dot.action { background: var(--amber); }
.dash-hero { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), #0b5d59); color: #fff; }
.dash-logo { width: 60px; height: 60px; flex: none; border-radius: 14px; background: #fff; object-fit: contain; padding: 5px; }
.dash-logo.ph { display: grid; place-items: center; color: var(--accent); font-size: 26px; font-weight: 700; }
.dash-hero-text { min-width: 0; }
.dash-hero h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.3; }
.dash-hero p { margin: 0; font-size: 13px; opacity: .9; }
@media (max-width: 480px) { .dash-hero { padding: 12px; } .dash-logo { width: 48px; height: 48px; } .dash-hero h2 { font-size: 17px; } }

.receipt { max-width: 520px; }
@media print {
  body:has(dialog[open]) > *:not(dialog) { display: none !important; }
  dialog[open] { position: static; display: block; border: none; width: 100%; max-width: none; }
  dialog::backdrop { display: none; }
  dialog[open] .d-in > .row.spaced:last-child, dialog[open] .btn, dialog[open] .dlg-foot, dialog[open] .dlg-x { display: none !important; }
}

.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-inline-start: 44px; }
.pw-toggle { position: absolute; inset-inline-start: 2px; top: 50%; transform: translateY(-50%); min-width: 40px; min-height: 40px;
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pw-toggle:hover { background: var(--bg); color: var(--ink); }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }

.student-row { display: grid; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.student-row:first-of-type { border-top: none; }
.student-row .s-name { font-size: 15px; }
.student-row .s-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.student-row .s-label { color: var(--muted); font-size: 12px; }
.student-row .s-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 900px) {
  .student-row { grid-template-columns: minmax(190px, 1.4fr) 130px minmax(170px, 1.2fr) 130px auto; }
  .student-row .s-label { display: none; }
  .student-row .s-actions .s-label { display: inline; }
}

.menu-title { margin: 0 0 12px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.menu-card { display: flex; align-items: center; gap: 10px; text-align: right; font: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-height: 64px; }
.menu-card:hover { border-color: var(--accent); background: var(--teal-soft); }
.menu-card .menu-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-card .menu-name { font-weight: 700; color: var(--navy); font-size: 15px; }
.menu-card .menu-note { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.menu-card .icon { color: var(--muted); }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 19px; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overflow-x: hidden; overscroll-behavior-y: contain; }

.cards-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.id-card { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.id-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 10px; font-size: 14px; }
.id-card .card-logo { height: 26px; }
.id-card .id-name { font-size: 18px; font-weight: 800; color: var(--navy); }
.id-card .id-class { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.id-card .id-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 3px 0; }
.id-card .id-row.big b { font-family: ui-monospace, monospace; font-size: 17px; letter-spacing: 1px; color: var(--navy); }
.id-card .id-note { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin: 8px 0 0; }

.report.wide { max-width: none; }
table.month-sheet th, table.month-sheet td { padding: 4px 6px; text-align: center; font-size: 12px; }
table.month-sheet tbody th { text-align: right; white-space: nowrap; position: sticky; inset-inline-start: 0; background: #fff; }
table.month-sheet .mark-present { color: var(--teal); }
table.month-sheet .mark-absent { color: var(--red); font-weight: 700; }
table.month-sheet .mark-late { color: var(--amber-ink); font-weight: 700; }
table.month-sheet .mark-excused { color: var(--violet); font-weight: 700; }
@media print {
  .cards-sheet { grid-template-columns: repeat(2, 1fr); }
  .id-card { break-inside: avoid; }
  table.month-sheet { font-size: 10px; }
}

.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.steps .step { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--muted); font-weight: 700; }
.steps .step.on { border-color: var(--accent); color: var(--accent); background: var(--teal-soft); }
.steps .step.done { border-color: var(--teal); background: var(--teal); color: #fff; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 10px 0; }
.subject-pick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; cursor: pointer; }
.subject-pick:hover { border-color: var(--accent); }

.grade-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #FBFCFD; }
.grade-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.grade-head b { font-size: 15px; color: var(--navy); }
.grade-head .row { margin-inline-start: auto; }
.sections { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.section-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--teal-soft); color: var(--navy);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }

.student-row.head { padding: 8px 0; }
.student-row .s-pick { display: flex; align-items: center; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--teal-soft);
  border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
@media (min-width: 900px) {
  .student-row { grid-template-columns: 28px minmax(180px, 1.3fr) 120px minmax(160px, 1.1fr) 120px auto; }
}

table.matrix th, table.matrix td { padding: 6px 8px; text-align: center; vertical-align: middle; }
table.matrix tbody th { text-align: right; white-space: nowrap; background: var(--bg); position: sticky; inset-inline-start: 0; }
table.matrix select { min-width: 130px; font-size: 12.5px; padding: 5px; }

.subject-group { margin-bottom: 10px; }
.subject-pick.suggested { border-color: var(--teal); background: var(--teal-soft); }

button.section-chip { border: 1px solid transparent; cursor: pointer; font: inherit; }
button.section-chip.on { background: var(--navy); color: #fff; }
button.section-chip:hover { border-color: var(--accent); }

.profile-page { max-width: 1180px; }
.profile-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.profile-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.profile-nav button { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer;
  font: inherit; color: var(--ink); min-width: 120px; }
.profile-nav button small { color: var(--muted); font-size: 11.5px; }
.profile-nav button.on { border-color: var(--accent); background: var(--teal-soft); color: var(--navy); font-weight: 700; }
.kpis.inline { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.kpis.inline div { background: var(--bg); border-radius: 10px; padding: 8px 14px; text-align: center; font-size: 12px; color: var(--muted); }
.kpis.inline b { display: block; font-size: 18px; color: var(--navy); }
@media (min-width: 900px) {
  .profile-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .profile-nav { flex-direction: column; overflow: visible; position: sticky; top: calc(16px + var(--sat)); }
  .profile-nav button { width: 100%; }
}

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 85% 10%, rgba(19,124,118,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 90%, rgba(201,162,77,.18), transparent 55%),
    linear-gradient(160deg, #0E2038 0%, #143354 45%, #0B1B2E 100%);
  position: relative; overflow: hidden; }
.gate::before, .gate::after { content: ""; position: absolute; opacity: .08; pointer-events: none; }
.gate::before { inset-inline-start: -60px; top: 12%; width: 320px; height: 210px; border: 10px solid #fff; border-radius: 12px;
  box-shadow: 0 0 0 18px rgba(255,255,255,.06); transform: rotate(-6deg); }
.gate::after { inset-inline-end: -40px; bottom: 8%; width: 260px; height: 180px;
  background: repeating-linear-gradient(90deg, #fff 0 22px, transparent 22px 38px); border-radius: 8px; transform: rotate(5deg); }
.gate-wrap { width: min(980px, 100%); display: grid; gap: 22px; position: relative; z-index: 1; }
.gate-aside { color: #EAF2F6; }
.gate-aside h1 { font-size: 26px; margin: 10px 0 6px; }
.gate-aside p { color: rgba(234,242,246,.8); margin: 0 0 14px; line-height: 1.9; }
.gate-points { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gate-points li { display: flex; gap: 8px; align-items: center; color: rgba(234,242,246,.9); font-size: 14px; }
.gate-points .icon { color: var(--gold, #C9A24D); }
.gate-card { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 18px;
  padding: 22px; backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.gate-card h2 { color: #fff; margin: 0 0 4px; font-size: 20px; }
.gate-card .gate-sub { color: rgba(255,255,255,.72); font-size: 13.5px; margin-bottom: 16px; }
.gate-card .f span { color: rgba(255,255,255,.8); }
.gate-card input, .gate-card select { background: rgba(255,255,255,.92); border-color: transparent; }
.gate-card .pw-toggle { color: #55636E; }
.gate-card .btn { width: 100%; justify-content: center; padding: 13px; font-size: 16px; }
.gate-card .btn.ghost, .gate-card .btn.link { background: transparent; color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.25); }
.gate-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 14px; flex-wrap: wrap; }
.gate-row label { color: rgba(255,255,255,.85); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.gate-link { background: none; border: none; color: #8FD8D2; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.gate-roles { margin-top: 16px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; }
.gate-roles h3 { color: rgba(255,255,255,.85); font-size: 13.5px; margin: 0 0 8px; font-weight: 600; }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
  padding: 10px 8px; text-align: center; color: #fff; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.role-card:hover { background: rgba(255,255,255,.14); }
.role-card.on { background: rgba(127,214,207,.18); border-color: #7FD6CF; box-shadow: inset 0 0 0 1px #7FD6CF; font-weight: 700; }
.role-card:focus-visible { outline: 2px solid #7FD6CF; outline-offset: 2px; }
.role-card small { display: block; color: rgba(255,255,255,.6); font-size: 11px; margin-top: 2px; }
.gate-foot { text-align: center; color: rgba(255,255,255,.6); font-size: 12.5px; margin-top: 14px; }
.gate-badge { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); font-size: 12.5px; }
@media (min-width: 900px) {
  .gate-wrap { grid-template-columns: 1fr 380px; align-items: center; gap: 40px; }
}
@media (prefers-reduced-motion: reduce) { .gate::before, .gate::after { display: none; } }
@media (max-width: 899px) { .hide-sm { display: none !important; } }
@media (min-width: 900px) { .show-sm { display: none !important; } }

.gate-card .hero-logo, .gate-aside .hero-logo { display: block; margin-inline: auto; }
.gate-card h2, .gate-card .gate-sub { text-align: center; }
.gate-aside { text-align: center; }
.gate-aside .gate-points { display: inline-grid; text-align: right; }
.gate-roles h3 { text-align: center; }
.gate-card .sub, .gate-card .empty { color: rgba(255,255,255,.62); text-align: center; }

.assign-list { display: grid; gap: 6px; }
.assign-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.assign-item.open { border-color: var(--accent); }
.assign-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: none; border: none; font: inherit; text-align: right; color: var(--ink); }
.assign-head:hover { background: var(--bg); }
.assign-head .assign-name { font-weight: 700; color: var(--navy); min-width: 90px; }
.assign-head .assign-sum { flex: 1; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-head.has .assign-sum { color: var(--ink); }
.assign-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); background: #FBFCFD; }
.assign-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 10px; }
.assign-subject { display: flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.assign-subject:hover { border-color: var(--accent); }

.notif-group { margin-bottom: 12px; }
.notif { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 6px; font: inherit; }
.notif:hover { border-color: var(--accent); background: var(--teal-soft); }
.notif .notif-count { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  background: var(--bg); color: var(--navy); font-weight: 800; font-size: 16px; }
.notif.warn { border-color: var(--amber); }
.notif.warn .notif-count { background: var(--amber-soft); color: var(--amber-ink); }
.notif.bad { border-color: var(--red); }
.notif.bad .notif-count { background: var(--red-soft); color: var(--red); }
.notif .notif-text b { display: block; color: var(--ink); }

.sub-banner { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
  background: #EAF4FF; color: #1F4E8C; border: 1px solid #C9DFF7; }
.sub-banner.trial { background: #FFF6E6; color: #7A4B00; border-color: #F3D9A8; }
.sub-banner.warn { background: #FFEFE9; color: #8C2F18; border-color: #F5C8B8; }
.sub-banner > svg { flex: none; }
/* Notices for the home page only (e.g. the free trial). */
body[data-section]:not([data-section="dashboard"]):not([data-section="home"]) .home-only { display: none; }
.sub-banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sub-banner small { opacity: .85; }
.sub-lock { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 18px; margin-bottom: 14px; }
.sub-lock > svg { color: var(--red); }
.sub-lock h2 { margin: 10px 0 6px; }
.sub-lock p { max-width: 560px; margin: 6px auto; line-height: 1.8; }
.feat-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.feat-row > svg { flex: none; color: var(--teal); }
.feat-row.off { color: var(--muted); }
.feat-row.off > svg { color: var(--muted); }
.feat-row small { color: var(--muted); }
.sub-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.sub-plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.sub-plan.cur { border-color: var(--teal); background: var(--teal-soft); }
.sub-plan h3 { margin: 0; font-size: 17px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sub-plan .btn { margin-top: auto; }
/* «اشتراكي»: the facts in a grid (two columns on phones), usage as «573 من 2000», one row of actions. */
.sub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 18px; margin-bottom: 12px; }
.sub-fact small { display: block; color: var(--muted); font-size: 12.5px; }
.sub-fact b { display: block; font-size: 16px; color: var(--navy); overflow-wrap: anywhere; }
.sub-use { margin-bottom: 10px; }
.sub-use-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.sub-use-h b { flex: none; font-variant-numeric: tabular-nums; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sub-actions.center { justify-content: center; }
.sub-price b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sub-cat { border-bottom: 1px solid var(--line); }
.sub-cat > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; }
.sub-cat > summary::-webkit-details-marker { display: none; }
.sub-cat > summary::after { content: "⌄"; color: var(--muted); }
.sub-cat[open] > summary::after { content: "⌃"; }
.sub-cat > summary small { margin-inline-start: auto; color: var(--muted); }
@media (max-width: 719px) {
  .sub-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-actions .btn { flex: 1 1 auto; }
  .feat-row .btn.sm { min-height: 44px; }
}

.skel { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.skel-line { height: 14px; border-radius: 7px; margin: 12px 0; background: linear-gradient(90deg, var(--bg) 25%, #F7F9FB 37%, var(--bg) 63%);
  background-size: 400% 100%; animation: skel 1.3s ease infinite; }
.skel-line.w40 { width: 40%; height: 20px; } .skel-line.w90 { width: 90%; } .skel-line.w75 { width: 75%; } .skel-line.w85 { width: 85%; } .skel-line.w60 { width: 60%; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel-line { animation: none; } }
.update-bar { position: fixed; bottom: calc(14px + var(--sab)); inset-inline: 14px; z-index: 1000; display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 520px; margin-inline: auto; }
.app-version { font-size: 11px; }
img[loading="lazy"] { content-visibility: auto; }
@media (max-width: 700px) {
  .line { flex-wrap: wrap; }
  .line > .row { flex: 1 1 100% !important; flex-wrap: wrap; justify-content: flex-start; min-width: 0; }
  .line > .row > * { min-width: 0 !important; flex: 0 1 auto; }
}
.diag { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; }
.diag.ok { background: var(--teal-soft); color: var(--teal); }
.diag.bad { background: #FDECEA; color: var(--red); }

.link-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.link-row .lr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-row .lr-text > b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.link-row .lr-text small { color: var(--muted); font-size: 12px; }
.link-row .lr-url, .link-row .lr-val { font-size: 13px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; }
.link-row .lr-val { color: var(--ink); font-family: ui-monospace, Menlo, Consolas, monospace; background: #F4F6F9; padding: 2px 6px; border-radius: 6px; align-self: flex-start; max-width: 100%; }
.link-row .lr-acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 560px) { .link-row { flex-wrap: wrap; } .link-row .lr-acts { width: 100%; } .link-row .lr-acts .btn { flex: 1; } }
.school-row { font: inherit; width: 100%; text-align: start; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; color: var(--ink); }
.school-row:hover { border-color: var(--accent); }
.school-row > div { flex: 1; min-width: 0; }
.school-row .go { color: var(--accent); font-size: 20px; }
.sec-title { margin: 12px 0 6px; font-size: 13.5px; color: var(--muted); }

.sync-pill { font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 5px 12px; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.sync-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.sync-pill.ok { background: var(--teal-soft); color: #085E5A; }
.sync-pill.busy { background: #FFF6E6; color: #8A5A10; }
.sync-pill.busy::before { animation: pulse 1s infinite; }
.sync-pill.off { background: var(--bg); color: #4A5568; }
.sync-pill.warn { background: #FDECEA; color: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.pending-dot { display: inline-block; font-size: 11px; font-weight: 600; color: #8A5A10; background: #FFF6E6; border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; }
.topbar .in { gap: 10px; }
@media (max-width: 560px) { .sync-pill { font-size: 11.5px; padding: 4px 9px; } }
.sync-pill .short { display: none; }
@media (max-width: 560px) { .sync-pill .full { display: none; } .sync-pill .short { display: inline; } }

.lock-box { background: #FFF6E6; border: 1px solid #F3D9A8; color: #7A4B00; border-radius: 12px; padding: 14px; text-align: center; margin: 8px 0; }
.lock-title { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.lock-sub { font-size: 12.5px; opacity: .85; }
.lock-time { display: block; font-size: 34px; font-weight: 800; letter-spacing: 2px; margin: 4px 0 8px; font-variant-numeric: tabular-nums; color: #9A5B00; }
.lock-bar { height: 6px; background: #F3D9A8; border-radius: 3px; overflow: hidden; margin: 0 auto 8px; max-width: 260px; }
.lock-bar i { display: block; height: 100%; background: #E8A33D; border-radius: 3px; transition: width .25s linear; }

.wiz-progress { margin-bottom: 14px; }
.wiz-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.wiz-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s; }
.setup-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 8px 0 0; overflow-x: auto; scrollbar-width: thin; }
.setup-steps li { flex: none; font-size: 12px; }
.setup-steps li > * { display: block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; white-space: nowrap; }
.setup-steps li.done > * { color: var(--teal); border-color: var(--teal); }
.setup-steps li.on > * { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.setup-steps button { cursor: pointer; }
.custom-stages { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 6px; }
.ar-chips { position: sticky; top: var(--sat); z-index: 3; background: var(--bg); padding: 6px 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.pick-card { display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.pick-card.on { border-color: var(--accent); background: var(--teal-soft); }
.pick-card input { width: 20px; height: 20px; min-height: 0; flex: none; }
.pick-card b { display: block; }
.pick-grid.one-col { grid-template-columns: 1fr; }
.prev-stage { margin: 10px 0; }
.prev-list { margin: 6px 0; padding-inline-start: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; }
.prev-list li { padding: 4px 0; }
.prev-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }

dialog.dialog-lg { width: min(880px, calc(100% - 24px)); }
@media (max-width: 640px) {
  dialog.dialog-lg { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.dialog-lg .d-in { padding: 14px; }
  dialog.dialog-lg .d-in > .row.spaced:last-child { bottom: -14px; margin: 0 -14px -14px; padding: 12px 14px calc(14px + var(--sab)); }
}
.s-head .section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.s-actions-top { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.s-actions-top .btn:first-child { flex: 1 1 140px; }
.more-stats { margin-top: 10px; }
.more-stats summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.stat-chips, .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.stat-chip { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.stat-chip b { background: var(--teal-soft); color: var(--teal); border-radius: 10px; padding: 0 7px; }
.search-row { margin-bottom: 8px; }
.search-row input { width: 100%; font-size: 16px; padding: 12px 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.s-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.s-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.s-card:hover, .s-card:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--teal-soft); }
.s-card .s-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-card .s-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-card .s-meta { font-size: 13px; color: var(--muted); }
.s-card .s-pick { display: flex; }
.s-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; background: var(--teal-soft); }
.s-photo.lg { width: 84px; height: 84px; font-size: 32px; }
.s-photo.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--teal); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 12px; }
.student-form .sec-title { margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.student-form .sec-title.first { margin-top: 0; }
.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.photo-row .btn { margin: 0 0 6px 6px; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.file-actions .fees-switch { display: inline-flex; gap: 6px; align-items: center; }
.student-file .profile-head { margin-bottom: 12px; }
.student-file .ph-row { display: flex; gap: 14px; align-items: center; }
.student-file .ph-row h1 { margin: 0; }
.student-file .profile-layout { display: grid; gap: 12px; }
@media (min-width: 720px) { .student-file .profile-layout { grid-template-columns: 200px minmax(0, 1fr); align-items: start; } }
.student-file .profile-nav { display: flex; gap: 6px; overflow-x: auto; }
@media (min-width: 720px) { .student-file .profile-nav { flex-direction: column; overflow: visible; } }
.student-file .profile-nav button { text-align: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; white-space: nowrap; display: flex; flex-direction: column; }
.student-file .profile-nav button.on { border-color: var(--accent); background: var(--teal-soft); font-weight: 700; }
.student-file .profile-nav small { color: var(--muted); font-weight: 400; }
.more-list { display: grid; gap: 8px; }
.wiz-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; }
.wiz-steps li { flex: 1; text-align: center; padding: 6px 4px; border-radius: 8px; background: #EEF1F4; color: var(--muted); }
.wiz-steps li.on { background: var(--accent); color: #fff; font-weight: 700; }
.wiz-steps li.done { background: var(--teal-soft); color: var(--teal); }
.method-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpis-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.kpis-row .kpi { border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; font-size: 13px; }
.kpis-row .kpi b { display: block; font-size: 22px; }
.kpis-row .kpi.ok b { color: var(--teal); } .kpis-row .kpi.warn b { color: #B7791F; } .kpis-row .kpi.bad b { color: var(--red); }
.amb { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: grid; gap: 4px; }
.tpl-box { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--line); }
.tpl-ask, .tpl-picker { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 8px; }
.tpl-ask[hidden], .tpl-picker[hidden] { display: none; }
.res-list { line-height: 2; font-size: 16px; }
.wiz-done { color: var(--teal); }
.wiz .scroll { overflow-x: auto; }
.wiz table.grid { min-width: 520px; }

.tab-chip { cursor: pointer; }
.chips .tab-chip { white-space: nowrap; border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 14px; background: #fff; }
.chips .tab-chip.on { border-color: var(--accent); background: var(--teal-soft); font-weight: 700; }
.teacher-file .chips { margin: 12px 0; }
.tabs-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tabs-scroll .tab-chip { flex: none; }

.picker-btn { font: inherit; font-size: 14px; text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-btn.has-value { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.picker-list { display: grid; gap: 4px; }
.picker-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: right;
  background: none; border: none; border-top: 1px solid var(--line); padding: 12px 4px; font: inherit; font-size: 15px; cursor: pointer; }
.picker-row:first-child { border-top: none; }
.picker-row:hover { background: var(--teal-soft); }
.picker-row.on { color: var(--accent); font-weight: 700; }
.picker-row.back { color: var(--muted); justify-content: flex-start; gap: 6px; }

.file-hero { display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 12px; border-radius: 14px;
  background: var(--teal-soft); border: 1px solid rgba(15,118,110,.15); }
.file-hero .s-photo.lg { width: 84px; height: 84px; }
.file-hero-text { min-width: 0; flex: 1; }
.file-hero-text h2 { margin: 0; font-size: 19px; color: var(--navy); }
.file-hero-text p { margin: 2px 0 6px; color: var(--muted); }
.file-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cred-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: #fff; }
.cred-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cred-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.cred-line, .cred-pw { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; min-width: 0; }
.cred-val { font-size: 1.05rem; font-weight: 700; letter-spacing: .5px; word-break: break-all; }
.cred-row a { word-break: break-all; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 10px 0; }
.info-block { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.info-block h4 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
@media (max-width: 600px) {
  .file-hero { flex-direction: column; text-align: center; }
  .file-hero-tags, .file-hero-text .row { justify-content: center !important; }
  .cred-row { grid-template-columns: 1fr; gap: 2px; }
}

.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-item, .stu-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.today-no { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--teal-soft); }
.stu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stu-main b { overflow: hidden; text-overflow: ellipsis; }
.stu-main small { color: var(--muted); font-size: 12px; }
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.class-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.class-card:hover { border-color: var(--accent); }
.class-card > b { font-size: 15px; color: var(--navy); }
.cc-subjects { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-acts { display: flex; gap: 6px; margin-top: auto; }
.cc-acts .btn { flex: 1; }
.stu-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.stu-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.stu-stats { display: flex; gap: 4px; flex: none; }
.stu-stats .att-count { padding: 2px 8px; font-size: 12px; }
.stu-today { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--bg); color: var(--muted); }
.stu-today.s-present { background: var(--teal-soft); color: var(--teal); }
.stu-today.s-absent { background: var(--red-soft); color: var(--red); }
.stu-today.s-late { background: var(--amber-soft); color: var(--amber-ink); }
.stu-today.s-excused { background: var(--violet-soft); color: var(--violet); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.pw-rules span { display: inline-flex; align-items: center; gap: 4px; }
.pw-rules .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: inline-block; }
.pw-rules .ok { color: var(--teal); font-weight: 700; }
.pw-rules .bad { color: var(--red); font-weight: 700; }
@media (max-width: 560px) {
  .stu-row { flex-wrap: wrap; }
  .stu-stats { order: 3; width: 100%; padding-inline-start: 34px; }
  .stu-stats:empty { display: none; }
}

.att-parts { margin-bottom: 12px; }
.att-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 14px; }
.att-kpis > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; color: var(--ink); }
.att-kpis > div b { display: block; font-size: 24px; color: var(--accent); }
.att-kpis .s-present b { color: var(--teal); } .att-kpis .s-absent b { color: var(--red); }
.att-kpis .s-late b { color: var(--amber-ink); } .att-kpis .s-excused b { color: var(--violet); } .att-kpis .s-rate b { color: var(--navy); }
.att-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.att-class { display: flex; flex-direction: column; gap: 6px; text-align: start; font: inherit; color: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.att-class:hover:not(:disabled), .att-class:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--teal-soft); outline: none; }
.att-class:disabled { cursor: default; opacity: .6; }
.ac-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ac-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.ac-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.att-class.partial .ac-bar span { background: var(--amber); }
.ac-counts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.ac-counts .s-absent { color: var(--red); font-weight: 700; } .ac-counts .s-late { color: var(--amber-ink); font-weight: 700; }
.ac-counts .s-excused { color: var(--violet); font-weight: 700; } .ac-counts .s-present { color: var(--teal); font-weight: 700; }
.att-class small { color: var(--muted); font-size: 11px; }
.att-people { display: flex; flex-direction: column; gap: 6px; }
.att-person { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.att-person-acts { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.att-reason { color: var(--ink) !important; } .att-reason.pending { color: var(--amber-ink) !important; }
.excuse-text { margin: 4px 0 0; padding: 6px 10px; background: var(--bg); border-radius: 8px; font-size: 14px; }
.att-why { align-self: flex-start; margin-top: 4px; font: inherit; font-size: 12px; color: var(--accent); background: none; border: 1px dashed var(--line); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.att-why-box { display: flex; gap: 6px; margin-top: 6px; }
.att-why-box input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; }
.rate-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 52px; align-items: center; gap: 10px; padding: 6px 0; }
.rate-row small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; margin-top: -4px; }
.rate-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.rate-bar span { display: block; height: 100%; background: var(--teal); }
.rate-bar span.low, .day-bar span.low { background: var(--red); }
.day-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; overflow-x: auto; padding-bottom: 18px; }
.day-bar { flex: 1 0 18px; max-width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.day-bar span { display: block; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 2px; }
.day-bar small { position: absolute; bottom: -16px; inset-inline: 0; text-align: center; font-size: 10px; color: var(--muted); }
.att-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.att-table th, .att-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.att-table th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--bg); }
.att-table tr.low td:first-child { box-shadow: inset -3px 0 0 var(--red); }
.att-table .n-absent { color: var(--red); font-weight: 700; } .att-table .n-late { color: var(--amber-ink); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.att-days { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.att-day-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.att-day-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-day-main small { color: var(--muted); font-size: 13px; }
.att-day-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sa-list { display: flex; flex-direction: column; gap: 8px; }
.sa-card { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.sa-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.sa-top small { margin-inline-start: auto; color: var(--muted); font-size: 12px; }
.sa-kind { font-size: 12px; font-weight: 700; color: var(--navy); background: var(--navy-soft); padding: 1px 9px; border-radius: 20px; }
.sa-level { font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 20px; background: var(--amber-soft); color: var(--amber-ink); }
.lv-urgent .sa-level { background: var(--red-soft); color: var(--red); } .lv-positive .sa-level { background: var(--teal-soft); color: var(--teal); }
.sa-title { display: block; font-size: 15px; color: var(--navy); }
.sa-body { margin: 4px 0 0; color: var(--ink); white-space: pre-line; }
.sa-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sa-foot small { color: var(--muted); font-size: 12px; }
.ok-text { color: var(--teal) !important; font-weight: 700; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.stu-acts { flex: none; }
@media (max-width: 600px) {
  .att-person { flex-wrap: wrap; }
  .att-person .stu-main { flex-basis: calc(100% - 90px); }
  .att-person-acts { width: 100%; }
  .att-person-acts > * { flex: 1; text-align: center; }
  .att-day-row { flex-direction: column; align-items: stretch; }
  .att-day-side { justify-content: flex-start; }
  .rate-row { grid-template-columns: 90px 1fr 46px; }
  .stu-acts { width: 100%; padding-inline-start: 34px; }
}
@media print {
  .att-parts, .att-person-acts, .att-table td:last-child, .att-table th:last-child { display: none !important; }
}

.xb-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.xb-chip { font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--ink); }
.xb-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.xb-chip .n { opacity: .7; margin-inline-start: 4px; }

.dz { display: flex; flex-direction: column; gap: 12px; }
.dz-hero { margin: 0; align-items: flex-start; }
.dz-hero b { font-size: 16px; }
.dz-hero span { line-height: 1.8; font-size: 14px; }
.dz-tabs { margin: 0; }
.dz-wizard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dz-steps { list-style: none; margin: 0 0 16px; padding: 0 0 12px; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.dz-steps li { flex: 1; min-width: 86px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.dz-steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.dz-steps li.on { color: var(--navy); font-weight: 700; } .dz-steps li.on span { background: var(--accent); color: #fff; border-color: var(--accent); }
.dz-steps li.done span { background: var(--teal-soft); color: var(--teal); border-color: var(--teal-soft); }
.dz-h { font-size: 15px; margin: 4px 0 8px; color: var(--navy); }
.dz-schools, .dz-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.dz-schools { margin-top: 10px; }
.dz-school, .dz-op { font: inherit; text-align: start; display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; color: var(--ink); }
.dz-school:hover, .dz-op:hover:not(:disabled) { border-color: var(--accent); background: var(--teal-soft); }
.dz-school b, .dz-op b { color: var(--navy); font-size: 15px; }
.dz-school small, .dz-op small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.dz-op.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--teal-soft); background: #fff; }
.dz-op:disabled { opacity: .55; cursor: not-allowed; }
.dz-why { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 600; }
.dz-school-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dz-school-bar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.dz-school-bar small { color: var(--muted); }
.dz-group { margin-bottom: 10px; }
.dz-op-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.dz-op-top h3 { margin: 0; font-size: 17px; color: var(--navy); }
.dz-extra:not(:empty) { margin-top: 12px; }
.dz-param { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.dz-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 8px; }
.dz-cat { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.dz-cat:hover { border-color: var(--accent); }
.dz-cat input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.dz-cat span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dz-cat small { color: var(--muted); font-size: 12px; }
.dz-cat em { font-style: normal; font-weight: 700; color: var(--accent); font-size: 14px; }
.dz-cat.off { opacity: .5; cursor: default; }
.dz-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dz-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.dz-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 16px; }
.dz-card p { margin: 6px 0; line-height: 1.8; }
.dz-impact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dz-affected, .dz-unaffected { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; }
.dz-affected h4, .dz-unaffected h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.dz-affected h4 { color: var(--red); } .dz-unaffected h4 { color: var(--teal); }
.dz-affected h4::before, .dz-unaffected h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dz-unaffected ul { margin: 0; padding-inline-start: 18px; line-height: 1.9; font-size: 14px; }
.dz-total { font-weight: 700; margin: 8px 0 0; color: var(--navy); }
.dz-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dz-table td, .dz-table th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.dz-table th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); }
.dz-table td.n { text-align: end; font-weight: 700; white-space: nowrap; color: var(--navy); }
.dz-review { margin: 0; padding-inline-start: 18px; line-height: 2; }
.dz-ok { display: flex; flex-direction: column; gap: 4px; background: var(--teal-soft); color: var(--teal); border-radius: 12px; padding: 12px 14px; }
.dz-ok b { display: inline-flex; align-items: center; gap: 6px; }
.dz-ok small { color: var(--muted); }
.dz-ok.big b { font-size: 16px; }
@media (max-width: 640px) {
  .dz-impact { grid-template-columns: 1fr; }
  .dz-steps li { min-width: 64px; font-size: 11px; }
  .dz-wizard { padding: 12px; }
}
.att-inline .s-present b { color: var(--teal); } .att-inline .s-absent b { color: var(--red); }
.att-inline .s-late b { color: var(--amber-ink); } .att-inline .s-excused b { color: var(--violet); }

.job-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; }
.job-row b { color: var(--teal); font-variant-numeric: tabular-nums; }
.job-bar { height: 10px; border-radius: 6px; margin: 8px 0 12px; }
.job-bar > i { background: var(--teal); border-radius: 6px; transition: width .4s ease; }

.sub-banner.stack { flex-direction: column; align-items: stretch; }
.sub-banner.stack .btn { align-self: flex-start; }

.fin-parts { position: sticky; top: var(--sat); z-index: 3; background: var(--bg); padding: 6px 0; }
.fin-range { align-items: end; margin-bottom: 10px; }
.fin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.fin-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fin-card h3 { margin: 0 0 4px; font-size: 16px; }
.fin-card.amber { border-color: var(--amber); }
.fin-card .btn { align-self: flex-start; margin-top: auto; }
.fin-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fin-row > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(260px, 1.6fr) auto; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line); }
.st-who { min-width: 0; }
.st-pay { display: flex; gap: 8px; align-items: end; }
.st-pay .field { margin: 0; flex: 1; min-width: 90px; }
.st-total { display: flex; flex-direction: column; min-width: 90px; }
.st-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pay-list { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 8px 0 12px; max-height: 420px; overflow: auto; }
.pay-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.pay-line:first-child { border-top: 0; }
.pay-item { display: grid; grid-template-columns: minmax(170px, 1.2fr) 2fr minmax(110px, auto); gap: 12px; align-items: end;
  padding: 12px 0; border-top: 1px solid var(--line); }
.pay-fields { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 8px; }
.pay-fields .field { margin: 0; }
.pay-net { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
@media (max-width: 760px) {
  .st-row, .pay-item { grid-template-columns: 1fr; }
  .st-acts { justify-content: flex-start; }
  .pay-fields { grid-template-columns: repeat(2, 1fr); }
  .pay-net { flex-direction: row; align-items: center; }
}
input.num { text-align: left; font-variant-numeric: tabular-nums; }

.tabs-layout > [role="tabpanel"], .profile-layout > * { min-width: 0; }
.panel { min-width: 0; }
.panel > table, .panel > .grid, .panel > div > table.grid { display: block; overflow-x: auto; max-width: 100%; }

.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--navy); cursor: pointer; -webkit-app-region: no-drag; }
.bell-btn:hover { background: var(--bg); }
.bell-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--amber); color: var(--navy); font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; }
.inbox-dialog { display: grid; gap: 12px; min-width: min(460px, 86vw); }
.inbox-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.inbox-item { display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.inbox-item.unread { border-color: var(--teal); background: var(--teal-soft); }
.inbox-item .ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); }
.inbox-item .tx { display: grid; gap: 2px; min-width: 0; }
.inbox-item .tx small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.inbox-item .tx small.muted { font-size: 11.5px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.check-grid .check { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.check-grid .check:hover { background: var(--bg); }
.check-grid .check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.ncenter { display: grid; gap: 10px; }
.ncenter-head { display: flex; gap: 8px; align-items: center; }
.ncenter-head input { flex: 1; min-width: 0; }
.nchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.nchip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.nchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nchip .n { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.inbox-row { display: flex; align-items: stretch; gap: 4px; }
.inbox-row .inbox-item { flex: 1; min-width: 0; }
.inbox-row.unread .inbox-item { border-color: var(--teal); background: var(--teal-soft); }
.inbox-item.p1 .ic { background: var(--red-soft); color: var(--red); }
.inbox-item.p2 .ic { background: var(--amber-soft); color: var(--amber-ink); }
.inbox-item .tx b { overflow-wrap: anywhere; }
.inbox-item .prio { margin-inline-start: 8px; padding: 0 6px; border-radius: 6px; font-size: 11px; }
.inbox-item .prio.p1 { background: var(--red-soft); color: var(--red); }
.inbox-item .prio.p2 { background: var(--amber-soft); color: var(--amber-ink); }
.inbox-item .rep { margin-inline-start: 8px; color: var(--muted); }
.inbox-archive { flex: none; width: 34px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; }
.inbox-archive:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.push-invite { display: grid; gap: 8px; padding: 14px; margin-bottom: 12px; border-radius: 12px; border: 1px solid var(--teal); background: var(--teal-soft); }
.push-invite .pi-head { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.push-invite .pi-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--teal); flex: none; }
.push-invite .sub { margin: 0; }
.nprefs { display: grid; gap: 8px; margin-top: 10px; }
.nprefs-list { display: grid; gap: 4px; }
.nprefs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.nprefs-row .sub { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.nprefs-row .switch[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.push-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.push-toggle .sub { margin: 0; }
.rules-table { width: 100%; border-collapse: collapse; }
.rules-table th, .rules-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; }
.rules-table td.c, .rules-table th.c { text-align: center; width: 92px; }
@media (max-width: 640px) { .bell-btn { width: 34px; height: 34px; } }

.beh-kpis .s-present b { color: var(--teal); } .beh-kpis .s-absent b { color: var(--red); }
.beh-list { display: grid; gap: 6px; }
.beh-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.beh-row .pts { flex: none; min-width: 46px; text-align: center; font-weight: 700; border-radius: 8px; padding: 4px 6px; }
.beh-row.positive .pts { color: var(--teal); background: var(--teal-soft); }
.beh-row.negative .pts { color: var(--red); background: var(--red-soft); }
.beh-row small.muted { color: var(--muted); font-size: 12px; }
.beh-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.beh-cat { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.beh-cat.positive { border-color: var(--teal); color: var(--teal); }
.beh-cat.negative { border-color: var(--red); color: var(--red); }
.beh-cat.on.positive { background: var(--teal); color: #fff; }
.beh-cat.on.negative { background: var(--red); color: #fff; }
.beh-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; }
.beh-pick label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.beh-pick label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.score-pill { display: inline-block; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 12px; font-weight: 700; background: var(--teal-soft); color: var(--teal); }
.score-pill.low { background: var(--red-soft); color: var(--red); }

.verify-card .verify-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.verify-card .verify-head h1 { margin: 0; font-size: 22px; }
.verify-card .verify-head p { margin: 2px 0 0; color: var(--muted); }
.verify-card .verify-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.verify-card.valid .verify-head { color: var(--teal); }
.verify-card.revoked .verify-head { color: var(--red); }
.cert-sheet { display: grid; gap: 18px; }
.cert { background: #fff; border: 3px double var(--navy); border-radius: 6px; padding: 26px 30px; position: relative; color: var(--ink); }
.cert .cert-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; }
.cert .cert-top .doc-school-logo, .cert .cert-top img { max-height: 64px; max-width: 120px; }
.cert .cert-school { font-weight: 700; font-size: 18px; color: var(--navy); }
.cert h2.cert-title { text-align: center; font-size: 24px; margin: 18px 0 6px; color: var(--navy); }
.cert .cert-scope { text-align: center; color: var(--muted); margin-bottom: 14px; }
.cert .cert-intro { text-align: center; font-size: 16px; line-height: 2; margin: 0 0 12px; }
.cert .cert-intro b { font-size: 19px; }
.cert table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; }
.cert th, .cert td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.cert th { background: var(--navy-soft); color: var(--navy); }
.cert .cert-result { text-align: center; font-size: 18px; font-weight: 700; margin: 10px 0; }
.cert .cert-result.pass { color: var(--teal); } .cert .cert-result.fail { color: var(--red); }
.cert .cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 18px; }
.cert .cert-qr { text-align: center; font-size: 11px; color: var(--muted); }
.cert .cert-qr img { width: 92px; height: 92px; display: block; margin: 0 auto 4px; }
.cert .cert-sign { text-align: center; min-width: 180px; }
.cert .cert-sign .line-sign { border-top: 1px solid var(--ink); margin-top: 38px; padding-top: 4px; }
.cert .cert-approval { text-align: center; font-size: 12.5px; color: var(--teal); margin: 4px 0 0; }
.cert .cert-meta { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.cert.revoked::after { content: attr(data-void); position: absolute; inset: 0; display: grid; place-items: center; font-size: 80px; color: rgba(184,65,47,.18); transform: rotate(-20deg); pointer-events: none; }
@media print {
  .cert-sheet { gap: 0; }
  .cert { break-after: page; page-break-after: always; border-radius: 0; min-height: 26cm; }
  .cert:last-child { break-after: auto; page-break-after: auto; }
}
@media (max-width: 640px) { .cert { padding: 16px 12px; } .cert h2.cert-title { font-size: 19px; } .cert table { font-size: 12px; } }

.oe-take { display: grid; gap: 12px; }
.oe-bar { position: sticky; top: var(--sat); z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; }
.oe-bar small { display: block; color: rgba(255,255,255,.8); }
.oe-bar-side { display: flex; align-items: center; gap: 12px; text-align: end; }
.oe-timer { font-size: 22px; font-variant-numeric: tabular-nums; direction: ltr; background: rgba(255,255,255,.12); padding: 2px 10px; border-radius: 8px; }
.oe-timer.low { background: var(--red); }
.oe-section h3 { margin: 6px 0 2px; color: var(--navy); }
.oe-question { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.oe-qhead { display: flex; justify-content: space-between; align-items: center; }
.oe-qtext { font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.oe-img { display: block; margin: 0 auto; height: auto; border-radius: 8px; max-height: 360px; }
.oe-choices { display: grid; gap: 8px; }
.oe-choices.tf { grid-template-columns: 1fr 1fr; }
.oe-choices label { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-height: 48px; }
.oe-choices label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.oe-choices input { width: 20px; height: 20px; flex: none; }
.oe-opt-img { display: block; max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 6px; margin-bottom: 4px; }
.oe-choices.with-img { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.oe-choices.with-img label { flex-direction: column; align-items: stretch; text-align: center; }
.oe-media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 8px 0; }
.oe-media .xb-media-link, .xb-media-link { word-break: break-all; overflow-wrap: anywhere; font-size: 13px; }
.oe-media video.xb-media, .oe-media audio.xb-media { width: 100%; }
.oe-media video, .oe-media audio { width: 100%; border-radius: 10px; }
.oe-media video { background: #000; max-height: 360px; }
.oe-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.oe-plays { font-size: 13px; }
.oe-file { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.oe-file a { display: block; min-width: 0; }
.oe-file img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; justify-self: center; }
.oe-file audio { width: 100%; }
.oe-rec { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.oe-rec .oe-rec-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--red, #c0392b); }
.oe-fill { display: grid; gap: 8px; }
.oe-match { display: grid; gap: 8px; }
.oe-match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.oe-match-row select { width: 100%; min-height: 44px; }
.oe-order { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.oe-order li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.oe-order-btns { display: flex; gap: 4px; flex: none; }
.oe-table { border-collapse: collapse; width: 100%; } .oe-table td, .oe-table th { border: 1px solid var(--line); padding: 6px; text-align: center; }
.oe-submit { padding: 6px 0 20px; }
.oe-take { --oe-scale: 1; }
.oe-take .oe-qtext { font-size: calc(16px * var(--oe-scale)); }
.oe-take .oe-choices label, .oe-take .oe-fill input, .oe-take textarea { font-size: calc(15px * var(--oe-scale)); }
.oe-progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: -6px; }
.oe-progress i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .3s; }
.oe-tools { display: flex; gap: 6px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.oe-map { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.oe-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.oe-map-grid button { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; position: relative; }
.oe-map-grid button.done { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.oe-map-grid button.flag::after { content: ""; position: absolute; top: 4px; inset-inline-end: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #d68910); }
.oe-map-grid button.here { outline: 2px solid var(--navy); outline-offset: 1px; }
.oe-map-grid button:disabled { opacity: .45; cursor: not-allowed; }
.oe-map-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.oe-map-key .k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line); margin-inline-end: 4px; vertical-align: -1px; }
.oe-map-key .k.done::before { background: var(--teal-soft); border-color: var(--teal); }
.oe-map-key .k.flag::before { background: var(--amber, #d68910); border-color: transparent; border-radius: 50%; }
.oe-flag { border: 1px dashed var(--line); background: none; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; margin-inline-start: auto; }
.oe-flag.on { border-style: solid; border-color: var(--amber, #d68910); color: var(--amber, #b9770e); background: #fff8e8; }
.oe-qhead { gap: 8px; }
.oe-page { display: grid; gap: 12px; }
.oe-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 22px; }
.oe-nav-btns { display: flex; gap: 8px; margin-inline-start: auto; }
.oe-nav-btns .btn { min-width: 110px; min-height: 46px; }
.oe-pageno { color: var(--muted); font-size: 13px; }
.oe-start { display: grid; gap: 12px; }
.oe-start h2 { margin: 0; }
.oe-start-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.oe-start-facts > div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; display: grid; }
.oe-start-facts b { font-size: 22px; color: var(--navy); }
.oe-start-facts small { color: var(--muted); }
.oe-start-facts > div.warn b { color: var(--red); }
.oe-start-h { margin: 4px 0 0; font-size: 15px; }
.oe-rules { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; line-height: 1.7; }
.oe-code { font-size: 20px; letter-spacing: 3px; text-align: center; text-transform: uppercase; }
.oe-review-page { display: grid; gap: 12px; }
.oe-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.oe-jump { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; cursor: pointer; }
.oe-jump:disabled { cursor: default; opacity: .7; }
.oe-analysis { display: grid; gap: 8px; }
.oe-an-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: #fff; }
.oe-an-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.oe-an-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.oe-an-bar i { display: block; height: 100%; background: var(--teal); }
.oe-an-bar.low i { background: var(--red); } .oe-an-bar.mid i { background: var(--amber, #d68910); }
.oe-an-opts { display: grid; gap: 3px; font-size: 13px; }
.oe-an-opts span.right { color: var(--teal); font-weight: 700; }
.oe-live { font-size: 12px; color: var(--muted); }
.oe-done { text-align: center; } .oe-score { font-size: 22px; font-weight: 700; color: var(--teal); }
dialog.oe-grade-dialog { width: min(760px, 96vw); }
.oe-review-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-height: 70vh; overflow-y: auto; }
.oe-review { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; background: #fff; min-width: 0; }
.oe-opts { margin: 0; padding-inline-start: 18px; } .oe-opts li.right { color: var(--teal); font-weight: 700; } .oe-opts li.picked::after { content: " ← إجابته"; color: var(--muted); font-weight: 400; font-size: 12px; }
.oe-essay { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 640px) { .oe-match-row { grid-template-columns: 1fr; } }

.sa-list { display: grid; gap: 6px; margin: 10px 0; }
.sa-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sa-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.sa-st { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; min-height: 34px; }
.sa-st.on.s-present { background: var(--teal); color: #fff; border-color: var(--teal); }
.sa-st.on.s-late { background: var(--amber); color: var(--navy); border-color: var(--amber); }
.sa-st.on.s-absent { background: var(--red); color: #fff; border-color: var(--red); }
.sa-st.on.s-leave, .sa-st.on.s-excused { background: var(--violet); color: #fff; border-color: var(--violet); }
.lp-view { display: grid; gap: 8px; min-width: min(560px, 86vw); }
.lp-block p { margin: 2px 0 0; white-space: pre-wrap; }
.lp-form textarea { min-height: 70px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month .dow { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-day { min-height: 84px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: grid; align-content: start; gap: 2px; min-width: 0; }
.cal-day.out { background: transparent; border-style: dashed; opacity: .55; }
.cal-day.today { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.cal-day .n { font-size: 12px; font-weight: 700; color: var(--navy); }
.cal-ev { font-size: 11px; line-height: 1.35; border-radius: 4px; padding: 1px 4px; background: var(--navy-soft); color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border: 0; text-align: start; font-family: inherit; }
.cal-ev.holiday { background: var(--amber-soft); color: var(--amber-ink); }
.cal-ev.exam { background: var(--red-soft); color: var(--red); }
.cal-ev.term { background: var(--teal-soft); color: var(--teal); }
.cal-list { display: grid; gap: 6px; }
.cal-item { display: flex; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; align-items: flex-start; }
.cal-item .d { flex: none; width: 54px; text-align: center; border-radius: 8px; background: var(--navy-soft); color: var(--navy); padding: 4px; font-weight: 700; line-height: 1.2; }
.cal-item .d small { display: block; font-weight: 400; font-size: 11px; }
@media (max-width: 640px) {
  .sa-row { grid-template-columns: 1fr; }
  .cal-month { display: none; }
}

.sv-rating { display: flex; gap: 6px; }
.sv-rating label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 0; cursor: pointer; }
.sv-rating input { display: none; }
.sv-rating label:has(input:checked) { background: var(--teal); color: #fff; border-color: var(--teal); }
.sv-bar { display: grid; grid-template-columns: minmax(80px, 30%) 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.sv-bar i { display: block; height: 10px; border-radius: 6px; background: var(--teal); min-width: 2px; }
.mt-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fff; }
.mt-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mt-slot { border: 1px solid var(--teal); color: var(--teal); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; direction: ltr; min-height: 38px; }
.mt-slot:hover { background: var(--teal-soft); }

.ai-ask { display: flex; gap: 8px; align-items: flex-end; margin: 10px 0 4px; }
.ai-ask textarea { flex: 1; min-height: 48px; resize: vertical; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ai-suggest .chip { color: var(--navy); font-weight: 500; text-align: right; }
.ai-privacy { display: block; margin-top: 6px; }
.ai-thread { display: flex; flex-direction: column; gap: 14px; }
.ai-turn { display: flex; flex-direction: column; gap: 6px; }
.ai-q { align-self: flex-start; max-width: 85%; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 14px 14px 14px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-a { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 14px; padding-inline-start: 34px; overflow-wrap: anywhere; min-width: 0; }
.ai-mark { position: absolute; inset-inline-start: 10px; top: 12px; color: var(--teal); }
.ai-answer p { margin: 0 0 8px; line-height: 1.8; }
.ai-answer h4 { margin: 10px 0 6px; font-size: 15px; }
.ai-answer ul, .ai-answer ol { margin: 0 0 8px; padding-inline-start: 20px; line-height: 1.8; }
.ai-answer table { margin: 6px 0 10px; font-size: 13px; }
.ai-wait { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.ai-wait span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: ai-dot 1s infinite ease-in-out; }
.ai-wait span:nth-child(2) { animation-delay: .15s; } .ai-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 600px) { .ai-ask { flex-direction: column; align-items: stretch; } .ai-q { max-width: 100%; } }
.ai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.ai-card { display: flex; gap: 10px; align-items: flex-start; text-align: right; font: inherit; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; color: var(--ink); }
.ai-card:hover { border-color: var(--teal); }
.ai-card.on { border-color: var(--teal); background: var(--teal-soft); }
.ai-card b { display: block; font-size: 15px; }
.ai-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ai-card-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.ai-params { align-items: end; margin-bottom: 6px; }
.ai-report { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.ai-tips { background: var(--amber-soft); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.ai-tips ul { margin: 6px 0 0; }
@media (max-width: 600px) { .ai-cards { grid-template-columns: 1fr 1fr; } .ai-card { flex-direction: column; } }
.gw-steps { margin: 6px 0 10px; padding-inline-start: 20px; line-height: 1.9; }
.wa-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.wa-vars .chip { color: var(--teal); }
.wa-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.wa-progress .bar { flex: 1; height: 8px; margin: 0; }
.wa-progress .bar > i { background: var(--teal); }
.wa-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--bg); }
.wa-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; line-height: 1.8; }
.wa-actions { display: flex; gap: 8px; margin: 12px 0 6px; }
.wa-actions .wa-send { flex: 1; text-align: center; background: #1f9d55; border-color: #1f9d55; }
.wa-done { text-align: center; padding: 18px 0; }
.sw-line { display: inline-flex; align-items: center; gap: 8px; }

.gc-rows { display: grid; gap: 8px; margin: 12px 0; }
.gc-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gc-row .gc-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; font-size: 13px; }
.gc-row .gc-w, .gc-row .gc-d { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .gc-row { grid-template-columns: 28px minmax(0, 1fr); }
  .gc-row .gc-w, .gc-row .gc-d { grid-column: 2; }
}

.pc-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 16px; }
.pc-wrap { display: grid; gap: 8px; align-content: start; }
.pc { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 20px rgba(20, 33, 61, .06); break-inside: avoid; }
.pc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; background: var(--teal, #0f5e5f); color: #fff; }
.pc-school { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc-school b { display: block; font-size: 15px; line-height: 1.3; }
.pc-school small { color: #cfe7e6; font-size: 12px; }
.pc-logo { height: 38px; width: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; flex: none; }
.pc-tag { font-weight: 800; color: var(--amber, #ffb703); font-size: 14px; }
.pc-body { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 14px; padding: 14px 16px 10px; align-items: start; }
.pc-name { font-size: 20px; font-weight: 800; color: var(--navy, #14213d); line-height: 1.35; margin-bottom: 8px; }
.pc-meta { display: grid; gap: 4px; margin-bottom: 10px; }
.pc-meta span { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.pc-meta small { color: var(--muted); min-width: 68px; }
.pc-key { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px dashed var(--amber, #ffb703); background: var(--amber-soft, #fff4d6); border-radius: 12px; }
.pc-key small { color: #7a5800; font-weight: 600; }
.pc-key b { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: 1.5px; color: var(--navy, #14213d); }
.pc-qr { margin: 0; text-align: center; }
.pc-qr img { width: 118px; height: 118px; display: block; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; }
.pc-qr figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pc-foot { display: grid; gap: 2px; padding: 8px 16px 12px; background: var(--bg); font-size: 11.5px; color: var(--muted); text-align: center; }
.pc-foot .ltr { color: var(--teal, #0f5e5f); font-weight: 700; font-size: 12.5px; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-single { max-width: 520px; }
@media (max-width: 420px) { .pc-body { grid-template-columns: minmax(0, 1fr) 96px; } .pc-qr img { width: 96px; height: 96px; } }
@media print {
  .no-print, .pc-actions { display: none !important; }
  .pc-sheet { grid-template-columns: repeat(2, 1fr); gap: 8mm; }
  .pc { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.pc-print-one .pc:not(.pc-printing), body.pc-print-one .panel, body.pc-print-one .toolbar { display: none !important; }
  body.pc-print-one .pc-sheet { display: block; }
  body.pc-print-one .pc.pc-printing { max-width: 120mm; margin: 0 auto; }
}

/* Demo school: a small button in the header, nothing fixed over the screen. */
.demo-pill { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: #E8A33D; color: #16244A;
  font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.demo-pill:focus-visible { outline: 3px solid rgba(232, 163, 61, .45); outline-offset: 2px; }
.demo-info p { margin: 0 0 10px; line-height: 1.9; }
@media (max-width: 380px) { .demo-pill { padding: 0 9px; font-size: 12px; } }
@media print { .demo-pill { display: none !important; } }
.ac { width: 86mm; height: 54mm; box-sizing: border-box; border: 1px solid var(--line); border-radius: 3mm; background: #fff; color: var(--ink);
  display: flex; align-items: center; gap: 3mm; padding: 3.5mm 4mm; overflow: hidden; position: relative; border-top: 3mm solid var(--navy); }
.ac-info { flex: 1; min-width: 0; display: grid; gap: 1mm; align-content: center; }
.ac-school { font-size: 9pt; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-kind { font-size: 8pt; font-weight: 700; color: var(--teal); }
.ac-name { font-size: 12.5pt; line-height: 1.3; }
.ac-class { font-size: 10pt; color: var(--navy); font-weight: 600; }
.ac-foot { font-size: 6.5pt; color: var(--muted); margin-top: 1mm; }
.ac-qr { width: 38mm; height: 38mm; flex: none; image-rendering: pixelated; }
.ac-preview { display: grid; justify-items: center; gap: 10px; overflow-x: auto; }
.ac-sheet { display: none; }
@media print {
  body.ac-printing > :not(.ac-sheet) { display: none !important; }
  body.ac-printing .ac-sheet { display: grid; grid-template-columns: repeat(2, 86mm); gap: 5mm 6mm; justify-content: center; padding: 6mm 0; }
  body.ac-printing .ac { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.gate-card-page { max-width: 460px; margin: 0 auto; padding: 48px 20px; text-align: center; }
.gate-card-page img { margin: 0 auto 12px; display: block; }
.stu-today.s-permitted, .gb-st.s-permitted { background: var(--navy-soft); color: var(--navy); }
.stu-today.s-trip, .stu-today.s-activity { background: var(--teal-soft); color: var(--teal); }
.gate-admin { display: grid; gap: 14px; }
.gate-phase { border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.gate-phase.open { background: var(--teal-soft); color: var(--teal); }
.gate-phase.wait { background: var(--amber-soft); color: var(--amber-ink); }
.gate-phase.closed { background: var(--red-soft); color: var(--red); }
.gate-phase.done { background: var(--navy-soft); color: var(--navy); }
.gate-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gate-stats .gs { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; }
.gate-stats .gs b { font-size: 24px; line-height: 1.2; color: var(--navy); }
.gate-stats .gs small { color: var(--muted); font-size: 12.5px; }
.gate-stats .gs.ok b { color: var(--teal); } .gate-stats .gs.late b { color: var(--amber-ink); }
.gate-stats .gs.warn { border-color: var(--amber); background: var(--amber-soft); } .gate-stats .gs.bad b { color: var(--red); }
.gate-rate { text-align: center; } .gate-rate b { display: block; font-size: 26px; color: var(--teal); } .gate-rate small { color: var(--muted); }
.gate-feed { display: grid; gap: 6px; max-height: 480px; overflow-y: auto; }
.gf-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--bg);
  border-inline-start: 4px solid var(--line); }
.gf-row.r-present { border-color: var(--teal); } .gf-row.r-late { border-color: var(--amber); } .gf-row.r-rejected { border-color: var(--red); }
.gf-main { display: grid; min-width: 0; } .gf-main small { color: var(--muted); font-size: 12.5px; }
.gf-side { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; } .gf-side small { color: var(--muted); font-size: 12px; }
.gate-groups { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gate-group { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; display: grid; gap: 2px; align-content: start; }
.gg-head { display: flex; align-items: center; gap: 8px; } .gg-head small { color: var(--muted); flex: 1; }
.gate-un { display: flex; align-items: center; gap: 8px; padding: 3px 0; flex-wrap: wrap; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; } .gate-actions > input { flex: 1; min-width: 220px; }
.gate-devs { display: grid; gap: 8px; }
.gate-dev { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.gate-dev.s-pending { border-color: var(--amber); background: var(--amber-soft); }
.gd-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gate-link { display: grid; gap: 10px; justify-items: center; text-align: center; }
.gate-link-qr { width: 220px; height: 220px; image-rendering: pixelated; }
.gj-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, var(--navy), #0B4D4A); color: #fff; margin-bottom: 14px; }
.gj-hero b { font-size: 17px; }
.gj-hero p { margin: 4px 0 0; opacity: .85; line-height: 1.8; font-size: 14px; max-width: 560px; }
.gj-hero .btn { background: #F0A53A; color: #16244A; border-color: #F0A53A; font-weight: 700; padding-inline: 22px; }
.gj { display: grid; gap: 10px; justify-items: center; text-align: center; }
.gj-step { margin: 0; color: var(--muted); }
.gj-code { font: 800 46px/1.1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 8px; color: var(--navy); background: var(--teal-soft);
  border-radius: 16px; padding: 10px 18px; }
.gj-joined { display: grid; gap: 6px; width: 100%; }
.gj-dev { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg); }
.gj-wait { margin: 0; }
.gate-link-url { font-size: 12px; overflow-wrap: anywhere; background: var(--bg); padding: 6px 8px; border-radius: 8px; max-width: 100%; }
.gate-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 10px; }
.ac-item { display: grid; gap: 6px; justify-items: start; overflow-x: auto; }
.att-name .att-gate { color: var(--teal); font-weight: 600; }
.att-monthly { margin: 8px 0; } .att-monthly td, .att-monthly th { text-align: center; white-space: nowrap; }
.gate-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: end; margin-bottom: 8px; }
.gate-records td, .gate-records th { white-space: nowrap; }
.gate-stage { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; margin-bottom: 8px; background: #fff; }

.kid-switch { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.kid-switch::-webkit-scrollbar { display: none; }
.kid-switch a, .kid-switch span { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.kid-switch .on { background: var(--navy); color: #fff; border-color: var(--navy); }
button.link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.pa-list { display: grid; gap: 6px; margin-top: 8px; }
.pa-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-align: start; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.pa-row:hover { border-color: var(--teal); }
.pa-main { display: grid; min-width: 0; flex: 1; }
.pa-kids { display: flex; gap: 4px; flex-wrap: wrap; }
.pa-kid { font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.pa-kid.old { background: var(--bg); color: var(--muted); text-decoration: line-through; }
.pa-creds { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.pa-cred { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.pa-cred > div { display: grid; }
.pa-results { display: grid; gap: 4px; margin: 6px 0; }
.pa-pick { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; text-align: start; }
.pa-pick:hover { border-color: var(--teal); }

.start-here { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 8px; margin-bottom: 16px; }
.start-here .sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.start-here h3 { margin: 0; font-size: 18px; }
.start-here .sh-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.start-here .sh-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; flex: none; }
.start-here .sh-close:hover { background: var(--bg); }
.start-here .sh-bar { height: 6px; background: var(--bg); border-radius: 99px; margin: 14px 0 6px; overflow: hidden; }
.start-here .sh-bar span { display: block; height: 100%; background: var(--teal, #0B7A75); border-radius: 99px; transition: width .3s; }
.start-here .sh-list { list-style: none; margin: 0; padding: 0; }
.start-here .sh-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.start-here .sh-list li:first-child { border-top: 0; }
.start-here .sh-mark { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--muted); }
.start-here li.done .sh-mark { background: var(--teal, #0B7A75); border-color: transparent; color: #fff; }
.start-here li.done b { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.start-here .sh-text { display: grid; gap: 3px; min-width: 0; padding-top: 3px; }
.start-here .sh-text small { color: var(--muted); font-size: 13px; }
.start-here .sh-go { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; text-align: start; }
.start-here .sh-go:hover { color: var(--teal, #0B7A75); }
.start-here .sh-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.chat-rows { display: grid; gap: 8px; }
.chat-row { font: inherit; color: inherit; text-align: start; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s; }
.chat-row:hover { border-color: var(--teal); }
.chat-row.unread { border-color: var(--teal); background: var(--teal-soft); }
.chat-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px;
  background: var(--teal-soft); color: var(--teal); }
.chat-row.unread .chat-avatar { background: var(--teal); color: #fff; }
.chat-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-row-text small { color: var(--muted); font-size: 13px; }
.chat-preview { color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-side { display: grid; justify-items: end; gap: 6px; flex: none; }
.chat-row-side small { color: var(--muted); font-size: 12px; }
.chat-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; }
.chat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head small { display: block; color: var(--muted); font-size: 13px; }
.chat-back { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-back svg { transform: scaleX(-1); }
.chat-more { align-self: center; margin: 8px 0 0; }
.chat-list { display: flex; flex-direction: column; gap: 8px; padding: 14px; height: min(58vh, 520px); overflow-y: auto; background: var(--bg); }
.chat-msg { max-width: 82%; padding: 9px 12px 6px; border-radius: 14px; line-height: 1.7; }
.chat-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg small { display: block; font-size: 11px; opacity: .75; margin-top: 2px; }
.chat-msg.mine { align-self: flex-start; background: var(--teal); color: #fff; border-end-start-radius: 4px; }
.chat-msg.theirs { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-end-end-radius: 4px; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; border-radius: 12px; }
.chat-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: var(--teal); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chat-send:disabled { opacity: .5; }

/* Student file */
.sf-head { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.sf-avatar { width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover; }
.sf-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sf-id h1 { margin: 0; font-size: 20px; line-height: 1.4; color: var(--navy); }
.sf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sf-chips .stu-today { font-size: 12px; }
.sf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sf-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; container-type: inline-size; }
.sf-kpi span { font-size: 12.5px; color: var(--muted); }
.sf-kpi b { font-size: clamp(16px, 15cqi, 24px); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sf-kpi.teal b { color: var(--teal); } .sf-kpi.violet b { color: var(--violet); } .sf-kpi.red b { color: var(--red); }
.sf-kpi.amber b { color: #B5650F; } .sf-kpi.navy b { color: var(--navy); }
.badge.violet { color: #4E4174; background: var(--violet-soft); }
.sf-toolbar { justify-content: space-between; }
.g-line { padding: 12px 0; border-top: 1px solid var(--line); }
.panel > h2 + .g-line { border-top: 0; }
.g-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.g-score { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 16px; color: var(--navy); }
.g-score small { font-size: 12px; color: var(--muted); font-weight: 500; }
.g-bar { height: 6px; border-radius: 6px; background: var(--violet-soft); margin-top: 8px; overflow: hidden; }
.g-bar > i { display: block; height: 100%; border-radius: 6px; background: var(--violet); }
.student-file .profile-nav button { border-radius: 12px; }
@media (max-width: 719px) {
  .student-file .profile-nav { flex-wrap: wrap; overflow: visible; }
  .student-file .profile-nav button { padding: 7px 12px; }
  .student-file .profile-nav small { display: none; }
  .sf-head { padding: 14px; gap: 12px; }
  .sf-avatar { width: 60px; height: 60px; }
  .sf-id h1 { font-size: 18px; }
  .sf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1079px) {
  .student-file.app .profile-nav { display: none; }
  .student-file.app .profile-layout { grid-template-columns: minmax(0, 1fr); }
}
.push-invite { border: 0; padding: 12px 14px; gap: 6px; }
.push-invite .pi-ic { width: 32px; height: 32px; }
.push-invite .row { flex-wrap: nowrap; }
.push-invite .row > .btn { flex: 1; }
.p-avatar { flex: none; border-radius: 50%; }
.sheet-note { font-size: 11px; color: var(--muted); font-weight: 400; }
@media (max-width: 719px) {
  .sf-kpis > .sf-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sf-toolbar .btn:last-child { display: none; }
}
@media (max-width: 1079px) {
  .student-file.app:not([data-view="overview"]) > .sf-kpis,
  .student-file.app:not([data-view="overview"]) > .push-invite { display: none; }
}
@media (max-width: 1079px) {
  body.has-bnav .att-bar { bottom: calc(76px + var(--sab)); }
  body.has-bnav .xs-addbar { bottom: calc(84px + var(--sab)); }
}

/* Dashboards */
.dash-hello { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.dash-hello .dash-logo { width: 54px; height: 54px; border-radius: 16px; border: 1px solid var(--line); }
.dash-hello .dash-logo.ph { background: var(--teal-soft); border: 0; color: var(--teal); }
.dash-hello-text { min-width: 0; }
.dash-hello h2 { margin: 0; font-size: 22px; line-height: 1.35; }
.dash-hello p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ann-strip { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border: 0; border-radius: 14px;
  background: var(--navy); color: #fff; font: inherit; font-size: 13px; text-align: start; cursor: pointer; overflow: hidden; }
.ann-strip > b { flex: none; padding-inline-end: 12px; border-inline-end: 1px solid rgba(255,255,255,.25); }
.ann-strip .ann-ic { flex: none; display: grid; place-items: center; color: var(--amber); }
.ann-items { display: flex; gap: 26px; min-width: 0; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(to left, #000 85%, transparent); }
.ann-items > span { position: relative; }
.ann-items > span + span::before { content: ""; position: absolute; inset-inline-start: -15px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); transform: translateY(-50%); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; min-width: 0; container-type: inline-size; text-align: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font: inherit; color: var(--ink); }
button.kpi-card { cursor: pointer; transition: border-color .15s, transform .05s; }
button.kpi-card:hover { border-color: var(--line-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-l { font-size: 13px; color: var(--muted); }
.kpi-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.kpi-v { font-size: clamp(18px, 13cqi, 28px); line-height: 1.25; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi-bar { height: 6px; border-radius: 6px; overflow: hidden; }
.kpi-bar > i { display: block; height: 100%; border-radius: 6px; }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-card.teal .kpi-ic, .kpi-card.teal .kpi-bar { background: var(--teal-soft); } .kpi-card.teal .kpi-ic { color: var(--teal); } .kpi-card.teal .kpi-bar > i { background: var(--teal); }
.kpi-card.violet .kpi-ic, .kpi-card.violet .kpi-bar { background: var(--violet-soft); } .kpi-card.violet .kpi-ic { color: var(--violet); } .kpi-card.violet .kpi-bar > i { background: var(--violet); }
.kpi-card.amber .kpi-ic, .kpi-card.amber .kpi-bar { background: var(--amber-soft); } .kpi-card.amber .kpi-ic { color: #B5650F; } .kpi-card.amber .kpi-bar > i { background: var(--amber); }
.kpi-card.red .kpi-ic, .kpi-card.red .kpi-bar { background: var(--red-soft); } .kpi-card.red .kpi-ic { color: var(--red); } .kpi-card.red .kpi-bar > i { background: var(--red); }
.kpi-card.navy .kpi-ic, .kpi-card.navy .kpi-bar { background: var(--navy-soft); } .kpi-card.navy .kpi-ic { color: var(--navy); } .kpi-card.navy .kpi-bar > i { background: var(--navy); }
@media (max-width: 719px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 12px; gap: 6px; }
  .kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
  .dash-hello h2 { font-size: 19px; }
  .ann-strip > b { display: none; }
}
.dash-cols { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) { .dash-cols { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.stage-list { display: grid; gap: 12px; }
.stage-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stage-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; flex: none; }
.stage-card.teal .stage-ic { background: var(--teal-soft); color: var(--teal); }
.stage-card.amber .stage-ic { background: var(--amber-soft); color: #B5650F; }
.stage-card.violet .stage-ic { background: var(--violet-soft); color: var(--violet); }
.stage-card.navy .stage-ic { background: var(--navy-soft); color: var(--navy); }
.stage-name { flex: 1; min-width: 0; font-size: 15px; color: var(--navy); }
.stage-num { display: flex; flex-direction: column; align-items: center; line-height: 1.2; padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.stage-num b { font-size: 18px; color: var(--navy); }
.stage-num small { font-size: 11px; color: var(--muted); }
.grade-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.grade-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); font: inherit; cursor: pointer; color: var(--ink); }
.grade-tile small { font-size: 11.5px; color: var(--muted); }
.grade-tile b { font-size: 17px; font-variant-numeric: tabular-nums; }
.grade-tile:hover { border-color: var(--accent); }
.seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; }
.seg-tabs button { min-height: 36px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-tabs button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.act-list { display: grid; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.act-row:last-child { border-bottom: 0; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-main b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-main small, .act-when { font-size: 12px; color: var(--muted); }
.act-when { flex: none; }
.act-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--navy-soft); color: var(--navy); }
.kpi-slot { display: contents; }
.t-hero { display: flex; flex-direction: column; gap: 6px; padding: 18px; margin-bottom: 16px; border-radius: 20px; background: var(--teal); color: #fff; }
.t-hero .t-hero-k, .t-hero small { font-size: 13px; color: #CDEAE7; }
.t-hero b { font-size: 20px; line-height: 1.45; }
.t-hero .btn { margin-top: 6px; align-self: flex-start; }
.btn.light { --b-bg: #fff; --b-fg: #085E5A; --b-hover: #F1F8F7; font-weight: 700; }
@media (max-width: 719px) { .t-hero .btn { align-self: stretch; } .t-hero b { font-size: 18px; } }
.class-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.class-tile { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.ct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.ct-main b { font-size: 15px; color: var(--navy); }
.ct-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ct-att { flex: none; width: 48px; border: 0; border-inline-start: 1px solid var(--line); background: var(--teal-soft); color: var(--teal); cursor: pointer; display: grid; place-items: center; }
.ct-att:hover { background: #D3EAE8; }
@media (max-width: 719px) { .class-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fin-period { margin-bottom: 12px; max-width: 520px; }
.bal-hero { display: flex; flex-direction: column; gap: 4px; padding: 18px; margin-bottom: 14px; border-radius: 20px; background: var(--navy); color: #fff; container-type: inline-size; }
.bal-k { font-size: 13px; color: #C9D2E3; }
.bal-k b { color: #fff; white-space: nowrap; }
.bal-v { font-size: clamp(22px, 9cqi, 34px); line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quick-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.quick-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; }
.quick-act:hover { border-color: var(--line-2); }
.qa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.quick-act.teal .qa-ic { background: var(--teal-soft); color: var(--teal); } .quick-act.red .qa-ic { background: var(--red-soft); color: var(--red); }
.quick-act.navy .qa-ic { background: var(--navy-soft); color: var(--navy); } .quick-act.violet .qa-ic { background: var(--violet-soft); color: var(--violet); }
@media (max-width: 719px) { .quick-acts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .quick-act { font-size: 12px; padding: 10px 2px; } }
.line > b:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) { .dz-steps li { min-width: 0; font-size: 11px; } }
.sf-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tc-list { display: grid; gap: 8px; margin-top: 10px; }
.tc-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tc-row.unread { border-color: var(--teal); background: #F7FBFB; }
.tc-av { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; }
.tc-av.ph { display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); font-weight: 700; font-size: 18px; }
.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-main b { font-size: 15px; color: var(--navy); }
.tc-main small { font-size: 12px; color: var(--muted); }
.tc-prev { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-side { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 1079px) { .sf-bnav .bnav-item .icon { width: 48px; } .sf-bnav .bnav-item { font-size: 11.5px; } }
.chat-back svg { transform: scaleX(-1); }
@media (min-width: 1080px) {
  .s-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-list > :not(.s-card) { grid-column: 1 / -1; }
}
.s-card { border-radius: 14px; padding: 12px 14px; }
.ca-rules { background: var(--navy-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 13.5px; color: var(--navy); }
.ca-rules ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.ca-filter { margin-bottom: 10px; }
.ca-threads, .ca-teachers { display: grid; gap: 8px; margin-top: 10px; }
.ca-row, .ca-teacher { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: start; color: var(--ink); }
.ca-row { cursor: pointer; width: 100%; }
.ca-row:hover { border-color: var(--line-2); }
.ca-row.flag { border-color: var(--red); background: #FFF9F8; }
.ca-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ca-main b { font-size: 14.5px; color: var(--navy); }
.ca-main small { font-size: 12px; color: var(--muted); }
.ca-prev { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ca-msgs { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 60vh; overflow-y: auto; padding: 4px; }
.ca-msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: var(--bg); align-self: flex-end; }
.ca-msg.teacher { background: var(--teal-soft); align-self: flex-start; }
.ca-msg.flag { outline: 2px solid var(--red); background: var(--red-soft); }
.ca-msg p { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ca-msg small { font-size: 11.5px; color: var(--muted); }
.ca-msg .ca-flag { color: var(--red); font-weight: 700; }
.ca-acts { justify-content: flex-start; }
.chat-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
.tc-off { font-size: 12px; color: var(--muted); }
.chat-closed { margin: 0; padding: 12px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); background: var(--bg); }
.chat > .chat-note.small { margin: 0; border-radius: 0; font-size: 11.5px; padding: 6px 12px; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .ca-teachers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chat-hours { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.chat-hours > div { display: flex; flex-direction: column; min-width: 0; }
.chat-hours b { font-size: 14px; color: var(--navy); }
.chat-hours small { font-size: 12.5px; color: var(--muted); }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 10px 0; }
.day-chk { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; }
.day-chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
label.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
label.chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.tc-hours { color: var(--teal) !important; }
.tc-hours.off { color: #B5650F !important; }
.lead-details { margin: 6px 0; font-size: 13px; }
.lead-details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.lead-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.lead-details dt { color: var(--muted); } .lead-details dd { margin: 0; overflow-wrap: anywhere; }
.grp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.grp-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.grp-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.grp-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.grp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grp-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-title small { color: var(--muted); font-size: 12px; text-align: right; }
.grp-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grp-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--bg); min-width: 0; container-type: inline-size; }
.grp-fig b { font-size: clamp(13px, 22cqi, 18px); white-space: nowrap; color: var(--navy); }
.grp-fig span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.grp-money { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.grp-money b { color: var(--ink); white-space: nowrap; }
.grp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* Student file: header ids and action bar */
.sf-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.sf-ids { display: flex; gap: 8px; }
.sf-idbox { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--line-2); }
.sf-idbox > span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sf-idbox > div { display: flex; align-items: center; gap: 8px; }
.sf-idbox b { font-size: 16px; letter-spacing: .6px; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.sf-copy { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.sf-copy:hover { color: var(--teal); border-color: var(--teal); }
.sf-copy.done { background: var(--teal-soft); color: var(--teal); border-color: var(--teal-soft); }
.sf-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0 0 12px; }
.sf-act { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .15s, background .15s; }
.sf-act:hover { border-color: var(--teal); background: #F7FBFB; }
.sf-act svg { flex: none; color: var(--teal); }
.sf-act span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-act.pri { background: var(--teal); border-color: var(--teal); color: #fff; } .sf-act.pri svg { color: #fff; } .sf-act.pri:hover { background: #096862; }
.sf-act.soft { background: var(--teal-soft); border-color: var(--teal-soft); color: var(--teal); } .sf-act.soft:hover { border-color: var(--teal); }
@media (max-width: 719px) {
  .sf-head { grid-template-columns: auto minmax(0, 1fr); }
  .sf-ids { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .sf-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sf-act { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 4px; font-size: 12px; }
  .sf-act span { white-space: normal; text-align: center; line-height: 1.3; }
  .student-file .profile-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -2px; padding: 2px; }
  .student-file .profile-nav::-webkit-scrollbar { display: none; }
  .student-file .profile-nav button { flex: none; }
}
@media print { .sf-bar, .sf-copy { display: none !important; } }
.sf-bar:has(> .sf-act:only-child) { grid-template-columns: minmax(0, 1fr); }
.sf-bar > .sf-act:only-child { flex-direction: row; min-height: 48px; font-size: 14.5px; }

/* Finance requests */
.fr-list { display: grid; gap: 10px; margin-top: 10px; }
.fr-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; border-inline-start: 4px solid var(--line-2); }
.fr-card.s-pending { border-inline-start-color: var(--amber); } .fr-card.s-approved { border-inline-start-color: var(--violet); }
.fr-card.s-paid { border-inline-start-color: var(--teal); } .fr-card.s-rejected { border-inline-start-color: var(--red); }
.fr-card > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fr-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fr-title small { color: var(--muted); font-size: 12px; text-align: right; }
.fr-title b { font-size: 15.5px; color: var(--navy); }
.fr-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.fr-amt b { font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fr-amt del { font-size: 12px; color: var(--muted); }
.fr-details { margin: 0; font-size: 14px; color: #3B4658; line-height: 1.8; }
.fr-trail { list-style: none; margin: 0; padding: 8px 10px; background: var(--bg); border-radius: 10px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.fr-trail li { display: flex; align-items: center; gap: 6px; } .fr-trail svg { flex: none; color: var(--teal); }
.fr-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.fr-acts:empty { display: none; }

/* Book deposits */
.bd-list { display: grid; gap: 8px; margin-top: 4px; }
.bd-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.bd-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--amber-soft); color: #B5650F; }
.bd-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .bd-main b { color: var(--navy); }
.bd-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bd-side > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd-side .row { gap: 6px; flex-wrap: nowrap; }
@media (max-width: 640px) {
  .bd-row { grid-template-columns: auto minmax(0, 1fr); }
  .bd-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .fr-card > header { flex-direction: column; } .fr-amt { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Printable vouchers */
.voucher { min-width: min(520px, 100%); }
.voucher > header { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 2px solid var(--navy); }
.voucher > header h3 { margin: 0; font-size: 18px; color: var(--navy); } .voucher > header small { color: var(--muted); }
.voucher .vc-logo { height: 44px; width: auto; }
.vc-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.vc-row span { color: var(--muted); } .vc-row b { text-align: left; }
.vc-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 18px; }
.vc-sign > div { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 13px; }
.vc-sign small { color: var(--muted); }
.fam-list { display: grid; gap: 8px; margin-top: 10px; }
.fam-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.fam-row.warn { border-color: #F2C98F; background: #FFFBF4; }
.fam-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fam-kids { display: flex; flex-wrap: wrap; gap: 6px; }
.fam-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 8px; }
.add-admin { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.add-admin > summary { cursor: pointer; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.act-cred { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; align-items: center; padding: 12px 14px; margin: 10px 0 14px;
  border-radius: 14px; background: var(--bg); border: 1px dashed var(--line-2); font-size: 14px; }
.act-cred > span { color: var(--muted); }
.act-done { text-align: center; } .act-done .big { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }

/* Owner: school files */
.sf-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.sf-table { display: grid; gap: 8px; margin-top: 8px; }
.sf-row { display: grid; grid-template-columns: auto minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.sf-row:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.sf-cb input { width: 18px; height: 18px; }
.sf-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .sf-name b { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-name small { color: var(--muted); font-size: 12px; text-align: right; }
.sf-stage { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sf-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; width: 100%; max-width: 160px; }
.sf-steps i { height: 5px; border-radius: 4px; background: var(--line); } .sf-steps i.on { background: var(--teal); }
.sf-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.sf-dates { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sf-row .go { color: var(--muted); font-size: 20px; }
.file-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.file-head { display: flex; align-items: center; gap: 14px; }
.file-head h2 { margin: 0; font-size: 22px; color: var(--navy); }
.file-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--teal-soft); color: var(--teal); flex: none; }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 0 0 6px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.pipeline li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12.5px; color: var(--muted); position: relative; }
.pipeline .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: 12px; }
.pipeline li.done { color: var(--teal); } .pipeline li.done .n { background: var(--teal-soft); border-color: var(--teal-soft); color: var(--teal); }
.pipeline li.on { color: var(--navy); font-weight: 700; } .pipeline li.on .n { background: var(--teal); border-color: var(--teal); color: #fff; }
.pipeline-next { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.file-tabs { margin: 4px 0 12px; }
.file-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 14px; }
.file-dl dt { color: var(--muted); } .file-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dlv-list { display: grid; gap: 8px; }
.dlv-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; border-inline-start: 4px solid var(--line-2); }
.dlv-row.s-sent { border-inline-start-color: var(--teal); } .dlv-row.s-pending { border-inline-start-color: var(--amber); } .dlv-row.s-failed { border-inline-start-color: var(--red); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.timeline li.k-note::before { border-color: var(--violet); } .timeline li.k-status::before, .timeline li.k-error::before { border-color: var(--red); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; } .tl-head small { color: var(--muted); }
.timeline p { margin: 4px 0 0; font-size: 14px; color: #3B4658; }
.tl-changes { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13.5px; color: #3B4658; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.edit-grid > .f:first-child, .edit-grid > .sub { grid-column: 1 / -1; }
.more-acts { display: grid; gap: 8px; } .more-acts .btn { width: 100%; justify-content: center; }
/* Handover screen */
dialog.ho-dlg { width: min(860px, 96vw); }
.handover-x { display: grid; gap: 14px; }
.ho-hero { text-align: center; padding: 22px 16px; border-radius: 18px; color: #fff; background: linear-gradient(150deg, #16244A, #0F3F45); }
.ho-hero .ho-logo { height: 34px; filter: brightness(0) invert(1); }
.ho-hero h2 { margin: 12px 0 6px; font-size: 24px; color: #fff; } .ho-hero p { margin: 0; color: #D5DEEC; }
.ho-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ho-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; display: grid; gap: 10px; align-content: start; }
.ho-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--navy); } .ho-card h3 svg { color: var(--teal); }
.ho-steps { margin: 0; padding-inline-start: 20px; font-size: 14px; line-height: 1.9; }
.ho-link { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--teal-soft); }
.ho-link span { font-size: 12.5px; color: var(--teal); font-weight: 700; } .ho-link code { font-size: 12.5px; overflow-wrap: anywhere; }
.ho-link small { color: var(--muted); }
.ho-msg { width: 100%; font-size: 14px; line-height: 1.8; }
.ho-sub { margin: 4px 0 0; font-size: 15px; color: var(--navy); }
.ho-ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ho-way { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font: inherit; cursor: pointer; color: var(--navy); }
.ho-way:hover:not(:disabled) { border-color: var(--teal); background: #F7FBFB; } .ho-way svg { color: var(--teal); }
.ho-way small { color: var(--muted); font-size: 12px; } .ho-way:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 860px) {
  .sf-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf-filters > :first-child { grid-column: 1 / -1; }
  .sf-row { grid-template-columns: auto minmax(0, 1fr) auto; } .sf-stage { grid-column: 2 / -1; } .sf-meta { grid-column: 2 / -1; } .sf-dates { display: none; }
  .sf-row .go { grid-row: 1; grid-column: 3; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .ho-cards, .edit-grid { grid-template-columns: minmax(0, 1fr); } .ho-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .file-dl dd { margin-bottom: 8px; }
}
/* Activation file print */
.act-sheet { display: none; }
@media print {
  body.act-printing > *:not(.act-sheet) { display: none !important; }
  body.act-printing .act-sheet { display: block; padding: 10mm 12mm; color: #16244A; font-size: 12pt; }
  .act-sheet header { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 3px solid #0B7A75; margin-bottom: 14px; }
  .act-sheet .act-logo { height: 40px; } .act-sheet h1 { margin: 0; font-size: 20pt; } .act-sheet header small { color: #5A6478; }
  .act-sheet h2 { font-size: 13pt; color: #0B7A75; margin: 14px 0 6px; }
  .act-sheet section { break-inside: avoid; border: 1px solid #E3E7EC; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
  .act-sheet .file-dl { grid-template-columns: 38mm 1fr; }
  .act-sheet .act-hello { font-size: 12.5pt; line-height: 1.8; }
  .act-sheet .act-warn { color: #B8412F; font-size: 10pt; }
  .act-sheet footer { margin-top: 12px; font-size: 9pt; color: #5A6478; text-align: center; }
}
.timeline .tl-changes li { border: 0; padding: 0; margin: 2px 0; list-style: disc; }
.timeline .tl-changes li::before { display: none; }

/* Activation steps */
.av-id { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); font-size: 14px; }
.av-id dt { color: rgba(255,255,255,.6); } .av-id dd { margin: 0; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.av-phone { text-align: end; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.gate-card .av-otp { text-align: center; font-size: 26px; letter-spacing: .5em; font-weight: 700; padding: 12px; font-variant-numeric: tabular-nums; }
.gate-card .btn + .btn { margin-top: 8px; }
.gate-card .notice { margin: 8px 0; }
.code-pick { display: grid; gap: 4px; padding: 10px 12px; margin: 4px 0 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line-2); }
.code-pick .code-url { font-weight: 700; font-size: 16px; color: var(--navy); overflow-wrap: anywhere; }
.code-pick summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.code-pick details input { margin-top: 6px; }
.ro-val { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); min-height: 42px; }
.otp-show { font-size: 34px; font-weight: 800; letter-spacing: .3em; text-align: center; padding: 14px; margin: 6px 0 10px; border-radius: 14px; background: var(--navy-soft); color: var(--navy); }

/* Stable dialogs: no auto-zoom on focus, no re-centering jumps while content changes, no background scroll. */
html { scrollbar-gutter: stable; }
html:has(dialog[open]:modal), html:has(dialog[open]:modal) body { overflow: hidden; }
dialog:modal { touch-action: pan-x pan-y; scrollbar-gutter: stable; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
dialog:modal:not(.sheet):not(.navdrawer):not(.mc-sheet) { position: fixed; inset: 0; margin: max(4vh, calc(16px + var(--sat))) auto auto;
  max-height: calc(100dvh - max(8vh, 32px) - var(--sat) - var(--sab)); }
@media (max-width: 719px) {
  dialog:modal:not(.sheet):not(.navdrawer):not(.dialog-lg):not(.mc-sheet) { width: calc(100% - 20px); margin: calc(10px + var(--sat)) auto auto;
    max-height: calc(100dvh - 20px - var(--sat) - var(--sab)); }
  dialog:modal.dialog-lg { margin: 0; max-height: 100dvh; padding-top: var(--sat); padding-bottom: var(--sab); }
}
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not(.av-otp), select, textarea { font-size: 16px !important; }
}
@media print { html, body { overflow: visible !important; } }

/* Teachers list */
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.tc-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tc-card:hover, .tc-card:focus-visible { border-color: var(--teal); box-shadow: 0 6px 18px rgba(22,36,74,.08); outline: none; }
.tc-card.off { opacity: .72; }
.tc-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tc-head .avatar, .tc-head > img, .tc-head > span:first-child { flex: none; }
.tc-head > .badge { flex: none; align-self: flex-start; }
.tc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-name { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-spec { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-subs { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.tc-chip { max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-chip.more { background: var(--navy-soft); color: var(--navy); }
.tc-chip.none { background: var(--amber-soft); color: #8A5A00; }
.tc-facts { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 6px; margin: 0; }
.tc-facts > div { min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.tc-facts dt { font-size: 11px; color: var(--muted); }
.tc-facts dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); min-width: 0; }
.tc-foot > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--teal-soft); border: 1px solid #CFE8E5; min-width: 0; }
.tf-hero > div:first-child { flex: none; }
.tf-text { flex: 1; min-width: 0; }
.tf-text h2 { margin: 0; font-size: 18px; color: var(--navy); overflow-wrap: anywhere; }
.tf-text p { margin: 2px 0 8px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.tf-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.teacher-file .kpis-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.teacher-file .kpis-row .kpi { min-width: 0; overflow-wrap: anywhere; }
.teacher-file .info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.teacher-file .info-block, .teacher-file .cred-card { min-width: 0; }
.teacher-file .line > b, .teacher-file .cred-val, .teacher-file a.ltr { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
@media (min-width: 720px) { dialog.dialog-lg:modal { height: min(88vh, 920px); } }
@media (max-width: 719px) { .tf-hero { gap: 10px; padding: 12px; } .teacher-file .kpis-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Top section bar: one horizontally scrollable row above the content (accountant, student file). */
.tabs-layout.tabs-top { display: block; }
.tabs-layout.tabs-top > .tabs { display: flex !important; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; max-height: none;
  position: sticky; top: var(--sat); z-index: 15; margin: 0 calc(-1 * var(--gut, 16px)) 16px; padding: 10px var(--gut, 16px);
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.96); box-shadow: 0 2px 10px rgba(16,38,64,.05);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); scroll-padding-inline: 16px;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(to left, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.tabs-layout.tabs-top > .tabs .tabs-group { display: none; }
.tabs-layout.tabs-top > .tabs button { flex: none; width: auto; min-width: 0; min-height: 40px; flex-direction: row; gap: 7px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs-layout.tabs-top > .tabs button .icon { color: var(--muted); }
.tabs-layout.tabs-top > .tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs-layout.tabs-top > .tabs button.on .icon { color: #fff; }
.tabs-layout.tabs-top > .tabs .nav-badge { margin-inline-start: 2px; }
@media (min-width: 1080px) { .tabs-layout.tabs-top > .tabs { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; top: 8px; } }

.student-file .profile-layout, .student-file.app .profile-layout { display: block; }
.student-file .profile-nav, .student-file.app .profile-nav { display: flex !important; flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden;
  position: sticky; top: var(--sat); z-index: 12; margin: 0 0 14px; padding: 8px 14px; scroll-padding-inline: 14px; background: var(--bg, #F4F6F8); scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
          mask-image: linear-gradient(to left, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%); }
.student-file .profile-nav::-webkit-scrollbar { display: none; }
.student-file .profile-nav button { flex: none; width: auto; min-width: 0; flex-direction: row; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.student-file .profile-nav button .icon { color: var(--muted); flex: none; }
.student-file .profile-nav button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.student-file .profile-nav button.on .icon { color: #fff; }
.student-file .profile-nav small { display: none; }
dialog .student-file .profile-nav { top: -18px; background: #fff; }
.gate-card .av-sent { margin: -4px 0 10px; }
.gate-card .av-links { justify-content: center; gap: 18px; margin: 10px 0 0; }
.gate-card .gate-link:disabled { color: rgba(255,255,255,.5); text-decoration: none; cursor: default; }

/* ---------- Institutes ---------- */
.in-hero { padding: 16px 18px; margin-bottom: 14px; border-radius: 18px; background: linear-gradient(135deg, var(--navy), #1f4f6b); color: #fff; }
.in-hero h2 { margin: 0 0 2px; font-size: 19px; color: #fff; } .in-hero .sub { color: rgba(255,255,255,.75); }
.in-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.in-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: start;
  cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.in-card[role=button]:hover, .in-card:focus-visible { border-color: var(--teal); box-shadow: 0 6px 18px rgba(22,36,74,.08); outline: none; }
.in-card.off { opacity: .7; }
.in-card > header { display: flex; align-items: center; gap: 10px; min-width: 0; }
.in-card > header > .badge { flex: none; align-self: flex-start; }
.in-av { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.in-av.lg { width: 52px; height: 52px; border-radius: 16px; }
.in-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.in-id b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .in-id small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-line { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.in-card > footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.in-card > footer > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.in-mini > div { min-width: 0; padding: 8px 10px; border-radius: 12px; background: var(--bg); }
.in-mini small, .in-prog small { display: block; font-size: 11px; color: var(--muted); } .in-mini b { font-size: 14px; }
.in-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 5px; }
.in-bar > i { display: block; height: 100%; border-radius: 6px; background: var(--teal); }
.in-bar.warn > i { background: var(--amber, #D9922B); }
.in-list { display: grid; gap: 8px; }
.in-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: start; font: inherit; color: var(--ink); flex-wrap: wrap; }
button.in-item { cursor: pointer; } button.in-item:hover { border-color: var(--teal); }
.in-item > div:first-child { flex: 1; min-width: 160px; } .in-item b { overflow-wrap: anywhere; }
.in-count { flex: none; font-weight: 700; color: var(--navy); }
.in-money { flex: none; text-align: end; } .in-money b { display: block; } .in-money small { color: var(--muted); font-size: 11.5px; }
.in-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px 0; padding-bottom: 2px; position: sticky; top: -18px; z-index: 3; background: #fff; padding-top: 6px; }
.in-tabs::-webkit-scrollbar { display: none; }
.in-tabs button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; }
.in-tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.in-file-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--teal-soft); flex-wrap: wrap; }
.in-file-head > div { flex: 1; min-width: 160px; } .in-file-head h2 { margin: 0; font-size: 18px; color: var(--navy); overflow-wrap: anywhere; }
.in-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 6px 0; } .in-kv > dt { color: var(--muted); font-size: 13px; } .in-kv > dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 900px) { .in-kv { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); } }
.in-h { margin: 14px 0 6px; font-size: 14px; color: var(--navy); }
.in-text { white-space: pre-line; color: var(--ink); line-height: 1.8; margin: 4px 0; }
.in-enroll { display: grid; gap: 10px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.in-enroll > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; } .in-enroll > header b { font-size: 15px; }
.in-prog { display: grid; gap: 8px; }
.in-prog-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.in-prog-row > div { padding: 8px 10px; border-radius: 12px; background: var(--bg); min-width: 0; } .in-prog-row b { font-size: 15px; }
.in-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 700; font-size: 13px; }
.in-why { margin: 0; padding-inline-start: 18px; color: #8A5A00; font-size: 12.5px; line-height: 1.8; }
.in-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.in-roster { display: grid; gap: 6px; }
.in-ros { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.in-ros:hover { border-color: var(--teal); } .in-ros.off { opacity: .6; }
.in-ros-id { min-width: 0; } .in-ros-id b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-ros-m small { display: block; font-size: 11px; color: var(--muted); } .in-ros-m b { font-size: 14px; }
@media (max-width: 560px) { .in-ros { grid-template-columns: minmax(0, 1fr) 58px 58px; } .in-ros > .badge { grid-column: 1 / -1; justify-self: start; } .in-prog-row { grid-template-columns: 1fr 1fr; } }
.in-att { display: grid; gap: 6px; margin-top: 8px; }
.in-att-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.in-att-name { flex: 1; min-width: 140px; } .in-att-name b { display: block; } .in-att-name small { color: var(--muted); }
.in-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; }
.in-seg button { border: 0; background: #fff; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); min-height: 40px; }
.in-seg button + button { border-inline-start: 1px solid var(--line); }
.in-seg .s-present.on { background: var(--teal); color: #fff; } .in-seg .s-late.on { background: #D9922B; color: #fff; }
.in-seg .s-absent.on { background: var(--red); color: #fff; } .in-seg .s-excused.on { background: var(--navy); color: #fff; }
.in-late { width: 96px !important; min-height: 40px; }
.in-att-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12.5px; }
.in-att-counts span { padding: 3px 10px; border-radius: 999px; background: var(--bg); }
.in-scores { display: grid; gap: 6px; margin: 8px 0; }
.in-score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.in-score-row > span { min-width: 0; overflow-wrap: anywhere; } .in-score-row small { color: var(--muted); }
.in-score-in { display: flex; align-items: center; gap: 6px; flex: none; } .in-score-in input { width: 96px; text-align: center; } .in-score-row select { width: 130px; flex: none; }
.in-days, .in-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.in-days .sub { width: 100%; }
.in-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; margin-bottom: 12px; }
.in-roles > div { padding: 10px 12px; border-radius: 12px; background: var(--bg); } .in-roles b { display: block; font-size: 13.5px; } .in-roles small { color: var(--muted); font-size: 12px; }
.in-timeline { display: grid; gap: 8px; border-inline-start: 2px solid var(--line); padding-inline-start: 14px; }
.in-tl { position: relative; } .in-tl::before { content: ""; position: absolute; inset-inline-start: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.in-tl small { color: var(--muted); font-size: 11.5px; }
.in-day { margin-bottom: 14px; } .in-day h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--navy); }
.in-day.now { padding: 10px; border-radius: 14px; background: var(--teal-soft); }
.in-changes summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-top: 6px; }

/* Certificates and reports print */
.ic-sheet, .ir-sheet { display: none; }
@media print {
  body.ic-printing > *:not(.ic-sheet), body.ir-printing > *:not(.ir-sheet) { display: none !important; }
  body.ic-printing .ic-sheet, body.ir-printing .ir-sheet { display: block; }
  .ic { position: relative; page-break-after: always; break-after: page; height: 190mm; padding: 14mm 16mm; border: 3px double #16244A; box-sizing: border-box; text-align: center; color: #16244A; }
  .ic > header { display: flex; align-items: center; justify-content: center; gap: 10px; } .ic-logo { height: 54px; } .ic > header b { font-size: 16pt; display: block; } .ic > header small { font-size: 10pt; color: #5F6B7A; }
  .ic h1 { font-size: 24pt; margin: 6mm 0 3mm; } .ic h2 { font-size: 22pt; margin: 2mm 0; color: #0E7C7B; } .ic h3 { font-size: 17pt; margin: 2mm 0; }
  .ic-lead { font-size: 12.5pt; margin: 2mm 0; } .ic-sub { font-size: 11pt; color: #5F6B7A; }
  .ic-facts { display: inline-grid; grid-template-columns: auto auto; gap: 1mm 6mm; margin: 4mm auto; font-size: 11pt; text-align: start; } .ic-facts dt { color: #5F6B7A; } .ic-facts dd { margin: 0; font-weight: 700; }
  .ic-note { font-size: 9.5pt; color: #5F6B7A; }
  .ic > footer { position: absolute; inset-inline: 16mm; bottom: 12mm; display: flex; justify-content: space-between; align-items: flex-end; }
  .ic-sign { text-align: center; } .ic-sign small { display: block; font-size: 10pt; } .ic-sign b { font-size: 12pt; } .ic-sign i { display: block; width: 50mm; border-top: 1px solid #16244A; margin-top: 12mm; }
  .ic-verify { display: grid; justify-items: center; gap: 1mm; font-size: 8.5pt; } .ic-verify img { width: 26mm; height: 26mm; } .ic-verify b { font-size: 10pt; letter-spacing: .1em; }
  .ic-void { position: absolute; inset: 0; display: grid; place-items: center; font-size: 60pt; color: rgba(184,65,47,.25); transform: rotate(-20deg); }
  .ir-sheet { padding: 8mm; color: #16244A; font-size: 10pt; } .ir-sheet > header { display: flex; gap: 10px; align-items: center; margin-bottom: 6mm; } .ir-logo { height: 42px; }
  .ir-sheet h1 { font-size: 15pt; margin: 2px 0; } .ir-sheet table { width: 100%; border-collapse: collapse; } .ir-sheet th, .ir-sheet td { border: 1px solid #C9D2DB; padding: 4px 6px; text-align: start; }
  .ir-sheet th { background: #EEF3F6; }
}
@page { margin: 10mm; }
@media print {
  body.ic-printing dialog, body.ir-printing dialog { display: none !important; }
  body.ic-printing > .ic-sheet, body.ir-printing > .ir-sheet { display: block !important; }
}

/* Student identifiers: one compact row */
.sf-ids { display: flex !important; flex-wrap: wrap; gap: 6px; }
.sf-idbox { flex-direction: row !important; align-items: center; gap: 6px !important; padding: 5px 6px 5px 10px !important; border-radius: 999px !important; border-style: solid !important; }
.sf-idbox > span { font-size: 11px; }
.sf-idbox b { font-size: 13.5px !important; letter-spacing: .4px !important; }
.sf-copy { width: 26px; height: 26px; border-radius: 999px; }
.sf-qr { width: auto; padding: 0 9px; gap: 4px; display: inline-flex; align-items: center; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--teal); border-color: var(--teal-soft); background: var(--teal-soft); }
.sf-qr:hover { background: var(--teal); color: #fff; }
.sms-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; margin: 10px 0 12px; }
.sms-opt { display: grid; gap: 3px; text-align: start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; color: var(--ink); }
.sms-opt small { color: var(--muted); font-size: 12px; } .sms-opt .badge { justify-self: start; margin-top: 4px; }
.sms-opt.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: var(--teal-soft); }
.sms-adv { margin: 12px 0; } .sms-adv > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* ===== Sign-in, activation and password pages ===== */
.au { --au-line: #DCE1E8; --au-ring: 0 0 0 4px rgba(11,122,117,.13); position: relative; overflow: hidden; min-height: 100dvh; display: grid;
  background: radial-gradient(900px 560px at 80% -8%, rgba(19,163,155,.32), transparent 62%), radial-gradient(760px 520px at 0% 105%, rgba(201,162,77,.15), transparent 60%),
    linear-gradient(168deg, #1C2F5E 0%, #15234A 46%, #0C1631 100%); }
html:has(> body > #app > .au), html:has(> body > #app > .au) body { background: #0C1631; }
.au-brand { color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 52px; }
.au-orbit { position: absolute; width: 860px; max-width: none; inset-inline-end: -300px; bottom: -380px; opacity: .75; pointer-events: none; animation: au-spin 140s linear infinite; }
.au-orbit ellipse { fill: none; stroke: rgba(255,255,255,.11); stroke-width: 1.2; }
.au-orbit .o2 ellipse { stroke: rgba(127,214,207,.16); }
.au-orbit .dot { fill: #7FD6CF; } .au-orbit .dot.gold { fill: #E3B65A; }
.au-orbit .core { fill: rgba(127,214,207,.08); stroke: rgba(127,214,207,.22); }
@keyframes au-spin { to { rotate: 360deg; } }
.au-brand-in { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; gap: 40px; }
.au-brand-in .au-brand-copy { margin-block: auto; }
.au-logo { width: 150px; height: auto; }
.au-brand-copy h2 { color: #fff; font-size: 34px; line-height: 1.45; margin: 0 0 12px; max-width: 440px; letter-spacing: -.2px; }
.au-brand-copy p { margin: 0; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.9; max-width: 420px; }
.au-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.au-points li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.88); font-size: 15px; }
.au-points li > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #7FD6CF; flex: none; }
.au-copy { position: relative; z-index: 1; color: rgba(255,255,255,.5); font-size: 12.5px; }
.au-main { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px 32px; }
.au-panel { width: min(468px, 100%); padding: 38px 36px 26px; border-radius: 28px; background: #fff;
  box-shadow: 0 40px 80px -28px rgba(2,8,26,.65), 0 0 0 1px rgba(255,255,255,.07), 0 1px 0 rgba(255,255,255,.6) inset; animation: au-up .55s cubic-bezier(.2,.8,.2,1) both; }
.au-head { margin-bottom: 26px; }
.au-head h1 { font-size: 28px; line-height: 1.35; color: var(--navy); margin: 0 0 6px; letter-spacing: -.2px; }
.au-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.au-school { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 14px 5px 6px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 999px; background: #F7F9FB; font-size: 13.5px; color: var(--ink); }
.au-school img, .au-school-ic { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.au-school-ic { display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); }
.au-school b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 22px; background: #F1F3F7; border-radius: 14px; }
.au-seg button { height: 42px; border: none; border-radius: 10px; background: none; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.au-seg button:hover { color: var(--ink); }
.au-seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(22,36,74,.08), 0 2px 8px rgba(22,36,74,.08); }
.au-seg button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.au-f { margin-bottom: 18px; }
.au-f-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.au-f-top label { font-size: 14px; font-weight: 600; color: var(--ink); }
.au-link { background: none; border: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--teal); cursor: pointer; }
.au-link:hover { text-decoration: underline; }
.au-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.au-main input:not([type=checkbox]):not(.otp-in):not(.pf-num):not(.pf-search) { height: 52px; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--au-line); border-radius: 14px; font-size: 16px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.au-main input:not([type=checkbox]):not(.otp-in):not(.pf-num):not(.pf-search):focus { outline: none; border-color: var(--teal); box-shadow: var(--au-ring); }
.au-main .pw-wrap input { padding-inline-start: 48px; }
.au-main .pw-toggle { inset-inline-start: 4px; }
.au-main input::placeholder { color: #A3ADBA; }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 22px; flex-wrap: wrap; }
.au-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.au-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.au .btn.au-go { width: 100%; height: 54px; justify-content: center; gap: 8px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #0F8C86 0%, #0B7A75 100%); box-shadow: 0 10px 24px -10px rgba(11,122,117,.6), inset 0 1px 0 rgba(255,255,255,.14); transition: filter .15s, transform .05s; }
.au .btn.au-go:hover { filter: brightness(1.06); }
.au .btn.au-go:active { transform: translateY(1px); }
.au .btn.au-go:disabled { filter: grayscale(.4); opacity: .7; cursor: default; }
.au .btn.au-go .icon { transform: scaleX(1); }
.au-alt { display: block; width: 100%; margin-top: 12px; text-align: center; }
.au-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; color: #8A95A3; font-size: 12.5px; }
.au .notice { margin: 0 0 16px; border-radius: 12px; }
.au-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.au-meter i { height: 4px; border-radius: 2px; background: #E6EAEF; transition: background .2s; }
.au-meter[data-l="1"] i:nth-child(-n+1) { background: #D9534F; }
.au-meter[data-l="2"] i:nth-child(-n+2) { background: #F0A53A; }
.au-meter[data-l="3"] i:nth-child(-n+3) { background: #2E9E8F; }
.au-meter[data-l="4"] i { background: #0B7A75; }

/* Phone number with country code */
.pf { position: relative; }
.pf-box { display: flex; align-items: stretch; height: 52px; border: 1.5px solid var(--au-line, #DCE1E8); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.pf-box:focus-within, .pf.open .pf-box { border-color: var(--teal); box-shadow: var(--au-ring, 0 0 0 4px rgba(11,122,117,.13)); }
.pf-box.bad { border-color: var(--red); }
.pf-cc { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 16px; border: none; background: none; border-radius: 13px 0 0 13px; font: inherit; font-size: 16px; font-weight: 700; color: var(--navy); cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-cc:hover { background: #F5F7FA; }
.pf-cc .icon { color: var(--muted); transition: rotate .15s; }
.pf.open .pf-cc .icon { rotate: 180deg; }
.pf-cc:focus-visible { outline: none; background: #EEF3F7; }
.pf-sep { width: 1px; align-self: center; height: 26px; background: var(--line); flex: none; }
.pf-box .pf-num { flex: 1; min-width: 0; height: auto; min-height: 0; border: none; background: none; padding: 0 14px; font-size: 16px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.pf-box .pf-num:focus { outline: none; box-shadow: none; }
.pf-pop { position: absolute; z-index: 30; top: calc(100% + 8px); inset-inline: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 48px -12px rgba(22,36,74,.25), 0 2px 6px rgba(22,36,74,.06); animation: pf-in .14s ease-out; }
@keyframes pf-in { from { opacity: 0; translate: 0 -4px; } }
.pf-search-row { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pf-search-row .pf-search { flex: 1; height: 48px; min-height: 0; border: none; padding: 0; background: none; font-size: 15px; }
.pf-search-row .pf-search:focus { outline: none; box-shadow: none; }
.pf-list { max-height: 272px; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pf-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: none; border-radius: 10px; background: none; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; text-align: start; }
.pf-opt:hover, .pf-opt:focus-visible { background: #F3F6F9; outline: none; }
.pf-opt.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.pf-name { flex: 1; }
.pf-dial { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pf-opt.on .pf-dial { color: var(--teal); }
.pf-tick { width: 15px; flex: none; }
.pf-none { margin: 0; padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* Six-digit code */
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-cell { height: 60px; display: grid; place-items: center; border: 1.5px solid var(--au-line, #DCE1E8); border-radius: 14px; background: #fff; font-size: 26px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s; }
.otp-cell.full { border-color: #B7C2CF; }
.otp-cell.on { border-color: var(--teal); box-shadow: var(--au-ring, 0 0 0 4px rgba(11,122,117,.13)); }
.otp-cell.on:empty::after { content: ""; width: 2px; height: 26px; background: var(--teal); animation: otp-caret 1s steps(1) infinite; }
@keyframes otp-caret { 50% { opacity: 0; } }
.otp .otp-in { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: none; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; opacity: .01; cursor: text; }
.otp.bad .otp-cell { border-color: var(--red); }
.otp.bad { animation: otp-shake .32s; }
@keyframes otp-shake { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.au-sent { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; font-size: 14px; color: var(--muted); }

/* Activation steps */
.au-steps { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 0; }
.au-steps li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.au-steps li:last-child { padding-bottom: 0; }
.au-steps li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.au-steps .n { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.au-steps b { display: block; font-size: 15.5px; color: var(--ink); margin-top: 6px; }
.au-steps small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.au-done { text-align: center; }
.au-done .big { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); margin-bottom: 14px; box-shadow: 0 0 0 10px rgba(11,122,117,.06); }
.au-done .au-head { margin-bottom: 22px; }

@media (min-width: 960px) {
  .au { grid-template-columns: minmax(0, 1fr) minmax(460px, 46%); }
  .au-brand { order: 2; }
}
@media (max-width: 959px) {
  .au { grid-template-rows: auto 1fr; }
  .au-brand { padding: 26px 20px 26px; gap: 0; align-items: center; }
  .au-brand-in { gap: 0; align-items: center; }
  .au-brand-copy, .au-copy { display: none; }
  .au-orbit { width: 560px; inset-inline-end: -190px; top: -150px; bottom: auto; opacity: .7; }
  .au-logo { width: 132px; }
  .au-main { place-items: start center; padding: 0 14px calc(22px + var(--sab)); }
  .au-panel { padding: 28px 20px 18px; border-radius: 26px; }
  .au-head h1 { font-size: 24px; }
  .otp { gap: 6px; } .otp-cell { height: 54px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .au-orbit, .otp.bad, .pf-pop { animation: none; } }
html:has(> body > #app > .au) { scrollbar-gutter: auto; }
.pf-search::-webkit-search-cancel-button { display: none; }

/* Sign-in: school header on phones, returning account, recovery */
.au-hero-school { display: none; }
.au-hero-logo { width: 78px; height: 78px; border-radius: 24px; display: grid; place-items: center; overflow: hidden; background: #fff; color: var(--navy);
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.45), 0 0 0 6px rgba(255,255,255,.08); }
.au-hero-logo img { width: 100%; height: 100%; object-fit: contain; padding: 9px; }
.au-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border: 1.5px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #FBFCFD, #F5F8FA); }
.au-me .av { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #13A39B, #16244A); box-shadow: 0 6px 14px -6px rgba(22,36,74,.5); }
.au-me-t { min-width: 0; flex: 1; }
.au-me-t b { display: block; font-size: 16px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-me-t small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; }
.au-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 18px; padding: 6px 10px 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.au-back .icon { rotate: 180deg; }
.au-back:hover { background: #F5F7FA; }
@keyframes au-up { from { opacity: 0; transform: translateY(22px); } }
@keyframes au-fade { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 959px) {
  .au-brand { padding: calc(20px + var(--sat)) 20px 26px; }
  .au-has-hero .au-brand { padding-bottom: 30px; }
  .au-has-hero .au-logo { width: 104px; opacity: .92; }
  .au-hero-school { display: grid; justify-items: center; gap: 6px; margin-top: 22px; text-align: center; animation: au-fade .5s .05s both; }
  .au-hero-school b { margin-top: 8px; font-size: 21px; line-height: 1.4; color: #fff; max-width: 300px; }
  .au-hero-school small { color: rgba(255,255,255,.66); font-size: 13px; }
  .au-has-hero .au-school { display: none; }
  .au-head { margin-bottom: 22px; }
  .au-head h1 { font-size: 25px; }
  .au-seg { margin-bottom: 20px; }
  .au-foot { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { .au-panel, .au-hero-school { animation: none; } }

/* Sign-in providers, divider, secondary action, account schools */
.au-provs { display: grid; gap: 10px; margin-bottom: 4px; }
.au-prov { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 14px; font-size: 15.5px; font-weight: 600;
  text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s; }
.au-prov:active { transform: translateY(1px); }
.au-prov.google { background: #fff; color: #1F1F1F; border: 1.5px solid #DADCE0; }
.au-prov.google:hover { background: #F8F9FA; box-shadow: 0 1px 3px rgba(60,64,67,.15); }
.au-prov.apple { background: #000; color: #fff; border: 1.5px solid #000; }
.au-prov.apple:hover { background: #1C1C1E; }
.au-prov:focus-visible { outline: 3px solid rgba(11,122,117,.35); outline-offset: 2px; }
.au-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #8A95A3; font-size: 13px; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.au-alt-btn { display: block; width: 100%; height: 52px; margin-top: 10px; border: 1.5px solid var(--au-line, #DCE1E8); border-radius: 14px; background: #fff;
  font: inherit; font-size: 15.5px; font-weight: 600; color: var(--navy); cursor: pointer; transition: background .15s, border-color .15s; }
.au-alt-btn:hover { background: #F5F8FA; border-color: #C5CED8; }
.au-alt-btn:focus-visible { outline: 3px solid rgba(11,122,117,.3); outline-offset: 2px; }
.au-schools { display: grid; gap: 8px; margin-bottom: 8px; }
.au-school-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
  font: inherit; text-align: start; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.au-school-row:hover { border-color: var(--teal); background: #F6FBFA; }
.au-school-row .au-school-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); flex: none; }
.au-school-t { flex: 1; min-width: 0; }
.au-school-t b { display: block; color: var(--navy); font-size: 15.5px; }
.au-school-t small { color: var(--muted); font-size: 12.5px; }
.au-school-row > .icon { color: var(--muted); }
.au-tabs-note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.ph-now { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.au-mail { display: block; margin: 4px 0; text-align: right; overflow-wrap: anywhere; font-weight: 600; color: var(--ink); }
.ph-now span { color: var(--muted); font-size: 13px; }
.ph-now b { font-size: 16px; color: var(--navy); font-weight: 700; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.si-steps { margin: 6px 0 12px; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--ink); font-size: 14px; line-height: 1.8; }

/* Manager's official account record (settings) and first sign-in note */
.acc-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 4px 0 12px; background: #fff; }
.acc-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(135deg, #16244A, #1E3566); color: #fff; }
.acc-av { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(127,214,207,.55); color: #fff; }
.acc-who { min-width: 0; }
.acc-who b { display: block; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.acc-who small { display: block; color: rgba(255,255,255,.72); font-size: 13px; margin-top: 2px; }
.acc-list { margin: 0; padding: 4px 18px; }
.acc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.acc-row:last-child { border-bottom: none; }
.acc-row dt { color: var(--muted); font-size: 13.5px; flex: none; }
.acc-row dd { margin: 0; font-weight: 600; color: var(--ink); text-align: left; min-width: 0; }
.acc-mail { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.acc-mail bdi { overflow-wrap: anywhere; }
@media (max-width: 560px) { .acc-row { flex-direction: column; align-items: flex-start; gap: 4px; } .acc-row dd { text-align: right; } .acc-mail { justify-content: flex-start; } }
.au-first { padding: 14px 16px; margin: 0 0 18px; border-radius: 16px; background: linear-gradient(180deg, #EEF7F6, #E3F1F0); border: 1px solid #CDE7E4; }
.au-first b { display: block; color: var(--navy); font-size: 15.5px; margin-bottom: 4px; }
.au-first p { margin: 0; color: #35505A; font-size: 13.5px; line-height: 1.85; }

/* Results approval (schools and institutes) */
.ra { display: grid; gap: 12px; }
.ra-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ra-head small { color: var(--muted); font-size: 12px; }
.ra-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-weight: 600; color: var(--navy); }
.ra-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.ra-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #F1F3F7; color: var(--muted); font-size: 12.5px; }
.ra-steps li i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 11px; font-weight: 700; }
.ra-steps li.done { background: #E3F1F0; color: var(--teal); }
.ra-steps li.on { background: var(--navy); color: #fff; }
.ra-steps li.on i { color: var(--navy); }
.ra-actions { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.ra-issues { margin: 0; padding: 0 18px 0 0; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.7; }
.ra-issues.err li::marker { color: var(--red); } .ra-issues.warn li::marker { color: #C88A12; }
.ra-issues .ra-subj { color: var(--navy); font-weight: 600; }
.ra-sub { margin: 14px 0 6px; font-size: 14px; color: var(--ink); }
.ra-log { margin: 0; padding: 0 18px 0 0; display: grid; gap: 8px; font-size: 13.5px; }
.ra-log small { color: var(--muted); margin-inline-start: 8px; }

/* Certificate pages (designer, preview, print): real millimetres, the same everywhere */
.cp { position: relative; overflow: hidden; direction: rtl; color: #1A2233; box-sizing: border-box; flex: none; transform-origin: top right; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cp *, .cp *::before, .cp *::after { box-sizing: border-box; }
.cp .cp-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cp .cp-frame, .cp .cp-fr, .cp .cp-orn { position: absolute; pointer-events: none; }
.cp .cp-frame { inset: 0; }
.cp .cp-orn { inset: 0; }
.cp .cp-el { position: absolute; transform-origin: center; }
.cp .cp-txt { width: 100%; height: 100%; display: flex; flex-direction: column; white-space: pre-wrap; overflow: hidden; word-break: break-word; }
.cp .cp-image img, .cp .cp-qr img, .cp .cp-qr svg { width: 100%; height: 100%; display: block; }
.cp .cp-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.cp .cp-empty { width: 100%; height: 100%; display: grid; place-items: center; border: 1px dashed #B6C0CE; color: #8A95A5; font-size: 9pt; background: repeating-linear-gradient(45deg, #F6F8FB 0 6px, #EEF2F7 6px 12px); }
.cp .cp-table { width: 100%; border-collapse: collapse; }
.cp .cp-table th, .cp .cp-table td { border: 0.25mm solid; padding: .34em .45em; text-align: center; }
.cp .cp-table td:first-child, .cp .cp-table th:first-child { text-align: right; }
.cp .cp-table.zebra tbody tr:nth-child(even) td { background: rgba(22,36,74,.04); }
.cp .cp-sign { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }
.cp .cp-sign i { display: block; width: 85%; border-top: 0.3mm solid; }
.cp .cp-hidden { opacity: .25; }
.cp .cp-void { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72pt; font-weight: 700; color: rgba(184,65,47,.2); transform: rotate(-20deg); pointer-events: none; }
.cp-sheet { display: grid; gap: 18px; }
.cp-wrap { width: 100%; overflow: hidden; display: flex; justify-content: flex-start; direction: rtl; }
.cp-wrap .cp { box-shadow: 0 6px 24px -10px rgba(22,36,74,.35); }
.cp-print { display: none; }
@page cp-portrait { size: A4 portrait; margin: 0; }
@page cp-landscape { size: A4 landscape; margin: 0; }
@media print {
  body.cp-printing > *:not(.cp-print) { display: none !important; }
  body.cp-printing { background: #fff !important; padding: 0 !important; display: block !important; }
  body.cp-printing .cp-print { display: block; }
  .cp-print .cp { break-after: page; page-break-after: always; margin: 0; box-shadow: none; transform: none !important; }
  .cp-print .cp:last-child { break-after: auto; page-break-after: auto; }
  .cp-print .cp-portrait { page: cp-portrait; }
  .cp-print .cp-landscape { page: cp-landscape; }
}

/* Certificate designer */
body.cd-open { overflow: hidden; }
.cd { position: fixed; inset: 0; z-index: 1000; padding-top: var(--sat); padding-bottom: var(--sab); background: #EEF1F6; display: grid; grid-template-rows: auto 1fr; direction: rtl; }
.cd-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px -6px rgba(22,36,74,.25); }
.cd-bar .cd-name { flex: 1 1 180px; min-width: 140px; height: 38px; }
.cd-bar .cd-kind { height: 38px; max-width: 200px; }
.cd-bar-g { display: flex; align-items: center; gap: 4px; }
.cd-zoom-l { min-width: 46px; text-align: center; font-size: 12.5px; color: var(--muted); }
.cd-status { font-size: 12px; color: var(--muted); }
.cd-status.warn { color: #B26B00; } .cd-status.ok { color: var(--teal); }
.cd-body { display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.cd-stage { overflow: auto; padding: 16px; display: grid; place-items: start center; outline: none; touch-action: none; }
.cd-pagehost { position: relative; direction: ltr; }
.cd-lib .empty { grid-column: 1 / -1; }
.cd-pagehost .cp { box-shadow: 0 10px 40px -14px rgba(22,36,74,.45); overflow: visible; }
.cd-pagehost .cp-el { cursor: move; }
.cd-pagehost .cp-el:hover { outline: 1px dashed rgba(11,122,117,.55); }
.cd-selbox { position: absolute; outline: 2px solid #0B7A75; pointer-events: none; transform-origin: center; }
.cd-selbox.locked { outline-color: #8A95A5; outline-style: dashed; }
.cd-h { position: absolute; width: calc(10px * var(--s)); height: calc(10px * var(--s)); background: #fff; border: calc(2px * var(--s)) solid #0B7A75; border-radius: 50%; pointer-events: auto; transform: translate(-50%, -50%); touch-action: none; }
.cd-h-nw { left: 0; top: 0; cursor: nwse-resize; } .cd-h-n { left: 50%; top: 0; cursor: ns-resize; } .cd-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.cd-h-e { left: 100%; top: 50%; cursor: ew-resize; } .cd-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .cd-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.cd-h-sw { left: 0; top: 100%; cursor: nesw-resize; } .cd-h-w { left: 0; top: 50%; cursor: ew-resize; }
.cd-guide { position: absolute; background: #E0457B; pointer-events: none; }
.cd-guide.v { top: 0; bottom: 0; width: 0.3mm; } .cd-guide.h { left: 0; right: 0; height: 0.3mm; }
.cd-side { background: #fff; border-inline-start: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.cd-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.cd-tabs button { border: 0; background: none; padding: 11px 4px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.cd-tabs button.on { color: var(--navy); font-weight: 700; border-bottom-color: var(--teal); }
.cd-panel { overflow: auto; padding: 12px 14px 24px; display: grid; align-content: start; gap: 4px; }
.cd-title { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.cd-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0; display: grid; gap: 8px; }
.cd-group h4 { margin: 0; font-size: 13px; color: var(--navy); }
.cd-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.cd-row > * { flex: 1 1 120px; }
.cd-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-num, .cd-sel, .cd-color { display: grid; gap: 3px; font-size: 12px; color: var(--muted); position: relative; }
.cd-num input, .cd-sel select { height: 36px; font-size: 13.5px; padding: 0 8px; }
.cd-num i { position: absolute; left: 8px; bottom: 9px; font-style: normal; font-size: 11px; color: #9AA4B2; pointer-events: none; }
.cd-color { grid-template-columns: 1fr auto auto; align-items: center; }
.cd-color input[type=color] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }
.cd-none { border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-size: 11.5px; padding: 4px 8px; cursor: pointer; }
.cd-none.on { background: var(--navy); color: #fff; }
.cd-check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.cd-seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cd-seg button { flex: 1; border: 0; background: #fff; padding: 7px 4px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.cd-seg button + button { border-inline-start: 1px solid var(--line); }
.cd-seg button.on { background: var(--navy); color: #fff; }
.cd-text { width: 100%; font: inherit; font-size: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.cd-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-hint { padding: 18px 6px; color: var(--muted); display: grid; gap: 6px; }
.cd-hint b { color: var(--navy); }
.cd-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.cd-add-b { border: 1px solid var(--line); background: #F7F9FB; border-radius: 12px; padding: 14px 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--navy); cursor: pointer; }
.cd-add-b:hover { border-color: var(--teal); background: #EEF7F6; }
.cd-layers { display: grid; gap: 6px; }
.cd-layer { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.cd-layer.on { border-color: var(--teal); background: #EEF7F6; }
.cd-layer small { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-layer-acts { display: flex; gap: 4px; }
.cd-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.cd-fields button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px; font: inherit; font-size: 13px; cursor: pointer; display: grid; gap: 2px; text-align: right; }
.cd-fields small { color: var(--muted); font-size: 10.5px; }
.cd-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; max-height: 55vh; overflow: auto; }
.cd-lib-item { position: relative; border: 1px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(#F3F5F8 0 25%, #fff 0 50%) 0 0 / 14px 14px; padding: 8px; cursor: pointer; display: grid; gap: 4px; }
.cd-lib-item img { width: 100%; height: 90px; object-fit: contain; }
.cd-lib-item small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-lib-x { position: absolute; top: 4px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; }
.cd-list { display: grid; gap: 14px; }
.cd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cd-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; display: grid; }
.cd-thumb { position: relative; width: 100%; overflow: hidden; background: #F3F5F8; }
.cd-thumb .cp { pointer-events: none; position: absolute; top: 0; right: 0; transform-origin: top right; transform: scale(0); }
.cd-card-b { padding: 10px 12px 4px; display: grid; gap: 2px; }
.cd-card-b small { color: var(--muted); }
.cd-card-a { padding: 6px 12px 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.cd-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cd-preset { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; cursor: pointer; display: grid; gap: 6px; font: inherit; font-size: 12.5px; }
.cd-preset.on { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,122,117,.15); }
.cd-main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; }
.cd-stagebar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 12px; background: #fff; border-bottom: 1px solid var(--line); min-height: 46px; }
.cd-tip { color: var(--muted); font-size: 13px; }
.cd-sb { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13px; cursor: pointer; color: var(--navy); }
.cd-sb:hover:not(:disabled) { border-color: var(--teal); background: #EEF7F6; }
.cd-sb:disabled { opacity: .45; cursor: default; }
.cd-sb.danger { color: #B42318; }
.cd-sb-x { background: var(--teal); border-color: var(--teal); color: #fff; margin-inline-start: auto; }
.cd-sb-x:hover:not(:disabled) { background: var(--teal); }
.cd-sb-n { font-size: 13.5px; color: var(--navy); margin-inline-end: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-lead { margin: 2px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.cd-lead b { color: var(--navy); }
.cd-parts { display: grid; gap: 6px; }
.cd-part { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cd-part.off { background: #F4F6F9; }
.cd-part.off .cd-part-n b { color: #8A95A5; }
.cd-part-n { flex: 1; min-width: 0; border: 0; background: none; text-align: right; font: inherit; cursor: pointer; display: grid; gap: 1px; padding: 6px 0; }
.cd-part-n b { font-size: 13.5px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-part-n small { font-size: 11.5px; color: var(--muted); }
.cd-sw { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.cd-sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.cd-sw span { position: absolute; inset: 0; background: #C9D1DE; border-radius: 999px; transition: background .15s; }
.cd-sw span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.cd-sw input:checked + span { background: var(--teal); }
.cd-sw input:checked + span::after { transform: translateX(-18px); }
.cd-sw input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.cd-sw input:disabled + span { opacity: .5; }
.cd-count { color: var(--muted); font-size: 12px; margin-inline-end: auto; }
.cd-acts { align-items: center; margin: 8px 0 4px; }
.cd-back { border: 0; background: none; color: var(--teal); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 0 6px; text-align: right; justify-self: start; }
.cd-vis { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.cd-vis small { color: var(--muted); font-size: 12px; font-weight: 400; }
.cd-size { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cd-size > span { flex: 1; }
.cd-size b { min-width: 28px; text-align: center; color: var(--navy); }
.cd-sws { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.cd-sws-r { display: flex; flex-wrap: wrap; gap: 7px; }
.cd-swc { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.cd-swc.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--teal); }
.cd-swc-none { background: linear-gradient(135deg, #fff 44%, #E0457B 44% 56%, #fff 56%); }
.cd-swc-more { background: conic-gradient(#E0457B, #F2C94C, #27AE60, #2D9CDB, #9B51E0, #E0457B); }
.cd-swc-more input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cd-range { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.cd-range input { width: 100%; accent-color: var(--teal); }
.cd-adv { border: 1px dashed var(--line); border-radius: 12px; padding: 9px 12px; margin-top: 10px; }
.cd-adv summary { cursor: pointer; font-size: 13px; color: var(--navy); font-weight: 600; }
.cd-adv[open] summary { margin-bottom: 6px; }
.cd-pal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-pal-b { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 2px; cursor: pointer; display: grid; gap: 5px; justify-items: center; font: inherit; }
.cd-pal-b:hover { border-color: var(--teal); background: #EEF7F6; }
.cd-pal-b span { display: flex; }
.cd-pal-b i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.cd-pal-b i + i { margin-inline-start: -6px; }
.cd-pal-b small { font-size: 11px; color: var(--ink); }
.cd-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-col { position: relative; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(0,0,0,.12); overflow: hidden; cursor: pointer; }
.cd-col input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.cd-frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cd-frame { border: 2px solid var(--line); border-radius: 12px; background: #F7F9FB; padding: 7px 4px; cursor: pointer; display: grid; justify-items: center; gap: 4px; font: inherit; }
.cd-frame:hover { border-color: #9FCFCB; }
.cd-frame.on { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,122,117,.15); }
.cd-frame small { font-size: 11.5px; }
.cd-frame-v { position: relative; width: 58px; overflow: hidden; box-shadow: 0 2px 6px -2px rgba(0,0,0,.3); background: #fff; }
.cd-frame-v .cp { position: absolute; top: 0; left: 0; transform-origin: top left; pointer-events: none; }
.cd-add-b i { font-style: normal; color: var(--teal); margin-inline-end: 4px; }
.cd-add-b:disabled { opacity: .5; cursor: default; }
@media (max-width: 860px) {
  .cd-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 46vh); }
  .cd-side { border-inline-start: 0; border-top: 1px solid var(--line); }
  .cd-stage { padding: 10px; }
  .cd-bar .cd-kind { max-width: 150px; }
  .cd-stagebar { padding: 6px 8px; gap: 5px; flex-wrap: nowrap; overflow-x: auto; min-height: 42px; }
  .cd-sb { padding: 5px 10px; font-size: 12.5px; flex: none; }
  .cd-sb-n { display: none; }
  .cd-tip { font-size: 12px; white-space: nowrap; }
  .cd-bar { flex-wrap: nowrap; gap: 5px; padding: 6px 8px; }
  .cd-bar .cd-name { min-width: 0; flex: 1 1 auto; height: 36px; }
  .cd-bar-g .cd-zoom, .cd-zoom-l, .cd-status { display: none; }
  .cd-bar .btn.sm { padding-inline: 9px; }
}
.cd-save.dirty { box-shadow: 0 0 0 3px rgba(178,107,0,.25); }
.cd-pagehost .cp-hidden { opacity: .22; outline: 1px dashed #8A95A5; }
.ask-reason textarea { width: 100%; } .ask-reason .err { color: var(--red); }
/* Transcript (كشف الدرجات) page */
.tp { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.tp::before { content: ""; position: absolute; inset: 7mm; border: 0.35mm solid #16244A; border-radius: 1.5mm; pointer-events: none; }
.tp-in { position: absolute; inset: 0; padding: 12mm 13mm 11mm; display: flex; flex-direction: column; gap: 3.2mm; font-size: 10.5pt; overflow: hidden; }
.tp-head { display: flex; justify-content: space-between; align-items: center; gap: 6mm; border-bottom: 0.6mm solid #16244A; padding-bottom: 3mm; }
.tp-org { display: flex; gap: 3mm; align-items: center; }
.tp-org .tp-logo { width: 15mm; height: 15mm; object-fit: contain; }
.tp-org b { display: block; font-size: 1.35em; color: #16244A; }
.tp-org span { color: #5F6B7A; font-size: .88em; }
.tp-ref { text-align: left; font-size: .82em; color: #5F6B7A; line-height: 1.7; }
.tp-draft-tag { background: #FFF4E5; color: #B26B00; padding: 1mm 3mm; border-radius: 2mm; font-weight: 700; }
.tp-title { margin: 0; text-align: center; font-family: Amiri, serif; font-size: 1.85em; color: #16244A; line-height: 1.3; }
.tp-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm 4mm; background: #F4F6FA; border-radius: 2mm; padding: 3mm 4mm; }
.tp-info span { display: block; font-size: .76em; color: #5F6B7A; }
.tp-info b { font-size: .97em; color: #1A2233; }
.tp-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.tp-table th { background: #16244A; color: #fff; padding: 1.6mm 1.4mm; font-weight: 600; border: 0.25mm solid #16244A; }
.tp-table td { border: 0.25mm solid #CCD3DE; padding: 1.3mm 1.4mm; text-align: center; }
.tp-table td:first-child, .tp-table th:first-child { text-align: right; }
.tp-table tbody tr:nth-child(even) td { background: #F7F9FC; }
.tp-table td.fail { color: #B42318; font-weight: 700; }
.tp-empty { text-align: center; color: #5F6B7A; }
.tp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(26mm, 1fr)); gap: 2mm; }
.tp-sum div { border: 0.3mm solid #CCD3DE; border-radius: 2mm; padding: 1.8mm; text-align: center; display: grid; gap: .6mm; }
.tp-sum span { font-size: .76em; color: #5F6B7A; }
.tp-sum b { color: #16244A; }
.tp-note { background: #F7F9FC; border-inline-start: 1mm solid #0B7A75; padding: 2mm 3mm; font-size: .92em; }
.tp-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; }
.tp-sign { display: grid; justify-items: center; gap: 1.2mm; min-width: 44mm; font-size: .9em; }
.tp-sign i { display: block; width: 42mm; border-top: 0.3mm solid #1A2233; margin-top: 9mm; }
.tp-qr { display: grid; justify-items: center; gap: .8mm; }
.tp-qr img { width: 22mm; height: 22mm; }
.tp-qr small { font-size: .68em; color: #5F6B7A; }
.tp-legal { margin: 0; font-size: .7em; color: #5F6B7A; text-align: center; line-height: 1.6; }
.cp .cp-void.tp-draft { color: rgba(178,107,0,.16); }
/* Transcripts page */
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tr-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tr-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 70px minmax(0, 1.4fr) minmax(0, 1.8fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.tr-row:first-child { border-top: 0; }
.tr-head { background: #F4F6F9; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tr-row.off { color: var(--muted); }
.tr-check { display: flex; gap: 10px; align-items: center; min-width: 0; cursor: pointer; }
.tr-check input { width: 18px; height: 18px; flex: none; accent-color: var(--teal); }
.tr-check span { display: grid; min-width: 0; }
.tr-check b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tr-check small { color: var(--muted); font-size: 11.5px; text-align: right; }
.tr-note-b { border: 0; background: none; color: var(--teal); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tr-note { grid-column: 1 / -1; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; }
.tr-opts { margin-top: 14px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.tr-opts summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.tr-row .badge { white-space: normal; text-align: start; line-height: 1.6; }
/* Phone: the name keeps its room with the percentage beside it; the result (which can list several subjects)
   and the official copy go on their own lines underneath. */
@media (max-width: 720px) {
  .tr-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; padding: 10px 12px; }
  .tr-row > span:nth-child(2) { font-weight: 700; color: var(--navy); }
  .tr-row > span:nth-child(3), .tr-row > span:nth-child(4) { grid-column: 1 / -1; padding-inline-start: 28px; }
  .tr-row > .tr-note-b { grid-column: 1 / -1; justify-self: start; padding-inline-start: 28px; }
  .tr-head > span { display: none; }
}
/* Library: textbooks */
.lb-form { display: grid; gap: 4px; }
.lb-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lb-seg button { flex: 1 1 auto; border: 0; background: #fff; padding: 9px 10px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.lb-seg button + button { border-inline-start: 1px solid var(--line); }
.lb-seg button.on { background: var(--navy); color: #fff; }
.lb-cover-row { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.lb-cover { width: 72px; height: 96px; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: #F7F9FB; flex: none; font-size: 11px; color: var(--muted); text-align: center; }
.lb-cover img { width: 100%; height: 100%; object-fit: cover; }
.lb-grade { display: grid; gap: 6px; max-height: 46vh; overflow: auto; margin-top: 8px; }
.lb-grade-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 80px; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.lb-grade-row select, .lb-grade-row input[type=number] { height: 36px; }
.lb-check { display: flex; gap: 8px; align-items: center; min-width: 0; cursor: pointer; }
.lb-check input { width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.lb-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.lb-item:first-child { border-top: 0; }
.lb-thumb { width: 44px; height: 58px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.lb-thumb.none { display: grid; place-items: center; background: #F1F4F8; color: var(--muted); font-size: 10.5px; }
.lb-info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 560px) { .lb-grade-row { grid-template-columns: 1fr 76px; } .lb-grade-row .lb-check { grid-column: 1 / -1; } }
/* Teacher grade entry */
.ge { display: grid; gap: 12px; }
.ge-step { font-size: 14px; color: var(--navy); margin-top: 4px; }
.ge-pairs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ge-pair { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 14px; cursor: pointer; display: grid; gap: 2px; text-align: right; color: var(--ink); }
.ge-pair small { color: #B26B00; font-size: 11.5px; }
.ge-pair.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.ge-pair.on small { color: #FFE7B8; }
.ge-new { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 12px; }
.ge-field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.ge-field input { height: 42px; }
.ge-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.ge-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ge-chip { border: 1px solid var(--line); background: #F7F9FB; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.ge-chip small { color: var(--muted); font-size: 11px; }
.ge-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ge-chip.on small { color: #C9D6EE; }
.ge-max-in { width: 90px; height: 38px; }
.ge-list { display: grid; gap: 8px; }
.ge-item { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; font: inherit; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: right; }
.ge-item:hover { border-color: var(--teal); }
.ge-item > div { display: grid; gap: 3px; min-width: 0; }
.ge-item small { color: var(--muted); font-size: 12px; }
.ge-item-s { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ge-go { color: var(--teal); font-weight: 700; font-size: 13px; }
.ge-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ge-head h2 { margin: 0; font-size: 19px; }
.ge-back { border: 0; background: none; color: var(--teal); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; flex-basis: 100%; text-align: right; }
.ge-tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ge-sheet { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; padding-bottom: 80px; }
.ge-sheet li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 96px 44px; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.ge-n { color: var(--muted); font-size: 12.5px; text-align: center; }
.ge-name { font-size: 14.5px; overflow-wrap: anywhere; line-height: 1.5; }
.ge-score { height: 44px; font-size: 18px; font-weight: 700; text-align: center; }
.ge-score.bad { border-color: var(--red); background: #FDECEA; }
.ge-score::-webkit-outer-spin-button, .ge-score::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ge-score { -moz-appearance: textfield; appearance: textfield; }
.ge-of { color: var(--muted); font-size: 12.5px; }
.ge-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: 0 -6px 20px -12px rgba(22,36,74,.35); }
.ge-bar > div { display: grid; gap: 2px; }
.ge-state { color: var(--muted); font-size: 12px; }
.ge-state.ok { color: var(--teal); } .ge-state.err { color: var(--red); }
@media (max-width: 560px) {
  .ge-row { grid-template-columns: 1fr; }
  .ge-sheet li { grid-template-columns: 26px minmax(0, 1fr) 84px; }
  .ge-of { display: none; }
  .ge-bar { bottom: 64px; }
}
.quick-act .qa-ic { position: relative; }
.qa-badge { position: absolute; top: -6px; inset-inline-start: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.t-acts .quick-act { font-size: 14px; padding: 16px 6px; }
@media (max-width: 719px) { .t-acts .quick-act { font-size: 12.5px; padding: 12px 2px; } }
/* Option cards (one choice) and section chips (on/off), used in the teachers settings */
.pick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.pick-card { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; color: var(--navy); cursor: pointer; }
.pick-card b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.pick-card small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.pick-card.on { border-color: var(--teal); background: var(--teal-soft); }
.pick-dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
.pick-card.on .pick-dot { border-color: var(--teal); box-shadow: inset 0 0 0 4px #fff; background: var(--teal); }
.sec-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.sec-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px dashed var(--line-2); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: line-through; }
.sec-chip.on { border-style: solid; border-color: var(--teal); background: var(--teal-soft); color: var(--navy); font-weight: 600; text-decoration: none; }
.sec-tick { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; background: var(--teal); color: #fff; }
.sec-chip:not(.on) .sec-tick { background: var(--line); }
.tc-h { font-size: 14.5px; margin: 18px 0 2px; }
.tc-list { display: grid; gap: 8px; margin-top: 10px; }
.tc-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.tc-row > div { flex: 1; min-width: 0; }
.tc-row small { display: block; color: var(--muted); font-size: 12px; }
/* Administration grades list */
.ax-list { display: grid; gap: 8px; margin-top: 12px; }
.ax-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ax-main { flex: 1; min-width: 0; }
.ax-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.ax-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ax-sheet { max-height: 60vh; overflow: auto; }
@media (max-width: 719px) { .ax-item { flex-direction: column; align-items: stretch; } .ax-acts { justify-content: flex-start; } }
.s-guardian { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.s-phone { margin-inline-start: 6px; font-weight: 700; color: var(--teal); text-decoration: none; unicode-bidi: isolate; white-space: nowrap; }
.tc-more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.tc-more summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.tc-more summary small { font-weight: 400; color: var(--muted); }
.tc-search { width: 100%; max-width: 360px; margin-top: 10px; }
@media (min-width: 900px) { .tc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fin-acts { margin: 4px 0 14px; }
.fin-acts .quick-act { font-size: 14px; padding: 16px 6px; }
.fin-more { margin: 14px 0; }
.fin-more > summary { cursor: pointer; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 700; color: var(--navy); }
.fin-more[open] > summary { margin-bottom: 12px; }
button.sf-kpi.go { font: inherit; color: inherit; text-align: start; cursor: pointer; position: relative; }
button.sf-kpi.go::after { content: "‹"; position: absolute; inset-inline-end: 12px; top: 10px; color: var(--muted); font-size: 18px; line-height: 1; }
button.sf-kpi.go:hover { border-color: var(--line-2); }
@media (max-width: 560px) {
  .att-monthly th:nth-child(5), .att-monthly td:nth-child(5) { display: none; }
  .att-monthly table { width: 100%; }
  .att-monthly th, .att-monthly td { padding-inline: 6px; white-space: nowrap; }
}
.sh-done { margin-top: 8px; font-size: 13px; color: var(--muted); }
.sh-done summary { cursor: pointer; }
.sh-done ul { list-style: none; padding: 6px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sh-done li { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); }
.att-source { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--teal-soft); font-size: 13.5px; color: var(--navy); }
/* Admin home: one activity panel with tabs (alerts, overdue invoices, absences, new students, announcements) */
.act-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.act-tabs::-webkit-scrollbar { display: none; }
.act-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: none; border-radius: 999px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.act-tabs button.on { background: var(--navy); color: #fff; }
.act-n { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 11.5px; line-height: 20px; text-align: center; }
.act-tabs button.on .act-n { background: rgba(255,255,255,.2); color: #fff; }
/* Gate review: folded classes and the two steps */
.gate-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 4px; }
.gate-groups { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 12px; }
.gate-group { padding: 0; }
.gate-group > summary.gg-head { list-style: none; cursor: pointer; padding: 10px 12px; }
.gate-group > summary.gg-head::-webkit-details-marker { display: none; }
.gate-group > summary.gg-head::before { content: "‹"; color: var(--muted); font-size: 18px; transition: transform .15s; }
.gate-group[open] > summary.gg-head::before { transform: rotate(-90deg); }
.gg-n { flex: 1; color: var(--muted); font-size: 12.5px; }
.gg-body { display: grid; gap: 2px; padding: 0 12px 10px; border-top: 1px solid var(--line); }
.gate-steps { display: grid; gap: 10px; grid-template-columns: 2fr 1fr; margin-top: 10px; }
.gate-step { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg, #F6F8FA); display: grid; gap: 6px; align-content: start; }
@media (max-width: 760px) { .gate-steps { grid-template-columns: 1fr; } }

/* Printing any page or dialog: only the content. Navigation, buttons, filters and other controls never reach the paper. */
@media print {
  .bnav, .tabs, .topbar, .toast, .update-bar, .install-ic, .seg-tabs, .file-tabs, .no-print, .skel,
  button:not(.print-keep), .btn, a.btn, input[type=search], .filters, .toolbar, .ho-ways, .ho-sub, .grp-acts, .row.spaced:has(> .btn:only-child) { display: none !important; }
  body.has-bnav { padding-bottom: 0 !important; }
  dialog[open] { position: static !important; inset: auto !important; margin: 0 !important; max-height: none !important; max-width: none !important;
    width: 100% !important; overflow: visible !important; box-shadow: none !important; padding: 0 !important; }
  dialog[open] .d-in { max-height: none !important; overflow: visible !important; }
  dialog[open] .d-in > h2 { margin-top: 0; }
  textarea.printing-hidden { display: none !important; }
  .print-text { display: block !important; white-space: pre-wrap; font: inherit; line-height: 1.8; border: 1px solid #E3E7EC; border-radius: 10px; padding: 10px 12px; }
  .ho-card, .grp-card { break-inside: avoid; }
  .ho-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href] { color: inherit; text-decoration: none; }
  input:not([type=checkbox]):not([type=radio]), select { border: none !important; background: none !important; padding: 0 !important; box-shadow: none !important; appearance: none; -webkit-appearance: none; min-height: 0 !important; }
  .sf-filters, .sf-cb, span.go[aria-hidden] { display: none !important; }
  .sf-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto !important; padding: 6px 10px; border-radius: 8px; break-inside: avoid; }
  .sf-row .sf-stage, .sf-row .sf-meta { grid-column: auto !important; }
  .sf-row .sf-dates { display: flex !important; flex-direction: column; }
  .kpi-grid { break-inside: avoid; }
}
.print-text { display: none; }

/* School handover document (owner): a single printed page — the screen dialog itself never prints. */
.ho-doc { display: none; }
@media print {
  body.act-printing > .act-sheet { display: block !important; padding: 0 !important; }
  body.act-printing dialog { display: none !important; }
  dialog.ho-dlg[open] .d-in > :not(.handover-x), dialog.ho-dlg .handover-x > :not(.ho-doc) { display: none !important; }
  .ho-doc { display: block !important; color: #16244A; font-size: 10.5pt; line-height: 1.6; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ho-doc h1, .ho-doc h2 { margin: 0; }
  .hd-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 3px solid #0B7A75; }
  .hd-logo { height: 42px; }
  .hd-title h1 { font-size: 18pt; color: #16244A; } .hd-title small { color: #5A6478; font-size: 9.5pt; }
  .hd-ref { display: grid; text-align: center; gap: 1px; padding: 6px 10px; border: 1px solid #C9D6DC; border-radius: 8px; background: #F4F8F9; }
  .hd-ref small { font-size: 8pt; color: #5A6478; } .hd-ref b { font-size: 9.5pt; letter-spacing: .02em; }
  .hd-hello { margin: 12px 0; font-size: 11pt; line-height: 1.8; }
  .hd-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
  .hd-box { border: 1px solid #DCE3E8; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; break-inside: avoid; }
  .hd-box h2 { font-size: 11.5pt; color: #0B7A75; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid #EEF2F4; }
  .hd-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #EEF2F4; }
  .hd-row:last-child { border-bottom: 0; } .hd-row span { color: #5A6478; } .hd-row.ltr-v b { direction: ltr; }
  .hd-qr { display: grid; grid-template-columns: 32mm 1fr; gap: 12px; align-items: center; }
  .hd-qr img { width: 32mm; height: 32mm; border: 1px solid #DCE3E8; border-radius: 8px; padding: 2mm; background: #fff; }
  .hd-qr > div { display: grid; gap: 1px; min-width: 0; }
  .hd-qr small { color: #5A6478; font-size: 8.5pt; margin-top: 4px; } .hd-qr b { font-size: 10pt; word-break: break-all; }
  .hd-qr .hd-link { font-size: 8.5pt; direction: ltr; text-align: start; unicode-bidi: plaintext; }
  .hd-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 14px 0 6px; break-inside: avoid; }
  .hd-sign div { display: grid; gap: 2px; text-align: center; } .hd-sign small { color: #5A6478; font-size: 8.5pt; } .hd-sign b { font-size: 10pt; }
  .hd-sign i { display: block; height: 14mm; border-bottom: 1px solid #16244A; }
  .hd-qr .hd-scan { color: #0B7A75; margin-top: 6px; }
  .hd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: s; }
  .hd-steps li { counter-increment: s; display: grid; gap: 2px; padding: 8px; border-radius: 8px; background: #F4F8F9; }
  .hd-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: #0B7A75; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 10pt; }
  .hd-steps b { font-size: 10pt; } .hd-steps span { font-size: 9pt; color: #3D4A5C; }
  .hd-safe { background: #F2FAF8; border-color: #BFE3DB; }
  .hd-safe ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 3px; font-size: 9.5pt; }
  .hd-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 6px; padding-top: 10px; border-top: 3px solid #0B7A75; }
  .hd-foot > div:first-child { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 9.5pt; }
  .hd-foot small { color: #5A6478; width: 100%; }
  .hd-seal { text-align: center; display: grid; } .hd-seal b { font-size: 12pt; color: #16244A; } .hd-seal small { font-size: 8.5pt; color: #5A6478; }
}

/* Owner security page and two-step enrollment */
.sec-list { margin: 10px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.sec-rows { display: grid; gap: 8px; }
.sec-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sec-row.unseen { border-color: var(--amber); background: #FFFBF2; }
.sec-row small { display: block; color: var(--muted); margin-top: 3px; }
.sec-row p { margin: 4px 0 0; font-size: 14px; }
.mfa-enroll { max-width: 560px; margin: 32px auto; padding: 0 16px; }
.mfa-steps { margin: 12px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.mfa-qr { display: grid; place-items: center; margin: 10px 0; }
.mfa-qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.mfa-h { font-size: 15px; margin: 16px 0 8px; color: var(--navy); }
.mfa-open { display: flex; justify-content: center; text-decoration: none; margin-bottom: 8px; }
.mfa-key { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.mfa-key .key-text, .mfa-key code { letter-spacing: .06em; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; margin: 12px 0; padding-inline-start: 22px; font-size: 16px; }
.mfa-codes code { font-weight: 700; letter-spacing: .08em; }
@media print { .mfa-codes { font-size: 14pt; } }

/* Date and time fields: the same box as every other field on every device. iOS Safari otherwise draws its own
   wider box that ignores the column width and overlaps the next field, and shows an empty field with no height. */
input[type=date], input[type=time], input[type=month], input[type=datetime-local] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: start; line-height: 1.4;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value,
input[type=month]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: start; min-height: 1.4em; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { margin: 0; padding: 0 2px; cursor: pointer; }
.form-grid > *, .filters > *, .gate-filters > *, .gate-times > *, label.f, .field { min-width: 0; }
/* On phones a field font under 16px makes the browser zoom the page when the field is tapped. */
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }

/* Attendance: two separate sections (attendance / smart gate), then one scrolling row of sub-pages. */
.att-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.att-sec { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: start; min-width: 0; transition: border-color .15s, background .15s; }
.att-sec-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.att-sec-t { display: grid; gap: 2px; min-width: 0; }
.att-sec-t b { font-size: 17px; line-height: 1.3; }
.att-sec-t small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sec.on { border-color: var(--accent); background: var(--teal-soft); }
.att-sec.on .att-sec-ic { background: var(--accent); color: #fff; }
.subnav { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.subnav::-webkit-scrollbar { display: none; }
.subnav:empty { display: none; }
.subnav-b { flex: none; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; border: 0; background: none; color: var(--muted);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; min-height: 40px; }
.subnav-b.on { background: var(--accent); color: #fff; }
.subnav-b:not(.on):hover { background: var(--bg); color: var(--ink); }
.gate-day-head { margin-bottom: 8px; max-width: 260px; }
.gate-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
@media (max-width: 560px) {
  .att-sec { padding: 12px; gap: 10px; }
  .att-sec-ic { width: 38px; height: 38px; }
  .att-sec-t b { font-size: 15.5px; }
  .att-sec-t small { display: none; }
  .gate-day-head { max-width: none; }
}
.gate-meta .gate-rate { display: flex; align-items: baseline; gap: 6px; } .gate-meta .gate-rate b { display: inline; font-size: 20px; }
.gate-admin .gate-phase { margin-bottom: 10px; }
/* Teacher home: shortcuts the teacher chooses. */
.t-shortcuts { margin-bottom: 14px; }
.t-sc-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; }
.t-sc-head b { font-size: 15px; }
.t-shortcuts .quick-acts { margin-bottom: 0; }
.sc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.sc-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: start; }
.sc-item .sc-ic { color: var(--muted); display: grid; }
.sc-item .sc-t { flex: 1; min-width: 0; }
.sc-item .sc-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--line-2); color: transparent; }
.sc-item.on { border-color: var(--accent); background: var(--teal-soft); }
.sc-item.on .sc-ic { color: var(--accent); }
.sc-item.on .sc-n { background: var(--accent); border-color: var(--accent); color: #fff; }
/* One-time invitation to turn on phone notifications, floating above the page and the bottom bar. */
.push-float { position: fixed; inset-inline: 12px; bottom: calc(12px + var(--sab)); z-index: 40; max-width: 460px; margin-inline: auto; }
body.has-bnav .push-float { bottom: calc(76px + var(--sab)); }
.push-float .push-invite { margin: 0; box-shadow: 0 10px 30px rgba(22, 36, 74, .18); background: #fff; }
@media print { .push-float { display: none !important; } }
/* The installed app does not bounce or pull past its edges. */
@media (display-mode: standalone) { html, body { overscroll-behavior: none; } }
/* The installed app: the status bar (white clock, black-translucent) gets Midar's navy behind it, so the clock stays
   readable and nothing scrolls into view under it. It takes no touches (the phone owns that strip anyway).
   html.standalone is set by script for iOS (navigator.standalone), where display-mode is not always reported. */
@media (display-mode: standalone) { body::before { content: ""; position: fixed; top: 0; inset-inline: 0; height: var(--sat); background: #F7F9FD; z-index: 2147483000; pointer-events: none; } }
html.standalone body::before { content: ""; position: fixed; top: 0; inset-inline: 0; height: var(--sat); background: #F7F9FD; z-index: 2147483000; pointer-events: none; }
.picker-btn { display: inline-flex; align-items: center; gap: 6px; } .picker-btn .icon { flex: none; color: var(--muted); }
.noscript-box { max-width: 460px; margin: 12vh auto; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-align: center; line-height: 1.7; }
.noscript-box h1 { font-size: 20px; margin: 0 0 10px; }
.offline-card { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 20px; margin: 8px 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); }
.offline-card .oc-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.offline-card b { font-size: 17px; }
.offline-card p { margin: 0; color: var(--muted); font-size: 14px; max-width: 360px; line-height: 1.7; }
.score-clash ul { margin: 6px 0 10px; padding-inline-start: 20px; } .score-clash li { margin: 2px 0; }
html.unsupported #app, html.unsupported .install-ic, html.unsupported .push-float { display: none !important; }
.compat-box { max-width: 460px; margin: 12vh auto; padding: 24px; background: #fff; border: 1px solid var(--line, #E3E7EC); border-radius: 16px;
  color: var(--ink, #1A2233); text-align: center; line-height: 1.7; }
.compat-box h1 { font-size: 20px; margin: 0 0 10px; }
.compat-box p { margin: 0 0 10px; }
.compat-box .compat-note { color: var(--muted, #5F6B7A); font-size: 14px; margin: 0; }
.sc-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border: 1.5px dashed var(--line-2);
  border-radius: var(--radius); background: transparent; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.sc-add:hover { border-color: var(--accent); color: var(--accent); }
.t-acts.n5, .t-acts.n6 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) { .t-acts.n5 { grid-template-columns: repeat(5, 1fr); } .t-acts.n6 { grid-template-columns: repeat(6, 1fr); } }

/* Forms as cards (add/edit teacher and student): a clear title per section, optional sections folded. */
.student-form.tidy { display: grid; gap: 12px; }
.fcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fcard-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--navy); }
.fcard-h .icon { color: var(--accent); flex: none; }
.fcard.fold { padding: 0; }
.fcard.fold > summary { list-style: none; cursor: pointer; margin: 0; padding: 14px 16px; min-height: 52px; }
.fcard.fold > summary::-webkit-details-marker { display: none; }
.fcard.fold > summary > span { flex: none; }
.fcard-note { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard.fold > summary > .icon:last-child { color: var(--muted); transition: transform .15s; }
.fcard.fold[open] > summary > .icon:last-child { transform: rotate(180deg); }
.fcard.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fcard-in { padding: 14px 16px; }
.fcard .form-grid { gap: 2px 14px; }
.fcard .photo-row { margin-bottom: 6px; }
.fcard > .sub:last-child, .fcard-in > .sub:last-child { margin-bottom: 0; }
.fees-line { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.fees-line > input[type=checkbox] { width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; accent-color: var(--accent); }
.fees-line b { display: block; font-size: 14.5px; }
.fees-line small { color: var(--muted); font-size: 12.5px; }
dialog .student-form.tidy { background: var(--bg); margin: 0 -18px; padding: 12px 18px; }
@media (max-width: 560px) { .fcard { padding: 12px; } .fcard.fold > summary, .fcard-in { padding: 12px; } }

/* Students and teachers pages: a compact head (title, small figures in one row, actions), tidy filters and cards. */
.s-head .stats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.s-head .stats::-webkit-scrollbar { display: none; }
.s-head .stat { flex: 1 0 auto; min-width: 104px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border-color: transparent; }
.s-head .stat b { font-size: 20px; }
.s-head .stat .stat-l { font-size: 12.5px; }
.s-head .stat .sub { font-size: 11.5px; }
.s-head .more-stats { margin: 0 0 4px; }
.s-actions-top { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.s-actions-top .btn { min-height: 44px; }
@media (max-width: 640px) {
  .s-actions-top { display: flex; flex-wrap: nowrap; }
  .s-actions-top .btn { flex: 0 1 auto; white-space: nowrap; }
  .s-actions-top .btn:first-child { flex: 1 1 auto; }
  .s-actions-top .btn { padding-inline: 8px; font-size: 14px; }
}
.filters { gap: 8px; }
.filters > *, .filters .picker-btn { min-height: 44px; width: 100%; }
.filters .picker-btn { justify-content: flex-start; padding: 9px 12px; border-radius: 12px; border-color: var(--line-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters > :first-child { grid-column: 1 / -1; } }
.s-guardian { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.s-guardian .s-phone { margin: 0; }

/* Quran circles */
.qr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.qr-card { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; cursor: pointer; }
.qr-card:hover { border-color: var(--teal); }
.qr-card b { color: var(--navy); font-size: 16px; }
.qr-count { color: var(--teal); font-weight: 600; font-size: 13px; }
.qr-list { display: grid; gap: 8px; }
.qr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qr-row.behind .qr-who b { color: var(--amber-ink); }
.qr-who { display: flex; flex-direction: column; gap: 3px; text-align: start; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; min-width: 0; }
.qr-who b { color: var(--navy); }
.qr-today { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.qr-today:empty { display: none; }
.qr-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; grid-row: 1; grid-column: 2; }
.qr-bar { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; max-width: 260px; }
.qr-bar i { display: block; height: 100%; background: var(--teal); }
.qr-bar.big { height: 10px; max-width: none; margin: 6px 0; }
.qr-big { display: flex; align-items: baseline; gap: 10px; }
.qr-big b { font-size: 28px; color: var(--teal); }
.qr-juz { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.qr-juz span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; }
.qr-juz span.part { background: linear-gradient(to top, var(--teal-soft) var(--p), var(--bg) var(--p)); }
.qr-juz span.done { background: var(--teal); color: #fff; border-color: var(--teal); }
.qr-juz small { font-size: 10px; min-height: 13px; }
.qr-pick { display: grid; gap: 4px; max-height: 320px; overflow: auto; margin: 8px 0; }
.qr-pick label { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; }
.qr-pick label:hover { background: var(--bg); }
.qr-pick small { margin-inline-start: auto; }
@media (max-width: 640px) {
  .qr-row { grid-template-columns: minmax(0, 1fr); }
  .qr-acts { grid-row: auto; grid-column: auto; }
  .qr-juz { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.qr-who > .badge { align-self: flex-start; }

/* University */
.uni-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.uni-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.uni-kpi small { color: var(--muted); }
.uni-kpi b { color: var(--navy); font-size: 17px; }
.uni-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.uni-marks input { max-width: 90px; }

/* Site message form: the field only bots fill in stays out of sight and out of the tab order. */
.inq-trap { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== MIDAR SCHOOL 2.0 — sign-in, activation and password pages =====
   The background used to live on .au only, with html/body darkened through :has() (unsupported before Safari 15.4 and
   in some in-app browsers). Light page colour then showed above and below the page, behind the iOS status bar, during
   rubber-band scrolling and when the keyboard opened. Now: html and body carry the dark colour through a class set by
   authShell(), the gradient is a fixed layer that never ends while scrolling, the page uses 100vh with 100dvh where
   supported, and the safe areas pad the content. */
html.au-root, html.au-root body { background-color: #16244A; min-height: 100%; }
html.au-root body { min-height: 100vh; min-height: 100dvh; }
.au { min-height: 100vh; min-height: 100dvh; overflow: visible; overflow-x: clip; background: transparent; isolation: isolate;
  --au-ring: 0 0 0 4px rgba(11, 122, 117, .16); }
.au::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 560px at 85% -10%, rgba(11, 122, 117, .55), transparent 62%), radial-gradient(760px 520px at 0% 108%, rgba(11, 122, 117, .26), transparent 60%),
    linear-gradient(170deg, #23376B 0%, #16244A 52%, #0F1A38 100%); }
.au::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000, transparent 70%); mask-image: radial-gradient(ellipse at 70% 0%, #000, transparent 70%); }
.au-orbit { position: fixed; }
.au-brand { padding-top: max(44px, calc(20px + var(--sat))); padding-inline: max(52px, var(--sal)) max(52px, var(--sar)); }
.au-main { padding-bottom: max(40px, calc(24px + var(--sab))); scroll-padding-bottom: 120px; }
.au-panel { border-radius: 26px; box-shadow: 0 40px 80px -28px rgba(2, 8, 26, .7), 0 0 0 1px rgba(255,255,255,.08); }
.au-head h1 { color: #0F1A33; }
.au-main input:not([type=checkbox]):not(.otp-in):not(.pf-num):not(.pf-search):focus { border-color: #0B7A75; }
.au .btn.au-go { background: linear-gradient(135deg, #0B7A75 0%, #0E8F88 60%, #9FCFCB 150%); box-shadow: 0 12px 26px -12px rgba(11, 122, 117, .75), inset 0 1px 0 rgba(255,255,255,.18); }
.au .btn.au-go:hover { filter: brightness(1.05); }
.au-link { color: #0B7A75; }
.au-check input { accent-color: #0B7A75; }
.au-seg button:focus-visible, .au :focus-visible { outline: 3px solid #9FCFCB; outline-offset: 2px; }
.au-points li > span { color: #9FCFCB; }
.au-panel .notice { animation: au-fade .25s ease both; }
.au .btn.au-go:disabled { cursor: progress; }
@media (max-width: 959px) {
  .au-brand { padding: calc(18px + var(--sat)) max(20px, var(--sar)) 22px max(20px, var(--sal)); }
  .au-main { padding-inline: max(14px, var(--sal)) max(14px, var(--sar)); }
  .au-panel { padding: 30px 22px 22px; }
}
@media (max-width: 360px) { .au-panel { padding: 24px 16px 18px; border-radius: 22px; } .au-head h1 { font-size: 24px; } }

/* One navigation in every Midar app: on phones the bottom bar (teacher, admin, accountant, owner and the parent app alike),
   so the parent app's top section bar gives way to it below 1080px. */
@media (max-width: 1079px) {
  body.has-bnav .student-file.app > nav.profile-nav { display: none !important; }
}

/* Student file: list and print buttons inside the student's card (not a separate row above it). */
.sf-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
.sf-tools .btn { min-height: 36px; }
@media (max-width: 719px) { .sf-tools .btn:last-child { display: none; } }
/* The parent app's home: the same teal card and shortcuts as the teacher's home. */
.student-file.app .sf-hero { margin: 0 0 14px; }
.student-file.app .t-shortcuts { margin-bottom: 14px; }
.student-file.app .profile-body > .sf-kpis { margin-bottom: 14px; }

/* Desktop: the parent app's sections in a side menu, like the teacher, admin and accountant apps. */
@media (min-width: 1080px) {
  .student-file.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .student-file.app > * { grid-column: 2; }
  .student-file.app > nav.profile-nav { grid-column: 1; grid-row: 1 / span 12; position: sticky; top: calc(16px + var(--sat)); flex-direction: column !important; flex-wrap: nowrap;
    overflow: visible; gap: 4px; margin: 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
    -webkit-mask-image: none; mask-image: none; }
  .student-file.app > nav.profile-nav button { width: 100%; justify-content: flex-start; border: 0; border-radius: 12px; min-height: 42px; background: transparent; }
  .student-file.app > nav.profile-nav button:hover { background: var(--teal-soft); color: var(--teal); }
  .student-file.app > nav.profile-nav button.on { background: var(--teal); color: #fff; }
}

/* ── Finance: one row of parts, a box per part, folded setup ─────────────────────────────── */
.xb-chips.fin-parts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.xb-chips.fin-parts::-webkit-scrollbar { display: none; }
.xb-chips.fin-parts .xb-chip { flex: none; }
.fin-sections { margin: 4px 0 16px; }
.fin-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .fin-boxes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fin-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 104px; padding: 14px; text-align: start; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; font: inherit; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.fin-box:hover { border-color: var(--teal); transform: translateY(-1px); }
.fin-box b { font-size: 15px; }
.fin-box small { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.fin-box.teal .qa-ic { background: var(--teal-soft); color: var(--teal); } .fin-box.navy .qa-ic { background: var(--navy-soft); color: var(--navy); }
.fin-box.violet .qa-ic { background: var(--violet-soft); color: var(--violet); } .fin-box.red .qa-ic { background: var(--red-soft); color: var(--red); }
.fin-box.amber .qa-ic { background: var(--amber-soft); color: #B5650F; }
.fin-funds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .fin-funds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .fin-funds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fin-fund { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.fin-fund.off { opacity: .6; }
.fin-fund-h { display: flex; align-items: center; gap: 10px; }
.fin-fund-h small { display: block; color: var(--muted); font-size: 12.5px; }
.fin-fund-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.fin-fund.k-bank .fin-fund-ic { background: var(--navy-soft); color: var(--navy); }
.fin-fund.k-donations .fin-fund-ic { background: var(--amber-soft); color: #B5650F; }
.fin-fund.k-online .fin-fund-ic { background: var(--violet-soft); color: var(--violet); }
.fin-fund-v { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.fin-fund-n { color: var(--muted); font-size: 12.5px; }
.fin-fund-acts { display: flex; justify-content: flex-end; }
details.fin-fold { margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
details.fin-fold > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--navy); list-style: none; display: flex; align-items: center; gap: 8px; }
details.fin-fold > summary::-webkit-details-marker { display: none; }
details.fin-fold > summary::before { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); flex: none; }
details.fin-fold[open] > summary::before { content: "−"; }
details.fin-fold > .panel { margin: 0 12px 12px; box-shadow: none; }
details.fin-fold.inner { margin: 8px 0; background: var(--bg); }
details.fin-fold.inner > summary { font-weight: 600; font-size: 14px; padding: 12px 14px; }
details.fin-fold.inner > :not(summary) { padding: 0 14px 12px; }
.seg-tabs.fin-mode { margin-bottom: 12px; }
/* Parent app, phones: the full student card on the home page only; in every other section a slim line (photo + name),
   the way the teacher's greeting stays on the teacher's home. */
@media all {
  .student-file.app:not([data-view="overview"]) > .sf-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; margin-bottom: 10px; box-shadow: none; }
  .student-file.app:not([data-view="overview"]) > .sf-head .sf-avatar { width: 34px; height: 34px; }
  .student-file.app:not([data-view="overview"]) > .sf-head .sf-id h1 { font-size: 15px; margin: 0; }
  .student-file.app:not([data-view="overview"]) > .sf-head .sf-id .sub { font-size: 12px; }
  .student-file.app:not([data-view="overview"]) > .sf-head :is(.sf-chips, .sf-ids, .sf-tools) { display: none !important; }
}
.student-file.app:not([data-view="overview"]) > .push-invite { display: none; }

/* ── Student card (parent app): photo + name + class in one row, the two identifiers on one line, the list and print
   icons in the corner. ───────────────────────────────────────────────────────────────────────────────────────── */
.student-file.app > .sf-head { position: relative; display: grid !important; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 12px 12px; padding: 16px 16px 14px; border-radius: 22px; }
.student-file.app > .sf-head .sf-avatar { width: 56px; height: 56px; }
.student-file.app > .sf-head .sf-id { gap: 2px; padding-inline-end: 84px; }
.student-file.app > .sf-head .sf-id h1 { font-size: 18px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-file.app > .sf-head .sf-id .sub { font-size: 13px; }
.student-file.app > .sf-head .sf-chips { margin-top: 2px; }
.student-file.app > .sf-head .sf-ids { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.student-file.app > .sf-head .sf-idbox { justify-content: space-between; min-width: 0; padding: 6px 6px 6px 12px !important; background: var(--bg); border: 1px solid var(--line) !important; }
.student-file.app > .sf-head .sf-idbox > span { font-size: 11px; color: var(--muted); }
.student-file.app > .sf-head .sf-idbox b { font-size: 13px !important; overflow: hidden; text-overflow: ellipsis; }
.student-file.app > .sf-head .sf-idbox .sf-copy { width: 26px; height: 26px; }
.student-file.app > .sf-head .sf-tools { position: absolute; top: 14px; inset-inline-end: 14px; width: auto; display: flex; gap: 6px;
  margin: 0; padding: 0; border: 0; grid-column: auto; }
.sf-iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  color: var(--navy); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.sf-iconbtn:hover, .sf-iconbtn:focus-visible { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
@media (max-width: 719px) { .student-file.app > .sf-head .sf-tools .sf-iconbtn.print { display: none; } .student-file.app > .sf-head .sf-id { padding-inline-end: 44px; } }
@media (max-width: 359px) { .student-file.app > .sf-head .sf-ids { grid-template-columns: minmax(0, 1fr); } }
@media print { .sf-tools { display: none !important; } }
.student-file.app > .sf-head .sf-ids { gap: 6px; }
.student-file.app > .sf-head .sf-idbox { gap: 4px !important; padding: 4px 4px 4px 8px !important; }
.student-file.app > .sf-head .sf-idbox > span { font-size: 10.5px; }
.student-file.app > .sf-head .sf-idbox b { font-size: 12.5px !important; letter-spacing: 0 !important; text-overflow: clip; }
.student-file.app > .sf-head .sf-idbox .sf-copy { width: 22px; height: 22px; border-radius: 7px; }
.student-file.app > .sf-head .sf-idbox .sf-copy svg { width: 12px; height: 12px; }
/* The person icon in the greeting (teacher, accountant): the same drawing as the student's card, round. */
.dash-hello .dash-person { border: 0; border-radius: 50%; flex: none; }

/* ---------- «اشتراكات MIDAR AI» ---------- */
.aip .aip-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.aip .aip-now > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.aip .aip-now small { color: var(--muted); }
.aip .aip-now b { color: var(--navy); font-size: 19px; }
.aip .aip-renew { margin-top: 10px; }
.aip .aip-cycle { display: flex; gap: 6px; }
.aip .aip-cycle .chip { color: var(--teal); }
.aip .aip-cycle .chip.on { background: var(--teal); border-color: var(--teal); }
.aip .aip-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.aip .aip-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.aip .aip-card.top { border-color: var(--navy); }
.aip .aip-card.current { border: 2px solid var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.aip .aip-card h3 { margin: 0; color: var(--navy); font-size: 18px; }
.aip .aip-tag { position: absolute; top: -11px; inset-inline-start: 16px; padding: 2px 10px; border-radius: 20px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; }
.aip .aip-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.aip .aip-price b { color: var(--navy); font-size: 26px; }
.aip .aip-price s { color: var(--muted); }
.aip .aip-price .aip-noprice { font-size: 16px; color: var(--muted); }
.aip .aip-benefit { width: 100%; color: var(--teal); font-weight: 600; }
.aip .aip-facts, .aip .aip-tasks ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.aip .aip-tasks { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.aip .aip-tasks small { color: var(--muted); font-weight: 700; }
.aip .aip-act { margin-top: auto; display: grid; }
.aip .aip-act .btn { width: 100%; }
.aip .aip-compare { margin-top: 14px; }
.aip .aip-compare summary { cursor: pointer; color: var(--navy); font-weight: 700; }
.aip .aip-compare td.yes { color: var(--teal); font-weight: 700; text-align: center; }
.aip .aip-compare td.no { color: var(--muted); text-align: center; }
.aip .aip-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.aip .aip-packs article { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.aip .aip-packs b { color: var(--navy); font-size: 17px; }
.aip .aip-packs small { color: var(--muted); }
.aip .aip-req { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.aip .aip-req span { flex: 1; min-width: 180px; }
.aip-quote { display: grid; gap: 8px; min-width: min(420px, 80vw); }
.aip-quote .aip-qrow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.aip-quote .aip-qrow.total { border-bottom: 0; font-size: 17px; }
.aip-quote .aip-qrow.total b { color: var(--teal); }

/* ---------- MIDAR AI | مدار الذكي: the one conversation ---------- */
.mchat { position: relative; display: flex; flex-direction: column; height: calc(100dvh - 128px); min-height: 520px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.mc-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.mc-av { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.mc-av.sm { width: 30px; height: 30px; border-radius: 9px; }
.mc-av.xl { width: 84px; height: 84px; border-radius: 22px; }
.mc-who { min-width: 0; }
.mc-who b { display: block; color: var(--navy); font-size: 15.5px; line-height: 1.35; white-space: nowrap; }
.mc-bar { color: var(--teal); margin: 0 2px; }
.mc-who small { color: var(--muted); font-size: 12.5px; }
.mc-sp { flex: 1; }
.mc-acts { display: flex; align-items: center; gap: 6px; }
.mc-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; white-space: nowrap; }
.mc-pill.plan { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; }
.mc-pill.pts b { color: var(--teal); }
.mc-pill.pts.low { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-ink); }
.mc-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff;
  color: var(--navy); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mc-btn:hover { background: var(--bg); }
.mc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; flex: none; }
.mc-icon.sm { width: 28px; height: 28px; border-radius: 8px; }
.mc-icon.plus { width: 40px; height: 40px; border-radius: 50%; }
.mc-menu-wrap { position: relative; }
.mc-options { position: absolute; top: 42px; inset-inline-end: 0; z-index: 5; min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 40px rgba(22, 36, 74, .18); padding: 6px; display: flex; flex-direction: column; }
.mc-options button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: start; cursor: pointer; }
.mc-options button:hover { background: var(--bg); }
.mc-options button.danger { color: var(--red); }
.mc-search { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); }
.mc-search-in { flex: 1; border: 0; outline: 0; font: inherit; font-size: 14px; background: transparent; }
.mc-low { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 8px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13.5px; }
.mc-low span { flex: 1; }
.mc-link { border: 0; background: none; color: var(--teal); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.mc-stream { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 0 10px; scroll-behavior: auto; }
.mc-col { max-width: 780px; margin: 0 auto; padding: 0 18px; display: flex; flex-direction: column; gap: 14px; }
.mc-older { align-self: center; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 14px; font: inherit; font-size: 12.5px; color: var(--navy); cursor: pointer; }
.mc-day { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 2px 12px; border-radius: 99px; }
.mc-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.mc-divider::before, .mc-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.mc-divider b { color: var(--teal); font-weight: 600; }
.mc-u { align-self: flex-start; max-width: 82%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mc-u-txt { background: var(--navy); color: #fff; padding: 9px 14px; border-radius: 16px 16px 16px 4px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-u.failed .mc-u-txt { opacity: .7; }
.mc-retry { border: 0; background: none; color: var(--red); font: inherit; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.mc-sending { color: var(--muted); font-size: 12px; }
.mc-a { display: flex; gap: 10px; align-items: flex-start; }
.mc-a-in { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mc-a-in .ai-answer { font-size: 15px; color: var(--ink); }
.mc-a-in .ai-answer p { margin: 0 0 6px; }
.mc-meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; align-items: center; }
.mc-meta .mc-link { color: var(--muted); font-weight: 600; font-size: 12px; }
.mc-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 4px 0; }
.mc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); animation: mc-pulse 1.2s ease-in-out infinite; flex: none; }
@keyframes mc-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mc-dot { animation: none; } }
.mc-txt { margin: 0; font-size: 14.5px; color: var(--ink); white-space: pre-wrap; }
.mc-sub { margin: 0; color: var(--muted); font-size: 12.5px; }
.mc-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.mc-card.ok { border-color: var(--teal); }
.mc-card.ok .mc-ic { background: var(--teal); color: #fff; }
.mc-card.err { border-color: #E9C3BC; }
.mc-card.err .mc-ic { background: var(--red-soft); color: var(--red); }
.mc-card.blocked { background: var(--bg); }
.mc-card-h { display: flex; align-items: flex-start; gap: 10px; }
.mc-card-h > div { flex: 1; min-width: 0; }
.mc-card-h h4 { margin: 0; color: var(--navy); font-size: 15px; }
.mc-card-h small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.mc-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.mc-tag { flex: none; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); font-weight: 600; white-space: nowrap; }
.mc-tag.warn { background: var(--amber-soft); color: var(--amber-ink); }
.mc-tag.gray { background: var(--bg); color: var(--muted); }
.mc-pick-one { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mc-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.mc-kv > div { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.mc-kv > div.warn { border-color: var(--amber); background: var(--amber-soft); }
.mc-kv small { display: block; color: var(--muted); font-size: 12px; }
.mc-kv b { color: var(--navy); font-size: 17px; }
.mc-insights { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-ins { padding: 3px 10px; border-radius: 99px; font-size: 12.5px; background: var(--bg); color: var(--ink); }
.mc-ins.warn { background: var(--amber-soft); color: var(--amber-ink); }
.mc-ins.good { background: var(--teal-soft); color: var(--teal); }
.mc-bars { display: grid; gap: 6px; }
.mc-bar-row { display: grid; grid-template-columns: minmax(70px, 130px) 1fr 52px; gap: 8px; align-items: center; font-size: 13.5px; }
.mc-track { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.mc-track i { display: block; height: 100%; background: var(--teal); border-radius: 8px; }
.mc-track i.low { background: var(--red); }
.mc-list { list-style: none; margin: 0; padding: 0; }
.mc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mc-list li b { white-space: nowrap; }
.mc-acts-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mc-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 12px; background: var(--teal); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 40px; }
.mc-primary.navy { background: var(--navy); }
.mc-primary:disabled { opacity: .7; cursor: default; }
.mc-warn { display: flex; gap: 6px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.mc-warn svg { flex: none; margin-top: 2px; }
.mc-lines { margin: 0; padding-inline-start: 20px; font-size: 14px; line-height: 1.8; }
details.mc-lines { padding: 0; } details.mc-lines summary { cursor: pointer; color: var(--teal); font-weight: 600; } details.mc-lines ul { margin: 6px 0 0; padding-inline-start: 20px; }
.mc-res { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.mc-res small { color: var(--muted); }
.mc-plan { display: flex; flex-direction: column; gap: 8px; }
.mc-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-pick button { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; text-align: start; }
.mc-pick small { color: var(--muted); font-size: 12px; }
.mc-h5 { margin: 4px 0 0; color: var(--navy); font-size: 14px; }
.mc-tips ul { margin: 4px 0 0; padding-inline-start: 20px; }
.mc-none { text-align: center; color: var(--muted); }
.mc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 0; }
.mc-empty h3 { margin: 6px 0 0; color: var(--navy); font-size: 21px; }
.mc-empty p { margin: 0; color: var(--muted); max-width: 460px; }
.mc-sugg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 640px; margin-top: 12px; }
.mc-sugg button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: start; cursor: pointer; }
.mc-sugg button:hover { border-color: var(--teal); }
.mc-sugg b { display: block; color: var(--navy); font-size: 14px; }
.mc-sugg small { color: var(--amber-ink); font-size: 11.5px; }
.mc-sugg-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.mc-comp { position: relative; flex: none; padding: 8px 16px 10px; background: linear-gradient(transparent, var(--bg) 35%); }
.mc-cbox { max-width: 780px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: 22px; padding: 6px;
  box-shadow: 0 6px 20px rgba(22, 36, 74, .06); }
.mc-cbox:focus-within { border-color: var(--teal); }
.mc-input { flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15.5px; line-height: 1.6; padding: 8px 4px; color: var(--ink); }
.mc-send { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; cursor: pointer; flex: none; }
.mc-send:disabled { background: var(--line-2); cursor: default; }
/* Long answers (links, long numbers) wrap inside the bubble instead of widening the page; tables scroll in place. */
.mc-a-in { overflow-wrap: anywhere; }
.mc-a-in table { display: block; max-width: 100%; overflow-x: auto; }
/* No connection: one line above the box; the text stays. */
.mc-offline { max-width: 780px; margin: 0 auto 6px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px;
  background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.mc-offline[hidden] { display: none; }
/* «أحدث الرسائل»: shown only when reading far above the end. */
.mc-latest { position: absolute; inset-inline-start: 50%; transform: translateX(50%); bottom: 92px; z-index: 5; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: 13px;
  font-weight: 600; box-shadow: 0 6px 18px rgba(22, 36, 74, .14); cursor: pointer; }
.mc-latest[hidden] { display: none; }
/* Measures the top safe area (clock) in pixels for the chat's placement. */
.mc-safe-probe { position: fixed; top: 0; width: 0; height: var(--sat); visibility: hidden; pointer-events: none; }
@media (pointer: coarse) {
  /* Touch targets of at least 44px for sending, the shortcuts and the header icons. */
  .mc-send, .mc-icon.plus { width: 44px; height: 44px; }
  .mc-icon:not(.sm) { width: 44px; height: 44px; }
  .mc-card .mc-btn, .mc-pick button { min-width: 44px; min-height: 44px; }
}
.mc-hint { max-width: 780px; margin: 6px auto 0; text-align: center; color: var(--muted); font-size: 11.5px; }
.mc-off { max-width: 780px; margin: 0 auto; display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber-ink); }
.mc-plus { position: absolute; bottom: calc(100% - 4px); inset-inline-start: max(16px, calc(50% - 390px)); z-index: 6; width: min(330px, calc(100% - 32px)); max-height: min(460px, 60dvh);
  overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 22px 60px rgba(22, 36, 74, .22); padding: 10px; }
.mc-pl-search { width: 100%; box-sizing: border-box; border: 0; border-radius: 14px; background: var(--bg); padding: 9px 12px; font: inherit; font-size: 14px; margin-bottom: 4px; outline: 0; }
.mc-pl-items { display: flex; flex-direction: column; gap: 2px; }
.mc-pl-group { color: var(--muted); font-size: 12px; font-weight: 700; padding: 8px 10px 2px; }
.mc-pl-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 0; border-radius: 14px; background: none; font: inherit; text-align: start; cursor: pointer; }
.mc-pl-item:hover, .mc-pl-item:focus-visible { background: var(--bg); outline: none; }
.mc-pl-item b { font-size: 15px; font-weight: 600; color: var(--ink); }
.mc-pl-item em { font-style: normal; margin-inline-start: auto; font-size: 11px; color: var(--amber-ink); background: var(--amber-soft); padding: 1px 8px; border-radius: 99px; }
.mc-pl-item em.free { color: var(--teal); background: var(--teal-soft); }
.mc-pl-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; color: var(--navy); flex: none; }
dialog.mc-dialog { border: 0; border-radius: 20px; padding: 0; width: min(440px, calc(100% - 32px)); }
dialog.mc-dialog::backdrop, dialog.mc-sheet::backdrop { background: rgba(14, 23, 48, .38); }
.mc-dlg-in { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.mc-dlg-in h3 { margin: 0; color: var(--navy); }
dialog.mc-sheet { border: 0; padding: 0; width: min(1100px, calc(100% - 24px)); max-width: none; height: min(92dvh, 900px); border-radius: 22px; }
.mc-sheet-in { display: flex; flex-direction: column; height: 100%; }
.mc-sheet-h { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mc-sheet-h b { color: var(--navy); font-size: 17px; }
.mc-sheet-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }
@media (max-width: 1079px) {
  .mchat { height: calc(100dvh - 58px - 80px - var(--sab)); min-height: 420px; border-radius: 0; border-inline: 0; margin: -12px -12px 0; }
  .mc-head { padding: 8px 12px; gap: 8px; }
  .mc-pill.plan, .mc-acts .mc-btn, .mc-sp { display: none; }
  .mc-who { flex: 1; }
  .mc-who b { font-size: 14px; }
  .mc-who b, .mc-who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mc-acts { flex: none; }
  .mc-col { padding: 0 12px; }
  .mc-comp { padding: 6px 10px 8px; }
  .mc-hint { display: none; }
  .mc-sugg { grid-template-columns: 1fr; }
  .mc-u { max-width: 88%; }
  dialog.mc-sheet { width: calc(100% - 16px - var(--sal) - var(--sar)); height: calc(100dvh - 16px - var(--sat) - var(--sab)); max-height: calc(100dvh - 16px - var(--sat) - var(--sab)); border-radius: 22px; margin: calc(8px + var(--sat)) auto auto; padding: 0; box-sizing: border-box; }
  /* Fixed to the screen between the header and the bottom bar; the page behind does not scroll. */
  html.mc-full, html.mc-full body { overflow: hidden; overscroll-behavior: none; }
  /* The optional notification invitation must not cover chat input or its touch targets. */
  html.mc-full .push-float { display: none; }
  /* While typing, the bottom bar steps aside so the box and the last message have the room (it comes back on leaving the box). */
  html.mc-full.mc-typing .bnav { display: none; }
  html.mc-full .mchat { position: fixed; top: var(--mc-top, 0px); bottom: auto; inset-inline: 0; height: var(--mc-height, 100dvh); min-height: 0; margin: 0;
    z-index: 10; border: 0; border-radius: 0; }
}

/* MIDAR AI workspace: the institution and the result stay readable at every size. */
.mchat { background: #F5F7FC; border-color: #DEE5EF; border-radius: 22px; overflow: hidden; }
.mc-head { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 20px 14px;
  background: linear-gradient(115deg, #FAFBFF, #EFF5F8); border: 0; color: var(--navy); border-bottom: 1px solid #DFE7F0; }
.mc-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mc-head .mc-av { border: 1px solid #E1E8F1; box-shadow: 0 3px 12px #16244A08; }
.mc-head .mc-who { min-width: 0; }
.mc-head .mc-who b { color: var(--navy); font-size: 16px; }
.mc-head .mc-who small { color: #65798E; font-size: 12px; }
.mc-head .mc-bar { color: #8FCBC8; }
.mc-head .mc-icon, .mc-head .mc-btn, .mc-head .mc-pill { background: #fff; color: var(--navy); border-color: #DFE7F0; }
.mc-head .mc-icon:hover, .mc-head .mc-btn:hover, .mc-head .mc-pill:hover { background: #EDF6F4; }
.mc-head .mc-pill.pts { color: var(--teal); gap: 5px; }
.mc-head .mc-pill.low { background: #FFF0D5; color: #72501C; }
.mc-context { display: flex; align-items: center; gap: 10px; border: 1px solid #DFE7F0; border-radius: 15px; background: #FFFFFFC9; padding: 9px 11px; min-width: 0; }
.mc-context-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #EDF2FA; color: var(--navy); flex: none; }
.mc-context-name { flex: 1; min-width: 0; }
.mc-context-name b { display: block; font-size: 13px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-context-name small { display: block; font-size: 11px; color: #65798E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-context-status { display: flex; align-items: center; gap: 4px; color: var(--teal); font-size: 11px; flex: none; }
.mc-quick { display: flex; gap: 8px; padding: 10px 16px; flex: none; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: #FAFBFE; border-bottom: 1px solid #E7ECF3; }
.mc-quick button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; flex: none;
  min-height: 40px; padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 600; border: 1px solid #E0E7EF; border-radius: 99px; background: #fff; color: var(--navy); cursor: pointer; }
.mc-quick svg { color: var(--teal); flex: none; }
.mc-quick button:hover { border-color: var(--teal); background: #F0FAF7; }
.mc-stream { background: radial-gradient(ellipse at 0 0, #E9EFFA66, transparent 65%); scrollbar-width: thin; }
.mc-col { max-width: 860px; padding: 20px 18px; gap: 22px; }
.mc-day { background: #E9EDF4; color: #5B6C83; font-size: 11px; padding: 3px 12px; }
.mc-u-txt { background: linear-gradient(120deg, #16244A, #243C64); padding: 12px 17px; border-radius: 19px 19px 5px 19px; box-shadow: 0 3px 9px #16244A0B; }
.mc-u-meta { display: inline-flex; align-items: center; gap: 5px; color: #708299; font-size: 11px; padding-inline: 4px; }
.mc-u-meta svg { color: var(--teal); }
.mc-a { direction: ltr; }
.mc-a-in { direction: rtl; gap: 8px; }
.mc-a-in > .ai-answer { padding: 14px 16px; background: #fff; border: 1px solid #E2E8F1; border-radius: 19px 19px 19px 5px; box-shadow: 0 3px 12px #16244A04; line-height: 1.85; }
.mc-a .mc-av.sm { width: 34px; height: 34px; margin-top: 3px; }
.mc-card { border-color: #DFE6F0; border-radius: 19px; padding: 16px; gap: 12px; box-shadow: 0 4px 15px #16244A05; }
.mc-card-h { align-items: center; }
.mc-ic { width: 40px; height: 40px; border-radius: 13px; }
.mc-stat { display: flex; align-items: center; gap: 13px; padding: 17px; border-radius: 16px; background: linear-gradient(115deg, #EAF2FA, #EEF8F4); }
.mc-stat-icon { width: 54px; height: 54px; display: grid; place-items: center; background: #FFFFFFC9; color: var(--teal); border-radius: 17px; flex: none; }
.mc-stat > div { flex: 1; min-width: 0; }
.mc-stat small { display: block; font-size: 12px; color: #4A6077; }
.mc-stat b { display: block; color: var(--navy); font-size: 38px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.mc-stat-label { font-size: 10px; color: #46645E; background: #FFFFFF9E; padding: 5px 8px; border-radius: 8px; }
.mc-result-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--navy); font-size: 13px; }
.mc-result-title small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mc-name-list { list-style: none; padding: 0; margin: 0; border: 1px solid #E5EAF1; border-radius: 13px; overflow: hidden; }
.mc-name-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #EBEFF5; }
.mc-name-list li:nth-child(even) { background: #F8FAFD; }
.mc-name-list li:last-child { border-bottom: 0; }
.mc-name-index { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #EDF2F8; color: #526C88; font-size: 11px; }
.mc-person { min-width: 0; overflow-wrap: anywhere; }
.mc-person b { display: block; font-size: 13px; color: var(--navy); }
.mc-person small { display: block; font-size: 11px; color: var(--muted); }
.mc-source { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #61758B; font-size: 11px; }
.mc-source svg { color: var(--teal); }
.mc-detail-card .mc-kv > div { background: #F8FAFD; border-color: #E8EDF3; padding: 11px; }
.mc-detail-card .mc-kv > div.warn { background: #FFF8E9; border-color: #F4E7C4; }
.mc-detail-card .mc-kv b { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mc-card .mc-btn { border-radius: 11px; padding: 8px 12px; background: #F4F8FC; border-color: #DEE7F0; color: var(--navy); }
.mc-card .mc-btn:hover { background: #EAF5F2; border-color: var(--teal); }
.mc-meta { padding-inline: 5px; gap: 10px; font-size: 11px; }
.mc-meta .mc-link { font-size: 11px; }
.mc-empty { padding: 28px 4px 20px; gap: 10px; }
.mc-welcome-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 16px; font-weight: 800; }
.mc-welcome-brand .mc-av.xl { width: 58px; height: 58px; box-shadow: 0 6px 20px #16244A15; }
.mc-eyebrow { color: var(--teal); font-size: 11px; margin-top: 8px; }
.mc-empty h3 { font-size: 24px; line-height: 1.5; }
.mc-empty p { font-size: 13px; line-height: 1.9; }
.mc-sugg { gap: 10px; margin-top: 8px; }
.mc-sugg button { padding: 14px; border-radius: 16px; border-color: #E1E8F1; }
.mc-sugg b { font-size: 13px; }
.mc-sugg small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.mc-trust { display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 440px; font-size: 11px; color: #668078; line-height: 1.8; padding: 8px 4px; }
.mc-trust svg { flex: none; }
.mc-comp { padding: 10px 16px 12px; background: linear-gradient(#F5F7FC00, #F5F7FC 20%); }
.mc-cbox { border-radius: 22px; border-color: #D8E2EF; padding: 7px; box-shadow: 0 4px 18px #16244A08; }
.mc-cbox:focus-within { box-shadow: 0 0 0 3px #0B7A7510; }
.mc-send { width: 44px; height: 44px; background: linear-gradient(135deg, #136F74, #0B7A75); box-shadow: 0 3px 9px #0B7A7524; }
.mc-status { min-height: 44px; padding: 10px 14px; border: 1px solid #E0E7F0; border-radius: 16px; background: #fff; }
.mc-sheet-in, .mc-sheet-body { min-height: 0; }
.mc-sheet-h { min-height: 65px; padding: 10px 16px; gap: 12px; background: #fff; }
.mc-sheet-h b { min-width: 0; overflow-wrap: anywhere; }
.mc-sheet-h .mc-icon { flex: none; width: 44px; height: 44px; }
.mc-sheet-body { overscroll-behavior: contain; padding: 18px; }
@media (max-width: 1079px) {
  .mc-head { padding: 10px 12px; gap: 9px; }
  .mc-head-main { gap: 8px; }
  .mc-head .mc-who b { font-size: 13px; }
  .mc-head .mc-who small { font-size: 10px; }
  .mc-head .mc-av { width: 38px; height: 38px; }
  .mc-head .mc-acts { gap: 4px; }
  .mc-head .mc-icon { width: 40px; height: 40px; }
  .mc-head .mc-pill.pts { min-height: 40px; padding: 5px 8px; font-size: 11px; }
  .mc-pts-label { display: none; }
  .mc-context { padding: 7px 9px; }
  .mc-context-status { font-size: 10px; }
  .mc-quick { padding: 8px 12px; gap: 6px; }
  .mc-quick button { font-size: 11px; }
  .mc-col { padding: 16px 10px; gap: 18px; }
  .mc-a { gap: 7px; }
  .mc-a .mc-av.sm { width: 28px; height: 28px; }
  .mc-card { padding: 12px; border-radius: 17px; gap: 10px; }
  .mc-stat { padding: 12px; gap: 10px; }
  .mc-stat b { font-size: 32px; }
  .mc-stat-label { display: none; }
  .mc-stat-icon { width: 45px; height: 45px; border-radius: 13px; }
  .mc-empty { padding-top: 18px; }
  .mc-empty h3 { font-size: 20px; }
  .mc-sugg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-sugg button { flex-direction: column; align-items: flex-start; padding: 12px; gap: 8px; }
  .mc-empty p { font-size: 12px; }
  .mc-comp { padding: 7px 8px calc(6px + var(--mc-safe-bottom, 0px)); }
  html.mc-typing .mc-context, html.mc-typing .mc-quick { display: none; }
  html.mc-typing .mc-comp { padding-bottom: 6px; }
  .mc-sheet-body { padding: 12px; }
}
@media (max-width: 359px) { .mc-context-status { display: none; } .mc-head .mc-who b { font-size: 12px; } }
@media (pointer: coarse) {
  .mc-quick button, .mc-head .mc-icon, .mc-head .mc-pill.pts { min-width: 44px; min-height: 44px; }
}

/* AI subscriptions: balance first, a clear choice, then optional details. */
.aip { display: grid; gap: 18px; min-width: 0; color: var(--ink); }
.aip > .panel { margin: 0; padding: 20px; border-color: #E1E8F1; border-radius: 19px; box-shadow: 0 3px 15px #16244A04; min-width: 0; }
.aip-intro { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px 6px; }
.aip-intro img { flex: none; border-radius: 15px; box-shadow: 0 4px 12px #16244A10; }
.aip-intro > div { flex: 1; min-width: 180px; }
.aip-intro small { color: var(--teal); font-size: 11px; font-weight: 700; }
.aip-intro h2 { margin: 2px 0 3px; font-size: 23px; line-height: 1.5; }
.aip-intro p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.aip .panel-head h2 { font-size: 17px; }
.aip-balance-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-radius: 16px; padding: 20px 24px;
  background: linear-gradient(115deg, #EAF2FA, #EBF7F3); color: var(--navy); margin-bottom: 14px; }
.aip-balance-hero > div { min-width: 0; }
.aip-balance-hero small { display: block; color: #5A7186; font-size: 12px; }
.aip-balance-hero b { display: inline-block; font-size: 43px; font-variant-numeric: tabular-nums; line-height: 1.4; overflow-wrap: anywhere; }
.aip-balance-hero span { margin-inline-start: 8px; color: var(--teal); font-size: 12px; }
.aip-balance-hero .aip-balance-period { display: grid; gap: 5px; text-align: end; }
.aip-balance-period svg { color: var(--teal); margin-inline-start: auto; }
.aip-balance-hero .aip-balance-period b { font-size: 14px; }
.aip .aip-now { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.aip .aip-now > div { padding: 12px; border-color: #E6ECF3; background: #F8FAFD; min-width: 0; }
.aip .aip-now small { font-size: 11px; line-height: 1.7; }
.aip .aip-now b { font-size: 23px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aip .aip-renew { display: flex; align-items: center; gap: 9px; padding: 10px 0 0; margin-bottom: 0; color: #50667E; font-size: 12px; }
.aip .aip-renew input { flex: none; }
.aip-pending { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1px solid #F0DDB2; border-radius: 12px; background: #FFF9EB; margin-top: 12px; }
.aip-pending > svg { color: #9C6D25; flex: none; }
.aip-pending > div { flex: 1; min-width: 130px; }
.aip-pending b { font-size: 13px; color: #775320; }
.aip-pending p { margin: 3px 0 0; font-size: 12px; color: #775320; }
.aip .aip-cycle { padding: 4px; background: #EDF2F7; border: 1px solid #E0E7F0; border-radius: 13px; gap: 3px; }
.aip .aip-cycle-choice { border: 1px solid transparent; background: transparent; min-height: 40px; padding-inline: 20px; border-radius: 9px; color: #50667E; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.aip .aip-cycle-choice.on { background: #fff; color: var(--navy); border-color: #E0E7F0; box-shadow: 0 2px 4px #16244A07; }
.aip .aip-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 18px; }
.aip .aip-card { padding: 20px; border-radius: 17px; gap: 14px; min-width: 0; }
.aip .aip-card.current { border: 2px solid var(--teal); box-shadow: 0 3px 12px #0B7A750A; }
.aip .aip-card.top { background: linear-gradient(160deg, #F2F5FB, #fff 55%); border-color: #CCD8E9; }
.aip .aip-card.top.current { border-color: var(--teal); }
.aip .aip-tag { position: static; align-self: flex-start; padding: 3px 9px; font-size: 10px; border-radius: 8px; }
.aip-plan-heading { display: flex; align-items: center; gap: 10px; }
.aip-plan-icon { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border-radius: 13px; background: #EDF5F3; color: var(--teal); }
.aip .aip-card.top .aip-plan-icon { background: #E5ECF7; color: var(--navy); }
.aip .aip-card h3 { font-size: 19px; }
.aip .aip-card p { line-height: 1.8; margin: 0; font-size: 12px; }
.aip .aip-price { min-height: 62px; gap: 5px; }
.aip .aip-price b { font-size: 29px; line-height: 1.5; overflow-wrap: anywhere; }
.aip .aip-price small { font-size: 11px; color: var(--muted); }
.aip .aip-price s { font-size: 12px; width: 100%; }
.aip .aip-price .aip-benefit { color: var(--teal); }
.aip .aip-facts { list-style: none; padding: 0; gap: 9px; font-size: 12px; }
.aip .aip-facts li { position: relative; padding-inline-start: 16px; line-height: 1.8; }
.aip .aip-facts li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal); font-size: 11px; }
.aip .aip-tasks { border-top: 1px solid #E8EDF4; padding-top: 12px; }
.aip .aip-tasks summary { cursor: pointer; color: #526980; font-size: 12px; font-weight: 600; min-height: 32px; }
.aip .aip-tasks > div { padding: 7px 0; }
.aip .aip-tasks ul { font-size: 12px; line-height: 1.8; margin-top: 5px; }
.aip .aip-act .btn { min-height: 44px; border-radius: 12px; font-size: 13px; }
.aip .aip-compare { padding: 12px; border: 1px solid #E2E9F2; border-radius: 12px; background: #FAFBFD; }
.aip .aip-compare summary { font-size: 13px; }
.aip .aip-packs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.aip .aip-packs article { background: #FAFCFE; border-color: #E1E8F1; min-width: 0; padding: 15px; }
.aip .aip-packs span { color: #50667E; font-size: 14px; }
.aip-fold { border: 1px solid #E1E8F1; border-radius: 16px; background: #fff; min-width: 0; overflow: hidden; }
.aip-fold > summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; gap: 10px; cursor: pointer; color: var(--navy); font-size: 14px; font-weight: 700; }
.aip-fold > summary small { color: var(--muted); font-size: 11px; font-weight: 400; }
.aip-fold > .panel { border: 0; border-top: 1px solid #E8EDF4; box-shadow: none; border-radius: 0; margin: 0; padding: 16px; }
.aip-trust { display: flex; justify-content: center; align-items: flex-start; gap: 7px; font-size: 11px; color: #61786F; line-height: 1.9; margin: 0; text-align: center; }
.aip-trust svg { flex: none; margin-top: 3px; }
.aip-quote { min-width: 0; width: min(420px, 100%); }
.aip-quote .aip-qrow { align-items: flex-start; font-size: 13px; }
.aip-quote .aip-qrow b { text-align: end; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 719px) {
  .aip { gap: 13px; }
  .aip > .panel { padding: 14px; border-radius: 16px; }
  .aip-intro > div { min-width: 150px; }
  .aip-intro h2 { font-size: 19px; }
  .aip-intro > .btn { margin-inline-start: 60px; }
  .aip-balance-hero { padding: 17px 14px; gap: 8px; }
  .aip-balance-hero b { font-size: 35px; }
  .aip-balance-hero .aip-balance-period b { font-size: 12px; }
  .aip .aip-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aip .aip-now > div { padding: 10px; }
  .aip .aip-now b { font-size: 21px; }
  .aip .aip-card { padding: 17px; }
  .aip .aip-cycle-choice { min-height: 44px; padding-inline: 24px; }
  .aip-fold > summary { padding: 14px; }
  .aip .btn { min-height: 44px; }
}
@media (max-width: 719px) {
  .profile-page .student-file.app > .sf-head .sf-id { padding-inline-end: 0; }
  .profile-page .student-file.app > .sf-head .sf-id h1 { white-space: normal; overflow-wrap: anywhere; font-size: 17px; }
  .profile-page .sf-iconbtn { min-width: 44px; width: 44px; min-height: 44px; height: 44px; flex: none; }
  .profile-page .kid-switch a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* One light application header for every role and institution. */
.topbar { background: linear-gradient(115deg, #FCFDFF, #F4F7FC); border-color: #E2E8F1; }
.topbar .in { gap: 14px; min-height: 74px; }
.topbar .who { flex: 1; min-width: 0; gap: 12px; align-items: center; }
.topbar .brand-logo { width: 78px; height: 42px; object-fit: contain; }
.topbar .school { flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 0; padding: 4px 6px; box-shadow: none; text-align: center; justify-content: center; }
.topbar .school b { font-size: 14px; line-height: 1.5; }
.topbar .school-text { flex: 1; min-width: 0; }
.topbar .school small { font-size: 11px; color: #6B8195; }
.topbar .top-acts { flex: none; display: flex; align-items: center; gap: 8px; }
.topbar .bell-btn, .topbar .nav-menu-btn, .hd-exit { flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border: 1px solid #E1E7F0; border-radius: 50%; background: #fff; color: var(--navy); place-items: center; box-shadow: 0 2px 8px #16244A04; cursor: pointer; }
.topbar .bell-btn, .hd-exit { display: grid; }
@media (max-width: 1079px) { .topbar .nav-menu-btn { display: grid; } }
.topbar .nav-menu-btn { border-radius: 14px; }
.hd-account { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; font: inherit; text-align: start; color: var(--navy); padding: 0; min-width: 44px; min-height: 44px; cursor: pointer; }
.hd-avatar { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; overflow: hidden; background: #EDF3F8; color: var(--teal); border: 2px solid #fff; outline: 1px solid #DFE7F0; font-size: 18px; font-weight: 700; }
.hd-avatar img, .pa-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.hd-person-label { display: grid; gap: 2px; max-width: 155px; }
.hd-person-label b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-person-label small { font-size: 10px; color: var(--muted); }
.personal-account { display: flex; flex-direction: column; gap: 18px; }
.pa-hero { display: flex; align-items: center; gap: 16px; border: 1px solid #E1E9F2; border-radius: 19px; padding: 20px; background: linear-gradient(120deg, #F8FAFE, #EDF6F4); }
.pa-avatar { position: relative; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; flex: none; overflow: hidden; background: #fff; color: var(--teal); border: 3px solid #fff; box-shadow: 0 2px 12px #16244A0A; font-size: 30px; font-weight: 700; }
.pa-hero > div { min-width: 0; }
.pa-hero h2 { margin: 0 0 4px; font-size: 21px; overflow-wrap: anywhere; }
.pa-hero p { margin: 0 0 8px; font-size: 13px; color: #587287; }
.pa-school { display: block; color: var(--teal); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.pa-photo-editor { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pa-section { border: 1px solid #E2E9F2; border-radius: 17px; background: #fff; padding: 18px; }
.pa-section h3 { margin: 0 0 14px; font-size: 16px; color: var(--navy); }
.personal-account .pa-details { margin: 0; display: grid; gap: 0; }
.personal-account .pa-detail-row { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); align-items: baseline; gap: 14px; padding: 13px 0; border-bottom: 1px solid #EDF1F6; font-size: 13px; }
.personal-account .pa-detail-row:last-child { border-bottom: 0; }
.personal-account .pa-detail-row dt { color: var(--muted); font-size: 12px; font-weight: 400; }
.personal-account .pa-detail-row dd { margin: 0; text-align: start; color: var(--navy); overflow-wrap: anywhere; min-width: 0; font-weight: 600; unicode-bidi: plaintext; }
.personal-account .pa-section .f { display: grid; gap: 7px; margin-bottom: 14px; }
.personal-account .pa-section .f > span { font-size: 12px; color: #596F83; }
.personal-account .pa-section input { min-height: 46px; border-radius: 12px; width: 100%; }
.personal-account .pa-photo-status { font-size: 12px; text-align: center; color: var(--muted); }
.personal-account .btn { min-height: 44px; }
@media (max-width: 719px) {
  .topbar .in { padding: 8px 10px; gap: 7px; min-height: 66px; }
  .topbar .who { gap: 6px; }
  .topbar .brand-logo { width: 44px; height: 32px; flex: none; }
  .topbar .school { padding: 3px 2px; }
  .topbar .school b { font-size: 13px; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .topbar .school small { font-size: 10px; }
  .topbar .school .school-logo { width: 30px; height: 30px; }
  .topbar .top-acts { gap: 6px; }
  .topbar .top-acts > .install-ic, .hd-person-label { display: none; }
  .topbar.has-sync .who > .brand-logo { display: none; }
  .topbar .sync-pill { position: relative; flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 14px;
    background-image: url('/brand/mark.svg'); background-position: center; background-size: 30px; background-repeat: no-repeat; }
  .topbar .sync-pill .full, .topbar .sync-pill .short { display: none; }
  .topbar .sync-pill::before { position: absolute; bottom: 3px; inset-inline-end: 3px; border: 2px solid #fff; width: 9px; height: 9px; }
  .topbar .sync-count:not([hidden]) { display: block; position: absolute; top: -3px; inset-inline-end: -4px; min-width: 17px; padding-inline: 3px; border-radius: 9px; font-size: 10px; line-height: 17px; color: #fff; background: var(--navy); }
  .pa-hero { padding: 15px; gap: 12px; }
  .pa-avatar { width: 64px; height: 64px; }
  .pa-hero h2 { font-size: 18px; }
  .pa-section { padding: 14px; }
  .personal-account .pa-detail-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 0; }
}
.sync-count { display: none; }
.cal-closed { margin-block-end: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.cal-closed > summary { display: flex; align-items: center; gap: 8px; padding: 12px; cursor: pointer; font-size: 13px; }
.cal-closed > summary b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cal-closed > summary small { color: var(--teal); white-space: nowrap; }
.cal-closed-details { padding: 0 12px 12px; font-size: 12px; }
.cal-closed-details .cal-pill { margin-block: 8px 0; }
@media (max-width: 359px) { .topbar .brand-logo { width: 34px; } .topbar .who { gap: 4px; } .topbar .school .school-logo { display: none; } .topbar .school small { display: none; } }

/* A compact conversation with one composer; overlays stay in its visible bounds. */
.notifications-sheet .inbox-dialog { min-width: 0; width: 100%; box-sizing: border-box; display: block; }
.notifications-sheet .nc-nav { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #FAFBFD; border-bottom: 1px solid var(--line); }
.notifications-sheet .nc-nav .btn { min-height: 44px; font-size: 12px; }
.notifications-sheet .ncenter { min-width: 0; }
.notifications-sheet .ncenter-head { align-items: stretch; gap: 10px; flex-wrap: wrap; }
.notifications-sheet .ncenter-head input { flex: 1 1 210px; min-width: 0; min-height: 44px; width: 100%; }
.notifications-sheet .ncenter-head .btn { min-height: 44px; font-size: 12px; }
.notifications-sheet .nchips { margin-block: 12px; gap: 7px; padding-bottom: 3px; }
.notifications-sheet .nchips button { min-height: 40px; }
.notifications-sheet .inbox-list { max-height: none; overflow: visible; gap: 10px; }
.notifications-sheet .inbox-item { border: 1px solid #E2E8F0; border-radius: 15px; padding: 13px; background: #fff; }
.notifications-sheet .inbox-item .tx { flex: 1; gap: 5px; }
.notifications-sheet .inbox-item .tx b { font-size: 13px; line-height: 1.7; }
.notifications-sheet .inbox-item .tx small { font-size: 12px; line-height: 1.7; }
.notifications-sheet .inbox-archive { min-width: 44px; min-height: 44px; }
.mc-head { padding: 9px 14px 8px; gap: 6px; flex: none; }
.mc-head-main { gap: 8px; }
.mc-head .mc-av { width: 32px; height: 32px; border-radius: 11px; }
.mc-head .mc-who b { font-size: 14px; }
.mc-plan-button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 9px; border: 1px solid #DDE7EE; border-radius: 12px; background: #fff; color: var(--navy); font: inherit; font-size: 11px; white-space: nowrap; cursor: pointer; }
.mc-plan-button b { font-weight: 700; }
.mc-usage-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; padding: 0 2px; }
.mc-usage-item { min-width: 0; display: grid; gap: 4px; }
.mc-usage-item > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 10px; color: #63778C; }
.mc-usage-item b { color: var(--navy); font-size: 10px; font-variant-numeric: tabular-nums; }
.mc-usage-item progress { display: block; appearance: none; width: 100%; height: 3px; border: 0; border-radius: 3px; overflow: hidden; background: #DFE8ED; }
.mc-usage-item progress::-webkit-progress-bar { background: #DFE8ED; border-radius: 3px; }
.mc-usage-item progress::-webkit-progress-value { background: var(--teal); border-radius: 3px; }
.mc-usage-item progress::-moz-progress-bar { background: var(--teal); border-radius: 3px; }
.mc-comp { isolation: isolate; }
.mc-cbox { align-items: flex-end; border-radius: 24px; padding: 5px; gap: 5px; }
.mc-input { min-width: 0; min-height: 44px; max-height: 152px; line-height: 1.5; padding: 10px 4px; font-size: 16px; overflow-y: auto; scrollbar-width: thin; unicode-bidi: plaintext; }
.mc-cbox .mc-icon, .mc-cbox .mc-send { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: none; }
.mc-voice.listening { color: #A83131; background: #FFF0ED; }
.mc-plus { bottom: calc(100% + 2px); max-height: min(390px,calc(var(--mc-height,100dvh) - var(--mc-composer-height,70px) - 100px)); width: min(360px,calc(100% - 20px)); inset-inline-start: 10px; border-radius: 18px; box-shadow: 0 8px 32px #16244A16; overflow-y: auto; overscroll-behavior: contain; }
.mc-plus-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -3px -3px 6px; }
.mc-plus-head .mc-icon { width: 44px; height: 44px; flex: none; }
.mc-plus button:not(.mc-icon) { min-height: 44px; }
@media (max-width:1079px) {
  .mc-head { padding: 7px 10px; gap: 5px; }
  .mc-head .mc-av { width: 30px; height: 30px; }
  .mc-head .mc-who b { font-size: 13px; }
  .mc-head .mc-icon { min-width: 44px; min-height: 44px; }
  .mc-plan-button { max-width: 118px; overflow: hidden; text-overflow: ellipsis; min-height: 40px; }
  .mc-stream { min-height: 0; overscroll-behavior-y: contain; }
  .mc-comp { padding-inline: 8px; }
  .mc-cbox { box-shadow: 0 2px 12px #16244A07; }
  .mc-col { padding-top: 12px; padding-bottom: 10px; }
}

/* Academic calendar strip under the greeting (calendar-pill.js): one line, no motion. */
.cal-pill { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--navy); font-size: 14px; line-height: 1.5; }
.cal-pill[hidden] { display: none; }
.cal-pill-ic { display: inline-flex; color: var(--teal); }
.cal-pill-t { color: var(--muted); font-variant-numeric: tabular-nums; }
.att-tasks .act-row.done { opacity: .75; }

/* The accountant's fees reminder drafts in the administration's conversation (midar-chat.js). */
.mc-draft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.mc-draft:first-of-type { border-top: 0; }
.mc-draft .mc-sub { display: block; margin-top: 2px; }
.mc-draft-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-draft-acts .mc-btn { min-height: 44px; }
.mc-btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); }

/* MIDAR AI: today's line on the start screen and suggested next questions under the latest answer. */
.mc-empty .mc-today { color: var(--navy); font-weight: 600; }
.mc-next { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; padding-inline: 4px; }
.mc-next-btn { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  color: var(--navy); font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
.mc-next-btn:hover, .mc-next-btn:focus-visible { border-color: var(--teal); color: var(--teal); }

/* MIDAR AI answers (identity: navy, teal, amber): tables, lists, voice and the composer. */
.mc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-card-top h4 { margin: 0; color: var(--navy); font-size: 16px; }
.mc-count { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12.5px; font-weight: 700; }
.mc-tbl-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #E3E9F1; border-radius: 14px; -webkit-overflow-scrolling: touch; }
.mc-tbl-wrap table.ai-tbl, .ai-answer table.ai-tbl { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ai-tbl th { background: #F4F7FB; color: var(--navy); font-weight: 700; font-size: 13px; white-space: nowrap; padding: 10px 12px; border-bottom: 1px solid #E3E9F1; }
.ai-tbl td { padding: 10px 12px; border-bottom: 1px solid #EEF2F7; color: var(--ink); vertical-align: middle; }
.ai-tbl tbody tr:nth-child(even) td { background: #FAFCFE; }
.ai-tbl tbody tr:last-child td { border-bottom: 0; }
.ai-tbl .n { width: 1%; color: var(--muted); font-size: 12.5px; text-align: center; white-space: nowrap; }
.ai-tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.mc-tel { color: var(--teal); font-weight: 600; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-answer ol { list-style: none; counter-reset: mc-ol; padding-inline-start: 0; }
.ai-answer ol > li { counter-increment: mc-ol; position: relative; padding-inline-start: 32px; margin: 0 0 6px; }
.ai-answer ol > li::before { content: counter(mc-ol); position: absolute; inset-inline-start: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ai-answer ul > li::marker { color: var(--teal); }
.ai-answer b { color: var(--navy); }
.mc-voice.listening { color: #fff; background: var(--teal); box-shadow: 0 0 0 0 #0B7A7555; animation: mc-listen 1.4s ease-out infinite; }
@keyframes mc-listen { to { box-shadow: 0 0 0 10px #0B7A7500; } }
@media (prefers-reduced-motion: reduce) { .mc-voice.listening { animation: none; } }
.mc-link.speaking { color: var(--teal); font-weight: 700; }
.mc-cbox { background: #fff; border: 1.5px solid #DCE4EE; }
.mc-cbox:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px #0B7A7514; }
.mc-input::placeholder { color: #8A94A6; }
.mc-tbl-wrap .ai-tbl th, .mc-tbl-wrap .ai-tbl td { padding: 9px 7px; font-size: 13.5px; }
.mc-tbl-wrap .ai-tbl th { white-space: normal; line-height: 1.35; }
.mc-tbl-wrap .ai-tbl td:nth-child(2) { min-width: 7em; }
.mc-tel { font-size: 13px; letter-spacing: -.2px; }
/* A question back or a gentle redirect is not an error: calm teal and navy, no red. */
.mc-card.ask { border-color: #CFE5E3; background: #FBFEFE; }
.mc-card.ask .mc-ic { background: var(--teal-soft); color: var(--teal); }
.mc-card.soft { border-color: #DCE4EE; }
.mc-card.soft .mc-ic { background: var(--navy-soft); color: var(--navy); }

/* ---------- MIDAR AI identity: the mark in its orbit, the plan's character, features by plan ---------- */
.mc-orb { position: relative; display: inline-grid; place-items: center; flex: none; }
.mc-orb .mc-av { position: relative; z-index: 1; }
.mc-orb-ring { position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid #0B7A7533; pointer-events: none; }
.mc-orb.xl .mc-orb-ring { inset: -12px; border-width: 2px; }
.mc-orb-dot { position: absolute; top: -4px; inset-inline-start: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 2px #fff, 0 0 10px #F0A53A99; }
.mc-orb.xl .mc-orb-dot { width: 12px; height: 12px; top: -6px; inset-inline-start: calc(50% - 6px); }
.mc-orb.xl .mc-orb-ring { animation: mc-orbit 14s linear infinite; }
.mchat.thinking .mc-head .mc-orb-ring { animation: mc-orbit 1.6s linear infinite; border-color: #0B7A7566; }
.mc-empty .mc-orb.xl { margin: 10px 0 2px; }
.mc-empty .mc-orb.xl::before { content: ""; position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, #0B7A7522 0%, #16244A0A 45%, transparent 70%); }
@keyframes mc-orbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mc-orb-ring, .mchat.thinking .mc-head .mc-orb-ring { animation: none !important; } }
.mc-who small { display: block; color: var(--teal); font-weight: 600; font-size: 12px; }

.mc-feats { width: 100%; max-width: 560px; margin-top: 6px; padding: 12px; border: 1px solid #E1E8F1; border-radius: 16px;
  background: linear-gradient(180deg, #F7FBFB, #fff); text-align: start; }
.mc-feats > small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.mc-feat-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-feat { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--teal-soft);
  color: var(--teal); font-size: 12.5px; font-weight: 600; }
.mc-feat-next { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px 11px; border: 1px dashed #F0A53A99;
  border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font: inherit; font-size: 12.5px; text-align: start; cursor: pointer; min-height: 44px; }
.mc-feat-next b { color: var(--navy); }
.mc-pl-item em.locked { background: var(--navy); color: #fff; }
.mc-pl-item:has(em.locked) .mc-pl-ic { color: var(--amber-ink); background: var(--amber-soft); }

.mc-lock-dlg .mc-dlg-in, .mc-unlock .mc-dlg-in { text-align: center; }
.mc-lock-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.mc-lock-badge.t1 { background: linear-gradient(135deg, var(--teal), #12A39B); color: #fff; }
.mc-lock-badge.t2 { background: linear-gradient(135deg, var(--navy), #2B3F72); color: #fff; box-shadow: inset 0 0 0 1.5px #F0A53A; }
.mc-lock-tier { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--navy-soft); text-align: start; }
.mc-lock-tier p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mc-unlock .mc-orb.xl { margin: 16px auto 8px; }
.mc-unlock-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; text-align: start; }
.mc-unlock-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: #F7FBFB; }
.mc-unlock-list small { display: block; color: var(--muted); }

/* Plans page: each plan's character and what opens only in it. */
.aip-char { margin: 2px 0 8px; color: var(--teal); font-weight: 700; }
.aip-feats { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.aip-feats li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.aip-feats li .ic { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }
.aip-feats li small { display: block; color: var(--muted); font-size: 12px; }
.aip-feats-head { margin: 10px 0 2px; color: var(--muted); font-size: 12.5px; }
.aip-card.top .aip-feats li .ic { background: var(--amber-soft); color: var(--amber-ink); }

/* ---------- MIDAR AI subject pages (Pro): «موادك» and one page per class and subject ---------- */
.msj-strip { width: 100%; max-width: 560px; margin-top: 8px; text-align: start; }
.msj-strip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--navy); }
.msj-strip-head em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: var(--navy); color: #fff; }
.msj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.msj-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px; min-height: 44px; border: 1px solid #E1E8F1; border-radius: 14px;
  background: #fff; font: inherit; text-align: start; cursor: pointer; }
.msj-card:hover { border-color: var(--teal); }
.msj-card-txt { display: grid; gap: 1px; min-width: 0; }
.msj-card-txt b { color: var(--navy); }
.msj-card-txt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msj-card-txt .msj-reached { color: var(--teal); }
.msj-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--teal-soft); color: var(--teal); }
.msj-ic.lg { width: 44px; height: 44px; border-radius: 14px; }

.msj-dlg { width: min(640px, calc(100vw - 16px)); max-height: calc(100dvh - 24px); padding: 0; }
.msj-in { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.msj-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #E1E8F1;
  background: linear-gradient(135deg, #F2F8F8, #fff); }
.msj-head > div { flex: 1; min-width: 0; }
.msj-head h3 { margin: 0; color: var(--navy); font-size: 18px; }
.msj-head small { color: var(--muted); }
.msj-body { overflow-y: auto; padding: 14px 16px 18px; display: grid; gap: 16px; }
.msj-body h4 { margin: 0 0 8px; color: var(--navy); font-size: 14.5px; }
.msj-where { padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--navy), #24386B); color: #fff; }
.msj-where-txt { margin: 0 0 10px; font-size: 15.5px; line-height: 1.8; font-weight: 600; }
.msj-where .mc-btn.primary { background: var(--amber); color: var(--navy); border-color: var(--amber); }
.msj-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msj-form { display: grid; gap: 10px; padding: 12px; border: 1px solid #E1E8F1; border-radius: 14px; background: #FAFCFC; }
.msj-form[hidden] { display: none; }
.msj-f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.msj-f input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2, #D5DDE8); border-radius: 12px; font: inherit; font-size: 16px; color: var(--navy); }
.msj-asks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.msj-ask { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px; border: 1px solid #CFE6E4; border-radius: 14px;
  background: #fff; font: inherit; font-weight: 600; color: var(--navy); text-align: start; cursor: pointer; }
.msj-ask:hover { background: var(--teal-soft); }
.msj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.msj-stat { padding: 10px; border-radius: 14px; background: #F5F7FB; display: grid; gap: 2px; }
.msj-stat small { color: var(--muted); font-size: 12px; }
.msj-stat b { color: var(--navy); font-size: 18px; }
.msj-stat.up .msj-hint { color: var(--teal); }
.msj-stat.down .msj-hint { color: #B4541A; }
.msj-bars { display: grid; gap: 6px; }
.msj-bar { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr auto; gap: 8px; align-items: center; font-size: 13px; }
.msj-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.msj-bar i { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--teal) var(--w), #E6ECF2 var(--w)); }
.msj-log, .msj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.msj-log li, .msj-list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #F7F9FC; }
.msj-log li b, .msj-list li b { color: var(--navy); }
.msj-log li small, .msj-list li small { display: block; color: var(--muted); font-size: 12px; }
.msj-log li p { margin: 4px 0; font-size: 13px; color: var(--ink, #334); }
.msj-log li:first-child { background: var(--teal-soft); }
.msj-none, .msj-loading, .msj-err { color: var(--muted); margin: 0; }
@media (max-width: 520px) { .msj-stats { grid-template-columns: 1fr 1fr; } .msj-stat:last-child { grid-column: span 2; } }

/* Subject textbook in MIDAR AI */
.msj-book { display: grid; gap: 10px; padding: 12px; border: 1px solid #E1E8F1; border-radius: 16px; background: linear-gradient(180deg, #FBFDFD, #fff); }
.msj-book h4 { margin: 0; }
.msj-book-head { display: flex; align-items: center; gap: 10px; }
.msj-book-head > div { flex: 1; min-width: 0; }
.msj-book-head b { display: block; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msj-book-head small { color: var(--muted); }
.msj-page-pick { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.msj-page-pick label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.msj-page-n { width: 96px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-2, #D5DDE8); border-radius: 12px; font: inherit; font-size: 16px; text-align: center; }
.msj-preview { max-height: 220px; overflow: auto; margin: 0; padding: 10px 12px; border-radius: 12px; background: #F5F7FB; white-space: pre-wrap;
  font: inherit; font-size: 14px; line-height: 1.9; direction: rtl; }
.msj-preview[hidden] { display: none; }
.msj-book-status { margin: 0; color: var(--teal); font-size: 13px; font-weight: 600; }
.msj-book-status:empty { display: none; }
.mc-source { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; padding: 3px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 600; }

/* Early warning (Max) on the subject page */
.msj-attn { display: inline-flex; align-items: center; gap: 3px; align-self: flex-start; margin-inline-start: auto; padding: 2px 8px; border-radius: 999px;
  background: var(--amber); color: var(--navy); font-style: normal; font-size: 12px; font-weight: 700; }
.msj-warn { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--amber-soft); border: 1px solid #F0A53A55; }
.msj-warn.ok { background: var(--teal-soft); border-color: #0B7A7533; }
.msj-warn h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.msj-warn > small { color: var(--muted); font-size: 12px; }
.msj-warn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.msj-warn-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; border-radius: 12px; background: #fff; }
.msj-warn-list li .msj-row { grid-column: 1 / -1; }
.msj-warn-who { display: grid; gap: 2px; min-width: 0; }
.msj-warn-who b { color: var(--navy); }
.msj-warn-who small { color: var(--muted); font-size: 12.5px; }
.msj-warn-abs { color: #B4541A !important; }
.msj-fall { align-self: start; font-style: normal; font-weight: 800; color: #B4541A; direction: ltr; }
.msj-warn-teaser { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; border: 1px dashed #F0A53A99; border-radius: 14px;
  background: var(--amber-soft); color: var(--amber-ink); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.mc-source.warn { background: var(--amber-soft); color: var(--amber-ink); }

/* Voice conversation (Pro) */
.mv-dlg { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: radial-gradient(circle at 50% 35%, #1F3266 0%, var(--navy) 55%, #0C1630 100%); color: #fff; }
.mv-dlg::backdrop { background: var(--navy); }
.mv-in { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(24px + var(--sat, 0px)) 20px calc(24px + var(--sab, 0px)); text-align: center; }
.mv-eyebrow { color: #9FD8D3; font-weight: 600; letter-spacing: .2px; }
.mv-orb { position: relative; display: grid; place-items: center; width: 200px; height: 200px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.mv-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #12A39B44 0%, transparent 65%); transition: transform .4s; }
.mv-orb .mc-orb-ring { border-color: #ffffff44; }
.mv-dlg[data-state="listening"] .mv-orb::before { animation: mv-pulse 1.2s ease-in-out infinite; background: radial-gradient(circle, #12A39B88 0%, transparent 65%); }
.mv-dlg[data-state="thinking"] .mc-orb-ring { animation: mc-orbit 1.2s linear infinite; }
.mv-dlg[data-state="speaking"] .mv-orb::before { animation: mv-pulse .7s ease-in-out infinite; background: radial-gradient(circle, #F0A53A77 0%, transparent 65%); }
@keyframes mv-pulse { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .mv-orb::before, .mv-dlg .mc-orb-ring { animation: none !important; } }
.mv-status { margin: 0; font-size: 19px; font-weight: 700; }
.mv-said { margin: 0; min-height: 1.6em; max-width: 560px; color: #D6E4F5; font-size: 16px; }
.mv-reply { margin: 0; max-width: 560px; color: #fff; font-size: 17px; line-height: 1.9; max-height: 30vh; overflow: auto; }
.mv-transcript { width: min(100%, 560px); text-align: start; }
.mv-transcript summary { padding: 10px; cursor: pointer; color: #D6E4F5; }
.mv-transcript[open] { max-height: 35dvh; overflow: auto; }
.mv-hint { margin: 0; color: #9FB1CC; font-size: 13px; }
.mv-in .mc-btn { background: #ffffff1a; color: #fff; border-color: #ffffff33; }

/* Grade change history (admin) */
.sh-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sh-list li { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; }
.sh-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sh-what { font-weight: 700; color: var(--teal); unicode-bidi: plaintext; }
.tc-sub { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }

/* Admin home: what needs action today, first */
.today-needs { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0 12px; }
.tn-title { font-size: 15px; margin: 0 0 8px; color: var(--ink); }
.tn-list { display: grid; gap: 6px; }
.tn-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.tn-item.urgent { border-color: #f1c4c4; background: #fdf3f3; }
.tn-item.action { border-color: #f0dcae; background: #fdf8ec; }
.tn-count { flex: none; min-width: 34px; text-align: center; font-weight: 800; font-size: 17px; color: var(--ink); }
.tn-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tn-text small { color: var(--muted); font-size: 12px; }
.tn-go { flex: none; color: var(--muted); }
.tn-calm, .tn-more { margin: 0; color: var(--muted); font-size: 13px; }
.tn-more { margin-top: 6px; }
/* The same X in every window, whatever other button styles it carries. */
dialog .mc-icon.dlg-x, dialog .rg-x.dlg-x, dialog .dlg-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); }
.dlg-msg { margin: 0; white-space: pre-line; line-height: 1.9; color: var(--ink); font-size: 15px; }
dialog.dlg-confirm { width: min(420px, calc(100% - 32px)); }
dialog.dlg:focus { outline: none; }
/* Personal account: the photo with its own small edit button, sign-in details, a folded password, then links. */
.pa-photo-wrap { position: relative; flex: none; }
.pa-photo-btn { position: absolute; inset-inline-start: -2px; bottom: -2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff; background: var(--teal); color: #fff; cursor: pointer; padding: 0; box-shadow: 0 2px 8px rgba(14, 23, 48, .18); }
.pa-photo-btn:focus-visible { outline: 3px solid rgba(11, 122, 117, .35); outline-offset: 2px; }
.pa-photo-editor:empty { display: none; }
.pa-photo-status:empty { display: none; }
.pa-fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; min-height: 32px; }
.pa-fold > summary::-webkit-details-marker { display: none; }
.pa-fold > summary b { color: var(--navy); font-size: 16px; }
.pa-fold > summary small { color: var(--muted); font-size: 12px; }
.pa-fold[open] > summary { margin-bottom: 14px; }
.pa-fold[open] > summary small { display: none; }
.pa-links { display: block; }
.pa-links { margin-top: 14px; }
.pa-links .set-row.pa-logout .set-text b, .pa-links .set-row.pa-logout .set-ic { color: #B42318; }
.pa-logout { color: #B42318 !important; border-color: #F1C4C4 !important; }
.pa-note { text-align: center; margin: 2px 0 0; }
.pa-photo-editor:not(:has(> :not([hidden]))) { display: none; }
.push-invite .pi-head b { flex: 1; min-width: 0; }
.push-invite .pi-x { width: 34px; height: 34px; flex: none; }

/* Funds: the total, each fund as a card (balance, money in and out), and a fund's statement like a bank statement. */
.fx-total { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--navy); color: #fff; margin: 12px 0 8px; }
.fx-total > div:first-child { display: grid; gap: 2px; }
.fx-total > div:first-child span { color: #C9D6EE; font-size: 13px; }
.fx-total > div:first-child b { font-size: 26px; line-height: 1.3; }
.fx-flow { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.fx-flow span { display: inline-flex; align-items: center; gap: 6px; }
.fx-total .fx-in { color: #8FE3C8; } .fx-total .fx-out { color: #FFB4A9; }
.fx-hint { margin: 4px 2px 10px; }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .fx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fx-card { display: grid; gap: 8px; text-align: start; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.fx-card:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(14, 23, 48, .06); }
.fx-card.off { opacity: .6; } .fx-card.low { border-color: #F1C4C4; }
.fx-head { display: flex; align-items: center; gap: 10px; }
.fx-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); flex: none; }
.fx-card.k-bank .fx-ic { background: #EEF2FB; color: var(--navy); }
.fx-card.k-donations .fx-ic { background: #FDF3E3; color: #9A6200; }
.fx-name { display: grid; min-width: 0; } .fx-name small { color: var(--muted); font-size: 12px; }
.fx-bal { font-size: 22px; color: var(--navy); }
.fx-mini { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; font-weight: 700; }
.fx-in { color: var(--teal); } .fx-out { color: #B42318; } .fx-n { color: var(--muted); font-weight: 400; }
.fx-pend { color: #9A6200; }
.fx-open { color: var(--teal); font-size: 13px; font-weight: 700; }
.fs-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.fs-title { display: grid; } .fs-title b { font-size: 18px; color: var(--navy); } .fs-title small { color: var(--muted); }
.fs-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 700px) { .fs-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fs-sum > div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.fs-sum span { font-size: 12px; color: var(--muted); } .fs-sum b { font-size: 17px; }
.fs-sum .fs-close { background: var(--navy); border-color: var(--navy); } .fs-sum .fs-close span { color: #C9D6EE; } .fs-sum .fs-close b { color: #fff; }
.fs-list { display: grid; gap: 12px; }
.fs-day { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.fs-date { margin: 0; padding: 10px 14px; font-size: 13px; color: var(--muted); background: #F7F9FC; border-bottom: 1px solid var(--line); }
.fs-line { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #EEF2F6; }
.fs-line:last-child { border-bottom: 0; }
.fs-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.fs-line.income .fs-ic { background: var(--teal-soft); color: var(--teal); }
.fs-line.expense .fs-ic { background: #FDECEA; color: #B42318; }
.fs-what { display: grid; min-width: 0; flex: 1; } .fs-what b { font-size: 14px; overflow-wrap: anywhere; } .fs-what small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fs-amt { display: grid; text-align: end; flex: none; } .fs-amt b { font-size: 15px; white-space: nowrap; } .fs-amt small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.fs-line.income .fs-amt b { color: var(--teal); } .fs-line.expense .fs-amt b { color: #B42318; }
.fs-acts { margin-top: 12px; }
@media (max-width: 420px) { .fs-line { flex-wrap: wrap; } .fs-amt { width: 100%; grid-auto-flow: column; justify-content: space-between; padding-inline-start: 44px; } }
.fx-total .danger-text { color: #FFB4A9 !important; }
/* Counting a fund (جرد) */
.fc-form { display: grid; gap: 12px; }
.fc-expected { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: #F4F7FB; }
.fc-expected span { color: var(--muted); font-size: 13px; } .fc-expected b { font-size: 18px; color: var(--navy); }
.fc-diff b { font-size: 15px; } .fc-ok { color: var(--teal); } .fc-over { color: #9A6200; } .fc-short { color: #B42318; }
.fc-settle { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.fc-settle input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.fc-settle span { display: grid; gap: 2px; } .fc-settle small { color: var(--muted); font-size: 12px; }
.fc-hist .fc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EEF2F6; }
.fc-hist .fc-row:last-child { border-bottom: 0; }
.fc-row > div { display: grid; gap: 2px; min-width: 0; } .fc-row small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.fc-row.ok b { color: var(--teal); } .fc-row.over b { color: #9A6200; } .fc-row.short b { color: #B42318; }

/* Settings-style menu: groups of rows, each with its own coloured icon, a name, one line and an arrow. */
.set-groups { display: grid; gap: 18px; max-width: 760px; }
.set-group-t { margin: 0 6px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.set-list { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-bottom: 1px solid #EEF2F6;
  background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; transition: background .15s ease; }
.set-row:last-child { border-bottom: 0; }
.set-row:hover { background: #F7F9FC; }
.set-row:focus-visible { outline: 3px solid rgba(11, 122, 117, .3); outline-offset: -3px; }
.set-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; flex: none; color: #fff; }
.set-ic.navy { background: var(--navy); } .set-ic.teal { background: var(--teal); } .set-ic.amber { background: #D98A1E; }
.set-ic.violet { background: #6B5BD2; } .set-ic.gold { background: #C9962B; } .set-ic.red { background: #C2412D; }
.set-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.set-text b { font-size: 15px; color: var(--navy); }
.set-text small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.set-badge { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 700; }
.set-go { flex: none; color: #A8B3C2; display: grid; }
.set-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; flex: none; }
.set-back:hover { background: #F4F6F9; }
.mod-head { display: grid; gap: 4px; padding: 14px 16px; margin-bottom: 14px; border-radius: 16px; background: var(--teal-soft); max-width: 760px; }
.mod-head b { color: var(--navy); font-size: 16px; } .mod-head small { color: #3E5A66; line-height: 1.8; }
.mod-apply { position: sticky; top: calc(8px + var(--sat, 0px)); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--navy); color: #fff; max-width: 760px; box-shadow: 0 8px 22px rgba(14, 23, 48, .18); }
.mod-apply .btn { background: #E8A33D; color: #16244A; }
.mod-row { cursor: default; } .mod-row.off .set-text b { color: var(--muted); }
.mod-locked { color: #9A6200 !important; }
/* Academic structure: one tidy row per grade */
.grade-block { border-radius: 14px; padding: 12px 14px; background: #fff; }
.grade-head { flex-wrap: nowrap; }
.gr-title { display: grid; gap: 1px; min-width: 0; flex: 1; } .gr-title small { color: var(--muted); font-size: 12.5px; }
.gr-more { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.gr-more:hover { background: #F4F6F9; }
.grade-block .sections { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.grade-block .section-chip { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 700; }
.grade-block .section-chip:hover { border-color: var(--accent); }
.grade-block .section-chip.add { background: #fff; border: 1px dashed var(--teal); color: var(--teal); gap: 4px; }
dialog.sheet .sheet-x.dlg-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); }
/* Setup quick start */
.qs { display: grid; gap: 12px; }
.qs-hero { display: grid; gap: 6px; padding: 18px; border-radius: 18px; background: var(--navy); color: #fff; }
.qs-hero b { font-size: 20px; } .qs-hero p { margin: 0; color: #C9D6EE; line-height: 1.9; }
.qs-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.qs-seg button { min-width: 56px; }
.qs-sum { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--teal-soft); color: var(--navy); line-height: 1.8; }
.qs-sum span { font-size: 14px; }
.qs-acts { display: grid; gap: 8px; }
.qs-acts .btn { width: 100%; min-height: 50px; }
.qs-back { margin-bottom: 10px; }
/* Setup subjects: a compact two-column grid of chips (the code and weekly periods in one small line) */
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 700px) { .subject-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.subject-grid .subject-pick { padding: 8px 10px; border-radius: 12px; min-height: 48px; }
.subject-grid .subject-pick b { font-size: 13.5px; }
.subject-grid .subject-pick .sub { font-size: 11px; margin: 0; }
.subject-group .sec-title { margin: 14px 0 6px; }

/* Staff directory */
.sp-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.sp-search { flex: 1 1 220px; min-height: 44px; }
.sp-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sp-group { margin-bottom: 16px; }
.sp-group-t { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; font-size: 14px; color: var(--navy); }
.sp-group-t span { margin-inline-start: auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.sp-list { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sp-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-bottom: 1px solid #EEF2F6;
  background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.sp-card:last-child { border-bottom: 0; } .sp-card:hover { background: #F7F9FC; } .sp-card.off { opacity: .6; }
.sp-av { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex: none; font-weight: 800; font-size: 14px; color: #fff; background: var(--teal); }
.sp-av.c-accountant { background: #D98A1E; } .sp-av.c-admin, .sp-av.c-supervisor { background: var(--navy); }
.sp-av.c-guard, .sp-av.c-driver, .sp-av.c-cleaner, .sp-av.c-worker, .sp-av.c-other { background: #6B5BD2; }
.sp-main { display: grid; gap: 2px; min-width: 0; flex: 1; } .sp-main b { font-size: 15px; color: var(--navy); }
.sp-main small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sp-tag { padding: 1px 8px; border-radius: 999px; background: #EEF2F6; color: #4B5A6B; font-size: 11.5px; }
.sp-tag.ok { background: var(--teal-soft); color: var(--teal); } .sp-tag.warn { background: #FDF3E3; color: #9A6200; }
.sp-go { flex: none; color: #A8B3C2; display: grid; }
.sp-step { display: block; margin-bottom: 8px; color: var(--navy); }
.sp-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.sp-type { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; }
.sp-type.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.sp-type.teacher { border-style: dashed; color: var(--muted); }
.sp-form { display: grid; gap: 4px; margin-top: 12px; }
.sp-login-wrap { display: grid; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 14px; background: #F7F9FC; }
.sp-check, .sp-perms label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sp-check input, .sp-perms input { width: 18px; height: 18px; }
.sp-perms { display: grid; gap: 6px; }
/* Parent accounts: a summary up top, what needs action next, then the accounts as a clean list */
.parents-admin { max-width: 860px; }
.pa-head { display: grid; gap: 12px; margin-bottom: 14px; }
.pa-title h2 { margin: 0; font-size: 20px; color: var(--navy); }
.pa-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.pa-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pa-stat { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; text-align: start; cursor: pointer; color: var(--navy); }
.pa-stat:disabled { cursor: default; opacity: 1; }
.pa-stat:not(:disabled):hover { background: #F7F9FC; }
.pa-stat b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pa-stat span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pa-stat.ok b { color: var(--teal); } .pa-stat.warn b { color: #B87513; }
.pa-cta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: 16px; background: var(--teal-soft); }
.pa-cta .btn { flex: none; }
.pa-seg { display: flex; overflow-x: auto; scrollbar-width: none; }
.pa-seg button { flex: none; padding: 0 12px; white-space: nowrap; }
.pa-req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #EEF2F6; }
.pa-req:last-child { border-bottom: 0; }
.pa-req-acts { display: flex; gap: 6px; flex: none; margin-inline-start: auto; }
.pa-box { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.pa-av { background: #0B7A75; }
.pa-kidrow { cursor: default; } .pa-kidrow:hover { background: none; }
@media (max-width: 560px) {
  .pa-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-cta { flex-wrap: wrap; } .pa-cta .btn { margin-inline-start: 50px; }
}
.pa-cta.amber { background: #FDF3E3; }
.pa-more { width: 100%; margin-top: 8px; }
/* Behavior: pick the item, tap the students, save from the bar that follows you */
.beh-class { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); margin-bottom: 12px; max-width: 100%; }
.beh-class select { border: 0; background: none; min-height: 40px; padding: 0 4px; font-weight: 700; color: var(--navy); min-width: 0; }
.beh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.beh-step { padding: 14px; margin-bottom: 12px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.beh-step h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.beh-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; }
.beh-count { color: var(--teal); font-size: 13px; font-weight: 700; }
.beh-link { margin-inline-start: auto; border: 0; background: none; color: var(--teal); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; min-height: 36px; }
.beh-seg { margin-bottom: 10px; }
.beh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.beh-tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-size: 14px; color: var(--navy); text-align: start; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.beh-tile b { flex: none; min-width: 36px; padding: 2px 8px; border-radius: 999px; text-align: center; font-size: 13px; }
.beh-tile.positive b { background: var(--teal-soft); color: var(--teal); }
.beh-tile.negative b { background: #FDF3E3; color: #9A6200; }
.beh-tile.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.beh-tile.negative.on { border-color: #D98A1E; background: #FFF8EC; box-shadow: inset 0 0 0 1px #D98A1E; }
.beh-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.beh-st { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; color: var(--navy); }
.beh-st-n { font-size: 13px; font-weight: 700; line-height: 1.4; text-align: center; }
.beh-st small { font-size: 12px; color: var(--teal); font-weight: 700; } .beh-st small.low { color: #B87513; }
.beh-st.on { border-color: var(--teal); background: var(--teal-soft); }
.beh-av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #EEF2F6; color: var(--navy); font-weight: 800; font-size: 13px; flex: none; }
.beh-st.on .beh-av { background: var(--teal); color: #fff; }
.beh-av.big { width: 42px; height: 42px; background: var(--teal); color: #fff; } .beh-av.big.low { background: #D98A1E; }
.beh-more { margin-bottom: 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.beh-more summary { padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--navy); min-height: 44px; }
.beh-more-in { display: grid; gap: 6px; padding: 0 14px 14px; }
.beh-notify { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.beh-notify span { display: grid; } .beh-notify small { color: var(--muted); font-size: 12.5px; }
.beh-bar { position: sticky; bottom: calc(12px + var(--sab, 0px)); z-index: 4; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 16px;
  background: var(--navy); color: #fff; box-shadow: 0 10px 26px rgba(14, 23, 48, .22); }
.beh-bar-t { display: grid; gap: 1px; min-width: 0; flex: 1; }
.beh-bar-t b, .beh-bar-t span { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beh-bar-t small { color: #C9D3E3; font-size: 12.5px; }
.beh-bar .btn { flex: none; background: #E8A33D; color: #16244A; min-width: 96px; }
@media (max-width: 1079px) { body.has-bnav .beh-bar { bottom: calc(80px + var(--sab, 0px)); } }
.beh-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; margin-bottom: 8px; }
.beh-stats .pa-stat { cursor: default; }
.beh-meter { display: block; height: 5px; margin-top: 4px; border-radius: 999px; background: #EEF2F6; overflow: hidden; max-width: 220px; }
.beh-meter i { display: block; height: 100%; border-radius: inherit; background: var(--teal); } .beh-meter i.low { background: #D98A1E; }
.beh-day { margin-bottom: 14px; }
.beh-entry { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #EEF2F6; }
.beh-entry:last-child { border-bottom: 0; }
.beh-pts { flex: none; display: grid; place-items: center; min-width: 44px; height: 32px; padding: 0 6px; border-radius: 10px; font-weight: 800; font-size: 14px; }
.beh-entry.positive .beh-pts, .beh-pts.positive { background: var(--teal-soft); color: var(--teal); }
.beh-entry.negative .beh-pts, .beh-pts.negative { background: #FDF3E3; color: #9A6200; }
.beh-by { font-size: 11.5px !important; }
.set-row.off .set-text b { color: var(--muted); }
.beh-num-in { width: 84px; flex: none; text-align: center; }
@media print { .beh-top .gr-more, .beh-seg, .beh-stats { display: none !important; } }
.beh-tile b, .beh-pts { direction: ltr; unicode-bidi: isolate; }
/* Settings menu, phone style: soft grey page, white rounded cards, outline icons, inset dividers, values in grey */
.set-groups { gap: 22px; }
.set-group-t { margin: 0 10px 10px; font-size: 15px; font-weight: 600; color: #8A94A3; }
.set-list.menu { border: 0; border-radius: 24px; box-shadow: 0 1px 2px rgba(22, 36, 74, .04); }
.set-list.menu .set-row { position: relative; min-height: 58px; padding: 6px 18px; gap: 14px; border-bottom: 0; }
.set-list.menu .set-row:not(:last-child)::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 56px; inset-inline-end: 18px; height: 1px; background: #E8ECF1; }
.set-ic.plain { width: 24px; height: 24px; border-radius: 0; background: none !important; color: var(--navy); }
.set-list.menu .set-text b { font-size: 16px; font-weight: 600; color: #1B2333; }
.set-value { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8A94A3; font-size: 15px; }
.set-list.menu .set-go { color: #A8B1BE; }
.section-head-t { display: grid; gap: 2px; min-width: 0; }
.section-head-t small { color: var(--muted); font-size: 13px; line-height: 1.6; }
/* The employee's file: summary tiles, then salary, advances, payroll lines, attendance and leaves */
.sf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sf-head .sp-av { width: 52px; height: 52px; font-size: 17px; }
.sf-sec { margin-top: 16px; }
.sf-box { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; margin-bottom: 8px; }
.sf-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #EEF2F6; font-size: 14px; }
.sf-kv:last-of-type { border-bottom: 0; } .sf-kv span { color: var(--muted); } .sf-kv b { color: var(--navy); }
.sf-kv.strong b { color: #B87513; font-size: 16px; }
.sf-acts { margin-top: 8px; }
.sf-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #EEF2F6; }
.sf-row:last-child { border-bottom: 0; }
.sf-amt { display: grid; justify-items: end; gap: 4px; flex: none; } .sf-amt b { color: var(--navy); font-size: 15px; }
/* Timetable: day tabs and period cards on the phone, a subject sheet to pick from, and auto-generate in three steps */
.tt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tt-days { display: flex; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.tt-days button { flex: 1 0 auto; padding: 0 12px; white-space: nowrap; }
.tt-periods { display: grid; gap: 8px; }
.tt-period { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.tt-period:hover { background: #F7F9FC; }
.tt-period.empty { border-style: dashed; background: #FAFBFC; } .tt-period.empty .sp-main b { color: var(--muted); font-weight: 600; }
.tt-no { display: grid; justify-items: center; gap: 1px; width: 52px; flex: none; padding: 6px 0; border-radius: 12px; background: var(--teal-soft); color: var(--teal); }
.tt-no b { font-size: 17px; } .tt-no small { font-size: 11px; color: #3E6A68; }
.tt-period.empty .tt-no { background: #EEF2F6; color: var(--muted); }
.tt-break { justify-self: center; padding: 3px 12px; border-radius: 999px; background: #FDF3E3; color: #9A6200; font-size: 12.5px; }
.tt-choices { display: grid; gap: 6px; padding: 4px 2px 8px; }
.tt-choice { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.tt-choice.on { border-color: var(--teal); background: var(--teal-soft); }
.tt-choice.clear { justify-content: center; color: #B42318; border-style: dashed; }
.tt-need { flex: none; padding: 2px 9px; border-radius: 999px; background: #EEF2F6; color: #4B5A6B; font-size: 12px; font-weight: 700; }
.tt-need.full { background: var(--teal-soft); color: var(--teal); }
.tt-all { justify-content: flex-start; gap: 14px; margin-bottom: 4px; }
.tt-grade { padding: 10px 0; border-bottom: 1px solid #EEF2F6; } .tt-grade:last-child { border-bottom: 0; }
.tt-grade-t { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--navy); cursor: pointer; padding: 0; }
.tt-tick { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #B8C2CF; color: #fff; }
.tt-grade-t.on .tt-tick { background: var(--teal); border-color: var(--teal); }
.tt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tt-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; min-width: 52px; justify-content: center; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: var(--navy); cursor: pointer; }
.tt-chip small { color: var(--muted); font-size: 11px; }
.tt-chip.on { border-color: var(--teal); background: var(--teal); color: #fff; } .tt-chip.on small { color: #CDEBE8; }
.tt-load { padding: 12px 0; border-bottom: 1px solid #EEF2F6; } .tt-load:last-child { border-bottom: 0; }
.tt-load-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tt-load-h b { color: var(--navy); } .tt-load-h small { color: var(--muted); } .tt-load-h small.over { color: #B42318; font-weight: 700; }
.tt-load .beh-meter { max-width: none; margin: 6px 0 10px; }
.tt-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.tt-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 4px 6px 4px 12px; border-radius: 12px; background: #F7F9FC; font-size: 14px; }
.tt-step { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.tt-step b { min-width: 24px; text-align: center; color: var(--navy); }
.tt-step button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.tt-draft-h { display: grid; gap: 2px; margin: 8px 2px 10px; } .tt-draft-h small { color: var(--muted); }
.tt-warn { margin: 0; padding: 0 14px 12px 0; font-size: 13.5px; line-height: 1.8; color: #6B4B00; }
.tt-bar { margin-top: 10px; }
.tt-all .beh-link { margin-inline-start: 0; }
.tt-grade { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0; }
.tt-grade-t { min-width: 92px; }
.tt-chips { margin-top: 0; }
.tt-load summary { list-style: none; cursor: pointer; padding: 2px 0; } .tt-load summary::-webkit-details-marker { display: none; }
.tt-load[open] .tt-subs { margin-top: 4px; }
.tt-all { display: flex; gap: 18px; }
/* Grades (administration): grouped by exam, one short row per section and subject */
.ex-admin { max-width: 860px; }
.ex-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ex-group { margin-bottom: 12px; border-radius: 18px; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.ex-group > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 56px; }
.ex-group > summary::-webkit-details-marker { display: none; }
.ex-group > summary::after { content: ""; width: 9px; height: 9px; border-inline-start: 2px solid #A8B3C2; border-bottom: 2px solid #A8B3C2; transform: rotate(-45deg); transition: transform .15s; flex: none; }
.ex-group[open] > summary::after { transform: rotate(-135deg); }
.ex-group .sp-list { border: 0; border-top: 1px solid #EEF2F6; border-radius: 0; }
.ex-bulk { padding: 0 14px 10px; }
.ex-row { display: flex; align-items: center; gap: 6px; padding-inline-end: 10px; border-bottom: 1px solid #EEF2F6; }
.ex-row:last-child { border-bottom: 0; }
.ex-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 60px; padding: 8px 14px; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.ex-open:hover { background: #F7F9FC; }
.ex-prog { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12.5px; font-weight: 700; }
.ex-prog.part { background: #FDF3E3; color: #9A6200; }
@media (max-width: 560px) { .ex-open .badge { display: none; } .ex-row.pending .ex-open .badge { display: inline-flex; } }
.ex-secs { border-top: 1px solid #EEF2F6; }
.ex-sec { border-bottom: 1px solid #EEF2F6; } .ex-sec:last-child { border-bottom: 0; }
.ex-sec > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px; cursor: pointer; min-height: 48px; }
.ex-sec > summary b { color: var(--navy); } .ex-sec > summary small { color: var(--muted); font-size: 12.5px; }
.ex-sec .sp-list { border: 0; border-top: 1px solid #EEF2F6; border-radius: 0; background: #FBFCFD; }
.nd-me { padding: 0; cursor: pointer; overflow: hidden; }
.nd-me .hd-avatar { width: 100%; height: 100%; border: 0; outline: 0; }
.nd-me .hd-avatar svg { width: 30px; height: 30px; }
/* The teacher's password: his own after the first sign-in; requests from «نسيت كلمة المرور» show here */
.pw-req { display: grid; gap: 8px; margin: 12px 0; padding: 12px 14px; border-radius: 16px; background: #F4F7FA; }
.pw-head { display: flex; gap: 10px; align-items: flex-start; color: var(--navy); }
.pw-head small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.pw-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.pw-item .row { margin-inline-start: auto; }
.pw-link { display: block; overflow-wrap: anywhere; padding: 10px; border-radius: 10px; background: #F4F7FA; margin-top: 8px; }
/* Chat: a date line between days, the sender in the administration's view, read receipts, quick replies */
.chat-day { align-self: center; margin: 6px 0 2px; }
.chat-day span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: #E6ECF2; color: #4B5A6B; font-size: 12px; font-weight: 600; }
.chat-who { display: block; font-size: 12px; margin-bottom: 2px; color: var(--teal); }
.chat-msg.mine .chat-who { color: #DDF3F1; }
.chat-tick { opacity: .85; } .chat-tick.read { font-weight: 700; }
.chat-msg.flag { box-shadow: inset 0 0 0 2px #E7A23A; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 0; border-top: 1px solid var(--line); }
.chat-quick button { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #F7F9FC; font: inherit; font-size: 13px; color: var(--navy); cursor: pointer; white-space: nowrap; }
.chat-quick button:hover { background: var(--teal-soft); border-color: var(--teal); }
.chat-quick + .chat-compose { border-top: 0; }
.chat-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: #FDF3E3; color: #9A6200; font-size: 11.5px; font-weight: 700; vertical-align: middle; }
.ca-stats { margin-bottom: 14px; }
.ca-pair { position: relative; width: 46px; height: 42px; flex: none; }
.ca-pair span { position: absolute; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: 13px; border: 2px solid #fff; }
.ca-pair span:first-child { inset-inline-start: 0; top: 0; }
.ca-pair span.p { inset-inline-end: 0; bottom: 0; background: var(--navy); }
.ca-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ca-read { height: auto; max-height: 62vh; border-radius: 14px; margin: 10px 0; }
.ca-row.flag { background: #FFFBF4; }
/* On a phone the conversation fits the screen: the message box stays in view above the bottom bar */
@media (max-width: 700px) { .chat .chat-list { height: max(260px, calc(100dvh - 430px - var(--sat, 0px) - var(--sab, 0px))); } }

/* Student card (parent app, phones): the list button in the top corner facing the name; the ID and the number on one
   line, two equal boxes, the label above the value and the copy button at the end. */
.student-file.app > .sf-head .sf-tools { position: absolute !important; top: 14px; inset-inline-end: 14px; width: auto !important; margin: 0 !important; }
.student-file.app > .sf-head .sf-id { padding-inline-end: 52px !important; }
.student-file.app > .sf-head .sf-ids { grid-column: 1 / -1; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
.student-file.app > .sf-head .sf-idbox { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center;
  column-gap: 6px !important; row-gap: 0 !important; padding: 7px 7px 7px 12px !important; border-radius: 14px !important; background: #F6F8FB !important; border: 1px solid #E6EBF1 !important; }
.student-file.app > .sf-head .sf-idbox > span { grid-column: 1; grid-row: 1; font-size: 11px; color: var(--muted); line-height: 1.3; }
.student-file.app > .sf-head .sf-idbox b { grid-column: 1; grid-row: 2; justify-self: start; font-size: 14px !important; letter-spacing: .3px !important; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; }
.student-file.app > .sf-head .sf-idbox .sf-copy { grid-column: 2; grid-row: 1 / span 2; width: 34px !important; height: 34px !important; min-width: 34px; min-height: 34px; border-radius: 10px !important; }
.student-file.app > .sf-head .sf-idbox .sf-qr { display: none; }
@media (max-width: 339px) { .student-file.app > .sf-head .sf-ids { grid-template-columns: minmax(0, 1fr) !important; } }
/* Teacher home: today's tasks, varied, one tidy row each (icon, what to do, a hint, arrow) */
.td-list { display: grid; gap: 8px; }
.td-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font: inherit; color: inherit; text-align: start; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.td-row:hover { background: #F7F9FC; border-color: #D5DDE7; }
.td-row.done { background: #F6FBFA; }
.td-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; }
.td-ic.teal { background: var(--teal-soft); color: var(--teal); } .td-ic.amber { background: #FDF3E3; color: #9A6200; }
.td-ic.violet { background: #EFEBF7; color: #6B5BD2; } .td-ic.navy { background: #E8ECF5; color: var(--navy); }
.td-text { display: grid; gap: 1px; min-width: 0; flex: 1; } .td-text b { font-size: 14.5px; color: var(--navy); } .td-text small { color: var(--muted); font-size: 12.5px; }
.td-go { color: #A8B3C2; flex: none; display: grid; }
.td-calm { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px; border-radius: 12px; background: #F6FBFA; color: var(--teal); font-weight: 600; }
.td-period { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.td-row.done .td-ic { background: #EAF6F4; color: var(--teal); }
.td-row.done .td-text b { font-weight: 600; color: #3E5A66; }

/* A small square button with only an icon (e.g. «المزيد» ⋮), so a row of actions fits on one line. */
.btn.icon-btn { flex: none !important; width: 44px; min-width: 44px; padding: 0; display: inline-grid; place-items: center; }
/* One face for every person: photo over a silhouette, same size and circle everywhere */
.pface { position: relative; display: inline-grid; place-items: center; width: var(--pf, 40px); height: var(--pf, 40px); border-radius: 50%; overflow: hidden; flex: none; background: #E3F1F0; }
.pface > svg { width: 100%; height: 100%; display: block; }
.pface > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Attendance rules (who records attendance) */
.ar { display: grid; gap: 12px; }
.ar-sub { display: grid; gap: 10px; }
.ar-sub:empty, .ar-warn:empty { display: none; }
.ar-q { color: var(--navy); font-size: 14px; }
.ar-pick { display: grid; gap: 8px; }
.ar-count { color: var(--muted); }
.ar-list { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.ar-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.ar-row.on { border-color: var(--teal); background: var(--teal-soft); }
.ar-row input { width: 20px; height: 20px; min-height: 0; flex: none; }
.ar-name { display: flex; flex-direction: column; min-width: 0; }
.ar-name b { color: var(--navy); font-size: 14px; }
.ar-name small { color: #8A5A0B; font-size: 12px; }
.ar-warn { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: #FFF7E6; border: 1px solid #F1C66B; color: #6B4508; }
.att-gap { color: #8A5A0B; }
/* Impact window before turning a money section off */
.imp-list { display: grid; gap: 6px; margin: 8px 0; }
.imp-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #FFF7E6; border: 1px solid #F1C66B; color: #6B4508; }
.imp-row b { min-width: 32px; text-align: center; font-size: 18px; color: #8A5A0B; }
.imp-row small { color: #8A5A0B; }
/* MIDAR AI start screen: today's line with its actions; meters only when a limit is near */
.mc-usage-row[hidden] { display: none !important; }
.mc-today-box { display: grid; gap: 8px; justify-items: center; margin: 4px auto 6px; padding: 12px 14px; max-width: 460px; border-radius: 14px; background: var(--teal-soft, #E6F4F3); }
.mc-empty .mc-today-box .mc-today { margin: 0; }
.mc-today-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mc-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--teal); border-radius: 999px; background: #fff; color: var(--teal); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.mc-chip:hover, .mc-chip:focus-visible { background: var(--teal); color: #fff; }

/* ==========================================================================
   MIDAR AI | مدار الذكي — v3 (Nov 2026). One calm column aligned to the reading side, Midar navy/teal/gold.
   Written last and scoped under .mchat so it is the one source of truth for the conversation's look.
   ========================================================================== */
.mchat { --mc-ink: #16244A; --mc-teal: #0B7A75; --mc-teal-soft: #E7F3F2; --mc-gold: #E8A33D; --mc-gold-soft: #FFF5E3;
  --mc-bg: #F6F8FB; --mc-line: #E3E8EF; --mc-muted: #5B6B80; background: var(--mc-bg); border-color: var(--mc-line); }
.mchat ::selection { background: #0B7A7533; }
.mchat textarea { caret-color: var(--mc-teal); }

/* Header: one row. Mark, name and plan on the reading side; search and menu on the other. */
.mchat .mc-head { flex-direction: column; gap: 0; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--mc-line); }
.mchat .mc-head-main { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.mchat .mc-head .mc-av { width: 36px; height: 36px; border-radius: 11px; border: 0; box-shadow: none; }
.mchat .mc-head .mc-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.mchat .mc-head .mc-who b { font-size: 15px; font-weight: 800; color: var(--mc-ink); }
.mchat .mc-head .mc-who small { font-size: 12px; color: var(--mc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mchat .mc-plan-button { min-height: 26px; padding: 2px 9px; border: 0; border-radius: 999px; background: var(--mc-gold-soft); color: #7A4E0C; font-size: 11.5px; gap: 4px; align-self: center; }
.mchat .mc-plan-button.low { background: #FDE7E2; color: #8C2D1B; }
.mchat .mc-acts { display: flex; gap: 4px; }
.mchat .mc-head .mc-icon { width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--mc-ink); }
.mchat .mc-head .mc-icon:hover, .mchat .mc-head .mc-icon:focus-visible { background: var(--mc-bg); }
.mchat .mc-usage-row { padding: 8px 2px 2px; }

/* Stream */
.mchat .mc-stream { background: var(--mc-bg); scrollbar-width: thin; scrollbar-color: #C9D2DE transparent; }
.mchat .mc-col { max-width: 760px; padding: 18px 16px 8px; gap: 14px; }
.mchat .mc-day { align-self: center; padding: 3px 12px; border: 0; border-radius: 999px; background: #E9EDF3; color: var(--mc-muted); font-size: 12px; }

/* Start screen: greeting, today, a list to start from, what the plan opens. Everything aligned to the reading side. */
.mchat .mc-start { display: flex; flex-direction: column; gap: 18px; padding: 6px 0 12px; text-align: start; }
.mchat .mc-hello { display: flex; align-items: flex-start; gap: 14px; }
.mchat .mc-hello .mc-orb.lg .mc-av { width: 52px; height: 52px; border-radius: 16px; }
.mchat .mc-hello .mc-orb.lg .mc-orb-ring { inset: -6px; }
.mchat .mc-hello-t { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.mchat .mc-hello-t h3 { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 800; color: var(--mc-ink); text-wrap: balance; }
.mchat .mc-hello-t p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--mc-muted); }
.mchat .mc-today-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--mc-line); }
.mchat .mc-today-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--mc-teal-soft); color: var(--mc-teal); grid-row: span 2; align-self: start; }
.mchat .mc-today-row .mc-today { margin: 0; font-size: 14.5px; line-height: 1.7; font-weight: 600; color: var(--mc-ink); }
.mchat .mc-today-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; grid-column: 2; }
.mchat .mc-chip { min-height: 34px; padding: 5px 14px; border: 0; border-radius: 999px; background: var(--mc-teal); color: #fff; font-size: 13px; font-weight: 700; }
.mchat .mc-chip:hover, .mchat .mc-chip:focus-visible { background: #096762; color: #fff; }
.mchat .mc-starts, .mchat .mc-feats { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; background: none; }
.mchat .mc-starts h4, .mchat .mc-feats h4 { margin: 4px 2px 0; font-size: 13px; font-weight: 700; color: var(--mc-muted); }
.mchat .mc-start-list { display: flex; flex-direction: column; border-radius: 16px; background: #fff; border: 1px solid var(--mc-line); overflow: hidden; }
.mchat .mc-start-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border: 0; background: none; color: inherit;
  font: inherit; text-align: start; cursor: pointer; }
.mchat .mc-start-row + .mc-start-row { border-top: 1px solid #EEF1F5; }
.mchat .mc-start-row:hover, .mchat .mc-start-row:focus-visible { background: #F8FAFC; outline: none; }
.mchat .mc-start-row:focus-visible { box-shadow: inset 0 0 0 2px var(--mc-teal); }
.mchat .mc-start-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: #EEF2F8; color: var(--mc-ink); }
.mchat .mc-start-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mchat .mc-start-t b { font-size: 14.5px; font-weight: 700; color: var(--mc-ink); }
.mchat .mc-start-t small { font-size: 12px; color: var(--mc-muted); }
.mchat .mc-tag { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--mc-gold-soft); color: #7A4E0C; font-size: 11px; font-weight: 700; }
.mchat .mc-start-go { flex: none; color: #9AA7B8; }
.mchat .mc-more-link { align-self: flex-start; min-height: 36px; padding: 4px 2px; border: 0; background: none; color: var(--mc-teal); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mchat .mc-feat-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mchat .mc-feat { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--mc-line); color: var(--mc-ink); font-size: 12.5px; }
.mchat .mc-feat svg { color: var(--mc-teal); }
.mchat .mc-feat-next { display: flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 2px; border: 0; background: none; color: #7A4E0C; font: inherit; font-size: 12.5px; text-align: start; cursor: pointer; }
.mchat .mc-trust { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--mc-muted); }
.mchat .mc-trust svg { color: var(--mc-teal); flex: none; }

/* Messages: the person's on the reading side in navy; MIDAR AI's on a white sheet, one mark per run of answers. */
.mchat .mc-u { align-self: flex-start; max-width: min(84%, 560px); gap: 3px; }
.mchat .mc-u-txt { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--mc-ink); color: #fff; font-size: 15px; line-height: 1.7; }
.mchat .mc-u-meta, .mchat .mc-sending { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; color: var(--mc-muted); font-size: 11.5px; }
.mchat .mc-a { gap: 10px; align-items: flex-start; }
.mchat .mc-a > .mc-av.sm { width: 30px; height: 30px; border-radius: 10px; margin-top: 2px; }
.mchat .mc-a.cont > .mc-av.sm { visibility: hidden; height: 0; }
.mchat .mc-a-in { gap: 8px; padding: 12px 14px; border-radius: 6px 18px 18px 18px; background: #fff; border: 1px solid var(--mc-line);
  box-shadow: 0 1px 2px #16244A0A; }
.mchat .mc-a-in .ai-answer { font-size: 15px; line-height: 1.8; color: var(--mc-ink); }
.mchat .mc-a-in .ai-answer > :last-child { margin-bottom: 0; }
.mchat .mc-status { color: var(--mc-muted); font-size: 14px; }
.mchat .mc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 6px; border-top: 1px solid #F0F3F7; color: var(--mc-muted); font-size: 12px; }
.mchat .mc-meta .mc-link { min-height: 28px; padding: 0; color: var(--mc-muted); font-size: 12px; }
.mchat .mc-meta .mc-link:hover { color: var(--mc-teal); }
.mchat .mc-next { display: flex; flex-wrap: wrap; gap: 8px; padding-inline-start: 40px; }
.mchat .mc-next-btn { min-height: 36px; padding: 6px 14px; border: 1px solid #CFE3E1; border-radius: 999px; background: #fff; color: var(--mc-teal); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mchat .mc-next-btn:hover, .mchat .mc-next-btn:focus-visible { background: var(--mc-teal-soft); }
.mchat .mc-divider { display: flex; align-items: center; gap: 8px; color: var(--mc-muted); font-size: 12px; }
.mchat .mc-divider::before, .mchat .mc-divider::after { content: ""; flex: 1; height: 1px; background: var(--mc-line); }

/* Composer: one rounded field; (+) on the reading side, voice or send on the other. */
.mchat .mc-comp { padding: 8px 12px calc(10px + var(--mc-safe-bottom, 0px)); background: var(--mc-bg); border-top: 1px solid var(--mc-line); }
.mchat .mc-cbox { max-width: 760px; align-items: flex-end; gap: 6px; padding: 5px; border: 1px solid #D6DDE7; border-radius: 24px; background: #fff; box-shadow: 0 2px 8px #16244A0D; }
.mchat .mc-cbox:focus-within { border-color: var(--mc-teal); box-shadow: 0 0 0 3px #0B7A751F; }
.mchat .mc-cbox textarea { padding: 9px 6px; font-size: 16px; line-height: 1.6; color: var(--mc-ink); background: transparent; }
.mchat .mc-cbox textarea::placeholder { color: #7C8AA0; }
.mchat .mc-cbox .mc-icon { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #F0F3F8; color: var(--mc-ink); }
.mchat .mc-cbox .mc-icon:hover { background: #E5EAF2; }
.mchat .mc-send { width: 40px; height: 40px; background: var(--mc-teal); }
.mchat .mc-send:disabled { background: #D9DFE8; }

@media (max-width: 719px) {
  .mchat .mc-col { padding: 14px 12px 6px; }
  .mchat .mc-hello-t h3 { font-size: 19px; }
  .mchat .mc-u { max-width: 88%; }
  .mchat .mc-next { padding-inline-start: 0; }
}
.mchat .mc-pick { display: flex; flex-direction: column; gap: 0; margin: 2px -14px 0; border-top: 1px solid #F0F3F7; }
.mchat .mc-pick > button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 52px; padding: 8px 14px; border: 0; border-radius: 0;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; box-shadow: none; }
.mchat .mc-pick > button + button { border-top: 1px solid #F0F3F7; }
.mchat .mc-pick > button:hover, .mchat .mc-pick > button:focus-visible { background: #F8FAFC; }
.mchat .mc-pick b { font-size: 14.5px; color: var(--mc-ink); }
.mchat .mc-pick small { font-size: 12px; color: var(--mc-muted); }
/* One sheet per answer: text and cards sit flat inside it (no box within a box). A card's state colours the sheet. */
.mchat .mc-a-in > .ai-answer, .mchat .mc-a-in > .mc-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.mchat .mc-a-in:has(> .mc-card.ok) { border-color: #9FD0CC; }
.mchat .mc-a-in:has(> .mc-card.err) { border-color: #E9C3BC; }
.mchat .mc-card h4 { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--mc-ink); }
.mchat .mc-card .mc-sub { margin: 0; font-size: 12.5px; color: var(--mc-muted); }
/* «ملخص متابعتك»: a list, the number at the end of each line, the explanation under it in one quiet line. */
.mchat [data-card="briefing"] .mc-kv { display: flex; flex-direction: column; gap: 0; margin: 4px -14px; border-top: 1px solid #F0F3F7; }
.mchat [data-card="briefing"] .mc-kv > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; padding: 10px 14px;
  border: 0; border-radius: 0; background: none; min-height: 0; }
.mchat [data-card="briefing"] .mc-kv > div + div { border-top: 1px solid #F0F3F7; }
.mchat [data-card="briefing"] .mc-kv > div > small:first-child { grid-column: 1; grid-row: 1; font-size: 14px; font-weight: 600; color: var(--mc-ink); }
.mchat [data-card="briefing"] .mc-kv > div > b { grid-column: 2; grid-row: 1; font-size: 18px; font-weight: 800; color: var(--mc-ink); font-variant-numeric: tabular-nums; }
.mchat [data-card="briefing"] .mc-kv > div > small:not(:first-child) { grid-column: 1 / -1; font-size: 12px; line-height: 1.6; color: var(--mc-muted); }
.mchat [data-card="briefing"] .mc-kv > div > .mc-link { grid-column: 1 / -1; justify-self: start; min-height: 30px; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--mc-teal); }
/* Tables in answers: names may wrap; numbers, dates and amounts never break. */
.mchat .mc-a-in .ai-tbl td:not(:first-child) { white-space: nowrap; }
.mchat .mc-a-in .ai-tbl td { font-variant-numeric: tabular-nums; }
.mchat .mc-a-in .ai-tbl td:first-child { min-width: 8.5em; }
.mchat .mc-a-in .ai-tbl th { white-space: normal; }
@media (max-width: 719px) { .mchat .mc-a-in .ai-tbl th, .mchat .mc-a-in .ai-tbl td { padding: 8px 6px; font-size: 13px; } }
.mchat .mc-btn.gold { background: var(--mc-gold-soft); border-color: #F1D29A; color: #7A4E0C; }
/* A subject's page (MIDAR AI Pro): the conversation scoped to one class and subject, with its record as a tab. */
.mchat .mc-stream[hidden], .mchat .mc-comp[hidden], .mchat .msj-record[hidden] { display: none !important; }
.mchat .msj-pagehead .mc-head-main { gap: 8px; }
.mchat .msj-pagehead .msj-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--mc-teal-soft); color: var(--mc-teal); }
.mchat .msj-tabs { display: flex; gap: 6px; padding-top: 8px; }
.mchat .msj-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--mc-line);
  border-radius: 12px; background: #fff; color: var(--mc-muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mchat .msj-tab[aria-selected="true"] { background: var(--mc-ink); border-color: var(--mc-ink); color: #fff; }
.mchat .msj-record { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; background: var(--mc-bg); }
.mchat .msj-record .msj-body { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.mchat .mc-hello .msj-ic.lg { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; background: var(--mc-teal-soft); color: var(--mc-teal); }

/* Guardian access groups (student file / parent account): four ready choices instead of many toggles. */
.ga { display: grid; gap: 12px; }
.ga-pick { display: grid; gap: 8px; }
.ga-opt { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; min-height: 44px; }
.ga-opt small { color: var(--muted); }
.ga-opt.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.ga-opt:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.ga-check { align-items: center; gap: 8px; margin-top: 8px; }
.ga-check input { width: 20px; height: 20px; accent-color: var(--teal); }
.ga-hist summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.ga-invite { display: grid; justify-items: center; gap: 10px; margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.ga-invite img { background: #fff; border-radius: 8px; }
.ga-url { font-size: 12px; word-break: break-all; color: var(--muted); text-align: center; }
