/*
 * CBSE Class Hub Option 4 — scoped under .rbl-v4.rbl-cbse-option4
 * Typography inherits Ribblu global tokens (tokens.css / public.css).
 * Page-local tokens keep Option 4 composition/palette only.
 * Does not restyle global header/footer/nav.
 */
.rbl-v4.rbl-cbse-option4 {
  --r-navy: var(--rbl-ink-strong, #142238);
  /* Decorative brand orange (accents/borders/links) — not white-text fills. */
  --r-orange: #ef5b19;
  --r-orange2: #ff7438;
  --r-blue: #eaf4ff;
  --r-cream: var(--rbl-surface-warm, #fcf7f1);
  --r-text: var(--rbl-ink-strong, #142238);
  --r-muted: var(--rbl-muted-readable, #4b5563);
  --r-border: var(--rbl-border, #e5e7eb);
  --r-bg: var(--rbl-white, #fff);
  --r-shadow: 0 10px 26px rgba(24, 41, 76, .075);
  --r-radius: 18px;
  --r-max: var(--rbl-container-wide, 1280px);
  --o4-asset: /assets/ribblu/cbse-class-hub-option4;
  color: var(--r-text);
  background: #fff;
  /* Global body stack + scale (public.css body / tokens.css) — not Outfit/Inter */
  font-family: var(--rbl-font-body);
  font-size: var(--rbl-text-md);
  line-height: var(--rbl-leading-body);
  padding: 0 0 calc(var(--rbl-bottom-nav-h, 80px) + var(--rbl-space-4, 16px));
  overflow-x: clip;
  min-height: 100vh;
}
.rbl-cbse-option4-dialog-open { overflow: hidden; }
.rbl-v4.rbl-cbse-option4 *,
.rbl-v4.rbl-cbse-option4 *::before,
.rbl-v4.rbl-cbse-option4 *::after { box-sizing: border-box; }
.rbl-v4.rbl-cbse-option4 a { color: inherit; text-decoration: none; }
.rbl-v4.rbl-cbse-option4 button,
.rbl-v4.rbl-cbse-option4 select,
.rbl-v4.rbl-cbse-option4 input { font: inherit; }
.rbl-v4.rbl-cbse-option4 button { cursor: pointer; }
/* Display face only on headings — mirrors public.css h1–h6 + home-v5 */
.rbl-v4.rbl-cbse-option4 h1,
.rbl-v4.rbl-cbse-option4 h2,
.rbl-v4.rbl-cbse-option4 h3 {
  font-family: var(--rbl-font-display);
  letter-spacing: -0.02em;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 button:focus-visible,
.rbl-v4.rbl-cbse-option4 a:focus-visible,
.rbl-v4.rbl-cbse-option4 input:focus-visible,
.rbl-v4.rbl-cbse-option4 select:focus-visible {
  outline: 3px solid var(--rbl-focus, #1d4ed8);
  outline-offset: 3px;
}
.rbl-v4.rbl-cbse-option4 img { display: block; max-width: 100%; height: auto; }

.rbl-v4.rbl-cbse-option4 .o4-shell {
  max-width: var(--r-max);
  margin: auto;
  padding: 0 clamp(var(--rbl-space-4, 16px), 2vw, 22px);
}

.rbl-v4.rbl-cbse-option4 .o4-breadcrumb {
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-text-xs); /* floor: global xs = 0.75rem */
  padding: 15px 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.rbl-v4.rbl-cbse-option4 .o4-breadcrumb a:hover { text-decoration: underline; color: var(--r-orange); }

.rbl-v4.rbl-cbse-option4 .o4-hero {
  position: relative;
  min-height: 290px;
  border-radius: 27px;
  overflow: hidden;
  isolation: isolate;
  background: var(--rbl-surface-warm, #fcf7f1) url("/assets/ribblu/cbse-class-hub-option4/backgrounds/hero-soft-clouds.svg") center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Room for searchbar overlap (searchbar lives inside hero) */
  margin-bottom: 36px;
}
/* Mobile stage + icon CTA — desktop defaults */
.rbl-v4.rbl-cbse-option4 .o4-hero-mobile-stage {
  display: none;
}
.rbl-v4.rbl-cbse-option4 .o4-primary-icon {
  display: none;
}
.rbl-v4.rbl-cbse-option4 .o4-primary-label {
  display: inline;
}
.rbl-v4.rbl-cbse-option4 .o4-hero-art {
  position: absolute;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  margin: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-hero-art--left {
  left: -22px;
  bottom: -4px;
  width: min(31%, 370px);
}
.rbl-v4.rbl-cbse-option4 .o4-hero-art--right {
  right: -30px;
  width: min(27%, 320px);
}
.rbl-v4.rbl-cbse-option4 .o4-hero-img-left,
.rbl-v4.rbl-cbse-option4 .o4-hero-img-right {
  display: block;
  width: 100%;
  margin: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-hero-img-left img,
.rbl-v4.rbl-cbse-option4 .o4-hero-img-right img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}
/* Mobile-v4 landscape row — hidden on desktop (sources are also media-gated) */
.rbl-v4.rbl-cbse-option4 .o4-hero-mobile-art {
  display: none;
}
/* Handwritten callout copy is baked into heroes artwork — no HTML overlays */
.rbl-v4.rbl-cbse-option4 .o4-hero-main {
  position: relative;
  text-align: center;
  z-index: 3;
  max-width: 580px;
  width: 50%;
  padding: 28px 0 33px;
}
.rbl-v4.rbl-cbse-option4 .o4-kicker {
  font-size: var(--rbl-text-sm);
  font-weight: 800;
  font-family: var(--rbl-font-display);
  color: #e45e18;
  border: 1px solid #f5d4b4;
  padding: 5px 13px;
  border-radius: var(--rbl-radius-pill, 999px);
  background: #fff9f0;
  display: inline-block;
}
/*
 * O4 hero H1 exception: class-hub focal title may sit slightly above CBSE-root
 * hero scale (computed ~39px @1440). Cap near home-v5 max (2.65rem) + slight lift.
 * Weight 800 only — Outfit loads 700/800 (header.php), not 900.
 */
.rbl-v4.rbl-cbse-option4 .o4-hero h1 {
  font-size: clamp(2rem, 1.55rem + 1.35vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--r-navy);
  margin: 13px 0 8px;
  font-weight: 800;
}
.rbl-v4.rbl-cbse-option4 .o4-hero h1 .o4-accent { color: var(--r-orange); }
.rbl-v4.rbl-cbse-option4 .o4-hero-subtitle {
  font-size: var(--rbl-text-lg);
  font-weight: 800;
  font-family: var(--rbl-font-display);
  line-height: var(--rbl-leading-tight);
  margin: 0 0 7px;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-hero-desc {
  font-size: var(--rbl-text-sm);
  line-height: 1.55;
  color: #536480;
  margin: 0 auto;
  max-width: 440px;
}

.rbl-v4.rbl-cbse-option4 .o4-hero-searchbar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 6;
  width: min(770px, calc(100% - 48px));
  max-width: 770px;
  margin: 0;
  transform: translate(-50%, 50%);
  display: flex;
  gap: 10px;
  align-items: center;
}
.rbl-v4.rbl-cbse-option4 .o4-class-change {
  border: 1px solid #f5b48e;
  background: #fff;
  border-radius: 13px;
  padding: 0 16px;
  height: 48px;
  min-width: 126px;
  font-weight: 800;
  color: var(--r-navy);
  box-shadow: var(--r-shadow);
}
.rbl-v4.rbl-cbse-option4 .o4-searchform {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 5px 4px 16px;
  min-width: 0;
  flex: 1;
  background: #fff;
  border: 1px solid #dfe8f0;
  border-radius: 14px;
  box-shadow: var(--r-shadow);
  min-height: 48px;
}
.rbl-v4.rbl-cbse-option4 .o4-searchform-leading {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-searchform input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  font-size: var(--rbl-text-sm);
  line-height: 36px;
  background: transparent;
  color: var(--r-text);
}
.rbl-v4.rbl-cbse-option4 .o4-primary {
  /* Phase B: white-on-orange fills use accessible CTA tokens. */
  background: var(--rbl-cta-fill, #c2410c);
  color: #fff;
  border: 0;
  border-radius: var(--rbl-radius, 8px);
  padding: 11px 22px;
  font-weight: 700;
  font-size: var(--rbl-text-sm);
  min-height: var(--rbl-target, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-primary:hover { background: var(--rbl-cta-fill-hover, #9a3412); }

.rbl-v4.rbl-cbse-option4 .o4-segment { padding-top: 28px; }
.rbl-v4.rbl-cbse-option4 .o4-segment-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.rbl-v4.rbl-cbse-option4 .o4-segment-title h2 {
  /*
   * O4 visual-fidelity exception: approved mockup section titles sit near ~22px,
   * between --rbl-text-xl (1.25rem) and --rbl-text-2xl (1.5rem). Home v5 clamp
   * max 1.8rem made O4 look like a generic hub, not Option 4 composition.
   */
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.375rem);
  line-height: var(--rbl-leading-tight);
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
  color: var(--rbl-ink-strong, #142238);
}
.rbl-v4.rbl-cbse-option4 .o4-segment-title p {
  margin: 4px 0 0;
  color: var(--r-muted);
  font-size: var(--rbl-text-sm);
  line-height: 1.55;
}
.rbl-v4.rbl-cbse-option4 .o4-textlink {
  color: #eb560f;
  font-size: var(--rbl-text-sm);
  font-weight: 700;
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 0;
  min-height: var(--rbl-target, 44px);
  display: inline-flex;
  align-items: center;
}
.rbl-v4.rbl-cbse-option4 .o4-cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  min-height: var(--rbl-target, 44px);
  padding: 0.55rem 1rem;
  border-radius: var(--rbl-radius, 8px);
  background: var(--rbl-cta-fill, #c2410c);
  color: #fff;
  font-size: var(--rbl-text-sm);
  font-weight: 700;
}
.rbl-v4.rbl-cbse-option4 .o4-cta-link:hover { background: var(--rbl-cta-fill-hover, #9a3412); color: #fff; }
.rbl-v4.rbl-cbse-option4 .o4-subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.rbl-v4.rbl-cbse-option4 .o4-subject-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: var(--rbl-space-3, 12px);
  padding: var(--rbl-space-4, 16px);
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 13px;
  box-shadow: 0 4px 13px rgba(32, 54, 91, .035);
  transition: box-shadow var(--rbl-transition-fast, 150ms ease),
              border-color var(--rbl-transition-fast, 150ms ease);
}
.rbl-v4.rbl-cbse-option4 .o4-subject-card:hover {
  border-color: #ffc09a;
  box-shadow: 0 8px 20px rgba(32, 54, 91, .08);
}
.rbl-v4.rbl-cbse-option4 .o4-subject-card[data-palette="0"] { background: #eff6ff; }
.rbl-v4.rbl-cbse-option4 .o4-subject-card[data-palette="1"] { background: #fff1e7; }
.rbl-v4.rbl-cbse-option4 .o4-subject-card[data-palette="2"] { background: #fff8eb; }
.rbl-v4.rbl-cbse-option4 .o4-subject-card[data-palette="3"] { background: #eaf9f2; }
.rbl-v4.rbl-cbse-option4 .o4-subject-card .o4-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}
.rbl-v4.rbl-cbse-option4 .o4-subject-info { flex: 1; min-width: 0; }
.rbl-v4.rbl-cbse-option4 .o4-subject-name {
  /* O4 primary nav label — display face + md token for tile presence */
  font-family: var(--rbl-font-display);
  font-size: var(--rbl-text-md);
  font-weight: 800;
  line-height: 1.25;
  display: block;
  overflow-wrap: anywhere;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-subject-count {
  font-size: var(--rbl-text-xs);
  color: #596882;
  margin-top: 4px;
  display: block;
}
.rbl-v4.rbl-cbse-option4 .o4-round-arrow {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 50%;
  height: 30px;
  width: 30px;
  color: var(--r-orange);
  box-shadow: 0 1px 3px rgba(24, 41, 76, .08);
}
.rbl-v4.rbl-cbse-option4 .o4-round-arrow img { width: 16px; height: 16px; }
.rbl-v4.rbl-cbse-option4 .o4-all-subjects {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.rbl-v4.rbl-cbse-option4 .o4-all-subjects.is-open { display: grid; }

.rbl-v4.rbl-cbse-option4 .o4-resource-types {
  padding: 12px 15px 18px;
  border: 1px solid #f1edf0;
  border-radius: 20px;
  background: linear-gradient(113deg, #f1f7ff, #fff9ee);
  margin-top: 25px;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-types .o4-segment-title { margin: 0 0 13px; }
.rbl-v4.rbl-cbse-option4 .o4-resource-types .o4-segment-title h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.45vw, 1.3rem);
}
.rbl-v4.rbl-cbse-option4 .o4-type-scroll {
  position: relative;
}
.rbl-v4.rbl-cbse-option4 .o4-type-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.rbl-v4.rbl-cbse-option4 .o4-type-chip {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--r-border);
  border-radius: 12px;
  min-width: 0;
  /* One shared box model: fixed height so active/inactive match */
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 1px 2px rgba(24, 41, 76, .04);
}
.rbl-v4.rbl-cbse-option4 .o4-type-chip:hover {
  border-color: #ffc09a;
}
.rbl-v4.rbl-cbse-option4 .o4-type-chip.is-active {
  /* Color emphasis only — keep same height/padding/shadow footprint */
  background: var(--rbl-cta-fill, #c2410c);
  border-color: var(--rbl-cta-fill, #c2410c);
  color: #fff;
  box-shadow: 0 1px 2px rgba(24, 41, 76, .04);
}
.rbl-v4.rbl-cbse-option4 .o4-type-chip.is-active span { color: #fff; }
.rbl-v4.rbl-cbse-option4 .o4-type-chip:focus-visible {
  outline: 2px solid var(--r-orange);
  outline-offset: 2px;
}
/* Keep supplied multi-color type icons; white text provides active contrast */
.rbl-v4.rbl-cbse-option4 .o4-type-chip img {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
  align-self: center;
}
/*
 * Active chips sit on --r-orange. Several type icons (esp. all-resources)
 * use the same orange strokes and vanish without a light plate.
 */
.rbl-v4.rbl-cbse-option4 .o4-type-chip.is-active img {
  background: #fff;
  border-radius: var(--rbl-radius, 8px);
  box-sizing: border-box;
  padding: 2px;
}
.rbl-v4.rbl-cbse-option4 .o4-type-chip span {
  font-weight: 700;
  font-size: var(--rbl-text-sm);
  line-height: 1.2;
  color: var(--r-navy);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-width: 0;
  align-self: center;
}

.rbl-v4.rbl-cbse-option4 .o4-explorer {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 25px;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-panel {
  border: 1px solid var(--r-border);
  border-radius: 15px;
  padding: 14px 14px 8px;
  background: var(--rbl-surface-neutral, #f3f4f6);
  position: sticky;
  top: calc(var(--rbl-sticky-top, 65px) + 18px);
  /* Secondary panel: avoid dominating viewport with a tall sticky scrollbar */
  max-height: min(70vh, calc(100vh - var(--rbl-sticky-top, 65px) - 48px));
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-family: var(--rbl-font-display);
  font-size: var(--rbl-text-sm);
  margin-bottom: 15px;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-form fieldset {
  border: 0;
  border-top: 1px solid var(--r-border);
  padding: 13px 0;
  margin: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-form legend,
.rbl-v4.rbl-cbse-option4 .o4-filter-form .o4-filter-legend {
  display: block;
  font-size: var(--rbl-text-xs);
  font-weight: 800;
  font-family: var(--rbl-font-display);
  margin-bottom: 9px;
  padding: 0;
  float: none;
  width: 100%;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-option {
  font-size: var(--rbl-text-sm);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
  color: #334363;
  min-height: 36px;
  cursor: pointer;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-option input {
  accent-color: #ed611d;
  width: 15px;
  height: 15px;
  margin: 0;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-option small { color: #78869e; }
.rbl-v4.rbl-cbse-option4 .o4-filter-more,
.rbl-v4.rbl-cbse-option4 .o4-filter-group {
  border: 0;
  margin: 4px 0;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-more > summary,
.rbl-v4.rbl-cbse-option4 .o4-filter-group > summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--rbl-text-xs);
  font-weight: 700;
  color: var(--r-muted);
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-more > summary::-webkit-details-marker,
.rbl-v4.rbl-cbse-option4 .o4-filter-group > summary::-webkit-details-marker { display: none; }

.rbl-v4.rbl-cbse-option4 .o4-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  gap: 12px;
}
.rbl-v4.rbl-cbse-option4 .o4-results-header h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.45vw, 1.3rem);
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-results-header p {
  color: var(--r-muted);
  font-size: var(--rbl-text-xs);
  margin: 2px 0 0;
}
.rbl-v4.rbl-cbse-option4 .o4-results-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.rbl-v4.rbl-cbse-option4 .o4-results-actions label { font-size: var(--rbl-text-xs); }
.rbl-v4.rbl-cbse-option4 .o4-sortselect {
  border: 1px solid var(--r-border);
  border-radius: var(--rbl-radius, 8px);
  padding: 8px 10px;
  color: #1b2c51;
  font-size: var(--rbl-text-sm);
  background: #fff;
  min-height: var(--rbl-target, 44px);
}
.rbl-v4.rbl-cbse-option4 .o4-mobile-filters { display: none; }
.rbl-v4.rbl-cbse-option4 .o4-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.rbl-v4.rbl-cbse-option4 .o4-active-filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--rbl-radius-pill, 999px);
  background: #fff4e9;
  border: 1px solid #ffd2b3;
  font-size: var(--rbl-text-xs);
  font-weight: 700;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-active-filters .o4-clear { background: #fff; color: var(--r-orange); }

.rbl-v4.rbl-cbse-option4 .o4-resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--rbl-space-3, 12px);
  align-items: stretch;
}
/* Approved Option 4 card: large type icon left + body hierarchy right */
.rbl-v4.rbl-cbse-option4 .o4-resource-card {
  border: 1px solid #e8edf4;
  border-radius: 13px;
  background: #fff;
  padding: 14px 14px 12px;
  min-height: 148px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 11px rgba(25, 51, 91, .03);
  height: 100%;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  margin-top: 2px;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.rbl-v4.rbl-cbse-option4 .o4-rtype {
  font-size: 0.6875rem;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: var(--rbl-radius-sm, 6px);
  background: #fff0e4;
  color: #d95713;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
}
.rbl-v4.rbl-cbse-option4 .o4-year { font-size: var(--rbl-text-xs); color: #697990; font-weight: 600; }
.rbl-v4.rbl-cbse-option4 .o4-resource-title {
  font-size: var(--rbl-text-md);
  line-height: 1.35;
  font-weight: 800;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-resource-title a:hover { color: var(--r-orange); }
.rbl-v4.rbl-cbse-option4 .o4-resource-meta {
  font-size: var(--rbl-text-sm);
  color: #6d7b95;
  margin: 0 0 8px;
  line-height: 1.4;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f0f2f6;
  gap: 10px;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-evidence {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
}
.rbl-v4.rbl-cbse-option4 .o4-answer-flag {
  font-size: var(--rbl-text-xs);
  color: #128665;
  font-weight: 700;
}
.rbl-v4.rbl-cbse-option4 .o4-answer-flag.is-muted {
  color: #8b95a5;
  font-weight: 600;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-proof {
  font-size: var(--rbl-text-xs);
  color: #8b95a5;
  font-weight: 600;
}
.rbl-v4.rbl-cbse-option4 .o4-resource-cta {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--rbl-cta-fill, #c2410c);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(194, 65, 12, .28);
}
.rbl-v4.rbl-cbse-option4 .o4-resource-cta:hover { background: var(--rbl-cta-fill-hover, #9a3412); color: #fff; }
.rbl-v4.rbl-cbse-option4 .o4-resource-cta:focus-visible {
  outline: 2px solid var(--r-orange);
  outline-offset: 3px;
}
/* Back-compat if older markup still present */
.rbl-v4.rbl-cbse-option4 .o4-resource-link {
  font-size: var(--rbl-text-sm);
  font-weight: 700;
  color: #e95414;
  white-space: nowrap;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.rbl-v4.rbl-cbse-option4 .o4-empty {
  border: 1px dashed var(--r-border);
  border-radius: 13px;
  padding: 28px 18px;
  text-align: center;
  background: var(--rbl-surface-neutral, #f3f4f6);
}
.rbl-v4.rbl-cbse-option4 .o4-empty h3 { margin: 0 0 8px; font-size: var(--rbl-text-md); font-weight: 800; }
.rbl-v4.rbl-cbse-option4 .o4-empty p { margin: 0 0 12px; color: var(--r-muted); font-size: var(--rbl-text-sm); }

.rbl-v4.rbl-cbse-option4 .o4-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  color: #586984;
  font-size: var(--rbl-text-sm);
}
.rbl-v4.rbl-cbse-option4 .o4-pagination a,
.rbl-v4.rbl-cbse-option4 .o4-pagination span {
  min-height: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 7px;
}
.rbl-v4.rbl-cbse-option4 .o4-pagination .o4-sel {
  background: var(--rbl-cta-fill, #c2410c);
  color: #fff;
  font-weight: 800;
}
.rbl-v4.rbl-cbse-option4 .o4-pagination [aria-disabled="true"] { opacity: .45; }

.rbl-v4.rbl-cbse-option4 .o4-bottom-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 23px 0 22px;
}
.rbl-v4.rbl-cbse-option4 .o4-info-card {
  border: 1px solid var(--r-border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
}
.rbl-v4.rbl-cbse-option4 .o4-info-card:nth-child(3) { background: #fff1e6; }
.rbl-v4.rbl-cbse-option4 .o4-info-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #eaf3ff;
  display: grid;
  place-items: center;
}
.rbl-v4.rbl-cbse-option4 .o4-info-icon img { width: 32px; height: 32px; }
.rbl-v4.rbl-cbse-option4 .o4-info-card h3 { margin: 0; font-size: var(--rbl-text-sm); font-weight: 800; }
.rbl-v4.rbl-cbse-option4 .o4-info-card p {
  font-size: var(--rbl-text-xs);
  color: #60708a;
  margin: 3px 0 0;
}
.rbl-v4.rbl-cbse-option4 .o4-info-card .o4-textlink { min-height: auto; margin-top: 6px; font-size: var(--rbl-text-xs); }

.rbl-v4.rbl-cbse-option4 .o4-faq { padding: 14px 0 32px; }
.rbl-v4.rbl-cbse-option4 .o4-faq h2,
.rbl-v4.rbl-cbse-option4 .o4-support > h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.375rem);
  margin: 0 0 8px;
  font-weight: 800;
}
.rbl-v4.rbl-cbse-option4 .o4-faq > p { color: var(--r-muted); font-size: var(--rbl-text-sm); margin: 0 0 10px; }
.rbl-v4.rbl-cbse-option4 .o4-faq details {
  border-bottom: 1px solid var(--r-border);
  padding: 11px 0;
  font-size: var(--rbl-text-sm);
}
.rbl-v4.rbl-cbse-option4 .o4-faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  min-height: var(--rbl-target, 44px);
  display: flex;
  align-items: center;
}
.rbl-v4.rbl-cbse-option4 .o4-faq summary::-webkit-details-marker { display: none; }
.rbl-v4.rbl-cbse-option4 .o4-faq details p {
  margin: 8px 0 0;
  color: #536480;
  line-height: 1.5;
}

.rbl-v4.rbl-cbse-option4 .o4-support {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--r-border);
  border-radius: 14px;
  background: var(--rbl-surface-neutral, #f3f4f6);
}
.rbl-v4.rbl-cbse-option4 .o4-support-copy {
  font-size: var(--rbl-text-sm);
  color: #536480;
  line-height: 1.55;
}
.rbl-v4.rbl-cbse-option4 .o4-support-copy p { margin: 0 0 10px; }
.rbl-v4.rbl-cbse-option4 .o4-support-copy a { color: var(--r-orange); font-weight: 700; }

.rbl-v4.rbl-cbse-option4 .o4-filter-dialog {
  border: 0;
  border-radius: 16px 16px 0 0;
  padding: 0;
  width: min(100%, 480px);
  max-height: min(88vh, 720px);
  margin: auto 0 0 auto;
}
.rbl-v4.rbl-cbse-option4 .o4-filter-dialog::backdrop { background: rgba(16, 33, 77, .45); }
.rbl-v4.rbl-cbse-option4 .o4-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--r-border);
}
.rbl-v4.rbl-cbse-option4 .o4-drawer-head h2 { margin: 0; font-size: var(--rbl-text-md); font-weight: 800; }
.rbl-v4.rbl-cbse-option4 .o4-drawer-head button {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  color: var(--r-navy);
}
.rbl-v4.rbl-cbse-option4 .o4-drawer-scroll {
  padding: 8px 16px 16px;
  overflow-y: auto;
  max-height: calc(min(88vh, 720px) - 64px);
}
.rbl-v4.rbl-cbse-option4 .o4-drawer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 10px;
}
.rbl-v4.rbl-cbse-option4 .o4-drawer-actions button {
  flex: 1;
  min-height: 44px;
}
.rbl-v4.rbl-cbse-option4 .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

@media (max-width: 1160px) {
  .rbl-v4.rbl-cbse-option4 .o4-type-grid { grid-template-columns: repeat(4, 1fr); }
  .rbl-v4.rbl-cbse-option4 .o4-resource-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rbl-v4.rbl-cbse-option4 .o4-hero { min-height: 250px; }
  .rbl-v4.rbl-cbse-option4 .o4-hero-main { width: 56%; }
  .rbl-v4.rbl-cbse-option4 .o4-subject-grid,
  .rbl-v4.rbl-cbse-option4 .o4-all-subjects { grid-template-columns: repeat(2, 1fr); }
  .rbl-v4.rbl-cbse-option4 .o4-explorer { grid-template-columns: 210px 1fr; }
  .rbl-v4.rbl-cbse-option4 .o4-type-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .rbl-v4.rbl-cbse-option4 .o4-shell { padding: 0 var(--rbl-space-4, 16px); }
  /* Expected mobile composition starts at Class H1 — hide breadcrumb on phone */
  .rbl-v4.rbl-cbse-option4 .o4-breadcrumb { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-hero {
    height: auto;
    min-height: 0;
    border-radius: 0;
    display: block;
    overflow: visible;
    isolation: auto;
    /*
     * Flat soft cream only on mobile — do NOT use hero-soft-clouds.svg here.
     * That SVG bakes a rounded peach rect which re-creates the rejected
     * “tall floating card” chrome. Landscape art blends into this surface.
     */
    background: #fff8ee;
    padding: 8px 0 10px;
    margin-bottom: 12px;
  }
  /* Mobile: copy first (full width); Class title dominates */
  .rbl-v4.rbl-cbse-option4 .o4-hero-main {
    position: relative;
    z-index: 3;
    width: auto;
    max-width: none;
    text-align: left;
    padding: 4px 2px 0;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.2rem);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 3px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-subtitle {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    max-width: none;
    margin: 0 0 4px;
  }
  /* Board-exam cue stays desktop-only so Class 12 stays compact */
  .rbl-v4.rbl-cbse-option4 .o4-hero-subtitle-board { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-hero-desc {
    font-size: 0.8125rem;
    line-height: 1.4;
    max-width: none;
    margin: 0;
    color: #5a6d85;
  }
  /* Compact mobile hero: remove redundant CBSE pill above H1 (desktop unchanged) */
  .rbl-v4.rbl-cbse-option4 .o4-kicker { display: none; }
  /* Hide desktop side-pair arts on mobile (sources already media-gated) */
  .rbl-v4.rbl-cbse-option4 .o4-hero-art--left,
  .rbl-v4.rbl-cbse-option4 .o4-hero-art--right {
    display: none !important;
  }
  /*
   * Landscape mobile-v4: full content width, no portrait frame/card chrome.
   * Art has baked soft edges that blend into the warm hero cream.
   */
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-stage {
    display: block;
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 2px 0 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-art {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    max-inline-size: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-picture {
    display: block;
    width: 100%;
    margin: 0;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-picture img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    transform: none;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-searchbar {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: auto;
    max-width: none;
    z-index: 4;
    margin: 8px 0 0;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .rbl-v4.rbl-cbse-option4 .o4-class-change {
    height: var(--rbl-target, 44px);
    min-width: 98px;
    max-width: 118px;
    padding: 0 10px;
    font-size: var(--rbl-text-sm);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 33, 77, 0.08);
  }
  .rbl-v4.rbl-cbse-option4 .o4-searchform {
    height: var(--rbl-target, 44px);
    padding: 3px 4px 3px 10px;
    gap: 5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 33, 77, 0.08);
  }
  .rbl-v4.rbl-cbse-option4 .o4-searchform input {
    font-size: var(--rbl-fs-search, 16px);
    line-height: 29px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-searchform input::placeholder {
    color: #6b7280;
  }
  /* Approved concept: orange icon CTA (not text “Search”) */
  .rbl-v4.rbl-cbse-option4 .o4-primary-label { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-primary-icon {
    display: block;
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
  }
  .rbl-v4.rbl-cbse-option4 .o4-primary {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-segment { padding-top: 22px; }
  .rbl-v4.rbl-cbse-option4 .o4-segment-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .rbl-v4.rbl-cbse-option4 .o4-subject-grid,
  .rbl-v4.rbl-cbse-option4 .o4-all-subjects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-subject-card {
    min-height: 84px;
    padding: 12px 10px;
    gap: 10px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-subject-card .o4-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .rbl-v4.rbl-cbse-option4 .o4-subject-name { font-size: var(--rbl-text-sm); }
  .rbl-v4.rbl-cbse-option4 .o4-subject-count { font-size: var(--rbl-text-xs); }
  .rbl-v4.rbl-cbse-option4 .o4-round-arrow { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-resource-types { padding: 12px 0 11px; margin-top: 22px; border: 0; background: transparent; border-radius: 0; }
  /* Mobile: horizontal scroll shortcuts; hide ugly scrollbar; keep scrollability */
  .rbl-v4.rbl-cbse-option4 .o4-type-scroll {
    margin: 0 -2px;
    padding: 0 2px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-scroll::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .92));
    opacity: 1;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-grid {
    display: flex;
    align-items: center;
    gap: var(--rbl-space-2, 8px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 18px 6px 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* legacy Edge */
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-grid::-webkit-scrollbar { display: none; height: 0; }
  /* One chip family: identical box model; active = color + icon plate only */
  .rbl-v4.rbl-cbse-option4 .o4-type-chip {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 138px;
    min-width: 138px;
    max-width: 138px;
    height: var(--rbl-touch-min, 48px);
    min-height: var(--rbl-touch-min, 48px);
    max-height: var(--rbl-touch-min, 48px);
    padding: var(--rbl-space-2, 8px) 10px;
    gap: var(--rbl-space-2, 8px);
    border-radius: var(--rbl-radius-lg, 12px);
    border-width: 1px;
    border-style: solid;
    align-items: center;
    justify-content: flex-start;
    scroll-snap-align: start;
    box-shadow: none;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-chip.is-active {
    box-shadow: none;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-chip img {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    margin: 0;
    padding: 0;
    border-radius: var(--rbl-radius-sm, 6px);
    object-fit: contain;
    align-self: center;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-chip.is-active img {
    background: #fff;
    border-radius: var(--rbl-radius-sm, 6px);
    padding: 2px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-type-chip span {
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: var(--rbl-text-xs);
    font-weight: 700;
    line-height: 1.2;
    /* Natural 1–2 line height; chip align-items centers icon+label together */
    min-height: 0;
    max-height: calc(1.2em * 2);
    align-self: center;
  }
  .rbl-v4.rbl-cbse-option4 .o4-explorer { display: block; margin-top: 21px; }
  .rbl-v4.rbl-cbse-option4 .o4-filters-desktop { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-mobile-filters {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-mobile-filters button,
  .rbl-v4.rbl-cbse-option4 .o4-mobile-filters .o4-tool-select {
    border: 1px solid #e4ebf3;
    background: #fff;
    border-radius: var(--rbl-radius, 8px);
    padding: 10px 12px;
    font-size: var(--rbl-text-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: var(--rbl-target, 44px);
    flex: 1;
  }
  .rbl-v4.rbl-cbse-option4 .o4-mobile-filters img { width: 17px; height: 17px; }
  .rbl-v4.rbl-cbse-option4 .o4-results-actions { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-resource-list { grid-template-columns: 1fr; gap: 10px; }
  .rbl-v4.rbl-cbse-option4 .o4-resource-card { min-height: 0; padding: 12px; }
  .rbl-v4.rbl-cbse-option4 .o4-resource-title { font-size: var(--rbl-text-md); }
  .rbl-v4.rbl-cbse-option4 .o4-bottom-strip { grid-template-columns: 1fr; gap: 9px; padding-top: 22px; }
  .rbl-v4.rbl-cbse-option4 .o4-info-card { align-items: flex-start; }
}
@media (max-width: 360px) {
  .rbl-v4.rbl-cbse-option4 .o4-hero {
    padding: 8px 0 10px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-main {
    padding: 2px 0 0;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-art {
    /* Landscape art already compact at 320 — keep full content width */
    max-inline-size: none;
    margin-top: 0;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-searchbar {
    margin-top: 6px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-subject-grid,
  .rbl-v4.rbl-cbse-option4 .o4-all-subjects { grid-template-columns: 1fr; }
  .rbl-v4.rbl-cbse-option4 .o4-type-chip {
    width: 128px;
    min-width: 128px;
    max-width: 128px;
  }
}
@media (min-width: 701px) {
  .rbl-v4.rbl-cbse-option4 .o4-filter-dialog { display: none; }
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-stage,
  .rbl-v4.rbl-cbse-option4 .o4-hero-mobile-art { display: none !important; }
  /*
   * Desktop search row: keep overflow:hidden on .o4-hero so side art clips to the
   * rounded peach panel. Do NOT use translateY(50%) — that hung half the controls
   * outside the clip box (~27px) and hid the dropdown / search / Search button.
   * Park the row fully inside the hero; keep only a tight cream cushion under it.
   */
  .rbl-v4.rbl-cbse-option4 .o4-hero {
    margin-bottom: 12px;
    padding-bottom: 20px;
    box-sizing: border-box;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-main {
    padding-bottom: 60px;
  }
  .rbl-v4.rbl-cbse-option4 .o4-hero-searchbar {
    bottom: 10px;
    transform: translateX(-50%);
  }
  /* Tighten hero → Explore subjects gap (desktop only) */
  .rbl-v4.rbl-cbse-option4 .o4-hero + .o4-segment {
    padding-top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rbl-v4.rbl-cbse-option4 *,
  .rbl-v4.rbl-cbse-option4 *::before,
  .rbl-v4.rbl-cbse-option4 *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
