/* ═══════════════════════════════════════════════════════════════
   UJIYARI — UI Components
═══════════════════════════════════════════════════════════════ */

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-brand-light), var(--color-accent));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(37,99,168,0.15);
}

.card:hover::before { opacity: 1; }

.card--flat {
  box-shadow: none;
  border-radius: var(--radius-lg);
}

.card--flat:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

.card--flat::before { display: none; }

/* Card content */
.card__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);   /* explicit — not inherited */
  line-height: var(--leading-snug);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.card__title a:hover { color: var(--color-brand-light); }

.card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.card__resources { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border: 1.5px solid transparent;
  letter-spacing: 0.01em;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn--primary {
  background: var(--color-brand);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(26,58,92,0.25);
}
.btn--primary:hover {
  background: var(--color-brand-dark);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(26,58,92,0.35);
  transform: translateY(-1px);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(232,131,10,0.30);
}
.btn--accent:hover {
  background: var(--color-accent-dark);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(232,131,10,0.40);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn--outline:hover {
  background: var(--color-brand);
  color: var(--color-white);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  background: var(--color-surface-alt);
  color: var(--color-brand);
  border-color: var(--color-brand-light);
}

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  gap: var(--space-1);
}

.btn--sm svg { width: 13px; height: 13px; }

/* Resource-specific buttons */
.btn--notes { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.btn--notes:hover { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

.btn--audio { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.btn--audio:hover { background: #0369a1; color: #fff; border-color: #0369a1; }

.btn--pdf { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.btn--pdf:hover { background: #be123c; color: #fff; border-color: #be123c; }

/* ── Monthly Subject Filter Wrap ────────────────────────────── */
.monthly-subject-filter-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.monthly-subject-filter-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.monthly-subject-filter-wrap .subject-filter {
  margin-bottom: 0;
}

/* ── Monthly Accordion ──────────────────────────────────────── */

/* Controls bar: Expand All / Collapse All */
.accordion-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.accordion-controls__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
}

.btn--accordion-toggle {
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn--accordion-toggle:hover {
  background: var(--color-brand-light);
}

/* Accordion panel — collapsed by default */
.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

/* Open state */
.accordion-panel.is-open {
  max-height: 99999px;
}

/* h2 heading becomes clickable toggle */
.article-body.accordion-enabled h2 {
  cursor: pointer;
  user-select: none;
  position: relative;
}

/* Toggle chevron — added via JS as a span inside h2 */
.accordion-chevron {
  display: inline-block;
  margin-left: var(--space-2);
  font-size: 0.85em;
  transition: transform 0.25s ease;
  font-style: normal;
  opacity: 0.75;
}

.accordion-chevron.is-open {
  transform: rotate(90deg);
}

/* ── Stat tiles (homepage) ──────────────────────────────────── */
.stat-bar {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
  justify-content: center;
}

.stat-tile {
  text-align: center;
  padding: var(--space-3) var(--space-5);
  flex: 1;
  min-width: 100px;
}

.stat-tile + .stat-tile {
  border-left: 1px solid var(--color-border);
}

.stat-tile__value {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--color-brand);
  font-family: var(--font-serif);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-tile__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
}

/* ── Subject card (homepage browse) ────────────────────────── */
.subject-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
  opacity: 0.3;
  transition: width var(--transition-normal), opacity var(--transition-normal);
}

.subject-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.subject-card:hover::before { width: 6px; opacity: 0.6; }

.subject-card__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
}

.subject-card__label {
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
}

.subject-card__desc {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

.badge--new { background: var(--color-accent-light); color: var(--color-accent-dark); }
.badge--date { background: var(--color-surface-alt); color: var(--color-text-muted); }

/* ── Callout box ────────────────────────────────────────────── */
.callout {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

.callout--info    { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.callout--tip     { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.callout--important { background: #fff7ed; border-color: var(--color-accent); color: #7c2d12; }

/* ── Date navigator ─────────────────────────────────────────── */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  margin-bottom: var(--space-6);
}

.date-nav__btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.date-nav__btn:hover {
  border-color: var(--color-brand-light);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}

.date-nav__btn svg { width: 16px; height: 16px; }

.date-nav__current {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  background: var(--color-surface-alt);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

/* ── Subject filter bar ─────────────────────────────────────── */
.subject-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.subject-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.subject-filter__btn:hover {
  color: var(--color-brand);
  border-color: var(--color-brand-light);
  background: #eff6ff;
}

.subject-filter__btn.active {
  background: var(--color-brand);
  color: var(--color-white);
  border-color: var(--color-brand);
  box-shadow: 0 2px 8px rgba(26,58,92,0.2);
}

/* ── Sidebar widget ─────────────────────────────────────────── */
.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.sidebar-widget__title {
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar-widget__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.sidebar-widget--edition {
  padding: var(--space-4);
  background:
    radial-gradient(circle at top right, rgba(232,131,10,0.08), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,247,250,0.98));
}

.edition-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.edition-link {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.edition-link:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,168,0.25);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-sm);
}

.edition-link__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.edition-link__label,
.edition-link__cta {
  font-size: 10px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edition-link__label {
  color: var(--color-text-muted);
}

.edition-link__cta {
  color: var(--color-brand-light);
}

.edition-link__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.edition-link__tag {
  font-size: 9px;
  padding: 2px 8px;
}

.edition-link__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: var(--leading-normal);
}

/* ── Divider ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: var(--space-8) 0; }

/* ── Skeleton ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-border) 50%, var(--color-surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Quick links row ────────────────────────────────────────── */
.quick-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
}

.quick-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--color-brand-light);
}

.quick-tile__icon {
  font-size: 2.25rem;
  line-height: 1;
}

.quick-tile__label {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.quick-tile__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.quick-tile--daily   { --tile-color: var(--color-brand); }
.quick-tile--weekly  { --tile-color: var(--color-brand-light); }
.quick-tile--monthly { --tile-color: var(--color-accent); }
.quick-tile--yearly  { --tile-color: var(--color-green); }

.quick-tile:hover .quick-tile__label { color: var(--tile-color, var(--color-brand)); }

/* Calendar archive */
.daily-calendar-shell {
  background:
    radial-gradient(circle at top right, rgba(232,131,10,0.1), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.daily-calendar-shell__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.daily-calendar-shell__eyebrow {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.daily-calendar-shell__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.daily-calendar-shell__meta {
  max-width: 28rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.daily-calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.daily-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.daily-calendar__month {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  color: var(--color-brand-dark);
}

.daily-calendar__nav {
  display: flex;
  gap: var(--space-2);
}

.daily-calendar__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.daily-calendar__nav-btn:hover:not(:disabled) {
  border-color: var(--color-brand-light);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}

.daily-calendar__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.daily-calendar__weekdays,
.daily-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
}

.daily-calendar__weekday {
  padding: 0 var(--space-2) var(--space-2);
  font-size: 11px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
}

.calendar-day {
  position: relative;
  min-height: 6.8rem;
  padding: var(--space-3);
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
  background: transparent;
}

.calendar-day--empty {
  min-height: 0;
  padding: 0;
}

.calendar-day--inactive {
  border-color: rgba(226,232,240,0.75);
  background: rgba(255,255,255,0.55);
}

.calendar-day--active {
  display: block;
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast),
    filter var(--transition-fast);
}

.calendar-day--active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,168,0.3);
}

.calendar-day--today::after {
  content: "";
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(232,131,10,0.12);
}

.calendar-day--inactive.calendar-day--today {
  border-color: rgba(232,131,10,0.45);
  background: rgba(255,244,230,0.9);
}

.calendar-day--active.calendar-day--today {
  border-color: rgba(232,131,10,0.45);
  box-shadow: 0 10px 24px rgba(15,34,56,0.08), 0 0 0 1px rgba(232,131,10,0.18);
}

.calendar-day--dimmed {
  opacity: 0.33;
  filter: saturate(0.65);
}

.calendar-day--match {
  border-color: rgba(37,99,168,0.34);
  box-shadow: 0 10px 24px rgba(15,34,56,0.08), 0 0 0 1px rgba(37,99,168,0.12);
}

.calendar-day__date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  background: var(--color-surface-alt);
}

.calendar-day--inactive .calendar-day__date {
  background: transparent;
  color: var(--color-text-muted);
}

.calendar-day__meta {
  margin-top: var(--space-3);
}

.calendar-day__title {
  display: block;
  margin-bottom: var(--space-3);
  font-size: 11px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.calendar-day__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.calendar-day__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.calendar-day__more {
  font-size: 10px;
  font-weight: var(--font-bold);
  color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .daily-calendar-shell {
    padding: var(--space-5);
  }

  .daily-calendar-shell__intro,
  .daily-calendar__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-calendar__nav {
    align-self: stretch;
    justify-content: flex-end;
  }

  .daily-calendar__weekdays,
  .daily-calendar__grid {
    gap: 6px;
  }

  .calendar-day {
    min-height: 5.6rem;
    padding: var(--space-2);
    border-radius: var(--radius-lg);
  }

  .calendar-day__date {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 12px;
  }

  .calendar-day__title {
    display: none;
  }
}

@media (max-width: 479px) {
  .daily-calendar-shell {
    padding: var(--space-4);
  }

  .daily-calendar__weekday {
    font-size: 10px;
    padding-bottom: var(--space-1);
  }

  .calendar-day {
    min-height: 4.9rem;
    padding: 10px 8px;
    border-radius: var(--radius-md);
  }

  .calendar-day__dots {
    gap: 4px;
  }

  .calendar-day__dot {
    width: 7px;
    height: 7px;
  }
}

/* Monthly archive */
.month-archive-shell {
  background:
    radial-gradient(circle at top right, rgba(37,99,168,0.12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.month-archive-shell__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.month-archive-shell__eyebrow {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-brand-light);
}

.month-archive-shell__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.month-archive-shell__meta {
  max-width: 28rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.month-calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.month-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.month-calendar__year {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  color: var(--color-brand-dark);
}

.month-calendar__nav {
  display: flex;
  gap: var(--space-2);
}

.month-calendar__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.month-card {
  position: relative;
  min-height: 8rem;
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(226,232,240,0.9);
  background: rgba(255,255,255,0.66);
}

.month-card--active {
  display: block;
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.month-card--active:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,168,0.28);
}

.month-card--current::after {
  content: "";
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(232,131,10,0.12);
}

.month-card__name {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.month-card__label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.month-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

.month-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.month-card__badge--audio {
  background: #f0fdf4;
  color: #15803d;
}

.month-card__badge--pdf {
  background: #fff1f2;
  color: #be123c;
}

@media (max-width: 767px) {
  .month-archive-shell {
    padding: var(--space-5);
  }

  .month-archive-shell__intro,
  .month-calendar__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .month-calendar__nav {
    align-self: stretch;
    justify-content: flex-end;
  }

  .month-calendar__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .month-archive-shell {
    padding: var(--space-4);
  }

  .month-calendar__grid {
    grid-template-columns: 1fr;
  }

  .month-card {
    min-height: 6.5rem;
    border-radius: var(--radius-lg);
  }
}

/* Weekly archive */
.weekly-archive-shell {
  background:
    radial-gradient(circle at top right, rgba(232,131,10,0.1), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.weekly-archive-shell__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.weekly-archive-shell__eyebrow {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.weekly-archive-shell__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.weekly-archive-shell__meta {
  max-width: 30rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.weekly-stream {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.weekly-card {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.weekly-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,168,0.22);
}

.weekly-card[hidden] {
  display: none;
}

.weekly-card__rail {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(26,58,92,0.98), rgba(30,77,123,0.96));
  color: var(--color-white);
}

.weekly-card__kind {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  font-size: 10px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weekly-card__date {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.weekly-card__range {
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.weekly-card__title {
  margin-bottom: var(--space-4);
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: var(--font-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.weekly-card__title a {
  color: inherit;
  text-decoration: none;
}

.weekly-card__title a:hover {
  color: var(--color-brand);
}

.weekly-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.weekly-archive-empty[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .weekly-archive-shell {
    padding: var(--space-5);
  }

  .weekly-archive-shell__intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .weekly-card {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .weekly-card__rail {
    align-self: auto;
  }

  .weekly-card__actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 479px) {
  .weekly-archive-shell {
    padding: var(--space-4);
  }

  .weekly-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .weekly-card__rail {
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }
}

/* ══════════════════════════════════════════════════════════════
   QUIZ ENGINE
══════════════════════════════════════════════════════════════ */

/* Shell */
.quiz-shell {
  max-width: 720px;
  margin: 0 auto;
}

/* ── Start screen ──────────────────────────────────────────── */
.quiz-start {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.quiz-start__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.quiz-start__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-brand);
  margin-bottom: var(--space-3);
}

.quiz-start__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.quiz-start__btn {
  font-size: var(--text-lg);
  padding: var(--space-4) var(--space-10);
}

/* ── Question card ─────────────────────────────────────────── */
.quiz-question {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6) var(--space-8);
}

/* Progress bar */
.quiz-progress {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.quiz-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-brand-light), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Question number */
.quiz-q-number {
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: var(--space-3);
}

/* Question text */
.quiz-q-text {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  line-height: var(--leading-normal);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--color-brand-light);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.quiz-option:disabled {
  cursor: default;
}

/* Letter badge A/B/C/D */
.quiz-option__letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.quiz-option__text {
  flex: 1;
}

/* Selected state */
.quiz-option.is-selected {
  border-color: var(--color-brand-light);
  background: rgba(37, 99, 168, 0.06);
}

.quiz-option.is-selected .quiz-option__letter {
  background: var(--color-brand-light);
  color: var(--color-white);
}

/* Correct state */
.quiz-option.is-correct {
  border-color: var(--color-green);
  background: rgba(22, 163, 74, 0.08);
}

.quiz-option.is-correct .quiz-option__letter {
  background: var(--color-green);
  color: var(--color-white);
}

/* Wrong state */
.quiz-option.is-wrong {
  border-color: var(--color-red);
  background: rgba(220, 38, 38, 0.07);
}

.quiz-option.is-wrong .quiz-option__letter {
  background: var(--color-red);
  color: var(--color-white);
}

/* Check button */
.quiz-check {
  width: 100%;
}

/* ── Explanation panel ─────────────────────────────────────── */
.quiz-explain {
  margin-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
}

.quiz-explain__verdict {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.quiz-explain__verdict--correct {
  color: var(--color-green);
}

.quiz-explain__verdict--wrong {
  color: var(--color-red);
}

.quiz-explain__text {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

/* Concept note callout */
.quiz-concept {
  background: var(--color-accent-light);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.quiz-concept__label {
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: var(--space-2);
}

.quiz-concept__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

/* Next question button */
.quiz-next {
  width: 100%;
}

/* ── Score screen ──────────────────────────────────────────── */
.quiz-score {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.quiz-score__ring {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  border: 6px solid var(--color-accent);
  background: var(--color-accent-light);
  margin-bottom: var(--space-6);
}

.quiz-score__num {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--color-brand);
  line-height: 1;
}

.quiz-score__denom {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-weight: var(--font-medium);
}

.quiz-score__msg {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 480px;
  margin: 0 auto var(--space-8);
}

.quiz-score__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Quiz CTA on daily edition pages ───────────────────────── */
.quiz-cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-mid) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  color: var(--color-white);
  box-shadow: var(--shadow-brand);
}

.quiz-cta__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.quiz-cta__text {
  flex: 1;
}

.quiz-cta__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-white);
  margin-bottom: var(--space-1);
}

.quiz-cta__sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.quiz-cta__btn {
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.quiz-cta__btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .quiz-question {
    padding: var(--space-5) var(--space-4);
  }

  .quiz-start,
  .quiz-score {
    padding: var(--space-8) var(--space-5);
  }

  .quiz-q-text {
    font-size: var(--text-lg);
  }

  .quiz-cta {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .quiz-cta__btn {
    width: 100%;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Editorials Archive — Two-Section Layout
═══════════════════════════════════════════════════════════════ */

/* ── Filter bar ─────────────────────────────────────────────── */
.ed-filter-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ed-filter-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}

.ed-filter-row + .ed-filter-row {
  border-top: 1px solid var(--color-border);
}

.ed-filter-label {
  font-size: 10px;
  font-weight: var(--font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  white-space: nowrap;
  padding-top: 7px;
  min-width: 82px;
  padding-right: var(--space-3);
  border-right: 2px solid var(--color-border);
  flex-shrink: 0;
}

.ed-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Newspaper short-code chip inside button */
.ed-np-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: var(--font-extrabold);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1;
}

/* GS Paper buttons — warm amber tint to distinguish from newspaper row */
.ed-gs-btn {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
}

.ed-gs-btn:hover {
  background: #fef3c7 !important;
  color: #78350f !important;
  border-color: #f59e0b !important;
}

/* ── Section headers ────────────────────────────────────────── */
.ed-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border);
}

.ed-section-header__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.ed-section-header__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-brand);
  margin: 0;
}

.ed-section-header__count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

/* ── Latest section ─────────────────────────────────────────── */
.ed-latest-section {
  margin-bottom: var(--space-16);
}

/* Use auto-fit so orphan cards in the last row expand instead of leaving
   an empty grid cell — avoids the lopsided 2-card last row problem */
.ed-latest-section .content-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ── Card sub-elements ──────────────────────────────────────── */
.ed-card-np {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ed-card-np__badge {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: var(--font-extrabold);
  flex-shrink: 0;
}

.ed-card-np__name {
  font-size: 11px;
  font-weight: var(--font-semibold);
}

.ed-card-np__date {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.ed-card-interview {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: #fffbeb;
  border-radius: var(--radius-md);
  border-left: 3px solid #f59e0b;
}

/* ── Archive section ────────────────────────────────────────── */
.ed-archive-section {
  margin-bottom: var(--space-16);
}

/* ── Month accordion blocks ─────────────────────────────────── */
.ed-month-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ed-month-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
}

.ed-month-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  list-style: none;
  gap: var(--space-4);
  user-select: none;

  background: var(--color-surface);
  transition: background 0.15s ease;
}

.ed-month-block[open] > .ed-month-block__header {
  background: #f0f6ff;
  border-bottom: 1px solid var(--color-border);
}

.ed-month-block__header:hover {
  background: #f8faff;
}

/* Remove default triangle marker */
.ed-month-block__header::-webkit-details-marker { display: none; }
.ed-month-block__header::marker              { display: none; }

/* Custom open/close chevron */
.ed-month-block__header::after {
  content: '›';
  font-size: 1.2rem;
  color: var(--color-text-muted);
  transform: rotate(90deg);
  display: inline-block;
  transition: transform 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.ed-month-block[open] > .ed-month-block__header::after {
  transform: rotate(270deg);
}

.ed-month-block__name {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-brand);
  font-family: var(--font-serif);
}

.ed-month-block__count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px var(--space-3);
}

/* ── Editorial row inside month block ───────────────────────── */
.ed-month-block__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ed-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  transition: background 0.12s ease;
}

.ed-row:last-child {
  border-bottom: none;
}

.ed-row:hover {
  background: #fafbff;
}

.ed-row__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  white-space: nowrap;
  min-width: 44px;
  flex-shrink: 0;
}

.ed-row__np {
  font-size: 9px;
  font-weight: var(--font-extrabold);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.ed-row__title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-brand);
  text-decoration: none;
  min-width: 0;
}

.ed-row__title:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.ed-row__gs {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ed-row__gs span {
  font-size: 10px;
  font-weight: var(--font-bold);
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

.ed-row__pdf {
  flex-shrink: 0;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.ed-row__pdf:hover {
  opacity: 1;
  color: #e8830a;
}

.ed-row__pdf svg {
  width: 14px;
  height: 14px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ed-filter-row {
    flex-direction: column;
    gap: var(--space-2);
  }

  .ed-filter-label {
    padding-top: 0;
    min-width: unset;
    border-right: none;
    padding-right: 0;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-1);
    width: 100%;
  }

  .ed-month-block__header {
    padding: var(--space-3) var(--space-4);
  }

  .ed-row {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }

  .ed-row__gs,
  .ed-row__pdf {
    display: none;
  }
}


/* ══════════════════════════════════════════════════════════════════════════
   MONTHLY SUB-SECTIONS — Prelims / Mains / Interview
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Sub-navigation tabs ─────────────────────────────────────────────────── */
.monthly-subnav {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
}

.monthly-subnav__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.monthly-subnav__btn:hover {
  color: var(--color-brand);
  border-color: var(--color-brand-light);
  background: #eff6ff;
}

.monthly-subnav__btn.active {
  color: #fff;
  background: var(--color-brand);
  border-color: var(--color-brand);
  box-shadow: 0 2px 8px rgba(26,58,92,0.25);
}

/* ── Edition/Month/Week intro card ───────────────────────────────────────── */
/* Used on daily (template), weekly (JS), monthly (JS).                       */
/* Label is set via data-label attribute so each context can vary the text.   */
.intro-card {
  margin-bottom: var(--space-6);
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.intro-card::before {
  content: attr(data-label);
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand-light);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.intro-card p {
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.intro-card p:last-child {
  margin-bottom: 0;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--color-border);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.intro-card strong {
  color: var(--color-brand);
  font-weight: 700;
}

/* ── Subject filter buttons (monthly-only) — reset <button> defaults ─────── */
.monthly-subject-filter-wrap button.subject-filter__btn {
  font-family: inherit;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}

/* ── Coming Soon placeholder ─────────────────────────────────────────────── */
.coming-soon-box {
  margin: var(--space-8) 0;
  padding: var(--space-10) var(--space-8);
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
.coming-soon-box p { margin: 0; }

/* ── Controls bar ────────────────────────────────────────────────────────── */
.prelims-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.prelims-controls__left,
.prelims-controls__right { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.prelims-quiz-start-btn {
  background: var(--color-accent);
  border-color: var(--color-accent);
  gap: var(--space-2);
}
.prelims-quiz-start-btn:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }

/* ── Quiz focus mode (body class toggled by JS) ──────────────────────────── */
body.prelims-quiz-on .page-header,
body.prelims-quiz-on #prelims-subnav,
body.prelims-quiz-on #prelims-controls,
body.prelims-quiz-on #prelims-sidebar-layout { display: none !important; }

/* ── Prelims score bar (sticky in quiz mode) ─────────────────────────────── */
.prelims-score-bar {
  position: sticky;
  top: var(--header-height, 64px);
  z-index: calc(var(--z-sticky) + 10);
  background: var(--color-brand);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 0;
  box-shadow: var(--shadow-md);
}
.prelims-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
}
.prelims-score__left,
.prelims-score__right { display: flex; align-items: center; gap: var(--space-3); }
.prelims-score__back {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
}
.prelims-score__back:hover { background: rgba(255,255,255,0.25); }
.prelims-score__qcount { font-size: var(--text-sm); opacity: 0.9; }
.prelims-score__correct { color: #86efac; font-size: var(--text-sm); }
.prelims-score__attempted { opacity: 0.75; font-size: var(--text-xs); }

.prelims-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: var(--space-5);
}
#prelims-progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.4s ease;
  border-radius: inherit;
}

/* ── Prelims subject section ─────────────────────────────────────────────── */
.prelims-subject-section { margin-bottom: var(--space-10); }
.prelims-subject-heading {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-inverse);
  background: var(--color-brand);
  padding: var(--space-3) var(--space-5);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  letter-spacing: 0.01em;
}
/* Override default article h2 styles for prelims context */
.article-main .prelims-subject-heading::after { display: none; }

/* ── Prelims card (browse mode) ──────────────────────────────────────────── */
.prelims-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.prelims-card:hover { box-shadow: var(--shadow-sm); border-color: #cbd5e1; }

.prelims-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.prelims-card__qnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 var(--space-2);
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.prelims-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prelims-card__badge--statement {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.prelims-card__q {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-relaxed);
  white-space: pre-line;
}

/* ── Statement question structured layout ─────────────────────────────────── */
.prelims-stmt-intro {
  margin: 0 0 var(--space-3);
  font-weight: 500;
  color: var(--color-text-primary);
}
.prelims-stmt-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prelims-stmt-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-left: 3px solid var(--color-brand-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: var(--leading-relaxed);
}
.prelims-stmt-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.prelims-stmt-text { flex: 1; }
.prelims-stmt-conclusion {
  margin: 0;
  font-weight: 600;
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.prelims-card__options {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prelims-card__option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: border-color 0.1s;
}
.prelims-card__opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--color-border);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.prelims-card__answer {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  animation: fadeSlideIn 0.2s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.prelims-card__correct {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: #166534;
  margin-bottom: var(--space-2);
}
.prelims-card__correct-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  background: #16a34a;
  color: #fff;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.prelims-card__explain {
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}
.prelims-card__concept {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}
.prelims-card__source {
  margin-top: var(--space-3);
}
.prelims-card__source a,
.prelims-quiz-source {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-brand-light);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-brand-light);
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.prelims-card__source a:hover,
.prelims-quiz-source:hover {
  background: var(--color-brand-light);
  color: #fff;
}
.prelims-card__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: 1px solid var(--color-brand-light);
  border-radius: var(--radius-md);
  color: var(--color-brand-light);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.prelims-card__toggle:hover,
.prelims-card__toggle--revealed { background: var(--color-brand-light); color: #fff; }

/* ── Prelims subject nav (sidebar) ───────────────────────────────────────── */
.prelims-subject-nav { display: flex; flex-direction: column; gap: var(--space-1); }
.prelims-subject-nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}
.prelims-subject-nav__link:hover { background: var(--color-bg); border-color: var(--color-border); }
.prelims-subject-nav__link.active {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

/* ── Quiz mode — question card ───────────────────────────────────────────── */
#prelims-quiz-view {
  max-width: 900px;
  margin: 0 auto var(--space-8);
}
.prelims-quiz-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-10);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.prelims-quiz-question {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: var(--leading-relaxed);
  margin: var(--space-4) 0 var(--space-6);
}
/* Quiz mode: statement items inherit the same structured layout */
.prelims-quiz-question .prelims-stmt-intro {
  font-size: var(--text-lg);
}
.prelims-quiz-question .prelims-stmt-item {
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
}
.prelims-quiz-question .prelims-stmt-num {
  min-width: 1.75rem;
  height: 1.75rem;
}
.prelims-quiz-question .prelims-stmt-conclusion {
  font-size: var(--text-base);
}
.prelims-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.prelims-quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 100%;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
}
.prelims-quiz-opt:hover:not(:disabled) {
  border-color: var(--color-brand-light);
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 168, 0.12);
}
.prelims-quiz-opt__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #e2e8f0;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.prelims-quiz-opt:hover:not(:disabled) .prelims-quiz-opt__letter {
  background: var(--color-brand-light);
  color: #fff;
}
.prelims-quiz-opt__text { flex: 1; line-height: var(--leading-relaxed); }
.prelims-quiz-opt.correct { border-color: #16a34a; background: #f0fdf4; }
.prelims-quiz-opt.correct .prelims-quiz-opt__letter { background: #16a34a; color: #fff; }
.prelims-quiz-opt.wrong { border-color: #dc2626; background: #fef2f2; }
.prelims-quiz-opt.wrong .prelims-quiz-opt__letter { background: #dc2626; color: #fff; }
.prelims-quiz-opt:disabled { cursor: default; }

.prelims-quiz-verdict {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 700;
  font-size: var(--text-sm);
}
.prelims-quiz-verdict--correct { background: #dcfce7; color: #166534; }
.prelims-quiz-verdict--wrong   { background: #fee2e2; color: #991b1b; }
.prelims-quiz-explain {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  animation: fadeSlideIn 0.2s ease;
}
.prelims-quiz-explain p { margin-bottom: var(--space-2); }
.prelims-quiz-concept {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
}
.prelims-quiz-next-btn { display: block; width: 100%; margin-top: var(--space-2); }

/* Quiz finished screen */
.prelims-quiz-finished {
  text-align: center;
  padding: var(--space-10) var(--space-6);
}
.prelims-quiz-finished__ring {
  width: 120px; height: 120px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  background: conic-gradient(var(--color-accent) 0%, var(--color-brand) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.prelims-quiz-finished__pct {
  width: 100px; height: 100px;
  background: var(--color-surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-brand);
}
.prelims-quiz-finished__grade {
  font-size: var(--text-2xl);
  color: var(--color-brand);
  margin-bottom: var(--space-3);
}
.prelims-quiz-finished p { color: var(--color-text-secondary); margin-bottom: var(--space-6); }
.prelims-quiz-finished__actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

/* ── Prelims PDF Cover + TOC — hidden on screen, shown in print ─────────── */
#prelims-pdf-cover,
#prelims-pdf-toc { display: none !important; }

@media print {
  #prelims-pdf-cover {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: 252mm; /* A4 content area = 297 - 22(top) - 14(bottom) = 261mm; 252mm leaves safe buffer */
    page-break-after: always;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
  }

  /* ── Header bar ── */
  .pcover__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a3a5c;
    color: #fff;
    padding: 10px 18px;
    flex-shrink: 0;
  }
  .pcover__logo-row { display: flex; align-items: center; gap: 8px; }
  .pcover__logo-text {
    font-size: 17pt;
    font-weight: 900;
    font-family: Georgia, serif;
    color: #fff;
    letter-spacing: -0.02em;
  }
  .pcover__logo-dot { color: #e8830a; font-size: 18pt; font-weight: 900; }
  .pcover__logo-tag { font-size: 8pt; color: rgba(255,255,255,0.7); letter-spacing: 0.04em; }
  .pcover__url { font-size: 9pt; color: rgba(255,255,255,0.6); letter-spacing: 0.08em; }

  /* ── Main body ── */
  .pcover__body {
    display: flex;
    flex: 1;
    overflow: hidden;
  }

  /* Left accent stripe */
  .pcover__stripe {
    width: 7px;
    background: linear-gradient(to bottom, #e8830a 0%, #f59e0b 50%, #e8830a 100%);
    flex-shrink: 0;
  }

  /* Title block */
  .pcover__title-block {
    flex: 1;
    padding: 24px 24px 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .pcover__eyebrow {
    font-size: 9pt;
    font-weight: 700;
    color: #e8830a;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 6px;
  }
  .pcover__title {
    font-size: 44pt;
    font-weight: 900;
    color: #1a3a5c;
    font-family: Georgia, serif;
    line-height: 1;
    margin: 0 0 6px;
    letter-spacing: -0.03em;
  }
  .pcover__subtitle {
    font-size: 11pt;
    color: #4b5563;
    margin: 0 0 16px;
    font-weight: 400;
  }
  .pcover__divider {
    width: 60px;
    height: 4px;
    background: #e8830a;
    border-radius: 2px;
    margin-bottom: 18px;
  }

  /* Stats row */
  .pcover__stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 22px;
  }
  .pcover__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 20px;
  }
  .pcover__stat-num {
    font-size: 22pt;
    font-weight: 900;
    color: #1a3a5c;
    line-height: 1;
    font-family: Georgia, serif;
  }
  .pcover__stat-lbl {
    font-size: 7.5pt;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
  }
  .pcover__stat-sep {
    width: 1px;
    height: 36px;
    background: #e5e7eb;
    margin: 0 20px 0 0;
    flex-shrink: 0;
  }

  /* Subject pills */
  .pcover__subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .pcover__pill {
    font-size: 7.5pt;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: 0.03em;
  }
  .pcover__pill--polity    { background: #eff6ff; color: #1d4ed8; }
  .pcover__pill--economy   { background: #f0fdf4; color: #166534; }
  .pcover__pill--environment { background: #ecfdf5; color: #065f46; }
  .pcover__pill--science   { background: #fdf4ff; color: #6b21a8; }
  .pcover__pill--ir        { background: #fef3c7; color: #92400e; }
  .pcover__pill--geo       { background: #fff7ed; color: #c2410c; }
  .pcover__pill--history   { background: #fef9c3; color: #713f12; }
  .pcover__pill--social    { background: #fce7f3; color: #9d174d; }
  .pcover__pill--defence   { background: #f0f9ff; color: #0369a1; }
  .pcover__pill--reports   { background: #f5f3ff; color: #4c1d95; }
  .pcover__pill--persons   { background: #fff1f2; color: #9f1239; }

  /* Right illustration panel */
  .pcover__illustration {
    width: 180px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #f0f6ff 0%, #e8f0fb 100%);
  }
  .pcover__circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(26,58,92,0.07);
  }
  .pcover__circle--1 { width: 200px; height: 200px; top: -60px; right: -60px; }
  .pcover__circle--2 { width: 140px; height: 140px; top: 80px;  right: 40px;  background: rgba(232,131,10,0.08); }
  .pcover__circle--3 { width: 90px;  height: 90px;  bottom: 40px; right: -20px; }
  .pcover__icon-stack {
    position: absolute;
    bottom: 30px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pcover__icon-line {
    font-size: 9pt;
    font-weight: 700;
    color: #1a3a5c;
    background: rgba(255,255,255,0.85);
    border-radius: 6px;
    padding: 5px 10px;
    display: block;
  }

  /* ── Footer bar ── */
  .pcover__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border-top: 2px solid #1a3a5c;
    padding: 8px 18px;
    flex-shrink: 0;
    font-size: 7.5pt;
    color: #6b7280;
  }
  .pcover__footer-left { display: flex; align-items: center; gap: 6px; }
  .pcover__footer-right { display: flex; align-items: center; gap: 6px; }
  .pcover__footer-sep { color: #d1d5db; }
  .pcover__footer strong { color: #1a3a5c; }

  /* ── TOC page ── */
  #prelims-pdf-toc {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: 252mm;
    page-break-after: always;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
  }
  .ptoc__header {
    background: #1a3a5c;
    padding: 12px 20px 10px;
    flex-shrink: 0;
  }
  .ptoc__title-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 3px; }
  .ptoc__brand  { font-size: 14pt; font-weight: 900; color: #fff; font-family: Georgia, serif; letter-spacing: -0.02em; }
  .ptoc__title  { font-size: 20pt; font-weight: 900; color: #e8830a; font-family: Georgia, serif; letter-spacing: -0.02em; }
  .ptoc__meta   { font-size: 7.5pt; color: rgba(255,255,255,0.6); letter-spacing: 0.05em; }

  .ptoc__body { display: flex; flex: 1; overflow: hidden; }

  .ptoc__table { flex: 1.1; padding: 18px 20px 14px; display: flex; flex-direction: column; }
  .ptoc__table-head {
    display: grid; grid-template-columns: 1fr auto auto; gap: 0 16px;
    padding: 5px 10px; background: #1a3a5c; color: #fff;
    font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    border-radius: 4px 4px 0 0;
  }
  .ptoc__table-head span:last-child,
  .ptoc__table-head span:nth-child(2) { text-align: right; }
  .ptoc__row {
    display: grid; grid-template-columns: 1fr auto auto; gap: 0 16px;
    padding: 6px 10px; font-size: 9pt; align-items: center;
    border-bottom: 1px solid #f1f5f9;
  }
  .ptoc__row--even { background: #f8fafc; }
  .ptoc__row--odd  { background: #fff; }
  .ptoc__subject { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #1a3a5c; }
  .ptoc__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
  .ptoc__dot--polity                  { background: #1d4ed8; }
  .ptoc__dot--economy                 { background: #166534; }
  .ptoc__dot--environment             { background: #065f46; }
  .ptoc__dot--science-tech            { background: #6b21a8; }
  .ptoc__dot--international-relations { background: #92400e; }
  .ptoc__dot--geography               { background: #c2410c; }
  .ptoc__dot--history-culture         { background: #713f12; }
  .ptoc__dot--social-issues           { background: #9d174d; }
  .ptoc__dot--security-defence        { background: #0369a1; }
  .ptoc__dot--reports-schemes         { background: #4c1d95; }
  .ptoc__dot--persons-awards          { background: #9f1239; }
  .ptoc__range { font-size: 8.5pt; color: #374151; white-space: nowrap; text-align: right; }
  .ptoc__count { font-size: 8.5pt; font-weight: 700; color: #6b7280; text-align: right; min-width: 22px; }
  .ptoc__total-row {
    display: grid; grid-template-columns: 1fr auto auto; gap: 0 16px;
    padding: 7px 10px; background: #1a3a5c; color: #fff;
    font-size: 9pt; font-weight: 700; border-radius: 0 0 4px 4px; align-items: center;
  }
  .ptoc__total-row span:last-child,
  .ptoc__total-row span:nth-child(2) { text-align: right; }

  .ptoc__how { flex: 1; padding: 18px 20px 14px 16px; background: #f8fafc; border-left: 1px solid #e5e7eb; display: flex; flex-direction: column; gap: 10px; }
  .ptoc__how-title { font-size: 10pt; font-weight: 900; color: #1a3a5c; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; padding-bottom: 6px; border-bottom: 2px solid #e8830a; }
  .ptoc__how-item { display: flex; gap: 10px; font-size: 8.5pt; color: #374151; line-height: 1.45; align-items: flex-start; }
  .ptoc__how-num { width: 18px; height: 18px; border-radius: 50%; background: #1a3a5c; color: #fff; font-size: 7.5pt; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
  .ptoc__how-item strong { color: #1a3a5c; }
  .ptoc__footer { background: #f1f5f9; border-top: 1px solid #e2e8f0; padding: 7px 20px; font-size: 7pt; color: #6b7280; line-height: 1.4; flex-shrink: 0; }

/* ── Prelims: print / PDF — reveal all answers ───────────────────────────── */
  .prelims-card__answer { display: block !important; }
  .prelims-card__toggle,
  .prelims-controls,
  #prelims-subnav,
  .layout-sidebar,
  #prelims-quiz-view,
  #prelims-score-bar { display: none !important; }
  /* Source links remain visible in print — localhost rewrite in generate-pdfs.js makes them ujiyari.com URLs */
  .layout-with-sidebar { display: block !important; }
  .article-main { width: 100% !important; max-width: 100% !important; }
  .prelims-card { break-inside: avoid; border: 1px solid #e2e8f0; margin-bottom: 8px; }
  .prelims-card__answer { background: #f0fdf4 !important; border-left: 4px solid #16a34a !important; }
}

/* ── Question Number Palette ─────────────────────────────────────────── */
.prelims-q-palette {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}
.prelims-q-palette__btn {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--color-border);
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  padding: 0;
  line-height: 1;
}
.prelims-q-palette__btn:hover { background: var(--color-brand-light); color: #fff; border-color: var(--color-brand-light); }
.prelims-q-palette__btn.answered { background: #16a34a; color: #fff; border-color: #16a34a; }
.prelims-q-palette__btn.current  { background: var(--color-accent); color: #fff; border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(232,131,10,0.35); }
.prelims-q-palette__btn.correct  { background: #16a34a; color: #fff; border-color: #16a34a; }
.prelims-q-palette__btn.wrong    { background: #dc2626; color: #fff; border-color: #dc2626; }

.prelims-palette-legend {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: 10px;
  color: var(--color-text-secondary);
  align-items: center;
  flex-wrap: wrap;
}
.prelims-palette-legend__item { display: flex; align-items: center; gap: 4px; }
.prelims-palette-legend__dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  border: 1px solid var(--color-border);
}
.prelims-palette-legend__dot--unanswered { background: #f1f5f9; }
.prelims-palette-legend__dot--answered   { background: #16a34a; border-color: #16a34a; }
.prelims-palette-legend__dot--correct    { background: #16a34a; border-color: #16a34a; }
.prelims-palette-legend__dot--wrong      { background: #dc2626; border-color: #dc2626; }
.prelims-palette-legend__dot--current    { background: var(--color-accent); border-color: var(--color-accent); }

/* Quiz-mode palette panel */
.prelims-quiz-palette-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.prelims-quiz-palette-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}
.prelims-quiz-palette-toggle {
  font-size: var(--text-xs);
  color: var(--color-brand-light);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}
/* Score bar palette button */
.prelims-score__palette-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.prelims-score__palette-btn:hover { background: rgba(255,255,255,0.25); }

/* ══════════════════════════════════════════════════════════════════════════
   MAINS & INTERVIEW — Question Cards
   ══════════════════════════════════════════════════════════════════════════ */

/* Override default .article-body h3 styles inside mains/interview */
.article-body--mains h3,
.article-body--interview h3 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
  background: transparent;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: none;
  line-height: var(--leading-relaxed);
}
.article-body--mains h3::after,
.article-body--interview h3::after { display: none; }

/* Subject h2 in mains/interview */
.article-body--mains h2,
.article-body--interview h2 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-inverse);
  background: var(--color-brand);
  padding: var(--space-3) var(--space-5);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius-md);
  margin: var(--space-10) 0 var(--space-5);
  width: 100%;
}
.article-body--mains h2::after,
.article-body--interview h2::after { display: none; }

/* Question card wrapper (added by JS) */
.mains-q-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  background: var(--color-surface);
  transition: box-shadow 0.15s;
}
.mains-q-card:hover { box-shadow: var(--shadow-sm); }

/* Question heading inside card */
.mains-q-card h3 {
  background: var(--color-surface-alt) !important;
  border-bottom: 1px solid var(--color-border);
}

/* GS paper badge row (first p after h3) */
.mains-q-card > p:first-of-type {
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.mains-q-card > p:first-of-type strong {
  background: var(--color-brand);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Toggle button */
.mains-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: var(--color-bg);
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-brand-light);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.mains-toggle:hover { background: #eff6ff; }
.mains-toggle--open { background: #eff6ff; color: var(--color-brand); }
.mains-toggle::before { content: '▶'; font-size: var(--text-xs); transition: transform 0.2s; }
.mains-toggle--open::before { transform: rotate(90deg); }

/* Answer body */
.mains-answer,
.interview-answer {
  padding: var(--space-5);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  animation: fadeSlideIn 0.2s ease;
}
.mains-answer { background: #fafbff; border-left: 4px solid var(--color-brand-light); }
.interview-answer { background: #fffbf5; border-left: 4px solid var(--color-accent); }

.mains-answer p, .interview-answer p { margin-bottom: var(--space-3); }
.mains-answer ul, .interview-answer ul { margin: var(--space-2) 0 var(--space-3) var(--space-5); }
.mains-answer ul li, .interview-answer ul li { margin-bottom: var(--space-1); }
.mains-answer blockquote, .interview-answer blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-2) var(--space-4);
  margin: var(--space-3) 0;
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Divider between questions */
.article-body--mains hr,
.article-body--interview hr { display: none; }

/* Interview category badge (inserted by JS) */
.interview-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  margin: 0 var(--space-5) var(--space-2);
}

/* Interview card accent */
.mains-q-card--interview h3 { border-left: 3px solid var(--color-accent); }
.prelims-subject-nav__link--all {
  margin-top: var(--space-2);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}

/* ── Mains / Interview Answer Blocks ─────────────────────────────────────── */
.mains-toggle {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-sm);
}
.article-body--mains .mains-answer,
.article-body--interview .interview-answer {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

/* ── Share Buttons ────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  margin: var(--space-6) 0;
  border-top: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.share-bar__label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted, #6b7280);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  transition: var(--transition-fast);
}
.share-btn:hover { opacity: 0.85; transform: scale(1.1); }
.share-btn--whatsapp { background: #25d366; }
.share-btn--twitter { background: #000; }
.share-btn--telegram { background: #0088cc; }
.share-btn--linkedin { background: #0077b5; }

/* ── Cross-links (auto-linked terms/vocab in articles) ──── */
a.cross-link {
  color: var(--color-brand-light);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-accent);
  cursor: pointer;
}
a.cross-link:hover {
  text-decoration-style: solid;
  color: var(--color-accent);
}

/* ── Cross-link Popover ──────────────────────────────────── */
.crosslink-popover {
  position: absolute;
  z-index: 9000;
  background: var(--color-surface);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: var(--space-4) var(--space-5);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  max-width: 320px;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed, 1.6);
}
.crosslink-popover--visible {
  opacity: 1;
  transform: translateY(0);
}
.crosslink-popover--above {
  transform: translateY(-6px);
}
.crosslink-popover--above.crosslink-popover--visible {
  transform: translateY(0);
}
.crosslink-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.crosslink-popover__term {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  color: var(--color-brand);
}
.crosslink-popover__close {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted, #888);
  padding: 0 var(--space-1);
  flex-shrink: 0;
}
.crosslink-popover__close:hover {
  color: var(--color-brand);
}
.crosslink-popover__def {
  color: var(--color-text, #333);
  margin: 0 0 var(--space-3);
}
.crosslink-popover__link {
  display: inline-block;
  font-weight: 600;
  color: var(--color-brand-light);
  text-decoration: none;
  font-size: var(--text-sm);
}
.crosslink-popover__link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Overlay for mobile bottom sheet */
.crosslink-overlay {
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition-fast);
}
.crosslink-overlay--visible {
  background: rgba(0, 0, 0, 0.35);
}

/* Mobile bottom sheet variant */
.crosslink-popover--mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  padding: var(--space-5) var(--space-6) var(--space-8);
  transform: translateY(100%);
  font-size: var(--text-base);
}
.crosslink-popover--mobile.crosslink-popover--visible {
  transform: translateY(0);
}
.crosslink-popover--mobile .crosslink-popover__term {
  font-size: var(--text-lg);
}
.crosslink-popover--mobile .crosslink-popover__link {
  font-size: var(--text-base);
  padding: var(--space-2) 0;
}

/* ── Study Streak Badge ──────────────────────────────────── */
.streak-badge {
  position: fixed;
  bottom: var(--space-5);
  left: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, #1a3a5c, #2563a8);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: opacity 0.3s, transform 0.3s;
  animation: streakSlideIn 0.4s ease-out;
}
.streak-badge__flame { font-size: 1.4rem; line-height: 1; }
.streak-badge__count { font-size: var(--text-sm); font-weight: var(--font-bold); }
.streak-badge__label { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }
@keyframes streakSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Bookmark Button ─────────────────────────────────────── */
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1.5px solid var(--color-border, #d1d5db);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: var(--space-3);
}
.bookmark-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.bookmark-btn--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
