/* =========================================================
   Islamiyat Q1 – styles
   Colours live in :root so they are easy to change.
   ========================================================= */
:root {
  --bg: #f6f2e8;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --ink: #1d2b28;
  --ink-soft: #55635f;
  --line: #e6dfcf;
  --brand: #0b4f45;
  --brand-2: #127a69;
  --brand-soft: #e2f1ec;
  --gold: #c39a2b;
  --gold-soft: #f8efd4;
  --red: #b5452f;
  --red-soft: #fbe7e1;
  --green: #2f7d4f;
  --green-soft: #e3f3e8;
  --t1: #0f6b5c;   /* God in Himself */
  --t2: #1f6f95;   /* Relationship with creation */
  --t3: #a8781b;   /* Messengers */
  --shadow: 0 1px 2px rgba(20, 40, 35, .06), 0 6px 20px rgba(20, 40, 35, .07);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c1513;
  --surface: #13201d;
  --surface-2: #182824;
  --ink: #e9efe9;
  --ink-soft: #a3b3ad;
  --line: #24362f;
  --brand: #5cc4ae;
  --brand-2: #7fd8c4;
  --brand-soft: #173a33;
  --gold: #e2bd57;
  --gold-soft: #3a3016;
  --red: #f08f78;
  --red-soft: #3a1f19;
  --green: #79d39b;
  --green-soft: #173323;
  --t1: #5cc4ae;
  --t2: #6cb7e0;
  --t3: #e2bd57;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }
p { margin: 0 0 1em; }
main { max-width: 860px; margin: 0 auto; padding: 16px; outline: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 10px; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--ink-soft); font-size: .75rem; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: 12px; font-size: 1.1rem; cursor: pointer;
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; font-size: .72rem; font-weight: 600;
  text-decoration: none; color: var(--ink-soft);
}
.bottomnav a span { font-size: 1.25rem; filter: grayscale(1); opacity: .7; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active span { filter: none; opacity: 1; }

/* ---------- Hero with geometric pattern ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 28px 22px;
  color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.2'%3E%3Cpath d='M40 6 L50 30 L74 40 L50 50 L40 74 L30 50 L6 40 L30 30 Z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #06342d 0%, #0b4f45 45%, #127a69 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(226,189,87,.45), transparent 70%);
}
.hero .eyebrow { color: #f2d684; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; }
.hero h1 { color: #fff; margin: 6px 0 8px; }
.hero p { color: #d7ece6; max-width: 520px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats div {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; padding: 8px 14px; font-size: .85rem;
}
.hero-stats b { display: block; font-size: 1.3rem; font-family: var(--serif); color: #f2d684; }

/* ---------- Progress ring ---------- */
.progress-card { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; width: 74px; height: 74px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center; }
.ring span { width: 58px; height: 58px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; }

/* ---------- Cards & grids ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
  position: relative;
}
.tile:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.tile .ic { font-size: 1.5rem; }
.tile h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .9rem; }

.theme-band { border-left: 5px solid var(--tc, var(--brand)); }
.t1 { --tc: var(--t1); } .t2 { --tc: var(--t2); } .t3 { --tc: var(--t3); }
.theme-label { color: var(--tc); font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }

.passage-tile .ref { font-family: var(--serif); font-size: 1.5rem; color: var(--tc); line-height: 1; }
.passage-tile .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
}
.badge.ready { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.soon { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge.learned { background: var(--brand); color: #fff; border-color: transparent; }

/* ---------- Search & chips ---------- */
.search {
  width: 100%; padding: 13px 16px; border-radius: 14px; font: inherit;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.search:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Article (method & passage pages) ---------- */
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.page-head { margin-bottom: 14px; }
.lead { font-size: 1.05rem; color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 12px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; border-radius: 8px; padding: 2px 8px; color: #fff; }
.p4 { background: var(--green); } .p3 { background: var(--brand-2); } .p2 { background: var(--gold); } .p1 { background: var(--red); }

.callout { background: var(--brand-soft); border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.callout.warn { background: var(--gold-soft); border-color: var(--gold); }

.steps { padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 12px 10px 48px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

.starters li, .avoid li { margin-bottom: 6px; }
.starters { padding-left: 0; list-style: none; }
.starters li { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-style: italic; }
.avoid { padding-left: 0; list-style: none; }
.avoid li::before { content: "✕ "; color: var(--red); font-weight: 700; }

.formula { font-family: var(--serif); font-size: 1.15rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; text-align: center; box-shadow: var(--shadow); margin-bottom: 14px; }
.formula span { color: #fff; background: var(--brand); border-radius: 8px; padding: 0 8px; margin-right: 1px; }
.formula em { color: var(--gold); font-style: normal; margin: 0 6px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare > div { border-radius: 14px; padding: 12px; font-size: .92rem; }
.compare h4 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.compare p { margin: 0; }
.weak { background: var(--red-soft); color: var(--ink); }
.weak h4 { color: var(--red); }
.strong { background: var(--green-soft); }
.strong h4 { color: var(--green); }

.answer { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 14px; padding: 14px 16px; margin: 12px 0; }
.answer.b { border-left-color: var(--gold); }
.answer h3 { margin-top: 0; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 1px 6px; margin-right: 2px; vertical-align: 1px; }
.tag.gold { background: var(--gold-soft); color: var(--gold); }

/* ---------- Passage page ---------- */
.passage-hero { border-radius: 22px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 85%, #000) 0%, var(--tc) 100%); }
:root[data-theme="dark"] .passage-hero { color: #08130f; }
.passage-hero .ref { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.passage-hero .name { font-size: 1.05rem; opacity: .95; margin-top: 4px; }
.passage-hero .tl { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.passage-hero .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.passage-hero .badge { background: rgba(255,255,255,.18); color: inherit; border-color: rgba(255,255,255,.25); }

.quote { font-family: var(--serif); font-size: 1.08rem; line-height: 1.75; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 14px 0; position: relative; }
.quote::before { content: "“"; position: absolute; top: -14px; left: 12px; font-size: 3.4rem; color: var(--gold); line-height: 1; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; position: sticky; top: 61px; z-index: 5;
  background: var(--bg); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tab.on { background: var(--tc, var(--brand)); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .tab.on { color: #08130f; }

.point { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.point .num { width: 28px; height: 28px; border-radius: 9px; background: var(--tc); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
:root[data-theme="dark"] .point .num { color: #08130f; }
.point b { display: block; }
.point p { margin: 2px 0 0; color: var(--ink-soft); }
.point.hidden-ans p { filter: blur(6px); user-select: none; cursor: pointer; }
.point.hidden-ans p::after { content: ""; }

.kw { display: grid; gap: 8px; }
.kw div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kw b { color: var(--tc); display: block; }

.evidence li { background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; list-style: none; }
.evidence { padding: 0; }

.ready-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.ready-box h4 { display: flex; justify-content: space-between; align-items: center; font-family: var(--font); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tc); }
.copy { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .75rem; cursor: pointer; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme="dark"] .btn { color: #08130f; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
:root[data-theme="dark"] .btn.ghost { color: var(--ink); }   /* v246: ghost buttons were dark-on-dark in the dark theme */
.btn.gold { background: var(--gold); color: #1d1607; }

.soon-box { text-align: center; padding: 26px 18px; }
.soon-box .big { font-size: 2.4rem; }

/* ---------- Frequency chart ---------- */
.freq { display: grid; gap: 6px; margin: 14px 0; }
.freq-row { display: grid; grid-template-columns: 78px 1fr 24px; align-items: center; gap: 10px; font-size: .85rem; text-decoration: none; color: var(--ink); }
.freq-row .bar { height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; }
.freq-row .bar i { display: block; height: 100%; border-radius: 7px; background: var(--tc); }
.freq-row b { font-family: var(--serif); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tc); margin-right: 6px; }

/* ---------- Practice ---------- */
.flash { min-height: 260px; display: flex; flex-direction: column; justify-content: center; text-align: center; cursor: pointer; }
.flash .q { font-family: var(--serif); font-size: 1.35rem; }
.flash .a { margin-top: 14px; color: var(--ink-soft); }
.flash small { color: var(--ink-soft); margin-top: 14px; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem;
  transition: .25s ease; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .compare { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .topbar, .bottomnav, .tabs, .actions, #toast { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* ---------- Branding & footer ---------- */
.brand b em { font-style: normal; font-weight: 600; color: var(--gold); font-size: .85em; }
.site-footer {
  max-width: 860px; margin: 36px auto 0; padding: 22px 18px 18px;
  border-radius: 22px 22px 0 0; color: #e9f3ef;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.2'%3E%3Cpath d='M40 6 L50 30 L74 40 L50 50 L40 74 L30 50 L6 40 L30 30 Z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #06342d, #0b4f45);
}
.f-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.f-brand img { border-radius: 10px; }
.f-brand b { font-family: var(--serif); font-size: 1.25rem; color: #fff; }
.f-brand span { color: #f2d684; font-weight: 600; }
.f-brand small { display: block; color: #b9d6cd; font-size: .8rem; }
.f-locs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loc {
  display: flex; flex-direction: column; text-decoration: none; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 12px 14px; font-weight: 700; transition: background .15s;
}
.loc:hover { background: rgba(255,255,255,.16); }
.loc small { color: #f2d684; font-weight: 500; font-size: .78rem; margin-top: 2px; }
.f-copy { margin: 14px 0 0; font-size: .75rem; color: #9fc2b7; text-align: center; }
@media (max-width: 420px) { .f-locs { grid-template-columns: 1fr; } }

/* ---------- Answer pattern highlighting ---------- */
.pattern-btn { margin-bottom: 10px; }
.pattern-key { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pattern-key span { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.show-pattern .pattern-key { display: flex; }
.seg i { display: none; }
.show-pattern .seg { border-radius: 6px; padding: 1px 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.show-pattern .seg i {
  display: inline-block; font-style: normal; font-size: .62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; padding: 0 5px; margin-right: 4px;
  border-radius: 4px; color: #fff; vertical-align: 2px;
}
.seg-M { background: #e3e8f7; } .show-pattern .seg-M i, .pattern-key .seg-M { background: #3d55a8; color: #fff; }
.seg-T { background: #dff1ea; } .show-pattern .seg-T i, .pattern-key .seg-T { background: #0f6b5c; color: #fff; }
.seg-Q { background: #fbefcf; } .show-pattern .seg-Q i, .pattern-key .seg-Q { background: #a8781b; color: #fff; }
.seg-E { background: #e4eef8; } .show-pattern .seg-E i, .pattern-key .seg-E { background: #1f6f95; color: #fff; }
.seg-V { background: #f1e3f5; } .show-pattern .seg-V i, .pattern-key .seg-V { background: #7a3d8f; color: #fff; }
.seg-B { background: #fde5dc; } .show-pattern .seg-B i, .pattern-key .seg-B { background: #b5452f; color: #fff; }
.seg-A { background: #e3f3e8; } .show-pattern .seg-A i, .pattern-key .seg-A { background: #2f7d4f; color: #fff; }
.answers:not(.show-pattern) .seg { background: none; }
:root[data-theme="dark"] .show-pattern .seg { background: rgba(255,255,255,.07); }

/* ---------- Flashcards (one passage at a time) ---------- */
.fc-home { display: flex; align-items: center; gap: 14px; margin-top: 12px; text-decoration: none; color: var(--ink); }
.fc-home-ic { font-size: 1.8rem; width: 52px; height: 52px; border-radius: 14px; background: var(--gold-soft); display: grid; place-items: center; flex: none; }
.fc-home span { color: var(--ink-soft); font-size: .9rem; }
.fc-go { margin-left: auto; font-weight: 700; color: var(--brand) !important; white-space: nowrap; }
.mbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 10px; }
.mbar i { display: block; height: 100%; background: var(--tc, var(--brand)); border-radius: 3px; }
.mlabel { color: var(--ink-soft); font-size: .72rem; }

.fc-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.fc-picker select { flex: 1; min-width: 0; font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.fc-picker .icon-btn { font-size: 1.4rem; line-height: 1; flex: none; }
.fc-picker .icon-btn:disabled { opacity: .35; }

.fc-passage { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--tc); border-radius: 16px; padding: 14px 16px; }
.fc-ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fc-ph h3 { margin: 2px 0 0; font-size: 1.1rem; }
.fc-ptext { font-family: var(--serif); font-size: 1rem; line-height: 1.7; margin: 10px 0 0; max-height: 220px; overflow-y: auto; padding-right: 4px; }

.fc-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 16px 0 6px; }
.fc-progress i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .25s ease; }
.fc-count { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-soft); margin-bottom: 10px; }

/* the flip card */
.fc-scene { perspective: 1200px; }
.fc-flip { position: relative; min-height: 290px; transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; cursor: pointer; outline: none; display: grid; }
.fc-flip.is-flipped { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.fc-front { background: var(--surface); border-top: 6px solid var(--tc); }
.fc-back { background: var(--surface-2); border-top: 6px solid var(--gold); transform: rotateY(180deg); }
.fc-kind { align-self: flex-start; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--tc);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.fc-back .fc-kind { color: var(--gold); }
.fc-text { flex: 1; font-size: 1.08rem; line-height: 1.6; }
.fc-front .fc-text { font-family: var(--serif); font-size: 1.25rem; display: flex; flex-direction: column; justify-content: center; }
.fc-text blockquote { font-size: 1.05rem; margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; }
.fc-sub { margin: 12px 0 2px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.fc-hint { font-size: .78rem; color: var(--ink-soft); text-align: center; }
.lbl { display: inline-block; min-width: 20px; text-align: center; font-size: .7rem; font-weight: 800; color: #fff; border-radius: 5px; padding: 1px 5px; margin: 0 6px 4px 0; vertical-align: 2px; }
.lt { background: #0f6b5c; } .le { background: #1f6f95; } .lb { background: #b5452f; } .la { background: #2f7d4f; }

.fc-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 14px; }
.fc-controls .btn { justify-content: center; padding: 12px 10px; }
.fc-controls .btn:disabled { opacity: .4; cursor: default; }
.fc-help { color: var(--ink-soft); font-size: .8rem; text-align: center; margin-top: 10px; }

.fc-done-head { display: flex; gap: 12px; align-items: center; background: var(--green-soft); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.fc-done-head .big { font-size: 2rem; }
.fc-done-head span { color: var(--ink-soft); font-size: .9rem; }
.fc-done .fc-controls { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) {
  .fc-controls { grid-template-columns: 1fr 1fr; }
  .fc-controls #fcKnow { grid-column: 1 / -1; grid-row: 1; }
  .fc-done .fc-controls { grid-template-columns: 1fr 1fr; }
  .fc-done .fc-controls #fcNextPass, .fc-done .fc-controls a.btn { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .fc-flip { transition: none; } }

/* learn / test cards */
.fc-mode { font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; color: #fff; }
.fc-mode.learn { background: var(--brand-2); } .fc-mode.test { background: var(--gold); } .fc-mode.done { background: var(--green); }
.fc-learn { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--tc); border-radius: 20px;
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.fc-test { border-top-color: var(--gold); }
.fc-q2 { font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }
.fc-q2 blockquote { font-size: 1.02rem; margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; }
.fc-ans { background: var(--green-soft); border-radius: 14px; padding: 12px 14px 14px; line-height: 1.6; }
.fc-ans-l { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--green); margin-bottom: 4px; }
.fc-think { border: 2px dashed var(--line); border-radius: 14px; padding: 22px 14px; text-align: center; color: var(--ink-soft); font-style: italic; }
.fc-wide { width: 100%; justify-content: center; margin-top: 10px; }
.fc-wide small { opacity: .7; font-weight: 500; margin-left: 4px; }
.fc-controls.two { grid-template-columns: 1fr 1fr; }
.fc-controls.three { grid-template-columns: 1fr 1fr 1fr; }
.fc-learn + .fc-controls { grid-template-columns: 1fr 1fr; }
.fc-no { background: #b5452f; color: #fff !important; } .fc-yes { background: #2f7d4f; color: #fff !important; }
@media (max-width: 420px) { .fc-controls.three { grid-template-columns: 1fr 1fr; } .fc-controls.three > :last-child { grid-column: 1 / -1; } }

/* make the hidden attribute always win */
[hidden] { display: none !important; }

/* ---------- Subjects home ---------- */
.subject-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.subject-tile { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-left: 6px solid var(--sc, var(--brand)); }
.s-islamiyat { --sc: #0f6b5c; }
.s-physics { --sc: #3d55a8; }
.subj-ic { font-size: 2rem; width: 58px; height: 58px; flex: none; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--sc) 14%, var(--surface)); }
.subj-body { min-width: 0; }
.subj-body .theme-label { color: var(--sc); }
.subj-body h3 { font-size: 1.3rem; margin: 2px 0 4px; }
.muted-note { color: var(--ink-soft); font-size: .85rem; text-align: center; margin-top: 18px; }

/* ---------- Physics pages ---------- */
.hero-phy {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.2'%3E%3Cellipse cx='40' cy='40' rx='30' ry='11'/%3E%3Cellipse cx='40' cy='40' rx='30' ry='11' transform='rotate(60 40 40)'/%3E%3Cellipse cx='40' cy='40' rx='30' ry='11' transform='rotate(120 40 40)'/%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #1b2a5c 0%, #2f4596 50%, #3d6fb8 100%);
}
.phy-tile { border-left: 5px solid #3d55a8; }
.phy-tile .ref { font-family: var(--serif); font-size: 1.5rem; color: #3d55a8; line-height: 1; }
:root[data-theme="dark"] .phy-tile .ref, :root[data-theme="dark"] .phy-tile { color: inherit; border-left-color: #8ea3e8; }
:root[data-theme="dark"] .phy-tile .ref { color: #8ea3e8; }
.phy-hero { --tc: #3d55a8; }
.obj-list li b { color: #3d55a8; margin-right: 6px; }
:root[data-theme="dark"] .obj-list li b { color: #8ea3e8; }
.bottomnav { transition: none; }

/* =========================================================
   PLATFORM BRAND (Excellence) + PER-SUBJECT COLOURS
   Home, header, footer and login screens use the navy/gold
   brand. Each subject switches the colours when it is open
   (body[data-subject="..."] is set by app.js).
   ========================================================= */
:root {
  --brand: #1d2f6f; --brand-2: #2f4596; --brand-soft: #e7ebf7;
  --navy: #14213d; --navy-2: #22346b;
}
:root[data-theme="dark"] { --brand: #9fb0ea; --brand-2: #b9c6f0; --brand-soft: #1c2647; }

body[data-subject="islamiyat"] { --brand: #0b4f45; --brand-2: #127a69; --brand-soft: #e2f1ec; }
:root[data-theme="dark"] body[data-subject="islamiyat"] { --brand: #5cc4ae; --brand-2: #7fd8c4; --brand-soft: #173a33; }
body[data-subject="physics"] { --brand: #2f4596; --brand-2: #3d6fb8; --brand-soft: #e4eaf8; }
:root[data-theme="dark"] body[data-subject="physics"] { --brand: #8ea3e8; --brand-2: #a9bbf0; --brand-soft: #1c2647; }

/* Platform hero (home): navy with a subtle dot grid */
.hero {
  background:
    radial-gradient(rgba(255,255,255,.10) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    linear-gradient(135deg, #0f1a3a 0%, #1d2f6f 55%, #2f4596 100%);
}
.hero::after { background: radial-gradient(circle, rgba(226,189,87,.40), transparent 70%); }
/* Islamiyat keeps its green + Islamic star pattern */
.hero.hero-isl {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.2'%3E%3Cpath d='M40 6 L50 30 L74 40 L50 50 L40 74 L30 50 L6 40 L30 30 Z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #06342d 0%, #0b4f45 45%, #127a69 100%);
}
/* Footer in brand navy */
.site-footer {
  background:
    radial-gradient(rgba(255,255,255,.07) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
    linear-gradient(135deg, #0f1a3a, #1d2f6f);
}

/* ---------- New home ---------- */
.home-hero h1 { font-size: clamp(1.9rem, 5.5vw, 2.8rem); margin-bottom: 6px; }
.home-hero .wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; color: #fff; margin-bottom: 14px; }
.home-hero .wordmark img { width: 36px; height: 36px; border-radius: 10px; }
.home-hero .wordmark span { color: #f2d684; font-weight: 600; }
.home-hero p { max-width: 560px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.btn.light { background: #fff; color: #14213d; }
.btn.outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }

.subject-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.subject-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.subject-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20,33,61,.14); }
.subject-card .band { height: 92px; position: relative; display: flex; align-items: flex-end; padding: 0 18px 14px; color: #fff; }
.subject-card .band .code { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.subject-card .band .icon { position: absolute; right: 16px; bottom: -26px; width: 60px; height: 60px; border-radius: 18px;
  background: var(--surface); display: grid; place-items: center; font-size: 1.9rem; box-shadow: var(--shadow); }
.band-islamiyat { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='1.4'%3E%3Cpath d='M40 6 L50 30 L74 40 L50 50 L40 74 L30 50 L6 40 L30 30 Z'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #06342d, #127a69); }
.band-physics { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='1.4'%3E%3Cellipse cx='40' cy='40' rx='28' ry='10'/%3E%3Cellipse cx='40' cy='40' rx='28' ry='10' transform='rotate(60 40 40)'/%3E%3Cellipse cx='40' cy='40' rx='28' ry='10' transform='rotate(120 40 40)'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #1b2a5c, #3d6fb8); }
.subject-card .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.subject-card h3 { font-size: 1.35rem; margin: 0; }
.subject-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.subject-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.subject-card .open { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--brand); font-size: .9rem; }
.subject-card.is-soon .open { color: var(--ink-soft); }
/* coming-soon subjects (27 Oct 2026): greyed out, not clickable */
.band-soon { background: linear-gradient(135deg, #5b6474, #8a94a6); }
div.subject-card.is-soon { opacity: .78; cursor: default; }
div.subject-card.is-soon:hover { transform: none; box-shadow: var(--shadow); }
.prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--gold); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.how .n { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; margin-bottom: 8px; }
.how h4 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 4px; }
.how p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
@media (max-width: 640px) { .how { grid-template-columns: 1fr; } }

:root[data-theme="dark"] .btn.outline-light { color: #fff; }
:root[data-theme="dark"] .btn.light { color: #14213d; }

/* =========================================================
   ACCOUNTS (log in, sign up, my account)
   ========================================================= */
.top-actions { display: flex; gap: 8px; align-items: center; }
.account-btn { display: inline-grid; place-items: center; text-decoration: none; }
.account-btn.signed-in { background: var(--gold); color: #1d1607; border-color: var(--gold); font-weight: 800; font-family: var(--font); }
.btn.outline { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
:root[data-theme="dark"] .btn.outline { color: var(--brand); }
.btn.outline.danger { color: var(--red); border-color: var(--red); }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: progress; }
.callout.ok { background: var(--green-soft); border-color: var(--green); }

.auth-wrap { display: grid; place-items: start center; padding: 10px 0 20px; }
.auth-card { width: 100%; max-width: 440px; padding: 22px 20px; }
.auth-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.auth-head img { width: 46px; height: 46px; border-radius: 12px; }
.auth-head h2 { margin: 0; font-family: var(--serif); }
.auth-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: .9rem; }
.auth-form { display: grid; gap: 12px; }
.fld { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.fld input, .fld select, .code-row input {
  font: inherit; font-weight: 500; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; box-sizing: border-box; }
.fld input:focus, .fld select:focus, .code-row input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.role-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.role-pick label { cursor: pointer; }
.role-pick input { position: absolute; opacity: 0; pointer-events: none; }
.role-pick span { display: grid; place-items: center; gap: 2px; text-align: center; padding: 9px 4px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); font-size: .78rem; color: var(--ink); }
.role-pick span b { font-size: 1.3rem; }
.role-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.role-pick input:focus-visible + span { outline: 2px solid var(--brand-2); }
.auth-msg { padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.auth-msg.bad { background: var(--red-soft); color: var(--red); }
.auth-msg.ok { background: var(--green-soft); color: var(--green); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: .9rem; }
.auth-links a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-note { color: var(--ink-soft); font-size: .84rem; margin: 10px 0 0; }
.auth-done { text-align: center; padding: 8px 0; }
.auth-done .big { font-size: 2.6rem; }

.acct-top { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.acct-top h2 { margin: 0; font-family: var(--serif); }
.acct-top p { margin: 2px 0 6px; color: var(--ink-soft); font-size: .9rem; word-break: break-all; }
.avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 1.5rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .9rem; }
.acct-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.acct-row b { margin-right: auto; font-weight: 600; color: var(--ink-soft); }
.acct-box { border-top: 1px solid var(--line); padding: 12px 0; }
.acct-box h3 { margin: 0 0 4px; }
.acct-box p { margin: 0 0 10px; color: var(--ink-soft); font-size: .9rem; }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-row code { font-size: 1.25rem; letter-spacing: .15em; font-weight: 800; padding: 8px 12px; border-radius: 10px;
  background: var(--gold-soft); color: var(--ink); border: 1.5px dashed var(--gold); }
.code-row input { flex: 1; min-width: 150px; text-transform: uppercase; letter-spacing: .08em; }
.kids { display: grid; gap: 8px; margin-bottom: 10px; }
.kid { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.acct-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }

.acct-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 14px; margin-bottom: 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; }
.acct-strip span { margin-right: auto; }
.acct-strip a { color: var(--brand); font-weight: 700; text-decoration: none; }
.acct-strip.pending { background: var(--gold-soft); border-color: var(--gold); }
@media (max-width: 380px) { .role-pick { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   ADMIN PANEL
   ========================================================= */
.adm-hero h1 { margin: 6px 0 0; }
.adm-tabs { margin-top: 14px; }
.adm-tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px;
  border-radius: 10px; background: var(--gold); color: #1d1607; font-size: .75rem; font-weight: 800; }
.adm-list { display: grid; gap: 12px; }
.adm-card { padding: 14px 16px; }
.adm-who { display: flex; gap: 10px; align-items: center; }
.adm-who b { display: block; }
.adm-who small, .pinfo small { color: var(--ink-soft); font-size: .8rem; word-break: break-all; }
.adm-ask { margin: 10px 0; font-size: .9rem; }
.adm-ask em { color: var(--ink-soft); font-size: .8rem; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.adm-grid select[disabled] { opacity: .75; }
.adm-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.adm-tools .search { width: 100%; box-sizing: border-box; }
.adm-people { display: grid; gap: 8px; margin-top: 10px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.person.open { border-color: var(--brand); box-shadow: var(--shadow); }
.person-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px;
  align-items: center; padding: 10px 12px; cursor: pointer; }
.person-head[disabled] { cursor: default; }
.person-head:focus-visible { outline: 2px solid var(--brand-2); }
.pinfo { min-width: 0; } .pinfo b { display: block; }
.ptags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 4px; }
.chev { grid-row: 1; grid-column: 3; color: var(--ink-soft); }
.person-body { padding: 4px 12px 14px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.sub-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-tog input { position: absolute; opacity: 0; pointer-events: none; }
.sub-tog span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .85rem; cursor: pointer; }
.sub-tog input:checked + span { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.sub-tog input:checked + span::before { content: "✓ "; }
.sub-tog input:focus-visible + span { outline: 2px solid var(--brand-2); }
.sub-tog input:disabled + span { opacity: .6; }
.badge.ok-b { background: var(--green-soft); color: var(--green); }
.badge.bad-b { background: var(--red-soft); color: var(--red); }
.badge.wait-b { background: var(--gold-soft); color: var(--ink); }
.add-branch { border-style: dashed; }
#toast.bad { background: var(--red); color: #fff; }
.sub-tog, .role-pick label { position: relative; }
.sub-tog input, .role-pick input { left: 0; top: 0; width: 1px; height: 1px; margin: 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  font-size: 1.1rem; cursor: pointer; padding: 6px; border-radius: 8px; }
.pw-eye:focus-visible { outline: 2px solid var(--brand-2); }
.keep { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--ink); cursor: pointer; }
.keep input { width: 18px; height: 18px; accent-color: var(--brand); }
.avatar.cls { background: var(--gold-soft); font-size: 1rem; }
.made { text-align: center; }
.made .big { font-size: 2.4rem; }
.creds { text-align: left; white-space: pre-wrap; word-break: break-all; background: var(--surface-2); border: 1.5px dashed var(--gold);
  border-radius: 12px; padding: 12px; font-size: .9rem; font-family: ui-monospace, Consolas, monospace; margin: 10px 0 0; color: var(--ink); }
.made .adm-btns { justify-content: center; }

/* =========================================================
   PROGRESS REPORTS
   ========================================================= */
.rp-hero h1 { margin: 6px 0 2px; }
.rp-hero p { margin: 0; opacity: .85; }
.rp-sum { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-left: 4px solid var(--gold); }
.rp-sum p { margin: 0; line-height: 1.55; }
.rp-ico { font-size: 1.5rem; line-height: 1; }
.rp-list { padding: 6px 16px 12px; }
.rp-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(70px, 1fr) auto; gap: 6px 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.rp-name b { display: block; font-size: .95rem; }
.rp-name small, .rp-val small { color: var(--ink-soft); font-size: .78rem; }
.rp-val { text-align: right; display: grid; justify-items: end; gap: 2px; }
.rp-meter { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.rp-meter i { display: block; height: 100%; border-radius: 6px; background: var(--lv, var(--brand)); transition: width .6s; }
.lv-4 { --lv: #2f7d4f; } .lv-3 { --lv: #1f6f95; } .lv-2 { --lv: #c39a2b; } .lv-1 { --lv: #b8b0a0; }
:root[data-theme="dark"] .lv-4 { --lv: #79d39b; } :root[data-theme="dark"] .lv-3 { --lv: #6cb7e0; }
:root[data-theme="dark"] .lv-2 { --lv: #e2bd57; } :root[data-theme="dark"] .lv-1 { --lv: #5b6a65; }
.rp-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  color: var(--lv); background: color-mix(in srgb, var(--lv) 14%, transparent); }
.rp-key { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding-top: 10px; font-size: .78rem; color: var(--ink-soft); }
.rp-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 130px; }
.rp-day { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; }
.rp-day small { color: var(--ink-soft); font-size: .7rem; padding-top: 4px; }
.rp-bar { position: relative; border-radius: 6px 6px 2px 2px; background: var(--surface-2); }
.rp-bar i, .rp-bar b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px 6px 2px 2px; }
.rp-bar i { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.rp-bar b { background: var(--brand); left: 20%; right: 20%; }
.rp-legend { display: flex; gap: 14px; justify-content: center; font-size: .78rem; color: var(--ink-soft); margin-top: 8px; }
.rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.k-all { background: color-mix(in srgb, var(--brand) 25%, transparent); } .k-ok { background: var(--brand); }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.rp-tiles div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: .8rem; color: var(--ink-soft); }
.rp-tiles b { display: block; font-size: 1.3rem; color: var(--ink); font-family: var(--serif); }
.kid-link { text-decoration: none; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.kid-link .go { margin-left: auto; color: var(--brand); font-size: .85rem; font-weight: 700; }
.kid-name { color: var(--ink); text-decoration: none; } .kid-name:hover { color: var(--brand); }
@media (max-width: 520px) {
  .rp-row { grid-template-columns: 1fr auto; }
  .rp-meter { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  .site-footer, .back, .acct-strip, .rp-hero::before, .rp-hero::after { display: none !important; }
  .rp-hero { background: #fff !important; color: #000 !important; border: 1px solid #ccc; }
  .rp-hero .hero-stats div { background: #f3f3f3 !important; color: #000 !important; }
  .rp-hero .hero-stats b { color: #000 !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  .adm-btns { display: none !important; }
}

/* =========================================================
   TYPED ANSWERS + AUTOMATIC CHECK (flashcard test)
   ========================================================= */
.fc-type-l { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.fc-type { width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 12px 14px; resize: vertical; min-height: 84px; line-height: 1.5; }
.fc-type:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.fc-type.shake { animation: fcshake .35s; border-color: var(--red); }
@keyframes fcshake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.fc-result { margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid; }
.fc-result.pass { background: var(--green-soft); border-color: var(--green); }
.fc-result.fail { background: var(--red-soft); border-color: var(--red); }
.fc-result > b { display: block; font-size: 1rem; }
.fc-result.pass > b { color: var(--green); } .fc-result.fail > b { color: var(--red); }
.fc-result .ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.fc-result small { color: var(--ink-soft); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.idea { padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); }
.idea.ok { color: var(--green); border-color: var(--green); } .idea.no { color: var(--red); border-color: var(--red); }
.fc-result .yours { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .92rem; }
.fc-result .yours small { display: block; margin-bottom: 2px; }
.fc-test .fc-ans { margin-top: 12px; }
.fc-override { font-size: .9rem; }
.learn-status { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: .9rem;
  background: var(--surface-2); border: 1px dashed var(--line); color: var(--ink-soft); }
.learn-status.on { background: var(--gold-soft); border: 1px solid var(--gold); color: var(--ink); }
.rp-self { margin-top: 14px; }
@media (max-width: 520px) { .fc-controls .btn small, #fcCheck small, #fcYes small { display: none; } }

/* =========================================================
   HINTS, FULL ANSWER TEST, "I WAS RIGHT" REVIEWS
   ========================================================= */
.fc-result.shown { background: var(--surface-2); border-color: var(--line); }
.fc-result.shown > b { color: var(--ink-soft); }
.fc-result .hint { margin: 8px 0 0; font-size: .92rem; }
.fc-full textarea { min-height: 140px; }
.full-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.full-res h4 { margin: 0 0 6px; }
.full-res ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.full-res li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 8px 10px; border-radius: 12px; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); }
.full-res li.ok { border-color: var(--green); background: var(--green-soft); }
.full-res li.no { border-color: var(--red); background: var(--red-soft); }
.full-res li > span { font-weight: 800; } .full-res li.ok > span { color: var(--green); } .full-res li.no > span { color: var(--red); }
.full-res li small { display: block; color: var(--ink-soft); margin-top: 2px; }
.fc-controls.three { flex-wrap: wrap; }
.rv-list { display: grid; gap: 12px; }
.rv-item { padding: 14px 16px; }
.rv-head { font-size: .9rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.rv-head small { margin-left: auto; color: var(--ink-soft); }
.rv-q { margin: 8px 0; font-weight: 600; }
.rv-q blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 8px; font-weight: 500; }
.rv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.rv-cols > div { padding: 10px 12px; border-radius: 12px; font-size: .92rem; }
.rv-cols small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.rv-yours { background: var(--gold-soft); border: 1px solid var(--gold); }
.rv-model { background: var(--green-soft); }
.rv-yours .ideas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rv-done { opacity: .85; } .rv-msg { margin: 0; font-weight: 600; }
.nav-badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .7rem; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.bottomnav a { position: relative; }
.rp-more { margin-top: 4px; }
.rp-more > summary { cursor: pointer; list-style: none; padding: 10px 0 4px; color: var(--brand); font-weight: 700; font-size: .9rem; }
.rp-more > summary::-webkit-details-marker { display: none; }
.rp-more > summary::before { content: "▸ "; } .rp-more[open] > summary::before { content: "▾ "; }
.rp-fb { padding: 6px 16px 10px; }
.fb-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fb-row:last-child { border-bottom: 0; }
.fb-ico { font-size: 1.1rem; } .fb-row.rejected .fb-ico { color: var(--red); font-weight: 800; }
.fb-row b { display: block; } .fb-row.rejected b { color: var(--red); } .fb-row.accepted b { color: var(--green); }
.fb-row small { color: var(--ink-soft); font-size: .8rem; }
.fb-txt { margin: 4px 0 0; font-size: .9rem; color: var(--ink-soft); font-style: italic; }
.acct-strip.notice { background: var(--brand-soft); border-color: var(--brand); }

/* =========================================================
   PHYSICS – concepts, MCQs, grade
   ========================================================= */
body[data-subject="physics"] { --phy: #2f4fb5; --phy-soft: #e6ebfa; }
:root[data-theme="dark"] body[data-subject="physics"] { --phy: #8ea3e8; --phy-soft: #1c2747; }
.phy-gradecard { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 14px 16px; }
.phy-grade { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-family: var(--serif); font-size: 1.8rem; font-weight: 800; color: #fff; background: var(--phy); }
.phy-grade.g-none { background: var(--surface-2); color: var(--ink-soft); border: 2px dashed var(--line); }
.phy-grade.g-As { background: linear-gradient(135deg, #c39a2b, #e8c45a); color: #1d1607; }
.phy-grade.g-A { background: #2f7d4f; } .phy-grade.g-B { background: #1f6f95; } .phy-grade.g-C { background: #a8781b; } .phy-grade.g-U { background: #b5452f; }
.gc-body b { display: block; } .gc-body small { color: var(--ink-soft); font-size: .8rem; }
.dots { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-2); border: 1.5px solid var(--line); }
.dots i.ok { background: var(--green); border-color: var(--green); } .dots i.no { background: var(--red); border-color: var(--red); }
.phy-start { margin: 14px 0 4px; }
.phy-objs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.phy-obj { padding: 14px 16px; display: grid; gap: 6px; }
.po-head { display: flex; gap: 10px; align-items: flex-start; }
.po-head p { margin: 2px 0 0; font-size: .88rem; color: var(--ink-soft); }
.po-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--phy-soft, var(--brand-soft)); color: var(--phy, var(--brand)); font-weight: 800; font-size: .85rem; }
.po-btns { display: flex; gap: 8px; margin-top: 4px; }
.phy-step { margin: 6px 0 10px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--phy, var(--brand)); }
.phy-concept { padding: 18px 18px 14px; }
.phy-concept h2 { margin: 6px 0 2px; font-family: var(--serif); }
.phy-objline { margin: 0 0 12px; color: var(--ink-soft); font-size: .88rem; }
.phy-concept p, .phy-concept li { line-height: 1.6; }
.phy-ex { background: var(--phy-soft, var(--brand-soft)); padding: 8px 12px; border-radius: 10px; }
.phy-list { font-weight: 700; font-size: 1.02rem; background: var(--gold-soft); padding: 10px 12px; border-radius: 12px; text-align: center; }
.phy-t { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .9rem; }
.phy-t th, .phy-t td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.phy-t th { background: var(--surface-2); }
.phy-fig { margin: 12px 0; text-align: center; }
.phy-svg { width: 100%; max-width: 380px; height: auto; color: var(--ink); }
.phy-svg .sv-stk { stroke: currentColor; stroke-width: 1.4; fill: none; }
.phy-svg .sv-stk.sv-thin { stroke-width: 1; } .phy-svg .sv-stk.sv-thick { stroke-width: 2.4; } .phy-svg .sv-stk.sv-dash { stroke-dasharray: 4 4; opacity: .7; }
.phy-svg .sv-lbl { fill: currentColor; font: 600 12px var(--font); }
.phy-svg .sv-cap { fill: var(--ink-soft); font: 500 11px var(--font); }
.phy-svg .sv-fill-soft { fill: var(--surface-2); stroke: var(--line); }
.phy-svg .sv-fill-soft2 { fill: var(--phy-soft, var(--brand-soft)); stroke: var(--line); }
.phy-svg .sv-glass { fill: none; stroke: currentColor; stroke-width: 1.6; }
.phy-svg .sv-water { fill: #6cb7e0; opacity: .45; }
.phy-svg .sv-stone { fill: #8a7f72; }
.phy-svg .sv-block { fill: #c39a2b; opacity: .55; stroke: currentColor; stroke-width: 1; }
.phy-svg .sv-ball { fill: #b5452f; opacity: .75; } .phy-svg .sv-ball.sv-faint { opacity: .3; }
.phy-svg .sv-pencil { fill: #e2bd57; stroke: currentColor; stroke-width: 1.2; }
.phy-svg .sv-screen { fill: #0f1a14; } .phy-svg .sv-digits { fill: #79d39b; font: 700 30px ui-monospace, Consolas, monospace; }
.phy-svg .sv-vecl { stroke: currentColor; stroke-width: 2.4; } .phy-svg .sv-vecl.sv-res { stroke: var(--phy, #2f4fb5); stroke-dasharray: 7 5; }
.phy-svg .sv-ahead { fill: currentColor; } .phy-svg .sv-res-t { fill: var(--phy, #2f4fb5); }
.phy-q { padding: 16px; }
.phy-qmeta { font-size: .75rem; font-weight: 700; color: var(--ink-soft); letter-spacing: .05em; }
.phy-stem { margin: 6px 0 10px; font-size: 1.02rem; font-weight: 600; line-height: 1.5; }
.phy-opts { display: grid; gap: 8px; }
.phy-opt { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); line-height: 1.4; }
.phy-opt:hover:not([disabled]) { border-color: var(--phy, var(--brand)); }
.phy-opt:focus-visible { outline: 2px solid var(--brand-2); }
.phy-opt .ol { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--surface); border: 1.5px solid var(--line); }
.phy-opt.right { border-color: var(--green); background: var(--green-soft); } .phy-opt.right .ol { background: var(--green); color: #fff; border-color: var(--green); }
.phy-opt.wrong { border-color: var(--red); background: var(--red-soft); } .phy-opt.wrong .ol { background: var(--red); color: #fff; border-color: var(--red); }
.phy-opt.dim { opacity: .6; } .phy-opt[disabled] { cursor: default; }
.phy-tile.is-ready { border-left-color: var(--green) !important; }
.rp-phys { padding: 12px 16px; }
.rp-phy { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 6px 0; }
.rp-phy b { display: block; } .rp-phy small { color: var(--ink-soft); font-size: .82rem; }
.rp-obj { display: grid; grid-template-columns: 54px 1fr 40px; gap: 8px; align-items: center; font-size: .82rem; padding: 3px 0; }

/* =========================================================
   REPORT – one layout for every subject
   ========================================================= */
.rp-subjstats a { text-decoration: none; color: inherit; }
.rp-subjstats a, .rp-subjstats div { cursor: default; }
.rp-subjstats a { cursor: pointer; }
.rp-sum > div { min-width: 0; }
.rp-lead { margin: 0 0 6px; font-weight: 700; }
.rp-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rp-lines li { line-height: 1.5; }
.rp-subj { margin-top: 14px; padding: 0; overflow: hidden; }
.rp-subj > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.rp-subj > summary::-webkit-details-marker { display: none; }
.rs-ico { font-size: 1.4rem; }
.rs-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.rs-name small { font-family: var(--font); font-weight: 600; font-size: .78rem; color: var(--ink-soft); margin-left: 4px; }
.rs-head { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rs-chev { color: var(--ink-soft); transition: transform .2s; }
.rp-subj:not([open]) .rs-chev { transform: rotate(-90deg); }
.rs-body { padding: 0 16px 14px; border-top: 1px solid var(--line); }
.rp-group { margin-top: 12px; }
.rp-ghead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.rp-ghead h4 { margin: 0; font-size: .95rem; }
.rp-ghead span { font-size: .8rem; color: var(--ink-soft); }
.rp-subhead { font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin: 12px 0 6px; }
.rp-row.has-more { grid-template-areas: "n m v" "d d d"; }
.rp-rowmore { grid-column: 1 / -1; margin-top: 0; }
.rp-rowmore > summary { padding: 4px 0 0; font-size: .82rem; }
.rp-tag.lv-0 { --lv: var(--ink-soft); }
.rp-tag.lv-bad { --lv: var(--red); }
.rp-grade { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: .85rem; color: #fff; background: var(--phy, #2f4fb5); }
.rp-grade.g-none { background: var(--surface-2); color: var(--ink-soft); border: 1px dashed var(--line); }
.rp-grade.g-As { background: linear-gradient(135deg, #c39a2b, #e8c45a); color: #1d1607; }
.rp-grade.g-A { background: #2f7d4f; } .rp-grade.g-B { background: #1f6f95; } .rp-grade.g-C { background: #a8781b; } .rp-grade.g-U { background: #b5452f; }
.rp-key span { margin-left: 4px; }
.rp-bar.stack { display: flex; flex-direction: column-reverse; justify-content: flex-start; overflow: hidden; }
.rp-bar.stack i { position: static; display: block; width: 100%; border-radius: 0; flex: none; }
.rp-bar.stack i:last-child { border-radius: 6px 6px 0 0; }
.s-isl { background: #2f7d4f; } .s-phy { background: #2f4fb5; } .s-sq { background: #c39a2b; }
:root[data-theme="dark"] .s-isl { background: #79d39b; } :root[data-theme="dark"] .s-phy { background: #8ea3e8; } :root[data-theme="dark"] .s-sq { background: #e2bd57; }
.rp-legend-note { margin-left: auto; }
.rp-fb { padding: 0; }
.rp-filter { margin: 10px 0 2px; }
.fc-done-head.tone-good { background: var(--green-soft); }
.fc-done-head.tone-mid { background: var(--gold-soft); }
.fc-done-head.tone-low { background: var(--red-soft); }
.badge.lock { background: var(--surface-2); color: var(--ink-soft); }
.lock-box { text-align: center; padding: 22px 18px; margin-top: 12px; }
.lock-box .big { font-size: 2.2rem; }
@media print { .rp-subj > summary .rs-chev { display: none; } .rp-filter { display: none; } }
.rp-bar.stack i.s-isl { background: #2f7d4f; } .rp-bar.stack i.s-phy { background: #2f4fb5; } .rp-bar.stack i.s-sq { background: #c39a2b; }
:root[data-theme="dark"] .rp-bar.stack i.s-isl { background: #79d39b; } :root[data-theme="dark"] .rp-bar.stack i.s-phy { background: #8ea3e8; } :root[data-theme="dark"] .rp-bar.stack i.s-sq { background: #e2bd57; }
.rp-bar.stack i { left: auto; right: auto; bottom: auto; }
.hero-stats a { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 8px 14px; font-size: .85rem; color: inherit; text-decoration: none; }
.hero-stats a:hover { background: rgba(255,255,255,.2); }

/* ---------- motion graphs (Physics 1.2) ---------- */
.phy-svg .sv-grid { stroke: var(--line); stroke-width: 1; }
.phy-svg .sv-plot { stroke: var(--phy, #2f4fb5); stroke-width: 2.6; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.phy-svg .sv-area { fill: var(--phy, #2f4fb5); opacity: .16; }
.phy-svg .sv-dot { fill: var(--phy, #2f4fb5); }
.phy-svg .sv-lbl.sv-sm { font-size: 11px; font-weight: 500; }
.phy-svg .sv-force { stroke: #c0392b; stroke-width: 2.6; }
.phy-svg .sv-fhead { fill: #c0392b; }
:root[data-theme="dark"] .phy-svg .sv-force { stroke: #ff7a6b; } :root[data-theme="dark"] .phy-svg .sv-fhead { fill: #ff7a6b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phy-svg .sv-force { stroke: #ff7a6b; } :root:not([data-theme="light"]) .phy-svg .sv-fhead { fill: #ff7a6b; } }
.phy-group { margin: 22px 0 6px; font: 700 .8rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); grid-column: 1 / -1; }
.phy-svg .sv-base { stroke: var(--phy, #2f4fb5); stroke-width: 4; stroke-linecap: round; opacity: .7; }
.phy-svg .sv-sk-in { fill: #8a93a6; opacity: .55; }
.phy-svg .sv-sk-use { fill: #2e8b57; opacity: .7; }
.phy-svg .sv-sk-waste { fill: #d9822b; opacity: .6; }
.phy-svg .sv-merc { fill: #9aa3ad; }
.phy-svg .sv-jet { stroke: #3a8fc7; stroke-width: 4; fill: none; stroke-linecap: round; opacity: .8; }

.nuc { display: inline-flex; align-items: center; white-space: nowrap; }
.nuc-n { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: .68em; line-height: 1.05; margin-right: 1px; }
.nuc-n sup, .nuc-n sub { vertical-align: baseline; font-size: 1em; line-height: 1.05; position: static; }

/* ---------- Mathematics 4024 ---------- */
.band-maths { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.2' stroke-width='1.6'%3E%3Cpath d='M14 26h20M24 16v20M48 26h18M50 52l14 14M64 52L50 66M14 58h20'/%3E%3Ccircle cx='24' cy='52' r='1.6'/%3E%3Ccircle cx='24' cy='64' r='1.6'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #3a1d5c, #7a4bb8); }
.hero-math { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.4'%3E%3Cpath d='M14 26h20M24 16v20M48 26h18M50 52l14 14M64 52L50 66M14 58h20'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #3a1d5c 0%, #5b3191 50%, #7a4bb8 100%); color: #fff; }
.math-tile { border-left: 5px solid #6a3fa8; }
.math-tile .ref { font-family: var(--serif); font-size: 1.5rem; color: #6a3fa8; line-height: 1; }
.math-tile.is-ready { border-left-color: var(--green) !important; }
:root[data-theme="dark"] .math-tile { border-left-color: #b79ae6; }
:root[data-theme="dark"] .math-tile .ref { color: #b79ae6; }
.math-hero { background: linear-gradient(135deg, #3a1d5c, #7a4bb8); color: #fff; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.sec-card { --c1: #5b3191; --c2: #8a5cc8; display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 12px; border-radius: 16px; text-decoration: none; color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(255,255,255,.18), transparent 55%), linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px rgba(40,20,70,.18); transition: transform .15s ease, box-shadow .15s ease; }
.sec-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(40,20,70,.26); }
.sec-card .ic { font-size: 1.7rem; line-height: 1; margin-bottom: 4px; }
.sec-card .n { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.sec-card h4 { margin: 0; font-family: var(--serif); font-size: 1.08rem; line-height: 1.2; color: #fff; }
.sec-card small { font-size: .8rem; opacity: .9; }
.sec-card .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 6px; }
.sec-card .bar i { display: block; height: 100%; background: #f2d684; border-radius: 3px; }
.sec-card .g { font-size: .74rem; opacity: .85; }
.sec-1 { --c1: #3a1d5c; --c2: #7a4bb8; } .sec-2 { --c1: #1f3a93; --c2: #4a6fd1; } .sec-3 { --c1: #0e6655; --c2: #1abc9c; }
.sec-4 { --c1: #7b3f00; --c2: #d68910; } .sec-5 { --c1: #922b21; --c2: #e74c3c; } .sec-6 { --c1: #1b4f72; --c2: #2e86c1; }
.sec-7 { --c1: #4a235a; --c2: #a569bd; } .sec-8 { --c1: #145a32; --c2: #27ae60; } .sec-9 { --c1: #6e2c00; --c2: #ca6f1e; }
.psec-1 { --c1: #1b2f6b; --c2: #3d55a8; } .psec-2 { --c1: #922b21; --c2: #e67e22; } .psec-3 { --c1: #0b5a73; --c2: #1aa3c4; }
.psec-4 { --c1: #6b4c00; --c2: #d4a017; } .psec-5 { --c1: #1e5631; --c2: #3fa55b; } .psec-6 { --c1: #2c1a4d; --c2: #5b3fa8; }
body[data-subject="maths"] { --brand: #5b3191; --brand-2: #7a4bb8; --brand-soft: #efe8f8; --phy: #5b3191; --phy-soft: #efe8f8; }
:root[data-theme="dark"] body[data-subject="maths"] { --brand: #b79ae6; --brand-2: #cbb5ee; --brand-soft: #2a1f3d; --phy: #b79ae6; --phy-soft: #2a1f3d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-subject="maths"] { --brand: #b79ae6; --brand-2: #cbb5ee; --brand-soft: #2a1f3d; --phy: #b79ae6; --phy-soft: #2a1f3d; } }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .9em; line-height: 1.1; margin: 0 .12em; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .2em; }
.frac > span:last-child { padding: 0 .2em; }
.cvec { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.15; padding: .05em .4em; margin: 0 .15em; border-left: 1.6px solid currentColor; border-right: 1.6px solid currentColor; border-radius: .7em / 50%; }
.ovec { position: relative; display: inline-block; padding-top: .42em; line-height: 1; }
.ovec::before { content: ""; position: absolute; left: 1px; right: 3px; top: .14em; border-top: 1.5px solid currentColor; }
.ovec::after { content: ""; position: absolute; right: 1px; top: -.02em; border: .17em solid transparent; border-left: .34em solid currentColor; }
.rad { border-top: 1.5px solid currentColor; padding: 0 .12em; margin-left: -.05em; }
.rad-f { display: inline-block; vertical-align: middle; padding-top: .1em; }   /* v256b: root over a fraction – the line goes above the numerator, not through it */
.calc-tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.calc-tag.no { background: #fde9e2; color: #9a3412; }
.calc-tag.yes { background: #e2f3e8; color: #166534; }
:root[data-theme="dark"] .calc-tag.no { background: #3a2018; color: #fdba9b; }
:root[data-theme="dark"] .calc-tag.yes { background: #16301f; color: #9be3b3; }
.mth-answer { margin-top: 14px; }
.mth-answer label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.mth-row { display: flex; gap: 8px; }
.mth-row input { flex: 1; min-width: 0; font: 600 1.1rem var(--font); padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.mth-row input:focus { outline: none; border-color: var(--brand); }
.mth-row input:disabled { opacity: .8; }
.linkbtn { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; font: 500 .85rem var(--font); padding: 8px 0 0; cursor: pointer; }
/* E1 structured questions (shared stem, earlier parts with answers) and E3 picture options – v252 */
.mth-set { margin: 6px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); }
.mth-set-head { font-size: .75rem; font-weight: 800; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 4px; }
.mth-set-stem { font-size: 1rem; line-height: 1.5; }
.mth-prev { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .92rem; line-height: 1.45; }
.mth-prev-ans { margin-top: 2px; font-weight: 700; color: var(--ink-soft); font-size: .88rem; }
.mth-prev-ans .ok { color: var(--green); } .mth-prev-ans .no { color: var(--red); }
.mth-pt { margin-right: 4px; } .mth-ft { font-weight: 500; color: var(--ink-soft); }
.phy-opts.pics { grid-template-columns: 1fr 1fr; }
.phy-opt.pic { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; min-width: 0; }
.phy-opt.pic .ol { width: 26px; height: 26px; }
.phy-opt.pic .opt-fig { display: block; background: #fff; border-radius: 8px; padding: 2px; color: #1b1b1b; --ink: #1b1b1b; --surface: #fff; --line: #ddd; }   /* white card in both themes, so the picture keeps dark text */
.phy-opt.pic .opt-fig svg, .phy-opt.pic .opt-fig img { display: block; width: 100%; height: auto; max-height: 180px; }
.opt-right svg, .opt-right img { max-width: 220px; height: auto; }
.phy-opt.pic .phy-svg .sv-lbl { font-size: 16px; }   /* E3: a picture option is drawn at about half size – bigger labels keep axis numbers readable */
.phy-opt.pic .phy-svg .sv-lbl.sv-sm { font-size: 14px; }
.mth-img { max-width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 330px) { .phy-opts.pics { grid-template-columns: 1fr; } }
.mth-sol { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.mth-sol ol { margin: 6px 0 0; padding-left: 22px; }
.mth-sol li { margin: 3px 0; }
.math-concept .phy-ex { font-size: 1rem; }
.s-mth { background: #6a3fa8; } :root[data-theme="dark"] .s-mth { background: #b79ae6; }
.rp-bar.stack i.s-mth { background: #6a3fa8; } :root[data-theme="dark"] .rp-bar.stack i.s-mth { background: #b79ae6; }
.nw { white-space: nowrap; }
.rdot { position: relative; display: inline-block; }
.rdot::after { content: ""; position: absolute; left: 50%; top: .04em; width: .22em; height: .22em; margin-left: -.11em; border-radius: 50%; background: currentColor; }

/* install-the-app card on the home page */
.install-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; }
.install-card .ic { width: 48px; height: 48px; border-radius: 12px; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.install-card .ib { flex: 1; min-width: 0; }
.install-card p { margin: 4px 0 10px; font-size: .92rem; }
.install-card .ibtns { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line, #ccc); border-radius: 6px; font-size: .85em; }

/* admin: pick the child when creating a parent account */
.kid-pick { grid-column: 1 / -1; }
.kid-list { display: grid; gap: 6px; margin-top: 6px; }
.kid-opt { text-align: left; padding: 8px 10px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: var(--card, #fff); color: inherit; cursor: pointer; font: inherit; }
.kid-opt:hover { border-color: var(--accent, #3b4ea0); }
.kid-opt small, .kid-chip small { display: block; opacity: .75; margin-top: 2px; }
.kid-sel { display: grid; gap: 6px; margin: 8px 0 4px; }
.kid-chip { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(46, 160, 67, .1); border: 1px solid rgba(46, 160, 67, .35); }
.kid-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; }

/* continue where you left off */
.resume-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border-left: 4px solid var(--gold, #d4a017); }
.resume-card .rz-ic { font-size: 1.4rem; }
.resume-card .rz-b { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.resume-card .rz-b span { font-size: .9rem; opacity: .8; }
.resume-card .rz-btns { display: flex; gap: 12px; align-items: center; }

/* maths answer: live preview + on-screen maths keypad */
.mth-preview { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface2, rgba(120,120,160,.08)); font-size: 1.15rem; }
.mth-preview small { font-size: .78rem; opacity: .7; margin-right: 6px; }
.mth-preview sup.open, .mth-preview sub.open { color: var(--brand); }
.mth-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.mkp { margin-top: 10px; padding: 8px; border-radius: 16px; background: var(--surface2, #eef0f6); border: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
.mkp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mkp-bar { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr .8fr 1.6fr; gap: 6px; margin-top: 6px; }
.mk { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--ink); font: 600 1.05rem var(--font); cursor: pointer; touch-action: manipulation; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.mk:active { transform: translateY(1px); background: var(--line); }
.mk.op { background: color-mix(in srgb, var(--brand) 9%, var(--surface, #fff)); color: var(--brand); }
.mk.wide { font-size: .85rem; }
.mk.go { background: var(--brand); color: #fff; border-color: var(--brand); }
.mk .frac { font-size: .7rem; }
.mk sup, .mk sub { font-size: .65em; }
@media (min-width: 700px) { .mkp { max-width: 520px; } }

/* maths tables: letters stay as typed (x, not X) */
.math-concept .phy-t th, .phy-q .phy-t th { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); }

/* report summary (v136): strengths / needs attention / next steps */
.rp-ins { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.rp-ins-box { border-radius: 12px; padding: 10px 12px; border: 1px solid; }
.rp-ins-box h4 { margin: 0 0 6px; font-size: .92rem; }
.rp-ins-box.good { background: rgba(46, 160, 67, .08); border-color: rgba(46, 160, 67, .35); }
.rp-ins-box.bad { background: rgba(214, 90, 49, .08); border-color: rgba(214, 90, 49, .35); }
.rp-ins-box li small { display: block; opacity: .8; }
.rp-next { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(200, 160, 60, .12); line-height: 1.5; }
.rp-up { color: #2ea043; font-weight: 600; }
.rp-down { color: #d65a31; font-weight: 600; }
.rp-obj { grid-template-columns: minmax(90px, 1.4fr) 1fr 40px; }
.rp-obj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media print { .rp-ins-box, .rp-next { background: none !important; } }

/* v138 – provisional grade (fewer than 25 Mixed-test answers): dashed outline */
.phy-grade.is-prov, .rp-grade.is-prov { outline: 2px dashed var(--ink-soft, #667); outline-offset: 2px; }

/* v141 – inbox bell and messages (js/inbox.js) */
.inbox-btn { position: relative; display: inline-grid; place-items: center; text-decoration: none; }
.inbox-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #c0392b; color: #fff; font: 700 .7rem/19px var(--font, sans-serif); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.inbox-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 12px; color: var(--ink-soft); }
.inbox-msg { padding: 0; margin-bottom: 10px; overflow: hidden; }
.inbox-msg summary { list-style: none; display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.inbox-msg summary::-webkit-details-marker { display: none; }
.inbox-msg .im-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: transparent; }
.inbox-msg.unread .im-dot { background: #c0392b; }
.inbox-msg .im-head { display: grid; gap: 2px; }
.inbox-msg .im-head b { font-weight: 600; }
.inbox-msg.unread .im-head b { font-weight: 800; }
.inbox-msg .im-head small { color: var(--ink-soft); }
.inbox-msg .im-body { padding: 0 16px 14px 36px; }
.inbox-msg .im-body p { margin: 0 0 10px; line-height: 1.55; }

/* v143 – staff feedback box on the report (js/staff-messages.js) */
.sm-box { margin: 14px 0; }
.sm-box h3 { margin: 0 0 10px; }
.sm-box textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.sm-row { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.sm-row small:last-child { flex: none; color: var(--ink-soft); }
#smMsg.callout { margin-top: 10px; }
.sm-old { margin-top: 12px; }
.sm-old summary { cursor: pointer; font-weight: 600; }
.sm-hist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.sm-hist li { display: grid; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.sm-hist small { color: var(--ink-soft); }

/* v145 – "My students" overview (js/staff-overview.js) */
.ov-link { margin: 12px 0; }
.ov-meta { color: var(--ink-soft); margin: 4px 0 12px; }
.ov-chips { margin: 4px 0 8px; }
.ov-sec { padding: 0; margin-bottom: 12px; }
.ov-sec summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.ov-sec summary::-webkit-details-marker { display: none; }
.ov-sec .count { min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.ov-sec > p { margin: 0 16px 8px; }
.ov-list { list-style: none; margin: 0; padding: 0 16px 14px; display: grid; gap: 8px; }
.ov-list li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); line-height: 1.5; }
.ov-list small, .ov-br { color: var(--ink-soft); }
.ov-list a { color: inherit; }

/* v146 – staff tools (js/staff-tools.js) */
.st-sec .st-in { padding: 0 16px 14px; }
.st-sec textarea, .st-sec input[type=search], .st-lbl select, .st-lbl input { width: 100%; box-sizing: border-box; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; }
.st-lbl { display: block; margin: 8px 0; font-weight: 600; }
.st-people li, .st-recs li { display: grid; gap: 6px; }
.st-people li { grid-template-columns: 1fr auto; align-items: center; }
.st-people small, .st-recs small { color: var(--ink-soft); }
.st-danger { margin-top: 16px; padding: 14px 16px; }
.st-danger summary { cursor: pointer; font-weight: 700; color: #b5452f; }
#stMsg.callout, #stHistMsg.callout { margin-top: 10px; }

/* v147 – tasks (js/tasks.js) */
.tk-home { margin: 12px 0; padding: 14px 16px; }
.tk-head { display: flex; justify-content: space-between; align-items: center; }
.tk-head h3, .tk-report h3 { margin: 0 0 8px; }
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tk-list.card { padding: 12px; }
.tk-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.tk-item small { display: block; color: var(--ink-soft); margin: 2px 0 6px; }
.tk-item.tk-done { opacity: .8; }
.tk-item.tk-late b { color: #b5452f; }
.tk-report { margin: 14px 0; padding: 14px 16px; }
.tk-sub { margin: 16px 0 8px; }
.tk-staff details summary { cursor: pointer; display: grid; gap: 2px; }
.tk-staff small, .tk-who small { color: var(--ink-soft); }
.tk-who { list-style: none; padding: 6px 0; margin: 0; display: grid; gap: 4px; }

/* v150 – pause / reopen (js/staff-tools.js) */
.st-pause { margin-top: 16px; padding: 14px 16px; }
.st-pause summary { cursor: pointer; font-weight: 700; }
#stPaused li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
#stPauseMsg.callout { margin-top: 10px; }

/* v151 – phone notifications card (js/inbox.js) */
.inbox-phone { margin: 6px 0 14px; padding: 14px 16px; }
.inbox-phone p { margin: 6px 0 10px; }

/* ---------- Chemistry 5070 (piece C1, 27 Oct 2026) ---------- */
.band-chemistry { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.2' stroke-width='1.5'%3E%3Cpath d='M40 14 L62 27 L62 53 L40 66 L18 53 L18 27 Z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #7a2e0b, #d2691e); }
.hero-chem { color: #fff; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.3'%3E%3Cpath d='M40 14 L62 27 L62 53 L40 66 L18 53 L18 27 Z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #5c2208 0%, #9a3f12 50%, #d2691e 100%); }
.chem-tile { border-left: 5px solid #b4531a; }
.chem-tile .ref { font-family: var(--serif); font-size: 1.5rem; color: #b4531a; line-height: 1; }
.chem-tile.is-ready { border-left-color: var(--green) !important; }
:root[data-theme="dark"] .chem-tile { border-left-color: #f0a46a; }
:root[data-theme="dark"] .chem-tile .ref { color: #f0a46a; }
.chem-hero { --tc: #b4531a; }
.chem-objs li b { color: #b4531a; }
body[data-subject="chemistry"] { --brand: #9a3f12; --brand-2: #c4561c; --brand-soft: #fbeadf; --phy: #9a3f12; --phy-soft: #fbeadf; }
:root[data-theme="dark"] body[data-subject="chemistry"] { --brand: #f0a46a; --brand-2: #f5bd8f; --brand-soft: #3d2416; --phy: #f0a46a; --phy-soft: #3d2416; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-subject="chemistry"] { --brand: #f0a46a; --brand-2: #f5bd8f; --brand-soft: #3d2416; --phy: #f0a46a; --phy-soft: #3d2416; } }
.csec-1 { --c1: #0b5a73; --c2: #1aa3c4; } .csec-2 { --c1: #1b2f6b; --c2: #3d55a8; } .csec-3 { --c1: #4a235a; --c2: #a569bd; }
.csec-4 { --c1: #6b4c00; --c2: #d4a017; } .csec-5 { --c1: #922b21; --c2: #e67e22; } .csec-6 { --c1: #1e5631; --c2: #3fa55b; }
.csec-7 { --c1: #7a2e0b; --c2: #d2691e; } .csec-8 { --c1: #2c1a4d; --c2: #5b3fa8; } .csec-9 { --c1: #37474f; --c2: #78909c; }
.csec-10 { --c1: #145a32; --c2: #27ae60; } .csec-11 { --c1: #4e342e; --c2: #a1887f; } .csec-12 { --c1: #0e6655; --c2: #1abc9c; }
/* Chemistry concept tables on phones (audit 27 Oct): wide tables scroll inside the card instead of spilling out */
body[data-subject="chemistry"] .phy-concept .phy-t { display: block; overflow-x: auto; max-width: 100%; font-size: .8rem; }
body[data-subject="chemistry"] .phy-concept .phy-t th, body[data-subject="chemistry"] .phy-concept .phy-t td { padding: 5px 4px; }
body[data-subject="chemistry"] .phy-concept .phy-t th { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); }

/* C11: Chemistry colour in the report's activity chart */
.s-chm { background: #1f8a70; } :root[data-theme="dark"] .s-chm { background: #6fd3b5; }
.rp-bar.stack i.s-chm { background: #1f8a70; } :root[data-theme="dark"] .rp-bar.stack i.s-chm { background: #6fd3b5; }
.s-pak { background: #b5651d; } :root[data-theme="dark"] .s-pak { background: #e6a15c; }
.rp-bar.stack i.s-pak { background: #b5651d; } :root[data-theme="dark"] .rp-bar.stack i.s-pak { background: #e6a15c; }
.s-cs { background: #0a5560; } :root[data-theme="dark"] .s-cs { background: #5fd0d6; }
.rp-bar.stack i.s-cs { background: #0a5560; } :root[data-theme="dark"] .rp-bar.stack i.s-cs { background: #5fd0d6; }

/* ---------- Pakistan Studies 2059, exams up to 2027 (piece PS1, 28 Oct 2026) ---------- */
.pm-svg { max-width: 560px; }
.pm-sea { fill: #d6ebf7; }
.pm-land { fill: #ede8de; stroke: #a49a8a; stroke-width: .7; }
.pm-prov { stroke: #8a7f70; stroke-width: .8; stroke-dasharray: 5 2.5; }
.pm-border { fill: none; stroke: #3b3226; stroke-width: 1.6; }
.pm-loc { fill: none; stroke: #b5452f; stroke-width: 1.6; stroke-dasharray: 2 3; }
.pm-wb { fill: none; stroke: #b5452f; stroke-width: 1.6; stroke-dasharray: 7 3 2 3; }
.pm-river { fill: none; stroke: #2e86c1; stroke-width: 1.7; stroke-linecap: round; }
.pm-river.pm-hl { stroke: #0b5fa5; stroke-width: 3.2; }
.pm-range { fill: none; stroke: #9a6b3c; stroke-width: 9; stroke-linecap: round; opacity: .45; }
.pm-range.pm-hl { stroke: #c0392b; opacity: .55; }
.pm-range2 { fill: none; stroke: #6e4520; stroke-width: 1.4; stroke-dasharray: 1 4; stroke-linecap: round; }
.pm-area { stroke: #a8742a; stroke-width: .8; stroke-dasharray: 3 2; }
.pm-area.pm-hl { stroke: #c0392b; stroke-width: 2; }
.pm-grid { stroke: #2a6f97; stroke-width: .8; stroke-dasharray: 6 4; opacity: .8; }
.pm-tropic { stroke: #b5452f; }
.pm-city { fill: #1d2b28; stroke: #fff; stroke-width: 1.2; }
.pm-city.pm-hl { fill: #c0392b; }
.pm-t { fill: #1d2b28; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; stroke-linejoin: round; }
.pm-letter-bg { fill: #fff; stroke: #c0392b; stroke-width: 2; }
.pm-letter { fill: #c0392b; }
.pm-legend { fill: rgba(255,255,255,.88); stroke: #bbb; stroke-width: .8; }
.pm-hlline { stroke: #c0392b; stroke-width: 1.8; opacity: 1; }
:root[data-theme="dark"] .pm-svg { filter: brightness(.92); }
.band-pak27 { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.2' stroke-width='1.5'%3E%3Cpath d='M8 50 L22 30 L32 40 L46 18 L62 50 Z'/%3E%3Cpath d='M6 60 q12 -6 24 0 t28 0'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #01411c, #2e8b57); }
.hero-pak { color: #fff; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.3'%3E%3Cpath d='M8 50 L22 30 L32 40 L46 18 L62 50 Z'/%3E%3Cpath d='M6 60 q12 -6 24 0 t28 0'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #012a12 0%, #01411c 50%, #2e8b57 100%); }
.pak-tile { border-left: 5px solid #1d6b3c; }
.pak-tile .ref { font-family: var(--serif); font-size: 1.4rem; color: #1d6b3c; line-height: 1; }
.pak-tile.is-ready { border-left-color: var(--green) !important; }
:root[data-theme="dark"] .pak-tile { border-left-color: #7fd3a0; }
:root[data-theme="dark"] .pak-tile .ref { color: #7fd3a0; }
.pak-hero { --tc: #1d6b3c; }
body[data-subject="pak27"] { --brand: #01411c; --brand-2: #1d6b3c; --brand-soft: #e1f2e6; --phy: #01411c; --phy-soft: #e1f2e6; }
:root[data-theme="dark"] body[data-subject="pak27"] { --brand: #7fd3a0; --brand-2: #a6e3bd; --brand-soft: #173a26; --phy: #7fd3a0; --phy-soft: #173a26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-subject="pak27"] { --brand: #7fd3a0; --brand-2: #a6e3bd; --brand-soft: #173a26; --phy: #7fd3a0; --phy-soft: #173a26; } }
body[data-subject="pak27"] .phy-concept .phy-t { display: block; overflow-x: auto; max-width: 100%; font-size: .82rem; }
body[data-subject="pak27"] .phy-concept .phy-t th, body[data-subject="pak27"] .phy-concept .phy-t td { padding: 5px 5px; }
body[data-subject="pak27"] .phy-concept .phy-t th { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); }
.pk-version { border-left: 4px solid #c39a2b; }
/* tappable words */
.pk-term { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; border-bottom: 2px dotted #2e8b57; }
.pk-term:hover, .pk-term:focus { background: var(--brand-soft); outline: none; }
.pk-tip { position: absolute; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #2e8b57; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: .92rem; line-height: 1.45; }
.pk-tip b { display: block; margin-bottom: 2px; color: #1d6b3c; }
:root[data-theme="dark"] .pk-tip b { color: #7fd3a0; }
/* maps */
.pk-mapbox { cursor: zoom-in; position: relative; }
.pk-zoomhint { display: block; font-size: .75rem; color: var(--ink-soft); text-align: right; margin-top: 2px; }
.pk-mapzoom { position: fixed; inset: 0; z-index: 80; background: rgba(10, 20, 15, .88); display: flex; flex-direction: column; align-items: flex-end; padding: 10px; gap: 8px; }
.pk-mapzoom-in { flex: 1; width: 100%; overflow: auto; background: #fff; border-radius: 10px; -webkit-overflow-scrolling: touch; }
.pk-mapzoom-in svg { width: 220%; max-width: none; min-width: 700px; display: block; }
.pk-pic img { width: 100%; border-radius: 10px; display: block; }
figure.phy-fig figcaption { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; text-align: center; }
/* sub-topic home */
.pk-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.pk-step { display: block; text-decoration: none; color: inherit; padding: 12px 12px 12px 44px; position: relative; }
.pk-step b { display: block; font-size: 1rem; }
.pk-step small { color: var(--ink-soft); font-size: .8rem; }
.pk-step .pk-n { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.pk-step .mbar { margin-top: 6px; }
@media (max-width: 420px) { .pk-steps { grid-template-columns: 1fr; } }
/* flashcards */
.pk-card { min-height: 170px; padding: 18px; }
.pk-q { font-size: 1.1rem; line-height: 1.5; }
.pk-a { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); font-size: 1.02rem; line-height: 1.5; color: var(--ink); }
.pk-q .phy-fig, .pk-a .phy-fig { margin: 8px 0 0; }
/* notes */
.pk-wordbox { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); }
.pk-wordbox h4 { margin: 0 0 6px; }
.pk-wordbox dl { margin: 0; } .pk-wordbox dt { font-weight: 700; margin-top: 6px; } .pk-wordbox dd { margin: 0 0 0 0; font-size: .92rem; }
/* exam practice */
.pk-exlist { display: grid; gap: 8px; margin-top: 12px; }
.pk-exrow { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; text-decoration: none; color: inherit; padding: 10px 12px; }
.pk-exrow p { margin: 2px 0 0; font-size: .92rem; } .pk-exrow small { color: var(--ink-soft); }
.pk-marks { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.pk-marks.big { width: auto; height: auto; padding: 4px 10px; background: none; }
.pk-best { font-weight: 800; color: var(--brand); }
.pk-exhead { display: flex; justify-content: space-between; align-items: center; }
.pk-cmd { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.pk-stem { font-size: 1.05rem; line-height: 1.5; }
.pk-ans { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; font-size: 1rem; background: var(--surface); color: var(--ink); margin: 8px 0; }
.pk-ms { margin-top: 12px; border-top: 2px dashed var(--line); padding-top: 10px; }
.pk-ms h4 { margin: 0 0 8px; }
.pk-ticks { display: grid; gap: 6px; }
.pk-ticks label { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); line-height: 1.4; cursor: pointer; }
.pk-ticks input { margin-top: 3px; transform: scale(1.2); }
.pk-pair { display: grid; gap: 4px; }
.pk-pair .pk-dev { margin-left: 22px; }
.pk-guide.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; font-size: .9rem; }
.pk-guide ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 480px) { .pk-guide.two { grid-template-columns: 1fr; } }
.pk-score { margin: 10px 0; font-size: 1.1rem; }
.pk-model { margin-top: 12px; background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; }
.pk-model summary { font-weight: 700; cursor: pointer; }
.pk-model div { margin-top: 6px; line-height: 1.55; }
/* word list */
.pk-find { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; margin: 10px 0; background: var(--surface); color: var(--ink); }
.pk-words { padding: 6px 14px; }
.pk-w { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pk-w dt { font-weight: 700; } .pk-w dd { margin: 2px 0 0; font-size: .93rem; }
.pk-wcode { font-size: .72rem; font-weight: 700; color: var(--brand); text-decoration: none; margin-left: 6px; }
.pm-pass { fill: none; stroke: #5b2c0f; stroke-width: 2.2; stroke-linejoin: round; }
.pm-pass.pm-hl { stroke: #c0392b; stroke-width: 3; }
.pm-wind { fill: none; stroke-width: 3.2; stroke-linecap: round; opacity: .85; }
.pm-mons { stroke: #1f6fa8; } .pm-west { stroke: #a8742a; stroke-dasharray: 9 5; }
.pm-rain { fill: rgba(46, 134, 193, .35); stroke: #1f6fa8; stroke-width: 1.2; }

/* PS1d: flashcard ease of use – key hints only where there is a keyboard, touch tips only on touch screens */
body[data-subject="pak27"] .pk-tap { cursor: pointer; }
body[data-subject="pak27"] .pk-touch { display: none; }
@media (hover: none) and (pointer: coarse) { body[data-subject="pak27"] .pk-key { display: none; } body[data-subject="pak27"] .pk-touch { display: block; } }
/* PS2: dams and barrages on Pakistan maps */
.pm-dam { fill: #1f6fa8; stroke: #fff; stroke-width: .8; }
.pm-barrage { fill: #b5452f; stroke: #fff; stroke-width: .6; }
.pm-dam.pm-hl, .pm-barrage.pm-hl { stroke: #7a1f10; stroke-width: 1.6; }
/* PS-C1: Paper 2 practice (js/pak27-paper.js) */
.pq-part h3 { margin: 0 0 8px; } .pq-part h3 small { color: var(--ink-soft); font-weight: 600; }
.pq-item { border-top: 1px solid var(--line); padding: 12px 0; } .pq-item:first-of-type { border-top: 0; }
.pq-stem { font-size: 1.02rem; line-height: 1.5; margin-bottom: 8px; } .pq-stem .pk-marks { display: inline-grid; width: auto; height: auto; padding: 1px 8px; font-size: .8rem; margin-left: 4px; }
.pq-field { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .pq-field > span { min-width: 26px; font-weight: 800; color: var(--brand); } .pq-field em { font-style: normal; color: var(--ink-soft); }
.pq-field.pq-wide { align-items: flex-start; } .pq-field.pq-wide .pk-ans { margin: 0; }
.pq-in { flex: 1; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 1rem; background: var(--surface); color: var(--ink); min-width: 0; }
.pq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pq-chip { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .95rem; cursor: pointer; text-align: left; line-height: 1.3; }
.pq-chip.is-sel { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; } .pq-chip.is-used { opacity: .4; }
.pq-blank { border: 0; border-bottom: 2px dashed var(--brand); background: var(--brand-soft); color: var(--ink); padding: 1px 10px; font: inherit; font-weight: 700; cursor: pointer; border-radius: 6px 6px 0 0; min-width: 70px; }
.pq-cloze { line-height: 2.1; } .pq-bank small { color: var(--ink-soft); }
.pq-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 3px; } .pq-list .ok { color: var(--green); } .pq-list .no { color: var(--red); } .pq-list .muted { color: var(--ink-soft); }
.pq-fb { margin-top: 8px; } .pq-fb-in { border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; background: var(--surface-2); }
.pq-fb-in.ok { background: var(--green-soft); } .pq-fb-in.part { background: var(--gold-soft); } .pq-fb-in.no { background: var(--red-soft); }
.pq-dispute { margin-top: 8px; } .pq-parttot { margin: 12px 0 6px; font-size: 1.05rem; } .pq-end h3 { margin-top: 0; }
.pq-grid { width: 100%; border-collapse: collapse; } .pq-grid th, .pq-grid td { border: 1px solid var(--line); padding: 8px 6px; text-align: center; } .pq-grid td:first-child { text-align: left; }
.pq-grid input { transform: scale(1.3); }
.pq-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .pq-match .pq-chip { display: block; width: 100%; border-radius: 12px; margin-bottom: 8px; }
.pq-badge { color: var(--brand); margin-left: 6px; } .pq-letter { color: var(--brand); margin-right: 4px; }
@media (max-width: 480px) { .pq-match { grid-template-columns: 1fr; } }
.pq-steps { display: grid; gap: 6px; margin: 8px 0; } .pq-step { display: flex; align-items: center; gap: 8px; } .pq-step span { flex: 1; font-weight: 600; }
.pq-step button { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1.3rem; cursor: pointer; } .pq-step .pq-val { min-width: 90px; text-align: center; }
.pq-tblwrap { overflow-x: auto; margin: 8px 0; } .pq-tbl { width: 100%; } .pq-tbl caption { text-align: left; font-weight: 700; padding: 4px 0; } .pq-tbl .pq-num { text-align: right; white-space: nowrap; } .pq-sub { margin: 10px 0 2px; } .pq-src { display: block; color: var(--ink-soft); margin-top: 4px; }
.pq-item .pf-fig { touch-action: manipulation; cursor: crosshair; } .pq-item .pf-slot { cursor: pointer; }
/* PS-C3b: exam practice – line breaks in question text, warnings */
.pk-stem, .pq-stem, body[data-subject="pak27"] .phy-stem { white-space: pre-line; }
.pq-warn { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; margin: 8px 0; } .linkbtn { background: none; border: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.phy-t.pk-wrap { table-layout: fixed; width: 100%; } .phy-t.pk-wrap td, .phy-t.pk-wrap th { overflow-wrap: anywhere; hyphens: auto; }   /* long three-column notes tables fit a phone */

/* ========== Computer Science 2210 Paper 1 (piece CS1) ========== */
body[data-subject="cs2210"] { --brand: #0a5560; --brand-2: #12a0a8; --brand-soft: #def3f3; --phy: #0a5560; --phy-soft: #def3f3; }
:root[data-theme="dark"] body[data-subject="cs2210"] { --brand: #6fd3d6; --brand-2: #9be3e5; --brand-soft: #113a3d; --phy: #6fd3d6; --phy-soft: #113a3d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-subject="cs2210"] { --brand: #6fd3d6; --brand-2: #9be3e5; --brand-soft: #113a3d; --phy: #6fd3d6; --phy-soft: #113a3d; } }
.band-cs2210 { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.2' stroke-width='1.5'%3E%3Crect x='10' y='14' width='22' height='16' rx='3'/%3E%3Cpath d='M36 22 h14 M36 28 h10 M14 44 h8 v8 h8 M40 44 h16 M44 52 h12'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #04353b, #12a0a8); }
.hero-cs { color: #fff; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1.3'%3E%3Crect x='10' y='14' width='22' height='16' rx='3'/%3E%3Cpath d='M36 22 h14 M36 28 h10 M14 44 h8 v8 h8 M40 44 h16 M44 52 h12'/%3E%3C/g%3E%3C/svg%3E"),
  linear-gradient(135deg, #032a2f 0%, #0a5560 50%, #12a0a8 100%); }
.cs-tile { border-left: 5px solid #0a5560; }
.cs-tile .ref { font-family: var(--serif); font-size: 1.4rem; color: #0a5560; line-height: 1; }
.cs-tile.is-ready { border-left-color: var(--green) !important; }
:root[data-theme="dark"] .cs-tile { border-left-color: #6fd3d6; } :root[data-theme="dark"] .cs-tile .ref { color: #6fd3d6; }
.cs-hero { --tc: #0a5560; }
.cs-version { border-left: 4px solid #c39a2b; }
body[data-subject="cs2210"] .phy-concept .phy-t { display: block; overflow-x: auto; max-width: 100%; font-size: .82rem; }
body[data-subject="cs2210"] .phy-concept .phy-t th, body[data-subject="cs2210"] .phy-concept .phy-t td { padding: 5px 5px; }
body[data-subject="cs2210"] .phy-concept .phy-t th { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); }
body[data-subject="cs2210"] .pk-touch { display: none; }
@media (hover: none) and (pointer: coarse) { body[data-subject="cs2210"] .pk-touch { display: block; } body[data-subject="cs2210"] .pk-key { display: none; } }
/* tappable words (own classes so they never clash with Pakistan Studies) */
.cs-term { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; border-bottom: 2px dotted #12a0a8; }
.cs-term:hover, .cs-term:focus { background: var(--brand-soft); outline: none; }
.cs-tip { position: absolute; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #12a0a8; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: .92rem; line-height: 1.45; }
.cs-tip b { display: block; margin-bottom: 2px; color: #0a5560; } :root[data-theme="dark"] .cs-tip b { color: #6fd3d6; }
.cs-figure svg { width: 100%; height: auto; max-width: 560px; margin: 0 auto; display: block; }
/* number questions */
.cs-big { font: 700 1.5rem ui-monospace, Consolas, Menlo, monospace; letter-spacing: .06em; margin: 8px 0 2px; color: var(--brand); }
.cs-input { margin: 12px 0 4px; }
.cs-bits { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 6px 0; }
.cs-nib { display: flex; gap: 3px; flex-wrap: nowrap; }
.cs-bit { width: 34px; height: 44px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface-2, #f4f4f4); color: var(--ink); font: 700 1.25rem ui-monospace, Consolas, Menlo, monospace; cursor: pointer; padding: 0; touch-action: manipulation; }
.cs-bit:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 1px; }
.cs-bit.is-1 { background: var(--brand-soft); border-color: var(--brand); } .cs-bit.is-0 { background: var(--surface); border-color: var(--ink-soft); }
.cs-bit:disabled { cursor: default; opacity: .85; }
.cs-text input { font: 700 1.2rem ui-monospace, Consolas, Menlo, monospace; letter-spacing: .05em; }
.cs-hint { margin: 4px 0 0; }
.cs-addgrid { display: grid; grid-template-columns: 52px repeat(9, minmax(0, 1fr)); gap: 4px; max-width: 440px; align-items: center; margin: 6px 0; }
.cs-addgrid .cs-bit { width: 100%; height: 38px; border-radius: 6px; font-size: 1.05rem; }
.cs-addgrid .cs-carry { height: 30px; border-color: #c0392b; font-size: .95rem; color: #c0392b; background: transparent; border-style: dashed; }
.cs-addgrid .cs-carry.is-1 { background: #fdecea; border-style: solid; }
.cs-dg { text-align: center; font: 700 1.25rem ui-monospace, Consolas, Menlo, monospace; }
.cs-lab { font-size: .72rem; color: var(--ink-soft); } .cs-plus { font: 700 1.3rem ui-monospace, monospace; color: var(--ink); text-align: right; padding-right: 6px; }
.cs-rule { grid-column: 1 / -1; border-top: 2px solid var(--ink); margin: 2px 0; }
.cs-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.cs-kind { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .82rem; }
.cs-kind.on { background: var(--brand); border-color: var(--brand); color: #fff; } .cs-kind small { opacity: .75; }
.cs-sess { font-size: .9rem; color: var(--ink-soft); margin: 4px 0 10px; }
@media (max-width: 380px) { .cs-bit { width: 31px; height: 42px; } }
body[data-subject="cs2210"] .pk-tap { cursor: pointer; }
body[data-subject="cs2210"] .phy-stem { white-space: pre-line; }
body[data-subject="cs2210"] .card, body[data-subject="cs2210"] .phy-stem, body[data-subject="cs2210"] .phy-opt { overflow-wrap: anywhere; }   /* long strings (IPv6, MAC, binary) never push the page wider than the phone */
/* Computer Science 2210 – structured questions (piece CS10) */
.cs-st-part { margin: 14px 0; padding-top: 10px; border-top: 1px dashed var(--line, #cfd8dc); }
.cs-st-part:first-of-type { border-top: 0; padding-top: 0; }
.cs-st-q { margin: 0 0 8px; line-height: 1.5; }
.cs-st-ticks { display: grid; gap: 6px; }
.cs-st-tick { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1.5px solid var(--line, #cfd8dc); border-radius: 12px; cursor: pointer; background: #fff; }
.cs-st-tick input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.cs-st-sel { min-height: 40px; padding: 6px 8px; border: 1.5px solid var(--line, #b0bec5); border-radius: 10px; font: inherit; background: #fff; max-width: 100%; }
.cs-st-box { background: #e6f4f5; border: 1.5px solid #12a0a8; border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; line-height: 2; }
.cs-st-box small { display: block; font-weight: 800; color: #0a5560; line-height: 1.2; }
.cs-st-w { display: inline-block; padding: 1px 9px; margin: 2px 2px; background: #fff; border: 1px solid #12a0a8; border-radius: 8px; }
.cs-st-gaps { line-height: 2.4; }
.cs-st-match { display: grid; gap: 8px; }
.cs-st-mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1.5px solid var(--line, #cfd8dc); border-radius: 12px; background: #fff; }
.cs-st-mrow > span { flex: 1 1 55%; min-width: 0; }
.cs-st-mrow .cs-st-sel { flex: 1 1 40%; }
.cs-st-scroll { overflow-x: auto; }
.cs-st-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.cs-st-table th, .cs-st-table td { border: 1.5px solid #12a0a8; padding: 6px 8px; text-align: left; vertical-align: middle; }
.cs-st-table th { background: #e6f4f5; color: #0a5560; }
.cs-st-cell { width: 100%; min-width: 90px; min-height: 40px; padding: 6px 8px; border: 1.5px solid var(--line, #b0bec5); border-radius: 8px; font: inherit; box-sizing: border-box; }
.cs-st-fb { margin: 10px 0; }
body[data-subject="cs2210"] .cs-st-part, body[data-subject="cs2210"] .cs-st-fb { overflow-wrap: anywhere; }
.cs-st-key { margin: 0 0 6px; padding-left: 26px; line-height: 1.5; } .cs-st-key li { margin: 3px 0; padding-left: 4px; } .cs-st-key li::marker { font-weight: 800; color: #0a5560; }
.cs-st-mrow .cs-st-sel { flex: 0 0 auto; min-width: 70px; }
.cs-st-sel { max-width: 100%; box-sizing: border-box; }
/* CS (v211): three nibbles (12 bits) stay on ONE line on a phone: the boxes shrink to fit; the typed-answer box is full width under its label */
.cs-bits { flex-wrap: nowrap; gap: 8px 10px; }
.cs-nib { flex: 0 1 auto; min-width: 0; }
.cs-nib .cs-bit { width: auto; flex: 0 1 34px; min-width: 0; }
@media (max-width: 380px) { .cs-nib .cs-bit { flex-basis: 31px; } }
.pq-field.cs-text { flex-direction: column; align-items: stretch; gap: 6px; }
.pq-field.cs-text > span { min-width: 0; }
.cs-text input.cs-in { width: 100%; min-height: 50px; padding: 10px 12px; flex: none; }

/* ===== TA3: sub-topic picker (admin → People → opened student) ===== */
.tp-wrap { display: grid; gap: 8px; }
.tp-title b { display: block; }
.tp-title small, .tp-help { color: var(--ink-soft); font-size: .85rem; line-height: 1.35; }
.tp-help { margin: 0 0 4px; }
.tp-subj { border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.tp-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 8px 12px; cursor: pointer; }
.tp-head b { display: block; font-size: .95rem; }
.tp-head small { display: block; color: var(--ink-soft); font-size: .8rem; }
.tp-head.has small { color: var(--green); font-weight: 600; }
.tp-head:focus-visible, .tp-sechead:focus-visible { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.tp-head.tp-off { cursor: default; opacity: .8; display: block; }
.tp-chev { color: var(--ink-soft); }
.tp-panel { padding: 4px 10px 12px; display: grid; gap: 6px; border-top: 1px dashed var(--line); }
.tp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tp-count { font-weight: 700; font-size: .9rem; color: var(--brand); }
.tp-sec { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tp-sechead { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 46px; padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.tp-sechead small { color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.tp-secbtns { display: flex; gap: 8px; padding: 0 10px 6px; }
.tp-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: .95rem; line-height: 1.3; }
.tp-row input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--green); margin: 0; }
.tp-row b { color: var(--brand); margin-right: 4px; }
.tp-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tp-badge { background: var(--green-soft); color: var(--green); }

/* ===== TA5: partly-open subjects, student view ===== */
.tp5-banner { margin: 10px 0; font-size: .92rem; line-height: 1.4; }
.tp5-mark { margin-left: 6px; margin-top: 4px; }
.tp5-open { background: var(--green-soft); color: var(--green); }
.tp5-lock { background: var(--gold-soft); color: var(--ink); }
.tp5-acct p { margin: 6px 0; } .tp5-acct small { color: var(--ink-soft); }

/* ===== TA10: class sub-topic picker (Admin → Classes) ===== */
.tp-cwrap .tp-limit{background:var(--card-2,rgba(0,0,0,.04));border-radius:12px;padding:8px 10px;margin:8px 0}
.tp-cwrap .tp-limit small{display:block;opacity:.85;margin-top:2px}
.tp-cwrap .tp-warn{color:#b45309;font-weight:600}
.tp-row input[disabled]+span{opacity:.8}
.tp-row small{opacity:.75}

/* ---------- Q2 History of the Qur'an (qh.js) ---------- */
.qh-aim { margin: 4px 0 0; color: var(--ink-soft); font-size: .9rem; }
.qh-notes h3 { margin-top: 20px; }
.qh-notes .note { color: var(--ink-soft); font-size: .88rem; }
.qh-time { border-left: 3px solid var(--gold); margin: 10px 0 14px 8px; padding-left: 14px; }
.qh-t { position: relative; padding: 6px 0 10px; display: flex; flex-direction: column; gap: 2px; }
.qh-t::before { content: ""; position: absolute; left: -22px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.qh-t b { color: var(--brand); }
.qh-card { margin-top: 8px; }
.qh-q { font-size: 1.08rem; line-height: 1.5; font-weight: 600; }
.qh-a { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); }
.qh-in { width: 100%; box-sizing: border-box; margin-top: 12px; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.qh-res { margin-top: 10px; font-weight: 800; }
.qh-res.ok, .qh-ideas .ok { color: #1a7f4b; }
.qh-res.no, .qh-ideas .no { color: #b3261e; }
:root[data-theme="dark"] .qh-res.ok, :root[data-theme="dark"] .qh-ideas .ok { color: #5fd49a; }
:root[data-theme="dark"] .qh-res.no, :root[data-theme="dark"] .qh-ideas .no { color: #ff8a80; }
.qh-ideas { list-style: none; padding: 0; margin: 8px 0; }
.qh-ideas li { padding: 3px 0; }
.fc-nav { display: flex; gap: 10px; margin-top: 10px; }
.fc-nav .btn { flex: 1; justify-content: center; }

/* ---------- Q2 History of the Qur'an: Block B + model answers (qh.js) ---------- */
h2.qh-block { margin: 26px 0 10px; font-size: 1.1rem; color: var(--brand); }
.qh-notes .table-wrap { margin: 8px 0 12px; }
.qh-qbox { margin-top: 8px; }
.qh-qbox .note { margin: 8px 0 0; color: var(--ink-soft); font-size: .85rem; }
.qh-ans { padding: 2px 2px 4px; }
.qh-ans p { line-height: 1.75; margin: 0 0 12px; }
mark.qh-f { background: transparent; color: inherit; font-weight: 600; border-bottom: 2px solid var(--gold); }
.qh-pt { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0; background: var(--surface); }
.qh-pt-h { font-weight: 800; color: var(--brand); margin-bottom: 2px; }
.qh-lwt { padding: 7px 0; line-height: 1.6; }
.qh-lwt + .qh-lwt { border-top: 1px dashed var(--line); }
.qh-tag { display: inline-block; min-width: 62px; margin-right: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.qh-close { margin: 10px 0; }
.qh-one { margin: 10px 0 14px; }
.qh-one summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.qh-model ul.steps li { padding-top: 8px; padding-bottom: 8px; }
.qh-notes .qh-sheet { width: 100%; }

/* ---------- Q2 (qh.js): part-by-part learning, exam practice and model answers ---------- */
.qh-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 700; line-height: 1.4; max-width: 100%; }
.qh-steps { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 8px 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.qh-step { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 36px; }
.qh-step.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.qh-step.done:not(.on) { border-color: #1a7f4b; color: #1a7f4b; }
:root[data-theme="dark"] .qh-step.done:not(.on) { border-color: #5fd49a; color: #5fd49a; }
.qh-ph { margin: 6px 0 10px; font-size: 1.2rem; }
.qh-facts { list-style: none; margin: 0; padding: 0; }
.qh-facts li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.qh-facts li:first-child { border-top: 0; padding-top: 2px; }
.qh-fq { color: var(--ink-soft); font-size: .92rem; }
.qh-fa { font-weight: 700; line-height: 1.5; }
.qh-sofar { border-left: 3px solid var(--gold); padding-left: 12px; margin-top: 4px; }
.qh-new { background: var(--brand-soft); border-radius: 10px; padding: 2px 10px; margin: 6px 0 6px -10px; position: relative; }
.qh-newtag { display: inline-block; font-size: .65rem; font-weight: 800; letter-spacing: .06em; color: var(--brand); margin-top: 6px; }
.qh-in.qh-big { min-height: 220px; line-height: 1.6; resize: vertical; }
.qh-wc { text-align: right; margin: 4px 2px 0; font-size: .82rem; color: var(--ink-soft); }
.qh-hint { color: #b3261e; font-weight: 600; margin: 8px 0 0; }
:root[data-theme="dark"] .qh-hint { color: #ff8a80; }
.qh-score { margin: 12px 0 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.qh-score b { font-size: 1.25rem; display: block; }
.qh-score span { color: var(--ink-soft); font-size: .88rem; }
.qh-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.qh-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.qh-parts { list-style: none; padding: 0; margin: 8px 0; }
.qh-parts > li { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; background: var(--surface); }
.qh-parts > li > span { float: right; color: var(--ink-soft); font-weight: 700; }
.qh-parts > li.ok > b { color: #1a7f4b; } .qh-parts > li.mid > b { color: #9a6b00; } .qh-parts > li.no > b { color: #b3261e; }
:root[data-theme="dark"] .qh-parts > li.ok > b { color: #5fd49a; } :root[data-theme="dark"] .qh-parts > li.mid > b { color: #f0c15a; } :root[data-theme="dark"] .qh-parts > li.no > b { color: #ff8a80; }
.qh-parts ul { list-style: none; margin: 8px 0 2px; padding: 0; font-size: .9rem; }
.qh-parts ul li { padding: 6px 0; border-top: 1px dashed var(--line); }
.qh-plan { margin: 10px 0 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.qh-plan summary { cursor: pointer; font-weight: 700; }
.qh-plan ol { margin: 8px 0 2px 18px; padding: 0; }
.qh-pickq { text-align: left; display: block; height: auto; padding: 12px 14px; line-height: 1.45; }
.qh-pickq span { font-weight: 500; opacity: .85; }
@media (max-width: 420px) { .qh-step { padding: 7px 11px; font-size: .78rem; } .qh-in.qh-big { min-height: 190px; } }
.tabs.qh-tabs { flex-wrap: wrap; overflow: visible; row-gap: 8px; }

/* ---- Paper 2 Q1 Hadith pages (js/hd.js) ---- */
.hd-ar { font-size: 1.45rem; line-height: 2; font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif; text-align: right; margin-bottom: 10px; }
.hd-en { font-size: 1rem; line-height: 1.7; }
.seg-C { background: #e3e8f7; } .show-pattern .seg-C i, .pattern-key .seg-C { background: #3d55a8; color: #fff; }
.seg-H { background: #e4eef8; } .show-pattern .seg-H i, .pattern-key .seg-H { background: #1f6f95; color: #fff; }
.seg-W { background: #fde5dc; } .show-pattern .seg-W i, .pattern-key .seg-W { background: #b5452f; color: #fff; }
.seg-X { background: #f1e3f5; } .show-pattern .seg-X i, .pattern-key .seg-X { background: #7a3d8f; color: #fff; }
.callout .ok { color: var(--green); } .callout .miss { color: var(--red); }

/* ---------- Islamiyat home (v246): next step, today's goal, two paper cards ---------- */
.isl-hero { padding: 22px 20px; }
.isl-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; margin-top: 8px; }
.isl-top h1 { margin: 0 0 2px; }
.isl-top p { margin: 0; font-size: .92rem; }
.isl-ring { width: 68px; height: 68px; background: conic-gradient(#f2d684 calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.isl-ring span { width: 54px; height: 54px; background: #0b4f45; color: #fff; }
.isl-go { display: block; position: relative; z-index: 1; margin-top: 16px; text-align: center; text-decoration: none;
  font-size: 1rem; padding: 14px 16px; line-height: 1.35; }
.isl-today { margin-top: 12px; display: grid; gap: 12px; }
.isl-goal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.isl-goal b { margin-right: 4px; }
.isl-goal span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .92rem; }
.isl-tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center;
  font-size: .7rem; font-weight: 800; color: #fff; }
.isl-tick.on { background: var(--green); border-color: var(--green); }
.isl-week { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.isl-week i { width: 12px; height: 12px; border-radius: 4px; background: var(--line); }
.isl-week i.on { background: var(--gold); }
.isl-week small { color: var(--ink-soft); margin-left: 6px; }
.isl-next { display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 14px; padding: 10px 14px; }
.isl-next span { font-size: .78rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; }
.isl-next em { font-style: normal; font-size: .82rem; color: var(--ink-soft); }
.isl-paper { margin-top: 16px; padding: 0; overflow: hidden; }
.isl-ph { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.isl-ph h2 { margin: 4px 0 2px; font-size: 1.15rem; }
.isl-ph p { margin: 0; color: var(--ink-soft); font-size: .82rem; }
.isl-pp { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--brand); border-radius: 8px; padding: 2px 8px; }
:root[data-theme="dark"] .isl-pp { color: #08130f; }
.isl-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); min-height: 64px; }
.isl-row:last-child { border-bottom: 0; }
.isl-row:hover { background: var(--surface-2); }
.isl-q { font-family: var(--serif); font-weight: 700; font-size: 1rem; color: var(--brand); text-align: center;
  background: var(--brand-soft); border-radius: 12px; padding: 8px 0; }
.isl-t { min-width: 0; }
.isl-t b { display: block; font-size: .95rem; line-height: 1.3; }
.isl-t small { color: var(--ink-soft); font-size: .8rem; }
.isl-t .mbar { display: block; margin-top: 6px; }
.isl-pct { font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.isl-links { display: flex; flex-wrap: wrap; gap: 8px; }
.isl-links a { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: .88rem; font-weight: 600; }
.isl-note { margin-top: 14px; }

/* every engine: tab rows scroll sideways in one line (v246) */
.tabs.qh-tabs { flex-wrap: nowrap; overflow-x: auto; }
.tabs .tab { text-decoration: none; }
.loses-box { margin: 12px 0; border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 12px; padding: 10px 14px; }
.loses-box summary { cursor: pointer; font-weight: 700; }
.loses-box ul { margin: 8px 0 0; padding-left: 20px; }
.qh-hero { --tc: var(--t1); margin-bottom: 4px; }
.qh-hero.p2 { --tc: var(--t3); }
.qh-hero .ref { font-size: 1.9rem; }

/* ---------- v247: Maths home (#/maths) like the Islamiyat home, and Previous/Next topic links ---------- */
.mth-ring span { background: #4a2777; }
.mth-pp { background: linear-gradient(135deg, var(--c1), var(--c2)) !important; color: #fff !important; }
.mth-sec .isl-q { color: #6a3fa8; font-size: .95rem; }
:root[data-theme="dark"] .mth-sec .isl-q { color: #b79ae6; }
.mth-sec .mbar i { background: #6a3fa8; }
:root[data-theme="dark"] .mth-sec .mbar i { background: #b79ae6; }
.mth-sec .isl-row { grid-template-columns: 44px 1fr auto; }
.mth-sec .isl-pct .phy-grade { width: 34px; height: 34px; font-size: .9rem; }
.mth-sec { scroll-margin-top: 70px; }
.mth-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.mth-pg { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.mth-pg:hover { border-color: #6a3fa8; }
.mth-pg small { color: var(--ink-soft); font-size: .76rem; font-weight: 700; }
.mth-pg b { font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.mth-pg.next { text-align: right; }
@media (max-width: 560px) {
  .mth-secgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mth-secgrid .sec-card { padding: 12px 12px 10px; }
  .mth-secgrid .sec-card h4 { font-size: .98rem; }
  .mth-secgrid .sec-card small { font-size: .74rem; }
}

/* ===== v250 TRIAL – Maths Coach: spoken step-by-step explanation (js/maths-coach.js) ===== */
:root { --co-or: #b45309; --co-or-soft: #fff1d9; --co-pu: #6d28d9; --co-pu-soft: #f1e8ff; --co-ac: #5b2fa0; }
:root[data-theme="dark"] { --co-or: #f5b15c; --co-or-soft: #3b2a12; --co-pu: #c9b3ff; --co-pu-soft: #2c2142; --co-ac: #b9a0f0; }
.coach-slot { margin: 10px 0 4px; }
.coach-open { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; border: 0; border-radius: 12px; padding: 10px 14px;
  background: var(--co-ac); color: #fff; font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; box-shadow: 0 2px 8px rgba(60, 30, 110, .18); transition: transform .12s, filter .12s; }
.coach-open small { font-weight: 600; font-size: .72rem; opacity: .85; text-transform: none; letter-spacing: 0; color: inherit; margin: 0; }
.coach-open:hover { filter: brightness(1.08); } .coach-open:active { transform: scale(.985); }
:root[data-theme="dark"] .coach-open { color: #160d29; }
.coach-right .coach-open { background: transparent; color: var(--green); border: 1.5px solid var(--green); box-shadow: none; padding: 8px 12px; font-size: .88rem; }
.coach-learn { margin: 6px 0 14px; }
.coach { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 12px; box-shadow: var(--shadow); }
.coach-top { display: flex; align-items: center; gap: 6px; }
.coach-step { font-size: .78rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .03em; }
.coach-sp { flex: 1; }
.coach-ic { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; width: 34px; height: 34px; font-size: .95rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.coach-set { display: grid; gap: 8px; margin: 8px 0 2px; padding: 10px; border-radius: 12px; background: var(--bg); font-size: .85rem; }
.coach-set[hidden] { display: none; }
.coach-set label { display: grid; gap: 4px; font-weight: 700; }
.coach-set select { font: inherit; padding: 7px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.coach-set input[type=range] { width: 100%; accent-color: var(--co-ac); }
.coach-note { margin: 0; color: var(--ink-soft); font-size: .8rem; }
.coach-fig { margin-top: 8px; max-height: 210px; overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.coach-fig .phy-fig { margin: 0; width: 100%; display: flex; justify-content: center; } .coach-fig svg { width: 100%; max-width: 340px; height: auto; max-height: 200px; }
.coach-board { margin-top: 8px; max-height: 300px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; border-radius: 12px; background: linear-gradient(180deg, var(--bg), var(--surface)); border: 1px solid var(--line); min-height: 76px; }
.coach-line { text-align: center; line-height: 1.5; max-width: 100%; }
.coach-line.prev { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.coach-line.now { font-size: clamp(1.12rem, 4.6vw, 1.5rem); font-weight: 800; color: var(--ink); animation: coachPop .4s ease; }
.coach-line .frac { font-size: .82em; }
@keyframes coachPop { 0% { transform: scale(.93); opacity: .4 } 70% { transform: scale(1.03) } 100% { transform: scale(1); opacity: 1 } }
.ct { display: inline-block; padding: 0 6px; border-radius: 8px; }
.ct-a { background: var(--co-or-soft); color: var(--co-or); box-shadow: 0 0 0 1.5px var(--co-or) inset; }
.ct-g { background: var(--green-soft); color: var(--green); box-shadow: 0 0 0 1.5px var(--green) inset; }
.ct-p { background: var(--co-pu-soft); color: var(--co-pu); }
.ct-s { color: var(--red); text-decoration: line-through; text-decoration-thickness: 2.5px; }
.coach-line.prev .ct-a, .coach-line.prev .ct-p { background: none; color: inherit; box-shadow: none; padding: 0; }
.coach-line.prev .ct-g { box-shadow: none; }
.coach-say { margin: 10px 2px 0; font-size: .95rem; line-height: 1.5; color: var(--ink); min-height: 3em; }
.coach-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 10px; }
.coach-bar i { display: block; height: 100%; width: 0; background: var(--co-ac); transition: width .25s; }
.coach-ctl { display: grid; grid-template-columns: 44px 1fr 44px 44px; gap: 6px; }
.coach-b { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; height: 42px; font: inherit; font-weight: 800; cursor: pointer; }
.coach-b.main { background: var(--co-ac); border-color: var(--co-ac); color: #fff; }
:root[data-theme="dark"] .coach-b.main { color: #160d29; }
.coach-b:disabled { opacity: .35; cursor: default; }
@media (prefers-reduced-motion: reduce) { .coach-line.now { animation: none; } .coach-bar i { transition: none; } }
/* v250 coach: cancelling as on paper – the old number crossed out, the new one written small above (numerator) or below (denominator) */
.ct-x { position: relative; display: inline-block; margin: 0 .2em; }
.ct-x s { text-decoration-color: var(--red); text-decoration-thickness: 2px; color: var(--ink-soft); }
.ct-x .ct-new { position: absolute; right: -.6em; top: -.95em; font-size: .7em; font-weight: 800; color: var(--co-ac); line-height: 1; }
.frac > span:last-child .ct-x .ct-new { top: auto; bottom: -.95em; }
.coach-line .frac > span { padding-top: .3em; padding-bottom: .3em; }
.coach-line .rad-f .frac > span:first-child { padding-top: 0; }   /* v256b: keep the root line close above the numerator */
.coach-board .coach-line { padding: .15em 0; }

/* ---- Chemistry quick notes + exam traps (CH1, v295) ---- */
.cq-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cq-card { margin: 10px 0; padding: 14px 16px; border-left: 5px solid #b4531a; }
.cq-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: #b4531a; }
.cq-card ul { margin: 0; padding-left: 1.1em; }
.cq-card li { margin: 5px 0; line-height: 1.45; }
.cq-intro { color: var(--ink-soft); margin: 4px 0 10px; font-size: .92rem; }
.cq-trap { margin: 10px 0; padding: 14px 16px; border-left: 5px solid #c0392b; }
.cq-trap .cq-tn { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #c0392b; }
.cq-trap h4 { margin: 2px 0 6px; font-size: 1.02rem; }
.cq-trap p { margin: 4px 0; line-height: 1.45; font-size: .95rem; }
.cq-trap .cq-r, .cq-trap .cq-r b { color: var(--green); }

/* =========================================================
   CHEMISTRY FULL PAPER 1 MOCK EXAMS (piece CH4, 11 Nov 2026) – js/chem-paper.js
   ========================================================= */
.cp-banner { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--gold-soft); border: 1.5px solid var(--gold); }
.cp-banner .ic { font-size: 1.8rem; } .cp-banner small { color: var(--ink-soft); } .cp-banner .go { margin-left: auto; font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.cp-list { display: grid; gap: 10px; margin-top: 14px; }
.cp-pcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.cp-pcard h3 { margin: 0 0 2px; } .cp-pcard small { display: block; color: var(--ink-soft); }
.cp-pcard .go { margin-left: auto; font-weight: 800; font-size: 1.3rem; color: var(--brand); }
.cp-pl { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-family: var(--serif); font-size: 1.5rem; font-weight: 800; color: #fff; background: var(--brand); }
.cp-soon { opacity: .55; } .cp-soon .cp-pl { background: var(--ink-soft); }
.cp-rules ul { padding-left: 1.1em; margin: 6px 0 10px; } .cp-rules li { margin: 7px 0; line-height: 1.45; }
.cp-hist { width: 100%; border-collapse: collapse; font-size: .92rem; } .cp-hist th, .cp-hist td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.cp-hist .phy-grade, .fc-done-head .phy-grade { width: auto; height: auto; display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 1.05rem; }
/* the exam */
.cp-bar { position: sticky; top: 61px; z-index: 6; display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .92rem; }
.cp-time { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--brand); } .cp-time.low { color: var(--red); animation: cpblink 1s steps(2) infinite; }
@keyframes cpblink { 50% { opacity: .55; } }
.cp-done { color: var(--green); font-weight: 700; }
.cp-tb { all: unset; box-sizing: border-box; margin-left: auto; cursor: pointer; text-align: center; font-size: 1.15rem; line-height: 1; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.cp-tb + .cp-tb { margin-left: 0; } .cp-tb small { display: block; font-size: .6rem; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.phy-opt.sel { border-color: var(--brand); background: var(--brand-soft); } .phy-opt.sel .ol { background: var(--brand); color: #fff; border-color: var(--brand); }
:root[data-theme="dark"] .phy-opt.sel .ol { color: #08130f; }
.cp-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; } .cp-nav .btn { justify-content: center; text-align: center; padding: 12px 6px; }
.cp-nav .btn[disabled], .cp-nav .is-off { opacity: .4; pointer-events: none; }
.cp-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; background: rgba(10, 20, 18, .55); }
.cp-box { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.cp-box h3 { margin: 0 0 10px; } .cp-warn { color: var(--red); }
.cp-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.cp-gb { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 6px 0 4px; border-radius: 10px; font-weight: 800; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.cp-gb small { display: block; font-size: .7rem; font-weight: 700; opacity: .8; }
.cp-gb.done { background: var(--brand-soft); border-color: var(--brand); } .cp-gb.flag { box-shadow: inset 0 0 0 2px var(--gold); } .cp-gb.now { outline: 2.5px solid var(--brand-2); }
.cp-res .cp-gb.ok { background: var(--green-soft); border-color: var(--green); color: var(--green); } .cp-res .cp-gb.bad { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.cp-res .cp-gb.blank { background: var(--surface-2); color: var(--ink-soft); }
.cp-key { font-size: .82rem; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.45; }
/* the Periodic Table */
.cp-ptw { overflow-x: auto; padding-bottom: 4px; } .cp-pt { display: grid; grid-template-columns: repeat(18, 38px); gap: 2px; width: max-content; }
.cp-pt-f { margin-top: 8px; grid-template-columns: 76px repeat(15, 38px); } .cp-pt-f .cp-fl:last-of-type { grid-column: 1; }
.cp-el { height: 48px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; font-size: .62rem; }
.cp-el i { font-style: normal; color: var(--ink-soft); } .cp-el b { font-size: .85rem; } .cp-el span { color: var(--brand); font-weight: 700; }
.cp-nil { visibility: hidden; } .cp-note { color: var(--ink-soft); background: transparent; border-style: dashed; text-align: center; }
.cp-g { text-align: center; font-weight: 800; font-size: .8rem; color: var(--ink-soft); } .cp-fl { grid-column: 1; align-self: center; font-size: .72rem; font-weight: 700; color: var(--ink-soft); }
.cp-pt-f .cp-fl:first-child { grid-row: 1; } .cp-pt-f .cp-fl:nth-of-type(2) { grid-row: 2; }
/* result */
.cp-tr { display: grid; grid-template-columns: 1fr 90px 44px; gap: 8px; align-items: center; font-size: .88rem; padding: 4px 0; }
.cp-tbar { height: 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; } .cp-tbar i { display: block; height: 100%; }
.cp-tbar i.ok { background: var(--green); } .cp-tbar i.mid { background: var(--gold); } .cp-tbar i.lo { background: var(--red); } .cp-tr b { text-align: right; }
/* coach */
.cp-ch { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; font-size: .85rem; font-weight: 800; color: var(--co-ac, var(--brand)); }
.cp-sec { margin: 12px 0; padding: 14px 16px; } .cp-sec h3 { margin: 0 0 8px; font-size: 1.05rem; }
.cp-steps { margin: 0; padding: 0; list-style: none; counter-reset: cps; } .cp-steps li { counter-increment: cps; position: relative; padding: 4px 0 8px 36px; line-height: 1.5; }
.cp-steps li::before { content: counter(cps); position: absolute; left: 0; top: 3px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--co-ac, var(--brand)); color: #fff; }
:root[data-theme="dark"] .cp-steps li::before { color: #160d29; }
.cp-trap { margin: 12px 0; padding: 12px 16px; border-left: 5px solid var(--gold); background: var(--gold-soft); } .cp-trap b { color: #8a6513; } .cp-trap p { margin: 4px 0 0; line-height: 1.45; }
:root[data-theme="dark"] .cp-trap { color: var(--ink); } :root[data-theme="dark"] .cp-trap b { color: var(--gold); }
.cp-wr { display: flex; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); } .cp-wr:first-of-type { border-top: 0; }
.cp-wr .ol { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); border: 1.5px solid var(--line); }
.cp-wr.mine .ol { background: var(--red); color: #fff; border-color: var(--red); } .cp-wr small { display: block; font-size: .7rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .05em; }
.cp-wo { font-weight: 700; margin-bottom: 2px; font-size: .92rem; } .cp-wr div { line-height: 1.45; font-size: .93rem; }
.cp-links { display: grid; gap: 8px; margin: 8px 0; } .cp-links .btn { justify-content: center; text-align: center; }
.cp-nav3 { grid-template-columns: 1fr 1.6fr 1fr; }
@media (max-width: 420px) { .cp-grid { grid-template-columns: repeat(8, 1fr); gap: 4px; } .cp-bar { gap: 8px; padding: 6px 8px; } .cp-tr { grid-template-columns: 1fr 64px 40px; } }
.fc-done-head .phy-grade, .cp-hist .phy-grade { color: #fff; } .fc-done-head .phy-grade.g-As, .cp-hist .phy-grade.g-As { color: #1d1607; }
:root[data-theme="dark"] .fc-done-head .phy-grade:not(.g-As), :root[data-theme="dark"] .cp-hist .phy-grade:not(.g-As) { color: #08130f; }

/* CH5R (11 Nov 2026): Chemistry mock papers – picture options one per row for structures */
.phy-opts.pics.one { grid-template-columns: 1fr; }
.phy-opts.pics.one .phy-opt.pic { flex-direction: row; align-items: center; gap: 10px; }
.phy-opts.pics.one .phy-opt.pic .opt-fig { flex: 1; min-width: 0; }
.phy-opts.pics.one .phy-opt.pic .opt-fig svg { max-height: 150px; max-width: 320px; margin: 0 auto; }

/* AU1 (11 Nov 2026): Chemistry audio coach on the quick-notes page (.ca-*) */
:root { --ca-ac: #b4531a; } :root[data-theme="dark"] { --ca-ac: #f0a46a; }
.ca-slot { margin: 10px 0 4px; }
.ca-slot.ca-live { position: sticky; top: 66px; z-index: 15; }
.ca-open { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; border: 0; border-radius: 12px; padding: 11px 14px; background: #b4531a; color: #fff;
  font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow); }
.ca-open small { font-weight: 600; font-size: .74rem; opacity: .9; text-transform: none; letter-spacing: 0; color: inherit; margin: 0; }
.ca-open:active { transform: scale(.985); }
.ca { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 9px 10px 11px; box-shadow: var(--shadow); }
.ca-top { display: flex; align-items: center; gap: 6px; }
.ca-unit { flex: 1; min-width: 0; font-size: .76rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-ic { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; width: 34px; height: 34px; font-size: .95rem; cursor: pointer; display: grid; place-items: center; }
.ca-set { display: grid; gap: 8px; margin: 8px 0 2px; padding: 10px; border-radius: 12px; background: var(--bg); font-size: .85rem; }
.ca-set[hidden] { display: none; }
.ca-set label { display: grid; gap: 4px; font-weight: 700; }
.ca-set select { font: inherit; padding: 7px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.ca-set input[type=range] { width: 100%; accent-color: var(--ca-ac); }
.ca-note { margin: 0; color: var(--ink-soft); font-size: .8rem; }
.ca-say { margin: 8px 2px 0; font-size: .98rem; line-height: 1.45; color: var(--ink); min-height: 4.4em; font-weight: 600; }
.ca-bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0 9px; }
.ca-bar i { display: block; height: 100%; width: 0; background: var(--ca-ac); transition: width .25s; }
.ca-ctl { display: grid; grid-template-columns: 44px 1fr 44px 44px; gap: 6px; }
.ca-b { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; height: 42px; font: inherit; font-weight: 800; cursor: pointer; }
.ca-b.main { background: var(--ca-ac); border-color: var(--ca-ac); color: #fff; }
:root[data-theme="dark"] .ca-b.main { color: #1b1209; }
.ca-b:disabled { opacity: .35; cursor: default; }
.ca-now { outline: 3px solid var(--ca-ac); outline-offset: 2px; scroll-margin-top: 262px; }

/* AU1b (11 Nov 2026): pictures inside the Chemistry quick-notes cards (.cf-*) and the highlight glow while the audio Coach speaks */
.cf-figs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 2px; }
.cf { flex: 1 1 100%; min-width: 0; margin: 0; padding: 8px 6px 6px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2, transparent); }
.cf.half { flex: 0 1 calc(50% - 5px); }
.cf svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; color: var(--ink); overflow: visible; }
.cf figcaption { margin-top: 4px; font-size: .8rem; line-height: 1.3; color: var(--ink-soft); }
.cf-halo { fill: var(--ca-ac); fill-opacity: .2; stroke: var(--ca-ac); stroke-width: 2.6; pointer-events: none; animation: cfGlow 1.3s ease-in-out infinite; }
@keyframes cfGlow { 0%, 100% { stroke-opacity: 1; fill-opacity: .2; } 50% { stroke-opacity: .5; fill-opacity: .34; } }
@media (prefers-reduced-motion: reduce) { .cf-halo { animation: none; } }
