/* ============ Teacher Mitra — styles ============ */
:root {
  --bg: #fdf4f8;
  --surface: #ffffff;
  --surface-2: #fef8fb;
  --ink: #1c2433;
  --ink-soft: #7a5a6e;
  --line: #f0d6e8;
  --primary: #e0457b;
  --primary-dark: #c23066;
  --primary-soft: #fce7f3;
  --green: #1f9d57;
  --green-soft: #e3f5ea;
  --red: #d33a3a;
  --red-soft: #fbe6e6;
  --purple: #7b3fdb;
  --purple-soft: #efe6fb;
  --amber: #d98a00;
  --amber-soft: #fbf0d6;
  --grey: #9aa4b5;
  --shadow: 0 1px 3px rgba(80, 20, 50, 0.06), 0 6px 18px rgba(80, 20, 50, 0.07);
  --radius: 16px;
  --radius-sm: 999px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.25; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--primary); }

/* ---------- top bar ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #e0457b, #f472b6); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(224, 69, 123, 0.32);
}
.brand .logo-img {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(224, 69, 123, 0.28);
}
.brand small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(224,69,123,.28); }
.btn.primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(224,69,123,.38); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* language toggle pill */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.seg button.active { background: var(--primary); color: #fff; }

/* ---------- generic view container ---------- */
#view { flex: 1; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 26px 20px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-soft); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.pill.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* ---------- dashboard ---------- */
.hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; }
.hero .card { padding: 22px; flex: 1; min-width: 280px; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.test-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.test-card h3 { font-size: 16px; }
.test-card .meta { font-size: 13px; color: var(--ink-soft); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 28px 0 12px; font-weight: 700; display: flex; align-items: center; gap: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 10px; }

.attempt-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.attempt-row:last-child { border-bottom: 0; }
.attempt-score { font-weight: 800; font-size: 18px; min-width: 70px; }

/* ---------- instructions ---------- */
.instructions .card { padding: 26px; max-width: 760px; margin: 0 auto; }
.instructions ul { padding-left: 20px; }
.instructions li { margin: 6px 0; }
.legend-inline { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.swatch { width: 22px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }

/* ============ EXAM ENGINE ============ */
.exam { display: flex; flex-direction: column; height: calc(100vh - 0px); }
.exam-header {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.exam-title { font-weight: 700; }
.timer {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px;
  background: var(--surface-2); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px;
}
.timer.warn { background: var(--red-soft); border-color: var(--red); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.section-tabs { display: flex; gap: 4px; padding: 8px 18px 0; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.section-tabs button {
  border: 1px solid var(--line); border-bottom: none; background: var(--surface-2);
  padding: 8px 14px; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.section-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.exam-body { flex: 1; display: grid; grid-template-columns: 1fr 320px; overflow: hidden; }
.q-pane { padding: 22px 26px; overflow-y: auto; }
.q-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.q-num { font-weight: 800; font-size: 17px; }
.q-tags { margin-left: auto; display: flex; gap: 6px; }
.q-stem { font-size: 17px; font-weight: 600; margin-bottom: 18px; white-space: pre-wrap; }
.options { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--surface); transition: border-color .12s, background .12s; text-align: left; width: 100%;
}
.option:hover { border-color: var(--primary); background: var(--primary-soft); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option .key {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.option.selected .key { background: var(--primary); color: #fff; border-color: var(--primary); }
.option .txt { padding-top: 2px; }

.q-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* palette */
.palette { border-left: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; overflow: hidden; }
.palette-legend { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; font-size: 12px; }
.palette-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.dot { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid var(--line); }
.dot.answered { background: var(--green); border-color: var(--green); }
.dot.notans { background: var(--red); border-color: var(--red); }
.dot.notvisited { background: var(--surface); }
.dot.marked { background: var(--purple); border-color: var(--purple); }
.dot.ansmarked { background: var(--purple); border-color: var(--purple); position: relative; }
.dot.ansmarked::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }

.palette-grid { padding: 14px; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start; }
.pcell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font-weight: 700; font-size: 13px; color: var(--ink); display: grid; place-items: center; position: relative;
}
.pcell.answered { background: var(--green); border-color: var(--green); color: #fff; }
.pcell.notans { background: var(--red); border-color: var(--red); color: #fff; }
.pcell.marked { background: var(--purple); border-color: var(--purple); color: #fff; }
.pcell.ansmarked { background: var(--purple); border-color: var(--purple); color: #fff; }
.pcell.ansmarked::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.pcell.current { outline: 3px solid var(--primary); outline-offset: 1px; }
.palette-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.palette-section-label { grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 6px 0 2px; }

/* ============ RESULT ============ */
.result-hero { padding: 28px; text-align: center; margin-bottom: 18px; }
.verdict { font-size: 28px; font-weight: 800; }
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }
.big-score { font-size: 46px; font-weight: 800; margin: 4px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.stat { padding: 14px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

/* ============ REVIEW ============ */
.review-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.review-filters button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rev-q { padding: 18px; margin-bottom: 14px; }
.rev-q .q-stem { font-size: 16px; }
.rev-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 9px; margin: 7px 0; }
.rev-opt.correct { border-color: var(--green); background: var(--green-soft); }
.rev-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.rev-opt .tag { margin-left: auto; font-size: 12px; font-weight: 700; }
.rev-opt.correct .tag { color: var(--green); }
.rev-opt.wrong .tag { color: var(--red); }
.explain { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; font-size: 14px; }

/* ============ INSIGHTS ============ */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.insight-grid .card { padding: 18px; }
.insight-grid .full { grid-column: 1 / -1; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.bar-track { background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--primary); border-radius: 6px 0 0 6px; }
.bar-fill.good { background: var(--green); }
.bar-fill.mid { background: var(--amber); }
.bar-fill.bad { background: var(--red); }
.tlist-weak li, .tlist-strong li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.tlist-weak li:last-child, .tlist-strong li:last-child { border-bottom: 0; }
.reco { padding: 12px 14px; border-radius: 9px; background: var(--amber-soft); border: 1px solid #f0dca5; margin: 8px 0; font-size: 14px; }
.reco.ok { background: var(--green-soft); border-color: #bfe6cd; }

/* ============ modal ============ */
#modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 22, 40, .5); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); max-width: 520px; width: 100%; padding: 24px; box-shadow: var(--shadow); }
.modal h2 { font-size: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.feedback-frame-wrap { height: min(72vh, 720px); margin-top: 12px; }
.feedback-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.modal:has(.feedback-frame) { max-width: 760px; }

/* ============ COUNTDOWN BANNER ============ */
.countdown-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-radius: var(--radius);
  margin-bottom: 16px; border: 1.5px solid transparent;
}
.banner-primary { background: var(--primary-soft); border-color: #f4b8d6; }
.banner-amber   { background: var(--amber-soft);   border-color: #f0c97a; }
.banner-red     { background: var(--red-soft);     border-color: #f4a6a6; }
.countdown-num  { font-size: 36px; font-weight: 900; line-height: 1; min-width: 48px; }
.banner-primary .countdown-num { color: var(--primary); }
.banner-amber   .countdown-num { color: var(--amber); }
.banner-red     .countdown-num { color: var(--red); }
.countdown-mid  { display: flex; flex-direction: column; gap: 2px; }
.countdown-label { font-weight: 700; font-size: 15px; }
.countdown-date  { font-size: 12px; color: var(--ink-soft); }

/* ============ COMPACT HERO ============ */
.compact-hero { padding: 16px 20px; margin-bottom: 8px; }
.compact-hero-top { display: flex; align-items: center; gap: 16px; }
.compact-hero-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
}
.readiness-compact { text-align: right; flex-shrink: 0; }
.readiness-score { font-size: 26px; font-weight: 900; line-height: 1; }

/* ============ RESUME BANNER ============ */
.resume-banner {
  padding: 14px 18px; margin-bottom: 16px;
  border-left: 4px solid var(--amber);
}
.resume-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ============ FOCUS AREAS ============ */
.focus-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.focus-chip {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.focus-icon { font-size: 24px; line-height: 1; flex-shrink: 0; width: 30px; text-align: center; }
.focus-body { flex: 1; min-width: 0; }
.focus-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.focus-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.focus-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.focus-score { flex-shrink: 0; text-align: right; min-width: 48px; }
.focus-acc { font-size: 16px; font-weight: 800; }
.focus-acc.bad { color: var(--red); }
.focus-acc.mid { color: var(--amber); }
.focus-acc.ok  { color: var(--green); }
.focus-acc-sub { font-size: 10px; color: var(--ink-soft); margin-top: 1px; }
.focus-reason {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px;
}
.focus-trend { font-size: 11px; font-weight: 700; }
.focus-trend.up { color: var(--green); }
.focus-trend.down { color: var(--red); }
.section-title-sub { font-weight: 400; text-transform: none; font-size: 12px; margin-left: 4px; }

/* ============ PYQ CARDS ============ */
.pyq-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
  justify-content: space-between;
}
@media (hover: hover) { .pyq-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(224,69,123,.15); } }
.pyq-left  { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.pyq-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pyq-icon  { font-size: 24px; line-height: 1; flex-shrink: 0; }
.pyq-title { font-weight: 700; font-size: 15px; }
.pyq-meta  { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pyq-score { font-weight: 700; color: var(--green); font-size: 13px; }
.pyq-chevron { font-size: 22px; font-weight: 700; color: var(--ink-soft); }

/* ============ SECTIONAL GRID ============ */
.back-link { cursor: pointer; color: var(--primary); font-size: 14px; font-weight: 600; margin: 16px 0 4px; display: inline-block; }
.sectional-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.sectional-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 16px; gap: 6px; text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .sectional-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(224,69,123,.15); } }
.sec-icon  { font-size: 32px; line-height: 1; margin-bottom: 4px; }
.sec-name  { font-weight: 700; font-size: 14px; }
.sec-meta  { font-size: 12px; }
.sec-best  { font-size: 12px; font-weight: 700; color: var(--green); }

/* ============ RESPONSIVE ============ */

/* Mobile-only UI elements: hidden on desktop */
.palette-header-mobile { display: none; }
.palette-backdrop { display: none; }
.palette-fab { display: none; }
.attempt-btns { display: flex; gap: 6px; }

/* --- Tablet (≤860px): palette moves below question --- */
@media (max-width: 860px) {
  .exam-body { grid-template-columns: 1fr; }
  .palette { border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; }
  .palette-grid { grid-template-columns: repeat(8, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
  .exam { height: auto; }
}

/* --- Phone (≤600px): full mobile treatment --- */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .wrap { padding: 16px 14px 56px; }

  /* Topbar */
  #topbar { padding: 8px 14px; gap: 8px; }
  .brand .logo { width: 26px; height: 26px; font-size: 14px; }
  .brand small { display: none; }
  .brand .logo-img { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-controls { gap: 6px; }
  .feedback-btn { padding: 6px 10px; font-size: 12px; }

  /* Exam header: title+lang on row 1, timer+submit on row 2 */
  .exam-header { flex-wrap: wrap; padding: 8px 12px; gap: 6px; }
  .exam-title {
    flex: 1 1 auto; min-width: 0;
    font-size: 13px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .timer { order: 10; margin-left: 0; flex: 1; font-size: 15px; padding: 5px 10px; }
  .exam-header > .btn.primary { order: 11; padding: 7px 12px; font-size: 13px; }

  /* Section tabs: bigger tap targets */
  .section-tabs { padding: 4px 10px 0; gap: 2px; }
  .section-tabs button { padding: 9px 10px; font-size: 12px; }

  /* Question pane */
  .q-pane { padding: 14px 14px 100px; } /* bottom room for FAB */
  .q-stem { font-size: 16px; }
  .options { gap: 8px; }
  .option { padding: 14px 12px; font-size: 15px; }

  /* Action buttons: Previous left, Save & Next right */
  .q-actions { display: flex; gap: 8px; }
  .q-prev { flex: 1; }
  .q-next { flex: 2; }

  /* Palette: slide-up bottom sheet */
  .palette {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    max-height: 65vh !important;
    border-top: 2px solid var(--primary) !important;
    border-left: 0 !important;
    border-radius: 16px 16px 0 0;
    z-index: 40;
    transform: translateY(calc(100% + 2px));
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    display: flex !important;
    flex-direction: column;
  }
  .palette.open { transform: translateY(0); }
  .palette-grid { grid-template-columns: repeat(5, 1fr) !important; padding: 12px; gap: 7px; }
  .pcell { font-size: 12px; }

  /* Palette mobile header */
  .palette-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
  }
  .palette-close-btn {
    border: 0; background: transparent;
    font-size: 20px; color: var(--ink-soft);
    padding: 2px 8px; cursor: pointer;
    line-height: 1; font-family: inherit;
  }

  /* Backdrop */
  .palette-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 18, 36, .45);
    z-index: 39;
  }
  .palette-backdrop.open { display: block; }

  /* FAB: floating palette trigger — subtle, left-anchored */
  .palette-fab {
    position: fixed;
    bottom: 20px; left: 16px;
    background: rgba(255,255,255,0.92); color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600; font-size: 13px;
    box-shadow: 0 2px 8px rgba(80,20,50,.10);
    z-index: 38;
    display: flex;
    align-items: center; gap: 6px;
    cursor: pointer; font-family: inherit;
    backdrop-filter: blur(6px);
  }
  .palette-fab:active { transform: scale(.95); }

  /* Dashboard */
  .hero { gap: 12px; flex-direction: column; }
  .hero .card { min-width: 0; padding: 16px; }
  .test-grid { grid-template-columns: 1fr; gap: 10px; }
  .attempt-row { flex-wrap: wrap; padding: 12px 14px; gap: 8px; align-items: flex-start; }
  .attempt-score { min-width: auto; font-size: 20px; }
  .attempt-btns { width: 100%; padding-top: 8px; border-top: 1px solid var(--line); }

  /* Result */
  .big-score { font-size: 34px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat .n { font-size: 20px; }
  .result-hero { padding: 20px 16px; }

  /* Insights */
  .insight-grid .card { padding: 14px; }
  .bar-row { grid-template-columns: 90px 1fr 44px; font-size: 12px; }

  /* Review */
  .review-filters { gap: 6px; }
  .rev-q { padding: 14px; }

  /* Modal: bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-width: 100%; padding: 20px 16px 28px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; margin-top: 16px; }
  .modal-actions .btn { width: 100%; text-align: center; padding: 12px 16px; font-size: 15px; }
  .feedback-frame-wrap { height: 68vh; }
  .feedback-frame { border-radius: 10px; }

  /* Countdown */
  .countdown-banner { padding: 10px 14px; gap: 10px; }
  .countdown-num { font-size: 28px; min-width: 38px; }

  /* Compact hero */
  .compact-hero { padding: 14px; }
  .readiness-score { font-size: 22px; }

  /* PYQ cards */
  .pyq-card { padding: 14px; gap: 10px; }
  .pyq-title { font-size: 14px; }

  /* Focus row */
  .focus-chip { padding: 10px 14px; }

  /* Sectional grid: 2-col on phone */
  .sectional-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sectional-card { padding: 16px 12px; }
  .sec-icon { font-size: 26px; }
}
