/* ─── 5-Mark Concept Guide / Tab Pages ──────────────────────────────────── */

/* Section tab nav */
.section-nav { margin-bottom: 16px }
.section-nav-inner { display: flex; gap: 6px; flex-wrap: wrap }
/* .tab base in base.css */

/* Tab panels */
.tab-section { display: none; padding: 2.5rem 0 3rem }
.tab-section.active { display: block }
.section-title {
  font-family: 'Newsreader', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--sand-200);
}

/* Alert / priority box */
.alert-box {
  background: var(--hot-bg);
  border: 1.5px solid var(--hot-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.alert-box h3 { font-family: 'Newsreader', serif; color: #991b1b; font-size: 1rem; font-weight: 700; margin-bottom: .75rem }
.alert-box ol { margin-left: 1.25rem; line-height: 2 }
.alert-box li { font-size: .8rem; color: #7f1d1d }
.alert-box .hot { color: var(--hot); font-weight: 700 }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 1.5rem }
.stat-tile { background: #fff; border: 1px solid var(--sand-200); border-radius: 10px; padding: 1.25rem; text-align: center }
.stat-tile .num { font-family: 'Newsreader', serif; font-size: 2rem; font-weight: 700; color: var(--ink) }
.stat-tile .lbl { font-size: .7rem; color: var(--ink-3); margin-top: .25rem; font-weight: 600 }

/* Topic cards */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1.5rem }
.topic-card {
  background: #fff;
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  padding: 1.25rem;
  border-top: 4px solid;
  transition: box-shadow .2s;
}
.topic-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07) }
.tc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem }
.tc-title  { font-size: .9rem; font-weight: 700; color: var(--ink) }

