/* School ERP — student portal & test player (mobile first) */
:root {
  --ink: #14213d; --ink-2: #334155; --muted: #5b6475; --line: #e4e7f0; --bg: #f5f6fb; --card: #fff;
  --primary: #2b3a9f; --primary-2: #4553d6; --primary-soft: #eceefe;
  --accent: #f59e0b; --accent-2: #ea580c; --accent-soft: #fff4dc;
  --ok: #059669; --ok-soft: #d1fae5; --bad: #e11d48; --bad-soft: #ffe4e6; --flag: #7c3aed; --flag-soft: #ede9fe;
  --radius: 16px; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 10px 28px -14px rgba(20,33,61,.25);
  --font-head: "Baloo 2", "Mukta", system-ui, sans-serif; --font-body: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .4em; text-wrap: balance; }
img { max-width: 100%; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.p-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--primary); color: #fff; }
.p-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.p-brand img, .p-brand svg { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; background: #fff; object-fit: contain; }
.p-brand strong { display: block; font-family: var(--font-head); font-size: 1.02rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.p-brand small { color: #c7d2fe; font-size: .78rem; }
.p-nav { display: flex; align-items: center; gap: 8px; }
.p-lang { display: flex; background: rgba(255,255,255,.12); border-radius: 999px; padding: 2px; }
.p-lang a { color: #e0e7ff; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.p-lang a.on { background: var(--accent); color: var(--ink); }
.p-out { background: rgba(255,255,255,.14); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.p-main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.p-alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.p-alert-error { background: var(--bad-soft); color: #9f1239; }
.p-alert-success { background: var(--ok-soft); color: #065f46; }
.p-alert-info, .p-alert-warning { background: var(--accent-soft); color: #92400e; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; font: 700 1rem/1.2 var(--font-body); cursor: pointer; text-align: center; }
.btn:hover { background: var(--primary-2); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-ok { background: var(--ok); }
.btn-light { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-light:hover { background: var(--bg); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary-2); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--bad); font-size: .85rem; font-weight: 600; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.b-open { background: var(--ok-soft); color: #065f46; } .b-upcoming { background: var(--accent-soft); color: #92400e; }
.b-done { background: var(--primary-soft); color: var(--primary); } .b-closed { background: #f1f5f9; color: var(--muted); }
.b-in_progress { background: var(--flag-soft); color: var(--flag); }

/* Login */
.login-wrap { max-width: 420px; margin: 4vh auto 0; }
.login-art { text-align: center; margin-bottom: 10px; }
.login-art svg { width: 120px; height: auto; }

/* Dashboard */
.hello { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.hello .ph { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font: 800 1.6rem var(--font-head); flex-shrink: 0; }
.hello h1 { font-size: 1.4rem; margin: 0; }
.test-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.test-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--primary); color: var(--ink); }
.test-card.st-open, .test-card.st-in_progress { border-top-color: var(--ok); }
.test-card.st-upcoming { border-top-color: var(--accent); }
.test-card.st-closed { border-top-color: #cbd5e1; }
.test-card h3 { font-size: 1.12rem; margin: 0; }
.test-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--muted); }
.test-card .grow { flex: 1; }
.section-title { font-size: 1.15rem; margin: 22px 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.hist { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hist td, .hist th { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.hist th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }

/* Intro */
.rules { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.fact { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.fact b { display: block; font: 800 1.35rem var(--font-head); color: var(--primary); font-variant-numeric: tabular-nums; }
.fact span { font-size: .82rem; color: var(--muted); }

/* Player */
body.playing { background: #eef0f8; }
.player { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.p-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 12px; }
.p-bar .tt { font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font: 800 1.3rem var(--font-head); font-variant-numeric: tabular-nums; color: var(--primary); background: var(--primary-soft); padding: 2px 12px; border-radius: 10px; white-space: nowrap; }
.timer.low { color: #fff; background: var(--bad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .7; } }
.save-state { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.q-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .88rem; color: var(--muted); }
.q-text { font-size: 1.12rem; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 14px; }
.q-img { display: block; max-height: 320px; border-radius: 10px; margin: 0 0 14px; border: 1px solid var(--line); }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.opt:hover { border-color: #c7cdf5; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .letter { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #c7cdf5; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; color: var(--primary); }
.opt .ot { padding-top: 3px; overflow-wrap: anywhere; }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.opt.sel .letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.q-input { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: 1.05rem; }
textarea.q-input { min-height: 160px; resize: vertical; }
.q-nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 16px; flex-wrap: wrap; }
.q-nav .mid { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-flag.on { background: var(--flag); color: #fff; border-color: var(--flag); }
.palette { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 124px); }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 10px 0; }
.pal-grid button { height: 40px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pal-grid button.ans { background: var(--ok); border-color: var(--ok); color: #fff; }
.pal-grid button.flag { border-color: var(--flag); box-shadow: inset 0 0 0 2px var(--flag-soft); }
.pal-grid button.ans.flag { background: var(--flag); border-color: var(--flag); }
.pal-grid button.cur { outline: 3px solid var(--accent); outline-offset: 1px; }
.legend { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; border: 2px solid var(--line); }
.legend .l-ans { background: var(--ok); border-color: var(--ok); } .legend .l-flag { border-color: var(--flag); }
.warn-overlay { position: fixed; inset: 0; background: rgba(20,33,61,.7); display: grid; place-items: center; z-index: 100; padding: 16px; }
.warn-overlay[hidden] { display: none; }
.warn-box { background: #fff; border-radius: 18px; padding: 22px; max-width: 420px; text-align: center; }
.warn-box h2 { color: var(--bad); }
dialog.sheet { border: 0; border-radius: 18px; padding: 0; width: min(440px, 94vw); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
dialog.sheet::backdrop { background: rgba(20,33,61,.55); }
.sheet-body { padding: 20px; }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; text-align: center; }
.sum-grid div { background: var(--bg); border-radius: 12px; padding: 8px; }
.sum-grid b { display: block; font: 800 1.4rem var(--font-head); }

/* Result */
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--ring, var(--primary)) calc(var(--p) * 1%), var(--primary-soft) 0); display: grid; place-items: center; }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.ring b { font: 800 1.6rem/1 var(--font-head); font-variant-numeric: tabular-nums; }
.ring small { color: var(--muted); font-size: .78rem; }
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.stats4 div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.stats4 b { display: block; font: 800 1.25rem var(--font-head); font-variant-numeric: tabular-nums; }
.stats4 span { font-size: .78rem; color: var(--muted); }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-flag { color: var(--flag); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 44px; gap: 10px; align-items: center; font-size: .9rem; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.rv { border-inline-start: 4px solid var(--line); padding-block: 10px 10px; padding-inline: 14px 0; margin-bottom: 14px; }
.rv.right { border-color: var(--ok); } .rv.wrong { border-color: var(--bad); } .rv.pending { border-color: var(--accent); }
.rv .q-text { font-size: 1rem; margin-bottom: 6px; }
.rv-row { font-size: .92rem; } .rv-row b { font-weight: 700; }
.expl { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: .92rem; color: #78350f; }
.lb td:first-child { width: 44px; font-weight: 800; }
.lb tr.me td { background: var(--accent-soft); }

@media (max-width: 860px) {
  .player { grid-template-columns: minmax(0, 1fr); }
  .palette { position: static; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .stats4 { grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
}
@media (max-width: 480px) {
  .p-lang { display: none; }
  .q-nav .btn { flex: 1; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 80px 40px; }
  .p-bar .tt { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- App home (Play Store / installed app start page) ---------- */
.app-hero { padding: 6px 2px 14px; }
.app-hero h1 { font-size: 1.6rem; margin: 0 0 2px; }
.app-hero p { margin: 0; color: var(--muted); }
.app-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); color: var(--ink); min-height: 128px; position: relative; overflow: hidden; transition: transform .15s; }
.app-tile:active { transform: scale(.98); }
.app-tile .ai { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 6px; background: var(--primary); }
.app-tile .ai .icon { width: 22px; height: 22px; }
.app-tile strong { font-family: var(--font-head); font-size: 1.05rem; line-height: 1.2; }
.app-tile small { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.app-tile.t2 .ai { background: var(--ink); } .app-tile.t3 .ai { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent, #14213d); }
.app-tile.t4 .ai { background: #0e7490; } .app-tile.t5 .ai { background: #b45309; } .app-tile.t6 .ai { background: #059669; }
.app-contact { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.app-contact a { flex: 1; min-width: 100px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 11px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.app-notices h2 { font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.app-notices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.app-notices a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.app-notices .nd { display: block; font-size: .78rem; color: var(--muted); }
.app-foot { text-align: center; font-size: .8rem; color: var(--muted); margin: 18px 0 8px; }
.app-foot a { color: var(--muted); text-decoration: underline; }
@media (min-width: 720px) { .app-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- v1.6: practice, progress ---- */
.quick2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.qa { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; color: var(--ink); border: 1px solid var(--line); }
.qa .ic, .qa > svg { width: 30px; height: 30px; flex-shrink: 0; color: var(--primary); }
.qa strong { display: block; font-size: 1.02rem; }
.qa small { display: block; color: var(--muted); font-size: .84rem; }
.qa-go { background: var(--primary); color: #fff; border-color: var(--primary); }
.qa-go > svg, .qa-go small { color: rgba(255,255,255,.85); }
.practice-form fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.practice-form legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick > span { display: inline-flex; flex-direction: column; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; min-width: 120px; }
.pick.sm > span { flex-direction: row; gap: 6px; align-items: baseline; min-width: 0; padding: 6px 12px; border-radius: 999px; font-size: .92rem; }
.pick small { color: var(--muted); font-size: .8rem; }
.pick input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.subj-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); }
.subj-card span { font-size: .84rem; color: var(--muted); }
.subj-card.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.subj-card .chg.up { color: var(--ok); font-weight: 600; }
.subj-card .chg.down { color: var(--bad); font-weight: 600; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.m0 { margin: 0; }
.nowrap { white-space: nowrap; }

/* ---- v1.7: profile, timetable, syllabus, notifications ---- */
.prof-photo { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.prof-photo img, .prof-photo .ph-empty { width: 84px; height: 100px; border-radius: 12px; object-fit: cover; background: var(--primary-soft); display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.field textarea { resize: vertical; }
.field-error, .error { color: var(--bad); font-size: .85rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.today-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin: 14px 0; }
.today-card h2 { font-size: 1.05rem; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pd-list { list-style: none; margin: 0; padding: 0; }
.pd-list li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.pd-list li:first-child { border-top: 0; }
.pd-list .tm { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.pd-list .tm b { display: block; color: var(--ink); font-size: .95rem; }
.pd-list li.now { background: var(--primary-soft); border-radius: 10px; padding-inline-start: 8px; padding-inline-end: 8px; }
.pd-list li.past { opacity: .55; }
.pd-list li.brk { color: var(--muted); font-size: .88rem; }
.pd-sub { font-weight: 700; }
.pd-meta { font-size: .84rem; color: var(--muted); }
.prep { font-size: .86rem; margin-top: 3px; color: var(--ink-2); }
.prep b { color: var(--primary); }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 6px 0 10px; }
.day-tabs a { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; white-space: nowrap; background: #fff; }
.day-tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.syl-subj { margin-bottom: 12px; }
.syl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.syl-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 8px; }
.syl-bar span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.syl-list { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.syl-list li { display: flex; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line); }
.syl-list li .ck { width: 20px; flex-shrink: 0; color: var(--muted); }
.syl-list li.done .ck { color: var(--ok); }
.syl-list li.done .tt { color: var(--muted); }
.syl-list .unit { font-size: .78rem; color: var(--muted); display: block; }
.notif-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #fff7e6; border: 1px solid #fde3a7; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: .92rem; }
.notif-bar[hidden] { display: none; }
.update-toast { position: fixed; inset-inline-start:  50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 16px; display: flex; gap: 12px; align-items: center; z-index: 99; box-shadow: var(--shadow); font-size: .92rem; }
.update-toast button { background: var(--accent); color: var(--ink); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.quick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.quick3 a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 600; font-size: .88rem; text-align: center; }
.quick3 a svg { width: 24px; height: 24px; color: var(--primary); }
.prep svg, .today-card h2 svg { width: 15px; height: 15px; vertical-align: -2px; }
.today-card h2 > span:first-child { flex: 1; min-width: 0; }
.today-card h2 > a { white-space: nowrap; font-weight: 600; }
.pd-list li { grid-template-columns: 84px 1fr; }
.pd-list .tm b { white-space: nowrap; }

/* ---- v1.8: in-app help popup ---- */
.help-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--primary); background: #fff; color: var(--primary); font: 800 1.05rem/1 system-ui, sans-serif; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; }
.help-btn:hover, .help-btn:focus-visible { background: var(--primary); color: #fff; }
.help-btn-p { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.14); color: #fff; }
.help-btn.pulse { animation: helpPulse 1.6s ease-out 4; }
@keyframes helpPulse { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.75); } 100% { box-shadow: 0 0 0 14px rgba(245,158,11,0); } }
@media (prefers-reduced-motion: reduce) { .help-btn.pulse { animation: none; box-shadow: 0 0 0 3px var(--accent); } }
dialog.help-modal { border: 0; border-radius: 18px; padding: 0; width: min(760px, 96vw); max-height: 92vh; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); color: var(--ink); }
dialog.help-modal::backdrop { background: rgba(15,23,42,.55); }
.hm-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; background: var(--primary); }
.hm-langs { display: flex; gap: 6px; flex-wrap: wrap; }
.hm-langs button { border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .88rem; font-family: inherit; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; }
.hm-langs button[aria-selected="true"] { background: #fff; color: var(--primary); }
.hm-x { border: 0; background: transparent; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.hm-body { padding: 16px 20px 6px; }
.hm-body h2 { margin: 0 0 8px; font-size: 1.3rem; }
.hm-body h3 { margin: 14px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.hm-body p, .hm-body li { margin: 0; line-height: 1.55; font-size: .96rem; }
.hm-body ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.hm-flow p { background: var(--primary-soft); border-radius: 10px; padding: 8px 12px; }
.hm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 600px) { .hm-two { grid-template-columns: 1fr; } .hm-body { padding: 14px 14px 4px; } }
.hm-shot { margin: 12px 0 0; }
.hm-shot img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; min-height: 80px; background: #f3f4f8; }
.hm-shot figcaption { font-size: .78rem; color: var(--muted); margin-top: 4px; text-align: center; }
.hm-foot { padding: 10px 20px 16px; text-align: end; }
.hm-shot img { max-height: 58vh; object-fit: contain; }

/* ---- v1.11: dues & online payment, documents, leave ---- */
.pd { display: grid; gap: 16px; }
.pd-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 6px 18px rgba(20,33,61,.05); }
.pd-empty, .pd-note { display: flex; gap: 8px; align-items: center; color: var(--ink-2); margin: 10px 0 0; }
.pd-note.ok { color: #047857; font-weight: 700; }
.pd-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.pd-sub { color: #5b6475; font-size: .86rem; margin: 2px 0; }
.pd-h { margin: 0 0 10px; font-size: 1.05rem; display: flex; gap: 6px; align-items: center; }
.pd-bal { text-align: end; padding: 8px 14px; border-radius: 12px; background: #ecfdf5; color: #065f46; }
.pd-bal.due { background: #fff7ed; color: #9a3412; }
.pd-bal small { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pd-bal b { font-size: 1.45rem; }
.pd-table { overflow-x: auto; }
.pd-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pd-table th, .pd-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.pd-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6475; }
.pd-table .num { text-align: end; white-space: nowrap; }
.pd-table tfoot td { font-weight: 800; border-bottom: 0; }
.pd-pay { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.pd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-fields label span { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.pd-fields input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1.05rem; }
.pd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-chips button { border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.pd-go { font-size: 1.05rem; padding: 14px; }
.pd-secure { display: flex; gap: 6px; align-items: center; justify-content: center; }
.pd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.pd-steps { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.pd-steps li { display: flex; gap: 8px; align-items: center; color: #5b6475; }
.pd-steps li.done { color: #047857; font-weight: 700; }
.pd-steps li.now { color: var(--primary); font-weight: 800; }
.pd-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #f1f5f9; color: #334155; }
.pd-tag.ok { background: #ecfdf5; color: #065f46; } .pd-tag.wait { background: #fef3c7; color: #92400e; } .pd-tag.bad { background: #fff1f2; color: #9f1239; } .pd-tag.info { background: var(--primary-soft); color: var(--primary); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pd-doc { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.pd-doc h4 { margin: 0; font-size: 1rem; }
.pd-doc .pd-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.pd-form { display: grid; gap: 10px; }
.pd-form label > span { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.pd-form input, .pd-form select, .pd-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.pd-form textarea { min-height: 80px; }
.pd-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .pd-fields, .pd-2 { grid-template-columns: 1fr; } .hide-sm { display: none; } .pd-card { padding: 14px; } }
.back-link { display: inline-block; margin: 0 0 6px; font-weight: 700; }
.page-h { font-size: 1.45rem; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.quick-more { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important; margin-top: 10px; }

/* ---------- Notification bell (v1.13) ---------- */
.bell { position: relative; flex-shrink: 0; }
.bell-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.bell-btn .icon, .bell-fab .icon { width: 20px; height: 20px; }
.bell-btn:hover, .bell-btn:focus-visible, .bell-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.bell-portal .bell-btn { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.14); color: #fff; }
.bell-portal .bell-btn:hover, .bell-portal .bell-btn[aria-expanded="true"] { background: rgba(255,255,255,.26); color: #fff; }
.bell-badge { position: absolute; top: -5px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff; font: 700 11px/19px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-badge[hidden] { display: none; }
.has-unread .bell-btn .icon { animation: bellRing 2.4s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes bellRing { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(7deg); } 95% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .has-unread .bell-btn .icon { animation: none; } }
.bell-pop { position: absolute; inset-inline-end: -4px; top: calc(100% + 10px); width: min(380px, calc(100vw - 20px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px -12px rgba(15,23,42,.35); z-index: 60; overflow: hidden; text-align: start; }
.bell-pop[hidden] { display: none; }
.bell-pop.from-fab { position: fixed; top: auto; inset-inline-end: 12px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-head strong { display: flex; align-items: center; gap: 6px; font-size: 1rem; }
.bell-head strong .icon { width: 18px; height: 18px; color: var(--primary); }
.bell-link { border: 0; background: none; color: var(--primary); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.bell-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 14px; background: #fff4dc; color: #92400e; font-size: .86rem; border-bottom: 1px solid #fde68a; }
.bell-warn[hidden] { display: none; }
.bell-list { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.bell-empty { margin: 0; padding: 26px 16px; text-align: center; color: var(--muted); font-size: .92rem; }
.bell-item, .bell-toast { display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: #f8fafc; }
.bell-item.unread { background: var(--primary-soft); }
.bell-item.unread .bell-tx b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: 6px; border-radius: 50%; background: var(--primary); vertical-align: middle; }
.bell-ic { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #eef2ff; color: var(--primary); }
.bell-ic .icon { width: 18px; height: 18px; }
.k-attendance .bell-ic { background: #ffe4e6; color: #e11d48; }
.k-marks .bell-ic { background: #ede9fe; color: #7c3aed; }
.k-document .bell-ic, .k-fee .bell-ic { background: #d1fae5; color: #059669; }
.k-leave .bell-ic { background: #e0f2fe; color: #0284c7; }
.k-notice .bell-ic { background: #fff4dc; color: #d97706; }
.bell-tx { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.bell-tx b { font-size: .92rem; line-height: 1.3; }
.bell-tx span { color: var(--ink-2); font-size: .86rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-tx small { color: var(--muted); font-size: .76rem; }
.bell-all { display: block; padding: 11px 14px; text-align: center; font-weight: 600; font-size: .9rem; border-top: 1px solid var(--line); background: #fafbff; }
.bell-fab { position: fixed; inset-inline-end: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 55; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; box-shadow: 0 10px 26px -8px rgba(15,23,42,.5); display: grid; place-items: center; cursor: pointer; }
.bell-fab[hidden] { display: none; }
.bell-fab .bell-badge { top: -3px; inset-inline-end: -3px; }
.bell-toast { position: fixed; z-index: 70; inset-inline-start:  50%; top: calc(12px + env(safe-area-inset-top, 0px)); width: min(420px, calc(100vw - 20px)); transform: translate(-50%, -140%); transition: transform .35s ease; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px -12px rgba(15,23,42,.4); }
.bell-toast.show { transform: translate(-50%, 0); }
.bell-toast small { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .7rem; }
.bell-toast > button { border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 2px; }
@media (prefers-reduced-motion: reduce) { .bell-toast { transition: none; } }
@media print { .bell, .bell-fab, .bell-toast { display: none !important; } }
@media (max-width: 640px) { .bell-pop:not(.from-fab) { position: fixed; inset-inline-start: 10px; inset-inline-end: 10px; width: auto; top: calc(66px + env(safe-area-inset-top, 0px)); } .bell-pop.from-fab { inset-inline-start: 10px; inset-inline-end: 10px; width: auto; } }

/* notifications page + "recent notifications" card */
.ntf-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ntf-list .bell-item { padding: 13px 16px; }
.ntf-list .bell-tx span { -webkit-line-clamp: 4; }
.ntf-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.ntf-tools form { margin: 0; }
.ntf-more { text-align: center; margin: 14px 0; }
.ntf-card { margin: 16px 0; }
.ntf-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.ntf-card-head h2 { display: flex; align-items: center; gap: 7px; font-size: 1.08rem; margin: 0; }
.ntf-card-head h2 .icon { width: 19px; height: 19px; color: var(--primary); }
.ntf-card-head a { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.ntf-pill { white-space: nowrap; background: #ffe4e6; color: #be123c; border-radius: 999px; padding: 1px 9px; font: 700 .74rem/1.6 var(--font-body); }
.ntf-card .bell-empty .icon, .ntf-list .bell-empty .icon { width: 26px; height: 26px; opacity: .5; }
/* choose fee heads for an online payment (v1.16) */
.pd-h2 { margin: 4px 0 2px; font-size: 1rem; }
.pd-heads { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0 12px; }
.pd-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fff; cursor: text; }
.pd-head-row:last-child { border-bottom: 0; }
.pd-head-name { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.pd-head-name small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.pd-head-amt { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.pd-head-amt input { width: 118px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 1rem; text-align: end; color: var(--ink); }
.pd-head-amt input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.pd-head-amt input[readonly] { background: #f5f6fb; }
.pd-fields input[readonly] { background: #f5f6fb; font-weight: 700; }

.pd-receipt { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 11px 13px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; text-decoration: none; }
.pd-receipt > .icon { width: 22px; height: 22px; flex-shrink: 0; }
.pd-receipt span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pd-receipt small { color: #047857; font-size: .82rem; }

.remember-me { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: .95rem; }
[lang="ur"] { font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; }
