/* ============================================================
   20 — HCS GUIDE PAGE ("Living with HCS")
   ============================================================
   Purpose:  Page-specific styles for the HCS guide long-form
             content page: two-column layout with sticky TOC,
             team cards, monitoring grid, red-flag list,
             age-band timeline, inheritance cards, callouts,
             accordions, cross-links, and closing CTA.

   Depends:  01-core-tokens-base.css (tokens, z-index scale)
             07-buttons.css (.byr-primary, .byr-outline)

   Enqueue:  functions.php → byr-hcs-guide
             Loaded only on the hcs-guide page.

   Migration note:
     Extracted from inline <style> in inc/hcs-guide-page.php.
     Token-mapped where practical; class names unchanged.

   TABLE OF CONTENTS:
     1.  Outer Grid Layout
     2.  Skip Link (page-local)
     3.  Sticky Table of Contents
     4.  Main Column & Sections
     5.  Typography (h2, h3, h4, p, strong, a)
     6.  Divider
     7.  Callouts
     8.  Accordions
     9.  Team Grid & Cards
     10. Monitoring Grid
     11. Red Flags
     12. Age-Band Timeline
     13. Inheritance Cards
     14. Cross-Links
     15. Closing CTA
     16. Responsive (max-width: 860px)
     17. Responsive (min-width: 861px)
     18. Responsive (max-width: 760px)
     19. Responsive (max-width: 560px)
     20. Responsive (max-width: 480px)
     21. Responsive (max-width: 375px)
     22. Reduced Motion
     23. Light Mode
     24. Forced Colors (Windows High Contrast)
   ============================================================ */


/* ==========================================================
   1. OUTER GRID LAYOUT
========================================================== */
.byr-lw-outer {
  position: relative;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem) 4rem;
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-areas: "toc main";
  gap: 3.5rem;
  align-items: start;
}


/* ==========================================================
   2. SKIP LINK (page-local)
========================================================== */
.byr-lw-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--color-accent-primary);
  color: #000;
  font-size: var(--text-sm);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  z-index: 100000;
}

.byr-lw-skip:focus,
.byr-lw-skip:focus-visible {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1.25rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6);
}


/* ==========================================================
   3. STICKY TABLE OF CONTENTS
========================================================== */
.byr-lw-toc {
  grid-area: toc;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  z-index: var(--z-controls);
}

.admin-bar .byr-lw-toc {
  top: calc(5.5rem + 32px);
}

.byr-lw-toc-inner {
  padding: 1.25rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--color-accent-secondary);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.byr-lw-toc-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.9rem 0;
}

.byr-lw-toc-btn {
  display: none;
}

.byr-lw-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.byr-lw-toc a {
  display: block;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s, padding-left 0.2s;
}

.byr-lw-toc a:hover,
.byr-lw-toc a[aria-current="true"] {
  color: var(--color-accent-secondary);
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--color-accent-secondary);
  padding-left: 0.9rem;
}

.byr-lw-toc a[aria-current="true"] {
  font-weight: 600;
}

.byr-lw-toc a:focus-visible {
  outline: 3px solid var(--color-accent-secondary);
  outline-offset: 2px;
  border-radius: 6px;
}


/* ==========================================================
   4. MAIN COLUMN & SECTIONS
========================================================== */
.byr-lw-main {
  grid-area: main;
  padding-top: clamp(1.5rem, 3vw, 3rem);
}

.byr-lw-section[id] {
  scroll-margin-top: 6.5rem;
}

.admin-bar .byr-lw-section[id] {
  scroll-margin-top: calc(6.5rem + 32px);
}

.byr-lw-section {
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.byr-lw-section.byr-lw-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ==========================================================
   5. TYPOGRAPHY (h2, h3, h4, p, strong, a)
========================================================== */
.byr-lw-main h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  color: var(--color-heading);
  margin: 0 0 1.1rem 0;
  line-height: var(--leading-tight);
}

.byr-lw-main h3 {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-weight: 700;
  color: var(--color-heading);
  margin: 2.25rem 0 0.9rem 0;
  line-height: var(--leading-snug);
}

