/* ==========================================================================
   RajOMR AI — Mobile-first stylesheet
   No external dependencies (system fonts only) so the UI works offline and
   in sandboxed previews. Deploys as-is to GitHub Pages / Vercel.
   ========================================================================== */

:root {
  color-scheme: light;
  --maroon: #8a1c33;
  --maroon-dark: #5c1420;
  --maroon-ink: #8a1c33;
  --saffron: #e8821e;
  --saffron-soft: #fdf1e3;
  --gold: #f5b70a;
  --ink: #161a23;
  --ink-2: #3f4756;
  --muted: #667085;
  --line: #e8e3dd;
  --line-strong: #cfc8c0;
  --bg: #f6f3ef;
  --card: #ffffff;
  --card-2: #fbfaf8;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --green-border: #a7e3bb;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --red-border: #f6b4b4;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --violet: #a21caf;
  --violet-soft: var(--violet-soft);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 26, 35, .05), 0 8px 24px rgba(22, 26, 35, .06);
  --shadow-lg: 0 24px 60px rgba(22, 26, 35, .22);
  --focus: 0 0 0 4px rgba(232, 130, 30, .25);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- Header ---------- */
.app-header {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff;
  padding: 22px 16px 18px;
  margin-bottom: 18px;
}
.app-header .inner { max-width: 760px; margin: 0 auto; }
.app-header h1 { margin: 0; font-size: 26px; letter-spacing: .3px; }
.app-header h1 .ai { color: var(--saffron); }
.app-header p { margin: 4px 0 0; font-size: 13.5px; opacity: .85; }

/* ---------- Cards & sections ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.step-badge {
  display: inline-block;
  background: var(--maroon);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  margin-right: 6px;
  vertical-align: 2px;
}

/* ---------- Form controls ---------- */
label.field-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
label.field-label:first-of-type { margin-top: 0; }
select, input[type="number"], input[type="text"], input[type="tel"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
select:focus, input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-soft); }
.field-invalid, input.field-invalid, select.field-invalid, [aria-invalid="true"] {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-soft) !important;
}
.check-pill.field-invalid, .dropzone.field-invalid {
  border: 2px solid var(--red) !important;
  background: var(--red-soft) !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .12) !important;
}
optgroup { font-weight: 700; color: var(--maroon-ink); }

.radio-row, .check-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.radio-pill, .check-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; background: var(--card);
}
.radio-pill input, .check-pill input { accent-color: var(--maroon); width: 16px; height: 16px; }
.radio-pill:has(input:checked), .check-pill:has(input:checked) {
  border-color: var(--maroon); background: var(--saffron-soft); font-weight: 600;
}

