/**
 * ╔══════════════════════════════════════════════════════════════╗
 * ║  YETI REPORT KIT — CSS Foundation                          ║
 * ║  Version: 1.6.2                                            ║
 * ║  Zero dependencies. Drop-in for Yii2 layouts.              ║
 * ║  v1.6.2 — distinct staff A++ text-size component scale     ║
 * ║  v1.6.1 — §33 native .yr-check checkbox primitive          ║
 * ║  v1.6.0 — shared report controls and lifecycle contract    ║
 * ║  v1.5.0 — §31 charts (YR.charts), §32 .yr-col-sticky       ║
 * ║                                                            ║
 * ║  v1.4.2 — Promoted page-level extensions to the kit        ║
 * ║    • §8  .yr-badge[data-tone="success|info|warn|danger|    ║
 * ║          muted"] — semantic tone variants                  ║
 * ║    • §13 .yr-btn-ghost / -success / -warn / -sm / -lg      ║
 * ║          and universal :disabled state                     ║
 * ║    Promoted from page CSS so all reports inherit the same  ║
 * ║    vocabulary. No breaking changes.                        ║
 * ║                                                            ║
 * ║  v1.4.1 — Mix-up chip miss variant                         ║
 * ║    • .yr-mixup-chip.is-miss — light amber tint for chips   ║
 * ║      where the student missed (typed nothing). Pairs with  ║
 * ║      v1.4.1 JS YR.mixupChipHTML which detects empty `t`.   ║
 * ║    • .yr-mixup-miss-label — italic, muted "missed" text    ║
 * ║      in the to-position of miss chips                      ║
 * ║                                                            ║
 * ║  v1.4.0 — Three new components for cross-report consistency║
 * ║    • §28  .yr-dd-* — generic styled dropdown               ║
 * ║              (YR.initDropdown — replaces native <select>)  ║
 * ║    • §29  .yr-skel*, .yr-loading-bar — skeleton loader     ║
 * ║              (use during async filter changes / data fetch)║
 * ║    • §30  .yr-export-* — Export ▼ dropdown menu            ║
 * ║              (YR.initExportMenu — XLSX/CSV/Print sections) ║
 * ║                                                            ║
 * ║  v1.3.7 — Table pagination styling                         ║
 * ║    • §27  .yr-pager — footer with info + windowed nav      ║
 * ║                                                            ║
 * ║  v1.3.6 — Unified scoping (single file for embed + full)   ║
 * ║    • Global reset + focus outlines scoped to .yr-scope     ║
 * ║    • Safe to load alongside Bootstrap or any framework     ║
 * ║    • Wrap report in <div class="yr-scope">...</div>        ║
 * ║      OR add yr-scope to body: <body class="yr-page         ║
 * ║      yr-scope"> for full-page Yeti layouts                 ║
 * ║    • Eliminates the separate yeti-report-embed.css variant ║
 * ║                                                            ║
 * ║  v1.3.5 — Sticky offset variable                           ║
 * ║    • --yr-sticky-top-offset (default: 0) lets reports      ║
 * ║      with sticky topbars push thead down by that amount    ║
 * ║    • thead th top now references the variable              ║
 * ║                                                            ║
 * ║  v1.3.4 — Sticky thead — really works this time            ║
 * ║    • Removed overflow:hidden from yr-main and yr-card so   ║
 * ║      position:sticky has no clipping ancestor above thead  ║
 * ║    • Narrow-screen horizontal scroll only applies <=1100px ║
 * ║    • Sticky thead uses opaque bg + z-index:5               ║
 * ║                                                            ║
 * ║  v1.3.3 — Sticky table headers (first attempt, superseded) ║
 * ║    • thead th position:sticky so column titles stay        ║
 * ║      visible while scrolling long student lists            ║
 * ║    • Uses :has() with block-display fallback for older     ║
 * ║      browsers                                              ║
 * ║                                                            ║
 * ║  v1.3.2 — Responsive overflow fixes                        ║
 * ║    • Tables scroll horizontally inside yr-card instead     ║
 * ║      of clipping (min-width 900px preserved)               ║
 * ║    • yr-main gets overflow-x:hidden + min-width:0 so       ║
 * ║      children can't push past viewport                     ║
 * ║    • Topbar title ellipsizes instead of forcing overflow   ║
 * ║    • Content padding shrinks at <=1100px breakpoint        ║
 * ║                                                            ║
 * ║  v1.3.0 — Mobile compliance (iPad/iPhone fixes)            ║
 * ║    • 16px font-size on inputs <=640px (prevents iOS zoom)  ║
 * ║    • Safe-area-inset-bottom padding on mobile toolbars     ║
 * ║    • Touch target audit — 44x44px minimum on mobile        ║
 * ║    • §25 Mobile Compliance section                         ║
 * ║                                                            ║
 * ║  v1.2.1 — Topbar component added to kit                   ║
 * ║    • §4a Topbar: page header with icon, title, subtitle    ║
 * ║    • Class dropdown (.yr-class-drop) for topbar            ║
 * ║    • High contrast, extra spacing, responsive overrides    ║
 * ║    • Fixed --yr-sidebar-bg token to match hub              ║
 * ║                                                            ║
 * ║  v1.2.0 — WCAG 2.2 AA compliance + Accessibility section   ║
 * ║    • Fixed all contrast failures (text, badges, focus)      ║
 * ║    • Added §22 Accessibility (focus, skip, motion, colors)  ║
 * ║    • Added §23 Accessibility Modal + Toggle Switch          ║
 * ║    • Added §24 State Classes (large text, high contrast)    ║
 * ║    • Touch-action: manipulation on all interactive elements ║
 * ║    • Loading/error state components                         ║
 * ║                                                            ║
 * ║  v1.1.0 — Brand alignment with Reports Hub                 ║
 * ║    • Updated brand tokens (#12A0DD blue, #69b64b green)     ║
 * ║    • Warmer surfaces, softer shadows                        ║
 * ║    • Collapsible sidebar with logo image support            ║
 * ║    • Nav active state uses brand green                      ║
 * ║                                                            ║
 * ║  Usage:                                                    ║
 * ║    <link href="/css/yeti-report.css" rel="stylesheet">     ║
 * ║    <script src="/js/yeti-report.js" defer></script>        ║
 * ╚══════════════════════════════════════════════════════════════╝
 */

/* ═══════════════════════════════════════════════════════════════
   §1 — DESIGN TOKENS
   All brand values in one place. Override per-page if needed.
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --yr-blue:            #12A0DD;
  --yr-blue-dark:       #0e85b8;
  --yr-blue-light:      #e7f3fc;
  --yr-green:           #69b64b;
  --yr-green-light:     #edf5e8;

  /* Semantic */
  --yr-excellent:       #2ecc71;
  --yr-good:            #27ae60;
  --yr-ok:              #69b64b;
  --yr-warn:            #f39c12;
  --yr-caution:         #e67e22;
  --yr-danger:          #c0392b;
  --yr-star-gold:       #f5b731;
  --yr-teal:            #1abc9c;
  --yr-purple:          #9b59b6;

  /* Semantic backgrounds (for pills, cards, finger cells) */
  --yr-excellent-bg:    #e8faf0;
  --yr-excellent-border:#b8eacd;
  --yr-good-bg:         #edf5e8;
  --yr-good-border:     #c5e4ad;
  --yr-ok-bg:           #edf5e8;
  --yr-ok-border:       #c5e4ad;
  --yr-warn-bg:         #fef7e6;
  --yr-warn-border:     #f5dfa0;
  --yr-caution-bg:      #fdf0e6;
  --yr-caution-border:  #f5cba0;
  --yr-danger-bg:       #fce8e6;
  --yr-danger-border:   #f5a8a0;

  /* Surfaces */
  --yr-body-bg:         #f5f6f9;
  --yr-card-bg:         #ffffff;
  --yr-card-border:     #e0e6ed;
  --yr-table-head-bg:   #f8f9fb;
  --yr-table-stripe:    #f6f8fa;
  --yr-detail-bg:       linear-gradient(180deg, #f7f9fc 0%, #fff 100%);

  /* Typography */
  --yr-text-primary:    #1e2d3d;
  --yr-text-secondary:  #5a7085;
  --yr-text-muted:      #657788;
  --yr-font:            'Lexend Deca', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sidebar */
  --yr-sidebar-bg:      #1a3a5c;
  --yr-sidebar-width:   200px;

  /* Elevation */
  --yr-shadow-sm:       0 1px 3px rgba(0,0,0,0.05);
  --yr-shadow-md:       0 4px 14px rgba(0,0,0,0.07);
  --yr-shadow-lg:       0 8px 24px rgba(0,0,0,0.09);

  /* Accessibility — WCAG-passing text-on-tint pairs */
  --yr-focus-ring:      #0b82b5;
  --yr-badge-blue:      #0a6e96;   /* on --yr-blue-light */
  --yr-badge-green:     #3d7a2a;   /* on --yr-green-light */
  --yr-badge-purple:    #7b4394;   /* on #f3edf7 */
  --yr-badge-gold:      #7a5c10;   /* on #fef5e7 */
  --yr-gold-text:       #866716;   /* star-gold as text on white */

  /* Radii */
  --yr-radius:          12px;
  --yr-radius-sm:       8px;
  --yr-radius-lg:       16px;
  --yr-radius-pill:     20px;

  /* Hero */
  --yr-hero-gradient:   linear-gradient(135deg, #d8eefb 0%, #e9f4fb 40%, #f2f7fc 100%);

  /* Sticky headers — offset from viewport top. Reports with a sticky
     topbar above the table should override this at report level, e.g.:
     .report-page { --yr-sticky-top-offset: 64px; }  */
  --yr-sticky-top-offset: 0px;
}


/* ═══════════════════════════════════════════════════════════════
   §2 — RESET & BASE
   Global rules are scoped to .yr-scope so the kit is safe to load
   on pages that still use Bootstrap or any other CSS framework.
   Every page using the kit must have .yr-scope on the wrapper
   element (or on <body> for full-page Yeti layouts).
   ═══════════════════════════════════════════════════════════════ */
.yr-scope,
.yr-scope *,
.yr-scope *::before,
.yr-scope *::after { margin: 0; padding: 0; box-sizing: border-box; }

.yr-scope {
  font-family: var(--yr-font);
  background: var(--yr-body-bg);
  color: var(--yr-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Full-page Yeti layouts: body gets min-height when .yr-scope is
   applied directly to <body class="yr-page yr-scope">. Embedded
   reports (inside a Bootstrap layout) don't need body height. */
body.yr-page.yr-scope { min-height: 100vh; }


/* ═══════════════════════════════════════════════════════════════
   §3 — LAYOUT: Sidebar + Main (collapsible)
   ═══════════════════════════════════════════════════════════════ */
.yr-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--yr-sidebar-width);
  background: linear-gradient(180deg, #153d5e 0%, #123552 30%, #0f2d48 100%);
  display: flex; flex-direction: column;
  z-index: 100; overflow: visible;
  transition: width 0.25s ease;
}

/* Logo area */
.yr-sidebar-logo {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 64px; overflow: visible;
  position: relative;
}

/* Expanded: logo image (TA-logo-side.png) */
.yr-sidebar-logo .yr-logo-img {
  height: 28px; width: auto; display: block;
  transition: opacity 0.2s;
}

/* Collapsed: Ta| compact icon */
.yr-sidebar-logo .yr-logo-compact {
  display: none; width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #12A0DD, #69b64b);
  align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(18,160,221,0.3);
  flex-shrink: 0;
}
.yr-logo-compact .yr-lc-t {
  font-family: 'Nunito', sans-serif;
  font-size: 17px; font-weight: 800; color: #fff; line-height: 1;
}
.yr-logo-compact .yr-lc-a {
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700; color: #fff; line-height: 1;
}
.yr-logo-compact .yr-lc-pipe {
  font-family: 'Nunito', sans-serif;
  font-size: 17px; font-weight: 400; color: #fff; line-height: 1;
}

/* Collapse toggle button */
.yr-sidebar-toggle {
  position: absolute; right: -12px; top: 32px;
  transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 1px solid var(--yr-card-border);
  box-shadow: var(--yr-shadow-md);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  z-index: 110; transition: transform 0.2s;
}
.yr-sidebar-toggle:hover {
  border-color: var(--yr-blue);
  box-shadow: var(--yr-shadow-lg);
}
.yr-sidebar-toggle svg {
  width: 12px; height: 12px;
  color: var(--yr-text-muted);
  transition: transform 0.25s;
}

/* Nav */
.yr-sidebar-nav { padding: 12px 0; flex: 1; overflow-x: hidden; overflow-y: auto; }
.yr-sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: rgba(255,255,255,0.75);
  text-decoration: none; font-size: 14px; font-weight: 400;
  transition: all 0.2s; white-space: nowrap; overflow: hidden;
}
.yr-sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.yr-sidebar-nav a.active {
  color: #fff; background: #69b64b;
  border-radius: 0 24px 24px 0; margin-right: 12px;
  box-shadow: 0 2px 8px rgba(105,182,75,0.3);
  font-weight: 600;
}
.yr-sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.yr-sidebar-nav a .yr-nav-label { transition: opacity 0.2s; }

/* Nav separator */
.yr-nav-sep {
  height: 1px; background: rgba(255,255,255,0.08); margin: 6px 20px;
}

/* Footer */
.yr-sidebar-footer {
  padding: 0; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; overflow: visible;
}

/* Solution Center link */
.yr-sidebar-footer .yr-sf-help {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: rgba(255,255,255,0.6);
  text-decoration: none; font-size: 13px; font-weight: 400;
  transition: all 0.2s; white-space: nowrap; overflow: visible;
}
.yr-sidebar-footer .yr-sf-help:hover { color: #fff; background: rgba(255,255,255,0.06); }
.yr-sidebar-footer .yr-sf-help svg { width: 18px; height: 18px; flex-shrink: 0; overflow: visible; }

/* User row — clickable */
.yr-sidebar-footer .yr-sf-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; position: relative; transition: background 0.15s;
}
.yr-sf-user:hover { background: rgba(255,255,255,0.04); }
.yr-sidebar-footer .yr-sf-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #2a5a8a; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 12px;
  color: #fff; flex-shrink: 0;
}
.yr-sidebar-footer .yr-sf-info {
  flex: 1; white-space: nowrap; overflow: hidden;
  transition: opacity 0.2s;
}
.yr-sidebar-footer .yr-sf-name { color: #fff; font-size: 13px; font-weight: 600; }
.yr-sidebar-footer .yr-sf-role { color: rgba(255,255,255,0.5); font-size: 11px; }

/* User row chevron */
.yr-sf-chevron {
  margin-left: auto; color: rgba(255,255,255,0.35);
  transition: transform 0.2s, color 0.15s; flex-shrink: 0;
}
.yr-sf-chevron svg { width: 12px; height: 12px; }
.yr-sf-user:hover .yr-sf-chevron { color: rgba(255,255,255,0.6); }
.yr-sf-user.open .yr-sf-chevron { transform: rotate(180deg); color: rgba(255,255,255,0.8); }

/* User popup menu — pops upward */
.yr-user-menu {
  position: absolute; bottom: calc(100% + 6px);
  left: 12px; right: 12px;
  background: var(--yr-card-bg); border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius); box-shadow: var(--yr-shadow-lg);
  z-index: 120; opacity: 0; transform: translateY(6px);
  pointer-events: none; transition: all 0.18s ease; overflow: hidden;
}
.yr-user-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; max-height: calc(100vh - 120px); overflow-y: auto; }

