:root {
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --bg: #faf9f6;
  --card: #ffffff;
  --ink: #16202e;
  --muted: #6d737c;
  --line: #e6e2da;
  --brand: #6030d8;
  --brand2: #8b5cf6;
  --ok: #1a7f4b;
  --bad: #b3372e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 46, .05), 0 12px 32px rgba(22, 32, 46, .06);
  --subject: #0f1b2d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-family: var(--font-head); font-weight: 900; font-size: 1.25rem; text-decoration: none; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.brand-logo { height: 52px; width: auto; display: block; }

.nav { display: flex; gap: 8px; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem;
  padding: 8px 14px; border-radius: 999px; transition: all .15s;
}
.nav a:hover { color: var(--ink); background: #eef0f8; }
.nav a.active { background: var(--brand); color: #fff; }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.who { font-size: .85rem; font-weight: 700; color: var(--muted); }
.navbtn {
  border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-family: inherit; font-size: .85rem; font-weight: 700; transition: all .15s;
  min-height: 44px; display: inline-flex; align-items: center;
}
.navbtn:hover { border-color: var(--brand); color: var(--brand); }
.navbtn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.navbtn.primary:hover { filter: brightness(1.1); }
.nav-right a { text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--muted); padding: 7px 12px; border-radius: 999px; }
.nav-right a:hover { color: var(--ink); background: #eef0f8; }

/* track bar (syllabus switcher) */
#trackbar { background: #eef0f8; border-bottom: 1px solid var(--line); }
.trackbar-inner { max-width: 1080px; margin: 0 auto; padding: 8px 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.tpill {
  border: 2px solid transparent; background: transparent; cursor: pointer; text-align: left;
  padding: 7px 16px; border-radius: 12px; font-family: inherit; transition: all .15s;
  display: flex; flex-direction: column; gap: 1px; line-height: 1.2;
}
.tpill-main { font-weight: 800; font-size: .95rem; color: var(--muted); }
.tpill-sub { font-size: .72rem; color: var(--muted); opacity: .8; }
.tpill:hover { background: #fff; }
.tpill.active { background: var(--brand); border-color: var(--brand); }
.tpill.active .tpill-main, .tpill.active .tpill-sub { color: #fff; }

/* modal */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px);
}
.modal {
  background: #fff; border-radius: 20px; max-width: 420px; width: 100%; padding: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: pop .2s ease;
}
.modal h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.form-field { margin-bottom: 12px; }
.form-field label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: .9rem; color: var(--ink); background: #fff;
}
.form-field textarea { resize: vertical; min-height: 60px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(96, 48, 216, 0.18); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 9px 12px; font-size: .85rem; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-switch { margin-top: 14px; font-size: .85rem; color: var(--muted); }
.modal-switch a { color: var(--brand); font-weight: 700; cursor: pointer; }
.hidden { display: none !important; }

/* manage */
.mg-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mg-select {
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px;
  font-family: inherit; font-size: .92rem; font-weight: 700; color: var(--ink); cursor: pointer;
}
.mg-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(96, 48, 216, 0.18); }
.mg-type-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.mg-type {
  border: 2px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  padding: 8px 16px; border-radius: 999px; font-family: inherit; font-size: .85rem; font-weight: 700; transition: all .15s;
}
.mg-type:hover { border-color: var(--brand); color: var(--brand); }
.mg-type.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.mg-count { margin-left: auto; align-self: center; color: var(--muted); font-size: .85rem; font-weight: 700; }
.mg-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.mg-item h5 { font-size: .92rem; margin-bottom: 10px; color: var(--ink); }
.mg-add {
  background: #f8faff; border: 2px dashed #c7d2fe; border-radius: 14px; padding: 16px; margin-bottom: 18px;
}
.mg-add h5 { color: var(--brand); margin-bottom: 10px; font-size: .92rem; }
.mg-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-sm { padding: 8px 16px; font-size: .85rem; border-radius: 10px; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

.mg-flash {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120;
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: pop .2s ease;
}
.mg-flash.ok { background: #15803d; }
.mg-flash.bad { background: #b91c1c; }
.small { font-size: .8rem; color: var(--muted); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- hero / home ---------- */
.hero {
  background: linear-gradient(135deg, #6030d8, #7c3aed 55%, #a855f7);
  color: #fff; border-radius: 24px; padding: 44px 40px; margin-bottom: 28px;
  box-shadow: 0 20px 50px rgba(79,70,229,.35); position: relative; overflow: hidden;
}
.hero::after {
  content: "✏️"; position: absolute; right: -30px; bottom: -40px; font-size: 190px; opacity: .12; transform: rotate(-12deg);
}
.hero h1 { font-family: var(--font-head); font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900; line-height: 1.15; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; opacity: .92; max-width: 620px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; }

.section-title { font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; margin: 30px 0 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- subject cards ---------- */
.grid-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.subject-card {
  background: var(--card); border-radius: var(--radius); padding: 22px; cursor: pointer;
  box-shadow: var(--shadow); border: 1px solid var(--line); border-top: 5px solid var(--subject);
  transition: transform .15s, box-shadow .15s; text-decoration: none; color: inherit; display: block;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(30,41,59,.14); }
.subject-card .emoji { font-size: 2rem; }
.subject-card h3 { font-family: var(--font-head); font-size: 1.15rem; margin: 8px 0 2px; }
.subject-card .code { color: var(--muted); font-size: .82rem; font-weight: 600; }
.subject-card .meta { display: flex; gap: 14px; margin-top: 12px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.subject-card .meta span b { color: var(--ink); }

/* ---------- generic cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }

/* ---------- subject page ---------- */
.subject-head {
  border-radius: 24px; padding: 30px; color: #fff; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--subject), color-mix(in srgb, var(--subject) 60%, #7c3aed));
  box-shadow: 0 16px 40px color-mix(in srgb, var(--subject) 35%, transparent);
}
.subject-head h1 { font-family: var(--font-head); font-size: 1.9rem; font-weight: 900; }
.subject-head .sub { opacity: .9; margin-top: 4px; font-size: .95rem; }
.subject-head .spec-box { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.subject-head .spec-box .pchip { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 8px 12px; border-radius: 12px; font-size: .82rem; }

.tabs { display: flex; gap: 6px; background: #eef0f8; padding: 6px; border-radius: 14px; margin-bottom: 20px; flex-wrap: wrap; }

/* year toggle */
.year-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.year-label { font-weight: 700; font-size: .88rem; color: var(--muted); }
.ypill {
  border: 2px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  padding: 7px 16px; border-radius: 999px; font-family: inherit; font-size: .85rem; font-weight: 700; transition: all .15s;
}
.ypill:hover { border-color: var(--subject); color: var(--ink); }
.ypill.active { background: var(--subject); border-color: var(--subject); color: #fff; }
.ybadge {
  display: inline-block; font-size: .68rem; font-weight: 800; padding: 2px 9px; border-radius: 99px;
  background: #eef0f8; color: #64748b; margin-left: 8px; vertical-align: 2px; flex-shrink: 0;
}
.ybadge.y10 { background: #ecfdf5; color: #047857; }
.ybadge.y11 { background: #eef2ff; color: #4338ca; }
.tab {
  border: 0; background: transparent; padding: 10px 20px; border-radius: 10px; font-family: inherit;
  font-size: .95rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s; flex: 1; min-width: 120px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(30,41,59,.12); }

/* syllabus */
.syllabus-item { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: var(--card); }
.syllabus-item summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-family: var(--font-head); list-style: none; display: flex; align-items: center; gap: 10px; }
.syllabus-item summary::-webkit-details-marker { display: none; }
.syllabus-item summary .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.syllabus-item[open] summary .chev { transform: rotate(90deg); }
.syllabus-item .body { padding: 4px 20px 16px; }
.subtopic-list { display: flex; flex-wrap: wrap; gap: 8px; }
.subtopic { background: #f1f3fa; border: 1px solid var(--line); color: #3c4461; padding: 6px 12px; border-radius: 999px; font-size: .83rem; font-weight: 500; }

/* learn cards */
.learn-topic { margin-bottom: 22px; }
.learn-topic h3 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.learn-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.learn-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--subject); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.learn-card h4 { font-size: .95rem; margin-bottom: 6px; color: var(--subject); }
.learn-card .body { font-size: .9rem; color: #374151; }
.learn-card ul { margin: 8px 0 0 18px; font-size: .85rem; color: #4b5563; }
.learn-card li { margin-bottom: 3px; }

/* learn pills (Easy / Detailed) */
.learn-pills { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.lpill {
  border: 2px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  padding: 9px 18px; border-radius: 999px; font-family: inherit; font-size: .88rem; font-weight: 700; transition: all .15s;
}
.lpill:hover { border-color: var(--subject); color: var(--ink); }
.lpill.active { background: var(--subject); border-color: var(--subject); color: #fff; }

/* detailed notes */
.det-sections { display: grid; gap: 14px; }
.det-section {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--subject);
  border-radius: 12px; padding: 18px; box-shadow: var(--shadow);
}
.det-section h4 { font-size: 1rem; margin-bottom: 8px; color: var(--subject); }
.det-paras p { font-size: .92rem; color: #374151; margin-bottom: 8px; }
.det-paras p:last-child { margin-bottom: 0; }
.det-bullets { margin: 10px 0 0 18px; font-size: .88rem; color: #4b5563; }
.det-bullets li { margin-bottom: 4px; }
.formula-box {
  margin-top: 12px; background: #eef2ff; border: 1px dashed #c7d2fe; border-radius: 10px;
  padding: 12px 14px; font-size: .95rem; color: #3730a3; font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.formula-box b { font-family: "Inter", sans-serif; font-size: .78rem; letter-spacing: .03em; display: block; margin-bottom: 2px; color: #4338ca; }
.formula-note { font-family: "Inter", sans-serif; font-size: .82rem; color: #6366f1; margin-top: 4px; }
.example-box {
  margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 12px 14px; font-size: .9rem; color: #78350f;
}
.example-box b { color: #b45309; }

/* quiz */
.quiz-box { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; color: var(--muted); }
.progress { height: 8px; background: #e6e9f2; border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress .fill { height: 100%; background: var(--subject); border-radius: 99px; transition: width .3s; }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.q-text { font-size: 1.06rem; font-weight: 600; margin-bottom: 16px; line-height: 1.5; }
.q-passage { background: #f8f9fd; border-left: 4px solid var(--subject); padding: 12px 14px; border-radius: 8px; font-style: italic; font-size: .92rem; margin-bottom: 14px; color: #374151; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer;
  border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 13px 16px;
  font-family: inherit; font-size: .95rem; color: var(--ink); transition: all .15s;
}
.opt:hover:not(:disabled) { border-color: var(--subject); background: #f5f6fd; }
.opt .key { font-weight: 800; color: var(--muted); background: #f1f3fa; border-radius: 8px; padding: 2px 9px; font-size: .85rem; flex-shrink: 0; }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--ok); background: #f0fdf4; }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: #fef2f2; }
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt.dim { opacity: .55; }

.feedback { margin-top: 16px; border-radius: 12px; padding: 14px 16px; font-size: .92rem; animation: pop .25s ease; }
.feedback.good { background: #f0fdf4; border: 1px solid #bbf7d0; }
.feedback.bad { background: #fef2f2; border: 1px solid #fecaca; }
.feedback h5 { margin-bottom: 6px; font-size: .95rem; }
.feedback .why { margin-top: 8px; color: #374151; }
.feedback .why li { margin-left: 18px; margin-bottom: 4px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.btn {
  border: 0; border-radius: 12px; padding: 12px 22px; font-family: inherit; font-weight: 700;
  font-size: .95rem; cursor: pointer; transition: all .15s; display: inline-flex; gap: 8px; align-items: center;
}
.btn-primary { background: var(--subject); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: #eef0f8; color: var(--ink); }
.btn-ghost:hover { background: #e2e6f3; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.quiz-actions { display: flex; gap: 10px; margin-top: 16px; }

/* results */
.results { text-align: center; padding: 30px; }
.score-ring {
  width: 150px; height: 150px; border-radius: 50%; margin: 18px auto;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: conic-gradient(var(--subject) calc(var(--pct) * 1%), #e6e9f2 0);
}
.score-ring .inner { width: 126px; height: 126px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.score-ring .num { font-size: 2.2rem; font-weight: 900; font-family: var(--font-head); }
.score-ring .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }
.grade { font-size: 1.05rem; font-weight: 700; margin-top: 4px; }
.review-list { text-align: left; margin-top: 20px; }
.review-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--card); font-size: .9rem; }
.review-item .rq { font-weight: 700; margin-bottom: 6px; }
.review-item .tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; margin-left: 8px; }
.tag.yours { background: #fef2f2; color: var(--bad); }
.tag.right { background: #f0fdf4; color: var(--ok); }


/* past papers */
.pp-subject { margin-bottom: 26px; }
.pp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.pp-head h3 { font-family: var(--font-head); font-size: 1.15rem; }
.pp-head .pp-code { color: var(--muted); font-size: .82rem; font-weight: 700; }
.pp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.pp { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
table.pp th { text-align: left; padding: 10px 14px; background: #f1f3fa; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.pp td { padding: 9px 14px; border-top: 1px solid var(--line); }
table.pp tr:hover td { background: #fafbfe; }
a.dl { text-decoration: none; font-weight: 700; padding: 4px 12px; border-radius: 8px; font-size: .8rem; display: inline-block; }
a.dl.qp { background: #eef2ff; color: #4338ca; }
a.dl.ms { background: #f0fdf4; color: #15803d; }
a.dl:hover { filter: brightness(.95); }
button.dl.exam { background: #eef2ff; color: #4338ca; font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; border: none; cursor: pointer; }
button.dl.exam:hover { filter: brightness(.95); }

/* online exam mode */
.exam-overlay { position: fixed; inset: 0; z-index: 200; background: #fff; display: flex; flex-direction: column; }
.exam-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: #0f1b2d; color: #fff; flex-wrap: wrap; }
.exam-title { font-size: .92rem; flex: 1; min-width: 200px; }
.exam-title b { color: #ffd27d; }
.exam-timer { font-family: ui-monospace, Menlo, monospace; font-size: 1.25rem; font-weight: 700; background: #8b5cf6; padding: 4px 14px; border-radius: 10px; color: #fff; }
.exam-flash { background: #22c55e; color: #fff; font-size: .8rem; font-weight: 700; padding: 6px 14px; border-radius: 99px; opacity: 0; transition: opacity .3s; }
.exam-bar .btn { padding: 8px 16px; font-size: .85rem; background: #1e293b; color: #e2e8f0; border: 1px solid #334155; }
.exam-bar .btn-primary { background: #8b5cf6; color: #fff; border: none; font-weight: 800; }
.exam-body { display: flex; flex: 1; min-height: 0; }
.exam-pane { display: flex; flex-direction: column; min-height: 0; }
.exam-paper { flex: 1.3; border-right: 1px solid #e5e7eb; background: #f1f3f9; }
.exam-sheet-pane { flex: 1; background: #f9fafb; }
.pane-head { padding: 10px 16px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid #e5e7eb; background: #fff; display: flex; align-items: center; gap: 8px; }
.pane-note { font-weight: 500; color: #6b7280; font-size: .78rem; }
.exam-pdf { flex: 1; width: 100%; border: none; min-height: 0; }
.pane-placeholder { padding: 30px 24px; text-align: center; color: #374151; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; height: 100%; }

/* mobile: stack panes */
@media (max-width: 900px) {
  .exam-body { flex-direction: column; overflow-y: auto; }
  .exam-paper { border-right: none; border-bottom: 1px solid #e5e7eb; min-height: 55vh; }
  .exam-sheet-pane { min-height: 55vh; }
  .exam-bar { gap: 8px; }
  .exam-title { min-width: 100%; order: -1; }
  .exam-calc { right: 8px; bottom: 8px; width: 92vw; }
}
.exam-sheet { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.exam-q { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px 10px; }
.exam-q .qnum { font-weight: 800; font-size: .8rem; color: var(--brand); background: #eef2ff; border-radius: 8px; padding: 4px 8px; min-width: 40px; text-align: center; margin-top: 4px; }
.exam-q .qflex { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.exam-q .qmini { font-size: .78rem; color: #6b7280; background: #f8fafc; border: 1px dashed #d1d5db; border-radius: 8px; padding: 5px 8px; }
.exam-q textarea { flex: 1; border: 1px solid #d1d5db; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .88rem; resize: vertical; min-height: 52px; }

/* questions pane */
.exam-questions-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.exam-questions { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.exam-questions .exam-sec { font-weight: 800; font-size: .8rem; letter-spacing: .05em; color: #7c3aed; background: #f3e8ff; align-self: flex-start; padding: 4px 12px; border-radius: 99px; margin-top: 6px; }
.exam-question { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; }
.exam-question .qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.exam-question .qmarks { font-size: .72rem; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; padding: 2px 8px; border-radius: 99px; }
.exam-question .qtext { font-size: .9rem; color: #111827; line-height: 1.5; }
.exam-question .qparts { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.exam-question .qpart { font-size: .85rem; color: #374151; border-left: 3px solid #c7d2fe; padding-left: 8px; line-height: 1.45; }
.exam-qcount { font-size: .72rem; font-weight: 700; color: #0f1b2d; background: #ffd27d; padding: 2px 10px; border-radius: 99px; }
.btn-sm { font-size: .76rem; padding: 5px 10px; }

/* exam tabs (answer sheet / whiteboard) */
.exam-tab { border: none; background: transparent; cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--muted); padding: 6px 12px; border-radius: 10px; }
.exam-tab.active { background: var(--brand); color: #fff; }

/* whiteboard */
#board-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-tools { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; background: #fff; flex-wrap: wrap; }
.bw, .bs { border: 1px solid #d1d5db; background: #fff; border-radius: 9px; padding: 5px 9px; font-size: .85rem; cursor: pointer; line-height: 1; }
.bw.active { background: #eef2ff; border-color: var(--brand); }
.bw-size { display: inline-flex; gap: 4px; align-items: center; margin-left: 4px; }
.board-canvas-wrap { flex: 1; min-height: 0; overflow: hidden; background: #fff; }
.board-canvas { display: block; touch-action: none; cursor: crosshair; }

/* scientific calculator panel */
.exam-calc { position: fixed; right: 20px; bottom: 20px; width: 320px; z-index: 220; background: #0f1b2d; border-radius: 16px; padding: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.45); display: none; }
.calc-head { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: .8rem; font-weight: 700; padding: 2px 4px 8px; }
.calc-deg, .calc-close { margin-left: auto; background: #1e293b; color: #7dd3fc; border: none; border-radius: 8px; padding: 4px 10px; font-weight: 700; font-size: .72rem; cursor: pointer; }
.calc-close { color: #fca5a5; }
.calc-display { background: #1e293b; border-radius: 12px; padding: 10px 14px; text-align: right; min-height: 64px; margin-bottom: 8px; }
.calc-expr { color: #94a3b8; font-size: .95rem; min-height: 20px; word-break: break-all; font-family: ui-monospace, Menlo, monospace; }
.calc-result { color: #fff; font-size: 1.5rem; font-weight: 700; font-family: ui-monospace, Menlo, monospace; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ck { background: #1e293b; color: #e2e8f0; border: none; border-radius: 10px; padding: 12px 0; font-size: .95rem; font-weight: 600; cursor: pointer; }
.ck:hover { background: #334155; }
.ck[data-k="="] { background: var(--brand); color: #fff; font-weight: 800; }
.ck[data-k="AC"], .ck[data-k="⌫"] { color: #fca5a5; }
.ck[data-k="÷"], .ck[data-k="×"], .ck[data-k="−"], .ck[data-k="+"], .ck[data-k="%"], .ck[data-k="±"], .ck[data-k="("], .ck[data-k=")"] { color: #7dd3fc; }
.ck[data-k="sin"], .ck[data-k="cos"], .ck[data-k="tan"], .ck[data-k="log"], .ck[data-k="ln"], .ck[data-k="√"], .ck[data-k="x²"], .ck[data-k="xʸ"], .ck[data-k="π"], .ck[data-k="e"], .ck[data-k="!"] { font-size: .78rem; }

/* interactive MCQ mode */
.mcq-wrap { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; background: #f1f3f9; min-height: 0; }
.exam-start { margin: auto; max-width: 520px; width: 100%; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.es-head { display: flex; gap: 14px; align-items: center; }
.es-badge { font-size: 2rem; background: #2b1a5e; color: #c4b5fd; border-radius: 16px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.es-head h2 { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 4px; }
.es-head p { margin: 0; font-size: .85rem; }
.es-stats { display: flex; gap: 10px; }
.es-stat { flex: 1; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; text-align: center; padding: 12px 8px; }
.es-stat b { display: block; font-size: 1.35rem; font-family: var(--font-head); color: #0f1b2d; }
.es-stat span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.es-stat.es-best b { color: #8b5cf6; }
.es-settings { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.es-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .85rem; }
.es-row label { font-weight: 700; color: #374151; }
.es-row select, .es-settings select { font: inherit; border: 1px solid #d1d5db; border-radius: 9px; padding: 7px 10px; background: #fff; max-width: 60%; }
.es-chk { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: #374151; }
.es-go { width: 100%; padding: 13px; font-size: 1rem; }
.es-resume { width: 100%; border: 2px dashed #8b5cf6; color: #6d28d9; background: #f5f3ff; font-weight: 700; }
.es-alt { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.es-alt .dl, .es-alt .linkish { background: none; border: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 700; color: var(--brand); text-decoration: none; padding: 4px 8px; }
.es-hint { text-align: center; font-size: .76rem; margin: 0; }
.mcq-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.mcq-prog { background: #2b1a5e; color: #c4b5fd; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }
.mcq-top .btn-sm { margin-left: auto; }
#mcq-flag { border: 1px solid #d1d5db; background: #fff; color: #64748b; }
#mcq-flag.flag-on { background: #f5f3ff; border-color: #8b5cf6; color: #6d28d9; }
.mcq-bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.mcq-bar-fill { height: 100%; background: linear-gradient(90deg, #8b5cf6, #a78bfa); border-radius: 99px; transition: width .25s; }
.mcq-palette { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.pal { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid #cbd5e1; background: #fff; font-size: .72rem; font-weight: 700; color: #64748b; cursor: pointer; }
.pal.cur { border-color: #0f1b2d; background: #0f1b2d; color: #fff; }
.pal.ans { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
.pal.flg { box-shadow: 0 0 0 2px #8b5cf6; }
.mcq-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.mcq-opt.sel { border-color: #8b5cf6; background: #f5f3ff; }
.mcq-opt.sel .ol { background: #8b5cf6; color: #fff; }
.bw .dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: middle; }
.bw svg { display: block; }
.mcq-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mcq-opt { display: flex; align-items: flex-start; gap: 10px; text-align: left; background: #fff; border: 2px solid #e5e7eb; border-radius: 12px; padding: 11px 14px; font: inherit; font-size: .9rem; cursor: pointer; transition: all .12s; }
.mcq-opt:hover { border-color: var(--brand); }
.mcq-opt .ol { font-weight: 800; color: var(--brand); background: #eef2ff; border-radius: 8px; padding: 2px 9px; min-width: 30px; text-align: center; }
.mcq-opt.right { border-color: #22c55e; background: #f0fdf4; }
.mcq-opt.right .ol { background: #22c55e; color: #fff; }
.mcq-opt.wrong { border-color: #ef4444; background: #fef2f2; }
.mcq-opt.wrong .ol { background: #ef4444; color: #fff; }
.mcq-opt.dim { opacity: .55; }
.mcq-fb { border-radius: 12px; padding: 12px 14px; font-size: .88rem; line-height: 1.5; margin-bottom: 12px; }
.mcq-fb.good { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.mcq-fb.bad { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.mcq-next-row { text-align: right; }
.mcq-done { margin: auto; max-width: 560px; text-align: center; padding: 16px; }
.mcq-done h2 { font-family: var(--font-head); font-size: 2rem; margin-bottom: 4px; }
.mcq-review { margin-top: 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.mcq-rv { border-radius: 10px; padding: 9px 12px; font-size: .85rem; line-height: 1.45; }
.mcq-rv.rv-good { background: #f0fdf4; border: 1px solid #bbf7d0; }
.mcq-rv.rv-bad { background: #fef2f2; border: 1px solid #fecaca; }
.mcq-rv .rv-x { margin-top: 4px; color: #374151; }
.exam-pdf-open { padding: 10px 14px; text-align: center; background: #f8fafc; border-top: 1px solid #e5e7eb; }
.sheet-tools { padding: 10px 14px; border-top: 1px solid #e5e7eb; display: flex; gap: 8px; flex-wrap: wrap; background: #fff; }
.sheet-tools .btn { font-size: .78rem; padding: 7px 12px; }
.exam-done { margin: auto; max-width: 560px; text-align: center; padding: 30px; }
.exam-done h2 { font-family: var(--font-head); margin-bottom: 8px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.score-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.score-box input { width: 90px; padding: 8px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; }
@media (max-width: 860px) {
  .exam-body { flex-direction: column; }
  .exam-paper { flex: 1; border-right: none; border-bottom: 1px solid #e5e7eb; min-height: 40vh; }
}
.spec-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.spec-badge.old { background: #fff7ed; color: #c2410c; }
.spec-badge.new { background: #ecfdf5; color: #047857; }
.spec-badge.cbse { background: #eef2ff; color: #4338ca; }
.note { background: #fefce8; border: 1px solid #fde68a; color: #854d0e; border-radius: 12px; padding: 12px 16px; font-size: .86rem; margin-bottom: 18px; }

/* misc */
.muted { color: var(--muted); }
.loading { text-align: center; padding: 80px 0; color: var(--muted); }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid #e6e9f2; border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.backlink { display: inline-flex; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .88rem; margin-bottom: 14px; }
.backlink:hover { color: var(--ink); }
footer.footer { text-align: center; padding: 26px 20px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: #fff; }

.error-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 14px; padding: 20px; }

@media (max-width: 640px) {
  .hero { padding: 32px 24px; }
  .tabs { flex-direction: column; }
  .tab { min-width: 100%; }
}

/* marketing landing */
.mk-hero { text-align: center; padding: 56px 16px 40px; max-width: 860px; margin: 0 auto; }
.mk-badge { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: #8b5cf6; background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .35); border-radius: 999px; padding: 6px 16px; margin-bottom: 22px; text-transform: uppercase; }
.mk-title { font-family: var(--font-head); font-size: clamp(3rem, 9vw, 5.2rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; color: var(--ink); }
.mk-dot { color: #8b5cf6; }
.mk-sub { font-size: clamp(1.02rem, 2.4vw, 1.25rem); line-height: 1.65; color: var(--muted); max-width: 660px; margin: 0 auto 28px; }
.mk-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mk-signin { background: #fff; border: 1px solid #d9dee7; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.mk-signin:hover { border-color: #8b5cf6; color: #7c3aed; }
.mk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; max-width: 760px; margin: 44px auto 0; }
.mk-stats div { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px 10px; }
.mk-stats b { display: block; font-family: var(--font-head); font-size: 1.7rem; color: #0f1b2d; }
.mk-stats span { font-size: .8rem; color: var(--muted); }
.mk-sec { max-width: 1000px; margin: 0 auto; padding: 44px 16px; }
.mk-sec h2 { font-family: var(--font-head); font-size: 1.7rem; text-align: center; margin-bottom: 26px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.mk-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 22px; transition: transform .15s ease, box-shadow .15s ease; }
.mk-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 27, 45, .08); }

.mk-card h3 { font-family: var(--font-head); margin: 10px 0 6px; font-size: 1.05rem; }
.mk-card p { font-size: .92rem; line-height: 1.6; color: var(--muted); margin: 0; }
.mk-tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mk-track-card { border-radius: 16px; padding: 22px; border: 1px solid #e5e7eb; background: #fff; }



.mk-track-card h3 { font-family: var(--font-head); margin: 0 0 8px; }
.mk-track-card p { font-size: .9rem; line-height: 1.65; color: var(--muted); margin: 0; }
.mk-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mk-steps div { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 14px; padding: 16px; text-align: center; }
.mk-steps b { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #2b1a5e; color: #c4b5fd; font-family: var(--font-head); margin-bottom: 8px; }
.mk-steps p { font-size: .86rem; margin: 0; color: var(--muted); line-height: 1.5; }
.mk-final { text-align: center; padding: 50px 16px 64px; background: linear-gradient(180deg, #0f1b2d, #16263f); color: #fff; margin-top: 20px; border-radius: 24px 24px 0 0; }
.mk-final h2 { font-family: var(--font-head); font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0 0 22px; }

/* practice topic picker */
.dl.real { background: #f5efe4; color: #7c3aed; border: 1px solid #e5dcc8; margin-top: 6px; }
.dl.real:hover { background: #efe6d2; }
.rt-start { padding: 10px 4px; }
.rt-facts { list-style: none; padding: 0; margin: 14px 0; }
.rt-facts li { padding: 7px 12px; margin-bottom: 8px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; font-size: .92rem; }
.rv-opt { padding: 7px 10px; border: 1px solid #e5e7eb; border-radius: 8px; margin: 3px 0; font-size: .9rem; }
.rv-correct { background: #ecfdf5; border-color: #6ee7b7; }
.rv-wrong { background: #fef2f2; border-color: #fca5a5; }
#float-calc-btn { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; border: none; background: #2b1a5e; color: #c4b5fd; box-shadow: 0 6px 20px rgba(15, 27, 45, .35); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 300; transition: transform .15s ease; }
#float-calc-btn:hover { transform: scale(1.07); }
#float-calc-btn:active { transform: scale(.96); }
#float-calc-wrap { position: fixed; right: 20px; bottom: 92px; z-index: 300; }
#float-calc-wrap .exam-calc { width: 300px; border-radius: 14px; box-shadow: 0 12px 40px rgba(15, 27, 45, .3); }
@media (max-width: 640px) { #float-calc-wrap { right: 10px; bottom: 84px; } #float-calc-wrap .exam-calc { width: calc(100vw - 40px); } }
.lfig { margin: 12px 0 4px; }
.lfig svg { width: 100%; height: auto; max-width: 560px; display: block; margin: 0 auto; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.lfig figcaption { text-align: center; font-size: .78rem; color: #64748b; margin-top: 6px; font-style: italic; }
.pr-head { margin-bottom: 14px; }
.pr-head h3 { font-family: var(--font-head); margin-bottom: 4px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pr-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; text-align: left; font: inherit; transition: all .15s; }
.pr-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(79, 70, 229, .08); transform: translateY(-2px); }

.pr-name { font-weight: 800; color: var(--ink); font-size: .92rem; }
.pr-count { font-size: .78rem; color: var(--muted); font-weight: 600; background: #f1f3fa; border-radius: 99px; padding: 2px 10px; }
@media (max-width: 640px) { .pr-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .pr-card { padding: 13px; } }
@media (max-width: 400px) { .pr-grid { grid-template-columns: 1fr; } }

/* ================= responsive layer ================= */

/* tablets */
@media (max-width: 1024px) {
  .exam-calc { width: 300px; }
}

/* large phones → tablets */
@media (max-width: 860px) {
  .trackbar-inner { flex-wrap: wrap; padding: 8px 14px; }
  .trackbar-inner .tpill { flex: 0 1 auto; min-width: 0; }
  .topbar-inner { padding: 8px 14px; gap: 8px; }
  .grid-subjects { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .exam-body { flex-direction: column; }
  .exam-paper { border-right: none; border-bottom: 1px solid #e5e7eb; min-height: 45vh; }
  .form-row { grid-template-columns: 1fr; }
}

/* phones */
@media (max-width: 640px) {
  .topbar { position: sticky; }
  .brand-logo { height: 38px; }
  .nav { gap: 4px; }
  .nav a { font-size: .8rem; padding: 6px 10px; }
  .nav-right a { font-size: .78rem; padding: 6px 12px; }

  .hero { padding: 26px 16px; text-align: left; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero p { font-size: .9rem; }

  .chips { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .chip { flex: 0 0 auto; }

  .container { padding: 0 12px; }
  .section-title { font-size: 1.05rem; }
  .subject-head { padding: 18px 14px; flex-wrap: wrap; }
  .subject-head h1 { font-size: 1.2rem; }


  /* subject tabs scroll horizontally instead of stacking */
  .tabs { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding: 0 2px; }
  .tab { min-width: auto; white-space: nowrap; }


  .grid-subjects { grid-template-columns: 1fr; gap: 12px; }
  .learn-cards { grid-template-columns: 1fr; }

  /* papers table scrolls inside its card */
  .pp-table-wrap { border-radius: 10px; }
  .pp { min-width: 640px; font-size: .82rem; }
  .pp th, .pp td { padding: 8px 10px; }
  .sheet-tools { gap: 6px; }
  .sheet-tools .btn { flex: 1 1 45%; justify-content: center; }

  /* quiz */
  .opts .opt { padding: 11px 12px; font-size: .9rem; }
  .quiz-top { flex-wrap: wrap; gap: 6px; }

  /* modal → bottom sheet */
  .overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }

  /* manage */
  .mg-toolbar { flex-direction: column; }
  .mg-select { width: 100%; }
  .mg-type-row { gap: 6px; }
  .mg-type-row .btn { flex: 1 1 45%; justify-content: center; font-size: .78rem; padding: 8px 6px; }
  .form-row { grid-template-columns: 1fr; }
  .card-pad { padding: 14px; }

  /* exam desk on phones */
  .exam-bar { gap: 6px; padding: 8px 10px; }
  .exam-bar .btn { padding: 7px 10px; font-size: .78rem; }
  .exam-title { font-size: .8rem; min-width: 100%; }
  .exam-timer { font-size: 1rem; }
  .pane-head { padding: 8px 10px; flex-wrap: wrap; font-size: .82rem; }
  .exam-start { padding: 14px; gap: 10px; }
  .es-head h2 { font-size: 1rem; }
  .es-badge { width: 52px; height: 52px; font-size: 1.6rem; }
  .es-stat b { font-size: 1.1rem; }
  .es-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .es-row select { max-width: 100%; }
  .mcq-top { font-size: .8rem; flex-wrap: wrap; }
  .mcq-palette { gap: 4px; }
  .pal { width: 24px; height: 24px; font-size: .68rem; }
  .mcq-card { padding: 12px; }
  .mcq-card .qtext, .mcq-opt { font-size: .88rem; }
  .mcq-done { padding: 10px; }
  .mcq-done h2 { font-size: 1.6rem; }
  .exam-q .qmini { display: none; } /* hide question preview on tiny screens */
  .exam-calc { right: 6px; bottom: 6px; width: 96vw; }
  .calc-grid { gap: 4px; }
  .ck { padding: 11px 0; font-size: .9rem; }
  .board-tools { gap: 4px; padding: 6px 8px; }
  .bw { padding: 5px 7px; }
  .exam-sheet { padding: 10px; }
  .exam-q textarea { min-height: 44px; }

  footer.footer { padding: 18px 12px; font-size: .76rem; }
}

/* tiny phones */
@media (max-width: 400px) {
  .pal { width: 22px; height: 22px; }
  .exam-sheet-pane { min-height: 50vh; }
  .exam-paper { min-height: 50vh; }
  .tpill-main { font-size: .85rem; }
  .tpill-sub { display: none; }
}

/* ================= UP-MARKET EDITORIAL LAYER v2 ================= */
/* typography */
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.01em; }
.muted { color: var(--muted); }

/* top bar — refined, hairline, editorial */
.topbar { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.nav { gap: 2px; }
.nav a {
  font-weight: 500; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 6px; color: var(--muted);
}
.nav a:hover { color: var(--ink); background: #f1eee8; }
.nav a.active { background: transparent; color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand2); border-radius: 0; }

/* buttons — rectangular, letter-spaced */
.btn, .btn-primary, .navbtn {
  border-radius: 8px; font-weight: 600; letter-spacing: .02em;
}
.btn { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn:hover { border-color: var(--brand2); color: #7c3aed; }
.btn-primary, .navbtn.primary { background: var(--brand); border-color: var(--brand); color: #f5f1e8; }
.btn-primary:hover, .navbtn.primary:hover { background: #16263f; border-color: #16263f; color: #fff; filter: none; }
.navbtn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; }
.navbtn:hover { border-color: var(--brand); color: var(--brand); }

/* track bar — quiet, hairline, active = navy + gold rule */
#trackbar { background: transparent; border-bottom: 1px solid var(--line); }
.tpill { border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; }
.tpill:hover { background: #f1eee8; }
.tpill.active { background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 18px rgba(15,27,45,.25); }
.tpill-main { font-weight: 600; font-size: .9rem; letter-spacing: .02em; }
.tpill-sub { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }

/* subject cards — restrained, hairline, serif names */

.subject-card:hover, .subj-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(22,32,46,.05), 0 18px 40px rgba(22,32,46,.10); }

/* chips — understated */
.chip, .spec-badge {
  border-radius: 999px; background: #f1eee8; border: 1px solid var(--line); color: var(--muted);
  font-size: .74rem; letter-spacing: .04em; font-weight: 600;
}

/* tabs (subject page) — hairline underline style */
.tab {
  border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; font-weight: 600;
  letter-spacing: .03em; color: var(--muted); text-transform: uppercase; font-size: .78rem;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand2); background: transparent; }

/* tables — hairline editorial */
.pp, .pp-table-wrap table, table.pp {
  border-collapse: collapse;
}
.pp th, .pp-table-wrap th {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); font-weight: 600;
}
.pp td, .pp-table-wrap td { border-bottom: 1px solid #efece5; }
.pp tr:hover td { background: #faf8f4; }

/* learn cards, sections — serif headers, hairline */

.learn-card h4, .det-section h4 { font-size: 1.08rem; }

/* form inputs — thinner, refined */
.form-field input, .form-field select, .form-field textarea, .mg-select {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .mg-select:focus { border-color: var(--brand2); }

/* modal */
.modal { border-radius: 14px; border: 1px solid var(--line); }
.modal h3 { font-size: 1.4rem; }

/* hero (app home) */
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; }

/* exam overlay + MCQ — editorial exam paper feel */
.exam-overlay { background: var(--bg); }
.qtext { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.55; }
.mcq-opt {
  border-radius: 10px; border: 1px solid var(--line); background: #fff; text-align: left;
  padding: 12px 14px; font-size: .95rem; transition: border-color .12s, background .12s;
}
.mcq-opt:hover { border-color: var(--brand2); }
.mcq-opt.sel { border-color: var(--brand); background: #f4f6fa; }
.ol { font-family: var(--font-mono); color: var(--brand2); font-weight: 500; }

/* marketing landing refinements */
.mk-title { font-weight: 700; }
.mk-card { border-radius: 12px; border: 1px solid var(--line); box-shadow: none; }
.mk-card:hover { box-shadow: var(--shadow); }
.mk-final { background: linear-gradient(180deg, #0f1b2d, #1a2b45); }

/* scrollbar subtle */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d8d2c6; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #c4bdaa; }

/* ================= COMPETITOR-GRADE REFRESH v3 ================= */
/* sans-first UI — Playfair reserved for the wordmark only */
h1, h2, h3, h4 { font-family: "Inter", system-ui, sans-serif; letter-spacing: -.015em; }
.brand, .mk-title { font-family: var(--font-head); }   /* wordmark stays serif */
.hero h1, .mk-title { font-family: var(--font-head); font-weight: 700; }
/* brand wordmark images (word "Practex" replaced by the logo) */
.brand-inline { height: 1em; width: auto; vertical-align: -0.22em; display: inline-block; }
.footer-base .brand-inline { height: 20px; vertical-align: -0.32em; }
/* inline logos in headings/tables sit on the text baseline, not above it */
.mk-cmp h2 .brand-inline, .mk-cmp th .brand-inline, .mk-cmp .mk-cmp-own img { vertical-align: -0.42em; }
.brand-hero { height: clamp(2.6rem, 7vw, 4.4rem); width: auto; display: block; margin: 0 auto 4px; }
.brand-home { height: 2.2rem; width: auto; vertical-align: middle; }
.brand-badge { height: 36px; width: auto; }
.brand-cmp { height: 1.5em; }

/* pill buttons (SaveMyExams / Khan pattern) */
.btn, .btn-primary, .navbtn, .dl, .tab, .tpill, .mg-type, .mg-select {
  border-radius: 999px;
}
.btn-primary { letter-spacing: .01em; }
.dl { border-radius: 999px; }
.tab { border-radius: 999px 999px 0 0; }
.tab.active { background: #f1eee8; border-bottom-color: transparent; }

/* subject monogram badges */
.subj-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: var(--brand2);
  font-family: var(--font-head); font-size: 1.35rem; font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 27, 45, .22); flex: none;
}
.emoji {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 27, 45, .22); flex: none;
}
.emoji .subj-badge { background: transparent; color: var(--brand2); box-shadow: none; width: auto; height: auto; font-size: 1.35rem; }
.subject-head h1 { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.subject-head h1 .subj-badge { width: 44px; height: 44px; font-size: 1.25rem; }
.pp-head h3 { display: flex; align-items: center; gap: 12px; }
.pp-head h3 .subj-badge { width: 38px; height: 38px; font-size: 1.1rem; }

/* whitespace + hero refinement */
.hero { padding: 64px 20px 40px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); letter-spacing: -.02em; }
.hero p { max-width: 640px; margin: 14px auto 0; font-size: 1.05rem; }

/* section titles — editorial small caps */
.section-title, .mk-sec h2 {
  font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-family: "Inter", sans-serif;
}
.mk-sec h2 { margin-bottom: 30px; }

/* cards — airier, action-first */
.subject-card { padding: 20px; }
.subject-card .emoji { margin-bottom: 12px; }
.mk-grid, .mk-tracks { gap: 20px; }
.mk-card { padding: 26px; }
.mk-card h3 { font-size: 1.02rem; font-weight: 700; }

/* nav pills cleaner */
.nav a { border-radius: 999px; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: none; }

/* focus rings — navy */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand2); outline-offset: 2px;
}

/* ================= HEADER / HERO / FOOTER v4 ================= */
/* topbar — airy, hairline, refined */
.topbar { background: rgba(250, 249, 246, .86); backdrop-filter: blur(14px); }
.topbar-inner { padding: 14px 24px; max-width: 1200px; }
.brand-logo { height: 40px; }
.nav a { font-size: .76rem; }
.nav-right .navbtn { border-radius: 999px; }

/* hero — two-column editorial */
.hero-grid, .mk-hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 72px 24px 56px;
}
.hero-left h1 { margin: 0 0 12px; }
.hero-left p, .mk-sub { max-width: 520px; margin: 0 0 24px; font-size: 1.06rem; }
.mk-hero-left { text-align: left; }
.mk-hero-left .mk-sub { margin-left: 0; }
.mk-cta { justify-content: flex-start; }
.mk-hero-left .mk-stats { max-width: 520px; margin: 40px 0 0; }
.mk-hero { max-width: 1200px; }
.mk-badge { margin-bottom: 20px; }

/* hero product mockup */
.hv { position: relative; padding: 24px 8px 30px 0; }
.hv-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 27, 45, .12), 0 2px 6px rgba(15, 27, 45, .04);
  padding: 22px; max-width: 400px; margin-left: auto; position: relative; z-index: 2;
  transform: rotate(1.2deg); transition: transform .2s ease;
}
.hv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.hv-chip { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand2); background: rgba(184,147,90,.1); border: 1px solid rgba(184,147,90,.3); border-radius: 999px; padding: 4px 12px; }
.hv-timer { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.hv-q { font-family: var(--font-head); font-size: 1.02rem; line-height: 1.5; color: var(--ink); margin-bottom: 14px; }
.hv-opts { display: grid; gap: 8px; }
.hv-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: .88rem; color: var(--muted); }
.hv-ol { font-family: var(--font-mono); color: var(--brand2); font-weight: 500; }
.hv-right { border-color: rgba(15, 27, 45, .4); background: #f4f6fa; color: var(--ink); }
.hv-right .hv-ol { color: var(--brand); }
.hv-bar { height: 6px; background: #ece8e0; border-radius: 999px; margin-top: 16px; overflow: hidden; }
.hv-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand2)); }
.hv-side { position: absolute; left: 0; top: 50%; transform: translateY(-42%); display: grid; gap: 12px; z-index: 1; }
.hv-mini { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 28px rgba(15,27,45,.10); padding: 12px 16px; min-width: 150px; }
.hv-mini b { display: block; font-family: var(--font-head); font-size: 1.3rem; color: var(--brand); }
.hv-mini span { font-size: .72rem; color: var(--muted); }
.hv-mini-gold { border-color: rgba(184,147,90,.45); }
.hv-mini-gold b { color: var(--brand2); }


/* footer — dark navy, editorial */
footer.footer { background: #2b1a5e; color: #cfd6e0; margin-top: 60px; border-top: none; text-align: left; padding: 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand p { font-size: .92rem; line-height: 1.65; color: #9aa7b8; max-width: 340px; margin-top: 14px; }
.footer-col h4 { color: #c4b5fd; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; font-family: "Inter", sans-serif; }
.footer-col a { display: block; color: #cfd6e0; text-decoration: none; font-size: .9rem; padding: 5px 0; }
.footer-col a:hover { color: #c4b5fd; }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); }
.footer-base p { max-width: 1200px; margin: 0 auto; padding: 18px 24px; font-size: .76rem; color: #7c8799; }
.footer .brand-logo { height: 36px; }

/* responsive */
@media (max-width: 900px) {
  .hero-grid, .mk-hero-grid { grid-template-columns: 1fr; padding: 48px 20px 36px; }
  .hero-right { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ================= COLOURFUL PANELS + STUDY DOODLES v5 ================= */
.mk-p-indigo { --acc: #6366f1; --acc-soft: #eef0fe; }
.mk-p-emerald { --acc: #10b981; --acc-soft: #e7f8f1; }
.mk-p-sky { --acc: #0ea5e9; --acc-soft: #e8f6fe; }
.mk-p-amber { --acc: #f59e0b; --acc-soft: #fef4e4; }
.mk-p-violet { --acc: #8b5cf6; --acc-soft: #f1ecfe; }
.mk-p-rose { --acc: #f43f5e; --acc-soft: #feecf0; }

.mk-panel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--acc-soft); color: var(--acc); margin-bottom: 14px;
}
.mk-panel-lg { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 16px; }
.mk-doodle { width: 26px; height: 26px; }
.mk-panel-lg .mk-doodle { width: 30px; height: 30px; }
.mk-card { border-top: 3px solid var(--acc); }
.mk-card h3 { color: var(--ink); }
.mk-track-card { border-top: 3px solid var(--acc); }
.mk-track-card h3 { margin-top: 4px; }

/* steps — colorful number circles */
.mk-step b {
  background: var(--acc, #0f1b2d);
}
.mk-step.s1 { --acc: #6366f1; }
.mk-step.s2 { --acc: #0ea5e9; }
.mk-step.s3 { --acc: #10b981; }
.mk-step.s4 { --acc: #f59e0b; }
.mk-step.s5 { --acc: #f43f5e; }
.mk-step b { background: var(--acc); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }

/* subject cards — color-coded identity (per-subject accent) */
.subject-card .emoji { background: var(--subject); }
.subject-card .emoji .subj-badge { color: #fff; }
.subject-head h1 .subj-badge { background: var(--subject, #0f1b2d); color: #fff; }
.pp-head h3 .subj-badge { background: var(--subject, #0f1b2d); color: #fff; }
.subject-card { position: relative; }
.subject-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--subject); border-radius: 12px 12px 0 0;
}

/* ================= DOODLES + RESPONSIVE v6 ================= */
/* floating hero doodles */
.hv { min-height: 260px; }
.hv-doodle {
  position: absolute; color: var(--brand2); opacity: .8;
  animation: hvfloat 5s ease-in-out infinite;
}
.hv-doodle .mk-doodle { width: 30px; height: 30px; }
.hv-d1 { top: -6px; left: 14%; transform: rotate(-14deg); color: #6366f1; }
.hv-d2 { bottom: 2px; left: 4%; transform: rotate(8deg); color: #0ea5e9; animation-delay: 1.2s; }
.hv-d3 { top: 22%; right: 0; transform: rotate(10deg); color: #10b981; animation-delay: 2.1s; }
.hv-d4 { bottom: -4px; right: 8%; transform: rotate(-8deg); animation-delay: .6s; }
@keyframes hvfloat { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-9px) rotate(var(--rot, 0deg)); } }
.hv-d1 { --rot: -14deg; } .hv-d2 { --rot: 8deg; } .hv-d3 { --rot: 10deg; } .hv-d4 { --rot: -8deg; }

/* subject card corner doodle */
.subject-card { position: relative; }
.card-art { position: absolute; top: 14px; right: 14px; opacity: .5; }
.card-art .mk-doodle { width: 24px; height: 24px; }
/* subject page header doodle */
.subj-art { position: absolute; right: 8px; top: 30px; opacity: .35; }
.subj-art .mk-doodle { width: 72px; height: 72px; }
.subject-head { position: relative; }

/* ============ responsive refinements ============ */
@media (max-width: 900px) {
  .hero-grid, .mk-hero-grid { grid-template-columns: 1fr; padding: 40px 18px 28px; }
  .hero-right, .mk-hero-right { display: block; margin-top: 28px; }
  .hv { margin: 0 auto; max-width: 420px; padding: 20px 6px; }
  .hv-side { left: -6px; }
  .mk-hero-left .mk-stats { margin-top: 28px; }
  .mk-stats { grid-template-columns: repeat(2, 1fr); }
  .mk-cta { justify-content: center; }
  .mk-hero-left { text-align: center; }
  .mk-hero-left .mk-sub, .mk-hero-left .mk-cta, .mk-hero-left .mk-stats { margin-left: auto; margin-right: auto; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .brand-logo { height: 34px; }
  .nav { order: 3; width: 100%; justify-content: center; gap: 2px; }
  .nav a { font-size: .7rem; padding: 6px 10px; }
  .nav-right { margin-left: auto; }
  .nav-right .navbtn, .nav-right a { font-size: .74rem; padding: 6px 10px; }
  .footer-inner { grid-template-columns: 1fr; padding: 40px 18px 28px; gap: 26px; }
  .mk-title { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .mk-sub { font-size: 1rem; }
  .mk-grid, .mk-tracks { grid-template-columns: 1fr; }
  .mk-steps { grid-template-columns: 1fr 1fr; }
  .hv { transform: none; }
  .hv-side { display: none; }
  .hv-card { transform: none; max-width: 100%; }
}


/* ================= PASTEL DOODLE STYLE v8 (reference-matched) ================= */
/* pastel doodle style (reference-matched) — used by hero doodles */
.hv-doodle { position: relative; color: #2b4a6f; }
.hv-doodle .mk-doodle { stroke: #2b4a6f; }
/* organic pastel blob behind each doodle */
.hv-doodle::before {
  content: ""; position: absolute; inset: -9px -8px; z-index: -1;
  background: var(--pastel, #d9d3f0);
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  transform: rotate(var(--rot, 0deg));
  opacity: .85;
  box-shadow: 0 2px 6px rgba(43, 74, 111, .08);
}
.hv-d1 { --pastel: #bfe8f2; } .hv-d2 { --pastel: #f7e8b8; }
.hv-d3 { --pastel: #c6ecd9; } .hv-d4 { --pastel: #ecd9b8; }
.hv-d5 { --pastel: #d9d3f0; } .hv-d6 { --pastel: #f3d3dc; }
.hv-doodle { color: #2b4a6f; }
.hv-doodle .mk-doodle { stroke: #2b4a6f; }


/* ================= COMPARISON TABLE v10 ================= */
.mk-cmp { max-width: 860px; margin: 0 auto; overflow-x: auto; }
.mk-cmp table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mk-cmp th, .mk-cmp td { padding: 12px 14px; text-align: left; font-size: .88rem; border-bottom: 1px solid #f0ece4; }
.mk-cmp thead th { background: #f8f6f1; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.mk-cmp .mk-cmp-own { background: rgba(139, 92, 246, .07); font-weight: 600; }
.mk-cmp .mk-cmp-own.yes, .mk-cmp .yes { color: #1a7f4b; font-weight: 700; }
.mk-cmp tbody tr:last-child td { border-bottom: none; }
@media (max-width: 640px) { .mk-cmp th, .mk-cmp td { padding: 9px 8px; font-size: .78rem; } }

/* ================= PROGRESS / RECALL CARDS / SKILLS CHECK v11 ================= */
/* subject tools row */
.subject-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 2px; }
.subject-tools .btn { font-size: .82rem; padding: 7px 16px; }
.mas-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; font-size: .8rem; color: var(--muted); }
.mas-total b, .mas-streak b { color: var(--brand); font-weight: 700; }
.mas-chip { font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.mas-chip.mas-weak { background: #fdecec; color: #b3372e; border: 1px solid #f5c9c4; }
.mas-chip.mas-strong { background: #e7f8f1; color: #1a7f4b; border: 1px solid #bfe6d3; }
.mas-weak-row { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* progress badges on practice cards */
.mas-badge { font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.mas-badge.mas-strong { background: #e7f8f1; color: #1a7f4b; }
.mas-badge.mas-ok { background: #fef4e4; color: #b45309; }
.mas-badge.mas-weak { background: #fdecec; color: #b3372e; }
.mas-badge.mas-none { background: #f1eee8; color: var(--muted); font-weight: 600; }

/* difficulty filters */
.pr-filters { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.prf { cursor: pointer; }
.prf.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* flashcards */
.fc-window { max-width: 640px; }
.fc-body { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.fc-progress { font-size: .85rem; color: var(--muted); font-weight: 600; }
.fc-card { width: 100%; height: 300px; perspective: 1000px; cursor: pointer; }
.fc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s ease; }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 24px; overflow: auto; }
.fc-back { transform: rotateY(180deg); background: #f8f6f1; }
.fc-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand2); font-weight: 700; margin-bottom: 10px; }
.fc-text { font-size: 1.02rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.fc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* target test report */
.tt-report { margin-top: 18px; text-align: left; }
.tt-row { display: grid; grid-template-columns: 1fr 120px 110px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f0ece4; }
.tt-name { font-size: .9rem; font-weight: 600; }
.tt-count { color: var(--muted); font-weight: 500; font-size: .8rem; }
.tt-bar { height: 8px; background: #ece8e0; border-radius: 999px; overflow: hidden; }
.tt-fill { height: 100%; border-radius: 999px; }
.tt-strong .tt-fill { background: #1a7f4b; }
.tt-ok .tt-fill { background: #f59e0b; }
.tt-weak .tt-fill { background: #dc2626; }
.tt-label { font-size: .74rem; font-weight: 700; text-align: right; }
.tt-strong .tt-label { color: #1a7f4b; }
.tt-ok .tt-label { color: #b45309; }
.tt-weak .tt-label { color: #b3372e; }
@media (max-width: 640px) { .tt-row { grid-template-columns: 1fr 90px; } .tt-label { display: none; } }

/* overlap fixes: doodle panels must not cover text */
.subj-art { display: none; } /* ghosted doodle no longer overlaps the heading/sub */
.card-art { pointer-events: none; z-index: 0; }
.subject-card h3 { position: relative; z-index: 1; padding-right: 34px; }
@media (min-width: 901px) {
  .subject-head .subj-art { display: block; }
}
@media (max-width: 480px) { .card-art { display: none; } }

/* ================= LANGUAGE TOGGLE (TN bilingual) v13 ================= */


.lang-b.active { background: var(--brand); color: #fff; }
.lang-b:not(.active):hover { color: var(--brand); }

/* ================= HOME REAL TEST HIGHLIGHT v14 ================= */
.subject-card { position: relative; }
.sc-main { display: block; text-decoration: none; color: inherit; }
.sc-real {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  border: 1px solid #8b5cf6; background: #fff; color: #7c3aed;
  font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.sc-real:hover { background: #7c3aed; color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, .35); }
/* card-art sits under the badge */
.card-art { top: 44px; right: 14px; }
@media (max-width: 480px) { .sc-real { font-size: .62rem; padding: 3px 9px; } }

/* ================= TN MEDIUM SWITCHER v15 ================= */
.medium-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; margin: 0 0 16px; }
.med-b { border: none; background: transparent; padding: 8px 18px; font-size: .82rem; font-weight: 700; color: var(--muted); cursor: pointer; font-family: "Inter", sans-serif; }
.med-b.active { background: var(--brand); color: #fff; }
.med-b:not(.active):hover { color: var(--brand); }
.med-tag { font-size: .72rem; font-weight: 700; color: #7c3aed; background: #f3f0ff; border: 1px solid #ddd6fe; border-radius: 999px; padding: 1px 8px; margin-left: 2px; }

/* ================= UI/UX PRO MAX + TASTE-SKILL FIXES v16 ================= */
/* 1. reduced-motion: gate ALL animation/transition behind no-preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}
/* 2. visible focus rings on every interactive element (WCAG 2.4.7) */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
a:focus, button:focus, .tpill:focus, .tab:focus, input:focus, select:focus, textarea:focus {
  outline-offset: 2px;
}
/* 3. touch targets >= 44px for primary controls (WCAG 2.5.8) */
.topbar-actions .btn, .topbar-actions a, .topbar-actions button {
  min-height: 44px;
}
/* 4. asymmetric bento feature grid: 2 wide + 4 standard, no equal-3-cols repetition */
.mk-grid { grid-template-columns: repeat(4, 1fr); }
.mk-grid .mk-card { grid-column: span 1; }
.mk-grid .mk-card.mk-wide { grid-column: span 2; }
@media (max-width: 980px) {
  .mk-grid { grid-template-columns: repeat(2, 1fr); }
  .mk-grid .mk-card.mk-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .mk-grid { grid-template-columns: 1fr; }
  .mk-grid .mk-card.mk-wide { grid-column: span 1; }
}

/* page backdrop */
body { background: #f5f2fb; background-image: radial-gradient(1000px 520px at 12% -8%, #ece6f8 0%, #f5f2fb 48%, #f9f7fd 100%); background-attachment: fixed; }

/* raised clay cards: feature cards, track cards, subject cards, practice cards */
.mk-card, .mk-track-card, .subject-card, .pr-card, .cmp-table th,
.mk-stat, .panel, .flashcard { 
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 10px 12px 22px rgba(43,26,94,.10), -6px -6px 14px rgba(255,255,255,.9),
              inset 1.5px 1.5px 3px rgba(255,255,255,.9), inset -2px -2px 4px rgba(43,26,94,.06);
}
/* pressed state on click */
.mk-card:active, .subject-card:active, .pr-card:active { transform: translateY(1px); box-shadow: 6px 7px 14px rgba(43,26,94,.10), -4px -4px 10px rgba(255,255,255,.85), inset 2px 2px 5px rgba(43,26,94,.08), inset -1.5px -1.5px 3px rgba(255,255,255,.7); }

/* clay pill buttons: raised, pressable */
.btn, .btn-primary, .navbtn, .mk-go, .mk-signin, .tpill { 
  border-radius: 999px;
  box-shadow: 6px 7px 12px rgba(43,26,94,.16), -3px -3px 8px rgba(255,255,255,.85), inset 1px 1px 2px rgba(255,255,255,.35);
}
.btn-primary { box-shadow: 6px 7px 14px rgba(43,26,94,.28), -3px -3px 8px rgba(255,255,255,.8), inset 1px 1px 2px rgba(255,255,255,.4); }
.btn:active, .btn-primary:active, .navbtn:active, .tpill:active { 
  transform: translateY(1.5px);
  box-shadow: 2px 3px 6px rgba(43,26,94,.20), inset 2px 2px 5px rgba(43,26,94,.14), inset -1px -1px 2px rgba(255,255,255,.4);
}

/* track pills: clay chips, selected = pressed-in violet */
.tpill { background: #fff; }
.tpill.selected { background: linear-gradient(145deg, #6b3ce8, #5729d0); box-shadow: inset 3px 3px 6px rgba(30,10,80,.35), inset -2px -2px 5px rgba(255,255,255,.18), 4px 5px 9px rgba(43,26,94,.18); }

/* soft oval panels for monograms/icons */
.monogram, .line-art-panel, .subj-ico { border-radius: 24px; box-shadow: inset 2px 2px 5px rgba(255,255,255,.55), inset -3px -3px 7px rgba(43,26,94,.10), 5px 6px 12px rgba(43,26,94,.10); }

/* hero: the big CTA buttons get extra depth */
.mk-go.btn-primary { border-radius: 999px; padding: 14px 34px; font-size: 1.06rem; }
@media (prefers-reduced-motion: no-preference) { .btn, .btn-primary, .navbtn, .tpill, .mk-card, .subject-card { transition: transform .12s ease, box-shadow .12s ease; } }


/* ================= MOBILE APP SHELL v19 (PWA) ================= */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
a, button, .tpill, .subject-card, .mk-card, .mk-track-card { -webkit-tap-highlight-color: transparent; }

.mtabbar { display: none; }

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .mtabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; align-items: stretch;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid rgba(43,26,94,0.10);
    box-shadow: 0 -6px 20px rgba(43,26,94,0.07);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body:not(.tabbar-on) .mtabbar { display: none; }
  body.tabbar-on { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  .mtabbar a {
    flex: 1 1 0; min-height: 64px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: rgba(43,26,94,0.52);
    font-family: Inter, system-ui, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
    transition: color 0.15s ease, transform 0.12s ease;
  }
  .mtabbar a svg {
    width: 22px; height: 22px; fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  .mtabbar a.on { color: var(--violet, #6030d8); }
  .mtabbar a.on svg { stroke-width: 2; }
  .mtabbar a:active { transform: scale(0.93); }

  /* app-feel touch feedback */
  .btn:active, .subject-card:active, .tpill:active, .mk-card:active, .mk-track-card:active { transform: scale(0.975); }
  .topbar { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
}

/* ================= MOBILE APP HOME v20: compact curriculum + hero ================= */
@media (max-width: 640px) {
  /* curriculum switcher: one swipeable row of compact pills (was 2x2 wrap, ~half the screen) */
  #trackbar { padding: 8px 0 6px; }
  .trackbar-inner {
    display: flex; flex-wrap: nowrap; gap: 8px; padding: 0 14px;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .trackbar-inner::-webkit-scrollbar { display: none; }
  .tpill {
    flex: 0 0 auto; scroll-snap-align: start;
    min-height: 44px; padding: 6px 14px;
    display: inline-flex; align-items: center;
  }
  .tpill-sub { display: none; }
  .tpill-main { font-size: 0.95rem; white-space: nowrap; }

  /* app hero: compact header instead of a full-viewport promo */
  .hero.hero-grid { padding: 12px 16px 4px; gap: 0; }
  .hero-left h1 { margin: 0 0 6px; }
  .hero-left h1 .brand-home { height: 34px; }
  .hero-left p { font-size: 0.92rem; line-height: 1.4; margin: 0 0 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-left .chips { gap: 6px; margin: 0 0 10px; }
  .hero-left .chip { font-size: 0.78rem; padding: 4px 9px; }
  .hero-right { display: none; }            /* demo card is marketing content; subjects matter in the app */
}

@media (max-width: 640px) {
  /* the 'pick a syllabus with the tabs' helper duplicates the pills - drop it on phones (home only) */
  #app > p.muted { display: none; }
  /* stat chips: single swipeable row instead of wrapping */
  .hero-left .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .hero-left .chips::-webkit-scrollbar { display: none; }
  .hero-left .chip { flex: 0 0 auto; }
  /* tighter hero block */
  .hero.hero-grid { padding: 10px 16px 2px; }
  .hero-left p { margin-bottom: 6px; }
  #app > .hero.hero-grid { margin-bottom: 0; }
}

/* ---- v21: curriculum pills sized to fit (beat .trackbar-inner .tpill specificity) ---- */
@media (max-width: 640px) {
  .trackbar-inner { gap: 6px; padding: 0 12px; }
  .trackbar-inner .tpill {
    flex: 0 0 auto;              /* never shrink: label must fit */
    min-width: 0; max-width: none;
    padding: 6px 11px;
    min-height: 40px;
    border-radius: 999px;        /* capsule = native segmented-control feel */
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(43,26,94,0.12);
    background: #fff;
  }
  .trackbar-inner .tpill .tpill-main { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
  .trackbar-inner .tpill.active { border-color: var(--brand); }
  /* edge fade hints the row swipes on very narrow screens */
  #trackbar { position: relative; }
  #trackbar::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 18px; pointer-events: none;
    background: linear-gradient(90deg, rgba(238,240,248,0), #eef0f8);
  }
}

/* ---- v22: phone pills use the short label so all five fit on one row ---- */
.tpill-short { display: none; }
@media (max-width: 640px) {
  .trackbar-inner .tpill .tpill-full { display: none; }
  .trackbar-inner .tpill .tpill-short { display: inline; }
  .trackbar-inner { padding: 0 10px; gap: 5px; }
  .trackbar-inner .tpill { padding: 6px 10px; min-height: 38px; }
  .trackbar-inner .tpill .tpill-main { font-size: 0.78rem; }
}

/* ================= CURRICULUM BAR v23: noon-style service tabs ================= */
/* icon-over-label tabs, evenly spaced, tinted active state, hairline bar */
#trackbar { background: #fff; border-bottom: 1px solid rgba(43,26,94,0.08); padding: 0; }
.trackbar-inner {
  display: flex; flex-wrap: nowrap; gap: 2px;
  max-width: 1080px; margin: 0 auto; padding: 0 8px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.trackbar-inner::-webkit-scrollbar { display: none; }
.tpill {
  flex: 1 1 0; min-width: 68px; max-width: 132px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 6px 7px; min-height: 60px;
  border: 0; border-radius: 12px; background: transparent;
  position: relative; transition: color .15s ease, background .15s ease;
}
.tpill .tpill-ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; color: rgba(43,26,94,0.42); }
.tpill .tpill-ico .mk-doodle { width: 21px; height: 21px; }
.tpill .tpill-main { font-size: 0.76rem; font-weight: 600; letter-spacing: .005em; color: rgba(43,26,94,0.62); white-space: nowrap; }
.tpill .tpill-sub { display: none; }
/* active: violet icon + label, soft violet pill + top rule (noon-style emphasis) */
.tpill.active, .tpill.selected { background: rgba(96,48,216,0.07); box-shadow: none; }
.tpill.active .tpill-ico, .tpill.selected .tpill-ico { color: #6030d8; }
.tpill.active .tpill-main, .tpill.selected .tpill-main { color: #4a22b8; font-weight: 700; }
.tpill.active::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: #6030d8;
}
.tpill:hover { background: rgba(43,26,94,0.04); }
@media (prefers-reduced-motion: no-preference) { .tpill { transition: color .15s ease, background .15s ease, transform .12s ease; } }
.tpill:active { transform: scale(0.97); }
/* desktop: slightly larger, keep the same language */
@media (min-width: 641px) {
  .tpill { min-height: 66px; max-width: 150px; padding: 10px 8px 9px; }
  .tpill .tpill-ico .mk-doodle { width: 23px; height: 23px; }
  .tpill .tpill-main { font-size: 0.82rem; }
  .tpill .tpill-sub { display: block; font-size: 0.66rem; color: rgba(43,26,94,0.42); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
/* phones keep the short label (full label hidden) */
@media (max-width: 640px) {
  .tpill .tpill-full { display: none; }
  .tpill .tpill-short { display: inline; }
}

/* ================= CURRICULUM BAR v24: square tile buttons ================= */
#trackbar { background: #fff; border-bottom: 1px solid rgba(43,26,94,0.08); padding: 8px 0; }
.trackbar-inner {
  display: flex; flex-wrap: nowrap; gap: 8px;
  max-width: 1080px; margin: 0 auto; padding: 0 12px;
  overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.trackbar-inner::-webkit-scrollbar { display: none; }
.tpill {
  flex: 0 0 auto; scroll-snap-align: start;
  width: 78px; height: 78px; min-width: 78px; min-height: 78px; max-width: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 4px; border-radius: 18px;
  border: 1px solid rgba(43,26,94,0.10);
  background: #fff;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.tpill .tpill-ico { line-height: 0; color: rgba(43,26,94,0.45); }
.tpill .tpill-ico .mk-doodle { width: 22px; height: 22px; }
.tpill .tpill-main {
  font-size: 0.68rem; font-weight: 600; color: rgba(43,26,94,0.66);
  white-space: nowrap; letter-spacing: .005em;
}
.tpill .tpill-sub { display: none; }
.tpill:hover { border-color: rgba(96,48,216,0.35); }
.tpill:active { transform: scale(0.95); }
/* active tile = filled violet (app-icon style) */
.tpill.active, .tpill.selected {
  background: linear-gradient(160deg, #6b3ce8, #5426cf);
  border-color: #5a2bd4;
  box-shadow: 0 6px 16px rgba(84,38,207,0.28);
}
.tpill.active .tpill-ico, .tpill.selected .tpill-ico { color: #fff; }
.tpill.active .tpill-main, .tpill.selected .tpill-main { color: #fff; font-weight: 700; }
.tpill.active::after, .tpill.selected::after { content: none; }
@media (min-width: 641px) {
  #trackbar { padding: 10px 0; }
  .tpill { width: 96px; height: 96px; min-width: 96px; min-height: 96px; border-radius: 22px; gap: 7px; }
  .tpill .tpill-ico .mk-doodle { width: 26px; height: 26px; }
  .tpill .tpill-main { font-size: 0.78rem; }
}

/* phone: square tiles sized so all five fit one row */
@media (max-width: 640px) {
  .trackbar-inner { gap: 7px; padding: 0 10px; }
  .tpill {
    width: calc((100vw - 20px - 28px) / 5);
    height: calc((100vw - 20px - 28px) / 5);
    min-width: 62px; min-height: 62px;
    border-radius: 16px; gap: 4px;
  }
  .tpill .tpill-ico .mk-doodle { width: 20px; height: 20px; }
  .tpill .tpill-main { font-size: 0.64rem; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .tpill { width: 88px; height: 88px; min-width: 88px; min-height: 88px; border-radius: 20px; }
}

/* ================= CURRICULUM BAR v25: icon squares + label beneath ================= */
#trackbar { background: #fff; border-bottom: 1px solid rgba(43,26,94,0.08); padding: 10px 0 8px; }
.trackbar-inner { gap: 6px; align-items: flex-start; }

.tpill {
  flex: 0 0 auto; width: auto; height: auto; min-width: 0; min-height: 0; max-width: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0;
  transition: transform .12s ease;
}
.tpill:hover { background: transparent; border: 0; }
.tpill:active { transform: scale(0.94); }

/* the square itself */
.tpill .tpill-ico {
  width: 68px; height: 68px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid rgba(43,26,94,0.10);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
  color: rgba(43,26,94,0.45);
}
.tpill .tpill-ico .mk-doodle { width: 24px; height: 24px; }

/* caption under the square */
.tpill .tpill-main {
  font-size: 0.66rem; font-weight: 600; color: rgba(43,26,94,0.62);
  white-space: nowrap; letter-spacing: .005em;
}
.tpill .tpill-sub { display: none; }

/* active: violet square, violet caption */
.tpill.active .tpill-ico, .tpill.selected .tpill-ico {
  background: linear-gradient(160deg, #6b3ce8, #5426cf);
  border-color: #5a2bd4; color: #fff;
  box-shadow: 0 6px 16px rgba(84,38,207,0.26);
}
.tpill.active .tpill-main, .tpill.selected .tpill-main { color: #4a22b8; font-weight: 700; }
.tpill.active::after, .tpill.selected::after { content: none; }

/* responsive square sizes (same fit maths as before) */
@media (max-width: 640px) {
  #trackbar { padding: 9px 0 7px; }
  .trackbar-inner { gap: 4px; padding: 0 8px; }
  .tpill .tpill-ico { width: calc((100vw - 16px - 16px) / 5); height: calc((100vw - 16px - 16px) / 5); min-width: 60px; min-height: 60px; border-radius: 16px; }
  .tpill .tpill-ico .mk-doodle { width: 22px; height: 22px; }
  .tpill .tpill-main { font-size: 0.62rem; }
}
@media (min-width: 641px) and (max-width: 1024px) { .tpill .tpill-ico { width: 88px; height: 88px; border-radius: 20px; } .tpill .tpill-ico .mk-doodle { width: 28px; height: 28px; } }
@media (min-width: 1025px) { .tpill .tpill-ico { width: 92px; height: 92px; border-radius: 22px; } .tpill .tpill-ico .mk-doodle { width: 30px; height: 30px; } .tpill .tpill-main { font-size: 0.72rem; } }

/* ================= CURRICULUM BAR v26: fix square + caption fit ================= */
.tpill { width: 92px; max-width: 100%; }
.tpill .tpill-ico { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.tpill .tpill-main { max-width: 100%; overflow: hidden; text-overflow: ellipsis; text-align: center; }
@media (max-width: 640px) {
  .trackbar-inner { gap: 4px; padding: 0 8px; }
  .tpill { width: calc((100vw - 16px - 16px) / 5); }
  .tpill .tpill-ico { min-width: 0; min-height: 0; }
  .tpill .tpill-main { font-size: 0.6rem; letter-spacing: -0.01em; }
}
@media (min-width: 641px) and (max-width: 1024px) { .tpill { width: 88px; } }

/* v27: kill inherited pill padding so the square fills its slot */
.trackbar-inner .tpill { padding: 0; gap: 5px; border: 0; background: transparent; }
.trackbar-inner .tpill:hover { border: 0; background: transparent; }
.trackbar-inner .tpill .tpill-ico { padding: 0; }

/* ================= USAGE / ANALYTICS PANEL ================= */
.usage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.usage-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.usage-card b { display: block; font-size: 1.35rem; font-weight: 800; color: var(--ink, #1c2340); }
.usage-card span { font-size: 0.75rem; color: var(--muted); }
.usage-list { margin: 6px 0 16px; }
.usage-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 0.82rem; }
.usage-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-bar { background: rgba(43,26,94,0.07); border-radius: 999px; height: 8px; overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #6030d8); }
.usage-num { font-variant-numeric: tabular-nums; color: var(--ink, #1c2340); font-weight: 600; }