/* Frequency badge */
.freq-badge { border-radius: 999px; padding: .2rem .65rem; font-size: .65rem; font-weight: 700; color: #fff; white-space: nowrap }
.freq-5 { background: #991b1b }
.freq-4 { background: #dc2626 }
.freq-3 { background: #ea580c }
.freq-2 { background: #d97706 }
.freq-1 { background: #16a34a }

/* Concept list inside topic cards */
.concept-list { list-style: none; padding: 0 }
.concept-list li { padding: .5rem 0; border-bottom: 1px solid var(--sand-100); font-size: .76rem; color: var(--ink-2); display: flex; align-items: flex-start; gap: .5rem }
.concept-list li:last-child { border-bottom: none }
.bullet { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px }
.years-tag { font-size: .66rem; color: var(--ink-3); margin-top: .15rem }

/* Priority table */
.priority-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--sand-200) }
.priority-table th { background: var(--sand-900); color: #fff; padding: .75rem 1rem; text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .03em }
.priority-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--sand-100); font-size: .78rem; vertical-align: top; color: var(--ink-2) }
.priority-table tr:last-child td { border-bottom: none }
.priority-table tr:hover td { background: var(--sand-50) }
.rank  { font-family: 'Newsreader', serif; font-weight: 700; color: var(--ink); font-size: 1.1rem }
.stars { color: #d97706; font-size: .9rem; letter-spacing: 1px }

/* Tag chips */
.tag { display: inline-block; border-radius: 6px; padding: .15rem .5rem; font-size: .62rem; font-weight: 700; margin: 2px 2px 2px 0 }

/* Full concept block — slide-style card */
.concept-block {
  background: #fff;
  border: 1px solid var(--sand-200);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: box-shadow .2s, transform .2s;
}
.concept-block:hover { box-shadow: 0 6px 24px rgba(0,0,0,.09); transform: translateY(-1px) }
.cb-header {
  background: var(--subject-bg);
  border-bottom: 1px solid var(--subject-border);
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.cb-title  { font-family: 'Newsreader', serif; font-size: 1.1rem; font-weight: 700; color: var(--ink); line-height: 1.35; flex: 1 }
.cb-freq   { background: var(--subject-color); color: #fff; border-radius: 999px; padding: .2rem .7rem; font-size: .62rem; font-weight: 700; flex-shrink: 0; margin-top: .15rem }
.cb-years  { font-size: .65rem; color: var(--subject-color); background: #fff; border: 1px solid var(--subject-border); border-radius: 999px; padding: .12rem .55rem; flex-shrink: 0; margin-top: .15rem; font-weight: 700 }
.cb-body   { padding: 1.25rem 1.5rem; font-size: .84rem; color: var(--ink-2); line-height: 1.85 }
.cb-body p { margin-bottom: .5rem }
.cb-body p:last-child { margin-bottom: 0 }
.cb-body ul, .cb-body ol { padding-left: 1.2rem; margin-bottom: .5rem }
.cb-body li { margin-bottom: .35rem }

/* Exact question pattern box */
.pattern-box { background: var(--sand-50); border: 1px solid var(--sand-200); border-radius: 8px; padding: 1.1rem 1.4rem; margin-top: .5rem }
.pattern-title { font-size: .65rem; font-weight: 700; color: var(--ink-3); margin-bottom: .4rem; letter-spacing: .05em; text-transform: uppercase }
.pattern-text  { font-size: .9rem; color: var(--ink-2); line-height: 2.5 }

/* Variant question box */
.variant-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 1rem 1.4rem; margin-top: .5rem }
.variant-title { font-size: .65rem; font-weight: 700; color: #92400e; margin-bottom: .35rem; letter-spacing: .05em; text-transform: uppercase }

/* Strategy cards */
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem }
.strat-card { border-radius: 8px; padding: 1rem; border: 1px solid var(--sand-200) }
.strat-card h4 { font-size: .92rem; font-weight: 800; margin-bottom: .6rem; letter-spacing: .03em }
.strat-card ul { list-style: none; padding: 0; font-size: .9rem; line-height: 1.9; color: var(--ink-2) }
.strat-card ul li::before { content: '✅ '; font-size: .82rem }

/* Q&A expandable cards */
.qa-card { background: #fff; border: 1px solid var(--sand-200); border-radius: 12px; margin-bottom: 1.25rem; overflow: hidden; transition: box-shadow .2s }
.qa-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,.08) }

/* Mark-split badges */
.mark-tag { display: inline-block; border-radius: 6px; padding: .2rem .55rem; font-size: .65rem; font-weight: 700; margin-left: .5rem }
.m2   { background: #dbeafe; color: #1d4ed8 }
.m3   { background: #dcfce7; color: #15803d }
.mdiag{ background: #f3e8ff; color: #7e22ce }

/* Named-reactions nav variant */
.rxn-nav { margin-bottom: 16px }
.rxn-nav-inner { display: flex; gap: 6px; flex-wrap: wrap }
.rxn-section { display: none; padding: 2rem 0 3rem }
.rxn-section.active { display: block }

/* Q&A expandable model-answer cards */
.qa-card { background: #fff; border: 1px solid var(--sand-200); border-radius: 12px; margin-bottom: 1.25rem; overflow: hidden }
.qa-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: 1.1rem 1.25rem; flex-wrap: wrap }
.qa-title { font-family: 'Newsreader', serif; font-size: .95rem; font-weight: 600; color: var(--ink); line-height: 1.4 }
.qa-answer { border-top: 1px solid var(--sand-200) }
.qa-answer summary { padding: .75rem 1.25rem; font-size: .75rem; font-weight: 700; color: var(--ink-3); cursor: pointer; user-select: none; list-style: none }
.qa-answer summary::-webkit-details-marker { display: none }
.qa-answer summary:hover { color: var(--ink) }
.qa-answer[open] summary { border-bottom: 1px solid var(--sand-100) }
.answer-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .6rem }
.summary-marks { font-size: .68rem; font-weight: 700; background: var(--sand-100); border: 1px solid var(--sand-200); border-radius: 999px; padding: .15rem .55rem; color: var(--ink-3); margin-left: .5rem }
.qa-variants-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: .5rem }
.qa-variants { font-size: .78rem; color: var(--ink-2); line-height: 1.8; padding-left: 1rem }

/* Mark-split rows inside model answers */
.mark-row { display: flex; gap: .75rem; padding: .6rem .75rem; border-radius: 6px; background: var(--sand-50); border-left: 4px solid var(--sand-300) }
.mark-tag { display: inline-block; border-radius: 6px; padding: .15rem .5rem; font-size: .62rem; font-weight: 700; flex-shrink: 0; margin-top: .1rem }
.mark-content { font-size: .77rem; color: var(--ink-2); line-height: 1.7 }
.mark-content .f { font-family: monospace; background: #f0fdf4; color: #166534; border: 1px solid #86efac; border-radius: 4px; padding: .05rem .4rem; font-size: .88em; display: inline-block }
.ans-total { display: flex; justify-content: space-between; font-size: .68rem; font-weight: 700; color: var(--ink-3); background: var(--sand-100); border-radius: 6px; padding: .4rem .75rem; margin-top: .25rem }

/* Inline formula span */
.f { font-family: monospace; background: #f0fdf4; color: #166534; border: 1px solid #86efac; border-radius: 4px; padding: .05rem .4rem; font-size: .88em; display: inline-block }

/* Diagram/structure box */
.diag-box { background: var(--sand-50); border: 1px solid var(--sand-200); border-radius: 8px; padding: 1rem; text-align: center; font-family: monospace; font-size: .82rem; color: var(--ink-2); line-height: 2; margin: .5rem 0 }

/* ── Concept card body — slide-style inner elements ── */

.cb-body .diagram-container {
  background: var(--sand-50);
  border: 1px solid var(--sand-200);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  overflow-x: auto;
}
.cb-body .diagram-container svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.cb-body .diagram-caption {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-style: italic;
  text-align: center;
  margin-top: 0.4rem;
}

.cb-body .key-point {
  background: var(--subject-bg, #eff6ff);
  border-left: 4px solid var(--subject-color, #2563eb);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0.85rem 0;
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.65;
}

.cb-body .formula-box {
  background: #1e1b2e;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin: 0.85rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.7;
  border: 1px solid #3d3560;
  position: relative;
}
.cb-body .formula-label {
  display: inline-block;
  font-family: 'Lato', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  margin-bottom: 0.35rem;
}

.cb-body .remember-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #22c55e;
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0.85rem 0;
  font-size: 0.82rem;
  color: #14532d;
  line-height: 1.65;
}

.cb-body .mistake-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  margin: 0.85rem 0;
  font-size: 0.82rem;
  color: #7f1d1d;
  line-height: 1.65;
}

.cb-body .compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.8rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sand-200);
}
.cb-body .compare-table th {
  background: var(--subject-bg, var(--sand-100));
  color: var(--subject-color, var(--ink));
  font-weight: 800;
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--subject-border, var(--sand-300));
}
.cb-body .compare-table td {
  padding: 0.5rem 0.85rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--sand-100);
  vertical-align: top;
  line-height: 1.55;
}
.cb-body .compare-table tr:last-child td { border-bottom: none; }
.cb-body .compare-table tr:hover td { background: var(--sand-50); }

/* Mobile sticky section nav & rxn nav */
@media (max-width: 640px) {
  .section-nav {
    position: sticky;
    top: 48px;  /* below sticky chapter-bar */
    z-index: 90;
    background: rgba(253,252,250,.95);
    backdrop-filter: blur(10px);
    margin: 0 -.75rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--sand-200);
  }
  .rxn-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(253,252,250,.95);
    backdrop-filter: blur(10px);
    margin: 0 -.75rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--sand-200);
  }
}

/* Subject tag colours — Physical */
.tag-soln { background: #e0f2fe; color: #0369a1 }
.tag-elec  { background: #dcfce7; color: #15803d }
.tag-kin   { background: #fff7ed; color: #c2410c }
/* Organic */
.tag-halo  { background: #fdf2f8; color: #9d174d }
.tag-carb  { background: #fef2f2; color: #b91c1c }
.tag-amine { background: #f5f3ff; color: #6d28d9 }
.tag-bio   { background: #f0fdf4; color: #15803d }
/* Inorganic */
.tag-dblk  { background: #fffbeb; color: #b45309 }
.tag-coord { background: #f5f3ff; color: #7c3aed }
