/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --accent: #f59e0b;
  --accent-dim: #b45309;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;

  /* tile accent colours */
  --notes-color: #3b82f6;

  /* General Studies & Hindi tile colours */
  --gs-color: #06b6d4;
  --hindi-color: #f43f5e;

  --practice-color: #10b981;
  --pyq-color: #f59e0b;
  --bm-color: #a855f7;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* ===== Screen system ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ===== Login ===== */
#loginScreen {
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.login-card {
  background: var(--surface);
  padding: 40px 28px;
  border-radius: var(--radius);
  text-align: center;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
}
.logo { font-size: 56px; margin-bottom: 12px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.tagline { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.subtitle { color: var(--text-dim); font-size: 13px; margin-bottom: 32px; }
.btn-google {
  width: 100%;
  background: #fff;
  color: #1f2937;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s;
}
.btn-google:active { transform: scale(0.98); }
.footer-note { color: var(--text-dim); font-size: 12px; margin-top: 24px; }

/* ===== App Header ===== */
.app-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.header-left h2 { font-size: 18px; font-weight: 700; color: var(--accent); }
.header-sub { font-size: 12px; color: var(--text-dim); }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--accent); }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-icon:active { background: var(--surface-2); }

/* ===== Welcome Strip ===== */
.welcome-strip {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.welcome-strip p { font-size: 14px; color: var(--text-dim); }
#userName { color: var(--accent); font-weight: 600; }

/* ===== HOME: 2x2 Tile Grid ===== */
.home-main { flex: 1; padding: 20px 16px; overflow-y: auto; }

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}
.home-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.home-tile:active { transform: scale(0.96); background: var(--surface-2); }

.tile-notes::before   { background: var(--notes-color); }
.tile-practice::before { background: var(--practice-color); }
.tile-pyq::before     { background: var(--pyq-color); }
.tile-bookmarks::before { background: var(--bm-color); }
.tile-gs::before    { background: var(--gs-color); }
.tile-hindi::before { background: var(--hindi-color); }
.tile-gs    { border-color: rgba(6,182,212,0.2); }
.tile-hindi { border-color: rgba(244,63,94,0.2); }

