:root {
  --study-surface: hsl(var(--background, 216 33% 98%));
  --study-card: hsl(var(--card, 0 0% 100%));
  --study-border: hsl(var(--border-strong, 220 24% 80%));
  --study-text: hsl(var(--foreground, 222 47% 11%));
  --study-muted: hsl(var(--muted-foreground, 215 16% 43%));
  --study-accent: hsl(var(--primary, 226 76% 25%));
}
.dark {
  --study-surface: hsl(var(--background, 226 39% 9%));
  --study-card: hsl(var(--card, 226 35% 13%));
  --study-border: hsl(var(--border-strong, 226 26% 27%));
  --study-text: hsl(var(--foreground, 226 100% 97%));
  --study-muted: hsl(var(--muted-foreground, 225 27% 72%));
  --study-accent: hsl(var(--primary, 214 100% 72%));
}

.neet-year-nav div { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.neet-year-nav a {
  display: inline-flex;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--study-border);
  border-radius: 0.6rem;
  background: var(--study-card);
  color: var(--study-text);
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms cubic-bezier(0.22, 1, 0.36, 1), color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .neet-year-nav a:hover {
    border-color: var(--study-accent);
    background: hsl(var(--primary) / 0.08);
    color: var(--study-accent);
  }
}
.neet-year-section,
.neet-across-years { margin-block: 1.75rem; scroll-margin-top: 6rem; }
.neet-year-section h3 { margin-block: 1.5rem 0.75rem; }
.neet-year-section h4 { font-weight: 700; margin-block: 0 0.6rem; }
.neet-format-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; margin: 1rem 0; }
.neet-format-counts > div { border: 1px solid var(--study-border); background: var(--study-card); border-radius: 0.7rem; padding: 0.85rem; }
.neet-format-counts dt { font-size: 0.875rem; line-height: 1.4; color: var(--study-muted); }
.neet-format-counts dd { font-size: 1.65rem; font-weight: 750; font-variant-numeric: tabular-nums; margin: 0.3rem 0 0; color: var(--study-accent); }
.neet-chapter-highlights { display: grid; gap: 1rem; }
.neet-subject-highlight { padding: 1rem; border: 1px solid var(--study-border); background: var(--study-card); border-radius: 0.7rem; }
.neet-subject-highlight ol { margin: 0.5rem 0; padding-left: 1.4rem; }
.neet-subject-highlight li { padding: 0.35rem 0; }
.neet-subject-highlight li span,
.neet-subject-highlight li strong { display: block; }
.neet-subject-highlight li strong { font-size: 0.875rem; }
.neet-subject-highlight a { display: inline-block; margin-top: 0.6rem; min-height: 32px; }
.neet-paper-download { border-top: 1px solid var(--study-border); padding-top: 1rem; margin-top: 1.25rem; }
.neet-paper-download .study-action-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.neet-paper-download a { min-height: 44px; display: inline-flex; align-items: center; }
.neet-comparison-detail { margin-top: 1.25rem; }
.neet-comparison-detail > summary { cursor: pointer; font-weight: 650; padding: 0.8rem 0; min-height: 44px; }
.neet-across-years > ol li { margin-bottom: 0.9rem; }
.neet-year-nav a:focus-visible,
.neet-year-section a:focus-visible,
.neet-across-years a:focus-visible,
.neet-comparison-detail > summary:focus-visible,
.neet-full-chart summary:focus-visible { outline: 3px solid var(--study-accent); outline-offset: 3px; }
.dark .neet-format-counts dd { color: var(--study-accent); }

