/**
 * Chapter Landing V2 — scoped to .rbl-chapter-v2
 * Reuses global Ribblu tokens; does not alter other page families.
 */
.rbl-chapter-v2 {
  --cv2-ink: var(--rbl-ink-strong, #142238);
  --cv2-text: var(--rbl-ink, #1f2937);
  --cv2-muted: var(--rbl-muted-readable, #4b5563);
  --cv2-orange: var(--rbl-cta-fill, #c2410c);
  --cv2-orange-dark: var(--rbl-cta-fill-hover, #9a3412);
  --cv2-tint: var(--rbl-surface-warm, #fcf7f1);
  --cv2-line: var(--rbl-border-warm, #ece8e2);
  --cv2-weak: var(--rbl-surface-neutral, #f3f4f6);
  --cv2-shadow: 0 5px 19px rgba(29, 37, 48, 0.035);
  --cv2-wide: 1192px;
  color: var(--cv2-text);
  font-family: var(--rbl-font-body);
  /* Extra clearance so the last resource open control can sit fully above fixed bottom nav. */
  padding-bottom: calc(var(--rbl-bottom-nav-h, 80px) + var(--rbl-space-10, 40px) + var(--rbl-safe-bottom, 0px));
}

.rbl-chapter-v2-shell {
  max-width: var(--cv2-wide);
}

.rbl-chapter-v2-breadcrumb {
  margin: 14px 0 12px;
  font-size: var(--rbl-fs-meta, 13px);
  color: var(--rbl-muted-readable, #4b5563);
}

.rbl-chapter-v2 h1,
.rbl-chapter-v2 h2,
.rbl-chapter-v2 h3 {
  font-family: var(--rbl-font-display);
  color: var(--cv2-ink);
  letter-spacing: -0.03em;
}

.rbl-cv2-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.rbl-cv2-eyebrow {
  font-size: 10px;
  letter-spacing: 0.115em;
  text-transform: uppercase;
  color: #a95328;
  font-weight: 790;
  margin-bottom: 6px;
}

.rbl-cv2-hero {
  background: var(--cv2-tint);
  border: 1px solid #efdfd1;
  min-height: 176px;
  border-radius: 18px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 33px 25px 35px;
  overflow: hidden;
}

.rbl-cv2-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cv2-orange);
}

.rbl-cv2-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 87%;
}

.rbl-cv2-kicker {
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  color: #9e4d26;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rbl-cv2-subject-dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--cv2-orange);
  display: inline-block;
}

.rbl-cv2-split { color: #c5a68f; }
.rbl-cv2-muted-label { color: #ad8170; font-weight: 550; }

.rbl-cv2-hero h1 {
  font-size: 40px;
  line-height: 1.17;
  margin: 0;
  max-width: 870px;
  overflow-wrap: anywhere;
  /* Owner-approved Phase B final: Outfit display weight 700. */
  font-weight: 700;
}

.rbl-cv2-hero-foot {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-top: 14px;
  min-width: 0;
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-fs-meta, 13px);
  line-height: var(--rbl-leading-body, 1.6);
  font-weight: 500;
  flex-wrap: wrap;
}

.rbl-cv2-pdf-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rbl-cv2-pdf-count strong {
  color: var(--cv2-ink);
  font-weight: 700;
}

.rbl-cv2-hero-caption {
  font-size: var(--rbl-fs-supporting, 14px);
  color: var(--rbl-muted-readable, #4b5563);
  font-weight: 500;
  line-height: var(--rbl-leading-body, 1.6);
}

.rbl-cv2-hero-motif {
  color: rgba(198, 75, 24, 0.32);
  margin-right: 8px;
  flex: 0 0 auto;
}

.rbl-cv2-hero-motif svg ellipse,
.rbl-cv2-hero-motif svg path,
.rbl-cv2-hero-motif svg rect {
  stroke-width: 1.75;
}

.rbl-cv2-first-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 287px;
  gap: 30px;
  align-items: start;
  margin-top: 26px;
}

.rbl-cv2-primary,
.rbl-cv2-rail { min-width: 0; }

.rbl-cv2-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 15px;
}

.rbl-cv2-section-head h2,
.rbl-cv2-below-section h2,
.rbl-cv2-info-card h2,
.rbl-cv2-faq-card h2,
.rbl-cv2-community h2,
.rbl-cv2-about h2 {
  font-size: 22px;
  line-height: 1.22;
  margin: 0;
}

.rbl-cv2-section-head p {
  font-size: var(--rbl-fs-meta, 13px);
  margin-top: 6px;
  line-height: var(--rbl-leading-body, 1.6);
  color: var(--rbl-muted-readable, #4b5563);
  font-weight: 500;
}

.rbl-cv2-count-grey {
  color: #a5adb5;
  font-size: 15px;
  font-family: var(--rbl-font-body);
  letter-spacing: 0;
}

.rbl-cv2-library-panel {
  border: 1px solid #eae6e1;
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--cv2-shadow);
}

.rbl-cv2-filterstrip {
  border-bottom: 1px solid var(--cv2-line);
  padding: 10px 11px;
  display: grid;
  gap: 10px;
}

.rbl-cv2-chipset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.rbl-cv2-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e7e1da;
  background: #fff;
  color: var(--cv2-text);
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 12px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 700;
}

.rbl-cv2-pill small {
  color: var(--cv2-muted);
  font-weight: 650;
}

.rbl-cv2-pill.is-selected,
.rbl-cv2-pill[aria-current="true"] {
  background: var(--cv2-orange);
  border-color: var(--cv2-orange);
  color: #fff;
}

.rbl-cv2-pill.is-selected small,
.rbl-cv2-pill[aria-current="true"] small {
  color: rgba(255, 255, 255, 0.9);
}

.rbl-cv2-pill:focus-visible,
.rbl-cv2-open:focus-visible,
.rbl-cv2-rail-link:focus-visible,
.rbl-cv2-chapter-chip:focus-visible,
.rbl-cv2-collection-card:focus-visible,
.rbl-cv2-contribute-button:focus-visible,
.rbl-cv2-community-cta:focus-visible,
.rbl-cv2-toolbar-btn:focus-visible {
  outline: 3px solid var(--rbl-focus, #1d4ed8);
  outline-offset: 2px;
}

.rbl-cv2-small-select {
  display: none;
  align-items: center;
  gap: 12px;
}

.rbl-cv2-small-select label {
  font-size: 11px;
  font-weight: 700;
  color: #566170;
  white-space: nowrap;
}

.rbl-cv2-small-select select,
.rbl-cv2-dense-toolbar input,
.rbl-cv2-dense-toolbar select {
  min-width: 0;
  width: 100%;
  border: 1px solid #e8e1d9;
  padding: 9px 10px;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  color: #394758;
  min-height: 44px;
}

.rbl-cv2-dense-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.rbl-cv2-toolbar-btn {
  border: 0;
  background: var(--cv2-orange);
  color: #fff;
  border-radius: 9px;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 12px;
}

.rbl-cv2-resource {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--cv2-line);
}

.rbl-cv2-resource:last-child { border-bottom: 0; }

.rbl-cv2-doc {
  width: 36px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f4f1ec;
  color: #7a8694;
}

.rbl-cv2-doc--qb { background: #fff1e8; color: #c64b18; }
.rbl-cv2-doc--notes { background: #eef6ff; color: #2f6fad; }
.rbl-cv2-doc--test { background: #eefaf1; color: #2f7a4c; }
.rbl-cv2-doc--worksheet { background: #f7f0ff; color: #6b4ca0; }

.rbl-cv2-resource-name {
  display: block;
  color: var(--cv2-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rbl-cv2-resource-name:hover { color: var(--cv2-orange-dark); }

.rbl-cv2-resource-sub {
  margin-top: 3px;
  font-size: var(--rbl-fs-meta, 13px);
  line-height: var(--rbl-leading-body, 1.6);
  color: var(--rbl-muted-readable, #4b5563);
  font-weight: 500;
}

.rbl-cv2-open {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--cv2-orange);
  text-decoration: none;
  background: #fff7f1;
}

.rbl-cv2-list-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-top: 1px solid var(--cv2-line);
  font-size: var(--rbl-fs-meta, 13px);
  color: var(--rbl-muted-readable, #4b5563);
  background: var(--cv2-weak);
}

.rbl-cv2-pager {
  display: inline-flex;
  gap: 12px;
}

.rbl-cv2-pager a {
  color: var(--cv2-orange-dark);
  font-weight: 700;
  text-decoration: none;
}

.rbl-cv2-empty {
  padding: 28px 18px;
  text-align: center;
}

.rbl-cv2-reset {
  display: inline-block;
  margin-top: 10px;
  color: var(--cv2-orange-dark);
  font-weight: 700;
}

.rbl-cv2-rail-panel,
.rbl-cv2-contribute {
  border: 1px solid #ebe6e0;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--cv2-shadow);
}

.rbl-cv2-rail-panel h3,
.rbl-cv2-contribute h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.rbl-cv2-rail-panel p,
.rbl-cv2-contribute p {
  font-size: 12px;
  color: var(--cv2-muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.rbl-cv2-rail-links {
  display: grid;
  gap: 8px;
}

.rbl-cv2-rail-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  color: var(--cv2-ink);
  border: 1px solid #ece7e1;
  border-radius: 10px;
  padding: 10px 11px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 650;
}

.rbl-cv2-rail-link small { color: var(--cv2-muted); font-weight: 600; }

.rbl-cv2-contribute { margin-top: 15px; text-align: left; }
.rbl-cv2-contribute-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff1e8;
  color: var(--cv2-orange);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.rbl-cv2-contribute-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--cv2-orange);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.rbl-cv2-contribute small {
  display: block;
  margin-top: 8px;
  color: var(--cv2-muted);
  font-size: 11px;
}

.rbl-cv2-below { margin-top: 28px; display: grid; gap: 22px; }

.rbl-cv2-below-section,
.rbl-cv2-about,
.rbl-cv2-community {
  border: 1px solid #ebe6e0;
  border-radius: 15px;
  background: #fff;
  padding: 24px 26px;
  box-shadow: var(--cv2-shadow);
}

.rbl-cv2-chapter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rbl-cv2-chapter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e8e2db;
  text-decoration: none;
  color: var(--cv2-ink);
  font-size: 12.5px;
  font-weight: 650;
  background: #fff;
}

.rbl-cv2-text-end-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--cv2-orange-dark);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.rbl-cv2-collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.rbl-cv2-collection-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 78px;
  border: 1px solid #ebe5df;
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: var(--cv2-ink);
  background: #fcfcfb;
  font-weight: 650;
  font-size: 13px;
}

.rbl-cv2-collection-card small {
  color: var(--cv2-muted);
  font-weight: 600;
  font-size: 11.5px;
}

.rbl-cv2-about-body {
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-fs-supporting, 14px);
  line-height: var(--rbl-leading-body, 1.6);
}

.rbl-cv2-about-body p { margin: 0 0 0.85em; }
.rbl-cv2-about-body p:last-child { margin-bottom: 0; }

.rbl-cv2-info-faq {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 14px;
}

.rbl-cv2-info-card,
.rbl-cv2-faq-card {
  border: 1px solid #ebe6e0;
  border-radius: 15px;
  background: #fff;
  padding: 22px;
  box-shadow: var(--cv2-shadow);
}

.rbl-cv2-info-card dl {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
}

.rbl-cv2-info-card dt {
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-fs-meta, 13px);
}

.rbl-cv2-info-card dd {
  margin: 0;
  color: var(--cv2-ink);
  font-size: var(--rbl-fs-meta, 13px);
  font-weight: 650;
}

.rbl-cv2-faq-list { display: grid; gap: 8px; margin-top: 12px; }

.rbl-cv2-faq-item {
  border: 1px solid #ece7e1;
  border-radius: 10px;
  padding: 0 12px;
  background: #fcfcfb;
}

.rbl-cv2-faq-item summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--cv2-ink);
  font-size: 13.5px;
}

.rbl-cv2-faq-item summary::-webkit-details-marker { display: none; }

.rbl-cv2-faq-item p {
  margin: 0 0 12px;
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-fs-supporting, 14px);
  line-height: var(--rbl-leading-body, 1.6);
}

.rbl-cv2-community-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.rbl-cv2-community p {
  margin: 6px 0 0;
  color: var(--rbl-muted-readable, #4b5563);
  font-size: var(--rbl-fs-supporting, 14px);
  line-height: var(--rbl-leading-body, 1.6);
}

.rbl-cv2-latest-upload {
  margin-top: 16px;
  border-top: 1px solid var(--cv2-line);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.rbl-cv2-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a95328;
  font-weight: 750;
  margin-bottom: 4px;
}

.rbl-cv2-upload-link,
.rbl-cv2-community-cta {
  color: var(--cv2-orange-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  padding: 0;
  min-height: 0;
  border-radius: 0;
}

.rbl-cv2-recent-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rbl-cv2-recent-list a {
  color: var(--cv2-ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 13px;
}

.rbl-cv2-recent-list small {
  display: block;
  color: var(--cv2-muted);
  font-size: 11px;
  margin-top: 2px;
}

@media (max-width: 1080px) {
  .rbl-cv2-first-grid { grid-template-columns: minmax(0, 1fr) 258px; gap: 20px; }
  .rbl-cv2-collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rbl-cv2-hero h1 { font-size: 36px; }
}

@media (max-width: 840px) {
  .rbl-cv2-first-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
  }
  .rbl-cv2-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .rbl-cv2-contribute { margin-top: 0; }
  .rbl-cv2-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rbl-cv2-info-faq { grid-template-columns: 1fr 1.2fr; }
  .rbl-cv2-hero { padding: 20px 24px; min-height: 140px; }
  .rbl-cv2-hero h1 { font-size: 33px; }
}

@media (max-width: 600px) {
  .rbl-chapter-v2-breadcrumb {
    margin: 8px 0 8px;
  }
  .rbl-cv2-first-grid {
    margin-top: 14px;
    gap: 16px;
  }
  .rbl-cv2-section-head {
    margin-bottom: 10px;
  }
  .rbl-cv2-section-head p {
    margin-top: 4px;
  }
  .rbl-cv2-filterstrip {
    padding: 8px 10px;
    gap: 8px;
  }
  .rbl-cv2-chipset {
    gap: 6px;
  }
  .rbl-cv2-hero {
    border-radius: 15px;
    padding: 14px 16px 14px;
    min-height: 0;
  }
  .rbl-cv2-kicker {
    margin-bottom: 8px;
  }
  .rbl-cv2-hero-foot {
    margin-top: 10px;
    gap: 12px;
    font-size: var(--rbl-fs-meta, 13px);
  }
  .rbl-cv2-hero-copy { max-width: 100%; }
  .rbl-cv2-hero h1 {
    font-size: var(--rbl-text-3xl, 1.875rem);
    line-height: 1.15;
    max-width: 94%;
    padding-right: 45px;
  }
  .rbl-cv2-hero-caption { display: none; }
  /* Mobile: clearer motif without overpowering the H1 */
  .rbl-cv2-hero-motif {
    position: absolute;
    right: -4px;
    top: 2px;
    margin: 0;
    color: rgba(183, 65, 20, 0.62);
    opacity: 1;
    transform: scale(0.92);
    transform-origin: center;
  }
  .rbl-cv2-hero-motif svg ellipse,
  .rbl-cv2-hero-motif svg path,
  .rbl-cv2-hero-motif svg rect {
    stroke-width: 2;
  }
  .rbl-cv2-section-head p,
  .rbl-cv2-resource-sub {
    font-size: var(--rbl-fs-meta, 13px);
  }
  .rbl-cv2-about-body,
  .rbl-cv2-faq-item p,
  .rbl-cv2-community p {
    font-size: var(--rbl-fs-supporting, 14px);
  }
  .rbl-cv2-rail { grid-template-columns: 1fr; }
  .rbl-cv2-section-head h2,
  .rbl-cv2-below-section h2,
  .rbl-cv2-info-card h2,
  .rbl-cv2-faq-card h2,
  .rbl-cv2-community h2,
  .rbl-cv2-about h2 { font-size: 20px; }
  .rbl-cv2-info-faq { grid-template-columns: 1fr; }
  .rbl-cv2-collection-grid { grid-template-columns: 1fr 1fr; }
  .rbl-cv2-dense-toolbar { grid-template-columns: 1fr; }
  .rbl-chapter-v2.is-dense .rbl-cv2-chipset { display: none; }
  .rbl-chapter-v2.is-dense .rbl-cv2-small-select { display: flex; }
}

@media (max-width: 390px) {
  .rbl-cv2-hero h1 {
    font-size: 1.75rem;
    max-width: 100%;
    /* Keep clearance from absolute motif (artwork preserved at 361–390) */
    padding-right: 78px;
  }
  .rbl-cv2-pill { font-size: 10.5px; padding: 8px 9px; }
  .rbl-cv2-resource-name { font-size: var(--rbl-fs-meta, 13px); }
  .rbl-cv2-collection-grid { grid-template-columns: 1fr 1fr; }
  .rbl-cv2-hero-motif {
    right: -22px;
    color: rgba(183, 65, 20, 0.58);
    transform: scale(0.7);
  }
}

@media (max-width: 360px) {
  /*
   * Narrow phones (≈320): decorative atom motif crosses long H1s when
   * absolutely positioned. Hide motif only here — keep it at 390+ / desktop.
   * H1 weight 700 and hero structure unchanged.
   */
  .rbl-cv2-hero-motif {
    display: none;
  }
  .rbl-cv2-hero h1 {
    padding-right: 0;
    max-width: 100%;
  }
}

@media (max-width: 345px) {
  .rbl-cv2-hero h1 { font-size: 1.625rem; }
  .rbl-cv2-resource { padding: 11px 9px; gap: 9px; }
  .rbl-cv2-collection-grid { grid-template-columns: 1fr; }
}