.byr-lw-main h4 {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  color: var(--color-heading);
  margin: 1.5rem 0 0.65rem 0;
  line-height: var(--leading-snug);
}

.byr-lw-main p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin: 0 0 1.15rem 0;
}

.byr-lw-main p:last-child {
  margin-bottom: 0;
}

.byr-lw-main strong {
  color: var(--color-accent-primary);
  font-weight: 600;
}

.byr-lw-main a {
  color: var(--color-accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.byr-lw-main a:hover {
  color: var(--color-accent-secondary);
}

.byr-lw-main a:focus-visible,
.byr-lw-main button:focus-visible {
  outline: 3px solid var(--color-accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}


/* ==========================================================
   6. DIVIDER
========================================================== */
.byr-lw-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent-secondary), transparent);
  border: none;
  border-radius: 2px;
  margin: 3rem 0;
  opacity: 0.45;
}


/* ==========================================================
   7. CALLOUTS
========================================================== */
.byr-lw-callout {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-left: 3px solid var(--color-accent-primary);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin: 1.75rem 0;
}

.byr-lw-callout p {
  color: var(--color-text-secondary) !important;
  margin: 0 !important;
  font-size: var(--text-md) !important;
}

/* Urgent (red) callout */
.byr-lw-callout--urgent {
  border-left-color: var(--color-condition-red, #ef4444);
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.18);
}

.byr-lw-callout--urgent strong {
  color: #f87171 !important;
}

/* Emerald callout */
.byr-lw-callout--emerald {
  border-left-color: var(--color-accent-secondary);
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.18);
}

.byr-lw-callout--emerald strong {
  color: var(--color-accent-secondary) !important;
}


/* ==========================================================
   8. ACCORDIONS
========================================================== */
.byr-lw-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.byr-lw-accordion details {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.byr-lw-accordion details[open] {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.06);
}

.byr-lw-accordion summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-heading);
  user-select: none;
  transition: color 0.2s;
}

.byr-lw-accordion summary::-webkit-details-marker {
  display: none;
}

.byr-lw-accordion summary:hover {
  color: var(--color-accent-secondary);
}

.byr-lw-accordion summary:focus-visible {
  outline: 3px solid var(--color-accent-secondary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.byr-lw-acc-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 1.6rem;
  text-align: center;
}

.byr-lw-acc-label {
  flex: 1;
}

.byr-lw-acc-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.25s ease, color 0.2s;
}

.byr-lw-accordion details[open] .byr-lw-acc-chevron {
  transform: rotate(180deg);
  color: var(--color-accent-secondary);
}