/* Chapter shares use a common zero-based percentage scale in every view. */
.neet-reader-artwork {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: #f3f5fd;
  border: 1px solid #dce3f5;
}
.neet-reader-artwork img { width: 100%; height: auto; display: block; border-radius: 0.75rem; }
.neet-reader-artwork figcaption { padding: 0; color: var(--study-text); font-size: 1rem; line-height: 1.6; max-width: 65ch; }
.neet-reader-artwork h2 { font-size: 1.7rem; line-height: 1.2; margin: 0.5rem 0; }
.neet-reader-artwork figcaption p { margin: 0.65rem 0; }
.neet-artwork-scope { font-size: 0.875rem; font-weight: 650; color: #344775; }
.neet-subject-heading { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.neet-subject-heading > span { font-size: 0.8125rem; color: var(--study-muted); }
.neet-subject-highlight { --neet-bar-color: #2c448e; --neet-bar-soft: #eef1fc; --neet-bar-border: #d6dff5; }
.neet-subject-chemistry { --neet-bar-color: #9a5b0c; --neet-bar-soft: #fff4e1; --neet-bar-border: #ebd5ad; }
.neet-subject-biology { --neet-bar-color: #236651; --neet-bar-soft: #eaf5ef; --neet-bar-border: #c4dfd2; }
.neet-weightage-chart { margin-top: 0.8rem; }
.neet-chart-unit { font-size: 0.8125rem; color: var(--study-muted); margin: 0.3rem 0 !important; }
.neet-chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  color: var(--study-muted);
  border-bottom: 1px solid var(--study-border);
  margin-bottom: 0.8rem;
}
.neet-subject-highlight .neet-chart-bars,
.neet-chart-bars,
.neet-weightage-chart ul.neet-chart-bars { list-style: none; padding: 0; margin: 0; }
.neet-chart-bars > li { margin: 0 0 1rem; padding: 0; }
.neet-bar-label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0.75rem; margin-bottom: 0.4rem; }
.neet-bar-name { font-size: 0.95rem; line-height: 1.4; overflow-wrap: anywhere; }
.neet-bar-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.4; }
.neet-subject-highlight li .neet-bar-value { display: block; }
.neet-subject-highlight li .neet-bar-value strong,
.neet-bar-value strong { display: block; font-size: 0.95rem; }
.neet-bar-value > span { display: block; font-size: 0.8125rem; color: var(--study-muted); }
.neet-bar-track {
  height: 0.65rem;
  border-radius: 0.2rem;
  border: 1px solid var(--neet-bar-border, #d6dff5);
  background: var(--neet-bar-soft, #eef1fc);
  overflow: hidden;
  background-image: linear-gradient(to right, transparent calc(50% - 0.5px), var(--neet-bar-border, #d6dff5) 50%, transparent calc(50% + 0.5px));
}
.neet-bar-fill { display: block; height: 100%; background: var(--neet-bar-color, #2c448e); border-radius: 0 0.15rem 0.15rem 0; }
.neet-chart-takeaway { font-size: 0.875rem; line-height: 1.6; max-width: 65ch; margin: 0.75rem 0 !important; padding-left: 0.75rem; border-left: 3px solid var(--neet-bar-color, #2c448e); }
.neet-history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.neet-history-subject {
  --neet-bar-color: #2c448e;
  --neet-bar-soft: #eef1fc;
  --neet-bar-border: #d6dff5;
  border: 1px solid var(--study-border);
  background: var(--study-card);
  padding: 1rem;
  border-radius: 0.7rem;
  min-width: 0;
}
.neet-history-subject.neet-subject-chemistry { --neet-bar-color: #9a5b0c; --neet-bar-soft: #fff4e1; --neet-bar-border: #ebd5ad; }
.neet-history-subject.neet-subject-biology { --neet-bar-color: #236651; --neet-bar-soft: #eaf5ef; --neet-bar-border: #c4dfd2; }
.neet-history-subject h4 { font-size: 1rem; line-height: 1.4; min-height: 4.2em; margin: 0.4rem 0; }
.neet-history-subject > .study-kicker { margin: 0; }
.neet-weightage-chart-compact .neet-bar-name { font-size: 0.875rem; font-weight: 650; }
.neet-weightage-chart-compact .neet-bar-value { display: flex; flex-direction: row-reverse; align-items: baseline; gap: 0.5rem; }
.neet-weightage-chart-compact .neet-bar-value strong { font-size: 0.875rem; }
.neet-weightage-chart-compact .neet-bar-value > span { font-size: 0.8125rem; }
.neet-weightage-chart-compact .neet-chart-bars > li { margin-bottom: 0.85rem; }
.neet-chapter-history { margin: 1.75rem 0 2rem; }
.neet-chapter-history h3 { font-size: 1.25rem; }
.neet-full-chart {
  --neet-bar-color: #2c448e;
  margin: 1.25rem 0;
  border: 1px solid var(--study-border);
  background: var(--study-card);
  padding: 1rem;
  border-radius: 0.7rem;
  scroll-margin-top: 6rem;
}
.neet-full-chart summary { font-weight: 650; cursor: pointer; min-height: 44px; align-content: center; }
.neet-full-chart .neet-weightage-chart { margin-top: 1.25rem; }
.neet-full-chart.neet-subject-chemistry { --neet-bar-color: #9a5b0c; --neet-bar-soft: #fff4e1; --neet-bar-border: #ebd5ad; }
.neet-full-chart.neet-subject-biology { --neet-bar-color: #236651; --neet-bar-soft: #eaf5ef; --neet-bar-border: #c4dfd2; }

.dark .neet-reader-artwork { background: #1b263d; border-color: #3c4e76; }
.dark .neet-reader-artwork figcaption { color: var(--study-text); }
.dark .neet-artwork-scope { color: #bdcafa; }
.dark .neet-chart-unit,
.dark .neet-chart-axis,
.dark .neet-bar-value > span,
.dark .neet-subject-heading > span { color: var(--study-muted); }
.dark .neet-subject-highlight,
.dark .neet-history-subject,
.dark .neet-full-chart {
  --neet-bar-color: #a5b8ff;
  --neet-bar-soft: #263454;
  --neet-bar-border: #40537c;
  border-color: var(--study-border);
}
.dark .neet-subject-chemistry,
.dark .neet-full-chart.neet-subject-chemistry { --neet-bar-color: #e7b467; --neet-bar-soft: #3d3223; --neet-bar-border: #685137; }
.dark .neet-subject-biology,
.dark .neet-full-chart.neet-subject-biology { --neet-bar-color: #8ecfb4; --neet-bar-soft: #233c34; --neet-bar-border: #396650; }

@media (max-width: 560px) {
  .neet-reader-artwork { grid-template-columns: 1fr; gap: 0.5rem; padding: 1rem; }
  .neet-reader-artwork img { max-width: 360px; margin: auto; }
  .neet-reader-artwork h2 { font-size: 1.5rem; }
  .neet-history-grid { grid-template-columns: 1fr; }
  .neet-history-subject h4 { min-height: 0; }
  .neet-bar-label { grid-template-columns: 1fr; gap: 0.2rem; }
  .neet-bar-value { text-align: left; display: flex; gap: 0.6rem; align-items: baseline; }
  .neet-subject-highlight li .neet-bar-value { display: flex; }
  .neet-bar-value > span { font-size: 0.8125rem; }
  .neet-weightage-chart-compact .neet-bar-label { grid-template-columns: 1fr auto; }
  .neet-weightage-chart-compact .neet-bar-value { flex-direction: row-reverse; }
  .neet-subject-heading { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .neet-format-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neet-year-section { padding: 1rem; }
  .neet-year-section h2 { font-size: 1.4rem; }
  .neet-paper-download .study-action-row { align-items: stretch; flex-direction: column; }
  .neet-paper-download .study-button { justify-content: center; }
  .neet-year-nav a { flex: 0 0 auto; }
}