/* ===== Enhanced Notes Cards — highlight colours ===== */
.notes-card-red    { border-left-color: #ef4444; }
.notes-card-teal   { border-left-color: #14b8a6; }
.notes-card-yellow { border-left-color: #eab308; }
.notes-card-pink   { border-left-color: #ec4899; }

/* Important highlight span inside notes points */
.hi-yellow { color: #fbbf24; font-weight: 700; }
.hi-green  { color: #34d399; font-weight: 700; }
.hi-red    { color: #f87171; font-weight: 700; }
.hi-blue   { color: #60a5fa; font-weight: 700; }
.hi-pink   { color: #f472b6; font-weight: 700; }

/* Notes alert variants */
.notes-alert-green {
  background: rgba(16,185,129,0.08); border-left: 3px solid #10b981;
  border-radius: 4px; padding: 12px 14px; margin-top: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.notes-alert-blue {
  background: rgba(59,130,246,0.08); border-left: 3px solid #3b82f6;
  border-radius: 4px; padding: 12px 14px; margin-top: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.notes-alert-orange {
  background: rgba(249,115,22,0.08); border-left: 3px solid #f97316;
  border-radius: 4px; padding: 12px 14px; margin-top: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
}

/* GS/Hindi specific topic bar */
#gsTopicBar, #hindiTopicBar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px 6px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}


.tile-icon { font-size: 32px; margin-bottom: 10px; }
.tile-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.tile-sub { font-size: 11px; color: var(--text-dim); line-height: 1.4; }

.tile-notes .tile-title   { color: var(--notes-color); }
.tile-practice .tile-title { color: var(--practice-color); }
.tile-pyq .tile-title     { color: var(--pyq-color); }
.tile-bookmarks .tile-title { color: var(--bm-color); }

/* ===== Subject / Exam Lists ===== */
.subjects-main { flex: 1; padding: 14px 16px; overflow-y: auto; }
.subjects-list { display: flex; flex-direction: column; gap: 10px; }

.subject-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  padding: 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}
.subject-card:active { transform: scale(0.98); border-color: var(--accent); background: var(--surface-2); }

.subject-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.subject-info { flex: 1; min-width: 0; }
.subject-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.subject-desc { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-count {
  font-size: 11px; font-weight: 700;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.subject-arrow { font-size: 20px; color: var(--accent); flex-shrink: 0; }

/* Exam cards (PYQ exam list) */
.exam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  padding: 18px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}
.exam-card:active { transform: scale(0.98); border-color: var(--accent); background: var(--surface-2); }
.exam-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.exam-info { flex: 1; min-width: 0; }
.exam-name { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.exam-state { font-size: 12px; color: var(--text-dim); }
.exam-arrow { font-size: 22px; color: var(--accent); flex-shrink: 0; }

/* ===== Topic Bar (scrollable chips) ===== */
.topic-bar-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topic-bar-scroll::-webkit-scrollbar { display: none; }
.topic-bar-scroll:empty { display: none; }

.topic-chip {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.topic-chip.active {
  background: var(--accent);
  color: #1a1500;
  border-color: var(--accent);
  font-weight: 700;
}
.topic-chip:active { opacity: 0.8; }

/* ===== Notes Content ===== */
.notes-container { display: flex; flex-direction: column; gap: 20px; }
.notes-section { display: flex; flex-direction: column; gap: 12px; }
.notes-topic-header {
  font-size: 15px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 8px; padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.notes-card {
  background: var(--surface);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
}
.notes-card-blue   { border-left-color: #3b82f6; }
.notes-card-purple { border-left-color: #a855f7; }
.notes-card-green  { border-left-color: #10b981; }
.notes-card-orange { border-left-color: #f97316; }

.notes-card-heading {
  font-size: 13px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.notes-formula { margin-bottom: 12px; }
.notes-formula-label { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.notes-formula-text {
  background: #0a1122; border: 1px solid var(--border); border-radius: 4px;
  padding: 10px 12px; font-size: 12px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--text-dim); overflow-x: auto; margin: 0;
  white-space: pre-wrap; word-break: break-word;
}
.notes-points { list-style: none; padding: 0; margin: 10px 0; }
.notes-points li {
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 7px; padding-left: 18px; position: relative;
}
.notes-points li::before { content: '•'; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }
.notes-table-wrapper { overflow-x: auto; margin: 10px 0; border-radius: 4px; border: 1px solid var(--border); }
.notes-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.notes-table thead { background: var(--surface-2); border-bottom: 2px solid var(--border); }
.notes-table th { padding: 9px 12px; text-align: left; font-weight: 700; color: var(--accent); }
.notes-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.notes-table tbody tr:last-child td { border-bottom: none; }
.notes-alert {
  background: rgba(239,68,68,0.08); border-left: 3px solid #ef4444;
  border-radius: 4px; padding: 12px 14px; margin-top: 10px;
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.notes-image { max-width: 100%; height: auto; border-radius: 4px; margin-top: 10px; border: 1px solid var(--border); }

/* ===== Bookmarks ===== */
.bookmarks-main { flex: 1; padding: 14px 16px; overflow-y: auto; }
.bookmarks-list { display: flex; flex-direction: column; gap: 8px; }
.practice-all-btn {
  width: 100%;
  background: var(--accent); color: #1f2937;
  padding: 12px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px;
  margin-bottom: 14px;
  transition: transform 0.1s;
}
.practice-all-btn:active { transform: scale(0.98); }
.bookmark-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--border);
  text-align: left; width: 100%; transition: all 0.15s;
}
.bookmark-card:active { transform: scale(0.98); border-color: var(--accent); background: var(--surface-2); }
.bookmark-num {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--surface-2); border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bookmark-content { flex: 1; min-width: 0; }
.bookmark-subject { font-size: 10px; color: var(--accent); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.bookmark-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.bookmark-arrow { font-size: 18px; color: var(--text-dim); flex-shrink: 0; }

/* ===== Quiz Screen ===== */
.quiz-header {
  display: flex; align-items: center;
  padding: 12px 14px; gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.quiz-header-center { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.quiz-progress-bar { width: 100%; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; }
.quiz-progress-text { font-size: 12px; font-weight: 600; color: var(--text-dim); }

#quizBookmarkBtn[data-marked="1"] { color: var(--accent); }

.quiz-main { flex: 1; padding: 18px 16px; overflow-y: auto; }

.quiz-meta { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.quiz-meta span {
  background: var(--surface); color: var(--text-dim);
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  border: 1px solid var(--border);
}
#quizExamTag {
  background: #0c2a0c; color: #4ade80;
  border-color: #166534;
  font-size: 11px; font-weight: 700;
  text-transform: none;
  padding: 4px 12px; border-radius: 20px;
  display: block; width: 100%; box-sizing: border-box;
  margin-bottom: 6px; text-align: center;
}
#quizExamTag.hidden { display: none; }

.quiz-question { font-size: 16px; font-weight: 500; line-height: 1.65; margin-bottom: 22px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
  background: var(--surface); padding: 13px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  text-align: left; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  transition: all 0.15s;
}
.quiz-option:active { background: var(--surface-2); }
.quiz-option.correct { border-color: var(--success); background: rgba(16,185,129,0.1); }
.quiz-option.wrong   { border-color: var(--error);   background: rgba(239,68,68,0.1); }
.opt-letter { font-weight: 700; color: var(--accent); flex-shrink: 0; }

.quiz-explanation {
  margin-top: 20px; padding: 14px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.quiz-explanation h4 { font-size: 12px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.quiz-explanation p  { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.quiz-footer {
  display: flex; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
  flex: 1; padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px;
  transition: transform 0.1s;
}
.btn-primary  { background: var(--accent); color: #1f2937; }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 40px 20px;
  background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-top: 16px;
}
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.hint-small { font-size: 11px !important; color: var(--text-dim); opacity: 0.7; margin-top: 14px !important; }
.hint-small code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--accent); font-size: 11px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-2); color: var(--text);
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; opacity: 0; transition: all 0.3s;
  z-index: 1000; border: 1px solid var(--accent);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 380px) {
  .home-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-tile { padding: 18px 12px 16px; }
  .tile-icon { font-size: 26px; }
  .tile-title { font-size: 13px; }
}

/* ===== Notes Screen ===== */
.notes-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notes-topic-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.notes-topic-bar::-webkit-scrollbar { display: none; }
.notes-topic-bar:empty { display: none; }

#notesRendered {
  padding: 14px 16px;
  flex: 1;
}

/* Admin panel exam row hidden state */
#examRow.hidden { display: none !important; }

/* PYQ Mode tiles reuse home-grid but need full width on small screens */
#pyqModeScreen .home-grid {
  grid-template-columns: 1fr 1fr;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== Quiz Sr No & Meta Row ===== */
.quiz-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.btn-grid {
  font-size: 20px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-grid:active { background: var(--surface-2); }

.quiz-sr-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 6px;
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 10px;
}

/* ===== Jump Panel ===== */
.jump-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.jump-panel.hidden { display: none !important; }

.jump-panel-inner {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.jump-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.jump-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.jump-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  overflow-y: auto;
  padding-bottom: 8px;
}
.jump-btn {
  aspect-ratio: 1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.jump-btn.current  { background: var(--accent); color: #1f2937; border-color: var(--accent); }
.jump-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }
.jump-btn.wrong    { background: var(--error);   color: #fff; border-color: var(--error); }
.jump-btn:active   { opacity: 0.8; transform: scale(0.95); }

/* ── Phone Auth Styles ─────────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0; color: #475569; font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: #1e293b;
}
.btn-phone {
  width: 100%; padding: 13px; border-radius: 12px;
  background: #1e293b; color: #94a3b8; border: 1px solid #334155;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.btn-phone:hover { background: #334155; color: #e2e8f0; }
.btn-primary-auth {
  width: 100%; padding: 13px; border-radius: 12px;
  background: #3b82f6; color: #fff; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-bottom: 8px; transition: background .2s;
}
.btn-primary-auth:hover { background: #2563eb; }
.btn-primary-auth:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
.btn-ghost {
  width: 100%; padding: 9px; border-radius: 10px;
  background: transparent; color: #64748b; border: none;
  font-size: 13px; cursor: pointer; margin-bottom: 4px;
}
.btn-ghost:hover { color: #94a3b8; }
.auth-step-label {
  font-size: 13px; color: #94a3b8; margin: 0 0 14px;
  text-align: center; line-height: 1.5;
}
.phone-input-row {
  display: flex; align-items: center; gap: 8px;
  background: #0f172a; border: 1px solid #334155;
  border-radius: 10px; padding: 0 12px; margin-bottom: 10px;
}
.country-code {
  color: #94a3b8; font-size: 14px; font-weight: 600;
  border-right: 1px solid #334155; padding-right: 10px;
}
.phone-input-row input {
  flex: 1; background: transparent; border: none;
  color: #e2e8f0; font-size: 14px; padding: 11px 0; outline: none;
}
.otp-row input {
  width: 100%; padding: 14px; border-radius: 10px;
  border: 1px solid #334155; background: #0f172a;
  color: #e2e8f0; font-size: 20px; font-weight: 700;
  text-align: center; letter-spacing: 6px; box-sizing: border-box;
  margin-bottom: 10px; outline: none;
}
.otp-row input:focus { border-color: #3b82f6; }
.auth-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid #334155; background: #0f172a;
  color: #e2e8f0; font-size: 14px; box-sizing: border-box;
  margin-bottom: 10px; outline: none;
}
.auth-input:focus { border-color: #3b82f6; }

/* ===== Sub-subject cards (GS deeper navigation) ===== */
.subject-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  text-align: left; width: 100%; transition: all 0.15s;
}
.subject-card:active { transform: scale(0.98); border-color: var(--accent); background: var(--surface-2); }
.subject-icon { font-size: 28px; flex-shrink: 0; }
.subject-info { flex: 1; min-width: 0; }
.subject-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.subject-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.subject-arrow { font-size: 20px; color: var(--text-dim); flex-shrink: 0; }
.subjects-main { flex: 1; padding: 12px 14px; overflow-y: auto; }
.subjects-list { display: flex; flex-direction: column; gap: 8px; }

/* ===== Notes topic bar (sticky) ===== */
.notes-topic-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px 8px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.notes-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
#notesTopicBar { display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px 8px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5; }
.notes-container { padding: 14px; display: flex; flex-direction: column; gap: 20px; }

/* Tile tile-gs hover color */
.tile-gs:active   { border-color: rgba(6,182,212,0.5); }
.tile-hindi:active { border-color: rgba(244,63,94,0.5); }

/* ════════════════════════════════════════════════════════════════════
   ANDROID APP FIXES (safe-area, reCAPTCHA badge, larger back button)
   ════════════════════════════════════════════════════════════════════ */

/* 1. Hide the reCAPTCHA badge — not needed in the native app */
.grecaptcha-badge {
  visibility: hidden !important;
  display: none !important;
  opacity: 0 !important;
}

/* 2. Keep the Prev/Next quiz footer above Android's system nav bar.
      env(safe-area-inset-bottom) is the height of the gesture/nav bar. */
.quiz-footer {
  /* Guaranteed clearance: at least 24px, plus the system nav bar height.
     The max() ensures buttons clear the nav bar even if env() reports 0. */
  padding-bottom: max(24px, calc(12px + env(safe-area-inset-bottom, 0px))) !important;
}

/* Also lift the floating toast above the nav bar */
.toast {
  bottom: calc(30px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 3. Make the top-left back button (and other header icons) larger
      and easier to tap */
.btn-icon {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

/* The back button specifically — make it stand out a bit more */
.back-btn {
  width: 46px;
  height: 46px;
  font-size: 26px;
  font-weight: 700;
}

/* 4. Give the whole app a little breathing room at the very bottom on
      screens that scroll, so content never hides under the nav bar */
body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── v12: New home tiles ───────────────────────────────────────────────── */
.tile-civil {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  border: 1px solid #2563eb44;
}
.tile-pcb {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  border: 1px solid #10b98144;
}
.tile-nontech {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
  border: 1px solid #7c3aed44;
}
/* Make 3 tiles fill nicely on home */
#homeScreen .home-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 480px) {
  #homeScreen .home-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── PCB Notes rendered HTML content ─────────────────────────────────────── */
.pcb-notes-content {
  padding: 12px 4px 40px;
  color: #e2e8f0;
}
.pcb-notes-content h2 {
  color: #fff;
  background: #1e3a5f;
  padding: 10px 14px;
  margin: 24px 0 12px;
  border-left: 4px solid #60a5fa;
  font-size: 14px;
  border-radius: 0 6px 6px 0;
  scroll-margin-top: 120px;
}
.pcb-notes-content h3 {
  color: #93c5fd;
  font-size: 13px;
  margin: 16px 0 8px;
  border-bottom: 1px solid #334155;
  padding-bottom: 4px;
}
.pcb-notes-content h4 {
  color: #bfdbfe;
  font-size: 13px;
  margin: 12px 0 6px;
}
.pcb-notes-content p,
.pcb-notes-content li,
.pcb-notes-content .content {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.pcb-notes-content ul,
.pcb-notes-content ol {
  padding-left: 18px;
  margin-bottom: 10px;
}
.pcb-notes-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12px;
}
.pcb-notes-content th {
  background: #1e3a5f;
  color: #e2e8f0;
  padding: 8px;
  text-align: left;
  border: 1px solid #334155;
}
.pcb-notes-content td {
  border: 1px solid #334155;
  padding: 7px 8px;
  color: #cbd5e1;
  background: #0f172a;
}
.pcb-notes-content tr:nth-child(even) td {
  background: #1e293b;
}
.pcb-notes-content .highlight,
.pcb-notes-content .exam-tip {
  background: #422006;
  border-left: 4px solid #f59e0b;
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  margin: 10px 0;
  font-size: 13px;
  color: #fde68a;
}
.pcb-notes-content .formula-box,
.pcb-notes-content .formula {
  background: #0c1a2e;
  border: 1px solid #2563eb;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #93c5fd;
  margin: 10px 0;
  overflow-x: auto;
}
.pcb-notes-content .important,
.pcb-notes-content .key-point {
  background: #064e3b;
  border-left: 4px solid #10b981;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0;
  font-size: 13px;
  color: #6ee7b7;
}
.pcb-notes-content .warning,
.pcb-notes-content .note {
  background: #1e1b4b;
  border-left: 4px solid #818cf8;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0;
  font-size: 13px;
  color: #c7d2fe;
}
/* Override any light background from original HTML */
.pcb-notes-content .container,
.pcb-notes-content > div {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: 100% !important;
}
.pcb-notes-content .subtitle { display: none; }

/* Unit 7 & 11: section-header divs as scroll targets */
.pcb-notes-content div.section-header {
  scroll-margin-top: 120px;
}

/* ── Report Question Button ─────────────────────────── */
.report-question-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(245,158,11,0.08);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.2px;
}
.report-question-btn:active { opacity: 0.7; }