.yr-user-menu-header {
  padding: 12px 14px; border-bottom: 1px solid var(--yr-card-border);
  display: flex; align-items: center; gap: 10px;
}
.yr-user-menu-header .yr-um-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--yr-blue); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px;
  color: #fff; flex-shrink: 0;
}
.yr-user-menu-header .yr-um-name { font-size: 13px; font-weight: 700; color: var(--yr-text-primary); }
.yr-user-menu-header .yr-um-school { font-size: 11px; color: var(--yr-text-muted); font-weight: 400; }

.yr-user-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; font-size: 13px; font-weight: 500;
  color: var(--yr-text-primary); text-decoration: none;
  transition: all 0.12s; min-height: 44px;
}
.yr-user-menu a:hover { background: var(--yr-blue-light); color: var(--yr-blue); }
.yr-user-menu a svg { width: 16px; height: 16px; color: var(--yr-text-muted); flex-shrink: 0; }
.yr-user-menu a:hover svg { color: var(--yr-blue); }
.yr-user-menu .yr-um-sep { height: 1px; background: var(--yr-card-border); margin: 4px 0; }
.yr-user-menu a.yr-um-logout { color: var(--yr-danger); }
.yr-user-menu a.yr-um-logout svg { color: var(--yr-danger); }
.yr-user-menu a.yr-um-logout:hover { background: #fce8e6; }

/* Collapsed: menu pops to the right */
.yr-sidebar.collapsed .yr-user-menu {
  bottom: 0; left: calc(100% + 8px); right: auto; min-width: 220px;
}
.yr-sidebar.collapsed .yr-sf-chevron { display: none; }

/* ── Collapsed state ── */
.yr-sidebar.collapsed { width: 64px; }
.yr-sidebar.collapsed .yr-sidebar-logo { padding: 14px 0; justify-content: center; }
.yr-sidebar.collapsed .yr-logo-img { display: none; }
.yr-sidebar.collapsed .yr-logo-compact { display: flex; }
.yr-sidebar.collapsed .yr-sidebar-toggle svg { transform: rotate(180deg); }
.yr-sidebar.collapsed .yr-nav-sep { margin: 6px 12px; }
.yr-sidebar.collapsed .yr-sidebar-nav a { justify-content: center; padding: 12px 0; }
.yr-sidebar.collapsed .yr-sidebar-nav a .yr-nav-label { opacity: 0; width: 0; overflow: hidden; }
.yr-sidebar.collapsed .yr-sidebar-nav a.active { margin-right: 0; border-radius: 0 12px 12px 0; margin-right: 4px; }
.yr-sidebar.collapsed .yr-sidebar-footer .yr-sf-help { justify-content: center; padding: 10px 0; }
.yr-sidebar.collapsed .yr-sidebar-footer .yr-sf-help .yr-nav-label { opacity: 0; width: 0; overflow: hidden; }
.yr-sidebar.collapsed .yr-sidebar-footer .yr-sf-user { justify-content: center; padding: 12px 0; }
.yr-sidebar.collapsed .yr-sidebar-footer .yr-sf-info { opacity: 0; width: 0; overflow: hidden; }

/* Collapsed tooltips */
.yr-sidebar.collapsed .yr-sidebar-nav a { position: relative; }
.yr-sidebar.collapsed .yr-sidebar-nav a::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 8px); top: 50%;
  transform: translateY(-50%);
  background: var(--yr-text-primary); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.15s; box-shadow: var(--yr-shadow-md);
}
.yr-sidebar.collapsed .yr-sidebar-nav a:hover::after { opacity: 1; }
.yr-sidebar.collapsed .yr-sf-help { position: relative; }
.yr-sidebar.collapsed .yr-sf-help::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 8px); top: 50%;
  transform: translateY(-50%);
  background: var(--yr-text-primary); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.15s; box-shadow: var(--yr-shadow-md);
}
.yr-sidebar.collapsed .yr-sf-help:hover::after { opacity: 1; }

.yr-main {
  margin-left: var(--yr-sidebar-width);
  min-height: 100vh;
  min-width: 0;
  /* NO overflow-x:hidden here — it creates a scroll container that
     breaks position:sticky on descendants. Horizontal overflow is
     prevented by applying max-width on .yr-content and overflow-x
     on specific wide children (like the table card) when needed. */
  transition: margin-left 0.25s ease;
}
.yr-sidebar.collapsed ~ .yr-main { margin-left: 64px; }


/* ═══════════════════════════════════════════════════════════════
   §4 — HERO BANNER
   ═══════════════════════════════════════════════════════════════ */
.yr-hero {
  background: var(--yr-hero-gradient);
  position: relative; overflow: hidden;
  padding: 28px 36px 20px;
}
.yr-hero-bg {
  position: absolute; bottom: 0; right: 0;
  width: 50%; height: 100%;
  opacity: 0.12; pointer-events: none;
}

.yr-breadcrumb {
  font-size: 12px; color: var(--yr-text-muted); margin-bottom: 8px;
}
.yr-breadcrumb a { color: var(--yr-blue); text-decoration: none; }
.yr-breadcrumb .yr-sep { margin: 0 6px; }

.yr-hero-title {
  display: flex; align-items: center; gap: 16px;
}
.yr-hero-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #12A0DD, #0e85b8);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(18,160,221,0.3);
  color: #fff; flex-shrink: 0;
}
.yr-hero-icon.round { border-radius: 50%; }
.yr-hero-icon svg { width: 24px; height: 24px; }

.yr-hero-meta h1 { font-size: 22px; font-weight: 700; color: var(--yr-text-primary); }
.yr-hero-meta .yr-sub {
  font-size: 13px; color: var(--yr-text-secondary);
  font-weight: 400; margin-top: 2px;
}
.yr-hero-meta .yr-sub strong { color: var(--yr-blue); font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════
   §4a — TOP BAR (page header — replaces hero on non-dashboard pages)
   White bar with icon, title, subtitle, and optional class dropdown.
   ═══════════════════════════════════════════════════════════════ */
.yr-topbar {
  background: #fff; border-bottom: none; padding: 14px 32px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  position: relative;
}
.yr-topbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--yr-blue); opacity: 0.15;
}
.yr-topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.yr-topbar-left > div { min-width: 0; }
.yr-topbar-left h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yr-topbar-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #12A0DD, #0e85b8);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(18,160,221,0.25); color: #fff; flex-shrink: 0;
}
.yr-topbar-icon svg { width: 18px; height: 18px; }
.yr-topbar-left h1 { font-size: 17px; font-weight: 700; color: var(--yr-blue); }
.yr-topbar-left .yr-sub { font-size: 11px; color: var(--yr-text-muted); }