.byr-lw-acc-body {
  padding: 0.25rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.byr-lw-acc-body p {
  font-size: var(--text-sm) !important;
  color: var(--color-text-secondary) !important;
  line-height: var(--leading-relaxed) !important;
  margin: 0.8rem 0 0 !important;
}

.byr-lw-acc-body p:first-child {
  margin-top: 0.65rem !important;
}


/* ==========================================================
   9. TEAM GRID & CARDS
========================================================== */
.byr-lw-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.byr-lw-team-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.byr-lw-team-card:hover {
  border-color: rgba(16, 185, 129, 0.38);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.byr-lw-team-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.byr-lw-team-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Specialist icon color variants */
.byr-lw-team-icon--bone {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.byr-lw-team-icon--heart {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.byr-lw-team-icon--kidney {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.18);
}

.byr-lw-team-icon--brain {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.byr-lw-team-icon--ear {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.byr-lw-team-icon--tooth {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.byr-lw-team-icon--dna {
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.18);
}

.byr-lw-team-icon--lung {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.byr-lw-team-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-heading);
  margin: 0;
  line-height: var(--leading-snug);
}

.byr-lw-team-body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
  flex: 1;
}


/* ==========================================================
   10. MONITORING GRID
========================================================== */
.byr-lw-monitor-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.byr-lw-monitor-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.byr-lw-monitor-row:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

.byr-lw-monitor-icon {
  font-size: 1.15rem;
  text-align: center;
}

.byr-lw-monitor-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.byr-lw-monitor-what {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-heading);
  margin: 0;
  line-height: var(--leading-snug);
}

.byr-lw-monitor-why {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: var(--leading-relaxed);
}

.byr-lw-monitor-freq {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  text-align: center;
}

/* Frequency badge variants */
.byr-lw-freq--annual {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-accent-secondary);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.byr-lw-freq--biannual {
  background: rgba(34, 211, 238, 0.1);
  color: var(--color-accent-primary);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.byr-lw-freq--ongoing {
  background: rgba(251, 191, 36, 0.1);
  color: var(--color-condition-amber, #FBB924);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.byr-lw-freq--baseline {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
}

.byr-lw-freq--urgent {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.18);
}


/* ==========================================================
   11. RED FLAGS
========================================================== */
.byr-lw-redflags {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.65rem;
}

.byr-lw-redflags li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1.1rem;
  background: rgba(239, 68, 68, 0.03);
  border: 1px solid rgba(239, 68, 68, 0.14);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.byr-lw-redflag-icon {
  color: #f87171;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 0.1rem;
}

.byr-lw-redflags li strong {
  color: #f87171;
}


/* ==========================================================
   12. AGE-BAND TIMELINE
========================================================== */
.byr-lw-age-track {
  position: relative;
  margin: 1.75rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.byr-lw-age-band {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.5rem;
  position: relative;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.byr-lw-age-band.byr-lw-visible {
  opacity: 1;
  transform: translateX(0);
}

.byr-lw-age-band:last-child {
  border-bottom: none;
}

.byr-lw-age-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding-top: 0.15rem;
}

.byr-lw-age-range {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-accent-secondary);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.byr-lw-age-stage {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.byr-lw-age-content {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.byr-lw-age-content strong {
  color: var(--color-heading);
}


/* ==========================================================
   13. INHERITANCE CARDS
========================================================== */
.byr-lw-inherit-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.byr-lw-inherit-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 1.25rem;
  background: rgba(244, 114, 182, 0.05);
  border: 1px solid rgba(244, 114, 182, 0.15);
  border-radius: var(--radius-md);
  min-width: 6.5rem;
}

.byr-lw-inherit-pct {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--color-heading);
  line-height: 1;
}

.byr-lw-inherit-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
}

.byr-lw-inherit-text p {
  font-size: var(--text-sm) !important;
  color: var(--color-text-secondary) !important;
  line-height: var(--leading-relaxed) !important;
  margin: 0 0 0.85rem 0 !important;
}

.byr-lw-inherit-text p:last-child {
  margin-bottom: 0 !important;
}


/* ==========================================================
   14. CROSS-LINKS
========================================================== */
.byr-lw-crosslink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.byr-lw-crosslink p {
  margin: 0 !important;
  color: var(--color-text-secondary) !important;
  font-size: var(--text-sm) !important;
  line-height: var(--leading-normal) !important;
}

.byr-lw-crosslink .byr-primary {
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}


/* ==========================================================
   15. CLOSING CTA
========================================================== */
.byr-lw-closing-cta {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.byr-lw-closing-cta h2 {
  text-align: center;
}

.byr-lw-closing-cta p {
  color: var(--color-text-secondary) !important;
  max-width: 520px;
  margin: 0 auto 1.75rem !important;
  text-align: center;
}

.byr-lw-cta-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.byr-lw-cta-btns .byr-primary,
.byr-lw-cta-btns .byr-outline {
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
}


/* ==========================================================
   16. RESPONSIVE — max-width: 860px  (tablet / mobile)
========================================================== */
@media (max-width: 860px) {
  .byr-lw-outer {
    display: block;
    padding-bottom: 3rem;
  }

  .byr-lw-toc {
    position: sticky;
    top: 4rem;
    max-height: none;
    margin-bottom: 0;
    z-index: var(--z-controls);
  }

  .admin-bar .byr-lw-toc {
    top: calc(4rem + 46px);
  }

  .byr-lw-toc-inner {
    background: var(--color-bg-elevated);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }

  .byr-lw-toc-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-heading);
    min-height: 48px;
  }

  .byr-lw-toc-btn:focus-visible {
    outline: 3px solid var(--color-accent-secondary);
    outline-offset: 2px;
    border-radius: 6px;
  }

  .byr-lw-toc ol {
    display: none;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border-subtle);
  }

  .byr-lw-toc.byr-lw-toc-open ol {
    display: flex;
  }

  .byr-lw-toc a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.6rem;
  }

  .byr-lw-toc-chevron {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
  }

  .byr-lw-toc.byr-lw-toc-open .byr-lw-toc-chevron {
    transform: rotate(180deg);
  }

  .byr-lw-main {
    padding-top: 2rem;
  }

  .byr-lw-section[id] {
    scroll-margin-top: 10rem;
  }

  .admin-bar .byr-lw-section[id] {
    scroll-margin-top: calc(10rem + 46px);
  }
}