/* ---------- Pattern card ---------- */
.pattern-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.pattern-item { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pattern-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.pattern-item .v { font-size: 17px; font-weight: 700; margin-top: 2px; }
.pattern-item .v.on { color: var(--green); }
.pattern-item .v.off { color: var(--muted); }
.exam-note { margin-top: 10px; font-size: 13px; color: var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; }

.formula-bar {
  margin-top: 12px;
  background: var(--maroon);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.formula-bar .lbl { opacity: .8; font-weight: 500; margin-right: 6px; }

/* ---------- Syllabus accordion ---------- */
.syllabus { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.syllabus summary {
  cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 14px;
  background: var(--saffron-soft); list-style: none;
}
.syllabus summary::-webkit-details-marker { display: none; }
.syllabus summary::after { content: "▾"; float: right; color: var(--saffron); }
.syllabus[open] summary::after { content: "▴"; }
.syllabus ul { margin: 0; padding: 12px 14px 12px 32px; font-size: 14px; }
.syllabus li { margin: 3px 0; }

/* ---------- Upload zones ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .upload-grid { grid-template-columns: 1fr 1fr; } }
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--card-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--saffron); background: var(--saffron-soft); }
.dropzone .icon { font-size: 30px; }
.dropzone .title { font-weight: 700; font-size: 15px; margin-top: 6px; }
.dropzone .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.dropzone .req { color: var(--red); font-weight: 700; }
.dropzone .file-info { margin-top: 10px; font-size: 13px; }
.dropzone .file-info img { max-width: 100%; max-height: 150px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--line); }
.dropzone .file-info .fname { font-weight: 600; word-break: break-all; }
.dropzone .file-info .fsize { color: var(--muted); font-size: 12px; }
.dropzone .remove-btn {
  margin-top: 8px; background: none; border: none; color: var(--red);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px;
}
.compress-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: block; width: 100%;
  background: var(--maroon); color: #fff;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700;
  padding: 15px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--maroon-dark); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { background: #c9a0a6; cursor: not-allowed; }
.btn-ghost {
  display: inline-block; width: 100%; text-align: center;
  background: var(--card); color: var(--maroon);
  border: 1.5px solid var(--maroon); border-radius: 12px;
  font-size: 15px; font-weight: 700; padding: 12px;
  cursor: pointer; text-decoration: none;
}
.error-msg { display: none; background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.error-msg.show { display: block; }

/* ---------- Result page ---------- */
.demo-banner {
  background: var(--amber-soft); color: var(--amber);
  border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px;
}
.score-hero { text-align: center; padding: 24px 18px; }
.score-hero .big { font-size: 52px; font-weight: 800; color: var(--maroon-ink); line-height: 1; }
.score-hero .of { font-size: 16px; color: var(--muted); margin-top: 4px; }
.score-hero .pct { display: inline-block; margin-top: 10px; background: var(--green-soft); color: var(--green); font-weight: 700; border-radius: 999px; padding: 4px 14px; font-size: 14px; }
.alert-danger {
  background: var(--red-soft); color: var(--red);
  border: 1.5px solid var(--red); border-radius: var(--radius);
  padding: 14px 16px; font-weight: 700; font-size: 15px; margin-bottom: 16px; text-align: center;
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; }
.stat .n { font-size: 22px; font-weight: 800; }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }
.stat.correct .n { color: var(--green); }
.stat.wrong .n, .stat.blank .n, .stat.multiple .n { color: var(--red); }
.stat.e .n { color: var(--saffron); }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-row .lbl { width: 74px; text-align: right; color: var(--muted); }
.bar-track { flex: 1; background: var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-row .val { width: 34px; font-weight: 700; }

.review-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.review-table th, .review-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.review-table th { background: var(--bg); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.review-table td.q { font-weight: 700; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.pill.correct { background: var(--green-soft); color: var(--green); }
.pill.wrong, .pill.blank, .pill.multiple { background: var(--red-soft); color: var(--red); }
.pill.e { background: var(--saffron-soft); color: var(--amber); }
.pill.deleted, .pill.no-key { background: var(--bg); color: var(--muted); }

.footer { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 24px; }
.hidden { display: none !important; }

/* ---------- Privacy banner (Module 7) ---------- */
.privacy-banner {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.tab-btn {
  flex: 1; min-width: 0;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap;
}
.tab-btn.active { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.tab-panel { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Scorecard hero metrics ---------- */
.hero-metrics { display: flex; justify-content: center; gap: 28px; margin-top: 16px; }
.hero-metric { text-align: center; }
.hero-metric span { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.hero-metric label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.rank-note { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }

/* ---------- Verification ---------- */
.omr-canvas {
  width: 100%; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.verify-controls { display: flex; align-items: center; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.verify-controls label { font-size: 13px; font-weight: 600; }
.verify-controls input { width: 70px; padding: 8px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.btn-mini {
  background: var(--card); border: 1.5px solid var(--maroon); color: var(--maroon);
  border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer; font-size: 13px;
}
.verify-detail { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.vd-head { font-size: 14px; margin-bottom: 10px; }
.vd-options { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-btn {
  min-width: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; font-size: 14px;
}
.opt-btn.chosen { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.verify-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-bottom: 14px; }
.verify-cell {
  aspect-ratio: 1; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0;
}
.verify-cell.selected { outline: 3px solid var(--saffron); outline-offset: 1px; }
.v-correct { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.v-wrong { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.v-e { background: var(--saffron-soft); border-color: var(--saffron); color: var(--amber); }
.v-blank { color: var(--muted); }
.v-multiple { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.v-uncertain { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }
.v-review { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.verify-actions { margin-top: 6px; }

/* ---------- Solutions ---------- */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted);
}
.filter-btn.active { background: var(--maroon); color: #fff; border-color: var(--maroon); }
#solutionSearch { margin-bottom: 14px; }
.solution-item {
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px; background: var(--card);
}
.solution-item.status-correct { border-left-color: var(--green); }
.solution-item.status-wrong, .solution-item.status-multiple { border-left-color: var(--red); }
.solution-item.status-uncertain, .solution-item.status-review_required { border-left-color: var(--violet); }
.solution-item.status-e, .solution-item.status-blank { border-left-color: var(--line-strong); }
.sol-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sol-q { font-weight: 800; font-size: 16px; color: var(--maroon-ink); }
.sol-marks { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--muted); }
.sol-marks.plus { color: var(--green); }
.sol-marks.minus { color: var(--red); }
.sol-question { margin-bottom: 12px; }
.q-line { margin: 0 0 8px; font-size: 15px; line-height: 1.7; color: var(--ink); }
.q-line.lang-en { color: var(--ink-2); padding-top: 8px; border-top: 1px dashed var(--line); }
.q-line.lang-hi:only-child, .q-line.lang-en:only-child { border-top: 0; padding-top: 0; }
.sol-options { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.sol-opt {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: start; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--card-2);
}
.sol-opt.is-correct { border-color: var(--green-border); background: var(--green-soft); }
.sol-opt.is-wrong { border-color: var(--red-border); background: var(--red-soft); }
.opt-letter {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--ink); background: var(--card);
}
.sol-opt.is-correct .opt-letter { background: var(--green); border-color: var(--green); color: #fff; }
.sol-opt.is-wrong .opt-letter { background: var(--red); border-color: var(--red); color: #fff; }
.opt-line { margin: 0; font-size: 14px; line-height: 1.55; }
.opt-line.lang-en { color: var(--ink-2); font-size: 13.5px; }
.opt-line.muted { color: var(--muted); }
.opt-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.opt-tag { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.opt-tag.ok { background: var(--green); color: #fff; }
.opt-tag.mine { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); }
.sol-answer { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
.sol-body { font-size: 14px; }
.sol-exp { margin-top: 4px; font-size: 14px; background: var(--bg); border-radius: 10px; padding: 11px 13px; line-height: 1.65; }
.sol-exp .exp-title { font-weight: 700; font-size: 13px; color: var(--maroon-ink); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.exp-line { margin: 0 0 6px; }
.exp-line:last-child { margin-bottom: 0; }
.exp-line.lang-en { color: var(--ink-2); }
.sol-exp.muted { color: var(--muted); }
.sol-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.report-wrong { border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 10px; background: var(--card); cursor: pointer; font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) {
  .solution-item { padding: 13px 12px; }
  .sol-opt { grid-template-columns: 28px 1fr; }
  .opt-tags { grid-column: 2; flex-direction: row; align-items: center; }
}

/* ---------- Share ---------- */
.share-card { text-align: center; }

/* ---------- 40% Qualifying banner (viral scorecard) ---------- */
.qualify-banner {
  border-radius: var(--radius);
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
}
.qualify-banner.qualified {
  background: linear-gradient(135deg, #fef3c7 0%, #d1fae5 100%);
  color: var(--green);
  border: 2px solid #f5c518;
  box-shadow: 0 0 0 4px rgba(245, 197, 24, .15), var(--shadow);
}
.qualify-banner.encourage {
  background: var(--saffron-soft);
  color: var(--amber);
  border: 1.5px solid var(--saffron);
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 16px;
  font-weight: 700;
}


.btn-whatsapp {
  display:block; width:100%; border:0; border-radius:12px; padding:14px 16px;
  background:#128c7e; color:#fff; font:inherit; font-weight:800; cursor:pointer;
}
.btn-whatsapp:hover { background:#0c7569; }

.wa-footer .btn-whatsapp {
  display: inline-block;
  width: auto;
  padding: 12px 18px;
  text-decoration: none;
}
.wa-footer .btn-whatsapp:focus-visible {
  outline: 3px solid #0c7569;
  outline-offset: 2px;
}

/* Compact floating WhatsApp help button — stays reachable while scrolling */
.floating-wa {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #25d366;              /* WhatsApp brand green */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), 0 0 0 3px rgba(255, 255, 255, .9);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.floating-wa:hover,
.floating-wa:focus-visible {
  background: #1ebe5b;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .32), 0 0 0 3px rgba(255, 255, 255, .95);
  outline: none;
}
.floating-wa:focus-visible { outline: 3px solid #101d34; outline-offset: 4px; }
.wa-icon { width: 34px; height: 34px; display: block; flex: none; overflow: visible; }
.wa-pill {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #101d34;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  opacity: .92;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .floating-wa { transition: none; }
}
@media (max-width: 480px) {
  .wa-pill { display: none; }
  .floating-wa { width: 54px; height: 54px; }
}

/* Question-paper page photo thumbnails */
.paper-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dropzone .file-info .paper-thumbs img { margin-top: 0; max-height: none; width: 48px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); }
.paper-thumbs .more { align-self: center; font-size: 12px; font-weight: 700; opacity: .8; }

/* Share scorecard live preview (4:5 portrait card) */
.share-preview { display: block; width: 100%; max-width: 360px; height: auto; margin: 14px auto 0; border-radius: 14px; box-shadow: 0 10px 30px rgba(17, 6, 12, 0.35); }

/* CET "paper dekh kar pehchaanein" picker */
.cet-picker-btn { margin: 6px 0 4px; font-size: 14px; padding: 10px; }
.cet-picker { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; background: var(--card-2); }
.cet-picker-head { font-weight: 700; margin: 0 0 6px; color: var(--maroon-ink); }
.cet-picker-list { margin: 0 0 10px; padding-left: 22px; max-height: 360px; overflow-y: auto; }
.cet-picker-list li { margin-bottom: 8px; }
.cet-picker-q { font-size: 14px; line-height: 1.4; }
.cet-picker-opts { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.cet-picker-nav { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; }
.cet-picker-nav button { width: 100%; padding: 10px 6px; font-size: 13px; }
.cet-picker-nav button:disabled { opacity: .45; cursor: not-allowed; }

/* "<coaching> answer key ke anusaar" line under the score */
.key-attribution { margin: 10px 0 0; font-size: 13px; font-weight: 600; opacity: .95; }
.unscored-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line, #d8dce3); background: var(--card-soft, #f5f7fa); font-size: 13px; font-weight: 600; }

/* ==========================================================================
   v2 layer (Nov 2026): hero, live stepper, upload states, evaluation sheet,
   score ring, polished controls, automatic dark mode. Keeps every class
   name used by app.js / result.js.
   ========================================================================== */
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  background:
    radial-gradient(1200px 420px at 50% -120px, color-mix(in srgb, var(--saffron) 10%, transparent), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: none; box-shadow: var(--focus); }
a { color: var(--maroon-ink); }

/* Header → hero */
.app-header {
  position: relative; overflow: hidden; padding: 26px 16px 24px; margin-bottom: 18px;
  background:
    radial-gradient(520px 260px at 92% -30%, rgba(245, 183, 10, .35), transparent 65%),
    radial-gradient(480px 300px at -10% 120%, rgba(232, 130, 30, .28), transparent 60%),
    linear-gradient(135deg, #8a1c33 0%, #5c1420 70%, #47101a 100%);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 12px 30px rgba(92, 20, 32, .25);
}
.app-header::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 18px 18px;
}
.app-header .inner { position: relative; z-index: 1; }
.app-header h1 { font-size: 28px; font-weight: 850; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.app-header h1::before {
  content: "R"; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: 19px; font-weight: 900;
  background: linear-gradient(135deg, #f7cf4a, #e0a106); color: #5c1220; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.app-header h1 .ai { color: #ffc93c; }
.app-header p { font-size: 14px; opacity: .9; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.hero-chips li {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(4px);
}
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: how; }
.how-steps li { counter-increment: how; background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 9px 10px; font-size: 12.5px; line-height: 1.35; color: rgba(255, 255, 255, .92); }
.how-steps li::before { content: counter(how); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: #ffc93c; color: #5c1220; font-weight: 900; font-size: 11.5px; }
.how-steps strong { color: #fff; }

/* Cards, headings, badges */
.card { border-radius: var(--radius); padding: 20px; margin-bottom: 16px; scroll-margin-top: 132px; }
.card h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 2px; }
.step-badge {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; margin-right: 8px; vertical-align: 0;
  border-radius: 9px; font-size: 13px; background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff;
}
.privacy-banner { display: flex; gap: 8px; align-items: flex-start; border-radius: 12px; font-size: 13px; }

/* Controls: 48px tap targets */
select, input[type="number"], input[type="text"], input[type="tel"] { min-height: 48px; border-radius: 12px; background-color: var(--card); color: var(--ink); }
select:focus, input:focus { border-color: var(--saffron); box-shadow: var(--focus); }
.radio-pill, .check-pill { min-height: 44px; background: var(--card); }
#requiredConsentLabel { display: block; position: relative; border-radius: 14px; padding: 12px 14px 12px 42px; line-height: 1.5; font-size: 13.5px; }
#requiredConsentLabel input { position: absolute; left: 14px; top: 14px; margin: 0; width: 18px; height: 18px; }

/* Upload zones */
.dropzone { position: relative; border-radius: 16px; padding: 22px 14px; background: var(--card-2); transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.dropzone:hover, .dropzone.drag { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(232, 130, 30, .14); }
.dropzone.drag { border-style: solid; }
.dropzone .icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--saffron-soft); font-size: 28px; }
.dropzone:has(.file-info .fname) { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.dropzone:has(.file-info .fname)::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 900; font-size: 14px;
}
.dropzone:has(.file-info .fname) .icon { background: var(--card); }
.dropzone .file-info .fname { color: var(--ink); }
.dropzone .remove-btn { border-radius: 8px; }
.dropzone .remove-btn:hover { background: var(--red-soft); }

/* Buttons */
.btn-primary {
  min-height: 56px; border-radius: 14px; font-size: 17px; letter-spacing: .01em;
  background: linear-gradient(135deg, #a3243b 0%, var(--maroon) 45%, var(--maroon-dark) 100%);
  box-shadow: 0 10px 24px rgba(138, 28, 51, .28), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-primary:hover { background: linear-gradient(135deg, #b02a43 0%, #7a1a2e 100%); }
.btn-primary:disabled { background: #c9a0a6; box-shadow: none; }
.btn-ghost { border-radius: 12px; background: var(--card); color: var(--maroon-ink); border-color: currentColor; }
.btn-mini { background: var(--card); color: var(--maroon-ink); border-color: currentColor; }

/* Live stepper (index) */
.stepper {
  position: sticky; top: 8px; z-index: 50; margin: -4px 0 16px; padding: 10px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stepper ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.stepper li button {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0; border: 0; background: none;
  font: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; border-radius: 10px;
}
.stepper .dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 850;
  border: 2px solid var(--line-strong); color: var(--muted); background: var(--card); transition: all .2s;
}
.stepper li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.done .dot span { display: none; }
.stepper li.done .dot::after { content: "✓"; }
.stepper li.current .dot { border-color: var(--maroon); color: var(--maroon-ink); box-shadow: 0 0 0 4px var(--saffron-soft); }
.stepper li.current button, .stepper li.done button { color: var(--ink); }
.stepper .bar { height: 4px; border-radius: 99px; background: var(--line); margin: 8px 2px 0; overflow: hidden; }
.stepper .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--saffron), var(--green)); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.stepper .next { margin: 7px 2px 0; font-size: 12.5px; color: var(--ink-2); text-align: center; min-height: 18px; }
.stepper .next strong { color: var(--maroon-ink); }
.stepper.all-done .next { color: var(--green); font-weight: 700; }

/* Evaluation progress sheet */
.eval-sheet { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: end center; background: rgba(10, 12, 18, .55); backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
@media (min-width: 640px) { .eval-sheet { place-items: center; } }
.eval-card {
  width: min(460px, 100%); background: var(--card); color: var(--ink); border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) { .eval-card { border-radius: 22px; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
.eval-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.eval-spinner { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--saffron-soft); border-top-color: var(--maroon); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eval-top h3 { margin: 0; font-size: 18px; }
.eval-top p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.eval-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.eval-stages li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; font-size: 14px; color: var(--muted); }
.eval-stages li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); }
.eval-stages li.done { color: var(--ink); }
.eval-stages li.done::before { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--card); }
.eval-stages li.active { color: var(--ink); font-weight: 700; background: var(--saffron-soft); }
.eval-stages li.active::before { border-color: var(--maroon); border-top-color: transparent; animation: spin .8s linear infinite; }
.eval-status { margin: 12px 2px 0; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.eval-foot { margin: 10px 2px 0; font-size: 12px; color: var(--muted); }

/* Result page */
.tabs { position: sticky; top: 8px; z-index: 40; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tab-btn { border: 0; border-radius: 10px; background: transparent; min-height: 42px; }
.tab-btn.active { box-shadow: 0 6px 14px rgba(138, 28, 51, .25); }
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.score-hero { position: relative; overflow: hidden; padding: 26px 18px 22px; }
.score-hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 6px;
  background: linear-gradient(90deg, var(--saffron), var(--gold), var(--green));
}
.score-ring {
  --p: 0; position: relative; width: 196px; height: 196px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-content: center;
  background: conic-gradient(var(--ring, var(--maroon)) calc(var(--p) * 1%), var(--line) 0);
  transition: --p 1.1s cubic-bezier(.2, .8, .2, 1);
}
.score-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--card); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .06); }
.score-ring > * { position: relative; }
.score-ring .big { font-size: 46px; }
.score-ring .of { font-size: 13.5px; margin-top: 6px; }
.score-ring.pass { --ring: var(--green); }
.hero-metrics { gap: 10px; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 420px; margin: 16px auto 0; }
.hero-metric { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; }
.stat { border-radius: 12px; background: var(--card-2); }
.stat .n { font-variant-numeric: tabular-nums; }
.qualify-banner { border-radius: 16px; }
.footer a { color: var(--muted); }

/* Dark mode (follows the phone/PC setting) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --maroon: #b8314c; --maroon-dark: #8a1c33; --maroon-ink: #ff8da0;
    --saffron: #f59e3d; --saffron-soft: #33220f; --gold: #f5c518;
    --ink: #eceef3; --ink-2: #c3c8d2; --muted: #9aa1ae;
    --line: #2a2f3a; --line-strong: #3a4150;
    --bg: #0e0f13; --card: #171a21; --card-2: #1c2029;
    --green: #4ade80; --green-soft: #0f2a1d; --green-border: #1f5a37;
    --red: #f87171; --red-soft: #3a1618; --red-border: #6b2424;
    --amber: #fbbf24; --amber-soft: #33270a;
    --violet: #e879f9; --violet-soft: #3a1440;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    --focus: 0 0 0 4px rgba(245, 158, 61, .3);
  }
  .opt-tag.ok, .sol-opt.is-correct .opt-letter, .sol-opt.is-wrong .opt-letter, .stepper li.done .dot,
  .dropzone:has(.file-info .fname)::after { color: #0e0f13; }
  .btn-primary:disabled { background: #4a2a31; color: #c9a0a6; }
  .qualify-banner.qualified { background: linear-gradient(135deg, #2e2608 0%, #0f2a1d 100%); }
  .alert-warning { background: #2d2208; color: #fcd34d; border-color: #a16207; }
  .app-header { box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
  .score-ring::before { box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4); }
}
.check-row {
  display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; padding: 11px 13px; min-height: 48px; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
}
.check-row input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--maroon); }
.check-row:has(input:checked) { border-color: var(--maroon); background: var(--saffron-soft); }
@media (max-width: 480px) {
  .app-header { padding: 20px 14px 18px; }
  .app-header h1 { font-size: 24px; }
  .hero-chips { gap: 6px; margin-top: 12px; }
  .hero-chips li { padding: 4px 9px; font-size: 11.5px; }
  .how-steps { gap: 6px; }
  .how-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; font-size: 11.5px; }
  .how-steps li::before { margin: 0; }
}
@media (max-width: 420px) {
  .score-ring { width: 176px; height: 176px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Optional-field tag + "Mera Result" lookup page */
.optional-tag { font-weight: 400; color: var(--muted, #667085); font-size: .9em; }
.lookup-results { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.lookup-results li { border: 1px solid var(--line, #e4e7ec); border-radius: 12px; padding: 12px 14px; background: #fff; }
.lookup-results .lr-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.lookup-results .lr-meta { color: var(--muted, #667085); font-size: .92em; margin: 4px 0 8px; }
.lookup-results button { width: auto; padding: 8px 14px; }

/* CET parchi symbol picker (series / symbol shown on the candidate's slip) */
.symbol-intro { margin: 6px 0 4px; }
.symbol-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin: 0 0 6px; }
.symbol-chip { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.symbol-chip .symbol-glyph { font-size: 22px; line-height: 1; min-width: 24px; text-align: center; }
.symbol-chip.selected { border-color: var(--maroon); box-shadow: 0 0 0 2px var(--maroon) inset; font-weight: 600; }
.symbol-chip:focus-visible { outline: 3px solid var(--maroon); outline-offset: 2px; }
.pending-key-card { border: 1px solid #f59e0b; background: #fffbeb; color: #78350f; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.pending-key-card h3 { margin: 0 0 6px; font-size: 17px; }
.pending-key-card p { margin: 4px 0; }
.symbol-chips.field-invalid { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 10px; }

/* CET parchi photo -> paper code (DataMatrix) + symbol suggestion */
.slip-scan { border: 1px dashed var(--maroon); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; background: var(--saffron-soft); }
.slip-scan .field-label { margin-top: 0; }
.slip-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--maroon); color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.slip-scan-btn { width: 100%; min-height: 48px; }
.slip-result { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-strong); }
.slip-result img { flex: none; width: 96px; height: 96px; border-radius: 8px; border: 2px solid var(--maroon); background: #000; image-rendering: auto; }
.slip-result-text { flex: 1; min-width: 0; }
.slip-result-text p { margin: 0 0 6px; }
.slip-result.slip-ok { border-color: #16a34a; }
.slip-result.slip-warn { border-color: #f59e0b; background: #fffbeb; }
#cetSlipConfirmLabel.field-invalid { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 10px; }