/* Class dropdown in topbar */
.yr-class-drop {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--yr-text-primary);
  background: var(--yr-table-stripe); border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius-sm); padding: 6px 12px;
  cursor: pointer; transition: border-color 0.15s;
  flex-shrink: 0; font-family: var(--yr-font); margin-left: auto;
}
.yr-class-drop:hover { border-color: var(--yr-blue); }
.yr-class-drop svg { width: 10px; height: 10px; color: var(--yr-text-muted); flex-shrink: 0; }
.yr-class-drop .yr-cd-label {
  font-size: 9px; font-weight: 700; color: var(--yr-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Report trail — breadcrumb path back to Reports Hub */
.yr-report-trail {
  display: flex; align-items: center; gap: 0;
  padding: 12px 0 14px; margin-bottom: 2px;
  font-size: 13px; font-weight: 500;
}
.yr-trail-back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--yr-blue); text-decoration: none;
  font-weight: 600; transition: color 0.15s;
}
.yr-trail-back:hover { color: var(--yr-blue-dark); text-decoration: underline; }
.yr-trail-back svg { width: 14px; height: 14px; flex-shrink: 0; }
.yr-trail-sep {
  margin: 0 8px; color: var(--yr-text-muted);
  font-size: 12px; font-weight: 400;
}
.yr-trail-link {
  color: var(--yr-blue); text-decoration: none;
  transition: color 0.15s;
}
.yr-trail-link:hover { color: var(--yr-blue-dark); text-decoration: underline; }
.yr-trail-current {
  color: var(--yr-text-secondary); font-weight: 600;
}


/* Class dropdown inside topbar */
.yr-topbar .yr-class-selector { min-width: 220px; z-index: 10; margin-left: auto; }
.yr-topbar .yr-class-menu { z-index: 61; }


/* ═══════════════════════════════════════════════════════════════
   §5 — TAB BAR
   ═══════════════════════════════════════════════════════════════ */
.yr-tabs {
  display: flex; background: #fff;
  border-bottom: 2px solid var(--yr-card-border);
  padding: 0 36px;
}
.yr-tabs a {
  padding: 14px 18px; font-size: 13px; font-weight: 500;
  color: var(--yr-text-muted); text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.yr-tabs a:hover { color: var(--yr-text-secondary); }
.yr-tabs a.active {
  color: var(--yr-blue);
  border-bottom-color: var(--yr-blue);
  font-weight: 600;
}

.yr-content {
  padding: 24px 36px 48px;
  max-width: 1340px;
  width: 100%;
  box-sizing: border-box;
}

/* Mid-screen: reduce horizontal padding so content doesn't clip */
@media (max-width: 1100px) {
  .yr-content { padding: 20px 24px 40px; }
}


/* ═══════════════════════════════════════════════════════════════
   §6 — STAT CARDS (Summary Row)
   Use: <div class="yr-stat-row yr-cols-5"> ... </div>
   ═══════════════════════════════════════════════════════════════ */
.yr-stat-row {
  display: grid; gap: 14px; margin-bottom: 24px;
}
.yr-cols-3 { grid-template-columns: repeat(3, 1fr); }
.yr-cols-4 { grid-template-columns: repeat(4, 1fr); }
.yr-cols-5 { grid-template-columns: repeat(5, 1fr); }

.yr-stat-card {
  background: var(--yr-card-bg);
  border-radius: var(--yr-radius);
  padding: 18px 20px;
  box-shadow: var(--yr-shadow-sm);
  border: 1px solid var(--yr-card-border);
  position: relative; overflow: hidden;
}
/* Top accent bar — set color with data-accent or modifier */
.yr-stat-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--yr-radius) var(--yr-radius) 0 0;
  background: var(--_accent, var(--yr-blue));
}
.yr-stat-card[data-accent="blue"]   { --_accent: var(--yr-blue); }
.yr-stat-card[data-accent="green"]  { --_accent: var(--yr-green); }
.yr-stat-card[data-accent="gold"]   { --_accent: var(--yr-star-gold); }
.yr-stat-card[data-accent="teal"]   { --_accent: var(--yr-teal); }
.yr-stat-card[data-accent="purple"] { --_accent: var(--yr-purple); }
.yr-stat-card[data-accent="danger"] { --_accent: var(--yr-danger); }

.yr-stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; font-size: 16px;
  background: color-mix(in srgb, var(--_accent) 12%, white);
  color: var(--_accent);
}
.yr-stat-value {
  font-size: 28px; font-weight: 700; line-height: 1;
  color: var(--_accent);
}
.yr-stat-label {
  font-size: 10px; font-weight: 600;
  color: var(--yr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px; margin-top: 4px;
}
.yr-stat-sub {
  font-size: 12px; color: var(--yr-text-secondary);
  margin-top: 6px; font-weight: 400;
}


/* ═══════════════════════════════════════════════════════════════
   §7 — SECTION CARD
   Generic container for report sections
   ═══════════════════════════════════════════════════════════════ */
.yr-card {
  background: var(--yr-card-bg);
  border-radius: var(--yr-radius);
  box-shadow: var(--yr-shadow-sm);
  border: 1px solid var(--yr-card-border);
  margin-bottom: 20px;
  /* NO overflow clipping here — it would break sticky thead.
     Rounded corners still work because the table has matching radii below. */
}
.yr-card > .yr-table {
  min-width: 900px;
}
/* Round the card's inner table corners so the missing overflow:hidden
   doesn't leave square edges where the table meets the card border */
.yr-card > .yr-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--yr-radius);
}
.yr-card > .yr-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--yr-radius);
}

/* (Sticky thead rule merged into the base .yr-table thead th below) */

.yr-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--yr-card-border);
  display: flex; align-items: center;
  justify-content: space-between;
}
.yr-card-header h2 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--yr-text-primary);
}
.yr-card-header h2 svg {
  width: 16px; height: 16px; color: var(--yr-blue);
}
.yr-card-body { padding: 20px 22px; }

/* Compact variant for inline detail panels */
.yr-card-sm .yr-card-header {
  padding: 10px 14px;
  background: var(--yr-table-head-bg);
  font-size: 12px;
}
.yr-card-sm .yr-card-body { padding: 12px 14px; }


/* ═══════════════════════════════════════════════════════════════
   §8 — BADGE / PILL
   ═══════════════════════════════════════════════════════════════ */
.yr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  background: var(--yr-blue); color: #fff;
}
.yr-badge svg { width: 11px; height: 11px; }

/* Tone variants (v1.4.2) — promoted from page CSS so all reports share the
   same status-badge vocabulary. Use data-tone on .yr-badge:
     <span class="yr-badge" data-tone="success">Will create</span>
     <span class="yr-badge" data-tone="danger">Needs fix</span>
     <span class="yr-badge" data-tone="muted">Will skip</span> */
.yr-badge[data-tone="success"] {
  background: var(--yr-green-light);
  color: var(--yr-badge-green);
  border: 1px solid var(--yr-good-border);
}
.yr-badge[data-tone="info"] {
  background: var(--yr-blue-light);
  color: var(--yr-badge-blue);
  border: 1px solid #c5dcf4;
}
.yr-badge[data-tone="warn"] {
  background: var(--yr-warn-bg);
  color: var(--yr-warn);
  border: 1px solid var(--yr-warn-border);
}
.yr-badge[data-tone="danger"] {
  background: var(--yr-danger-bg);
  color: var(--yr-danger);
  border: 1px solid var(--yr-danger-border);
}
.yr-badge[data-tone="muted"] {
  background: var(--yr-table-stripe);
  color: var(--yr-text-muted);
  border: 1px solid var(--yr-card-border);
}
.yr-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--yr-radius-pill);
  font-weight: 600; font-size: 12px;
}
/* Pill tiers — apply with data-tier or class */
.yr-pill[data-tier="excellent"], .yr-pill-excellent { background: var(--yr-excellent-bg); color: var(--yr-excellent); }
.yr-pill[data-tier="good"],      .yr-pill-good      { background: var(--yr-good-bg);      color: var(--yr-good); }
.yr-pill[data-tier="ok"],        .yr-pill-ok         { background: var(--yr-ok-bg);        color: var(--yr-ok); }
.yr-pill[data-tier="warn"],      .yr-pill-warn       { background: var(--yr-warn-bg);      color: var(--yr-warn); }
.yr-pill[data-tier="caution"],   .yr-pill-caution    { background: var(--yr-caution-bg);   color: var(--yr-caution); }
.yr-pill[data-tier="danger"],    .yr-pill-danger     { background: var(--yr-danger-bg);    color: var(--yr-danger); }


/* ═══════════════════════════════════════════════════════════════
   §9 — DATA TABLE
   ═══════════════════════════════════════════════════════════════ */
.yr-table { width: 100%; border-collapse: collapse; }

/* Column headers — base styling. Sticky behavior is handled by
   YR.initStickyHeader() in JS, which clones the thead into a fixed
   container. See §26 for the floater CSS. */
.yr-table thead th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; font-weight: 700;
  color: var(--yr-text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 2px solid var(--yr-card-border);
  background: var(--yr-table-head-bg);
  white-space: nowrap;
}
.yr-table thead th.sortable { cursor: pointer; user-select: none; }
.yr-table thead th.sortable:hover { color: var(--yr-blue); }
.yr-table thead th .yr-sort-icon {
  font-size: 10px; margin-left: 3px; opacity: 0.4;
  display: inline-block; transition: transform 0.2s;
}
.yr-table thead th.sorted .yr-sort-icon { opacity: 1; color: var(--yr-blue); }
.yr-table thead th.sort-desc .yr-sort-icon { transform: rotate(180deg); }

.yr-table tbody td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid #f0f4f7;
  vertical-align: middle;
}
.yr-table tbody tr.yr-data-row { cursor: pointer; transition: background 0.15s; }
.yr-table tbody tr.yr-data-row:hover { background: var(--yr-table-stripe); }
.yr-table tbody tr.yr-data-row.expanded { background: var(--yr-blue-light); }

/* Chevron */
.yr-chev {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.yr-chev svg {
  width: 14px; height: 14px;
  color: var(--yr-text-muted);
  transition: transform 0.25s ease;
}
tr.expanded .yr-chev svg {
  transform: rotate(180deg); color: var(--yr-blue);
}


/* ═══════════════════════════════════════════════════════════════
   §10 — TABLE CELL COMPONENTS
   Reusable cell patterns for inside <td>
   ═══════════════════════════════════════════════════════════════ */

/* Student name + avatar */
.yr-name-cell { display: flex; align-items: center; gap: 10px; }
.yr-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff; flex-shrink: 0;
}
.yr-avatar-lg { width: 52px; height: 52px; font-size: 20px; }
.yr-name { font-weight: 600; font-size: 13px; }

/* WPM with mini bar */
.yr-wpm-cell { display: flex; align-items: center; gap: 8px; }
.yr-wpm-val { font-weight: 600; font-size: 13px; min-width: 28px; }

/* Mini progress bar */
.yr-bar-track {
  height: 5px; background: #edf1f5;
  border-radius: 3px; overflow: hidden;
}
.yr-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease;
}
.yr-bar-track.thick { height: 6px; }
.yr-bar-track.w60 { width: 60px; }
.yr-bar-track.w80 { width: 80px; }
.yr-bar-track.full { width: 100%; }

/* Stars */
.yr-stars { white-space: nowrap; font-size: 16px; letter-spacing: -1px; }
.yr-star-on  { color: var(--yr-star-gold); }
.yr-star-off { color: #d5dde5; }

/* Status dot + label */
.yr-status { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.yr-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* Mini key badges (for problem keys column) */
.yr-key-list { display: flex; gap: 3px; flex-wrap: wrap; }
.yr-key-mini {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}
.yr-key-more {
  font-size: 10px; color: var(--yr-text-muted);
  font-weight: 600; padding: 0 4px; line-height: 22px;
}


/* ═══════════════════════════════════════════════════════════════
   §11 — EXPANDABLE DETAIL PANEL
   ═══════════════════════════════════════════════════════════════ */
.yr-detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid var(--yr-blue) !important;
}
.yr-detail-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--yr-detail-bg);
}
.yr-detail-panel.open { max-height: 1400px; }
.yr-detail-inner { padding: 20px 24px 24px; }