/* ==========================================================
   17. RESPONSIVE — min-width: 861px  (desktop TOC chrome)
========================================================== */
@media (min-width: 861px) {
  .byr-lw-toc-btn {
    pointer-events: none;
  }

  .byr-lw-toc-chevron {
    display: none;
  }
}


/* ==========================================================
   18. RESPONSIVE — max-width: 760px
========================================================== */
@media (max-width: 760px) {
  .byr-lw-redflags {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================
   19. RESPONSIVE — max-width: 560px
========================================================== */
@media (max-width: 560px) {
  .byr-lw-team-grid {
    grid-template-columns: 1fr;
  }

  .byr-lw-monitor-row {
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
  }

  .byr-lw-monitor-freq {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.25rem;
  }

  .byr-lw-inherit-card {
    grid-template-columns: 1fr;
  }

  .byr-lw-inherit-visual {
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
    min-width: auto;
  }

  .byr-lw-age-band {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}


/* ==========================================================
   20. RESPONSIVE — max-width: 480px
========================================================== */
@media (max-width: 480px) {
  .byr-lw-outer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 2.5rem;
  }

  .byr-lw-section {
    margin-bottom: 2.5rem;
  }

  .byr-lw-callout {
    padding: 1rem 1.1rem;
  }

  .byr-lw-crosslink {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.1rem;
    gap: 1rem;
  }

  .byr-lw-crosslink .byr-primary {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .byr-lw-team-card {
    padding: 1rem;
  }

  .byr-lw-closing-cta {
    padding: 2rem 1rem;
  }

  .byr-lw-divider {
    margin: 2rem 0;
  }
}


/* ==========================================================
   21. RESPONSIVE — max-width: 375px
========================================================== */
@media (max-width: 375px) {
  .byr-lw-main h2 {
    font-size: 1.35rem;
  }

  .byr-lw-acc-body {
    padding: 0.25rem 0.9rem 1rem;
  }
}


/* ==========================================================
   22. REDUCED MOTION
========================================================== */
@media (prefers-reduced-motion: reduce) {
  .byr-lw-section {
    opacity: 1;
    transform: none;
  }

  .byr-lw-age-band {
    opacity: 1;
    transform: none;
  }

  .byr-lw-team-card:hover {
    transform: none;
  }

  .byr-lw-accordion details[open] .byr-lw-acc-chevron {
    transform: none;
    opacity: 0.5;
  }

  .byr-lw-toc.byr-lw-toc-open .byr-lw-toc-chevron {
    transform: none;
    opacity: 0.5;
  }
}


/* ==========================================================
   23. LIGHT MODE
   Adjusts dark-glass backgrounds, shadows, hover glows,
   and red/amber accent colors for readability on light bg.
========================================================== */

/* --- Team cards --- */
.mode-light .byr-lw-team-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mode-light .byr-lw-team-card:hover {
  border-color: rgba(5, 150, 105, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* --- Monitor rows --- */
.mode-light .byr-lw-monitor-row {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mode-light .byr-lw-monitor-row:hover {
  border-color: rgba(5, 150, 105, 0.28);
}

.mode-light .byr-lw-freq--ongoing {
  color: #b45309;
}

.mode-light .byr-lw-freq--urgent {
  color: #dc2626;
}

/* --- Red flags --- */
.mode-light .byr-lw-redflags li {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.18);
}

.mode-light .byr-lw-redflag-icon {
  color: #dc2626;
}

.mode-light .byr-lw-redflags li strong {
  color: #dc2626;
}

/* --- Callouts --- */
.mode-light .byr-lw-callout {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mode-light .byr-lw-callout--urgent {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.22);
}

.mode-light .byr-lw-callout--urgent strong {
  color: #dc2626 !important;
}

.mode-light .byr-lw-callout--emerald {
  background: rgba(5, 150, 105, 0.05);
  border-color: rgba(5, 150, 105, 0.22);
}

/* --- Accordions --- */
.mode-light .byr-lw-accordion details {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mode-light .byr-lw-accordion details[open] {
  border-color: rgba(5, 150, 105, 0.45);
  box-shadow: 0 0 16px rgba(5, 150, 105, 0.06);
}

.mode-light .byr-lw-acc-body {
  border-top-color: rgba(0, 0, 0, 0.07);
}

/* --- Inheritance cards --- */
.mode-light .byr-lw-inherit-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mode-light .byr-lw-inherit-visual {
  background: rgba(244, 114, 182, 0.06);
  border-color: rgba(244, 114, 182, 0.18);
}

/* --- Age bands --- */
.mode-light .byr-lw-age-range {
  color: #059669;
}

/* --- Cross-links --- */
.mode-light .byr-lw-crosslink {
  background: rgba(5, 150, 105, 0.05);
  border-color: rgba(5, 150, 105, 0.22);
}

/* --- Closing CTA --- */
.mode-light .byr-lw-closing-cta {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* --- TOC --- */
.mode-light .byr-lw-toc-inner {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mode-light .byr-lw-toc a:hover,
.mode-light .byr-lw-toc a[aria-current="true"] {
  background: rgba(5, 150, 105, 0.08);
}


/* ==========================================================
   24. FORCED COLORS (Windows High Contrast)
   Ensures all interactive elements remain visible when the
   OS overrides colors.
========================================================== */
@media (forced-colors: active) {

  /* --- Cards (team, inheritance, closing CTA) --- */
  .byr-lw-team-card,
  .byr-lw-inherit-card,
  .byr-lw-closing-cta {
    background: Canvas;
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .byr-lw-team-card:hover {
    border-color: Highlight;
    box-shadow: none;
    transform: none;
  }

  .byr-lw-inherit-visual {
    background: Canvas;
    border-color: CanvasText;
  }

  /* --- Callouts --- */
  .byr-lw-callout {
    background: Canvas;
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .byr-lw-callout--urgent {
    border-left-color: LinkText;
  }

  .byr-lw-callout--emerald {
    border-left-color: Highlight;
  }

  /* --- Accordions --- */
  .byr-lw-accordion details {
    background: Canvas;
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .byr-lw-accordion details[open] {
    border-color: Highlight;
    box-shadow: none;
  }

  .byr-lw-accordion summary:focus-visible {
    outline: 2px solid Highlight;
  }

  .byr-lw-acc-body {
    border-top-color: CanvasText;
  }

  /* --- Red flags --- */
  .byr-lw-redflags li {
    background: Canvas;
    border: 2px solid CanvasText;
  }

  .byr-lw-redflag-icon,
  .byr-lw-redflags li strong {
    color: LinkText;
  }

  /* --- Monitor rows --- */
  .byr-lw-monitor-row {
    background: Canvas;
    border: 2px solid CanvasText;
    box-shadow: none;
  }

  .byr-lw-monitor-row:hover {
    border-color: Highlight;
  }

  .byr-lw-monitor-freq {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  /* --- TOC --- */
  .byr-lw-toc-inner {
    background: Canvas;
    border: 2px solid CanvasText;
    backdrop-filter: none;
  }

  .byr-lw-toc a[aria-current="true"] {
    border-left-color: Highlight;
    color: Highlight;
  }

  /* --- Cross-links --- */
  .byr-lw-crosslink {
    background: Canvas;
    border: 2px solid CanvasText;
  }

  /* --- Age bands --- */
  .byr-lw-age-band {
    border-bottom-color: CanvasText;
  }

  .byr-lw-age-range {
    color: Highlight;
  }
}