/* Stat strip inside detail */
.yr-detail-stats {
  display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap;
}
.yr-detail-stat { display: flex; flex-direction: column; gap: 1px; }
.yr-detail-stat .yr-ds-label {
  font-size: 10px; font-weight: 600;
  color: var(--yr-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.yr-detail-stat .yr-ds-value {
  font-size: 16px; font-weight: 700;
  color: var(--yr-text-primary);
}

/* Multi-column detail layout */
.yr-detail-cols {
  display: grid; gap: 16px;
}
.yr-detail-cols-2 { grid-template-columns: 1fr 1fr; }
.yr-detail-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Loading spinner */
.yr-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; gap: 12px;
}
.yr-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--yr-card-border);
  border-top-color: var(--yr-blue);
  border-radius: 50%;
  animation: yr-spin 0.7s linear infinite;
}
@keyframes yr-spin { to { transform: rotate(360deg); } }
.yr-loading-text { font-size: 13px; color: var(--yr-text-muted); font-weight: 500; }


/* ═══════════════════════════════════════════════════════════════
   §12 — TYPING ANALYTICS COMPONENTS
   Specific to typing reports but reusable across all games
   ═══════════════════════════════════════════════════════════════ */

/* Key accuracy row */
.yr-key-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
}
.yr-key-badge {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.yr-key-badge.lg { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.yr-key-pct {
  font-size: 11px; font-weight: 600;
  color: var(--yr-text-secondary);
  min-width: 32px; text-align: right;
}
.yr-key-time {
  font-size: 10px; color: var(--yr-text-muted);
  min-width: 48px; text-align: right;
}

/* Mix-up chips */
.yr-mixup-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.yr-mixup-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f4f7fa; border: 1px solid #e4eaf0;
  border-radius: 6px; padding: 4px 8px;
  font-size: 12px; font-weight: 600;
}
.yr-mixup-chip.lg {
  gap: 6px; border-radius: var(--yr-radius-sm);
  padding: 8px 14px; font-size: 14px;
}
.yr-mixup-from  { color: var(--yr-danger); }
.yr-mixup-arrow { color: var(--yr-text-muted); font-size: 10px; }
.yr-mixup-to    { color: var(--yr-green); }
.yr-mixup-count {
  font-size: 9px; color: var(--yr-text-muted);
  margin-left: 1px;
}

/* Miss variant (v1.4.1) — student was expected to type `from` but
   typed nothing. Distinct error category from substitutions, so we
   tint the whole chip amber so they read at a glance as different
   from the substitution chips around them. */
.yr-mixup-chip.is-miss {
  background: #fff7e6;
  border-color: #f4d090;
}
.yr-mixup-chip.is-miss .yr-mixup-arrow { color: #b08020; }
.yr-mixup-miss-label {
  color: #8a6020 !important;
  font-style: italic;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2px;
}
.yr-mixup-chip.is-miss.lg .yr-mixup-miss-label { font-size: 13px; }

/* Finger strength map */
.yr-finger-map {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px; padding: 10px 0;
}
.yr-finger-row { display: flex; gap: 8px; justify-content: center; }
.yr-finger-cell {
  text-align: center; border-radius: var(--yr-radius-sm);
  padding: 14px 8px; border: 2px solid transparent;
}
.yr-finger-cell.compact {
  padding: 8px 4px; border-width: 1.5px;
  border-radius: 6px;
}
.yr-finger-cell .yr-f-pct { font-size: 24px; font-weight: 700; line-height: 1; }
.yr-finger-cell.compact .yr-f-pct { font-size: 16px; }
.yr-finger-cell .yr-f-lbl {
  font-size: 10px; font-weight: 600; color: var(--yr-text-muted);
  text-transform: uppercase; letter-spacing: 0.6px; margin-top: 4px;
}
.yr-finger-cell.compact .yr-f-lbl { font-size: 8px; letter-spacing: 0.4px; margin-top: 2px; }

/* Finger grid (compact, for detail panels) */
.yr-finger-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.yr-finger-thumb { grid-column: 2 / 4; }

/* Finger strength tier colors */
.yr-f-excellent { background: var(--yr-excellent-bg); border-color: var(--yr-excellent-border); }
.yr-f-excellent .yr-f-pct { color: var(--yr-excellent); }
.yr-f-good { background: var(--yr-good-bg); border-color: var(--yr-good-border); }
.yr-f-good .yr-f-pct { color: var(--yr-good); }
.yr-f-ok { background: var(--yr-warn-bg); border-color: var(--yr-warn-border); }
.yr-f-ok .yr-f-pct { color: var(--yr-warn); }
.yr-f-warn { background: var(--yr-caution-bg); border-color: var(--yr-caution-border); }
.yr-f-warn .yr-f-pct { color: var(--yr-caution); }
.yr-f-danger { background: var(--yr-danger-bg); border-color: var(--yr-danger-border); }
.yr-f-danger .yr-f-pct { color: var(--yr-danger); }


/* ═══════════════════════════════════════════════════════════════
   §13 — BUTTONS & TOOLBAR
   ═══════════════════════════════════════════════════════════════ */
.yr-toolbar { display: flex; gap: 8px; }

.yr-btn {
  background: #f4f7fa; border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius-sm);
  padding: 7px 14px; font-family: var(--yr-font);
  font-size: 12px; font-weight: 600;
  color: var(--yr-text-secondary);
  cursor: pointer; display: inline-flex;
  align-items: center; gap: 5px;
  transition: all 0.15s; text-decoration: none;
}
.yr-btn:hover {
  background: var(--yr-blue-light);
  color: var(--yr-blue);
  border-color: var(--yr-blue);
}
.yr-btn svg { width: 14px; height: 14px; }

.yr-btn-primary {
  background: var(--yr-blue); color: #fff;
  border-color: var(--yr-blue);
}
.yr-btn-primary:hover {
  background: var(--yr-blue-dark); color: #fff;
  border-color: var(--yr-blue-dark);
}

/* Button variants (v1.4.2) — promoted from page CSS.
   Sizes:  .yr-btn-sm (compact)   .yr-btn-lg (prominent CTA)
   Styles: .yr-btn-ghost — transparent until hovered
           .yr-btn-success — solid green   .yr-btn-warn — solid amber */
.yr-btn-lg { padding: 11px 20px; font-size: 13.5px; }
.yr-btn-sm { padding: 4px 10px; font-size: 11.5px; gap: 4px; }
.yr-btn-sm svg { width: 12px; height: 12px; }
.yr-btn-ghost {
  background: transparent;
  color: var(--yr-text-secondary);
  border-color: transparent;
}
.yr-btn-ghost:hover {
  background: var(--yr-table-stripe);
  color: var(--yr-text-primary);
  border-color: transparent;
}
.yr-btn-success {
  background: var(--yr-green); color: #fff;
  border-color: var(--yr-green);
}
.yr-btn-success:hover {
  background: #58a23d; color: #fff;
  border-color: #58a23d;
}
.yr-btn-warn {
  background: var(--yr-warn); color: #fff;
  border-color: var(--yr-warn);
}
.yr-btn-warn:hover {
  background: #d88808; color: #fff;
  border-color: #d88808;
}
/* Universal disabled state for kit buttons. */
.yr-btn:disabled,
.yr-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Export dropdown */
.yr-dropdown-wrap { position: relative; }
.yr-dropdown {
  display: none; position: absolute;
  top: 100%; right: 0; margin-top: 4px;
  background: var(--yr-card-bg);
  border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius-sm);
  box-shadow: var(--yr-shadow-md);
  z-index: 50; min-width: 180px; overflow: hidden;
}
.yr-dropdown.open { display: block; }
.yr-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--yr-text-primary); text-decoration: none;
  transition: background 0.15s;
}
.yr-dropdown a:hover { background: var(--yr-blue-light); color: var(--yr-blue); }
.yr-dropdown a svg { width: 16px; height: 16px; color: var(--yr-text-muted); }
.yr-dropdown a:hover svg { color: var(--yr-blue); }
.yr-dropdown-sep { height: 1px; background: var(--yr-card-border); }

/* Back link */
.yr-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--yr-blue);
  text-decoration: none; font-weight: 500; margin-bottom: 16px;
}
.yr-back-link:hover { text-decoration: underline; }
.yr-back-link svg { width: 16px; height: 16px; }

/* View full report link */
.yr-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--yr-blue);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.yr-link:hover { text-decoration: underline; }
.yr-link svg { width: 14px; height: 14px; }


/* ═══════════════════════════════════════════════════════════════
   §14 — LEGEND
   ═══════════════════════════════════════════════════════════════ */
.yr-legend { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; flex-wrap: wrap; }
.yr-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--yr-text-secondary); font-weight: 500;
}
.yr-legend-dot { width: 10px; height: 10px; border-radius: 3px; }


/* ═══════════════════════════════════════════════════════════════
   §15 — GRID HELPERS
   ═══════════════════════════════════════════════════════════════ */
.yr-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.yr-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }


/* ═══════════════════════════════════════════════════════════════
   §16 — COLOR UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.yr-c-excellent { color: var(--yr-excellent); }
.yr-c-good      { color: var(--yr-good); }
.yr-c-ok        { color: var(--yr-ok); }
.yr-c-warn      { color: var(--yr-warn); }
.yr-c-caution   { color: var(--yr-caution); }
.yr-c-danger    { color: var(--yr-danger); }
.yr-c-blue      { color: var(--yr-blue); }
.yr-c-muted     { color: var(--yr-text-muted); }

.yr-bg-excellent { background: var(--yr-excellent); }
.yr-bg-good      { background: var(--yr-good); }
.yr-bg-ok        { background: var(--yr-ok); }
.yr-bg-warn      { background: var(--yr-warn); }
.yr-bg-caution   { background: var(--yr-caution); }
.yr-bg-danger    { background: var(--yr-danger); }
.yr-bg-blue      { background: var(--yr-blue); }


/* ═══════════════════════════════════════════════════════════════
   §17 — NETWORK TOAST
   Stacking rule (staff-v6): content < menus < modal overlays <
   TOASTS (9600) < top-priority chrome — activity-log 10000,
   staff-action 10050, soon-popup 11000, idle-logout 12000.
   9600 clears every overlay a flow can toast across (.ya-/.ym-
   overlay bumps top out at 1400, page takeovers at 9560), so
   failure toasts stay visible while a modal is open. Toasts sit
   deliberately BELOW the idle-logout security dialog: nothing
   toasts while the ≥10000 layers are open, and a pending session
   timeout must never be covered. Page copies of this rule
   (classes-list.css / student.css / add-staff.css §6) and
   .ym-toast (yeti-modal.css) must keep the same 9600.
   ═══════════════════════════════════════════════════════════════ */
.yr-toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9600;
  background: var(--yr-card-bg); border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius); padding: 12px 18px;
  box-shadow: var(--yr-shadow-md); font-size: 12px;
  color: var(--yr-text-secondary); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease; pointer-events: none;
}
.yr-toast.show { opacity: 1; transform: translateY(0); }
.yr-toast .yr-toast-dot { width: 8px; height: 8px; border-radius: 50%; }
.yr-toast .yr-toast-dot.loading {
  background: var(--yr-warn);
  animation: yr-pulse 1s infinite;
}
.yr-toast .yr-toast-dot.done { background: var(--yr-excellent); }
.yr-toast .yr-toast-dot.error { background: var(--yr-danger); }
@keyframes yr-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }


/* ═══════════════════════════════════════════════════════════════
   §18 — PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */
.yr-print-header {
  display: none; padding: 0 0 16px;
  border-bottom: 2px solid var(--yr-blue); margin-bottom: 16px;
}
.yr-print-header h1 { font-size: 18px; font-weight: 700; }
.yr-print-header .yr-print-sub {
  font-size: 12px; color: var(--yr-text-secondary); margin-top: 2px;
}

@media print {
  @page { size: landscape; margin: 0.5in; }
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .yr-sidebar, .yr-sidebar-toggle, .yr-hamburger, .yr-sidebar-overlay,
  .yr-user-menu, .yr-a11y-overlay, .yr-loading-state, .yr-error-state,
  .yr-tabs, .yr-hero, .yr-legend, .yr-topbar, .yr-report-trail,
  .yr-toolbar, .yr-chev, .yr-toast, .yr-link,
  .yr-btn, .yr-dropdown { display: none !important; }

  .yr-main { margin-left: 0 !important; }
  .yr-content { padding: 0 !important; max-width: none !important; }
  .yr-print-header { display: block !important; }

  .yr-stat-card { box-shadow: none !important; border: 1px solid #ccc !important; padding: 12px !important; }
  .yr-card { box-shadow: none !important; border: 1px solid #ccc !important; }

  .yr-table thead th { background: #f0f0f0 !important; font-size: 9px !important; padding: 6px 8px !important; }
  .yr-table tbody td { font-size: 11px !important; padding: 6px 8px !important; }
  .yr-table tbody tr.yr-data-row { break-inside: avoid; }
  .yr-detail-row { display: none !important; }

  .yr-finger-cell { border: 1px solid #ccc !important; }
}


/* ═══════════════════════════════════════════════════════════════
   §19 — HAMBURGER MENU
   ═══════════════════════════════════════════════════════════════ */
.yr-hamburger {
  display: none; width: 44px; height: 44px;
  border-radius: var(--yr-radius-sm);
  background: none; border: 1px solid var(--yr-card-border);
  cursor: pointer; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
  color: var(--yr-text-muted);
}
.yr-hamburger:hover {
  border-color: var(--yr-blue); color: var(--yr-blue);
  background: var(--yr-blue-light);
}
.yr-hamburger svg { width: 18px; height: 18px; }

.yr-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.3); z-index: 99;
  opacity: 0; transition: opacity 0.25s;
}
.yr-sidebar-overlay.show { display: block; opacity: 1; }


/* ═══════════════════════════════════════════════════════════════
   §20 — RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Large screens: report-specific adjustments */
@media (max-width: 1200px) {
  .yr-detail-cols-3 { grid-template-columns: 1fr 1fr; }
  .yr-cols-5 { grid-template-columns: repeat(3, 1fr); }
  .yr-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Table-card horizontal scroll — applies at ALL widths.
   Roster/report tables need ~1500px of intrinsic width for 10 columns;
   below ~1830px viewport the card is narrower than that, and without
   overflow-x:auto the rightmost columns visibly spill past the card's
   right edge. Earlier versions gated this rule behind
   @media (max-width:1100px) to preserve sticky thead — but sticky thead
   is implemented in JS (YR.initStickyHeader clones the thead into a
   fixed floater), not via CSS position:sticky, so this overflow rule
   is safe at every width. */
.yr-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Mid screens: auto-collapse sidebar to icon bar */
@media (max-width: 900px) {
  .yr-sidebar { width: 64px; }
  .yr-sidebar .yr-sidebar-logo { padding: 14px 0; justify-content: center; }
  .yr-sidebar .yr-logo-img { display: none; }
  .yr-sidebar .yr-logo-compact { display: flex; }
  .yr-sidebar .yr-sidebar-toggle { display: none; }
  .yr-sidebar .yr-nav-sep { margin: 6px 12px; }
  .yr-sidebar .yr-sidebar-nav a { justify-content: center; padding: 12px 0; }
  .yr-sidebar .yr-sidebar-nav a .yr-nav-label { opacity: 0; width: 0; overflow: hidden; }
  .yr-sidebar .yr-sidebar-nav a.active { margin-right: 0; border-radius: 0 12px 12px 0; margin-right: 4px; }
  .yr-sidebar .yr-sf-help { justify-content: center; padding: 10px 0; }
  .yr-sidebar .yr-sf-help .yr-nav-label { opacity: 0; width: 0; overflow: hidden; }
  .yr-sidebar .yr-sf-user { justify-content: center; padding: 12px 0; }
  .yr-sidebar .yr-sf-info { opacity: 0; width: 0; overflow: hidden; }
  .yr-sidebar .yr-sf-chevron { display: none; }
  .yr-main { margin-left: 64px !important; }
}

/* Small screens: sidebar as overlay with hamburger */
@media (max-width: 768px) {
  .yr-hamburger { display: flex; }
  .yr-sidebar {
    width: 260px; transform: translateX(-260px);
    position: fixed; z-index: 200;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .yr-sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .yr-sidebar.mobile-open .yr-sidebar-logo { padding: 16px 20px; }
  .yr-sidebar.mobile-open .yr-logo-img { display: block; }
  .yr-sidebar.mobile-open .yr-logo-compact { display: none; }
  .yr-sidebar.mobile-open .yr-sidebar-toggle { display: none; }
  .yr-sidebar.mobile-open .yr-nav-sep { margin: 6px 20px; }
  .yr-sidebar.mobile-open .yr-sidebar-nav a { justify-content: flex-start; padding: 12px 20px; min-height: 44px; }
  .yr-sidebar.mobile-open .yr-sidebar-nav a .yr-nav-label { opacity: 1; width: auto; }
  .yr-sidebar.mobile-open .yr-sidebar-nav a.active { margin-right: 12px; border-radius: 0 24px 24px 0; }
  .yr-sidebar.mobile-open .yr-sf-help { justify-content: flex-start; padding: 12px 20px; min-height: 44px; }
  .yr-sidebar.mobile-open .yr-sf-help .yr-nav-label { opacity: 1; width: auto; }
  .yr-sidebar.mobile-open .yr-sf-user { justify-content: flex-start; padding: 14px 20px; }
  .yr-sidebar.mobile-open .yr-sf-info { opacity: 1; width: auto; }
  .yr-sidebar.mobile-open .yr-sf-chevron { display: block; }
  .yr-main { margin-left: 0 !important; }
  .yr-cols-3, .yr-cols-4, .yr-cols-5 { grid-template-columns: 1fr 1fr; }
  .yr-detail-cols-2, .yr-detail-cols-3 { grid-template-columns: 1fr; }
  .yr-grid-2, .yr-grid-3 { grid-template-columns: 1fr; }
  .yr-content { padding: 16px; }
  .yr-topbar { padding-left: 16px; padding-right: 16px; }
  .yr-topbar .yr-class-selector { min-width: 0; width: 100%; order: 10; }
  .yr-topbar .yr-class-selector label { display: none; }
  .yr-hero { padding: 20px 16px; }
  .yr-tabs { padding: 0 16px; overflow-x: auto; }
  .yr-finger-row { flex-wrap: wrap; }
  .yr-finger-cell { width: 80px; }
}

/* Touch devices — show interactive indicators always */
@media (hover: none) {
  .yr-chev { opacity: 0.4; }
  .yr-table tbody tr.yr-data-row { padding-right: 8px; }
}


/* ═══════════════════════════════════════════════════════════════
   §21 — CLASS DROPDOWN (custom, replaces native <select>)
   ═══════════════════════════════════════════════════════════════ */
.yr-class-selector {
  position: relative;
  min-width: 260px;
}
.yr-class-selector label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--yr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.yr-class-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--yr-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--yr-text-primary);
  background: white;
  border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: var(--yr-shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.yr-class-trigger:hover {
  border-color: var(--yr-blue);
}
.yr-class-trigger.open {
  border-color: var(--yr-blue);
  box-shadow: 0 0 0 3px rgba(19,158,221,0.12);
  border-radius: var(--yr-radius-sm) var(--yr-radius-sm) 0 0;
}
.yr-class-trigger-chevron {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
  color: var(--yr-text-muted);
  flex-shrink: 0;
}
.yr-class-trigger.open .yr-class-trigger-chevron {
  transform: rotate(180deg);
}
.yr-class-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--yr-blue);
  border-top: 0;
  border-radius: 0 0 var(--yr-radius-sm) var(--yr-radius-sm);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  /* Thin scrollbar that doesn't clip border-radius */
  scrollbar-width: thin;
  scrollbar-color: #c5cdd6 transparent;
}
.yr-class-menu::-webkit-scrollbar { width: 5px; }
.yr-class-menu::-webkit-scrollbar-track { background: transparent; margin-bottom: 8px; }
.yr-class-menu::-webkit-scrollbar-thumb { background: #c5cdd6; border-radius: 3px; }
.yr-class-menu::-webkit-scrollbar-thumb:hover { background: #a8b5c2; }
.yr-class-menu.open {
  display: block;
}
.yr-class-menu-item {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--yr-text-primary);
  cursor: pointer;
  transition: all 0.1s;
  border-bottom: 1px solid #f0f4f8;
}
.yr-class-menu-item:last-child {
  border-bottom: 0;
}
.yr-class-menu-item:hover {
  background: var(--yr-blue-light);
  color: var(--yr-blue);
}
.yr-class-menu-item.active {
  background: var(--yr-blue);
  color: white;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════
   §22 — ACCESSIBILITY
   Self-contained. Any page using the YR kit gets all of this.
   ═══════════════════════════════════════════════════════════════ */

/* ── Touch: eliminate 300ms delay ── */
.yr-sidebar-nav a, .yr-sf-user, .yr-sf-help, .yr-sidebar-toggle,
.yr-cat-tile, .yr-report-card, .yr-qlaunch, .yr-ql-remove,
.yr-scope-btn, .yr-back-btn, .yr-class-trigger, .yr-class-menu-item,
.yr-hamburger, .yr-rc-pin, .yr-search-clear,
.yr-user-menu a, .yr-a11y-close, .yr-toggle-track, .yr-error-retry,
.yr-btn, .yr-chev, .yr-link, .yr-class-drop, .yr-trail-back, .yr-trail-link {
  touch-action: manipulation;
}

/* ── Focus indicators (progressive enhancement) ── */
.yr-scope :focus { outline: 2px solid var(--yr-focus-ring); outline-offset: 2px; border-radius: 4px; }
.yr-scope :focus:not(:focus-visible) { outline: none; }
.yr-scope :focus-visible { outline: 2px solid var(--yr-focus-ring); outline-offset: 2px; border-radius: 4px; }

.yr-sidebar-nav a:focus-visible { outline-color: #fff; outline-offset: -2px; border-radius: 0 24px 24px 0; }
.yr-sf-help:focus-visible { outline-color: #fff; outline-offset: -2px; }
.yr-sf-user:focus-visible { outline-color: #fff; outline-offset: -2px; }
.yr-user-menu a:focus-visible { outline-offset: -2px; border-radius: 0; }
.yr-report-card:focus-visible { outline-offset: -1px; border-radius: var(--yr-radius); }
.yr-cat-tile:focus-visible { outline-offset: -1px; border-radius: var(--yr-radius); }
.yr-scope-btn:focus-visible { outline-offset: -2px; border-radius: 0; }
.yr-rc-pin:focus-visible { outline-offset: 0; border-radius: 7px; }
.yr-sidebar-toggle:focus-visible { outline-offset: 0; border-radius: 50%; }
.yr-hamburger:focus-visible { outline-offset: -1px; }
.yr-chev:focus-visible { border-radius: 50%; }

/* ── Skip link ── */
.yr-skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 9999;
  background: var(--yr-blue); color: #fff; padding: 10px 20px;
  border-radius: 0 0 var(--yr-radius-sm) var(--yr-radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--yr-font);
  text-decoration: none; box-shadow: var(--yr-shadow-lg); transition: top 0.2s;
}
.yr-skip-link:focus { top: 0; }

/* ── Visually hidden (screen reader only) ── */
.yr-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── SVG overflow helper ── */
.yr-svg-overflow { overflow: visible; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Forced colors (Windows High Contrast) ── */
@media (forced-colors: active) {
  .yr-card, .yr-cat-tile, .yr-report-card, .yr-qlaunch,
  .yr-scope-toggle, .yr-search input, .yr-a11y-modal,
  .yr-class-trigger { border: 2px solid ButtonText; }
  .yr-sidebar { border-right: 2px solid ButtonText; }
  .yr-sidebar-nav a.active { border: 2px solid Highlight; }
  .yr-toggle-track { border: 2px solid ButtonText; }
  .yr-toggle input:checked + .yr-toggle-track { background: Highlight; }
  *:focus-visible { outline: 2px solid Highlight; }
}

/* ── Increased contrast preference ── */
@media (prefers-contrast: more) {
  :root {
    --yr-card-border: #8995a1;
    --yr-shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
    --yr-shadow-md: 0 4px 14px rgba(0,0,0,0.2);
  }
  .yr-card, .yr-cat-tile, .yr-report-card { border-width: 2px; }
}


/* ═══════════════════════════════════════════════════════════════
   §23 — ACCESSIBILITY MODAL & TOGGLE SWITCH
   Drop-in component. Requires matching HTML and JS.
   ═══════════════════════════════════════════════════════════════ */

/* Overlay */
.yr-a11y-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35); z-index: 300;
  align-items: center; justify-content: center;
}
.yr-a11y-overlay.open { display: flex; }

/* Modal panel */
.yr-a11y-modal {
  background: var(--yr-card-bg); border-radius: var(--yr-radius-lg);
  box-shadow: var(--yr-shadow-lg); width: 420px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.yr-a11y-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--yr-card-border);
}
.yr-a11y-header h2 {
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  color: var(--yr-text-primary);
}
.yr-a11y-header h2 svg { width: 20px; height: 20px; color: var(--yr-blue); }
.yr-a11y-close {
  width: 32px; height: 32px; border-radius: 8px; border: none; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--yr-text-muted); transition: all 0.15s;
}
.yr-a11y-close:hover { background: var(--yr-table-stripe); color: var(--yr-text-primary); }
.yr-a11y-close svg { width: 18px; height: 18px; }

.yr-a11y-body { padding: 20px 24px 24px; }
.yr-a11y-desc { font-size: 13px; color: var(--yr-text-secondary); margin-bottom: 20px; line-height: 1.5; }

.yr-a11y-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--yr-card-border);
}
.yr-a11y-option:last-child { border-bottom: none; }
.yr-a11y-opt-info { flex: 1; margin-right: 16px; }
.yr-a11y-opt-label { font-size: 14px; font-weight: 600; color: var(--yr-text-primary); margin-bottom: 2px; }
.yr-a11y-opt-desc { font-size: 12px; color: var(--yr-text-muted); line-height: 1.4; }

/* Toggle switch */
.yr-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.yr-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.yr-toggle-track {
  position: absolute; inset: 0; background: #cdd5de;
  border: 1px solid #7e8d9c; border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
}
.yr-toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: transform 0.2s;
}
.yr-toggle input:checked + .yr-toggle-track { background: var(--yr-blue); border-color: var(--yr-blue); }
.yr-toggle input:checked + .yr-toggle-track::after { transform: translateX(20px); }
.yr-toggle input:focus-visible + .yr-toggle-track { outline: 2px solid var(--yr-focus-ring); outline-offset: 2px; }


/* ═══════════════════════════════════════════════════════════════
   §24 — ACCESSIBILITY STATE CLASSES
   Applied to <body> via JS toggle. Covers all YR kit elements.
   ═══════════════════════════════════════════════════════════════ */

/* ── Larger Text ── */
body.yr-large-text { font-size: 18px; }
body.yr-large-text .yr-topbar-left h1 { font-size: 19px; }
body.yr-large-text .yr-topbar-left .yr-sub { font-size: 13px; }
body.yr-large-text .yr-report-trail { font-size: 15px; }
body.yr-large-text .yr-trail-sep { font-size: 14px; }
body.yr-large-text .yr-greeting { font-size: 17px; }
body.yr-large-text .yr-sidebar-nav a { font-size: 15px; }
body.yr-large-text .yr-sf-help { font-size: 15px; }
body.yr-large-text .yr-sf-name { font-size: 15px; }
body.yr-large-text .yr-sf-role { font-size: 13px; }
body.yr-large-text .yr-user-menu a { font-size: 15px; }
body.yr-large-text .yr-um-name { font-size: 15px; }
body.yr-large-text .yr-um-school { font-size: 13px; }
body.yr-large-text .yr-hero-title { font-size: 20px; }
body.yr-large-text .yr-hero-sub { font-size: 14px; }
body.yr-large-text .yr-tab { font-size: 14px; }
body.yr-large-text .yr-stat-value { font-size: 22px; }
body.yr-large-text .yr-stat-label { font-size: 13px; }
body.yr-large-text .yr-table thead th { font-size: 12px; }
body.yr-large-text .yr-table tbody td { font-size: 14px; }
body.yr-large-text .yr-class-trigger { font-size: 15px; }
body.yr-large-text .yr-class-menu-item { font-size: 15px; }
body.yr-large-text .yr-a11y-opt-label { font-size: 16px; }
body.yr-large-text .yr-a11y-opt-desc { font-size: 14px; }
body.yr-large-text .yr-a11y-desc { font-size: 15px; }
body.yr-large-text .yr-a11y-header h2 { font-size: 18px; }
body.yr-large-text .yr-toast { font-size: 14px; }

/* Extra-large is a separate state so A++ is visibly larger than A+. */
body.yr-large-text.yr-extra-large-text { font-size: 21px; }
body.yr-large-text.yr-extra-large-text .yr-topbar-left h1 { font-size: 22px; }
body.yr-large-text.yr-extra-large-text .yr-topbar-left .yr-sub { font-size: 15px; }
body.yr-large-text.yr-extra-large-text .yr-report-trail { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-trail-sep { font-size: 16px; }
body.yr-large-text.yr-extra-large-text .yr-greeting { font-size: 19px; }
body.yr-large-text.yr-extra-large-text .yr-sidebar-nav a { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-sf-help { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-sf-name { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-sf-role { font-size: 15px; }
body.yr-large-text.yr-extra-large-text .yr-user-menu a { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-um-name { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-um-school { font-size: 15px; }
body.yr-large-text.yr-extra-large-text .yr-hero-title { font-size: 23px; }
body.yr-large-text.yr-extra-large-text .yr-hero-sub { font-size: 16px; }
body.yr-large-text.yr-extra-large-text .yr-tab { font-size: 16px; }
body.yr-large-text.yr-extra-large-text .yr-stat-value { font-size: 26px; }
body.yr-large-text.yr-extra-large-text .yr-stat-label { font-size: 15px; }
body.yr-large-text.yr-extra-large-text .yr-table thead th { font-size: 14px; }
body.yr-large-text.yr-extra-large-text .yr-table tbody td { font-size: 16px; }
body.yr-large-text.yr-extra-large-text .yr-class-trigger { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-class-menu-item { font-size: 17px; }
body.yr-large-text.yr-extra-large-text .yr-toast { font-size: 16px; }

/* ── High Contrast ── */
body.yr-high-contrast {
  --yr-text-primary: #000;
  --yr-text-secondary: #222;
  --yr-text-muted: #444;
  --yr-card-border: #333;
  --yr-body-bg: #fff;
  --yr-card-bg: #fff;
  --yr-table-head-bg: #f0f0f0;
  --yr-table-stripe: #f5f5f5;
  --yr-shadow-sm: none;
  --yr-shadow-md: none;
  --yr-shadow-lg: none;
}
/* Sidebar */
body.yr-high-contrast .yr-sidebar { background: #000; }
body.yr-high-contrast .yr-sidebar-nav a { color: #fff; }
body.yr-high-contrast .yr-sidebar-nav a:hover { background: rgba(255,255,255,0.15); }
body.yr-high-contrast .yr-sidebar-nav a.active { background: #fff; color: #000; box-shadow: none; }
body.yr-high-contrast .yr-nav-sep { background: rgba(255,255,255,0.3); }
body.yr-high-contrast .yr-sf-help { color: #fff; }
body.yr-high-contrast .yr-sf-name { color: #fff; }
body.yr-high-contrast .yr-sf-role { color: #ccc; }
body.yr-high-contrast .yr-sf-chevron { color: #fff; }
/* Cards, tiles, tables */
body.yr-high-contrast .yr-report-card,
body.yr-high-contrast .yr-cat-tile,
body.yr-high-contrast .yr-card,
body.yr-high-contrast .yr-stat-card { border: 2px solid #333; box-shadow: none; }
body.yr-high-contrast .yr-report-card:hover,
body.yr-high-contrast .yr-cat-tile:hover,
body.yr-high-contrast .yr-card:hover { border-color: #000; }
body.yr-high-contrast .yr-table thead th { border-bottom: 2px solid #000; }
body.yr-high-contrast .yr-table tbody td { border-bottom: 1px solid #999; }
/* Hero */
body.yr-high-contrast .yr-hero { background: #000; color: #fff; }
body.yr-high-contrast .yr-hero-title { color: #fff; }
body.yr-high-contrast .yr-hero-sub { color: #ddd; }
/* Topbar */
body.yr-high-contrast .yr-topbar { border-bottom: 2px solid #000; }
body.yr-high-contrast .yr-topbar::after { display: none; }
body.yr-high-contrast .yr-topbar-left h1 { color: #000; }
body.yr-high-contrast .yr-topbar-icon { background: #000; }
body.yr-high-contrast .yr-trail-back,
body.yr-high-contrast .yr-trail-link { color: #000; text-decoration: underline; }
body.yr-high-contrast .yr-trail-sep { color: #000; }
body.yr-high-contrast .yr-trail-current { color: #000; }
/* Mix-up miss chip — keep amber readable in HC mode (v1.4.1) */
body.yr-high-contrast .yr-mixup-chip.is-miss { background: #fff; border: 2px solid #000; }
body.yr-high-contrast .yr-mixup-miss-label { color: #000 !important; }
/* Class dropdown */
body.yr-high-contrast .yr-class-trigger { border: 2px solid #333; box-shadow: none; }
body.yr-high-contrast .yr-class-trigger.open { border-color: #000; }
body.yr-high-contrast .yr-class-menu { border: 2px solid #000; }
body.yr-high-contrast .yr-class-menu-item:hover { background: #eee; color: #000; }
body.yr-high-contrast .yr-class-menu-item.active { background: #000; color: #fff; }
/* Tabs */
body.yr-high-contrast .yr-tab.active { border-bottom-color: #000; color: #000; }
/* User menu */
body.yr-high-contrast .yr-user-menu { border: 2px solid #333; }
body.yr-high-contrast .yr-user-menu a:hover { background: #eee; color: #000; }
body.yr-high-contrast .yr-user-menu a:hover svg { color: #000; }
body.yr-high-contrast .yr-user-menu-header { border-bottom: 2px solid #333; }
body.yr-high-contrast .yr-um-sep { background: #333; }
body.yr-high-contrast .yr-user-menu a.yr-um-logout { color: #8b0000; }
/* Toggle switch */
body.yr-high-contrast .yr-toggle-track { background: #999; border-color: #333; }
body.yr-high-contrast .yr-toggle input:checked + .yr-toggle-track { background: #000; border-color: #000; }
/* Focus ring */
body.yr-high-contrast *:focus-visible { outline-color: #000; outline-width: 3px; }
body.yr-high-contrast .yr-sidebar-nav a:focus-visible { outline-color: #fff; }
/* Toast */
body.yr-high-contrast .yr-toast { background: #000; color: #fff; border: 2px solid #fff; }
/* A11y modal */
body.yr-high-contrast .yr-a11y-modal { border: 2px solid #333; }
body.yr-high-contrast .yr-a11y-option { border-bottom-color: #333; }
/* Loading/error */
body.yr-high-contrast .yr-loading-spinner { border-color: #333; border-top-color: #000; }
body.yr-high-contrast .yr-error-retry { background: #000; }

/* ── Increased Spacing ── */
body.yr-extra-spacing { line-height: 2; letter-spacing: 0.02em; }
/* Content */
body.yr-extra-spacing .yr-report-card { padding: 20px 22px; gap: 16px; }
body.yr-extra-spacing .yr-cat-tile { padding: 24px 22px; }
body.yr-extra-spacing .yr-report-grid { gap: 16px; }
body.yr-extra-spacing .yr-cat-grid { gap: 20px; }
body.yr-extra-spacing .yr-card { padding: 24px; }
body.yr-extra-spacing .yr-stat-card { padding: 20px; }
/* Tables */
body.yr-extra-spacing .yr-table thead th { padding: 12px 16px; }
body.yr-extra-spacing .yr-table tbody td { padding: 12px 16px; }
/* Sidebar */
body.yr-extra-spacing .yr-sidebar-nav a { padding: 14px 20px; }
body.yr-extra-spacing .yr-nav-sep { margin: 10px 20px; }
body.yr-extra-spacing .yr-sf-help { padding: 14px 20px; }
body.yr-extra-spacing .yr-sf-user { padding: 16px 20px; }
/* User menu */
body.yr-extra-spacing .yr-user-menu a { padding: 14px 18px; }
body.yr-extra-spacing .yr-user-menu-header { padding: 16px 18px; }
/* Hero, tabs */
body.yr-extra-spacing .yr-hero { padding: 32px 40px 24px; }
body.yr-extra-spacing .yr-topbar { padding: 18px 36px; }
body.yr-extra-spacing .yr-tab { padding: 14px 20px; }
/* A11y modal */
body.yr-extra-spacing .yr-a11y-option { padding: 18px 0; }
body.yr-extra-spacing .yr-a11y-body { padding: 24px 28px 28px; }

/* ── Reduced Motion (via class — no DOM iteration) ── */
body.yr-reduced-motion *,
body.yr-reduced-motion *::before,
body.yr-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ── Loading & Error States ── */
.yr-loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; gap: 16px;
}
.yr-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--yr-card-border); border-top-color: var(--yr-blue);
  border-radius: 50%; animation: yr-spin 0.7s linear infinite;
}
@keyframes yr-spin { to { transform: rotate(360deg); } }
.yr-loading-state p { font-size: 13px; color: var(--yr-text-muted); font-weight: 500; }

.yr-error-state { display: none; text-align: center; padding: 60px 20px; }
.yr-error-state.show { display: block; }
.yr-error-state svg { width: 48px; height: 48px; color: var(--yr-danger); margin-bottom: 12px; opacity: 0.6; }
.yr-error-state h3 { font-size: 15px; font-weight: 700; color: var(--yr-text-primary); margin-bottom: 4px; }
.yr-error-state p { font-size: 13px; color: var(--yr-text-muted); margin-bottom: 16px; }
.yr-error-retry {
  font-family: var(--yr-font); font-size: 13px; font-weight: 600; color: #fff;
  background: var(--yr-blue); border: none; border-radius: var(--yr-radius-sm);
  padding: 10px 20px; cursor: pointer; transition: background 0.15s;
}
.yr-error-retry:hover { background: var(--yr-blue-dark); }


/* ═══════════════════════════════════════════════════════════════
   §25 — MOBILE COMPLIANCE (v1.3.0)
   iPad/iPhone fixes: input zoom prevention, safe-area insets,
   touch target minimums. All scoped to mobile breakpoints so
   desktop sizing is unchanged.
   ═══════════════════════════════════════════════════════════════ */

/* ── Prevent iOS auto-zoom on input focus ── */
/* iOS Safari zooms in when tapping any input under 16px. */
@media (max-width: 640px) {
  input,
  select,
  textarea,
  .yr-class-trigger,
  .yr-search input,
  .yr-a11y-modal input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"] {
    font-size: 16px !important;
  }
}

/* ── Safe-area-inset-bottom on mobile toolbars ── */
/* iPhone home indicator overlaps bottom UI without this. */
@media (max-width: 768px) {
  .yr-toolbar {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .yr-card-header {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px) * 0.5);
  }
  .yr-toast {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .yr-sidebar-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .yr-a11y-modal {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Touch target minimums (WCAG 2.5.8) ── */
/* All interactive elements ≥ 44x44px on mobile. */
@media (max-width: 768px) {
  .yr-btn,
  .yr-hamburger,
  .yr-sidebar-nav a,
  .yr-sf-help,
  .yr-sf-user,
  .yr-sidebar-toggle,
  .yr-class-trigger,
  .yr-class-menu-item,
  .yr-dropdown a,
  .yr-user-menu a,
  .yr-a11y-close,
  .yr-toggle,
  .yr-trail-back,
  .yr-trail-link,
  .yr-tabs a,
  .yr-table tbody tr.yr-data-row,
  .yr-error-retry,
  .yr-link {
    min-height: 44px;
  }
  .yr-btn,
  .yr-hamburger,
  .yr-a11y-close,
  .yr-sidebar-toggle {
    min-width: 44px;
  }
  /* Padding adjustment so content stays centered in 44px targets */
  .yr-btn { padding: 11px 16px; }
  .yr-class-trigger { padding: 11px 14px; }
  .yr-dropdown a,
  .yr-user-menu a { padding: 12px 16px; }
  .yr-class-menu-item { padding: 12px 14px; }
}


/* ═══════════════════════════════════════════════════════════════
   §26 — STICKY TABLE HEADER (JS-based floater)
   YR.initStickyHeader() clones the <thead> into this fixed
   container when the real header scrolls out of view.
   ═══════════════════════════════════════════════════════════════ */
.yr-sticky-floater {
  position: fixed;
  top: 0;
  z-index: 50;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 0 var(--yr-card-border);
  border-radius: 0;
}
.yr-sticky-floater table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}
.yr-sticky-floater thead th {
  background: var(--yr-table-head-bg) !important;
}
/* Hide when printing */
@media print {
  .yr-sticky-floater { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   §27 — TABLE PAGINATION (YR.initPagination)
   Footer that sits below a sortable table. Composes with sort,
   filter, and the sticky thead.
   ═══════════════════════════════════════════════════════════════ */
.yr-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--yr-card-border);
  background: var(--yr-card-bg);
  border-radius: 0 0 var(--yr-radius-md, 12px) var(--yr-radius-md, 12px);
  font-size: 13px;
  color: var(--yr-text-secondary);
}
.yr-pager-left {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.yr-pager-info { font-weight: 500; }
.yr-pager-info strong {
  color: var(--yr-text-primary);
  font-weight: 700;
}
.yr-pager-nav { display: flex; align-items: center; gap: 4px; }

.yr-pg-btn {
  min-width: 32px; height: 32px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--yr-card-border);
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--yr-text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.yr-pg-btn:hover:not(:disabled) {
  border-color: var(--yr-blue);
  color: var(--yr-blue);
}
.yr-pg-btn:focus-visible {
  outline: 2px solid var(--yr-blue);
  outline-offset: 1px;
}
.yr-pg-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
}
.yr-pg-btn.active {
  background: var(--yr-blue);
  border-color: var(--yr-blue);
  color: #fff;
}
.yr-pg-btn.active:hover { color: #fff; }
.yr-pg-arrow {
  font-size: 18px; line-height: 1;
  font-weight: 600;
}
.yr-pg-ellipsis {
  padding: 0 4px;
  color: var(--yr-text-muted);
  font-weight: 600;
  user-select: none;
}

/* Page size selector */
.yr-pg-size {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--yr-text-muted);
}
.yr-pg-size span { font-weight: 500; }
.yr-pg-size-select {
  padding: 4px 22px 4px 8px;
  border: 1px solid var(--yr-card-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--yr-text-primary);
  background: #fff;
  cursor: pointer;
}
.yr-pg-size-select:focus {
  outline: none;
  border-color: var(--yr-blue);
  box-shadow: 0 0 0 2px rgba(18, 160, 221, 0.15);
}

/* Mobile: stack info above nav */
@media (max-width: 640px) {
  .yr-pager { flex-direction: column; align-items: stretch; }
  .yr-pager-left { justify-content: space-between; }
  .yr-pager-nav { justify-content: center; flex-wrap: wrap; }
}

/* Hide when printing — a printed report shows all rows */
@media print {
  .yr-pager { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   §28 — DROPDOWN (YR.initDropdown)
   v1.4.0 — Generic styled dropdown component. Replaces native
   <select> with a fully styled, keyboard-navigable, ARIA-compliant
   popup. Used for class pickers, student pickers, filters, and
   anywhere a styled single-select is needed. Composes with kit's
   focus ring and disabled state.
   ═══════════════════════════════════════════════════════════════ */
.yr-dd-wrap {
  position: relative;
  width: 100%;
}
.yr-dd-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: var(--yr-card-bg);
  border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--yr-text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, box-shadow .12s;
}
.yr-dd-button:hover { border-color: #cbd5e1; }
.yr-dd-button:focus-visible {
  outline: none;
  border-color: var(--yr-blue);
  box-shadow: 0 0 0 3px rgba(18, 160, 221, .18);
}
.yr-dd-button[aria-expanded="true"] {
  border-color: var(--yr-blue);
  box-shadow: 0 0 0 3px rgba(18, 160, 221, .18);
}
.yr-dd-button[disabled],
.yr-dd-wrap.is-disabled .yr-dd-button {
  opacity: .55;
  cursor: wait;
  background: var(--yr-table-head-bg);
}
.yr-dd-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.yr-dd-button .yr-dd-chevron {
  width: 14px; height: 14px;
  color: var(--yr-text-muted);
  flex-shrink: 0;
  transition: transform .15s;
}
.yr-dd-button[aria-expanded="true"] .yr-dd-chevron {
  transform: rotate(180deg);
  color: var(--yr-blue);
}

.yr-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--yr-card-bg);
  border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius);
  box-shadow: var(--yr-shadow-lg);
  z-index: 60;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
  animation: yr-dd-menu-in .14s ease-out;
}
@keyframes yr-dd-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.yr-dd-menu::-webkit-scrollbar { width: 8px; }
.yr-dd-menu::-webkit-scrollbar-track { background: transparent; }
.yr-dd-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.yr-dd-menu::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.yr-dd-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--yr-text-primary);
  text-align: left;
  cursor: pointer;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .1s, color .1s;
}
.yr-dd-option:hover,
.yr-dd-option:focus-visible {
  background: var(--yr-blue-light);
  color: var(--yr-badge-blue);
  outline: none;
}
.yr-dd-option[aria-selected="true"] {
  background: var(--yr-blue);
  color: #fff;
  font-weight: 500;
}
.yr-dd-option[aria-selected="true"]:hover {
  background: var(--yr-blue-dark);
  color: #fff;
}
.yr-dd-option .yr-dd-meta {
  display: block;
  font-size: 11px;
  color: inherit;
  opacity: .65;
  font-weight: 400;
  margin-top: 1px;
}


/* ═══════════════════════════════════════════════════════════════
   §29 — SKELETON LOADER
   v1.4.0 — Shimmer placeholders shown while data is loading.
   Compose: .yr-skel (default 12px line) | .yr-skel-tall (26px) |
   .yr-skel-pill (rounded) | .yr-skel-circle (avatar). For card-
   level loading states add .yr-card-loading + a .yr-loading-bar
   element at the top.
   JS helpers: YR.skeletonStatCard, YR.skeletonTableRow.
   ═══════════════════════════════════════════════════════════════ */
@keyframes yr-shimmer {
  0%   { background-position: -460px 0; }
  100% { background-position:  460px 0; }
}
@keyframes yr-loading-slide {
  0%   { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}

.yr-skel {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 800px 100%;
  animation: yr-shimmer 1.3s infinite linear;
  border-radius: 4px;
  display: block;
  height: 12px;
}
.yr-skel-tall   { height: 26px; border-radius: 6px; }
.yr-skel-pill   { height: 18px; border-radius: 999px; display: inline-block; vertical-align: middle; }
.yr-skel-circle { width: 30px; height: 30px; border-radius: 50%; display: inline-block; vertical-align: middle; flex-shrink: 0; }

.yr-card-loading { position: relative; }
.yr-loading-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yr-blue), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  position: absolute;
  top: 0; left: 0; right: 0;
  animation: yr-loading-slide 1.1s infinite ease-in-out;
}

.yr-skel-row td { padding: 14px; }
.yr-skel-row .yr-skel-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ═══════════════════════════════════════════════════════════════
   §30 — EXPORT MENU (YR.initExportMenu)
   v1.4.0 — Standard Export ▼ button + grouped dropdown menu.
   Renders any combination of XLSX, CSV, and Print options. Visual
   sections keyed by data-format on each option. Companion to the
   existing YR.exportXLSX / YR.exportCSV functions in §6 (JS).
   ═══════════════════════════════════════════════════════════════ */
@keyframes yr-export-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.yr-export-wrap {
  position: relative;
  display: inline-block;
}
.yr-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.yr-export-btn .yr-caret {
  width: 10px; height: 10px;
  margin-left: 2px;
  transition: transform .15s;
}
.yr-export-btn[aria-expanded="true"] .yr-caret {
  transform: rotate(180deg);
}
.yr-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--yr-card-bg);
  border: 1px solid var(--yr-card-border);
  border-radius: var(--yr-radius);
  box-shadow: var(--yr-shadow-lg);
  min-width: 320px;
  z-index: 100;
  overflow: hidden;
  padding: 6px 0;
  animation: yr-export-menu-in .14s ease-out;
}
.yr-export-menu-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--yr-text-muted);
  padding: 8px 14px 4px;
}
.yr-export-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: var(--yr-text-primary);
  transition: background .1s;
}
.yr-export-menu button:hover,
.yr-export-menu button:focus-visible {
  background: var(--yr-blue-light);
  outline: none;
}
.yr-export-menu .yr-opt-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.yr-export-menu button[data-format="xlsx"]  .yr-opt-icon { background: var(--yr-green-light); color: var(--yr-badge-green); }
.yr-export-menu button[data-format="csv"]   .yr-opt-icon { background: var(--yr-warn-bg);     color: var(--yr-badge-gold); }
.yr-export-menu button[data-format="print"] .yr-opt-icon { background: var(--yr-danger-bg);   color: var(--yr-danger); }
.yr-export-menu .yr-opt-text { flex: 1; min-width: 0; }
.yr-export-menu .yr-opt-name {
  font-weight: 600;
  display: block;
  color: var(--yr-text-primary);
  font-size: 13px;
}
.yr-export-menu .yr-opt-meta {
  font-size: 11.5px;
  color: var(--yr-text-muted);
  display: block;
  margin-top: 1px;
  font-weight: 400;
  line-height: 1.35;
}
.yr-export-menu .yr-menu-divider {
  height: 1px;
  background: var(--yr-card-border);
  margin: 6px 0;
}

/* Helper class — used by .yr-dd-menu and .yr-export-menu when closed */
.yr-dd-menu.is-hidden,
.yr-export-menu.is-hidden { display: none !important; }

/* Guard the kit's own dropdown component against page CSS that ships an
   unscoped `.yr-dd-menu { display: none }` for a DIFFERENT dropdown system
   (e.g. accommodations-modal.css's `.yr-dd`/`.open` component). Such a rule
   leaks onto these `.yr-dd-wrap` menus — which are revealed by toggling
   `.is-hidden`, not an `.open` class — and a plain `.yr-dd-menu { display:none }`
   (specificity 0,1,0) would otherwise beat the kit's display-less base rule, so
   the menu "opens" (is-hidden removed, chevron flips) but never paints. Asserting
   display here at `.yr-dd-wrap` scope (0,2,0) keeps these menus working no matter
   what a page loads. This belongs in the kit so every page that uses the filter
   dropdowns is covered without a per-page workaround. */
.yr-dd-wrap .yr-dd-menu { display: block; }
.yr-dd-wrap .yr-dd-menu.is-hidden { display: none; }

/* Persisted modal overlays — global safety hide. reset-password.js and
   delete-students.js relocate their `.ya-overlay` (run-once IIFEs) out to
   <body> so it survives the staff-v6 AjaxNav #main innerHTML swap. But the
   overlay's `display:none` base rule lives in add-student.css — PAGE CSS that
   AjaxNav RETIRES when you navigate away — so on the next page the orphaned
   overlay loses its hide rule and paints its raw, unsized contents (giant SVG
   icons at the bottom of the page). This rule lives in the always-loaded kit
   CSS, so a CLOSED overlay stays hidden on every page; the owning page's
   `.ya-overlay.is-open { display:flex }` still wins while the modal is open.
   (.ym-overlay — the accommodations modal — needs no equivalent: yeti-modal.css
   is shell-loaded and never retired.) */
.ya-overlay:not(.is-open) { display: none !important; }


/* ═══════════════════════════════════════════════════════════════
   §31 — CHARTS (kit v1.5.0) — YR.charts SVG builders
   Scoped under .yr-scope so it never leaks outside a report page.
   ═══════════════════════════════════════════════════════════════ */
.yr-scope .yr-figure { margin: 0; }
.yr-scope .yr-fig-title { font-size: 13px; font-weight: 600; color: var(--yr-text-primary, #2b3440); margin-bottom: 8px; }
.yr-scope .yr-figure-empty .yr-chart-empty,
.yr-scope .yr-chart-empty { display: flex; align-items: center; justify-content: center; min-height: 90px; color: #8a97a5; font-size: 13px; }
.yr-scope .yr-chart-svg { width: 100%; height: auto; overflow: visible; }
.yr-scope .yr-spark { display: inline-block; vertical-align: middle; }

/* Horizontal bars */
.yr-scope .yr-hbar { display: flex; flex-direction: column; gap: 6px; }
.yr-scope .yr-hbar-row { display: grid; grid-template-columns: 130px 1fr 52px; align-items: center; gap: 8px; font-size: 12px; }
.yr-scope .yr-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--yr-text-primary, #2b3440); }
.yr-scope .yr-hbar-track { background: #eef2f6; border-radius: 5px; height: 14px; overflow: hidden; }
.yr-scope .yr-hbar-fill { display: block; height: 100%; border-radius: 5px; min-width: 2px; }
.yr-scope .yr-hbar-val { text-align: right; color: #56616d; font-variant-numeric: tabular-nums; }
.yr-scope .yr-hbar-note { margin-top: 8px; font-size: 11px; color: #8a97a5; }

/* Heatmap */
.yr-scope .yr-hm { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.yr-scope .yr-hm-row { display: grid; grid-template-columns: 120px repeat(14, 1fr); gap: 3px; align-items: center; }
.yr-scope .yr-hm-head .yr-hm-col { font-size: 9px; color: #8a97a5; text-align: center; }
.yr-scope .yr-hm-label { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--yr-text-primary, #2b3440); }
.yr-scope .yr-hm-cell { height: 16px; border-radius: 3px; }

/* Scatter */
.yr-scope .yr-scatter-pt { transition: r .1s ease; }
.yr-scope .yr-scatter-pt:hover { r: 6; }

/* ═══════════════════════════════════════════════════════════════
   §32 — .yr-col-sticky (sticky first column, distinct from the
   .yr-sticky-floater header clone)
   ═══════════════════════════════════════════════════════════════ */
.yr-scope .yr-col-sticky { position: sticky; left: 0; z-index: 2; background: var(--yr-card-bg, #fff); }
.yr-scope thead .yr-col-sticky { z-index: 3; }

/* ============================================================================
   §33 — NATIVE CHECKBOX PRIMITIVE (kit v1.6.1)
   Native semantics stay intact; the surrounding label owns the touch target.
   ============================================================================ */
.yr-scope input.yr-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  border: 2px solid var(--yr-text-muted, #657788);
  border-radius: 4px;
  background: var(--yr-card-bg, #fff);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}
.yr-scope input.yr-check::before {
  content: '';
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
}
.yr-scope input.yr-check:hover { border-color: var(--yr-blue-dark, #08658c); }
.yr-scope input.yr-check:checked,
.yr-scope input.yr-check:indeterminate { background: var(--yr-blue-dark, #08658c); border-color: var(--yr-blue-dark, #08658c); }
.yr-scope input.yr-check:checked::before { transform: rotate(-45deg) scale(1); }
.yr-scope input.yr-check:indeterminate::before { width: 8px; height: 0; border-left: 0; border-bottom: 2px solid #fff; transform: scale(1); }
.yr-scope input.yr-check:focus-visible { outline: 3px solid var(--yr-focus-ring, #0876a5); outline-offset: 2px; }
.yr-scope input.yr-check:disabled { cursor: not-allowed; opacity: .55; }
@media (prefers-reduced-motion: reduce) { .yr-scope input.yr-check { transition: none; } }
@media (forced-colors: active) {
  .yr-scope input.yr-check { appearance: auto; -webkit-appearance: checkbox; forced-color-adjust: auto; }
  .yr-scope input.yr-check::before { content: none; }
}
